-
-
Save note103/2efcf0f51203a7a5b45ce31de557238b to your computer and use it in GitHub Desktop.
For Scrapbox article
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! 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