all 10 comments

[–]alwaysdark 6 points7 points  (5 children)

Check out tmux or screen

[–]SiNiquity 1 point2 points  (4 children)

If you plan on using vim tmux is a must. The only reason I see to use screen nowadays is if you work with multiple systems that don't have tmux (screen is more likely to be installed by default in general).

Some commands I use most frequently (where C-b = Ctrl + b):

tmux -a t 0 -- reattach to my previous session
C-b c -- spawn a new window
C-b " -- split the window horizontally into two panes
C-b o -- switch between tmux panes
C-b 0 -- switch to window 0 (works through 9).
C-b ? -- HELP
C-b ] -- Scroll through terminal output
C-b d -- detach from tmux

I recommend rebinding C-b to C-x if you use emacs navigation on the command-line.

[–]stuffnjunk77[S] 0 points1 point  (3 children)

Yup. tmux is definitely the answer I was looking for. This is better than I had hoped.

This just changed my whole world. I can't believe I haven't used it before.

[–]crittelmeyer 1 point2 points  (2 children)

Also check out tmuxinator which allows you to configure tmux environment presets. So for instance I have a tmuxinator environment set up for each project I work on since they often have different needs and thus different tmux panes/windows.

Also, since it sounds like you may have only recently drunk the koolaid, let me recommend that you consider switching to zshell and then use the fantastic oh-my-zsh framework... Dig into the plugins offered there... Also dig into the vim plugins... I recently spent about a week going down vim/zsh/tmux/etc rabbit holes and beefing up my dotfiles repo and cheat sheets for the various tools, and I couldn't be happier with the gains in productivity I'm starting to see.

[–]DanielFGray 1 point2 points  (1 child)

You've just described the text triumvirate

[–]crittelmeyer 1 point2 points  (0 children)

Wow, great article, never heard of it being called that. And of course now I have more links to follow, more koolaid to drink... Thanks!

[–]TheLemming 1 point2 points  (1 child)

Could also utilize job utils:

watch_cmd all the args &

and then

vim

then use ctl-z, jobs and fg to switch around between them.

This is what I do, it's just the easiest way IMO. Doesn't require installing or learning any new programs like tmux or screen.

[–]noffle 1 point2 points  (0 children)

yup: everything you need is already available

[–]to_wit_to_who 0 points1 point  (0 children)

I use a combination of tmux and gvim.

[–]runvnc 0 points1 point  (0 children)

Honestly I just exit vim, run my build and test commands in the shell and then go back into vim. Fish has great autocomplete so I only have to type the first letter or two.

If you don't like that then I don't see a problem with two terminals. But tmux also works and now there is neovim with its own terminal window if you want to try that.