From 5593e743e757dc5ed35cd54c2690c3006172d74f Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Sat, 28 Jan 2017 16:12:56 +0200 Subject: [PATCH] Add Unite and Neostrophic menu --- neostrophic.vim | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/neostrophic.vim b/neostrophic.vim index 6ec5642..c82ee94 100644 --- a/neostrophic.vim +++ b/neostrophic.vim @@ -68,7 +68,7 @@ Plug 'Shougo/echodoc.vim' " --- Syntax and completion engine components Plug 'Shougo/context_filetype.vim' -"Plug 'Shougo/denite.nvim', {'do': function('URP')} +Plug 'Shougo/unite.vim' Plug 'Shougo/vimproc.vim', {'do' : 'make'} " C++ @@ -289,6 +289,41 @@ autocmd! User GoyoLeave nested call on_goyo_leave() " Markdown let g:markdown_include_jekyll_support = 0 +" Own Unite menu +" Thanks to: http://vi.stackexchange.com/a/591 + +if !exists('g:unite_source_menu_menus') + let g:unite_source_menu_menus = {} +endif +let g:unite_source_menu_menus.neostrophic_menu = {'description': 'Neostrophic menu'} + +function! g:unite_source_menu_menus.neostrophic_menu.map(key, value) + return { + \ 'word': a:key, + \ 'kind': 'command', + \ 'action__command': a:value + \ } +endfunction + +let g:unite_source_menu_menus.neostrophic_menu.command_candidates = [ +\ ['▷ Syntastic: toggle checking mode C-A-f', 'SyntasticToggleMode'], +\ ['▷ Neostrophic: grep for TODOs ', 'grep TODO'], +\ ['▷ Git: preview hunk ,hp', 'GitGutterPreviewHunk'], +\ ['▷ Git: stage hunk ', 'GitGutterStageHunk'], +\ ['▷ Git: undo hunk ,hr', 'GitGutterUndoHunk'], +\ ['▷ Git: move to next changed hunk ', 'GitGutterNextHunk'], +\ ['▷ Git: move to previous changed hunk ,hr', 'GitGutterPrevHunk'], +\ ['▷ Git: blame ', 'Gblame'], +\ ['▷ Git: pull ', 'Gpull'], +\ ['▷ Git: diff ', 'Gdiff'], +\ ['▷ Git: status ', 'Gstatus'], +\ ['▷ Undo: show tree F6', 'GundoToggle'], +\ ['▷ Goyo: toggle F8', 'Goyo'], +\] + +nnoremap m :Unite menu:neostrophic_menu -start-insert -ignorecase + + " --- Keymaps " Commonly used commands