User Tools

Site Tools


vi_tips

To change all uppercase letters to lowercase in vi, you can use the command

:%s/.*/\L&/ 

To insert a quote at the beginning of each line

:%s/^/“/

To insert a quote and comma at the end of each line

:%s/$/“,/

Find non ASCII Characters

grep --color='auto' -P  "[\x80-\xFF]"
grep -P -n "[\x00-\x1F\x7F-\xFF]" input_file
grep --color='auto' -P -n '[^\x00-\x7F]' 
grep --color='auto' -P -n "[^[:ascii:]]"

This will prevent any weird Unicode character showing up in your code.

:set enc=latin1

grep regex operator Meaning

^	Matches the empty string at the beginning of a line; also represents the characters not in the range of a list.
$	Matches the empty string at the end of a line.
\b	Matches the empty string at the edge of a word.
vi_tips.txt · Last modified: by korn