diff options
author | Anmol Sethi <anmol@aubble.com> | 2016-08-24 11:56:33 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-09-03 12:57:41 -0400 |
commit | f8fc8f51c0db0137a696f65a8ba75c89c1012119 (patch) | |
tree | e5591214a8a28b5cd6dce41865e295260d2df734 /runtime/ftplugin | |
parent | 94dfb6cea24180592af5c495dd9e8abf61d5735f (diff) | |
download | rneovim-f8fc8f51c0db0137a696f65a8ba75c89c1012119.tar.gz rneovim-f8fc8f51c0db0137a696f65a8ba75c89c1012119.tar.bz2 rneovim-f8fc8f51c0db0137a696f65a8ba75c89c1012119.zip |
man.vim #5249
- fix synopsis highlighting in other locales. Cannot always rely on the first
line for the section in some locales; instead, use the file path and
explicitly set b:man_sect to the actual section.
- eliminate separate s:man_args function
- simplify logic: do not reuse buffer content
- introduce b:man_default_sects Fixes #5233
- introduce <Plug>(man_vsplit), <Plug>(man_tab)
- simplify regexps
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/c.vim | 2 | ||||
-rw-r--r-- | runtime/ftplugin/man.vim | 15 |
2 files changed, 13 insertions, 4 deletions
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index 487ce7a165..d1b2a4941e 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -55,5 +55,7 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") endif endif +let b:man_default_sects = '3,2' + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index fddfee3c31..08a88e6b90 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -19,7 +19,9 @@ if has('vim_starting') endif " This is not perfect. See `man glDrawArraysInstanced`. Since the title is " all caps it is impossible to tell what the original capitilization was. - execute 'file man://'.tolower(matchstr(getline(1), '^\S\+')) + let ref = tolower(matchstr(getline(1), '^\S\+')) + let b:man_sect = man#extract_sect_and_name_ref(ref)[0] + execute 'file man://'.ref endif setlocal buftype=nofile @@ -33,11 +35,16 @@ setlocal tabstop=8 setlocal softtabstop=8 setlocal shiftwidth=8 -call man#set_window_local_options() +setlocal nonumber +setlocal norelativenumber +setlocal foldcolumn=0 +setlocal colorcolumn=0 +setlocal nolist +setlocal nofoldenable if !exists('g:no_plugin_maps') && !exists('g:no_man_maps') - nmap <silent> <buffer> <C-]> <Plug>(Man) - nmap <silent> <buffer> K <Plug>(Man) + nmap <silent> <buffer> <C-]> <Plug>(man) + nmap <silent> <buffer> K <Plug>(man) nnoremap <silent> <buffer> <C-T> :call man#pop_tag()<CR> if s:pager nnoremap <silent> <buffer> <nowait> q :q<CR> |