Vim Tips
Contents
merge two files together
- in vim test :
:read file.name - just run
cat file.1 file.2 > file.mergeorcat file.* > file.merge
Sed
- remove all spaces behind the lines
%s/\s\+$//g - remove line with charactor you wont like
g/somestring/, d
Encoding
- Show file encoding
file $fileor in vim:set fileencoding - If you only want to see all kinds of encoding files, just edit ~/.vimrc
set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936 - Change encoding
:set fileencoding=utf-8 - Other ways to change encoding : lconv convmv
Delete BOM
- remove UTF-8 BOM
:set nobomb - keep UTF-8 BOM
:set bomb
About how to search special characters
- Referencd : http://vimcdoc.sourceforge.net/doc/digraph.html
Reference : http://www.cnblogs.com/processakai/archive/2012/07/25/2608713.html
Author Hangbin Liu
LastMod 2018-12-02 (a90227f)