sponsor Vim development Vim logo Vim Book Ad

vim-smartsplit : You're lazy. Let Vim decide your split directions.

 script karma  Rating 0/0, Downloaded by 172  Comments, bugs, improvements  Vim wiki

created by
Daniel Moch
script type
Yeah, you're aware of split/vsplit, new/vnew and the like. You use them
because you have to, but you know there must be a better way. This is it.

Vim, given it's old pedigree, tacitly assumes a standard terminal width of
around 80 characters. In this environment it makes sense for Vim to assume any
command that divides the current window should divide horizonally. But our
monitors are often capable of more than twice the width of an old terminal, so
this doesn't make sense any more.

One sensible option, which this plugin adopts, is to make a best-guess at the
width of the text displayed in the current window (see 'textwidth'. Then
operations should default to vertical if there is enough horizonal room to
display two splits side-by-side.

This plugin provides :Help, :Split, :New, and :Buffer commands to replace
their lower-case counterparts. It also sets 'diffopt' to split in either a
horizontal or vertical direction, again depending on the horizontal space

Only releases are made available at Vim.org. The latest source code is always available at https://git.danielmoch.com/vim-smartsplit/files.html
install details
It's 2019, and the only sensible option for package management in Vim's
built-in manager. If you've never used it before, here's the summary
(adapted from :help packages).

cd .vim
mkdir -p pack/foo/start
cd pack/foo/start
unzip /tmp/vim-smartsplit.zip

If you're stuck on an old version of Vim without support for packages,
then I recommend using Pathogen (https://github.com/tpope/vim-pathogen)
to fill the gap, in which case the installation is the same.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-smartsplit.zip 0.1.0 2019-07-22 6.0 Daniel Moch Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
OSDN.net Logo