diff --git a/vim/vimrc.symlink b/vim/vimrc.symlink index efe653d..4ae0b18 100644 --- a/vim/vimrc.symlink +++ b/vim/vimrc.symlink @@ -288,6 +288,28 @@ function! ApplyLocalSettings(dirname) endfunction autocmd! BufEnter * call ApplyLocalSettings(expand(":p:h")) +" smart tab completion +function! Smart_TabComplete() + let line = getline('.') + let substr = strpart(line, -1, col('.')+1) + + let substr = matchstr(substr, "[^ \t]*$") + if (strlen(substr) == 0) + return "<\tab>" + endif + let has_period = match(substr, '\.') != -1 + let has_slash = match(substr, '\/') != -1 + if (!has_period && !has_slash) + return "\\" + elseif (has_slash) + return "\\" + else + return "\\" + endif +endfunction + +inoremap =Smart_TabComplete() + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Plugins """""""""""""""""""""""""""""""""""""""""""""""""""""""""""