X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/0ab90df02f6d6585faa686fd715a41be044769b1..d2b5677d781f21772f94e3e824e49f48ecbee8aa:/vimrc diff --git a/vimrc b/vimrc index 77ebad0..94c32a8 100644 --- a/vimrc +++ b/vimrc @@ -107,6 +107,18 @@ set nrformats=hex " number formats recognized for CTRL-A and CTRL- " whether to use a popup menu for Insert mode completion set completeopt=longest,menuone,preview +" Indent if we're at the beginning of a line. Else, do completion. +function! InsertTabWrapper() + let col = col('.') - 1 + if !col || getline('.')[col - 1] !~ '\k' + return "\" + else + return "\" +endif +endfunction +inoremap =InsertTabWrapper() +inoremap + " fix legacy vi inconsistency map Y y$ @@ -159,7 +171,7 @@ set writebackup " write a backup file before overwriting a file set backup " keep a backup after owerwriting a file set backupdir=$HOME/.vim/backupdir -set undofile " persistent undo history +set undofile " persistent undo history set undodir=$HOME/.vim/backupdir set autowrite " automatically write a file when leaving a modified buffer @@ -227,4 +239,3 @@ if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis \ | wincmd p | diffthis endif -