The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 4: | Line 4: | ||
|previous=843 |
|previous=843 |
||
|next=846 |
|next=846 |
||
− | |created=2005 |
+ | |created=January 5, 2005 |
|complexity=basic |
|complexity=basic |
||
|author=Anders Thøgersen |
|author=Anders Thøgersen |
||
− | |version= |
+ | |version=5.7 |
|rating=1/7 |
|rating=1/7 |
||
|category1= |
|category1= |
||
Line 22: | Line 22: | ||
nnoremap wq :silent! normal mpeld bhd `ph<CR> |
nnoremap wq :silent! normal mpeld bhd `ph<CR> |
||
</pre> |
</pre> |
||
− | |||
− | ==See also== |
||
⚫ | |||
==Comments== |
==Comments== |
||
Line 40: | Line 37: | ||
vmap <silent> <Leader>qs :call Quote("'")<CR> |
vmap <silent> <Leader>qs :call Quote("'")<CR> |
||
vmap <silent> <Leader>qd :call Quote('"')<CR> |
vmap <silent> <Leader>qd :call Quote('"')<CR> |
||
− | function! Quote(quote) |
+ | function! Quote(quote) " {{{ |
let save = @" |
let save = @" |
||
silent normal gvy |
silent normal gvy |
||
Line 46: | Line 43: | ||
silent normal gvp |
silent normal gvp |
||
let @" = save |
let @" = save |
||
− | endfunction |
+ | endfunction " }}} |
</pre> |
</pre> |
||
Line 53: | Line 50: | ||
<pre> |
<pre> |
||
" Quote a word consisting of letters from iskeyword. |
" Quote a word consisting of letters from iskeyword. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
normal mz |
normal mz |
||
exe 's/\(\k*\%#\k*\)/' . a:quote . '\1' . a:quote . '/' |
exe 's/\(\k*\%#\k*\)/' . a:quote . '\1' . a:quote . '/' |
||
normal `zl |
normal `zl |
||
+ | endfun |
||
− | endfunction |
||
− | + | fun! UnQuote() |
|
normal mz |
normal mz |
||
exe 's/["' . "'" . ']\(\k*\%#\k*\)[' . "'" . '"]/\1/' |
exe 's/["' . "'" . ']\(\k*\%#\k*\)[' . "'" . '"]/\1/' |
||
normal `z |
normal `z |
||
+ | endfun |
||
− | endfunction |
||
+ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</pre> |
</pre> |
||
---- |
---- |
||
⚫ | |||
− | Surround current word or visually selected text with double quotes: |
||
+ | |||
− | <pre> |
||
+ | ---- |
||
− | nnoremap <Leader>" ciw"<C-r>""<Esc> |
||
− | vnoremap <Leader>" c"<C-r>""<Esc> |
||
− | </pre> |