Update vimrc

Author Mitja Felicijan <mitja.felicijan@gmail.com> 2024-06-20 02:45:09 +0200
Committer Mitja Felicijan <mitja.felicijan@gmail.com> 2024-06-20 02:45:09 +0200
Commit 382295fe653fa9937c4cd66350f718ee072bb93d (patch)
-rw-r--r-- vimrc 6
1 files changed, 3 insertions, 3 deletions
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