diff --git a/autoload/wiki/buffer.vim b/autoload/wiki/buffer.vim index 9e0c83c7..1f0cecd0 100644 --- a/autoload/wiki/buffer.vim +++ b/autoload/wiki/buffer.vim @@ -175,6 +175,9 @@ function! s:init_buffer_mappings() abort " {{{1 endif call extend(l:mappings, get(g:, 'wiki_mappings_local', {})) + if b:wiki.in_journal + call extend(l:mappings, get(g:, 'wiki_mappings_local_journal', {})) + endif call wiki#init#apply_mappings_from_dict(l:mappings, '') endfunction diff --git a/doc/wiki.txt b/doc/wiki.txt index 80183075..4aefc03e 100644 --- a/doc/wiki.txt +++ b/doc/wiki.txt @@ -594,6 +594,7 @@ OPTIONS *wiki-config-options* *g:wiki_mappings_global* *g:wiki_mappings_local* +*g:wiki_mappings_local_journal* These options allow one to customize global and buffer local mappings through dictionaries where the keys are the right-hand sides and the values are the desired mappings, e.g.: > @@ -616,6 +617,18 @@ OPTIONS *wiki-config-options* visual mode, respectively. The available `` mappings are listed in |wiki-mappings|. + For any local mappings that should only be applied in journal entries, + consider setting |g:wiki_mappings_local_journal|. For example, similar to + above: > + + let g:wiki_mappings_local = { + \ '(wiki-journal-prev)' : '[w', + \ '(wiki-journal-next)' : ']w', + \} +< + Here we create a pair of mappings `[w` and `]w` to navigate between journal + entries. + Default: Undefined *g:wiki_month_names* @@ -1208,6 +1221,23 @@ information about the different modes. `ox` at |(wiki-at)| `ox` it |(wiki-it)| +------------------------------------------------------------------------------ +DEFAULT JOURNAL MAPPINGS *wiki-mappings-journal-default* + +This is a list of default mappings four journal entries. For a more detailed +description of each mapping, read the documentation of the `(wiki-[name])` +form of the mapping. The mode specifier is a single letter which indicates +which mode the mapping is valid in. See e.g. |nmap|, |imap|, |omap| or |xmap| +for more information about the different modes. + + MODE LHS RHS~ + ==== === === + `n` |(wiki-journal-prev)| + `n` |(wiki-journal-next)| + `n` |(wiki-journal-copy-tonext)| + `n` wu |(wiki-journal-toweek)| + `n` wm |(wiki-journal-tomonth)| + ============================================================================== LINKS *wiki-link*