aboutsummaryrefslogtreecommitdiff
path: root/vim/after
diff options
context:
space:
mode:
Diffstat (limited to 'vim/after')
-rw-r--r--vim/after/ftplugin/c.vim5
-rw-r--r--vim/after/ftplugin/cpp.vim5
-rw-r--r--vim/after/ftplugin/gitcommit.vim2
-rw-r--r--vim/after/ftplugin/html.vim6
-rw-r--r--vim/after/ftplugin/sh.vim10
-rw-r--r--vim/after/ftplugin/vim.vim22
-rw-r--r--vim/after/indent/awk.vim7
-rw-r--r--vim/after/indent/perl.vim9
8 files changed, 47 insertions, 19 deletions
diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim
index 9ac59733..da34d269 100644
--- a/vim/after/ftplugin/c.vim
+++ b/vim/after/ftplugin/c.vim
@@ -5,13 +5,14 @@ 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
-
-let b:undo_ftplugin .= '|setlocal complete< include< path<'
diff --git a/vim/after/ftplugin/cpp.vim b/vim/after/ftplugin/cpp.vim
index b5596613..4042fb84 100644
--- a/vim/after/ftplugin/cpp.vim
+++ b/vim/after/ftplugin/cpp.vim
@@ -5,13 +5,14 @@ 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
-
-let b:undo_ftplugin .= '|setlocal complete< include< path<'
diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim
index c9b14b6b..2dc5fa37 100644
--- a/vim/after/ftplugin/gitcommit.vim
+++ b/vim/after/ftplugin/gitcommit.vim
@@ -12,7 +12,7 @@ let b:undo_ftplugin .= '|setlocal comments< formatoptions<'
if has('autocmd') && exists('+cursorcolumn')
augroup gitcommit
autocmd CursorMoved,CursorMovedI <buffer>
- \ let &l:colorcolumn = gitcommit#CursorColumn()
+ \ let &l:colorcolumn = gitcommit#CursorColumn()
augroup END
let b:undo_ftplugin .= '|autocmd! gitcommit'
\ . '|augroup! gitcommit'
diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim
index dc429221..759d06bf 100644
--- a/vim/after/ftplugin/html.vim
+++ b/vim/after/ftplugin/html.vim
@@ -12,9 +12,9 @@ let b:undo_ftplugin .= '|unlet b:current_compiler'
" Set up hooks for timestamp updating
augroup html_timestamp
autocmd BufWritePre <buffer>
- \ if exists('b:html_timestamp_check')
- \| call html#TimestampUpdate()
- \|endif
+ \ if exists('b:html_timestamp_check')
+ \| call html#TimestampUpdate()
+ \|endif
augroup END
let b:undo_ftplugin .= '|autocmd! html_timestamp BufWritePre <buffer>'
diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim
index 766994b7..fdc42ccc 100644
--- a/vim/after/ftplugin/sh.vim
+++ b/vim/after/ftplugin/sh.vim
@@ -33,6 +33,16 @@ if exists('b:is_posix')
let g:is_posix = 1
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
+
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_sh_maps')
finish
diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim
index 46182627..2fc5bd78 100644
--- a/vim/after/ftplugin/vim.vim
+++ b/vim/after/ftplugin/vim.vim
@@ -24,15 +24,15 @@ let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>K'
" 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> ["'
+ \ . '|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/indent/awk.vim b/vim/after/indent/awk.vim
new file mode 100644
index 00000000..fc848d2a
--- /dev/null
+++ b/vim/after/indent/awk.vim
@@ -0,0 +1,7 @@
+" The stock AWK indenting is decent, but doesn't include an undo variable;
+" this adds one, clearing away the sole global function too.
+if !exists('b:undo_indent')
+ let b:undo_indent = 'unlet! b:did_indent'
+ let b:undo_indent = b:undo_indent . '|setlocal indentexpr< indentkeys<'
+ let b:undo_indent = b:undo_indent . '|delfunction! GetAwkIndent'
+endif
diff --git a/vim/after/indent/perl.vim b/vim/after/indent/perl.vim
new file mode 100644
index 00000000..6f97d979
--- /dev/null
+++ b/vim/after/indent/perl.vim
@@ -0,0 +1,9 @@
+" The stock Perl indenting is decent, but doesn't include an undo variable;
+" this adds one
+if !exists('b:undo_indent')
+ let b:undo_indent = 'unlet! b:did_indent'
+ let b:undo_indent = b:undo_indent . '|setlocal indentexpr< indentkeys<'
+ let b:undo_indent = b:undo_indent . '|unlet! b:indent_use_syntax'
+ let b:undo_indent = b:undo_indent . '|unlet! b:match_skip'
+ let b:undo_indent = b:undo_indent . '|unlet! b:match_words'
+endif