Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeffkreeftmeijer/vim-numbertoggle
Toggles between hybrid and absolute line numbers automatically
https://github.com/jeffkreeftmeijer/vim-numbertoggle
Last synced: 30 days ago
JSON representation
Toggles between hybrid and absolute line numbers automatically
- Host: GitHub
- URL: https://github.com/jeffkreeftmeijer/vim-numbertoggle
- Owner: jeffkreeftmeijer
- License: mit
- Created: 2012-01-30T12:39:08.000Z (almost 13 years ago)
- Default Branch: main
- Last Pushed: 2021-07-14T08:57:35.000Z (over 3 years ago)
- Last Synced: 2024-10-06T11:43:19.122Z (about 1 month ago)
- Language: Vim script
- Homepage: https://jeffkreeftmeijer.com/vim-number/#automatic-toggling-between-line-number-modes
- Size: 6.88 MB
- Stars: 681
- Watchers: 5
- Forks: 49
- Open Issues: 2
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://raw.githubusercontent.com/jeffkreeftmeijer/vim-numbertoggle/cast/toggle.gif)
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 [email protected]: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`) (https://github.com/jeffkreeftmeijer/vim-numbertoggle/issues/45).