Is there a way to check the length of the current line where the cursor is currently in the VI editor? I tried searching in Google but all I could find is how to see the line number in the currently opened file using "set nu".
Write to current line to a shell command:
:.w !wc -c
Also note that the length with wc -c
includes the \n
. When you don't want that, substract one or use something like
:.w !tr -d '\n'|wc -c