User Tools

Site Tools


How can I

vertical alignment of columns

show line endings

change the encoding to utf-8

insert newline in search and replace


will insert a new line before each occurrence of 29.

join lines with a character

Preprocess files before diffing them

  • :echo expand(“%:p”)
  • :!ls %:p
  • :!realpath % - be aware that realpath is not POSIX
  • :!echo “$PWD/%” - very difficult to type this!
  • 1 followed by ctrl-g - shows full path name but does not expand “~” to home directory
  • :'<,'>!realpath % - to replace the current selection with the file path
  • set statusline+=%F - will show full filename in the status bar
  • ctrl-g - shows file path relative to vim's current working directory


vim_notes.txt · Last modified: 2023/08/02 18:18 by raju