Skip to content

Commit 3bcfc6e

Browse files
committed
Add documentation about mapping
1 parent 726f418 commit 3bcfc6e

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

doc/fern-develop.txt

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,21 @@ See https://github.com/lambdalisue/fern-comparator-lexical.vim as example.
185185
=============================================================================
186186
MAPPING *fern-develop-mapping*
187187

188-
TBW
188+
Fern provides global mappings under "autoload/fern/mapping" directory.
189+
Mapping MUST provide an init function as "fern#mapping#{name}#init()" with
190+
a boolean argument to disable default mappings.
191+
192+
Mappings under that directory are registered automatically when a filename has
193+
listed in |g:fern#mapping#mappings| variable.
194+
195+
So 3rd party plugin MUST register mappings by add followings to plugin.vim
196+
like:
197+
>
198+
call add(g:fern#mapping#mappings, ['your_plugin'])
199+
>
200+
*g:fern#mapping#mappings*
201+
A |List| of globally available mapping names.
202+
A target mapping MUST exist under "fern#mapping#" namespace.
189203

190204

191205
=============================================================================
@@ -292,7 +306,23 @@ the following methods.
292306
-----------------------------------------------------------------------------
293307
MAPPING *fern-develop-scheme-mapping*
294308

295-
TBW
309+
Fern provides scheme mappings under "autoload/fern/scheme/{scheme}/mapping"
310+
directory. Mapping MUST provide an init function as
311+
"fern#scheme#{scheme}#mapping#{name}#init()" with a boolean argument to disable
312+
default mappings.
313+
314+
Mappings under that directory are registered automatically when a filename has
315+
listed in |g:fern#scheme#{scheme}#mapping#mappings| variable.
316+
317+
So 3rd party plugin MUST register mappings by add followings to plugin.vim
318+
like:
319+
>
320+
call add(g:fern#scheme#file#mapping#mappings, ['your_plugin'])
321+
>
322+
*g:fern#scheme#{scheme}#mapping#mappings*
323+
A |List| of scheme available mapping names for {scheme}.
324+
A target mapping MUST exist under "fern#scheme#{scheme}#mapping#"
325+
namespace.
296326

297327

298328
=============================================================================

0 commit comments

Comments
 (0)