现在,这可能是显而易见的事情,并且已经为所有人解决,但我只是想到了,所以请仁慈...
是否有一个Vim插件(用于编写降价文本时),使您能够以某种方式插入链接Ctrl- L在这里(StackOverflow)即可。或类似的东西。
例如,我写了一个链接http://www.google.com,按Ctrl- 键L,它将链接移动到页面底部,用[description] [28]代替,其中28是当前的(增加倒数第二个)标识符。
任何人?有什么相似之处吗?
小智 5
我使用自定义宏从系统剪贴板插入链接(在OS X和Windows上使用Vim 7.3进行了测试,也应该在Linux上也可以使用),并在我认为合适时使用formd将生成的内联样式链接转换为引用样式。
我在我的这些宏.vimrc:
" Create a Markdown-link structure for the current word or visual selection with
" leader 3. Paste in the URL later. Or use leader 4 to insert the current
" system clipboard as an URL.
nnoremap <Leader>3 ciw[<C-r>"]()<Esc>
vnoremap <Leader>3 c[<C-r>"]()<Esc>
nnoremap <Leader>4 ciw[<C-r>"](<Esc>"*pli)<Esc>
vnoremap <Leader>4 c[<C-r>"](<Esc>"*pli)<Esc>
Run Code Online (Sandbox Code Playgroud)
并使用这些调用formd位于我的~/bin/文件夹中的文件:
" Use formd to transfer markdown from inline to reference links and vice versa
" see: http://drbunsen.github.com/formd/
nmap <leader>fr :%! ~/bin/formd -r<CR>
nmap <leader>fi :%! ~/bin/formd -i<CR>
Run Code Online (Sandbox Code Playgroud)
因此,我只复制了所需的链接,导航到该单词(或使用可视模式选择更多单词)以变成一个链接并点击,4。如果我知道我将链接一个单词或选区,但还没有URL,则单击,3并在宏中插入所需的括号为空。
击中,fr会产生参考样式。如果需要,,fi返回到内联样式的链接。