From f4e3bce32128e6460bfa937ecd76cfcad493725d Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 11 Jul 2018 17:33:17 +0200 Subject: [PATCH] vimrc: fix indent --- .vimrc | 66 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/.vimrc b/.vimrc index ca19fbb..0b30fe2 100644 --- a/.vimrc +++ b/.vimrc @@ -40,12 +40,12 @@ set nocompatible " Switch syntax highlighting on when the terminal has colors or when using the " GUI (which always has colors). if &t_Co > 2 || has("gui_running") - " Revert with ":syntax off". - syntax on + " Revert with ":syntax off". + syntax on - " I like highlighting strings inside C comments. - " Revert with ":unlet c_comment_strings". - let c_comment_strings=1 + " I like highlighting strings inside C comments. + " Revert with ":unlet c_comment_strings". + let c_comment_strings=1 endif filetype plugin on @@ -62,15 +62,15 @@ set autowrite " Put these in an autocmd group, so that you can revert them with: " ":augroup vimStartup | au! | augroup END" augroup vimStartup - au! + au! - " 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 - " (happens when dropping a file on gvim). - autocmd BufReadPost * - \ if line("'\"") >= 1 && line("'\"") <= line("$") | - \ exe "normal! g`\"" | - \ endif + " 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 + " (happens when dropping a file on gvim). + autocmd BufReadPost * + \ if line("'\"") >= 1 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif augroup END @@ -307,7 +307,7 @@ if bufwinnr(1) endif " open automatically quickfix window if has("autocmd") - autocmd QuickFixCmdPost * cw + autocmd QuickFixCmdPost * cw endif " open a file in the same directory as the current file with F2 and split with shift+F2 @@ -325,11 +325,11 @@ imap " show contextual help with F1 function Help() try - if exists('b:current_syntax') && b:current_syntax == "python" - :call ShowPyDoc(expand(""), 1) - else - execute "Man " . expand("") - endif + if exists('b:current_syntax') && b:current_syntax == "python" + :call ShowPyDoc(expand(""), 1) + else + execute "Man " . expand("") + endif catch /:E149:/ execute "help " . expand("") endtry @@ -353,7 +353,7 @@ imap a " show git diff when committing let g:git_diff_spawn_mode = 1 if has("autocmd") - autocmd BufRead,BufNewFile COMMIT_EDITMSG setf git + autocmd BufRead,BufNewFile COMMIT_EDITMSG setf git endif " zf#j creates a fold from the cursor down # lines. @@ -412,6 +412,8 @@ else colorscheme mycolor endif 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 @@ -436,11 +438,11 @@ nnoremap k :SetLinuxFormatting """""""""" if filereadable(expand('~/.vimrc.local')) - " Plugins list and settings should be loaded - " only once. Load local_settings block - let g:local_plugins = 0 - let g:local_settings = 1 - source ~/.vimrc.local + " Plugins list and settings should be loaded + " only once. Load local_settings block + let g:local_plugins = 0 + let g:local_settings = 1 + source ~/.vimrc.local endif """""""""" @@ -460,13 +462,13 @@ nnoremap a :LinuxCodingStyle "Or start vim with -V[VERBOSENUMBER][FILE] function! ToggleVerbose() - if !&verbose - set verbosefile=~/.log/vim/verbose.log - set verbose=15 - else - set verbose=0 - set verbosefile= - endif + if !&verbose + set verbosefile=~/.log/vim/verbose.log + set verbose=15 + else + set verbose=0 + set verbosefile= + endif endfunction """""""""