Stop man and vim from forking new window
Bonjour,
In linux, how do you prevent vim and man from forking new window on top of the shell? When I exit man, the pages are gone from the terminal, I don't want that. When I run vim, I can not scroll the window as I scroll "out of vim", I don't want that. How can I fix both man and vim so they are kept in the current shell, so man printout remains on the shell screen? thanks for your help on this very basic question :P) |
I think you'd have to go as far as to download the source for those programs, modify their behavior and recompile. There are no settings that I'm aware of to avoid this behavior.
|
Well, let me explain something else. I was using, up until now, SSH Secure shell software and there everything behave as I want to. When I exit man, man stays in the same screen.
I am now using mobaXterm and I'm having the problem with man and vi that I didn't have with the other tool. Might be a configuration there but couldn't find anything! |
I utilize this is my ~/bashrc
Code:
export PAGER="" |
I fully understand the behaviors you described in your first post.
VIM and MAN do behave exactly like that. Once you exit, the screen, and buffer, are cleared. I feel this beneficial behavior you have been seeing is due to how the ssh was working for you. Unsure if terminal settings played any factor in that or if it was the specific SSH implementation. You may have become accustomed to a happenstance. Not a bad thing, but I do not see any guarantee of a solution except something along the lines of my earlier code suggestion. Or perhaps to continue to use ssh over this new terminal program. |
Thanks, I have set export PAGER="more" so fix the man pages. Now, when I exit man, man page remains on the screen.
I need to do the same with vim as it still behave as before which means, it's gone when I quit vim. |
Use a multiplexer, screen or tmux, both will allow running sessions.
|
I do not know if there are better ways to fix this but here how I did to fix everything at once :
export TERM=linux Problem fix for man and VIM Thanks guys. P.S. the PAGER thing lead me to form my google search differently which lead to the fix. Sometimes, the answer you search depends on how you ask the question 8¬) |
The traditional method (full screen terminal) is to pause vi/vim with Ctrl-Z. This should restore the shell screen and give control back to the shell. If desired continue with vi/vim with the fg command.
If you have a graphical desktop, start vim in a new graphical terminal window Code:
xterm -e vim & Code:
gvim & |
Bah .... it's not quite like it, with TERM=linux you trade xterm for a console with less functionnality.
In xterm, you can set these two options in the .vimrc cat .vimrcAs per doc, t_te out of "termcap" mode t_ti put terminal in "termcap" mode http://vimdoc.sourceforge.net/htmldoc/term.html Need a way to keep the current nice man PAGE with the termcap off. From what I read, you need to mess with terminfo to completely get rid of the alternate screen. |
Quote:
Or, if "less" is more useful to you (it's generally the default pager nowadays) and you don't want to disable use of a pager, set up an alias for man: Code:
alias man='PAGER=more man' Hope this helps. Later... |
In /etc/man_db.conf change
Code:
less -is Code:
less -isX Quote:
I don't use vi/vim, so can't help with that. I'm a nano or ScITe guy. |
All times are GMT -5. The time now is 02:12 AM. |