默认情况下,我希望使用defx打开nvim,而不是使用Nerdtree。不知道如何改变这种行为
我正在使用defx,可以通过使用sf自定义映射命令来打开它,但是为此,我应该已经进入了nvim,所以它需要两个步骤。
vim
sfSf生活在maps.vim
" Description: Keymaps
" defx
nnoremap <silent>sf :<C-u>Defx -listed -resume
\ -columns=indent:mark:icon:icons:filename:git:size
\ -buffer-name=tab`tabpagenr()`
\ `expand('%:p:h')` -search=`expand('%:p')`<CR>我可以用.
nvim .我可以在nvim/init.vim中禁用nerdtree。
" Disable netrw
let g:loaded_netrwPlugin = 1但是即使有了它,我也应该做sf来打开defx。
发布于 2021-12-05 08:55:18
所以,创作者@Shougo的答案是https://gitter.im/Shougo/defx.nvim?at=61abfda5b5ba9e5a11ef079e
autocmd BufEnter,VimEnter,BufNew,BufWinEnter,BufRead,BufCreate
\ * if isdirectory(expand('<amatch>'))
\ | call s:browse_check(expand('<amatch>')) | endif
function! s:browse_check(path) abort
if bufnr('%') != expand('<abuf>')
return
endif
" Disable netrw.
augroup FileExplorer
autocmd!
augroup END
execute 'Defx' a:path
endfunctionhttps://stackoverflow.com/questions/70220630
复制相似问题