Created
June 29, 2015 14:24
-
-
Save fukajun/81397a29fedbf5dccb4c to your computer and use it in GitHub Desktop.
コードをコピーしてコメント付きのMarkdownをレジスタに登録する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Memo() range | |
let tmp = @@ | |
silent normal gvy | |
let selected = @@ | |
let @@ = tmp | |
let line = line('.') | |
let memo = input('memo: ') | |
let fpath = expand('%:p') | |
let buf = '' | |
let buf = buf . "\n" | |
let buf = buf . memo . "\n" | |
let buf = buf . "```" . fpath . ":" . line . "\n" | |
let buf = buf . selected . "\n" | |
let buf = buf . "```\n" | |
let @0 = buf | |
let @+ = buf | |
endfunction | |
vnoremap <leader>m :call Memo()<Return> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment