
Vim Splits: A Guide to Doing What You Want (2010) - polm23
https://technotales.wordpress.com/2010/04/29/vim-splits-a-guide-to-doing-exactly-what-you-want/
======
dickeytk
If you use vim + tmux this plugin[0] is super handy. It allows ctrl-h|j|k|l to
switch between tmux or vim splits so you don't have to know whether it's a
different terminal window or a vim split—just that you want to go right (for
example).

[0] [https://github.com/christoomey/vim-tmux-
navigator](https://github.com/christoomey/vim-tmux-navigator)

~~~
artificialLimbs
As a new~ish vim/tmux user, thank you. I stopped using vim splits because
tmux.

~~~
opan
You can easily copy stuff between vim splits, though. The window movements can
also be part of vim macros. I have a couple macros that will assume I'm on the
left window, make a change to the right window, save the file, and return me
to the left side. I also have one to delete the second line from two side-by-
side files for playlist management. At one point I used several vim instances
in tmux panes, but only because I hadn't learned of vim's own advanced
features.

------
jonfw
It seems like there are a lot of different ways to get tiling windows. You can
do it in window managers by using different instances of applications. You can
do it in terminal sessions using tmux and screen. You can do it in VIM, you
can do it in IDEs. You can use suckless tabbed.

I use a tiling window manager, which means I have a unified interface for
tiling with all of my windows. I don't ever use tiling window management
features of specific programs, outside of tabs in my browser. But I do
sometimes miss out on things like sharing VIM registers, or TMUX session
management.

Does anybody use tiling features at multiple points in their system?

~~~
opan
I pretty much use them at every point. The only special window management I've
never liked is tabs or splits at the level of the terminal emulator (like in
terminator). It really does just feel like worse/clunkier tmux. I use Sway,
tmux, and splits in vim/emacs. I like to have all my terminal stuff glued
together and in a certain arrangement. I like that this whole layout of panes
I'm used to can then neatly take up half my screen thanks to the wm. Vim has
registers and macros that benefit from a single session. Emacs has commands to
scroll the "other window", also it often opens a temporary window when you use
something like M-x describe-mode or M-x describe-char. You could maybe remove
some of this overlap if everything had some sort of ipc and your wm just sent
commands to it all.

------
apotatopot
Vim never ceases to amaze me. Opening remote files over scp, splits, file
explorer, and the built in cli w/ 8\. Such a beautiful program.

------
djohnston
I chose using vim + tmux instead of using the vim-specific tiling. The main
benefit for me is that all tiles are using same mechanism, as opposed to tmux
for shells and vim for code

~~~
jacoblambda
you can also use vim's built in terminal multiplexer if you have vim 8 or
newer. The benefit with using the vim variant is that you can apply most of
the vim features to terminal use. i.e. you can use vim to sift through
terminal output, you can make vim macros that leverage the terminal as well,
and you can yank and paste using vim registers.

Still not as polished as tmux in some ways but I've found it to be a very nice
improvement over tmux with vim. Mind you when doing this I still use vim
inside tmux so that I can detach and so that I get a bit more consistent
terminal output between devices.

~~~
F147H34D
ctrl-z will suspend vim. then just type fg from command prompt to get it back.

~~~
jacoblambda
This doesn't work over ssh unfortunately. The tmux method works locally and
remotely. Vim has server mode which is similar but significantly less
ergonomic than just using tmux and requires vim to be compiled with non
default flags.

------
ashton314
I _promise_ I’m not trying to start a flame war, but as an Emacs user this
seems… commonplace. Are splits not a commonly used feature? I’ve used the
equivalent for as long as I can remember in Emacs, so it doesn’t feel
particularly esoteric. Or is it that this is just a commonly not fully-
understood/utilized feature of Vim? If that’s the case, that is totally
understandable. That’s basically my life with Emacs. :)

I’m curious: what features of Vim do you feel are essential to become a power
user?

~~~
jdonaldson
Vim is great but ancient. It was designed on/for systems that just don't exist
any more. E.g. looking at the popular keyboard of the time hints at why
"escape" was such a critical key :
[https://i.imgur.com/Hn174TJ.jpg](https://i.imgur.com/Hn174TJ.jpg)

In order to get the most from Vim, you have to take a huge step back and look
at your screen configuration and usage patterns.

* The escape key is too difficult to reach on modern keyboards, use ctrl-c

* Code file sizes are becoming really large. Use search rather than directional navigation/paging to save some time

* The search key is too difficult to hit, remap to space

* Most people are on a wide screen. So, try to make vertical splits as easy as possible to do.

* Folder based search is now very fast and efficient. Use a modified search command (<leader>space) and map it to Rg/Ack

There's some good work recently done for vim with language servers. I'm
counting on redoing the key mapping once more. IMHO the poor defaults of vim
isn't a bug of vim, it's a feature.

