AssistEnclose.vim : Assist manipulation on brackets, quotes
script karma |
Rating 12/13,
Downloaded by 4857 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Han-seok Ryu |
|
script type |
ftplugin |
|
description |
=========================================================================
[ Usage ]
___________
1. Enclosing
On text
<Alt> + ) (
text → (text)
visual block on 'some text' and <Alt> + )( on text
some text → (some text)
with the same way working on
[...] <...> {....}
<Alt> + ][ or >< or }{
to make each enclosing.
Basically, enclosing range is in the unit of word,
so you don't need care about cursor position precisely.
Regardless of input mode(normal or visual),
put on across somewhere of the word you want.
When to make enclosure with single or double quotations
'...' "..."
<Alt> + '; or ":
(this is to make consistency with other key mapping)
(example)
stdio.h
"stdio.h"
<"stdio.h">
<...> {...} [...] (...) eat over single or double quotations '...' "..."
In (vertical)visual mode (<C-v>)
by pressing <leader> key before same key operation,
you can encapsulate 'on each word'.
w◘rd
w◘rd
w◘rd
(word)
(word)
(word)
__________________________
2. Delete contents in enclosure
On the word enclosed with (...)
<Alt> + ((
Same way is applied to
{...} [...] <...> "..." '...'
<Alt> + {{ [[ << :: ;; on each
___________________________________
3. Delete enclosure leaving contents intact
On the word enclosed with (...)
<Alt> + ))
Same way is applied to
{...} [...] <...> "..." '...'
<Alt> + }} ]] >> "" '' on each
________________________________________
4. Blow out the contents at once in the enclosure
hit <A-;'> to blow out in '...' or "..."
hit <A-[]> to blow out in [...] <...> {...} (...)
You can also rearrange "priority order" by modifying g:ListBraTotal
Default order is {...} (...) <...> [...]
← →
High Low
___________________________________
5. when manipulate snippets file or html file
word -> ${1:word} when in .snipptes
word -> <em>word</em> when in .html
word -> \emph{word} when in .tex
with Alt + ][
______________
6. smart escape
This function is separated to easy-through-pairing.vim
for functional rearrangement.
please, check if you thought this script not bad.
http://www.vim.org/scripts/script.php?script_id=4578
--------------------------------------------------------------------------
[ NOTE ]
You would have get more help from following scripts.
Ckeck out,
surround.vim
http://www.vim.org/scripts/script.php?script_id=1697
autoclose.vim
http://www.vim.org/scripts/script.php?script_id=1849 |
|
install details |
Just drop in .vim/plugin or vimfiles/plugin |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 44.220.184.63
|