https://github.com/crosbymichael/vim-cfmt
Vim plugin for automatic formatting of C source code
https://github.com/crosbymichael/vim-cfmt
Last synced: 3 months ago
JSON representation
Vim plugin for automatic formatting of C source code
- Host: GitHub
- URL: https://github.com/crosbymichael/vim-cfmt
- Owner: crosbymichael
- Created: 2014-11-24T03:44:51.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-26T03:34:43.000Z (over 10 years ago)
- Last Synced: 2024-12-30T01:19:52.904Z (5 months ago)
- Language: VimL
- Size: 113 KB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-cfmt
A vim plugin using
[gnu indent](https://www.gnu.org/software/indent/manual/indent.html)
to auto format C source code.You will need to install `indent` on your system to use this plugin.
If you are on a debian based system you can use apt to install it.
```bash
apt-get install indent
```Install using Pathogen or Vundle then set this in your `vimrc`:
```vimrc
autocmd BufWritePre *.c,*.h Cfmt
```You can configure the style of formating by using the `g:cfmt_style`
variable.```vimrc
let g:cfmt_style = '-linux'
let g:cfmt_style = '-kr'
let g:cfmt_style = '-gnu'
```### License
Distributed under the same terms as Vim itself. See `:help license`.