Skip to content

Easily set line numbering mode in vim

License

Notifications You must be signed in to change notification settings

heindsight/lineno.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lineno.vim

This very simple plugin provides commands to simultaneously set the number and relativenumber options in vim and to switch between different combinations of these options.

Installation

You can use your favourite installation method. With Tim Pope's pathogen it is simply a question of cloning the lineno.vim repository into your vim bundle directory.

cd ~/.vim/bundle
git clone git://github.com/heindsight/lineno.vim

Usage

The :SetLineNoMode command simultaneously sets the number and relativenumber options in vim. It takes a single integer argument which determines the line numbering mode:

  1. No numbering ('number' and 'relativenumber' both unset)
  2. Absolute numbering ('number' set, 'relativenumber' unset)
  3. Relative numbering ('number' unset, 'relativenumber' set)
  4. Relative numbering with absolute numbering for cursor line ('number' and 'relativenumber' both set)

Use :SwitchLineNoMode to cycle between the modes listed above. You may want to define a mapping for this command in your ~/.vimrc. Eg:

   nmap <silent><F2> :SwitchLineNoMode<CR>

License

Copyright (c) 2015, Heinrich Kruger. Distributed under the MIT license (see the LICENSE file).

About

Easily set line numbering mode in vim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published