diff --git a/vim/vimrc b/vim/vimrc index 85bf10f..4314a1f 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -81,12 +81,6 @@ endif " ============================================================================== " Status Line " ============================================================================== -function! GitBranch() abort " Fetch the Git branch of cwd - let l:branchname = system("git rev-parse --abbrev-ref HEAD 2>/dev/null - \ | tr -d '\n'") - return strlen(l:branchname) > 0 ? '#'.l:branchname : '' -endfunction - set laststatus=2 " Enable the statusline set statusline= " Initialize it set statusline+=%3*%m " Modified flag @@ -122,6 +116,26 @@ nnoremap f :edit ~/.dotfiles/ nnoremap F :tabnew ~/.dotfiles/ " Emulate vim-vinegar nnoremap - :silent edit =empty(expand('%')) ? '.' : expand('%:p:h') +" Some notes/wiki shortcuts +nnoremap ww :edit ~/Documents/Wiki/index.md +nnoremap ws :vsplit ~/Documents/Wiki/scratchpad.md +nnoremap wt :vsplit ~/Documents/Wiki/to-do.md +nnoremap wd :edit ~/Documents/Wiki/diary/diary.wiki +nnoremap tj :call NewJournal() +" ============================================================================== +" Functions +" ============================================================================== +" Read from the journal template, and replace 'Date' with today's date +function! NewJournal() abort + .-1read ~/.vim/templates/journal + s/Date/\=strftime("%A, %B %d")/ +endfunction +" Fetch the git branch of the current file, if applicable +function! GitBranch() abort + let l:branchname = system("git rev-parse --abbrev-ref HEAD 2>/dev/null + \ | tr -d '\n'") + return strlen(l:branchname) > 0 ? '#'.l:branchname : '' +endfunction " ============================================================================== " Plugins " ============================================================================== diff --git a/vim/vimrc-plugins b/vim/vimrc-plugins index e042bb4..fe18bab 100644 --- a/vim/vimrc-plugins +++ b/vim/vimrc-plugins @@ -10,26 +10,12 @@ endif call plug#begin('~/.vim/bundle') Plug 'tpope/vim-fugitive' - Plug 'vimwiki/vimwiki' Plug 'tpope/vim-unimpaired' Plug 'tpope/vim-commentary' - Plug 'ajh17/VimCompletesMe' "Plug 'ludovicchabant/vim-gutentags' Plug 'sheerun/vim-polyglot' Plug 'junegunn/goyo.vim' Plug 'tpope/vim-tbone' call plug#end() - -" ============================================================================== -" Plugin Configuration -" ============================================================================== -" Vimwiki Configs -let g:vimwiki_list = [{'path': '~/Workbench/vimwiki/', 'auto_tags': 1}] -"" Insert my journal template, and the current date -nnoremap tj :call NewJournal() -function! NewJournal() abort - .-1read ~/.vim/templates/journal - s/Date/\=strftime("%A, %B %d")/ -endfunction