Commit graph

179 commits

Author SHA1 Message Date
Aly Thobani
0b1168b2ae chore: replace unnecessary CodeMirrorEditor import aliases
- CodeMirror.Editor is globally available as a type (and already used in other files), so lets just
  stick consistently to using that
2026-05-24 17:32:38 -07:00
Aly Thobani
80721a3053 docs: update README to mention the provided motions support repeat and show remapping example for them 2026-05-24 17:16:17 -07:00
Aly Thobani
72e932010b docs: update README line about jump to code fence motion 2026-05-24 16:58:56 -07:00
Aly Thobani
bcad4fd818 docs: update docstrings for regexes for clarity 2026-05-24 16:04:27 -07:00
Aly Thobani
c15140ee56 test(motions): expand code fence motion coverage 2026-05-12 08:30:03 -07:00
Aly Thobani
97e75ae226 docs(readme): document code fence jump mappings 2026-05-11 17:35:56 -07:00
Aly Thobani
803ad685a0 refactor(tests): use EditorPosition in code fence specs 2026-05-11 17:31:26 -07:00
Aly Thobani
b46f370b37 chore: format test file 2026-05-11 17:29:39 -07:00
Aly Thobani
fdc3aa054e refactor(tests): deduplicate code fence motion specs 2026-05-11 17:28:48 -07:00
Aly Thobani
827dea58a1 feat(motions): add code fence jump motions 2026-05-11 17:08:45 -07:00
Threeinone
1ff5d97afc
Merge pull request #267 from alythobani/alyt/4-fix-jump-to-link-in-checkbox
Fix: Jump to link in checkbox
2026-03-25 21:50:07 -05:00
Threeinone
ba2c8243c1
Merge pull request #282 from joaosa/feat/leader-key
feat: Add <leader> key support
2026-03-25 21:29:01 -05:00
Threeinone
b3beeae815
Note on <Space> is unnecessary 2026-03-25 21:26:58 -05:00
João Andrade
10c5a580f9 feat: Add <leader> key support
Parse `let mapleader` directives and substitute `<leader>` in mapping
commands before passing lines to CodeMirror's handleEx(). This is
pure text substitution at the plugin level — no CodeMirror changes needed.

- Default leader is `\` (backslash), matching Vim
- Case-insensitive: <leader>, <Leader>, <LEADER> all work
- Single-pass processing: each `let mapleader` affects subsequent mappings only
- Only substitutes in recognized mapping commands (no false positives)
- Backwards compatible: no change for users who don't use <leader>
- Works with `source` command (sourced files inherit/override leader)

Closes #117
2026-02-16 10:50:39 +00:00
Dmitry Surin
774de34205
Update README.md (#272)
Not enough examples in readme. Trying to fix that. Spend some time to find this ability to run command without exmap
2025-08-22 06:28:13 +03:00
Aly Thobani
923de9fe8a chore: fix ts error by replacing Any with any 2025-05-18 09:21:19 -07:00
Aly Thobani
2fe5ee588c test: add more unit tests to jumpToLink.test.ts 2025-05-18 09:20:21 -07:00
Aly Thobani
2f18ae8b56 fix: make sure the closing paren of a markdown link isnt escaped 2025-05-17 22:33:45 -07:00
Aly Thobani
3d3bf60c88 docs: update docstrings for jumpToLink regexes 2025-05-17 22:33:45 -07:00
Aly Thobani
e800087a72 fix: make jumpToLink work for links inside checkboxes 2025-05-17 22:33:45 -07:00
Aly Thobani
1dd8077282 chore: remove package-lock.json from gitignore and add it to repo 2025-05-17 22:33:45 -07:00
Aly Thobani
340931c975 chore: add words to workspace dictionary to resolve cspell warnings 2025-05-17 22:33:45 -07:00
Juan Luque
4aa4ca31f1
Fix pasteinto error when clipboard text has surrounding whitespace. (#262)
`pasteinto` is called by `surroundFunc` which a string into whitespace
delimited arguments. Surrounding whitespace in the link to be copied
thus errors due to an unhandled number of arguments.

The now fixed error can be recreated by using `yy` to yank a line and
then using <A-p> to paste the link over a word. Similarly, `yW` will
reproduce the error if the link has a trailing whitespace.

`pasteinto` will still error if the link contains internal whitespace,
but this is more reasonable behavior. Fixing this will require tweaking
the regex `surroundFunc` uses to split up arguments.
2025-04-09 08:47:08 +03:00
Juan Luque
47de579471
Update README.md (#261)
Fix typo:  surround with '[ ]' command  `s[` was listed twice.
2025-02-27 16:59:31 +02:00
firai
378753b0b4
Update vim links to point to codemirror-vim repo (#251) 2024-11-24 20:30:37 +02:00
ko-shin-ryo
d376bfd048
fix: prevent yank events registration issues in multi-window setup (#249)
When opening a vault with multiple windows, non-active windows could miss the timing to register yank events. Added a mechanism to manage windows that have registered yank events to ensure proper event handling across all windows.
2024-11-17 13:13:41 +02:00
esm7
0171572ac1 Small README fix 2024-11-03 11:35:15 +02:00
esm7
e6d24066d3 Version release 2024-11-03 11:33:54 +02:00
esm7
957c14bd14 Merge branch 'master' of github.com:esm7/obsidian-vimrc-support 2024-10-31 17:04:25 +02:00
esm7
ee5897383e Documentation fix 2024-10-31 17:04:19 +02:00
Bao
a5fdaec56c
fix: guard against uninitialized codemirror instance (#246)
In obsidian (>=v1.7.2?) the codemirror instance is often not unitialized
at times, triggering some uncaught exceptions. This is particularly
noticable when:

- (w/ "Vim chord display" enabled) opening the vault w/o a note opened
- closing all tabs and opening a note

Add some null guards to avoid these errors
2024-10-31 16:02:36 +02:00
esm7
ba94e13835
Update README.md 2024-10-18 20:59:21 +03:00
esm7
10d3c3c464 Merge branch 'master' of github.com:esm7/obsidian-vimrc-support 2024-10-17 06:47:21 +03:00
esm7
040478f988 Documentation update for Obsidian 1.7 2024-10-17 06:46:32 +03:00
ko-shin-ryo
10c2b613bf
Fix RangeError when executing surround command with backward selection (#234) 2024-09-11 11:29:45 +03:00
esm7
2a5fffa2d1 Fix to https://github.com/esm7/obsidian-vimrc-support/issues/232
(and a version bump)
2024-08-08 21:09:40 +03:00
Aly Thobani
2795bb62b1
Fix: jumpToHeading shouldn't match within codeblocks (also improve jumpToLink a bit) (#233)
* fix: jumpToHeading should not jump to "headings" within codeblocks

jumpToPattern now accepts an optional filterMatch param to make this
happen

* jumpToLink can now jump to standalone hyperlinks

* Adjust/clarify docstring for `jumpToNextLink`
2024-08-04 20:50:54 +03:00
esm7
b5b50320d7 README updates and version bump 2024-07-23 20:31:44 +03:00
Aly Thobani
d2583078ac
Implement and provide default mappings for some Obsidian-specific Vim motions/commands (#222)
* feat: define and expose obsidian-specific vim commands

jumpToNextHeading: g]
jumpToPreviousHeading: g[

* Implement jumpToPreviousLink motion

* Refactoring and implementing jumpToNextLink

* refactor: new jumpToPattern function that can be used for motions

* refactor: renamed file and removed unneeded exports

* fix: return last found index even if fewer than n instances found, instead of undefined

* feat: implement moveUpSkipFold and moveDownSkipFold

* refactor: extract out helper functions for defining obsidian vim actions

* refactor: split vimApi.ts into two files

* refactor: add comment

* refactor: update names, types, etc

* feat: followLinkUnderCursor action

* feat: jumpToLink now jumps to both markdown and wiki links

* refactor: rename fns

* refactor: add docstrings / change var names

* feat: implement looping around

* refactor: cleaner implementation of jumpToPattern

* Change mappings for next/prev heading to [[ and ]]

* Tiny fixes

* docs: update docs now that some more motions are provided by default

---------

Co-authored-by: Erez Shermer <erezshermer@gmail.com>
2024-07-23 20:21:29 +03:00
esm7
89cd8c71b8 1. Added LICENSE file (https://github.com/esm7/obsidian-vimrc-support/issues/202)
2. Fixed errors when Vim mode is not active in Obsidian (https://github.com/esm7/obsidian-vimrc-support/issues/228)
2024-07-23 20:12:48 +03:00
esm7
5867e784f5
Merge pull request #219 from WATA-Haru/fix-readme-gt-gT
fix README , validate gt and gT command without Tab Switcher plugin
2024-07-01 06:45:08 +03:00
WATA-Haru
b9625acc80 fix README , validate gt and gT command without Tab Switcher plugin 2024-04-08 21:56:14 +09:00
esm7
4657923eb3
Merge pull request #218 from jsrozner/navigate_folds
Add a jssnippet to skip folds
2024-03-25 17:15:29 +02:00
jsrozner
89ae5fd0aa Add a jssnipped to skip folds 2024-03-21 16:42:30 -07:00
esm7
9ccf52a590
Merge pull request #184 from twio142/patch-1
Improve `surround`
2023-07-01 15:30:59 +03:00
esm7
224425bb6c
Merge pull request #193 from MaciejWieczor/patch-1
Update JsSnippets.md
2023-07-01 15:30:21 +03:00
Maciej Wieczór-Retman
0895ca4d07
Update JsSnippets.md 2023-06-29 12:46:35 +02:00
Maciej Wieczór-Retman
dd1838a175
Update JsSnippets.md 2023-06-29 12:45:50 +02:00
Maciej Wieczór-Retman
a864306288
Update JsSnippets.md
Vimwiki style link navigation
2023-06-24 21:57:42 +02:00
Erez Shermer
05b3a43a8e Readme update 2023-06-13 10:26:24 +03:00