throughpairs : spread or shrink the space of parenthesis symmetrically & smart traverse paren
script karma |
Rating 10/10,
Downloaded by 1675 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Han-seok Ryu |
|
script type |
ftplugin |
|
description |
1. traverse
map <M-f> : forward traverse parentheses, will stop at end position
imap <M-b> : backward traverse parentheses, will stop at start position
let abc = func( foo( xyz ), love( child(toy, food(water) ), parent ) )
| | | | |
| | | | |
2. spread or shrink
imap <M-l> : spread out parentheses
imap <M-h> : shink parentheses
3. easy pass
<C-j> especially, in python coding can pass through "..." '...' (...) [...] <...> in insert mode selectively
if the cursor meet keyword (say, class object(abc), if (...), for(...), etc.)
<C-j> key will work as <right arrow> or <tab> or <enter> or spot ":" and <enter>
so as to user don't care about which key to press.
("'[{word▌}]'")
("'[{word}▌]'")
("'[{word}]▌'")
("'[{word}]'▌")
("'[{word}]'"▌)
("'[{word}]'")▌
in python
def func(▄)
def func():
▄
in C
void func(▄)
void func() {
▄
}
else works like enter key if the pos of cursor is at last column.
You can add or modify
let g:closingList = ["'",'"',")","]",">","}","$",'']
in which <C-j> key can pass through.
Note : all work will be done in insert mode except <M-f>
|
|
install details |
drop in your vimfiles/plugin
or
using Bundle
in your .vimrc ( _vimrc for windows )
Bundle 'https://github.com/escher9/throughpairs'
|
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 18.217.230.80
|