scy on Nostr: Reminder that #Vim and #Neovim have the special `=` register that gives you the ...
Reminder that #Vim and #Neovim have the special `=` register that gives you the result of an expression.
Most basic example would be a calculation. For example, I'm configuring the cache_size in the config file for davfs2. It takes a value in MiB. I'd like to set it to 50 GiB, so I can simply, in insert mode, hit Ctrl-R and then type
=50*1024
and hit return, and Vim will insert 51200.
See `:h @=` and `:h i_CTRL-R` for details.
https://vimhelp.org/change.txt.html#%40%3D
https://vimhelp.org/insert.txt.html#i_CTRL-R
Most basic example would be a calculation. For example, I'm configuring the cache_size in the config file for davfs2. It takes a value in MiB. I'd like to set it to 50 GiB, so I can simply, in insert mode, hit Ctrl-R and then type
=50*1024
and hit return, and Vim will insert 51200.
See `:h @=` and `:h i_CTRL-R` for details.
https://vimhelp.org/change.txt.html#%40%3D
https://vimhelp.org/insert.txt.html#i_CTRL-R