aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-06-03 20:41:43 +0100
committerMatthew Lemon <y@yulqen.org>2024-06-03 20:41:43 +0100
commit5d2e97043ded8a67f3c9ade4b3b0bb50c60c2910 (patch)
treec7e7ef8545f0a79e28c951537c1b96bcfccdaa2d
parent392db2a20cef8ee19b1f41db70726e02797ed70e (diff)
Adds back a lot of vim config... Inevitable. Not ALE though!
-rw-r--r--vim/vimrc73
1 files 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 <leader>ev <C-w>s<C-w>j<C-w>L:e $HOME/.vim/vimrc<cr>
+if (exists("*strftime"))
+ noremap <silent> <leader>date "=strftime("%F")<CR>p9h
+ noremap <silent> <leader>time "=strftime("%X")<CR>p7h
+endif
+nnoremap <leader><space> :noh<cr>:call clearmatches()<cr>
+noremap <silent> J 10j
+noremap <silent> K 10k
+command! W w
+let @x = 'o- [ ] '
+
+" FZF
+
+nnoremap <leader><C-p> :<C-u>FZF!<CR>
+nnoremap <C-p>g :Files<CR>
+nnoremap <C-p>p :GitFiles<CR>
+nnoremap <leader>o :Tags<CR>
+nnoremap <leader>h :History<CR>
+nnoremap <silent> <leader>0 :Files<CR>
+nnoremap <silent> <leader>; :BLines<CR>
+nnoremap <silent> <leader>l :Lines<CR>
+nnoremap <silent> <leader>o :BTags<CR>
+nnoremap <C-p>b :Buffers<CR>
+nnoremap <silent> <leader>? :History:<CR>
+nnoremap <silent> <leader>/ :execute 'Ag ' . input('Ag/')<CR>
+nnoremap <silent> <leader>ft :Filetypes<CR>
+nnoremap <silent> <leader>CC :Commands<CR>
+
+" vim-test
+nmap <silent> tn :TestNearest<CR>
+nmap <silent> tf :TestFile<CR>
+nmap <silent> ts :TestSuite<CR>
+nmap <silent> tl :TestLast<CR>
+nmap <silent> <leader>tv :TestVisit<CR>
+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(<q-args>), 1,
+ \ <bang>0 ? fzf#vim#with_preview('up:60%')
+ \ : fzf#vim#with_preview('right:50%:hidden', '?'),
+ \ <bang>0)
+
+nnoremap <C-p>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()