Skip to content

Commit

Permalink
neovim: add wrapper for vim-dotoo
Browse files Browse the repository at this point in the history
Search for the current heading for `gI`, `gO` and `cit`.
dhruvasagar/vim-dotoo#42
  • Loading branch information
paretje committed Nov 26, 2016
1 parent 018a99f commit cc3cca8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ au FileType dotooagenda setlocal nowrap
au FileType dotooagenda nnoremap <buffer> / :call dotoo#agenda#filter_agendas()<CR>tags<CR>
au BufHidden nmbs.org setlocal nobuflisted
au BufEnter ~/vcs/personal/notes/*.org call GitRoot() | au BufLeave <buffer> call ResetRoot()
au FileType dotoo nnoremap <buffer> <silent> gI :call VimDotoo('clock#start')<CR>
au FileType dotoo nnoremap <buffer> <silent> gO :call VimDotoo('clock#stop')<CR>
au FileType dotoo nnoremap <buffer> <silent> cit :call VimDotoo('change_todo')<CR>
" Java ft options
au FileType java setlocal tags+=/usr/lib/jvm/openjdk-8/tags
Expand Down Expand Up @@ -640,3 +643,11 @@ fun! GitAutocommit(...)
execute '!git -C ~/vcs/personal/notes autocommit'
endif
endfun

fun! VimDotoo(func)
let l:pos = getcurpos()
call search('^\*', 'b')
exe 'call dotoo#' . a:func . '()'
call setpos('.', l:pos)
normal! zO
endfun

0 comments on commit cc3cca8

Please sign in to comment.