Vim Tips

25 Dec 2020

This page is indeed a great source of inspirations for useful vim tips; please do visit this page often.

Here is my own curated vim tips:

Inserting Command Output Into Currently Editting File

" inserts text from a specified file into the current buffer
:r textfile

" read in sorted order of file names
:r ! ls -1 /home/user/directory | sort -r

Execute External Commands Without Quiting Vim

" execute an NON-INTERACITVE command by Bang (!)
" below: count the number of words for current editing file (%)
:! wc %

" execute INTERACTIVE commands by dropping to interactive 
" shell; you can always go back to vim by 'CTRL-D' or 'exit'

Line Completion

" Line complete SUPER USEFUL

Search Words Completion

" Pull <cword> onto search/command line

" Pull <CWORD> onto search/command line

Window Size Adjustment

" Adjust height of splitted windows

" Adjust width of splitted windows

Jump Among Functions By Function Browsers

By using Taglist plugin? Or some other better tools/plugins?