|
diff --git a/vimrc b/vimrc
|
| ... |
| 2 |
set number relativenumber autoindent |
2 |
set number relativenumber autoindent |
| 3 |
set ignorecase smartcase incsearch |
3 |
set ignorecase smartcase incsearch |
| 4 |
set hidden nowrap nobackup noswapfile autoread |
4 |
set hidden nowrap nobackup noswapfile autoread |
| 5 |
set wildmenu laststatus=2 |
5 |
set wildmenu wildmode=longest,list,full laststatus=2 |
| 6 |
set encoding=utf8 spelllang=en_us |
6 |
set encoding=utf8 spelllang=en_us |
| 7 |
set backspace=2 scrolloff=4 |
7 |
set backspace=2 scrolloff=4 |
| 8 |
set shiftwidth=4 tabstop=4 |
8 |
set shiftwidth=4 tabstop=4 |
| ... |
| 37 |
|
37 |
|
| 38 |
" Function to auto format source code files. |
38 |
" Function to auto format source code files. |
| 39 |
function! Format() |
39 |
function! Format() |
| 40 |
if &filetype == 'c' | call system('clang-format -i '.expand('%')) | edit! | endif |
40 |
if &filetype == 'c' | write | call system('clang-format -i '.expand('%')) | edit! | endif |
| 41 |
if &filetype == 'go' | call system('go fmt '.expand('%')) | edit! | endif |
41 |
if &filetype == 'go' | write | call system('go fmt '.expand('%')) | edit! | endif |
| 42 |
endfunction |
42 |
endfunction |
| 43 |
command! Format call Format() |
43 |
command! Format call Format() |
| 44 |
|
44 |
|