diff options
author | eug-vs <eug-vs@keemail.me> | 2021-03-10 21:07:09 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-03-10 21:07:49 +0300 |
commit | 684a92726f2533fbbefe553b3ddb9ddfcdec2919 (patch) | |
tree | 55d227de0a7177f5dbfac9f956f1f560fdabda73 | |
parent | b030cf491b5abc540038d91dda9420ca0ef6ddf3 (diff) | |
download | dotfiles-684a92726f2533fbbefe553b3ddb9ddfcdec2919.tar.gz |
feat(vim): map t to tabedit in Defx
-rw-r--r-- | .vimrc | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -52,6 +52,12 @@ nnoremap <silent> <F3> :Defx<CR> autocmd FileType defx call s:defx_my_settings() autocmd BufEnter * if(winnr("$") == 1 && &ft == 'defx') | q | endif +function! SmartTabEdit(context) abort + tabnew + execute "e " . a:context.targets[0] + tabp +endfunction + function! s:defx_my_settings() abort set nonumber set norelativenumber @@ -60,6 +66,7 @@ function! s:defx_my_settings() abort \ defx#is_directory() ? \ defx#do_action('open_tree') : \ defx#do_action('open', 'choose') + nnoremap <silent><buffer><expr> t defx#do_action('call', 'SmartTabEdit') nnoremap <silent><buffer><expr> h defx#do_action('close_tree') nnoremap <silent><buffer><expr> dd defx#do_action('remove') nnoremap <silent><buffer><expr> cw defx#do_action('rename') |