-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathvaffle.txt
311 lines (214 loc) · 10.5 KB
/
vaffle.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
*vaffle.txt* Lightweight file manager for Vim.
______ __________ ~
___/__/__/__ __, _________/ __/ __/ /____ ~
/__/__/__/__/ | | / / _ /_ __ __/ / _, / ~
/__/__/__/__/ | |/ / // /_/ / / / / / ___/ ~
/__/__/ |___/___^__/_/ /_/ /_/____/ ~
~
Sweet treat for file operations ~
==============================================================================
0. Contents *vaffle-contents*
1. Intro .................................. |vaffle-intro|
1.1. Concept .............................. |vaffle-concept|
1.2. Story ................................ |vaffle-story|
1.3. Requirements ......................... |vaffle-requirements|
2. Commands ............................... |vaffle-commands|
3. Key mappings ........................... |vaffle-key-mappings|
3.1. Toggle selection ..................... |vaffle-key-mappings-toggle|
3.2. Operations for the current item ...... |vaffle-key-mappings-current|
3.3. Operations for selections ............ |vaffle-key-mappings-selected|
3.4. Other operations ..................... |vaffle-key-mappings-others|
3.5. Default key mappings ................. |vaffle-default-key-mappings|
4. Global options ......................... |vaffle-options|
5. Examples ............................... |vaffle-examples|
6. FAQ .................................... |vaffle-faq|
7. About .................................. |vaffle-about|
==============================================================================
1. Intro *vaffle-intro*
------------------------------------------------------------------------------
1.1. Concept *vaffle-concept*
Vaffle is...
- a file manager >
You can select, delete, move, rename files intuitively.
<
- simple >
Written in pure Vim script. Doesn't require any other plugins and not
have too complex features: coping files, lazy loading, etc.
<
------------------------------------------------------------------------------
1.2. Story *vaffle-story*
There are already awesome file managers in the world: NERDTree, vimfiler,
Dirvish, etc. So why did I decide to develop a new file manager plugin from
scratch?
|NERDTree| is a popular file manager plugin and seems to be designed for large
window. But I uses Vim with heavy-split windows so I want to operate files
in a small window...!
|vimfiler| is full-featured file manager, maybe it can do all things you want
to do. But... it's too complex to customize and requires another plugin:
|unite|.
|dirvish| is also awesome file manager. But it's a "minimalist directory
viewer" and needs some effort to operate (select multiple, delete, move,
rename, ...) files.
I dreamed a file manager - that is suitable for small window, and is as simple
as Dirvish, and has intuitive user interface like vimfiler!
------------------------------------------------------------------------------
1.3. Requirements *vaffle-requirements*
Vaffle requires Vim (>= 8.0) to access full features. It may work in earlier
version, but not supported.
Feature Used Supported Version ~
--------------- ----------------- ~
|win_getid()| v7.4.1557
|win_gotoid()| v7.4.1557
|win_findbuf()| v7.4.1558
==============================================================================
2. Commands *vaffle-commands*
:Vaffle *:Vaffle*
Open the current working directory with Vaffle.
:Vaffle {file} *:Vaffle_f*
Open {file} with Vaffle. If {file} is not a directory, open its parent
directory and focus the file.
==============================================================================
3. Key mappings *vaffle-key-mappings*
------------------------------------------------------------------------------
3.1. Toggle selection *vaffle-key-mappings-toggle*
*<Plug>(vaffle-toggle-all)*
Toggle selections of all items.
*<Plug>(vaffle-toggle-current)*
Toggle selection of the item under the cursor.
------------------------------------------------------------------------------
3.2. Operations for the current item *vaffle-key-mappings-current*
*<Plug>(vaffle-open-current)*
Open the item under the cursor.
*<Plug>(vaffle-open-current-tab)*
Open the item under the cursor in a new tab.
------------------------------------------------------------------------------
3.3. Operations for selections *vaffle-key-mappings-selections*
*<Plug>(vaffle-delete-selected)*
Delete selected items.
Note: Vaffle uses builtin function |delete()| to delete files, so cannot undo
the operation.
*<Plug>(vaffle-fill-cmdline)*
Fill the command-line with a list of selected items. Useful for passing
their paths to a shell command.
*<Plug>(vaffle-move-selected)*
Move selected items to specified directory.
*<Plug>(vaffle-open-selected)*
Open selected items.
*<Plug>(vaffle-open-selected-split)*
Open selected items under the cursor with a split window.
*<Plug>(vaffle-open-selected-vsplit)*
Open selected items under the cursor with a split window, it will be split
vertically.
*<Plug>(vaffle-rename-selected)*
Rename selected items.
------------------------------------------------------------------------------
3.4. Other operations *vaffle-key-mappings-others*
*<Plug>(vaffle-chdir-here)*
Change the current working directory to one the current buffer has opened.
*<Plug>(vaffle-mkdir)*
Create a new directory in the current directory.
*<Plug>(vaffle-new-file)*
Create a new file in the current directory.
*<Plug>(vaffle-open-home)*
Open home directory.
*<Plug>(vaffle-open-parent)*
Open the parent directory.
*<Plug>(vaffle-open-root)*
Open the root directory.
*<Plug>(vaffle-quit)*
Quit Vaffle and close the buffer.
*<Plug>(vaffle-refresh)*
Refresh the buffer.
*<Plug>(vaffle-toggle-hidden)*
Toggle visibility of hidden (dot-prefixed) items.
------------------------------------------------------------------------------
3.5. Default key mappings *vaffle-default-key-mappings*
Mode {lhs} {rhs} ~
---- -------- -------------------------------- ~
n ~ |<Plug>(vaffle-open-home)|
n h |<Plug>(vaffle-open-parent)|
n l |<Plug>(vaffle-open-current)|
n t |<Plug>(vaffle-open-current-tab)|
n * |<Plug>(vaffle-toggle-all)|
n . |<Plug>(vaffle-toggle-hidden)|
nv <Space> |<Plug>(vaffle-toggle-current)|
n <CR> |<Plug>(vaffle-open-selected)|
n m |<Plug>(vaffle-move-selected)|
n d |<Plug>(vaffle-delete-selected)|
n r |<Plug>(vaffle-rename-selected)|
n q |<Plug>(vaffle-quit)|
n o |<Plug>(vaffle-mkdir)|
n R |<Plug>(vaffle-refresh)|
n i |<Plug>(vaffle-new-file)|
n x |<Plug>(vaffle-fill-cmdline)|
==============================================================================
4. Global options *vaffle-options*
*g:vaffle_auto_cd*
(Default: 0)
If enabled, changes the working directory to selected one automatically.
*g:vaffle_force_delete*
(Default: 0)
Vaffle doesn't delete non-empty directory by default. This option will lift
the restriction.
*g:vaffle_show_hidden_files*
(Default: 0)
If enabled, Vaffle shows hidden files by default. You can toggle the option
with |<Plug>(vaffle-toggle-hidden)| any time.
*g:vaffle_open_selected_split_position*
(Default: '')
Possible values: '', 'topleft' or 'rightbelow'
Set the position of the new window of |<Plug>(vaffle-open-selected-split)|.
*g:vaffle_open_selected_vsplit_position*
(Default: '')
Possible values: '', 'topleft' or 'rightbelow'
Set the position of the new window of |<Plug>(vaffle-open-selected-vsplit)|.
*g:vaffle_use_default_mappings*
(Default: 1)
If disabled, Vaffle doesn't set up the default mappings. To customize key
mappings, see |vaffle-example-custom-key-mappings|.
*g:vaffle_render_custom_icon*
(Default: '')
If you want to render custom file type icon for each item, specify
the function name. See |vaffle-example-file-type-icons|.
==============================================================================
5. Examples *vaffle-examples*
Customizing key mappings: *vaffle-example-custom-key-mappings*
>
function! s:customize_vaffle_mappings() abort
" Customize key mappings here
nmap <buffer> <Bslash> <Plug>(vaffle-open-root)
nmap <buffer> K <Plug>(vaffle-mkdir)
nmap <buffer> N <Plug>(vaffle-new-file)
endfunction
augroup vimrc_vaffle
autocmd!
autocmd FileType vaffle call s:customize_vaffle_mappings()
augroup END
<
Adding file type icons: *vaffle-example-file-type-icons*
>
" Install devicons (https://github.com/ryanoasis/vim-devicons)
function! VaffleRenderCustomIcon(item)
return WebDevIconsGetFileTypeSymbol(a:item.basename, a:item.is_dir)
endfunction
let g:vaffle_render_custom_icon = 'VaffleRenderCustomIcon'
<
==============================================================================
6. FAQ *vaffle-faq*
Q: I want to use Vaffle with NERDTree, but |:Vaffle| opens NERDTree buffer...
A: Try adding the following command to your vimrc:
>
let NERDTreeHijackNetrw = 0
<
Q: How to prevent "Press ENTER or ..." message after every action?
A: Try adding the following command to your vimrc:
>
set cmdheight=2
<
==============================================================================
7. About *vaffle-about*
Vaffle is developed by cocopon and licensed under the MIT License.
Visit the project page for the latest information:
https://github.com/cocopon/vaffle.vim
==============================================================================
vim:ft=help:norl:ts=8:tw=78: