From adbbf3304baf1dc1e4f2c5ed4c7c898f948b87c2 Mon Sep 17 00:00:00 2001 From: Ivar Fatland Date: Mon, 29 Sep 2025 22:35:47 +0200 Subject: [PATCH] add vimrc --- vim/.vimrc | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 vim/.vimrc diff --git a/vim/.vimrc b/vim/.vimrc new file mode 100644 index 0000000..a46f592 --- /dev/null +++ b/vim/.vimrc @@ -0,0 +1,59 @@ +set exrc +set secure +set clipboard=unnamedplus +set tabstop=4 +set shiftwidth=0 +set rnu +set nu +set nowrap +set shiftround +set expandtab +set nohlsearch +set incsearch +set guicursor=n-v-c:block-Cursor +set cursorline + +nnoremap ,co :copen +nnoremap ,cc :cclose +nnoremap ,cq :call setqflist([]):cclose +nnoremap ,ct :call setqflist([{'filename': expand('%'), 'lnum': line('.'), 'col': col('.'), 'text': 'TODO'}], 'a') +nnoremap ,cf :cfirst +nnoremap ,cl :clast +nnoremap :cnextzz +nnoremap :cpreviouszz +nnoremap ,cu :colder +nnoremap ,cr :cnewer +nnoremap ,h H +nnoremap ,l L +nnoremap H ^ +nnoremap L $ +xnoremap H ^ +xnoremap L $ + +nnoremap ,cD :call setqflist(filter(getqflist(), 'v:val != getqflist()[getqflist({"idx": 0}).idx - 1]')) + +nnoremap ,t vl:terminala + +" Don't include curdir, it just causes pain. +set viewoptions=folds,cursor +autocmd BufWinLeave *.* silent! mkview +autocmd BufWinEnter *.* silent! loadview + +nnoremap h +nnoremap j +nnoremap k +nnoremap l + +nnoremap zz +nnoremap zz + +tnoremap c c + +autocmd BufEnter *__virtual* setlocal buftype=nofile bufhidden=hide noswapfile + +let g:rustfmt_autosave = 0 + +" remove annoying and bad indentation +autocmd FileType * setlocal indentexpr= + +set wildignore=*.o,*.obj,.git/**,tags,*.pyc