Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to choose default split type #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions doc/man.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ Default man command is '/usr/bin/man', but it can be changed:
>
let g:vim_man_cmd = 'LANG=ja_JP.UTF-8 /usr/bin/man'
<


man_split_type *g:man_split_type*
Change the default split type when using |:Man|. Valid values are
'horizontal', 'vertical', or 'tab'

>
let g:man_split_type = 'horizontal'
<

CONTRIBUTING *man-contributing* *man-bugs*

Contributing and bug fixes are welcome. If you have an idea for a new feature
Expand Down
8 changes: 6 additions & 2 deletions plugin/man.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ if !exists('g:vim_man_cmd')
let g:vim_man_cmd='/usr/bin/man'
endif

command! -nargs=* -bar -complete=customlist,man#completion#run Man call man#get_page('horizontal', <f-args>)
if !exists('g:man_split_type')
let g:man_split_type = 'horizontal'
endif

command! -nargs=* -bar -complete=customlist,man#completion#run Man call man#get_page(g:man_split_type, <f-args>)
command! -nargs=* -bar -complete=customlist,man#completion#run Sman call man#get_page('horizontal', <f-args>)
command! -nargs=* -bar -complete=customlist,man#completion#run Vman call man#get_page('vertical', <f-args>)
command! -nargs=* -bar -complete=customlist,man#completion#run Tman call man#get_page('tab', <f-args>)

command! -nargs=+ -bang Mangrep call man#grep#run(<bang>0, <f-args>)

" map a key to open a manpage for word under cursor, example: map ,k <Plug>(Man)
nnoremap <silent> <Plug>(Man) :<C-U>call man#get_page_from_cword('horizontal', v:count)<CR>
nnoremap <silent> <Plug>(Man) :<C-U>call man#get_page_from_cword(g:man_split_type, v:count)<CR>
nnoremap <silent> <Plug>(Sman) :<C-U>call man#get_page_from_cword('horizontal', v:count)<CR>
nnoremap <silent> <Plug>(Vman) :<C-U>call man#get_page_from_cword('vertical', v:count)<CR>

Expand Down