From d58fe541bca03e9ce220ef3163d84bf1031279ab Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Fri, 17 Dec 2021 23:26:54 +0100 Subject: [PATCH] init: Fix settings for root --- init.vim | 175 ++++++++++++++++++++++++++-------------------------- plugins.vim | 5 +- 2 files changed, 92 insertions(+), 88 deletions(-) diff --git a/init.vim b/init.vim index 845bc42..50cb6b4 100644 --- a/init.vim +++ b/init.vim @@ -204,7 +204,7 @@ let g:detectspelllang_langs = {} let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT'] au FileType mail let g:VimMailSpellLangs=['de', 'en'] -:let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'], +let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'], \ ['|', 'OBSOLETE(o)', 'WONT(n)'], \ ['CANCELED(c)']] @@ -228,95 +228,96 @@ let g:VimMailContactsCommands={ let g:vimtex_fold_enabled = 1 let g:vimtex_fold_levelmarker = '➜' -" The denite settings are largely stolen from spacevim -let s:denite_options = { - \ 'default' : { - \ 'winheight' : 15, - \ 'mode' : 'insert', - \ 'start_filter' : 1, - \ 'quit' : 1, - \ 'highlight_matched_char' : 'MoreMsg', - \ 'highlight_matched_range' : 'MoreMsg', - \ 'direction': 'rightbelow', - \ }} - -augroup spacevim_layer_denite - autocmd! - autocmd FileType denite call s:denite_my_settings() -augroup END - -function! s:denite_my_settings() abort - nnoremap i - \ denite#do_map('open_filter_buffer') - nnoremap ' - \ denite#do_map('toggle_select').'j' - nnoremap q - \ denite#do_map('quit') - nnoremap - \ denite#do_map('do_action', 'tabopen') - nnoremap - \ denite#do_map('do_action', 'vsplit') - nnoremap - \ denite#do_map('do_action', 'split') - nnoremap - \ denite#do_map('do_action') - nnoremap p - \ denite#do_map('do_action', 'preview') - nnoremap j - nnoremap k -endfunction - -" FIND and GREP COMMANDS -if executable('rg') - " Ripgrep command on grep source - call denite#custom#var('grep', 'command', ['rg']) - call denite#custom#var('grep', 'default_opts', - \ ['--vimgrep', '--no-heading']) - call denite#custom#var('grep', 'recursive_opts', []) - call denite#custom#var('grep', 'pattern_opt', ['--regexp']) - call denite#custom#var('grep', 'separator', ['--']) - call denite#custom#var('grep', 'final_opts', []) -endif - -let s:insert_mode_mappings = [ - \ ['jk', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ] - -let s:normal_mode_mappings = [ - \ ["'", '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['gg', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['q', '', 'noremap'], - \ ['r', '', 'noremap'], - \ ] - " termdebug split windows let g:termdebug_wide = 1 let termdebugger = $HOME . '/.vim/gdb.sh' -if g:lowendbox == 0 - if has('nvim-0.5') && $USER != "root" +if $USER != "root" && g:lowendbox == 0 + + " The denite settings are largely stolen from spacevim + let s:denite_options = { + \ 'default' : { + \ 'winheight' : 15, + \ 'mode' : 'insert', + \ 'start_filter' : 1, + \ 'quit' : 1, + \ 'highlight_matched_char' : 'MoreMsg', + \ 'highlight_matched_range' : 'MoreMsg', + \ 'direction': 'rightbelow', + \ }} + + augroup spacevim_layer_denite + autocmd! + autocmd FileType denite call s:denite_my_settings() + augroup END + + function! s:denite_my_settings() abort + nnoremap i + \ denite#do_map('open_filter_buffer') + nnoremap ' + \ denite#do_map('toggle_select').'j' + nnoremap q + \ denite#do_map('quit') + nnoremap + \ denite#do_map('do_action', 'tabopen') + nnoremap + \ denite#do_map('do_action', 'vsplit') + nnoremap + \ denite#do_map('do_action', 'split') + nnoremap + \ denite#do_map('do_action') + nnoremap p + \ denite#do_map('do_action', 'preview') + nnoremap j + nnoremap k + endfunction + + " FIND and GREP COMMANDS + if executable('rg') + " Ripgrep command on grep source + call denite#custom#var('grep', 'command', ['rg']) + call denite#custom#var('grep', 'default_opts', + \ ['--vimgrep', '--no-heading']) + call denite#custom#var('grep', 'recursive_opts', []) + call denite#custom#var('grep', 'pattern_opt', ['--regexp']) + call denite#custom#var('grep', 'separator', ['--']) + call denite#custom#var('grep', 'final_opts', []) + endif + + let s:insert_mode_mappings = [ + \ ['jk', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ] + + let s:normal_mode_mappings = [ + \ ["'", '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['gg', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['', '', 'noremap'], + \ ['q', '', 'noremap'], + \ ['r', '', 'noremap'], + \ ] + + if has('nvim-0.5') lua <