Skip to content

Commit 1f361fd

Browse files
author
Radosław Woźniak
committed
add syntax complete
1 parent 645499d commit 1f361fd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

vimrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ set laststatus=2 " Always show the statusline
6060
set hidden " Maintain scroll position (don't close buffer)
6161
runtime macros/matchit.vim " Needed for Ruby block selection support: https://github.com/nelstrom/vim-textobj-rubyblock
6262

63+
set ofu=syntaxcomplete#Complete
64+
6365
" Visual
6466
set showmatch " Show matching brackets.
6567
set mat=5 " Bracket blinking.
@@ -118,3 +120,19 @@ map <C-j> <C-W>j
118120
map <C-k> <C-W>k
119121
map <C-h> <C-W>h
120122
map <C-l> <C-W>l
123+
124+
function! SuperCleverTab()
125+
if strpart(getline('.'), 0, col('.') - 1) =~ '^\s*$'
126+
return "\<Tab>"
127+
else
128+
if &omnifunc != ''
129+
return "\<C-X>\<C-O>"
130+
elseif &dictionary != ''
131+
return "\<C-K>"
132+
else
133+
return "\<C-N>"
134+
endif
135+
endif
136+
endfunction
137+
138+
inoremap <Tab> <C-R>=SuperCleverTab()<cr>

0 commit comments

Comments
 (0)