Skip to content

Instantly share code, notes, and snippets.

@pedrox86lopes
Created February 7, 2015 23:26
Show Gist options
  • Save pedrox86lopes/de3fc7beef4d9d6c64f9 to your computer and use it in GitHub Desktop.
Save pedrox86lopes/de3fc7beef4d9d6c64f9 to your computer and use it in GitHub Desktop.
.vimrc
function AutoCompletar(direcao)
let posicao = col(".") - 1
if posicao || getline(".")[posicao - 1] !~ '\k'
return "\<Tab>"
elseif a:direcao == "avancar"
return "\<C-n>"
else
return "\<C-p>"
endif
endfunction
inoremap <Tab> <C-R>=AutoCompletar("avancar")<CR>
inoremap <S-Tab> <C-R>=AutoCompletar("voltar")<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment