diff options
author | Matthew Lemon <y@yulqen.org> | 2023-04-04 16:25:16 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-04-04 16:25:16 +0100 |
commit | 367e7eb328e8760cbe4b5d5b6e27eec4438d6b74 (patch) | |
tree | d85c7f88499df81998d5d70328917363d94582f4 /vim | |
parent | 58c3801cffefc213c69898fd3f0ae5b93c6a4893 (diff) |
relented and added vim-test and some tpope bits
Diffstat (limited to 'vim')
-rw-r--r-- | vim/vimrc | 37 |
1 files changed, 31 insertions, 6 deletions
@@ -43,6 +43,32 @@ noremap <silent> <leader>rpy :!clear; python %<CR> noremap <silent> <leader>rb :!clear; bash %<CR> noremap <silent> <leader>rs :!clear; sh %<CR> +" essential plugins +call plug#begin() +Plug 'vim-test/vim-test' +Plug 'tpope/vim-dispatch' +Plug 'tpope/vim-commentary' +call plug#end() + +" vim-test +nmap <silent> tn :TestNearest<CR> +nmap <silent> tf :TestFile<CR> +nmap <silent> ts :TestSuite<CR> +nmap <silent> <leader>tl :TestLast<CR> +nmap <silent> <leader>tv :TestVisit<CR> +let test#strategy = "basic" +let test#python#pytest#options = '-q -s' +let test#python#runner = 'pytest' +let test#vimterminal#term_position = "belowright" + +" to run tests automatically +"augroup test +" autocmd! +" autocmd BufWrite * if test#exists() | +" \ TestFile | +" \ endif +"augroup END + set shell=/bin/sh set hi=500 set scrolloff=0 @@ -98,12 +124,12 @@ endif nnoremap <F5> :checktime<CR> " Python - keybindings -nnoremap <leader>Ts :setlocal makeprg=pytest\ -q\ %<cr> -nnoremap <leader>Tf :setlocal makeprg=flake8\ %<cr> -nnoremap <leader>Tb :setlocal makeprg=black\ %<cr> -nnoremap <leader>Tm :setlocal makeprg=mypy\ --ignore-missing-imports\ %<cr> +"nnoremap <leader>Ts :setlocal makeprg=pytest\ -q\ %<cr> +"nnoremap <leader>Tf :setlocal makeprg=flake8\ %<cr> +"nnoremap <leader>Tb :setlocal makeprg=black\ %<cr> +"nnoremap <leader>Tm :setlocal makeprg=mypy\ --ignore-missing-imports\ %<cr> " then run the one set with this... -nnoremap <leader>Tt :make!<cr> +"nnoremap <leader>Tt :make!<cr> " clear search highlights nnoremap <leader><space> :noh<cr>:call clearmatches()<cr> @@ -141,7 +167,6 @@ nnoremap <leader>ev <C-w>s<C-w>j<C-w>L:e $MYVIMRC<cr> set background=dark "colorscheme hipster -colorscheme gruber-darker " manual highlights " highlight Visual ctermfg=black ctermbg=LightMagenta |