Skip to content

Instantly share code, notes, and snippets.

@nhooyr
Created February 29, 2016 06:27
Show Gist options
  • Save nhooyr/9808b840a2a46f1aed4d to your computer and use it in GitHub Desktop.
Save nhooyr/9808b840a2a46f1aed4d to your computer and use it in GitHub Desktop.
inoremap <silent><expr><Tab> pumvisible() ? "\<c-n>"
\ : (<SID>is_whitespace() ? "\<Tab>" : deoplete#mappings#manual_complete())
inoremap <expr><S-Tab> pumvisible() ? "\<c-p>" : "\<c-h>"
function! s:is_whitespace()
let col = col('.') - 1
return !col || getline('.')[col - 1] =~? '\s'
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment