Random tips
arysom opened this issue · 4 comments
Some tips I have in vimrc.
"http://stackoverflow.com/questions/13232262/how-to-disable-tab-completion-for-tags-in-vim
"The default value of complete option is .,w,b,u,t,i, which means to scan:
". the current buffer
"w buffers in other windows
"b other loaded buffers
"u unloaded buffers
"t tags
"i included files
set cpt-=t
This function is probably for completing from current buffer, I must admit I don't know exactly.
function! Tab_Or_Complete()
if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
return "\<C-N>"
else
return "\<Tab>"
endif
endfunction
:inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>
:set dictionary="/usr/dict/words"
This one to remove everything from vimdow.
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L "remove left-hand scroll bar
au GUIEnter * simalt ~x "maxminze windowns
Auto reload vimrc when editing it.
autocmd! bufwritepost .vimrc source ~/.vimrc
Disable sound on errors.
set noerrorbells
set novisualbell
set t_vb=
set tm=500
This function is probably for completing from current buffer, I must admit I don't know exactly.
maybe this is func of complete plugins ,such as deoplete or ycm
I use garbas/vim-snipmate, but I think it has nothing to do with it. It's just word completion.
you can try with neosnippet.vim, which provid expand args after compeltion.
for example if you complete a methon test(arg1,arg2)
then after completion ,you can use tab jump from arg1 to agr2 ,and also can jump out of pairs
From the list above, I added reload on save
, disable bells
, and faster keyword completion
.
The function Tab_Or_Complete()
simply checks if there's only leading whitespace on the line and then inserts a literal \t
character. Otherwise (that is, there's text before the cursor) it tries auto completion via <c-n>
. I like to extend this function and use it in the Vim scripting
section later on. :)
Thanks for the feedback!