Skip to content

tunnel vision for vim: for when you need to put on the blinders and focus on a smaller chunk of code

Notifications You must be signed in to change notification settings

misterbuckley/vim-tunnel-vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

vim-tunnel-vision

Narrow your vision to focus on a smaller chunk of a buffer.

Example usage

Installation

Install it however you usually install plugins.

For example, if you use Vim-Plug, simply add to your vimrc:

Plug 'misterbuckley/vim-tunnel-vision'

Pathogen users:

cd ~/.vim/bundle
git clone https://github.com/misterbuckley/vim-tunnel-vision.git

Usage

Put mappings such as the following in your .vimrc:

nmap <Leader>t <Plug>(EnterTunnel)
vmap <Leader>t <Plug>(EnterTunnel)

Then, either visually select a block of text to focus on and press <Leader>t or press <Leader>t in normal mode followed by a motion to focus on that block of text.

The block of text you have selected will be copied to a scratch buffer where those lines are all you see, allowing you to focus on that smaller chunk of text.

When you are done editing in this new buffer, hit :w to exit the tunnel. This will copy your newly edited text back to the original buffer that you came from and destroy the scratch buffer.

It's as simple as that.

Settings

g:tv_write_immediately

Normally when exiting the tunnel with :w, your new changes will not immediately be saved in the original buffer. If g:tv_write_immediately is set to a number greater than zero, your changes will immediately be saved in the original buffer (as if you did another :w).

About

tunnel vision for vim: for when you need to put on the blinders and focus on a smaller chunk of code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published