Git Product home page Git Product logo

vim-tunnel-vision's Introduction

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).

vim-tunnel-vision's People

Contributors

misterbuckley avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.