aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2021-09-29 09:46:47 +0800
committerGuangxiong Lin <[email protected]>2021-09-29 09:46:47 +0800
commit25af66099396cd5d27d0861fd4ea7db84b6b095b (patch)
tree715fe9471fa87fba0d4ac537f06f8c93202db772
parentbc1e8a4191fbdfc65e493d65a9c4f0fdaa2b1d19 (diff)
downloaddotfiles-25af66099396cd5d27d0861fd4ea7db84b6b095b.tar.gz
dotfiles-25af66099396cd5d27d0861fd4ea7db84b6b095b.tar.bz2
dotfiles-25af66099396cd5d27d0861fd4ea7db84b6b095b.zip
Add scripts to create notes
-rw-r--r--.aliases3
-rw-r--r--.vim/notes.vim18
-rw-r--r--.vimrc1
3 files changed, 21 insertions, 1 deletions
diff --git a/.aliases b/.aliases
index 79edb52..eee9f0d 100644
--- a/.aliases
+++ b/.aliases
@@ -3,4 +3,5 @@
alias emacs='emacs -nw'
alias mu4e='emacs -nw -f mu4e'
alias magit='emacs -nw -f magit'
-alias todo='emacs -nw ~/journals/todo.org'
+alias nb='cd ~/journals; vim index.md; cd -'
+alias todo='cd ~/journals; vim gtd.md; cd -'
diff --git a/.vim/notes.vim b/.vim/notes.vim
new file mode 100644
index 0000000..c56896e
--- /dev/null
+++ b/.vim/notes.vim
@@ -0,0 +1,18 @@
+let s:search_dir = ' ~/diaries ~/journals ~/notes '
+
+command! -bang FzfNoteFiles
+ \ call fzf#run(fzf#wrap(fzf#vim#with_preview({
+ \ 'source': 'fd --type f . ' . s:search_dir,
+ \ 'sink': 'edit',
+ \ }), <bang>0))
+
+command! -bang -nargs=* FzfNoteRg
+ \ call fzf#vim#grep(
+ \ 'rg --column --line-number --no-heading --color=always --smart-case -e '
+ \ . shellescape(<q-args>) . s:search_dir, 1,
+ \ fzf#vim#with_preview(), <bang>0)
+
+nnoremap <leader>ww :edit ~/journals/index.md<CR>
+nnoremap <leader>wn :edit ~/journals/gtd.md<CR>
+nnoremap <leader>wf :FzfNoteFiles<CR>
+nnoremap <leader>wr :FzfNoteRg<space>
diff --git a/.vimrc b/.vimrc
index 6ee6097..a3b3e98 100644
--- a/.vimrc
+++ b/.vimrc
@@ -100,6 +100,7 @@ nnoremap <leader>cd :cd %:p:h<CR> :pwd<CR>
source ~/.vim/plugin/init.vim
source ~/.vim/keybindings.vim
+source ~/.vim/notes.vim
silent colorscheme onedark