News for hackers. Stuff that matters.
Re:History and Effective Use of Vim by stirfrykitty on Friday July 19, 2019 @04:31PM (#20482195)
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.

Re:History and Effective Use of Vim by Syssiphus on Friday July 19, 2019 @04:33PM (#20482206)
Or just CTRL+z and then 'fg' to go back.
Re:History and Effective Use of Vim by pselbert on Friday July 19, 2019 @06:43PM (#20483056)
This 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

Re:History and Effective Use of Vim by TheGrassyKnoll on Friday July 19, 2019 @08:19PM (#20483457)
That's what I do in Emacs. I always run it from a terminal (currently using Terminator).
Re:History and Effective Use of Vim by SEJeff on Friday July 19, 2019 @05:51PM (#20482749)
This is exactly what I do all the time and works nicely.
Re:History and Effective Use of Vim by stirfrykitty on Friday July 19, 2019 @04:42PM (#20482294)
Does that work in all shells?
Re:History and Effective Use of Vim by pfranz on Friday July 19, 2019 @04:52PM (#20482347)
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.

Re:History and Effective Use of Vim by mprovost on Friday July 19, 2019 @05:51PM (#20482748)
Job control was first implemented in csh, another Bill Joy invention, although I believe that particular feature was added by someone else.
Re:History and Effective Use of Vim by bch on Friday July 19, 2019 @08:50PM (#20483551)
> :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.

Re:History and Effective Use of Vim by miguelmota on Friday July 19, 2019 @08:06PM (#20483413)
Been 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
Re:History and Effective Use of Vim by magduf on Friday July 19, 2019 @05:19PM (#20482538)
I 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?
Re:History and Effective Use of Vim by passthejoe on Saturday July 20, 2019 @03:58PM (#20487971)
The worst thing is when you start typing Vim commands in programs that are not Vim.
Re:History and Effective Use of Vim by Zelphyr on Friday July 19, 2019 @06:48PM (#20483089)
You can also do

    :! ls -a
to execute a shell command and see the results from within Vim.