Skip to content

Instantly share code, notes, and snippets.

@violetyk
Last active December 28, 2015 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save violetyk/7541486 to your computer and use it in GitHub Desktop.
Save violetyk/7541486 to your computer and use it in GitHub Desktop.
memolistの設定
" memolist.vim {{{
let g:memolist_memo_suffix = "md"
let g:memolist_memo_date = "%Y-%m-%d %H:%M"
let g:memolist_prompt_tags = 1
" let g:memolist_prompt_categories = 1
" let g:memolist_filename_prefix_none = 1
let g:memolist_template_dir_path = '~/dotfiles/memotemplates'
let g:memolist_unite = 1
let g:memolist_unite_option = "-start-insert -vertical"
let g:memolist_unite_source = "file_rec"
" Function: s:MemoRemove() メモをゴミ箱に入れる。 {{{
function! s:MemoRemove()
let src = g:memolist_path . '/' . expand("%:t")
let trash_path = g:memolist_path . '/../.trash'
let dest = trash_path . '/' . expand("%:t") . '.del.' . strftime("%Y%m%d_%H%M")
let name = expand("%:t:r")
if !filereadable(src)
return 0
endif
let choice = confirm('Remove ' . name . " ?", "&Yes\n&No", 0)
if choice == 0
" Was interrupted. Using Esc or Ctrl-C.
return 0
elseif choice == 1
let result1 = system("mkdir -p " . trash_path)
let result2 = system("mv " . src . " " . dest)
if strlen(result1) != 0 && strlen(result2) != 0
echohl WarningMsg | redraw | echo 'Error!' | echohl None
return 0
else
execute "normal bd"
return 1
endif
endif
return 0
endfunction "}}}
nnoremap <Leader>mc :MemoNew<CR>
nnoremap <Leader>mg :MemoGrep<CR>
nnoremap <Leader>ml :MemoList<CR>
nnoremap <silent> <Leader>md :call <SID>MemoRemove()<CR>
" }}}
@honbin
Copy link

honbin commented Nov 19, 2013

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment