7 ms·
Been using vim since 1998 and rarely stray unless I'm typing notes for something unimportant and them I use Nano. Back in the day when I was a Unix admin, we o
by stirfrykitty 7y ago
Been using vim since 1998 and rarely stray unless I'm typing notes for something unimportant and them I use Nano.
Back in the day when I was a Unix admin, we often worked in full screen terminals and when editing a config file didn't like having to close the vim instance to go look at something, so learned about this little gem:
:sh (go back to shell and do your thing and leave vim running)
Ctrl-d to return to intact and running vim instance.
As an aside, if you decide to use nano to edit config files, make sure you use nano -w (no wrap), otherwise you may find yourself with a non-bootable OS instance.
- Syssiphus 7y agoOr just CTRL+z and then 'fg' to go back.
- stirfrykitty 7y agoDoes that work in all shells?
- steve76 7y agoWell, we can't call it Satan ... ... ... ... ??? How about ... ... Sad Sam! :) FUN AT PBS FROM MANHATTAN PROJECT FUCK YOU HITLER.
- pfranz 7y agohttps://en.wikipedia.org/wiki/Job_control_(Unix) https://en.wikipedia.org/wiki/Job_control_(Unix) I haven't used many esoteric environments, but wikipedia says it "exists in most modern Unix shells" and the timeline for first adding it was the late 70s early 80s.
- mprovost 7y agoJob control was first implemented in csh, another Bill Joy invention, although I believe that particular feature was added by someone else.
- SEJeff 7y agoThis is exactly what I do all the time and works nicely.
- pselbert 7y agoThis is one of the many things I learned from the destroyallsoftware screencasts [0] so many years ago. Before that I used vim in a gui (MacVim). Along with moving to tmux this completely changed how I work. [0]: https://www.destroyallsoftware.com/screencasts https://www.destroyallsoftware.com/screencasts
- TheGrassyKnoll 7y agoThat's what I do in Emacs. I always run it from a terminal (currently using Terminator).
- magduf 7y agoI wouldn't even use nano for typing notes; I'm so used to vim that I don't see why I wouldn't want its powers, even for something as simple as writing notes. I might very well want to reorder the notes, for instance: that's very easy in vim with dd/p. nano might have some Ctrl-key combo that does the same thing, but why bother learning that when I already know vim?
- passthejoe 7y agoThe worst thing is when you start typing Vim commands in programs that are not Vim.
- bch 7y ago> :sh (go back to shell and do your thing and leave vim running) In nvi (at least), one can also open a buffer and :script to run a shell inside vi and have all the yank/paste/navigation/all-the-things features of vi. Mind you need to i[nsert] or a[ppend] after the prompt to issue your commands.
- Zelphyr 7y agoYou can also do :! ls -a to execute a shell command and see the results from within Vim.
- deleted 7y ago[deleted]
- miguelmota 7y agoBeen using vim for almost a decade and embarrassed to not have known about how to go back to vim after doing `:sh` , so thanks for sharing that. I use tmux all the time so I tend to switch to a pane running bash and `ctrl-b z` to toggle the pane fullscreen