Vim Cheatsheet
Adding scripts coming from vim.org
Eg:
Script to add => Rename2.vim
Add the following in Vundle plugin:
{% highlight ruby %} Plugin 'vim-scripts/Rename2' {% endhighlight %}
Steps to record a macro
- In normal mode press "q"
- Press another key to register for the macro
- Perform operations
- Again press "q" to end the macro
- Call the macro by pressing @ then the registered key
Find and Replace with confirmation
vimscript
:%s/old/new/gc
Where old is the string you want to replace and new would be the replacement
vim-surround
key | function |
---|---|
cst | change surrounding tag |
dst | delete surrounding tag |
cit | change innter tag |
dit | delete inner tag |
ysst | surround with tag |
yss[ | surround with bracket |