Skip to content

Commit

Permalink
Merge pull request #28 from mrpdaemon/toggle-on-window-enter-leave
Browse files Browse the repository at this point in the history
Toggle numbers on/off on WinEnter/WinLeave
  • Loading branch information
myusuf3 committed Jul 12, 2013
2 parents b9e6d7e + e6b4d1b commit 3606caf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ numbers.vim
numbers.vim is a plugin for intelligently toggling line numbers.

This plugin alternates between relative numbering (`relativenumber`) and
absolute numbering (`number`) depending on the mode you are in. In a GUI, it
also functions based on whether or not the app has focus.
absolute numbering (`number`) for the active window depending on the mode
you are in. In a GUI, it also functions based on whether or not the app has
focus.

Commands are included for toggling the line numbering method and for enabling
and disabling the plugin.
Expand Down
5 changes: 3 additions & 2 deletions doc/numbers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ Help on using numbers *numbers*
1. INTRODUCTION *numbers-intro*

The |numbers| plugin intelligently alternates between relative numbering
(|relativenumber|) and absolute numbering (|number|) depending on the mode you
are in. In a GUI, it also functions based on whether or not the app has focus.
(|relativenumber|) and absolute numbering (|number|) for the active window
depending on the mode you are in. In a GUI, it also functions based on whether
or not the app has focus.

Commands are included for toggling the line numbering method and for enabling
and disabling the plugin.
Expand Down
2 changes: 2 additions & 0 deletions plugin/numbers.vim
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ function! NumbersEnable()
autocmd BufReadPost * :call ResetNumbers()
autocmd FocusLost * :call Uncenter()
autocmd FocusGained * :call Center()
autocmd WinEnter * :call SetRelative()
autocmd WinLeave * :call SetNumbers()
augroup END
endfunc

Expand Down

0 comments on commit 3606caf

Please sign in to comment.