the key @ in vim command mode replays a recorded vim macro (e.g. @a replays the recorded macro of register a)
Actual result
Typing @ is not recognised as a command, but inserted into the text at the current position.
Environment
Operating system: macOS Monterey Version 12.6
Debug info:
SYSTEM INFO:
Obsidian version: v0.16.3
Installer version: v0.14.6
Operating system: Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 21.6.0
Login status: logged in
Catalyst license: insider
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: adapt to system
Community theme: none
Snippets enabled: 1
Restricted mode: on
I just tested in Windows and MacOS, and it’s working for me.
(You need to redownload and install because your installer is out of date, older than certain features that the auto-updater can’t self-install. That won’t necessarily fix this particular issue. But it might.)
As a tangential question, is not being able to self-update a bug/issue with the installer that will eventually be resolved, or is it an inherent weakness that will always have to be worked around by doing a manual download/install from time to time?
I have downloaded and installed Obsidian again with the latest installer. But the Problem is still here (@ is not recognized as a vim command).
SYSTEM INFO:
Obsidian version: v0.16.3
Installer version: v0.15.9
Operating system: Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 21.6.0
Login status: logged in
Catalyst license: insider
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: adapt to system
Community theme: none
Snippets enabled: 1
Restricted mode: on
Does it happen here https://codemirror-vim–util.repl.co/ ? NO, but something unexpected happens, as soon as I press @, an edit box labeled “Go to line:” opens below the editor.
It is not possible to reproduce the error on https://codemirror-vim--util.repl.co as this environment is different from Obsidian and the two environments behave differently.
When I press Option-G on my Swiss keyboard in Obsidian, the @ character is written (instead of executing as a VIM command). However, when I press Option-G in https://codemirror-vim--util.repl.co, an edit box with the label “Go to line:” appears below the editor and no @ character is inserted into the text in the editor.
If this is something relegated to how obsidian handles hotkey in various languages, we are not going to fix this because solving this problem for all possible languages with the current API has proven impossible. We found a compromise that works for most people and we won’t change it until new APIs are available.
If this problem comes from a library upstream, in this case codemirror-vim, if they fix it, we will get the fix.
Without VIM, you can also check if Option-G triggers some command in obsidian and than disable that command/hotkey in settings. Maybe that’ll help.
But Alt is in the ignored keys, so this isn’t the same issue.
I can repro this with dead keys in normal mode, so the issue is probably that it doesn’t wait for the composition to happen. If that is how macos does it with option keys, I don’t know if that is the case. See this issue comment re dead keys.
I am still waiting for a solution. I think I have described simply and clearly above how to reproduce this bug (by switching to Swiss Keyboard). Unfortunately, I cannot correct this bug myself and have to rely on the help of others.
I see. I have created a github issue on the codemirror-vim repo (link). The (supposed) fix is to be included from upstream. @WhiteNoise did not give a precise estimate of time until inclusion, so we’ll just have to wait (link)
Create a file named .obsidian.vimrc in your vault directory and insert the following lines to add a remap for the @-character (I chose <Space>m for “macro”, but you can choose whatever you like):
" unmap space to act as leader key
unmap <Space>
"remap @-key
nmap <Space>m @
Then you can execute recorded macros in Obsidian with <Space>m {register}.