Skip to main content
Share Your Experience: Take the 2024 Developer Survey
7 votes
Accepted

How to display file size in vim rulerformat?

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 ...
Martin Tournoij's user avatar
7 votes
Accepted

Default rulerformat

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 ...
Christian Brabandt's user avatar
6 votes
Accepted

How to set ruler with decimals in .vimrc file?

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: ...
statox's user avatar
  • 50.1k
3 votes
Accepted

How to show the currents char code in ruler

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 &...
D. Ben Knoble's user avatar
  • 26.4k
3 votes
Accepted

Set ruler does nothing

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 ...
Quasímodo's user avatar
  • 2,466
3 votes
Accepted

Statusline vs Rulerformat - What is the Difference?

Vi didn't have windows so the user only needed one information device for the single buffer vi could display at a time: the "ruler". Vim is a vi clone, therefore Vim has a "ruler". ...
romainl's user avatar
  • 41.1k
2 votes
Accepted

How to show the current statusline definition?

:help 'rulerformat' and :help 'statusline' are both clear about this: their default value is empty. If the user doesn't set them explicitly (or implicitly, via some plugin), then some internal routine ...
romainl's user avatar
  • 41.1k
2 votes

How to change the color of the vim ruler?

The highlight group for the default ruler is Normal. If you just want to adjust the opacity for everything, this might work. In vim there is not a built-in way to adjust the standard ruler's colors ...
Mass's user avatar
  • 14.1k
2 votes
Accepted

Isolate a matched virtual column ruler to the cursorline only?

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 ...
Rich's user avatar
  • 32.1k
1 vote

How to show ruler always in the last line instead of statusline?

I don't believe what you're asking is possible. You can remove the ruler from the statusline, however you cannot have it only appear on the bottom of the screen and be accurate to each window.
doopNudles's user avatar
1 vote
Accepted

Remove right text (line numbers , ALL) in command line

That’s the ruler setting. Neovim sets it by default—they’ve tweaked the defaults for many things. So :set noruler should do it.
D. Ben Knoble's user avatar
  • 26.4k
1 vote

How to display file size in vim rulerformat?

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 ...
elig's user avatar
  • 121

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