diff --git a/vimrc b/vimrc index 217cf1a..32f0ebf 100644 --- a/vimrc +++ b/vimrc @@ -25,6 +25,7 @@ Plug 'tpope/vim-endwise' Plug 'tpope/vim-commentary' Plug 'tpope/vim-repeat' Plug 'tpope/vim-obsession' +Plug 'tpope/vim-tbone' " Auto session management Plug 'dhruvasagar/vim-prosession' @@ -70,14 +71,13 @@ Plug 'rhysd/clever-f.vim' Plug 'romainl/vim-qf' Plug 'AndrewRadev/switch.vim' Plug 'alvan/vim-closetag' -Plug 'Krasjet/auto.pairs' +" Plug 'Krasjet/auto.pairs' Plug 'Vimjas/vim-python-pep8-indent', { 'for': [ 'python' ] } Plug 'rhysd/conflict-marker.vim' " [x ]x to navigate merge conflicts Plug 'christoomey/vim-tmux-navigator' Plug 'antoinemadec/FixCursorHold.nvim' Plug 'jesseleite/vim-agriculture' Plug 'moll/vim-bbye' -Plug 'preservim/vimux' " junegunn op Plug 'junegunn/fzf', { 'do': './install --all' } @@ -201,6 +201,11 @@ augroup yank_highlight autocmd! autocmd TextYankPost * if exists('##TextYankPost') | exe "silent! lua require'vim.highlight'.on_yank()" | endif augroup END + +augroup remember_cursor_position + autocmd! + autocmd BufReadPost \* if line("'\\"") > 1 && line("'\\"") <= line("$") | exe "normal! g`\"" | call timer\_start(1, {tid -> execute("normal! zz")}) | endif +augroup END " }}} " Lightline + Tabline {{{ @@ -443,21 +448,6 @@ nnoremap k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk' " switch.vim let g:switch_mapping = "s" - -" Vimux -if exists('$TMUX') - let g:VimuxRunnerName = "vimuxout" - - augroup vimux_maps - autocmd! - autocmd FileType python map tt :call VimuxRunCommand("clear; pytest -vv " . expand('%:p')) - " autocmd FileType cucumber map tt :RunAllCukes - augroup END - - nnoremap tp :VimuxPromptCommand - nnoremap to :VimuxOpenRunner - nnoremap tq :VimuxCloseRunner -endif " }}} " styling {{{ @@ -735,3 +725,20 @@ omap ah (GitGutterTextObjectOuterPending) xmap ih (GitGutterTextObjectInnerVisual) xmap ah (GitGutterTextObjectOuterVisual) " }}} + +" tbone {{{ +function! s:pytest_buffer() abort + execute 'Tmux send-keys -t ''bottom'' ''C-u''' + execute 'Tmux send-keys -t ''bottom'' ''clear''' + execute 'Tmux send-keys -t ''bottom'' ''Enter''' + execute 'Tmux send-keys -t ''bottom'' ''pytest -vv '.expand('%:p').' ''' + execute 'Tmux send-keys -t ''bottom'' ''Enter''' +endfunction + +if exists('$TMUX') + augroup long_live_tpope + autocmd! + autocmd FileType python map tt :call pytest_buffer() + augroup END +endif +" }}}