Instantly share code, notes, and snippets.

@note103 /.vimrc.vim Secret
Created Aug 31, 2018

Embed
What would you like to do?
For Scrapbox article
function! s:sbnew(prj)
let prj = a:prj
let input = input('This is @'.prj.': Other Project? [n]: ')
if input != ""
let prj = input
endif
let ans = input('Create? @'.prj.' (y/n) [n]: ')
if ans != 'y'
redraw
echo 'Canceled!'
return
endif
let datetime = strftime('%Y-%m-%d').'-'.strftime('%H-%M-%S')
call append(0, 'https://scrapbox.io/'.prj.'/'.datetime)
let url = getline(1)
execute ':OpenBrowser '.url
execute ':2'
execute ':normal VGy'
endfunction
nnoremap <silent><Leader><Leader>sa :<C-u>call <SID>sbnew('note103')<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment