Guest User

Untitled

a guest
Jan 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. fun! CleverTab()
  2. if col('.') > 1
  3. let beginning = strpart( getline('.'), 0, col('.')-1 )
  4. else
  5. let beginning = ''
  6. endif
  7.  
  8. if l:beginning == '' || l:beginning =~ '\s$'
  9. return "\<Tab>"
  10. elseif (l:thisWord =~ '/')
  11. return "\<C-X>\<C-F>"
  12. else
  13. "return "\<C-X>\<C-O>"
  14. return "\<C-P>"
  15. endif
  16. endfunction
  17. imap <Tab> <C-R>=CleverTab()<CR>
Add Comment
Please, Sign In to add comment