0

I would like to use the setruler option in order to know which line number and column my cursor is on. I have tried typing the command manually by typing :set ruler and also adding set ruler to my ~/.vimrc but neither seem to have any effect. Any ideas why this is? My VIM version is:

$ vi --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31)
Included patches: 1-2269
Modified by [email protected]
Compiled by [email protected]
Small version without GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tcl
-arabic            -file_in_path      -mouse_urxvt       -termguicolors
+autocmd           -find_in_path      +mouse_xterm       -terminal
-autochdir         -float             +multi_byte        +terminfo
-autoservername    -folding           -multi_lang        +termresponse
-balloon_eval      -footer            -mzscheme          -textobjects
-balloon_eval_term +fork()            -netbeans_intg     -textprop
-browse            -gettext           -num64             -timers
+builtin_terms     -hangul_input      -packages          -title
-byte_offset       +iconv             -path_extra        -toolbar
-channel           +insert_expand     -perl              +user_commands
-cindent           -job               -persistent_undo   -vartabs
-clientserver      +jumplist          -printer           +vertsplit
-clipboard         -keymap            -profile           +virtualedit
+cmdline_compl     -lambda            -python            +visual
+cmdline_hist      -langmap           -python3           +visualextra
-cmdline_info      -libcall           -quickfix          -viminfo
+comments          -linebreak         -reltime           +vreplace
-conceal           -lispindent        -rightleft         +wildignore
-cryptv            +listcmds          -ruby              -wildmenu
-cscope            +localmap          +scrollbind        +windows
+cursorbind        -lua               -signs             +writebackup
-cursorshape       -menu              -smartindent       -X11
-dialog            -mksession         -sound             +xfontset
-diff              +modify_fname      -spell             -xim
-digraphs          +mouse             -startuptime       -xpm
-dnd               -mouseshape        -statusline        -xsmp
-ebcdic            -mouse_dec         -sun_workshop      -xterm_clipboard
-emacs_tags        -mouse_gpm         -syntax            -xterm_save
-eval              -mouse_jsbterm     +tag_binary        
+ex_extra          -mouse_netterm     -tag_old_static    
-extra_search      +mouse_sgr         -tag_any_white     
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-iU6mZD/vim-8.1.2269=. -fstack-protector-strong -Wformat -Werror=format-security -DTINY_VIMRC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim    -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo  -lselinux -lacl -lattr -ldl 

The expected behaviour is that the line and column number appears in the status bar as shown here:

https://linuxhint.com/wp-content/uploads/2020/07/11-12.png

2
  • Welcome to Vi and Vim!
    – D. Ben Knoble
    Feb 25, 2021 at 17:42
  • 1
    Do you also set statusline? I believe that the ruler setting doesn't do anything if you have a custom statusline value. Feb 26, 2021 at 0:14

1 Answer 1

3

Ruler is not available when compiled without +cmdline_info feature. View local documentation about Vim commands and options with :h. Here :h ruler would have given you that information.

In Debian and Ubuntu, you can install a more featureful Vim with vim-athena or vim-nox packages. Those will come with +cmdline-info.

1
  • Thanks. That documentation was helpful. Feb 26, 2021 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.