Update runtime files.
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index ea3f9ac..dc03211 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: man
" Maintainer: SungHyun Nam <goweol@gmail.com>
-" Last Change: 2018 May 2
+" Last Change: 2018 Jul 25
" To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file.
@@ -14,32 +14,47 @@
finish
endif
let b:did_ftplugin = 1
+endif
+let s:cpo_save = &cpo
+set cpo-=C
+
+if &filetype == "man"
" allow dot and dash in manual page name.
setlocal iskeyword+=\.,-
+ let b:undo_ftplugin = "setlocal iskeyword<"
" Add mappings, unless the user didn't want this.
if !exists("no_plugin_maps") && !exists("no_man_maps")
if !hasmapto('<Plug>ManBS')
nmap <buffer> <LocalLeader>h <Plug>ManBS
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|silent! nunmap <buffer> <LocalLeader>h'
endif
nnoremap <buffer> <Plug>ManBS :%s/.\b//g<CR>:setl nomod<CR>''
nnoremap <buffer> <c-]> :call <SID>PreGetPage(v:count)<CR>
nnoremap <buffer> <c-t> :call <SID>PopPage()<CR>
nnoremap <buffer> <silent> q :q<CR>
+
+ " Add undo commands for the maps
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|silent! nunmap <buffer> <Plug>ManBS'
+ \ . '|silent! nunmap <buffer> <c-]>'
+ \ . '|silent! nunmap <buffer> <c-t>'
+ \ . '|silent! nunmap <buffer> q'
endif
if exists('g:ft_man_folding_enable') && (g:ft_man_folding_enable == 1)
setlocal foldmethod=indent foldnestmax=1 foldenable
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|silent! setl fdm< fdn< fen<'
endif
- let b:undo_ftplugin = "setlocal iskeyword<"
-
endif
if exists(":Man") != 2
- com -nargs=+ -complete=shellcmd Man call s:GetPage(<f-args>)
+ com -nargs=+ -complete=shellcmd Man call s:GetPage(<q-mods>, <f-args>)
nmap <Leader>K :call <SID>PreGetPage(0)<CR>
nmap <Plug>ManPreGetPage :call <SID>PreGetPage(0)<CR>
endif
@@ -100,7 +115,7 @@
return 1
endfunc
-func <SID>GetPage(...)
+func <SID>GetPage(cmdmods, ...)
if a:0 >= 2
let sect = a:1
let page = a:2
@@ -154,7 +169,11 @@
new
endif
else
- new
+ if a:cmdmods != ''
+ exe a:cmdmods . ' new'
+ else
+ new
+ endif
endif
setl nonu fdc=0
endif
@@ -218,4 +237,7 @@
endif
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
" vim: set sw=2 ts=8 noet:
diff --git a/runtime/ftplugin/rst.vim b/runtime/ftplugin/rst.vim
index e61213e..9d737cd 100644
--- a/runtime/ftplugin/rst.vim
+++ b/runtime/ftplugin/rst.vim
@@ -1,10 +1,12 @@
-" Vim filetype plugin file
-" Language: reStructuredText documentation format
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2008-07-09
+" reStructuredText filetype plugin file
+" Language: reStructuredText documentation format
+" Maintainer: Marshall Ward <marshall.ward@gmail.com>
+" Original Maintainer: Nikolai Weibull <now@bitwi.se>
+" Website: https://github.com/marshallward/vim-restructuredtext
+" Latest Revision: 2018-01-07
if exists("b:did_ftplugin")
- finish
+ finish
endif
let b:did_ftplugin = 1
@@ -16,5 +18,25 @@
setlocal comments=fb:.. commentstring=..\ %s expandtab
setlocal formatoptions+=tcroql
+" reStructuredText standard recommends that tabs be expanded to 8 spaces
+" The choice of 3-space indentation is to provide slightly better support for
+" directives (..) and ordered lists (1.), although it can cause problems for
+" many other cases.
+"
+" More sophisticated indentation rules should be revisted in the future.
+
+if !exists("g:rst_style") || g:rst_style != 0
+ setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
+endif
+
+if has('patch-7.3.867') " Introduced the TextChanged event.
+ setlocal foldmethod=expr
+ setlocal foldexpr=RstFold#GetRstFold()
+ setlocal foldtext=RstFold#GetRstFoldText()
+ augroup RstFold
+ autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache
+ augroup END
+endif
+
let &cpo = s:cpo_save
unlet s:cpo_save