aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin
diff options
context:
space:
mode:
Diffstat (limited to 'vim/after/ftplugin')
-rw-r--r--vim/after/ftplugin/c.vim11
-rw-r--r--vim/after/ftplugin/cpp.vim18
-rw-r--r--vim/after/ftplugin/diff.vim9
-rw-r--r--vim/after/ftplugin/gitcommit.vim12
-rw-r--r--vim/after/ftplugin/help.vim5
-rw-r--r--vim/after/ftplugin/html.vim7
-rw-r--r--vim/after/ftplugin/mail.vim16
-rw-r--r--vim/after/ftplugin/make.vim5
-rw-r--r--vim/after/ftplugin/markdown.vim9
-rw-r--r--vim/after/ftplugin/perl.vim5
-rw-r--r--vim/after/ftplugin/php.vim11
-rw-r--r--vim/after/ftplugin/sh.vim16
-rw-r--r--vim/after/ftplugin/text.vim5
-rw-r--r--vim/after/ftplugin/vim.vim22
-rw-r--r--vim/after/ftplugin/zsh.vim5
15 files changed, 20 insertions, 136 deletions
diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim
index da34d269..ccc5b170 100644
--- a/vim/after/ftplugin/c.vim
+++ b/vim/after/ftplugin/c.vim
@@ -1,18 +1,13 @@
-" Extra configuration for C files
-if &filetype !=# 'c' || v:version < 700
- finish
-endif
-
" Include macros in completion
setlocal complete+=d
-let b:undo_ftplugin .= '|setlocal complete<'
" Set include pattern
setlocal include=^\\s*#\\s*include
-let b:undo_ftplugin .= '|setlocal include<'
" Include headers on UNIX
if has('unix')
setlocal path+=/usr/include
- let b:undo_ftplugin .= '|setlocal path<'
endif
+
+" Undo all of the above
+let b:undo_ftplugin .= '|setlocal complete< include< path<'
diff --git a/vim/after/ftplugin/cpp.vim b/vim/after/ftplugin/cpp.vim
deleted file mode 100644
index 4042fb84..00000000
--- a/vim/after/ftplugin/cpp.vim
+++ /dev/null
@@ -1,18 +0,0 @@
-" Extra configuration for C++ files
-if &filetype !=# 'cpp' || v:version < 700
- finish
-endif
-
-" Include macros in completion
-setlocal complete+=d
-let b:undo_ftplugin .= '|setlocal complete<'
-
-" Set include pattern
-setlocal include=^\\s*#\\s*include
-let b:undo_ftplugin .= '|setlocal include<'
-
-" Include headers on UNIX
-if has('unix')
- setlocal path+=/usr/include
- let b:undo_ftplugin .= '|setlocal path<'
-endif
diff --git a/vim/after/ftplugin/diff.vim b/vim/after/ftplugin/diff.vim
index a52b3fdd..123f0d0a 100644
--- a/vim/after/ftplugin/diff.vim
+++ b/vim/after/ftplugin/diff.vim
@@ -1,8 +1,3 @@
-" Extra configuration for diffs
-if &filetype !=# 'diff' || v:version < 700 || &compatible
- finish
-endif
-
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_diff_maps')
finish
@@ -28,13 +23,11 @@ let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>['
\ . '|xunmap <buffer> <LocalLeader>['
\ . '|xunmap <buffer> <LocalLeader>]'
-" Set mappings
+" Set mappings for diff pruning plugin
nmap <buffer> <LocalLeader>p
\ <Plug>(DiffPrune)
xmap <buffer> <LocalLeader>p
\ <Plug>(DiffPrune)
-nmap <buffer> <LocalLeader>pp
- \ <Plug>(DiffPrune)_
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>p'
\ . '|xunmap <buffer> <LocalLeader>p'
\ . '|nunmap <buffer> <LocalLeader>pp'
diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim
index 2dc5fa37..1a4c1b1b 100644
--- a/vim/after/ftplugin/gitcommit.vim
+++ b/vim/after/ftplugin/gitcommit.vim
@@ -1,8 +1,3 @@
-" Extra configuration for Git commit messages
-if &filetype !=# 'gitcommit' || v:version < 700
- finish
-endif
-
" Make angle brackets behave like mail quotes
setlocal comments+=n:>
setlocal formatoptions+=coqr
@@ -14,8 +9,9 @@ if has('autocmd') && exists('+cursorcolumn')
autocmd CursorMoved,CursorMovedI <buffer>
\ let &l:colorcolumn = gitcommit#CursorColumn()
augroup END
- let b:undo_ftplugin .= '|autocmd! gitcommit'
+ let b:undo_ftplugin .= '|execute ''autocmd! gitcommit'''
\ . '|augroup! gitcommit'
+ \ . '|setlocal colorcolumn<'
endif
" Stop here if the user doesn't want ftplugin mappings
@@ -26,8 +22,6 @@ endif
" Quote operator
nnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
-nnoremap <buffer> <expr> <LocalLeader>qq
- \ quote#Quote().'_'
xnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
@@ -37,8 +31,6 @@ let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
" Quote operator with reformatting
nnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
-nnoremap <buffer> <expr> <LocalLeader>QQ
- \ quote#QuoteReformat().'_'
xnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
diff --git a/vim/after/ftplugin/help.vim b/vim/after/ftplugin/help.vim
index 71ad3a8d..ae032344 100644
--- a/vim/after/ftplugin/help.vim
+++ b/vim/after/ftplugin/help.vim
@@ -1,8 +1,3 @@
-" Extra configuration for Vim help files
-if &filetype !=# 'help' || v:version < 700
- finish
-endif
-
" This variable had the wrong name before Vim 7.1
if v:version == 700 && exists('b:undo_plugin')
let b:undo_ftplugin = b:undo_plugin
diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim
index 759d06bf..b5c387fb 100644
--- a/vim/after/ftplugin/html.vim
+++ b/vim/after/ftplugin/html.vim
@@ -1,5 +1,5 @@
-" Extra configuration for HTML files
-if &filetype !=# 'html' || v:version < 700 || &compatible
+" Don't load if the buffer is not actually HTML (e.g. Markdown)
+if &filetype !=# 'html'
finish
endif
@@ -16,7 +16,8 @@ augroup html_timestamp
\| call html#TimestampUpdate()
\|endif
augroup END
-let b:undo_ftplugin .= '|autocmd! html_timestamp BufWritePre <buffer>'
+let b:undo_ftplugin .= '|execute ''autocmd! html_timestamp'''
+ \ . '|augroup! html_timestamp'
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_html_maps')
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index 688ca6eb..74ec1699 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -1,8 +1,3 @@
-" Extra configuration for mail messages
-if &filetype !=# 'mail' || &compatible || v:version < 700
- finish
-endif
-
" If something hasn't already moved the cursor, we'll move to an optimal point
" to start writing
if line('.') == 1 && col('.') == 1
@@ -41,6 +36,13 @@ if exists('g:no_plugin_maps') || exists('g:no_mail_maps')
finish
endif
+" Clear away the quoting maps that the stock mail.vim sets; they work fine,
+" but we have nicer ones to define shortly
+nunmap <buffer> <LocalLeader>q
+vunmap <buffer> <LocalLeader>q
+nunmap <buffer> <Plug>MailQuote
+vunmap <buffer> <Plug>MailQuote
+
" Flag messages as important/unimportant
nnoremap <buffer> <LocalLeader>h
\ :<C-U>call mail#FlagImportant()<CR>
@@ -52,8 +54,6 @@ let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>l'
" Quote operator
nnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
-nnoremap <buffer> <expr> <LocalLeader>qq
- \ quote#Quote().'_'
xnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
@@ -63,8 +63,6 @@ let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
" Quote operator with reformatting
nnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
-nnoremap <buffer> <expr> <LocalLeader>QQ
- \ quote#QuoteReformat().'_'
xnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
diff --git a/vim/after/ftplugin/make.vim b/vim/after/ftplugin/make.vim
index 3018e11b..353a0bbf 100644
--- a/vim/after/ftplugin/make.vim
+++ b/vim/after/ftplugin/make.vim
@@ -1,8 +1,3 @@
-" Extra configuration for Makefiles
-if &filetype !=# 'make' || v:version < 700
- finish
-endif
-
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_make_maps')
finish
diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim
index cd8873b9..f129deba 100644
--- a/vim/after/ftplugin/markdown.vim
+++ b/vim/after/ftplugin/markdown.vim
@@ -1,8 +1,3 @@
-" Extra configuration for Markdown documents
-if &filetype !=# 'markdown' || v:version < 700
- finish
-endif
-
" Spellchecking features
if has('spell')
@@ -29,8 +24,6 @@ endif
" Quote operator
nnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
-nnoremap <buffer> <expr> <LocalLeader>qq
- \ quote#Quote().'_'
xnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
@@ -40,8 +33,6 @@ let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
" Quote operator with reformatting
nnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
-nnoremap <buffer> <expr> <LocalLeader>QQ
- \ quote#QuoteReformat().'_'
xnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
diff --git a/vim/after/ftplugin/perl.vim b/vim/after/ftplugin/perl.vim
index ee8da2a7..5dd2b7bb 100644
--- a/vim/after/ftplugin/perl.vim
+++ b/vim/after/ftplugin/perl.vim
@@ -1,8 +1,3 @@
-" Extra configuration for Perl filetypes
-if &filetype !=# 'perl' || v:version < 700 || &compatible
- finish
-endif
-
" Use Perl itself for checking and Perl::Tidy for tidying
compiler perl
setlocal equalprg=perltidy
diff --git a/vim/after/ftplugin/php.vim b/vim/after/ftplugin/php.vim
index 9b7c2bb0..688166ba 100644
--- a/vim/after/ftplugin/php.vim
+++ b/vim/after/ftplugin/php.vim
@@ -1,8 +1,3 @@
-" Extra configuration for PHP scripts
-if &filetype !=# 'php' || v:version < 700 || &compatible
- finish
-endif
-
" Use PHP itself for syntax checking
compiler php
let b:undo_ftplugin .= '|unlet b:current_compiler'
@@ -21,9 +16,3 @@ let b:undo_ftplugin .= '|setlocal keywordprg<'
if exists('g:no_plugin_maps') || exists('g:no_php_maps')
finish
endif
-
-" Get rid of the core ftplugin's square-bracket maps on unload
-let b:undo_ftplugin .= '|nunmap <buffer> [['
- \ . '|ounmap <buffer> [['
- \ . '|nunmap <buffer> ]]'
- \ . '|ounmap <buffer> ]]'
diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim
index fdc42ccc..6ee016a5 100644
--- a/vim/after/ftplugin/sh.vim
+++ b/vim/after/ftplugin/sh.vim
@@ -1,8 +1,3 @@
-" Extra configuration for shell script
-if &filetype !=# 'sh' || v:version < 700 || &compatible
- finish
-endif
-
" Set comment formats
setlocal comments=:#
setlocal formatoptions+=or
@@ -34,14 +29,9 @@ if exists('b:is_posix')
endif
" Queue up undo commands to clear the shell language flags that we set for
-" this buffer during filetype detection in filetype.vim
-if exists('b:is_bash')
- let b:undo_ftplugin .= '|unlet b:is_bash'
-elseif exists('b:is_kornshell')
- let b:undo_ftplugin .= '|unlet b:is_kornshell'
-elseif exists('b:is_posix')
- let b:undo_ftplugin .= '|unlet b:is_posix'
-endif
+" this buffer during filetype detection in filetype.vim, or that the stock
+" syntax highlighting chose for us
+let b:undo_ftplugin .= '|unlet! b:is_bash b:is_kornshell b:is_posix'
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_sh_maps')
diff --git a/vim/after/ftplugin/text.vim b/vim/after/ftplugin/text.vim
index 8341f72d..cda2891c 100644
--- a/vim/after/ftplugin/text.vim
+++ b/vim/after/ftplugin/text.vim
@@ -1,8 +1,3 @@
-" Extra configuration for text files
-if &filetype !=# 'text' || v:version < 700
- finish
-endif
-
" Spellcheck documents we're actually editing (not just viewing)
if has('spell') && &modifiable && !&readonly
setlocal spell
diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim
index 2fc5bd78..a7a69993 100644
--- a/vim/after/ftplugin/vim.vim
+++ b/vim/after/ftplugin/vim.vim
@@ -1,8 +1,3 @@
-" Extra configuration for Vim scripts
-if &filetype !=# 'vim' || v:version < 700 || &compatible
- finish
-endif
-
" Use Vint as a syntax checker
if bufname('%') !=# 'command-line'
compiler vint
@@ -19,20 +14,3 @@ endif
nnoremap <buffer> <LocalLeader>K
\ :<C-U>helpgrep <cword><CR>
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>K'
-
-" Get rid of the core ftplugin's square-bracket maps on unload
-" 8.1.273 updated the runtime files to include a fix for this
-if v:version < 801 || v:version == 801 && !has('patch273')
- let b:undo_ftplugin .= '|nunmap <buffer> [['
- \ . '|vunmap <buffer> [['
- \ . '|nunmap <buffer> ]]'
- \ . '|vunmap <buffer> ]]'
- \ . '|nunmap <buffer> []'
- \ . '|vunmap <buffer> []'
- \ . '|nunmap <buffer> ]['
- \ . '|vunmap <buffer> ]['
- \ . '|nunmap <buffer> ]"'
- \ . '|vunmap <buffer> ]"'
- \ . '|nunmap <buffer> ["'
- \ . '|vunmap <buffer> ["'
-endif
diff --git a/vim/after/ftplugin/zsh.vim b/vim/after/ftplugin/zsh.vim
index 49736401..5aa2600a 100644
--- a/vim/after/ftplugin/zsh.vim
+++ b/vim/after/ftplugin/zsh.vim
@@ -1,8 +1,3 @@
-" Extra configuration for Z shell scripts
-if &filetype !=# 'zsh' || v:version < 700 || &compatible
- finish
-endif
-
" Use Z shell itself as a syntax checker
compiler zsh
let b:undo_ftplugin .= '|unlet b:current_compiler'