Skip to content

tandrewnichols/vim-headfirst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vim-Headfirst

Commands to quickly open sibling files in vim.

Overview

This plugin is a small wrapper around :e, :sp, :vsp, and :tabe for editing sibling files. That is, it's comparable to typing :e %:h/<Tab>, but it also let's you supply multiple files to open.

Installation

If you don't have a preferred installation method, I really like vim-plug and recommend it.

Manual

Clone this repository and copy the files in plugin/, autoload/, and doc/ to their respective directories in your vimfiles, or copy the text from the github repository into new files in those directories. Make sure to run :helptags.

Add the following to your vimrc, or something sourced therein:

Plug 'tandrewnichols/vim-headfirst'

Then install via :PlugInstall

Add the following to your vimrc, or something sourced therein:

Plugin 'tandrewnichols/vim-headfirst'

Then install via :BundleInstall

Add the following to your vimrc, or something sourced therein:

NeoBundle 'tandrewnichols/vim-headfirst'

Then install via :BundleInstall

git clone https://github.com/tandrewnichols/vim-headfirst.git ~/.vim/bundle/vim-headfirst

Usage

Using the following commands to edit sibling files in the corresponding windows. Tab completion works as normal.

:He/:Hedit

Edit a sibling file in the current window.

:He foo.js

:Hsp/:Hsplit

Edit a sibling file in a split.

" All these commands accept multiple sibling files, although it may not make sense to ":edit"
" multiple files at the same time. It's basically like preloading the additional ones.
:Hsp foo.js bar.js

:Hvsp/:Hvsplit

Edit a sibling file in a vertical split.

:Hvsp foo.js

:Htabe/:Htabedit

Edit a sibling file in a new tab.

:Htabe foo.js bar.js baz.js

Contributing

I always try to be open to suggestions, but I do still have opinions about what this should and should not be so . . . it never hurts to ask before investing a lot of time on a patch.

License

See LICENSE