- Reference to popular plugins
- Go to /usr/share/vim and find autoload, syntax, ftplugin (etc) system sample
- Make command can be bound with different program like gcc, javac, gradle
- Reference to github project: vim-gradle
- ErrorFormat is used to parse the build command output and present to user at quickfix window
:compiler gradlewand then:make {gradle-task}- Famous plugins CtrlP takes advantage of the make system in vim and bind it with execute find and map output to errorFormat.
:help find- Amazing when use with
:set wildmenu :find *.mdand Tab
- :echo has("python")
- :python print("hello world")
- :pyfile mypython.py
- In python script, there is a vim module to be used:
import vim window = vim.current.window window.height =200 window.width = 10 window.cursor = (1,1)
- Its about clipboard history.
- Session is the working status you are having with the file.
:mksessionto save- Similarly,
:mkviewto save view
- To create tag list, we can use ctag (most popular), vtags etc.
- Let vim know where is the tag file and it will be able to navigate
- Plugin tagbar can present.
iabbrev <buffer> for( for (x=0;x<var;x++){<cr><cr>}
autocmd BufNewFile *.html 0r $VIMHOME/templates/html.tplautocmd BufNewFile * silent! 0r $VIMHOME/templates/%:e.tpl
- map :NERDTreeToogle
- map dd
- imap : insert mode mapping
- nmap : normal mode
- noremap : no recursive mapping
- nnoremap : normal mode noremap
- See details with
:help :map-commands
//TODO
:vimgrep /import/ **search all:vimgrep /import/g **search all. result inlcude a line for each match. And will jump to result.:vimgrep /import/j **search all. Silent search. Use clist to check.:vimgrep /import/ *.md:vimgrep /import/ **/*.md:clist:cnext:cprevious
- Set is used to set system-defined fields (vim refers it as option)
- Let is used to set custom fields
- System-defined fields (aka options) types:
- Toggle option (aka boolean field)
- Number option (aka int field)
- String option (aka string field)
- :set all - show all set options
- :set number - turn on boolean field
- :set number? - query field
- :set number! - toogle boolean field
- :set tabwidth=4 - set non boolean field
- :help set
Commands below can be run under normal mode. Most of them has counter-part
- { : beginning of paragraph
- ( : beginning of sentence
[[: last definition- gd : go to definition of field/function
- gf : go to dependency file (doesn't really work well...)
- [Times][Actions][Where]
- [Times] is a number
- [Actions]: d, y, p, g and etc
- [Where]: w, b, e, {, ) and etc
- For example: 3de
- Vim will check ~/.vim/pack/ after boots and load .vimrc
- All packages will be the added to
runtimepath - Use
:help packagesto get more info - Packages are composed of plugins
- Ask for help with
:help *topic*
- Installation:
- download the pathogen.vim to ~/.vim/autoload/pathogen.vim
- add to vimrc: execute pathogen#infect()
- Usage: download any plugin into ~/.vim/bundle/ and pathogen will auto-deploy the plugin, so no need to change config file# The plugin manager pathogen: