| set whichwrap=b,s,<,>,[,] |
| set mouse=a |
| |
| vnoremap // y/\V<C-R>=escape(@",'/\')<CR><CR> |
| |
| fun! SetupCommandAlias(from, to) |
| exec 'cnoreabbrev <expr> '.a:from |
| \ .' ((getcmdtype() is# ":" && getcmdline() is# "'.a:from.'")' |
| \ .'? ("'.a:to.'") : ("'.a:from.'"))' |
| endfun |
| |
| augroup vimrc-auto-mkdir |
| autocmd! |
| autocmd BufWritePre * call s:auto_mkdir(expand('<afile>:p:h'), v:cmdbang) |
| function! s:auto_mkdir(dir, force) |
| if !isdirectory(a:dir) |
| \ && (a:force |
| \ || input("'" . a:dir . "' does not exist. Create? [y/N]") =~? '^y\%[es]$') |
| call mkdir(iconv(a:dir, &encoding, &termencoding), 'p') |
| endif |
| endfunction |
| augroup END |
| " https://stackoverflow.com/a/42872275/12293760 |
| |
| command W w |
| command Wq wq |
| call SetupCommandAlias("git","Git") |
| |
| set ignorecase |
| set smartcase |
| |
| set expandtab |