From 5d2e97043ded8a67f3c9ade4b3b0bb50c60c2910 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 3 Jun 2024 20:41:43 +0100 Subject: Adds back a lot of vim config... Inevitable. Not ALE though! --- vim/vimrc | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 99654a5..d84adfa 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -3,6 +3,9 @@ filetype plugin indent on "source ~/.vim/grep.vim +let maplocalleader = "\\" +let mapleader = "," + set autoread set foldmethod=manual set autowrite @@ -14,7 +17,7 @@ set display=truncate set equalalways set fileformat=unix set hidden -set history=500 +set history=1000 set ignorecase set incsearch set infercase @@ -36,9 +39,11 @@ set report=0 set ruler set scrolloff=5 set shell=bash +set shortmess+=c set showcmd set showmatch set showmode +set signcolumn=number set splitright set tabstop=4 softtabstop=4 shiftwidth=4 expandtab set ttimeout @@ -47,14 +52,74 @@ set ttimeoutlen=100 set wildmenu set wildoptions=pum set wildmode=full +set wildignore=**/__pycache*/** set wrap packadd! matchit +nnoremap ev sjL:e $HOME/.vim/vimrc +if (exists("*strftime")) + noremap date "=strftime("%F")p9h + noremap time "=strftime("%X")p7h +endif +nnoremap :noh:call clearmatches() +noremap J 10j +noremap K 10k +command! W w +let @x = 'o- [ ] ' + +" FZF + +nnoremap :FZF! +nnoremap g :Files +nnoremap p :GitFiles +nnoremap o :Tags +nnoremap h :History +nnoremap 0 :Files +nnoremap ; :BLines +nnoremap l :Lines +nnoremap o :BTags +nnoremap b :Buffers +nnoremap ? :History: +nnoremap / :execute 'Ag ' . input('Ag/') +nnoremap ft :Filetypes +nnoremap CC :Commands + +" vim-test +nmap tn :TestNearest +nmap tf :TestFile +nmap ts :TestSuite +nmap tl :TestLast +nmap tv :TestVisit +let test#strategy = "basic" +let test#python#pytest#options = '-q -s' +let test#python#runner = 'django' +let test#vimterminal#term_position = "belowright" + + +if executable('rg') + set grepprg=rg\ --color=never\ --vimgrep +endif + +" and search with ripgrep +command! -bang -nargs=* Rg + \ call fzf#vim#grep( + \ 'rg --column --line-number --no-heading --color=always --ignore-case '.shellescape(), 1, + \ 0 ? fzf#vim#with_preview('up:60%') + \ : fzf#vim#with_preview('right:50%:hidden', '?'), + \ 0) + +nnoremap a :Rg + +augroup textfiles + autocmd! + autocmd filetype markdown setlocal spell spelllang=en +augroup end + call plug#begin() Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' Plug 'mhinz/vim-signify' -"Plug 'vim-test/vim-test' +Plug 'vim-test/vim-test' Plug 'ledger/vim-ledger' Plug 'fatih/vim-go', {'do': ':GoUpdateBinaries' } Plug 'tpope/vim-dispatch' @@ -62,8 +127,8 @@ Plug 'tpope/vim-surround' Plug 'tpope/vim-commentary' Plug 'tpope/vim-unimpaired' Plug 'tpope/vim-fugitive' -"Plug 'SirVer/UltiSnips' -"Plug 'honza/vim-snippets' +Plug 'SirVer/UltiSnips' +Plug 'honza/vim-snippets' "Plug 'dense-analysis/ale' call plug#end() -- cgit v1.2.3