Commit graph

22 commits

Author SHA1 Message Date
Hektor Misplon
e7f4335a77 Add option to disable <CR> remapping 2025-06-14 12:57:59 -04:00
Tomas Babej
6f5f641ceb ftplugin: Fix whitespace indentation 2025-06-13 21:01:21 -04:00
Nadav Spiegelman
0ee63dd1f5 Apply g:taskwiki_suppress_mappings to <cr> mapping
Up until now, g:taskwiki_suppress_mappings could be used to supress the
leader keys, but it did nothing to the <cr> mapping
(task_info_or_vimwiki_follow_link())
2024-02-29 02:33:13 -05:00
Jasha
5e125960c9 add toggle to disable custom folding for vimwiki files 2021-09-20 20:50:24 -04:00
Tomas Babej
b972e901c7 ftplugin: Expose TaskWikiToggle as a vim command 2021-06-21 19:13:40 -04:00
Tomas Janousek
6cedc13b58 completion: Add tab completion for TaskWikiMod 2020-12-26 20:52:04 -05:00
Tomas Janousek
a6907bac85 ftplugin: Avoid changing global viewoptions
As mentioned in an earlier commit, viewoptions is global, so it's
probably best to override it only temporarily for mkview.

(loadview is moved to autoload just for symmetry and in case we need to
do something more complex, like saving/restoring foldmethod, later)
2020-12-18 17:55:09 -05:00
Tomas Janousek
7b72ee47b9 syntax: Move setl foldtext to BufWinEnter autocmd
Vimwiki now resets fold{method,text} on BufWinEnter:

8d4cb7f11d/plugin/vimwiki.vim (L177)
8d4cb7f11d/plugin/vimwiki.vim (L325)

so we should do that as well otherwise we get overridden.

If the user actually configured vimwiki to use its folding, by setting
g:vimwiki_folding to something else than '' or 'custom', we should not
replace that. It would be nice if we could somehow augment
VimwikiFoldText and leave the rest intact, but we can't, so it's best to
keep off. Using foldmethod=syntax gets extremely laggy with just a few
hundreds of lines, so we must not force it.

Also, we now need to increase foldlevel in tests because the folding is
no longer being overridden in the default vimwiki configuration, so we'd
get closed folds in tests...
2020-12-18 17:55:09 -05:00
Tomas Janousek
792ca80a2b syntax: Move setl viewoptions to ftplugin
Doesn't belong in syntax, and shouldn't be set unless we need it for
mkview, so move it next to that mkview.

(BTW, it's a bit confusing that we use setlocal for a global option. Are
we hoping it's going to be made local one day? If not, we may as well
change it to `set` to avoid confusion.)
2020-12-18 17:55:09 -05:00
Tomas Janousek
92785f10f7 ftplugin: Minor cleanup 2020-09-18 11:28:39 -04:00
Tomas Janousek
94fe6ed8e8 ftplugin: Postpone initial refresh to better preserve folds
Vim preserves folds by writing line jumps into the view script, so it's
better to load this script with the original file contents and only then
refresh from taskwarrior. The folding is still often broken when the
buffer is updated, but that can now be considered a vim bug and may
perhaps one day be fixed (or even worked around, if one is persistent
enough). Loading the view after modifying the buffer is simply wrong,
that can never ever work.
2020-09-18 11:28:39 -04:00
Tomas Janousek
f3fe7aca21 ftplugin: Only load the python plugin once
This makes opening wiki pages significantly faster and also prevents
clearing the entire cache every time.
2020-09-18 11:28:39 -04:00
Tomas Janousek
b722c29f9e ftplugin: Make commands buffer-local
Consistency with vimwiki, less confusion/clutter.
2020-09-18 11:28:39 -04:00
Tomas Janousek
2942ba776d ftplugin: Use buffer local autocmds
* simplifies code a bit
* avoids triggering autocmds on *.wiki files outside of registered vimwiki
* prevents reordering of autocmds when switching wiki pages

The last bit is my main motivation: I need to add a BufEnter autocmd (to
~/.vim/after, not to taskwiki itself) and I'd love to rely on
`cache.load_current()` having been called already.
2020-09-18 11:28:39 -04:00
Tomas Janousek
15ce16f24c Revert "tests: Use explicit coverage tracking"
This reverts commit b00e886142.

This fixes reporting of coverage by the few tests that run outside of
vim.

The commit that is being reverted doesn't explain why it was committed,
and the git history suggests it was reverted once and then reintroduced
later again. None of those commits explains the why. I can only guess
that the last time this was committed was an attempt to fix coverage
reporting to outside of docker, which it didn't, and additionally it
made coverage gathering less robust (see previous commit). So this is
yet another fix for the inaccurate coverage reporting.

Or maybe it was because `--cov` without `=taskwiki` an argument reports
coverage for tests instead of taskwiki code? Nevermind, I guess, now it
works well.
2020-07-08 21:36:52 -04:00
Tomas Janousek
698e2448f3 tests: Fix vimwiki loading errors
Not only can we stop ignoring the errors, this also fixes
TestInfoActionNotTriggeredByEnterOnLink which would otherwise cause vim
to complain about g:vimwiki_wikilocal_vars not being available.
2020-07-02 09:51:56 -04:00
mrossinek
c5310126fa
Change mappings to disallow remaps (fixes #182) 2019-02-24 12:02:13 -05:00
mrossinek
879853becc
Add maplocalleader option 2019-02-24 12:02:12 -05:00
mrossinek
e82813e03b
Add mapping-suppressing option 2019-02-24 12:01:54 -05:00
Marco Hinz
eaffcbd718 Nvim doesn't imply Python support
`has('python')` and `has('python3')` work the same in Vim and Neovim, so there's
no need for that extra check. That check is even wrong, since Nvim's `:python`
and friends won't work either as long as the Python provider isn't installed as
well.
2019-01-12 00:03:41 -05:00
Tomas Babej
b00e886142
tests: Use explicit coverage tracking 2018-07-31 03:46:58 -04:00
Igor Line
0c964460e6 Fixes filename and path in ftplugin to avoid conflict with vimwiki and
specific plugin managers
2017-10-10 01:03:01 -04:00
Renamed from ftplugin/vimwiki.vim (Browse further)