Skip to content

Instantly share code, notes, and snippets.

@fukajun
Created June 29, 2015 14:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save fukajun/81397a29fedbf5dccb4c to your computer and use it in GitHub Desktop.
コードをコピーしてコメント付きのMarkdownをレジスタに登録する
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