aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/autocmd.txt2
-rw-r--r--runtime/doc/options.txt9
-rw-r--r--runtime/ftplugin/vim.vim26
3 files changed, 32 insertions, 5 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 045dd9a32a..bacd0e7cf1 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -4,7 +4,7 @@
VIM REFERENCE MANUAL by Bram Moolenaar
-Automatic commands *autocmd* *autocommand* *autocommand*
+Automatic commands *autocmd* *autocommand*
For a basic explanation, see section |40.3| in the user manual.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index e107de52cd..2c1d71e96d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -675,7 +675,9 @@ A jump table for the options with a short description can be found at |Q_op|.
global or local to buffer |global-local|
When a file has been detected to have been changed outside of Vim and
it has not been changed inside of Vim, automatically read it again.
- When the file has been deleted this is not done. |timestamp|
+ When the file has been deleted this is not done, so you have the text
+ from before it was deleted. When it appears again then it is read.
+ |timestamp|
If this option has a local value, use this command to switch back to
using the global value: >
:set autoread<
@@ -3809,7 +3811,10 @@ A jump table for the options with a short description can be found at |Q_op|.
Running into the limit often means that the pattern is very
inefficient or too complex. This may already happen with the pattern
"\(.\)*" on a very long line. ".*" works much better.
- Vim may run out of memory before hitting the 'maxmempattern' limit.
+ Might also happen on redraw, when syntax rules try to match a complex
+ text structure.
+ Vim may run out of memory before hitting the 'maxmempattern' limit, in
+ which case you get an "Out of memory" error instead.
*'menuitems'* *'mis'*
'menuitems' 'mis' number (default 25)
diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
index 59ea349710..da27e35faf 100644
--- a/runtime/ftplugin/vim.vim
+++ b/runtime/ftplugin/vim.vim
@@ -14,8 +14,28 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo-=C
-let b:undo_ftplugin = "setl fo< isk< com< tw< commentstring< keywordprg<"
- \ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
+if !exists('*VimFtpluginUndo')
+ func VimFtpluginUndo()
+ setl fo< isk< com< tw< commentstring< keywordprg<
+ if exists(b:did_add_maps)
+ silent! nunmap <buffer> [['
+ silent! vunmap <buffer> [['
+ silent! nunmap <buffer> ]]'
+ silent! vunmap <buffer> ]]'
+ silent! nunmap <buffer> []'
+ silent! vunmap <buffer> []'
+ silent! nunmap <buffer> ]['
+ silent! vunmap <buffer> ]['
+ silent! nunmap <buffer> ]"'
+ silent! vunmap <buffer> ]"'
+ silent! nunmap <buffer> ["'
+ silent! vunmap <buffer> ["'
+ endif
+ unlet! b:match_ignorecase b:match_words b:match_skip b:did_add_maps
+ endfunc
+endif
+
+let b:undo_ftplugin = "call VimFtpluginUndo()"
" Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o".
@@ -43,6 +63,8 @@ setlocal commentstring=\"%s
setlocal keywordprg=:help
if !exists("no_plugin_maps") && !exists("no_vim_maps")
+ let b:did_add_maps = 1
+
" Move around functions.
nnoremap <silent><buffer> [[ m':call search('^\s*fu\%[nction]\>', "bW")<CR>
vnoremap <silent><buffer> [[ m':<C-U>exe "normal! gv"<Bar>call search('^\s*fu\%[nction]\>', "bW")<CR>