vim - Show line numbers only on command mode -


i ever use line numbers when want switch line on screen, use command mode (e.g. :82)

is there way show line numbers when switch command mode?

yes. can use map that.

: nnoremap : :set nu<cr>: 

this set line numbers when enter command line mode.

the following command not show line numbers when leave command-line mode.

  :nnoremap <cr> :set nonu<cr> 

but needs 2 enters pressed.

** andrew suggests, following command des same , avoids typing enter twice.**

:cnoremap <silent> <cr> <cr>:set nonu<cr>  

put these 2 lines in ~/.vimrc file.


Comments

Popular posts from this blog

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

wordpress - (T_ENDFOREACH) php error -

Using django-mptt to get only the categories that have items -