LoginSignup
0
0

More than 5 years have passed since last update.

gst-indent を使ってコード整形する

Posted at

gst-indent って?

gnu indentのラッパーで、GStreamerのコーディングスタイルにコードを整形してくれるというもの。

コードは gstreamer/common にあります。

gst-indent の使い方

引数にファイルを渡す。それだけ。

$ path/to/gst-indent hogehoge.c
$ ls
hogehoge.c hogehoge.C~

~ チルダがついている方がもとのファイルです。

gst-indent を vim から使う

また、vim の equalprg に gst-indent をセットしてあげれば、gg=G で整形することができます。

ezgif.com-video-to-gif.gif

setlocal を叩くのが面倒であれば vimrcinit.vim に以下を追記してもいいかもしれません。

au FileType c setlocal equalprg=~/src/gst/common/gst-indent\ 2>\ /dev/null
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0