-
Notifications
You must be signed in to change notification settings - Fork 20
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
Read man page in split mode #4
Comments
I'm right there with you. I just haven't found any way to do it that doesn't involve huge hacks. There's a section from " Use an existing "man" window if it exists, otherwise open a new one.
if &filetype != "man"
let thiswin = winnr()
exe "norm! \<C-W>b"
if winnr() > 1
exe "norm! " . thiswin . "\<C-W>w"
while 1
if &filetype == "man"
break
endif
exe "norm! \<C-W>w"
if thiswin == winnr()
break
endif
endwhile
endif
if &filetype != "man"
new
setl nonu fdc=0
endif
endif
silent exec "edit $HOME/".page.".".sect."~" It's a little hard to follow, but it basically searches through all windows within the active tab for one with In the plugin right now, I use I'm going to investigate this a little bit further, but I'd love to hear suggestions on how to accomplish this better. It might involve submitting a patch to the upstream |
I redid a lot of the vim man page plugin here to make it better at handling different sections of manpages and only use the edit command to open the page. This allows you to easily do stuff like I also made it easy to integrate it with the neovim terminal. E.g. if you have a terminal buffer open in a window in neovim and you type This is the zsh function I use and you will need https://github.com/mhinz/neovim-remote nman() {
if [[ "$@" == "" ]]; then
print "What manual page do you want?"
return
fi
/usr/bin/man "$@" > /dev/null 2>&1
if [[ "$?" != "0" ]]; then
print "No manual entry for $*"
return
fi
if [ -z $NVIM_LISTEN_ADDRESS ]; then
/usr/bin/env nvim -c "Neoman $*"
else
nvr --remote-send "<c-n>" -c "Neoman $*"
fi
} Its again a work in progress and I'm changing a lot, still have to add the credits to this plugin which gave me the idea. None of this extra code should have any conflicts with the original man. Everything is done under neoman (e.g. filetype is neoman) |
I just gave neoman.vim a massive update. Its pretty good now. |
Huh, that's very interesting; i'll have to give it a look. I haven't really been able to get into NeoVim's |
Hi,
I find superman really great, especially when doing c programming and needing to read man pages.
I use the plugin from inside vim with for example
:SuperMan printf
I would like to open the man page in a split. Currently it creates a new buffer, and loads in a complete windows.
The text was updated successfully, but these errors were encountered: