Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for relative numbers #1431

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions doc/NERDTree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,9 @@ the NERDTree. These settings should be set in your vimrc, using `:let`.
|NERDTreeShowLineNumbers| Tells the NERDTree whether to display line
numbers in the tree window.

|NERDTreeShowRelLineNumbers| Tells the NERDTree whether to display relative
line numbers in the tree window.

|NERDTreeSortOrder| Tell the NERDTree how to sort the nodes in the
tree.

Expand Down Expand Up @@ -1107,6 +1110,16 @@ window. Use one of the follow lines for this setting: >
let NERDTreeShowLineNumbers=0
let NERDTreeShowLineNumbers=1
<
------------------------------------------------------------------------------
*NERDTreeShowRelLineNumbers*
Values: 0 or 1.
Default: 0.

This setting tells vim whether to display relative line numbers for the NERDTree
window. Use one of the follow lines for this setting: >
let NERDTreeShowRelLineNumbers=0
let NERDTreeShowRelLineNumbers=1
<
------------------------------------------------------------------------------
*NERDTreeSortOrder*
Values: a list of regular expressions.
Expand Down
2 changes: 2 additions & 0 deletions lib/nerdtree/creator.vim
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ function! s:Creator._setCommonBufOptions()

if g:NERDTreeShowLineNumbers
setlocal number
elseif g:NERDTreeShowRelLineNumbers
setlocal relativenumber
else
setlocal nonumber
if v:version >= 703
Expand Down
1 change: 1 addition & 0 deletions plugin/NERD_tree.vim
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ let g:NERDTreeShowBookmarks = get(g:, 'NERDTreeShowBookmarks', 0
let g:NERDTreeShowFiles = get(g:, 'NERDTreeShowFiles', 1)
let g:NERDTreeShowHidden = get(g:, 'NERDTreeShowHidden', 0)
let g:NERDTreeShowLineNumbers = get(g:, 'NERDTreeShowLineNumbers', 0)
let g:NERDTreeShowRelLineNumbers = get(g:, 'NERDTreeShowRelLineNumbers', 0)
let g:NERDTreeSortDirs = get(g:, 'NERDTreeSortDirs', 1)
let g:NERDTreeFileLines = get(g:, 'NERDTreeFileLines', 0)

Expand Down