aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-03-22 18:11:28 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-03-22 18:11:28 +0100
commit0d7c827359dd35d0069532a829b6728b3ca84ad4 (patch)
treee76511458dcc45761fe6d8ce7df700ca02b1f79a
parent399065f7793eec9778f3e4486c6ca5e5fbdd091e (diff)
downloaddotfiles-0d7c827359dd35d0069532a829b6728b3ca84ad4.tar.gz
vim updates
m---------.vim/bundle/completor.vim0
m---------.vim/bundle/nerdtree0
m---------.vim/bundle/nerdtree-git-plugin0
m---------.vim/bundle/todo.txt-vim0
m---------.vim/bundle/vim-airline0
m---------.vim/bundle/vim-airline-themes0
m---------.vim/bundle/vim-pathogen0
m---------.vim/bundle/vimagit0
-rw-r--r--.vim/vimrc29
9 files changed, 29 insertions, 0 deletions
diff --git a/.vim/bundle/completor.vim b/.vim/bundle/completor.vim
-Subproject 7af7d5b5cc9f2b9834a287cc832ae74dfd0ca83
+Subproject 69718e96e57610fc4f0ab969da31006485af4d7
diff --git a/.vim/bundle/nerdtree b/.vim/bundle/nerdtree
-Subproject aaa946fb6bd79b9af86fbaf4b6b63fd81d839bd
+Subproject 577ddc73f0a1d2fd6166ed3268ab8536111037e
diff --git a/.vim/bundle/nerdtree-git-plugin b/.vim/bundle/nerdtree-git-plugin
-Subproject 5fa0e3e1487b17f8a23fc2674ebde5f55ce6a81
+Subproject a8c031f11dd312f53357729ca47ad493e798aa8
diff --git a/.vim/bundle/todo.txt-vim b/.vim/bundle/todo.txt-vim
-Subproject 9bff4b6bf1bd5c8911f8adf115823408fb96265
+Subproject 109c2d298fefa92fdfeb433097466ce1606f7bd
diff --git a/.vim/bundle/vim-airline b/.vim/bundle/vim-airline
-Subproject f39208f1a074fb525270312a20c87521a50c74e
+Subproject 3740312de0be5200286260816e2563e77c0be0c
diff --git a/.vim/bundle/vim-airline-themes b/.vim/bundle/vim-airline-themes
-Subproject 8f1aa2c7fa44bf33b1fd4678f9c7b40c126b0e2
+Subproject 155bce6665ab8c83447102e8402cc9d3b7c3b3f
diff --git a/.vim/bundle/vim-pathogen b/.vim/bundle/vim-pathogen
-Subproject c6bc42404597c718e4a032a98e21e63321cbb05
+Subproject e0a3efbda5ea8e5b181b2b232ef6453c05d0773
diff --git a/.vim/bundle/vimagit b/.vim/bundle/vimagit
-Subproject aaf1278f03e866f0b978d4b0f0cc7084db25112
+Subproject bf7b16e99e075b019e56f2fbfb96c493ca3635e
diff --git a/.vim/vimrc b/.vim/vimrc
index d98bb5f..bda5c62 100644
--- a/.vim/vimrc
+++ b/.vim/vimrc
@@ -15,6 +15,8 @@ let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#whitespace#enabled = 1
let g:airline_powerline_fonts = 1
+let g:completor_clang_binary = '/usr/bin/clang'
+
"All things cursor
set guicursor+=a:blinkon0 "disable blinking
if &term =~ "xterm\\|rxvt"
@@ -97,6 +99,12 @@ inoremap {} {}<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {;<CR> {<CR>};<ESC>O
+" completor
+
+inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
+inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
+inoremap <expr> <Tab> Tab_Or_Complete()
+
" ===========
" COMMANDS
" ===========
@@ -138,6 +146,27 @@ function Run_in_terminal(prog)
startinsert
endfunction
+" Use TAB to complete when typing words, else inserts TABs as usual. Uses
+" dictionary, source files, and completor to find matching words to complete.
+
+" Note: usual completion is on <C-n> but more trouble to press all the time.
+" Never type the same word twice and maybe learn a new spellings!
+" Use the Linux dictionary when spelling is in doubt.
+function! Tab_Or_Complete() abort
+ " If completor is already open the `tab` cycles through suggested completions.
+ if pumvisible()
+ return "\<C-N>"
+ " If completor is not open and we are in the middle of typing a word then
+ " `tab` opens completor menu.
+ elseif col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^[[:keyword:][:ident:]]'
+ return "\<C-R>=completor#do('complete')\<CR>"
+ else
+ " If we aren't typing a word and we press `tab` simply do the normal `tab`
+ " action.
+ return "\<Tab>"
+ endif
+endfunction
+
" helper function to toggle hex mode
function ToggleHex()
" hex mode should be considered a read-only operation