Skip to content

jeffkreeftmeijer/vim-numbertoggle

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
doc
Sep 20, 2017
Jan 12, 2021
Sep 2, 2017

numbertoggle

In a buffer with "hybrid" line numbers (:set number relativenumber), numbertoggle switches to absolute line numbers (:set number norelativenumber) automatically when relative numbers don't make sense.

vim-numbertoggle toggles between "hybrid" and absolute line numbers automatically

Relative numbers are used in a buffer that has focus, and is in normal mode, since that's where you move around. They're turned off when you switch out of Vim, switch to another split, or when you go into insert mode.

Installation

Using Vim's package manager:

  1. $ git clone --branch main git@github.com:jeffkreeftmeijer/vim-numbertoggle.git ~/.vim/pack/plugins/start/vim-numbertoggle
  2. :set number

Once help tags are generated, you can view the manual with :help numbertoggle.

tmux

If you use tmux, add set-option -g focus-events on to your tmux config (~/.tmux.conf) (#45).