From 684a92726f2533fbbefe553b3ddb9ddfcdec2919 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 10 Mar 2021 21:07:09 +0300 Subject: feat(vim): map t to tabedit in Defx --- .vimrc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 04f35f4..c214070 100644 --- a/.vimrc +++ b/.vimrc @@ -52,6 +52,12 @@ nnoremap :Defx 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 t defx#do_action('call', 'SmartTabEdit') nnoremap h defx#do_action('close_tree') nnoremap dd defx#do_action('remove') nnoremap cw defx#do_action('rename') -- cgit v1.2.3