Last active
June 26, 2020 08:04
-
-
Save jborza/b1c1ac4991d81a9c724883f232905524 to your computer and use it in GitHub Desktop.
my .vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
filetype plugin indent on | |
" expand tab 2 spaces | |
set expandtab | |
set tabstop=2 | |
set softtabstop=2 | |
" indenting with > | |
set shiftwidth=2 | |
autocmd FileType c,cpp setlocal equalprg=clang-format | |
" map return key in insert mode to produce ctrl+y in (autocomplete) popup menu | |
inoremap <expr> <CR> pumvisible() ? "\<C-Y>" : "\<CR>" | |
" tab completion - tab on line beginning, else autocomplete | |
function! InsertTabWrapper() | |
let col = col('.') - 1 | |
if !col || getline('.')[col - 1] !~ '\k' | |
return "\<tab>" | |
else | |
return "\<c-p>" | |
endif | |
endfunction | |
inoremap <expr> <tab> InsertTabWrapper() | |
inoremap <s-tab> <c-n> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment