Excerpts from stardiviner's message of Mon Jun 13 10:18:06 +0200 2011:
> I installed vim plugin *vimwiki*
> sometimes I copied multiple lines of code from website into vimwiki.
> In vimwiki, code is between ` ` 
> so I hope that I can have a simple way to add ` ` for each code line. 
> like this: 
> print hello -> ` print hello `
> that's it. 
> can you support a simple macro or function to let me bind a key. 
> destination: 
>     a macro or function. then I can use V to visual multiple line. then press 
> a key bind to add ` `. 

Macro: q<any char> then @<any char> to run macro.

|print line

if | is cursor do qqi` <esc>A`jq
The j should move cursor to the new line, then do @q then @@ until all
lines have ``.

Alternative: Visually select and then type :s/\(.*\)/`\1\`/
Vim will add '<,'> or such for you after : which is fine.
 
 this remembers the line and replaces the line by `\1` where \1 is what
 was  remembered.

Marc Weber

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to