11# dired.nvim
22
3- A file manager similar to Emacs that aims to use functional programming in Lua.
4-
5- ![ Image] ( https://github.com/user-attachments/assets/f74cc4da-017e-4cb8-85f0-6cc7b7cbbb0a )
3+ A file manager similar to Emacs that aims to use Vim operations to execute file
4+ operations and functional programming in Lua.
65
76## Usage
87
8+ dired.nvim supports search, creation, and file operations. After making changes
9+ to a buffer using Vim commands, you can execute file operations through execute.
10+ For example, if you want to delete one or more files, you can press <C-j > to switch
11+ to the displayed buffer, then use commands like dd, D, or VcountD. Afterward,
12+ press <C-w > to execute the operation. To create a file, you can directly type the
13+ file name or nested folders, like a/b/c.txt, which will create the folders a, b,
14+ and then the file c.txt. Note that renaming can be performed alongside creation,
15+ but it cannot be done together with deletion.
16+
917Default config
1018
1119``` lua
1220{
13- show_hidden = true ,
14- mark = ' ⚑' ,
15- enable_fuzzy = true ,
16- prompt_start_insert = true , -- when start dired auto enter insert mode
17- prompt_insert_on_open = true , -- when open if mode not in insert auto enter insert mode
18- -- i mean insert mode n mean normal mode
19- keymaps = {
20- open = { i = ' <CR>' , n = ' <CR>' },
21- up = ' u' ,
22- quit = { n = { ' q' , ' <ESC>' }, i = ' <C-c>' },
23- create_file = { n = ' cf' , i = ' <C-f>' },
24- create_dir = { n = ' cd' , i = ' <C-d>' },
25- delete = ' D' ,
26- rename = { n = ' R' , i = ' <C-r>' },
27- copy = ' yy' ,
28- cut = ' dd' ,
29- paste = ' p' ,
30- forward = { i = ' <C-n>' , n = ' j' },
31- backward = { i = ' <C-p>' , n = ' k' },
32- mark = { n = ' m' , i = ' <A-m>' },
33- split = { n = ' s' , i = ' <C-s>' },
34- vsplit = { n = ' v' , i = ' <C-v>' },
35- },
21+ show_hidden = true ,
22+ enable_fuzzy = true ,
23+ prompt_insert_on_open = true ,
24+ keymaps = {
25+ open = { i = ' <CR>' , n = ' <CR>' },
26+ up = { i = ' <C-u>' , n = ' <C-u>' },
27+ quit = { n = { ' q' , ' <ESC>' }, i = ' <C-c>' },
28+ forward = { i = ' <C-n>' , n = ' j' }, -- both on search and main buffer
29+ backward = { i = ' <C-p>' , n = ' k' }, -- both on search and main buffer
30+ split = { n = ' gs' , i = ' <C-s>' }, -- both on search and main buffer
31+ vsplit = { n = ' gv' , i = ' <C-v>' }, -- both on search and main buffer
32+ switch = { i = ' <C-j>' }, -- only search buffer
33+ execute = { n = ' <C-w>' , i = ' <C-w>' }, -- both on search and main buffer
34+ },
3635}
3736```
3837
@@ -44,14 +43,4 @@ vim.keymap.set({'n', 'i'}, '<C-X><C-f>', '<cmd>Dired<CR>')
4443
4544use ` :Dired path? ` , custom config by using ` vim.g.dired ` variable.
4645
47- ** [ VS/SP] Open** can also create nested dir and file when not exists.
48-
49- like custom keymaps in ` vim.g.dired ` like
50-
51- ``` lua
52- vim .g .dired = {
53- keymaps = { up = { i = ' <C-p>' , n = ' k' }, down = ' j' -- just normal mode }
54- }
55- ```
56-
5746## License MIT
0 commit comments