vimrc: fix indent

This commit is contained in:
Mathieu Maret 2018-07-11 17:33:17 +02:00
parent de271744bc
commit f4e3bce321
1 changed files with 34 additions and 32 deletions

66
.vimrc
View File

@ -40,12 +40,12 @@ set nocompatible
" Switch syntax highlighting on when the terminal has colors or when using the " Switch syntax highlighting on when the terminal has colors or when using the
" GUI (which always has colors). " GUI (which always has colors).
if &t_Co > 2 || has("gui_running") if &t_Co > 2 || has("gui_running")
" Revert with ":syntax off". " Revert with ":syntax off".
syntax on syntax on
" I like highlighting strings inside C comments. " I like highlighting strings inside C comments.
" Revert with ":unlet c_comment_strings". " Revert with ":unlet c_comment_strings".
let c_comment_strings=1 let c_comment_strings=1
endif endif
filetype plugin on filetype plugin on
@ -62,15 +62,15 @@ set autowrite
" Put these in an autocmd group, so that you can revert them with: " Put these in an autocmd group, so that you can revert them with:
" ":augroup vimStartup | au! | augroup END" " ":augroup vimStartup | au! | augroup END"
augroup vimStartup augroup vimStartup
au! au!
" When editing a file, always jump to the last known cursor position. " When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler " Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim). " (happens when dropping a file on gvim).
autocmd BufReadPost * autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") | \ if line("'\"") >= 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" | \ exe "normal! g`\"" |
\ endif \ endif
augroup END augroup END
@ -307,7 +307,7 @@ if bufwinnr(1)
endif endif
" open automatically quickfix window " open automatically quickfix window
if has("autocmd") if has("autocmd")
autocmd QuickFixCmdPost * cw autocmd QuickFixCmdPost * cw
endif endif
" open a file in the same directory as the current file with F2 and split with shift+F2 " open a file in the same directory as the current file with F2 and split with shift+F2
@ -325,11 +325,11 @@ imap <S-F1> <Esc><S-F1>
" show contextual help with F1 " show contextual help with F1
function Help() function Help()
try try
if exists('b:current_syntax') && b:current_syntax == "python" if exists('b:current_syntax') && b:current_syntax == "python"
:call ShowPyDoc(expand("<cword>"), 1) :call ShowPyDoc(expand("<cword>"), 1)
else else
execute "Man " . expand("<cword>") execute "Man " . expand("<cword>")
endif endif
catch /:E149:/ catch /:E149:/
execute "help " . expand("<cword>") execute "help " . expand("<cword>")
endtry endtry
@ -353,7 +353,7 @@ imap <M-F10> <ESC><M-F10>a
" show git diff when committing " show git diff when committing
let g:git_diff_spawn_mode = 1 let g:git_diff_spawn_mode = 1
if has("autocmd") if has("autocmd")
autocmd BufRead,BufNewFile COMMIT_EDITMSG setf git autocmd BufRead,BufNewFile COMMIT_EDITMSG setf git
endif endif
" zf#j creates a fold from the cursor down # lines. " zf#j creates a fold from the cursor down # lines.
@ -412,6 +412,8 @@ else
colorscheme mycolor colorscheme mycolor
endif endif
cnoremap sudow w !sudo tee % >/dev/null cnoremap sudow w !sudo tee % >/dev/null
" Allow saving of files as sudo when I forgot to start vim using sudo.
cmap w!! w !sudo tee > /dev/null %
""""""""""" """""""""""
" NerdTree " NerdTree
@ -436,11 +438,11 @@ nnoremap <silent> <leader>k :SetLinuxFormatting<cr><cr>
"""""""""" """"""""""
if filereadable(expand('~/.vimrc.local')) if filereadable(expand('~/.vimrc.local'))
" Plugins list and settings should be loaded " Plugins list and settings should be loaded
" only once. Load local_settings block " only once. Load local_settings block
let g:local_plugins = 0 let g:local_plugins = 0
let g:local_settings = 1 let g:local_settings = 1
source ~/.vimrc.local source ~/.vimrc.local
endif endif
"""""""""" """"""""""
@ -460,13 +462,13 @@ nnoremap <silent> <leader>a :LinuxCodingStyle<cr>
"Or start vim with -V[VERBOSENUMBER][FILE] "Or start vim with -V[VERBOSENUMBER][FILE]
function! ToggleVerbose() function! ToggleVerbose()
if !&verbose if !&verbose
set verbosefile=~/.log/vim/verbose.log set verbosefile=~/.log/vim/verbose.log
set verbose=15 set verbose=15
else else
set verbose=0 set verbose=0
set verbosefile= set verbosefile=
endif endif
endfunction endfunction
""""""""" """""""""