diff options
Diffstat (limited to 'vim')
-rw-r--r-- | vim/after/ftplugin/gitcommit.vim | 2 | ||||
-rw-r--r-- | vim/after/ftplugin/markdown.vim | 10 | ||||
-rw-r--r-- | vim/after/ftplugin/text.vim | 10 | ||||
m--------- | vim/bundle/insert_cancel | 0 | ||||
-rw-r--r-- | vim/config/debian.vim | 21 | ||||
-rw-r--r-- | vim/vimrc | 3 |
6 files changed, 36 insertions, 10 deletions
diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim index 761ebc81..b7538c9c 100644 --- a/vim/after/ftplugin/gitcommit.vim +++ b/vim/after/ftplugin/gitcommit.vim @@ -14,6 +14,6 @@ let b:undo_ftplugin = b:undo_ftplugin " Make angle brackets behave like mail quotes setlocal comments+=n:> -setlocal formatoptions+=or +setlocal formatoptions+=cor let b:undo_ftplugin = b:undo_ftplugin \ . '|setlocal comments< formatoptions<' diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim index 29d13c71..7ec37c64 100644 --- a/vim/after/ftplugin/markdown.vim +++ b/vim/after/ftplugin/markdown.vim @@ -12,7 +12,9 @@ let b:did_ftplugin_after = 1 let b:undo_ftplugin = b:undo_ftplugin \ . '|unlet b:did_ftplugin_after' -" Spellcheck documents -setlocal spell -let b:undo_ftplugin = b:undo_ftplugin - \ . '|setlocal spell<' +" Spellcheck documents we're actually editing (not just viewing) +if !&readonly + setlocal spell + let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal spell<' +endif diff --git a/vim/after/ftplugin/text.vim b/vim/after/ftplugin/text.vim index cd35231e..06ca464a 100644 --- a/vim/after/ftplugin/text.vim +++ b/vim/after/ftplugin/text.vim @@ -12,7 +12,9 @@ let b:did_ftplugin_after = 1 let b:undo_ftplugin = b:undo_ftplugin \ . '|unlet b:did_ftplugin_after' -" Spellcheck documents -setlocal spell -let b:undo_ftplugin = b:undo_ftplugin - \ . '|setlocal spell<' +" Spellcheck documents we're actually editing (not just viewing) +if !&readonly + setlocal spell + let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal spell<' +endif diff --git a/vim/bundle/insert_cancel b/vim/bundle/insert_cancel -Subproject ec0551228a91752d2be5f9d771e2cb5a624e6ba +Subproject a7aa9d44a7dc4f604c68a1b51eb66d6c4e2789a diff --git a/vim/config/debian.vim b/vim/config/debian.vim new file mode 100644 index 00000000..e50fc260 --- /dev/null +++ b/vim/config/debian.vim @@ -0,0 +1,21 @@ +" Revert settings that Debian might have touched +if $VIM ==# '/usr/share/vim' && filereadable('/etc/debian_version') + + " Set options back to appropriate defaults + set history& + set suffixes& + if has('cmdline_info') + set ruler& + endif + if has('printoptions') + set printoptions& + endif + + " Restore terminal settings to reflect terminfo + set t_Co& t_Sf& t_Sb& + + " Remove addons directories from 'runtimepath' if present + silent! set runtimepath-=/var/lib/vim/addons + silent! set runtimepath-=/var/lib/vim/addons/after + +endif @@ -165,7 +165,8 @@ if has('windows') endif " Stack normal/visual/select Ctrl-L to clear search highlight -noremap <silent> <C-L> :<C-U>nohlsearch<CR><C-L> +nnoremap <silent> <C-L> :<C-U>nohlsearch<CR><C-L> +vnoremap <silent> <C-L> :<C-U>nohlsearch<CR>gv<C-L> " Stack insert Ctrl-C to undo the escaped insert operation " Default to not-quite-correct vim-tiny-compatible map if no plugin |