Skip to content

Commit 31d4cab

Browse files
nvim: replace netrw with yazi file manager
1 parent b7d3632 commit 31d4cab

4 files changed

Lines changed: 38 additions & 0 deletions

File tree

.config/cvim/cheats/cheat40.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ Show diagnostics in bottom window <space>q N
110110
Jump to next diagnostic [d N
111111
Jump to previous diagnostic ]d N
112112
}}}
113+
File manager {{{2
114+
Open file manager at current file <leader>- N
115+
Open file manager at work dir <leader>cw N
116+
Resume last file manager session <C-up> N
117+
}}}
113118
Keycodes {{{2
114119
All keycodes like <S-..>, :keycodes N
115120
}}}

.config/cvim/init/init.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,17 @@ elseif g:vimDistribution ==# g:VIM_FLAVOR_NEOVIM
507507
\ 'setting': "$HOME/.config/cvim/settings/neovim_indent-blankline.lua",
508508
\ }
509509
endif
510+
" File manager
511+
if g:vimDistribution ==# g:VIM_FLAVOR_VIM
512+
" no support
513+
elseif g:vimDistribution ==# g:VIM_FLAVOR_NEOVIM
514+
let cvim_plugins.nvim_yazi = {
515+
\ 'name': 'mikavilpas/yazi.nvim',
516+
\ 'event': 'VeryLazy',
517+
\ 'dependencies': { 'nvim-lua/plenary.nvim': {'lazy': 1} } ,
518+
\ 'setting': "$HOME/.config/cvim/settings/nvim_yazi.lua",
519+
\ }
520+
endif
510521
" Diff swap and content file
511522
let cvim_plugins.recover = {
512523
\ 'name': 'chrisbra/Recover.vim',
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
vim.keymap.set( {'n','v'}, '<leader>-',
2+
"<cmd>Yazi<cr>",
3+
{ desc = 'Open file manager at current file', }
4+
)
5+
vim.keymap.set( {'n','v'}, '<leader>cw',
6+
"<cmd>Yazi cwd<cr>",
7+
{ desc = 'Open file manager in nvim working directory', }
8+
)
9+
vim.keymap.set( {'n','v'}, '<C-up>',
10+
"<cmd>Yazi toggle<cr>",
11+
{ desc = 'Resume last file manager session', }
12+
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
local function config()
2+
require('yazi').setup({
3+
-- open with yazi istead of netrw
4+
-- REQUIRES: loaded_netrwPlugin = 1
5+
open_for_directories = true
6+
})
7+
vim.g.loaded_netrwPlugin = 1
8+
end
9+
10+
return {config = config}

0 commit comments

Comments
 (0)