Hot answers tagged


One possible solution is to do the calculation by yourself and add them in your status line: First you will need a function which returns as a string your current position as a decimal percentage: function! GetCurrentPosition() return printf('%.2f%%', ( 100.0 * line('.') / line('$') )) endfunction The function uses line('.') to get the position of the ...


You can get the size of the buffer in bytes with: :echo line2byte('$') + len(getline('$')) line2byte() gets the number of bytes until the last line, but not including the last line, so we need to add the length of the last line ourselves. You can use %{expr} to use any expression inside the statusline or rulerfrmat settings; for example: let &...


The default format of the ruler option is directly set in the C core of Vim. If you do not like the default, you can customize it using the 'rulerformat' option and using the statusline format expressions. By experimenting, it seems the default ruler format (when not customized) is: :set rulerformat=%l,%c%V%=%P │ │ │ │ └ position in the ...


There's an example under :help statusline: < Similar, but add ASCII value of char under the cursor (like "ga") > :set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P It's "Emulat[ing] [the] standard status line with 'ruler' set" and "add[ing] ASCII value of char under the cursor." The relevant items are b N ...


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.


That’s the ruler setting. Neovim sets it by default—they’ve tweaked the defaults for many things. So :set noruler should do it.


Try the following two commands: " Match when cursor before column matchadd('ColorColumn', '\%#.*\zs\%81v', 100) " Match when cursor after column matchadd('ColorColumn', '\%81v\ze.*\%#', 100) It should be possible to combine these into a single regular expression, but simply placing them into an alternation with \| doesn't work correctly*, so doing so ...


You can get the size of the file that is loaded in the current buffer with: getfsize(expand(@%)). To add it to the statusline you would use: let &statusline .= "%{getfsize(expand(@%))}" Be aware that it will show -1 for the size of a new unnamed buffer and will update on modified files only after they are saved.

Only top voted, non community-wiki answers of a minimum length are eligible