Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.26 KB

README.md

File metadata and controls

38 lines (27 loc) · 1.26 KB

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