-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdirvish-do.txt
120 lines (91 loc) · 4.46 KB
/
dirvish-do.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
*dirvish-do.txt* *dirvish-do.nvim* *dirvish-do*
Type |gO| to see the table of contents.
==============================================================================
1. Introduction *dirvish-do-introduction*
This is an extension for |dirvish| that provides a set of keymaps to perform
file manipulation operations. It also provides |:Open| and |:Launch| commands
so that you can use them even if you disable |netrw|.
==============================================================================
2. Configuration
*dirvish-do-config*
IN LUA
>lua
require('dirvish-do').setup({
operations = {
remove = "permanent", -- Change to "trash" if you want to move to trash instead of deleting permanently
},
keymaps = {
make_file = 'mf',
make_dir = 'md',
copy = 'cp',
move = 'mv',
rename = 'r',
remove = '<Del>',
},
open_cmd = nil -- Must be a table or nil. See |:Open|
})
<
IN VIMSCRIPT
You can use |v:lua| to call the Lua function from Vimscript: >vim
call v:lua.require'dirvish-do'.setup(
\ " Config dictionary goes here
\ )
<
You can check your current configuration by running: >vim
:checkhealth dirvish-do
<
==============================================================================
3. Usage
*dirvish-do-usage*
KEYMAPS
*dirvish-do-keymaps*
Below are the default keymaps. You can change them in the
|dirvish-do-config|
--------------------------------------------------------------------------------
Function Default Mode Tip to remember
----------------------------------- --------- -------- -------------------------
Create file mf Normal mf for “make file”
Create directory md Normal md for “make directory”
Delete under cursor <Del> Normal Just delete key
Delete items in visual selection <Del> Visual Just delete key
Rename under cursor r Normal r for “rename”
Copy file to current directory cp Normal cp for “copy”
Move file to current directory mv Normal mv for “move”
--------------------------------------------------------------------------------
For example, you can use |yy| to yank a file, then move to a new directory and
use |p| to paste the file there. Or to move a file, you use |yy| to yank the
file, move to a new directory and use `mv` to move the file there.
You can also use |y| in `visual line` mode to select many files to copy or
move. (Note: `visual line` mode is recommended so that you can yank the full
file path)
If you want to delete multiple files, you should use Visual mode to select the
files. Visual line mode doesn't work for this operation.
SUDO MODE
*dirvish-do-sudo-mode*
This plugin also provides a `sudo` mode that allows you to perform operations
in directories that require root permissions. To use `sudo` mode in `dirvish-do.nvim`,
you need to be in a Unix-like environment like Linux, MacOS,... Windows may
work but we currently don't support it (but you can use WSL). To toggle `sudo` mode,
use this command: >vim
:DirvishSudo
<
When `sudo` mode is enabled, the plugin will prompt you for your password
whenever you perform an operation as said in the previous section.
OPENING FILES AND LAUNCHING APPS
For |nvim| 0.10.1+, |dirvish-do.nvim| provides 2 commands |:Open| and |:Launch| commands
that work the same as |netrw|'s respective commands (see |netrw-gx|), so that you can
use them even if you disable |netrw|.
*:Open*
To open a path (or URL) <path>, type >vim
:Open <path>
<
No escaping, neither for the shell nor for Vim's command-line, is needed.
By default, the path is opened with the system's default application. If you
wish to change it, you can set the option `open_cmd` in |dirvish-do-config|.
Note that `open_cmd` must be a |lua-table| (for example `{ os_url }`) or |lua-nil|.
*:Launch*
To launch a specific application <app> <args>, often <args> being <path> >vim
:Launch <app> <args>.
Since <args> can be arbitrarily complex, in particular contain many file
paths, the escaping is left to the user.
vim:tw=78:ts=8:noet:ft=help:norl: