: g/^$/d Delete blank line:%d delete all rows: g/^[0-9]*$/d Delete Only the number of rows if you want to change the file name of the file that is currently being edited, the workaround is to first use: F to Buffer name, and then delete the original file:: F New_file_name:!del # (# will be automatically replaced by VIM to the previous filename) here will be a command-line window, if you do not want to see it, the second command changed to:!start/b del # VIM format code: GG=G formatted full-text directive = = Formatting the current line 8= and formatting the current cursor next 8 lines vie Select Code in w mode and press = To format comments directly Java code:%s/^/\/\//g ? undo operation on U ^r hex edit windows:!xxd Replace all Chinese characters with English characters normal mode under map <c-s > on Lines 10 to 18 Note: 10,18s#^#//#g给10到18行反注释: 10,18s#^//# #g
Common Vim tips (2015-7-15)