2 ms·
I use ":sh" for this purpose, but it has the problems that: - you get a new shell, so your history is lost - if you have a "stack" of vim's you have to return
by jstanley 4y ago
I use ":sh" for this purpose, but it has the problems that:
- you get a new shell, so your history is lost
- if you have a "stack" of vim's you have to return to them in stack order
- I develop a habit of typing Ctrl-d when I want to get back to vim, which means I accidentally log out of SSH sessions all the time if I actually haven't still got vim open
I think getting in the habit of using Ctrl-z instead would be a big improvement.
- UI_at_80x24 4y ago> - you get a new shell, so your history is lost To prevent that from happening you can add this to your .bashrc #write to history file at each shell prompt export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
- cerved 4y agoNote that this can slow down your shell. Also it mingles histories from different sessions. Stop doing this myself for these reasons
- UI_at_80x24 4y agoYes, these are good points but I've found the benefit outweighs the annoyance. fzf for a history searcher really helps. BUT not being able to 'up arrow' the previous command is annoying at times. So far it's a 6/10 Slightly better then not doing it. =)