From d98459ae4b1b46e381a62f38f177da22b1406f68 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 26 Jul 2021 07:54:07 +0200 Subject: Added vim autocompletion with Tab and Shift-Tab instead of C-n/C-p --- config/vim/vimrc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config/vim/vimrc b/config/vim/vimrc index 7d2441b..9f5c8fb 100644 --- a/config/vim/vimrc +++ b/config/vim/vimrc @@ -335,3 +335,19 @@ nnoremap ss :setlocal spell! hi link juliaFunctionCall Identifier hi link juliaParDelim Delimiter + +nnoremap gf :vsp + +" from: https://vim.fandom.com/wiki/Autocomplete_with_TAB_when_typing_words + +function! TabOrComplete(direction) + if col('.') > 1 && strpart(getline('.'), col('.') - 2, 3) =~# '^\w' + return a:direction ==# 'next' ? "\" : "\" + else + return "\" + endif +endfunction + +inoremap =TabOrComplete('next') +" st maps Shift-Tab to [Z (and it's discouraged to change it) +inoremap [Z =TabOrComplete('prev') -- cgit