config/shared/home/vimrc

77 lines
2.0 KiB
VimL
Raw Normal View History

2023-10-09 17:17:24 +03:00
syntax on
filetype plugin indent on
set et ts=4 sw=4 sts=4 nu hlsearch ruler ignorecase smartcase nomodeline bg=dark incsearch
2024-06-11 11:36:46 +03:00
set path=**/* backspace=2 nojs signcolumn=no
set laststatus=1 diffopt+=algorithm:patience
2023-10-09 17:17:24 +03:00
nnoremap <Leader>\ gqj
command OLD :enew | setl buftype=nofile | 0put =v:oldfiles | nnoremap <buffer> <CR> :e <C-r>=getline('.')<CR><CR>
" nvim 0.10 uses bland colors. Necessary habits don't die.
2024-11-20 10:03:14 +02:00
" I also liked: industry, koehler, pablo, torte, vim
2024-11-21 12:38:21 +02:00
colorscheme vim
2024-04-09 16:54:23 +03:00
" https://vi.stackexchange.com/a/39451
2024-04-09 16:18:06 +03:00
set maxmempattern=5000
2023-10-09 17:17:24 +03:00
call matchadd('ColorColumn', '\%81v', 100)
2023-10-09 17:17:24 +03:00
" thanks to drew de vault's vimrc, except swearing
set mouse=
set backupdir=~/.cache directory=~/.cache
"nnoremap Q :grep <cword><CR>
nmap gs :grep <cursor><CR>
" bits from vim-sensible
set autoindent smarttab nrformats-=octal
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
set wildmenu sidescrolloff=5 display+=lastline encoding=utf-8
set formatoptions+=j history=1000 tabpagemax=50 sessionoptions-=options
" so Gdiff and vimdiff output are somewhat readable
if &diff
syntax off
endif
" html
au FileType html,gohtmltmpl setlocal ts=2 sw=2 sts=2
" ruby
au BufRead,BufNewFile Vagrantfile setfiletype ruby
" puppet
au BufRead,BufNewFile *.j2 setfiletype django
" avro
au BufRead,BufNewFile *.avsc setfiletype json
au BufRead,BufNewFile *.avsc setlocal ts=2 sw=2 sts=2
" redo
au BufRead,BufNewFile *.do setfiletype sh
" go
au FileType go setlocal noet
2024-02-02 14:07:01 +02:00
au FileType go nnoremap <buffer> <C-]> :GoDef<CR>
au FileType go let g:go_template_autocreate = 0
2023-10-09 17:17:24 +03:00
2024-04-24 11:13:59 +03:00
" starlark
au BufRead,BufNewFile *.star setfiletype python
2023-10-09 17:17:24 +03:00
" strace
au FileType strace setlocal nonu
" yaml
au FileType yaml setlocal ts=2 sw=2 sts=2
" sql
au FileType sql setlocal formatprg=pg_format\ -
au FileType sql setlocal ts=2 sw=2 sts=2
2024-07-29 16:11:01 +03:00
" nix
au FileType nix setlocal ts=2 sw=2 sts=2
2023-10-09 17:17:24 +03:00
" mail
autocmd BufRead,BufNewFile *mutt-* setfiletype mail
" TeX
au FileType tex setlocal spell spelllang=en_us ts=2 sw=2 sts=2