Commit graph

83 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
Philipp Weißmann
406041c868 Fix <CR> mapping (use nnoremap instead of nmap)
This fixes non-working <CR> key to follow vimwiki links / display task infos
2017-05-23 14:44:48 +02:00
Tomas Babej
6bcc93cfe6 plugin: Fix stupid copy-paste error 2017-03-17 17:11:35 +01:00
Tomas Babej
cf3789f074 plugin: Prefer python3 over python2 by default 2017-03-16 12:26:39 +01:00
Bodo Graumann
0c06e02a0e BufEnter: load cache of current buffer
This fixes issue #116.
2017-01-27 22:23:33 +01:00
Bodo Graumann
8f51f2f4c2 main: Use one cache object for each buffer 2017-01-27 22:23:33 +01:00
Tomas Babej
886b90df67 ftplugin: Add vim command and mappings for the redo method 2017-01-11 09:52:36 +01:00
Tomas Babej
21b766134f coverage: Explicit coverage tracking no longer needed 2017-01-09 00:38:24 +01:00
Tomas Babej
590749d1aa ftplugin: Default to python3 for neovim 2017-01-07 18:53:53 +01:00
Tomas Babej
be0cfed86c python3: Use global variables for py/pyfile so they are accessible from within pyton too 2016-12-16 04:16:46 +01:00
Tomas Babej
8f4a87e16e ftplugin: Fix invalid quotation level 2016-12-16 04:11:10 +01:00
Tomas Babej
91af39e17e ftplugin: Support both +python and +python3 2016-12-16 03:27:35 +01:00
Tomas Babej
d360f67b80 Reset cache after entering a new buffer 2016-12-12 23:43:24 +01:00
Tomas Babej
6806c26589 folding: Make sure SessionLoadPost event does not visibly error out
The SessionLoadPost event is fired mainly for other plugins to register
that a view has been created. However, if no autocmd listens to
SessionLoadPost, vim provides an error message. Hence we need to supress
the output of this call.
2016-05-23 10:00:21 +02:00
Tomas Babej
74a81250c3 folds: Make sure the missing views do not raise exceptions 2016-05-14 22:35:03 +02:00
Tomas Babej
9feb8f0dcd syntax: Fire a SessionLoadPost event after the view is loaded 2016-05-12 15:56:32 +02:00
Tomas Babej
a27d05a512 taskwiki: Make the plugin a proper Python module 2016-05-11 18:52:51 +02:00
Philipp Hack
64a6852eac Added option to disable fold saving 2015-12-22 17:29:44 +01:00
Tomas Babej
34c4119c64 folds: Preserve folding of the taskwiki files 2015-09-18 07:07:50 +02:00
absala
0ec4d1d4f8 small: typo 2015-09-10 23:07:00 +02:00
Tomas Babej
3641ac227e taskwiki: Add TaskWikiSort command 2015-08-13 23:14:48 +02:00
Tomas Babej
8054bbd423 ftplugin: Execute TaskWikiBufferSave instead of direct call 2015-08-13 23:14:26 +02:00
Tomas Babej
86d2e60e20 commands: Add TaskWikiBufferSave and TaskWikiBufferLoad commands 2015-08-13 02:11:46 +02:00
Tomas Babej
5a5b5b3c91 base: Check for 3rd-party requirements 2015-07-16 01:38:40 +02:00
Tomas Babej
5c9a0b0b32 mappings: Add mappings fo visual mode 2015-04-23 10:19:12 +02:00
Tomas Babej
13177a92e3 taskwiki: Add taskwiki_disable variable check that allows for a quick flexible taskwiki turnoff 2015-04-22 20:16:56 +02:00
Tomas Babej
dfaef302f1 taskwiki: Add ChoosSplitTags command 2015-04-10 17:19:45 +02:00
Tomas Babej
4630c371ec keymaps: Add mappings for TaskWikiChooseProject command 2015-04-10 17:04:18 +02:00
Tomas Babej
f3331986f4 mappings: Fix mapping for TaskWikiCalendar 2015-04-09 17:09:28 +02:00