Unable to use Vim-mode to edit the markdown of previewed images

Currently it’s impossible to use Vim navigation in the preview-mode to edit the markdown of image files. Any image that is previewed just shows up, and doesn’t reveal it’s code. That’s true for internal as well as external images.

I tried various keys like enter, space, TAB or the vim-shortcuts for editing, like i, but that always edits before the image code, not inside.

This is an extremely common situation if one has any images in their vault (among the dozen of us who use Vim mode :sweat_smile:). So it’s an annoyance every couple of minutes.

Steps to reproduce

  • Open the Sandbox Vault
  • activate the Vim mode
  • make sure to be in preview mode
  • either paste an image in to create the image markdown (![[image.jpg]])
    • or alternatively open the existing note called “Images”.
  • Navigate to the line using vim
  • try to edit the image markdown

Did you read and follow the Troubleshooting Guide ?

Yes

Expected result

Essentially the behavior befor the recent update: If I navigate into the line with an image link, then the preview should disappear and just reveal the code, so I can easily navigate. At the very least once I navigate inside the specific image-link markdown (less optimal).

Actual result

The image preview stays. There is no way (except with mouse navigation) to reveal the markdown code of it.

Environment

SYSTEM INFO:
Obsidian version: 1.13.7
Installer version: 1.13.7
Operating system: #1 SMP PREEMPT_DYNAMIC Fri, 21 Aug 2026 22:18:59 +0000 7.1.9-arch1-2
Login status: logged in
Language: en
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none

Distro Name: EndeavourOS (Arch)
Desktop Environment: KDE
Installation method used: AUR

Additional information

Workarounds

A workaround would be to click with the mouse on the </> icon that pops up, which defeats the idea of using the Vim keyboard navigation.

Another is to use the :image command as noted in the July 30 release notes. It works when I type :image edit. But I can’t set it to a hotkey. My current (failing) attempt for code in my .vimrc:

exmap imageEdit obcommand editor:image-edit

nnoremap <S-TAB> :imageEdit<CR>

It doesn’t work - as it seams the command is not available that way, as the command list I can see via :obcommand (as explained in the Vimrc-Support Plugin) doesn’t show this one. It’s also not as handy anyways.

Related threads

This is the issue as discussed here about the new image system, but relates to the Vim mode specifically. So I was told to make a new thread.

when the image is in focus press enter.

Enter does not work for this in VIM mode. The cursor simply jumps behind the image.

TAB does work. But selects parts of the text, which puts the user in another edit mode. This breaks when using in visual vim mode.

I replicated these behaviors under both Windows and Linux.

<Tab> and <Enter> work in insert mode.

<Tab> and g<Enter> work in Normal Mode

For normal mode, you can also use these commands:

pHLtgdEQ4z

While tab does make it possible to see the image code, it also inserts a tab in both modes.

Neither Enter nor gEnter do anything but move the cursor, and the :image commands do nothing for me.

No, it does not insert a tab. The image needs to be in focus/selected and then you do g<Enter> or <tab>.

Obsidian_POqZNRZC3h

Let me add because I starting to wonder if this other part is not clear, enter is used to to quickly edit the filename part, tab is used to edit the size part.

But the idea of insert mode is to insert the keys I press. So I would expect it to insert the TAB or a new line for Enter. I wouldn’t navigate in insert mode anyway, so I don’t quite follow.

Tab works in normal mode - but it selects text. Differently according to context. It therefore goes into a selection mode. I have to then hit ESC to be able to navigate/type normally again.
As noted: this is not ideal. And it uses up the TAB key. Which is not listed in the hotkey editor… it just doesn’t make sense to me that users should know or expect that.

Further, it doesn’t work at all in visual mode. Then Obsidian adds a tab into the text - indenting the image rather than showing its code.

The g<Enter> suggestion I don’t understand either. Maybe that’s something I’m unfamiliar with, as there there are many ways to use VIM. Maybe someone can chime in if that’s a common command.

I tried to go into that in the “workarounds” section. Typing `:image edit" for every time I select an image is cumbersome. Assigning it to a key for VIM seems to be impossible (the command is unavailable for vim).

That wasn’t clear to me. And it acts differently when there is an Alt-Text or a size definition. I’m not even sure that is an intuitive workflow for non-vim users. Would you expect people to know or predict this without reading the manual? Maybe list it in the hotkeys?
From the VIM side: I would’ve never thought of TAB, nor g<Enter>. Neither do these work in all cases. The former workflow of just showing the code without extra keys, worked great.

I know that VIM support is not the center of Obsidian. But this is broken. And at least an option to turn it off would be necessary.

RIght now,

Insert mode follows the non-vim active case (enter to edit the line, tab to edit the size).
Normal mode has several commands defined to manipulate the image, including some shorthands. We picked g<Enter>, because <enter> does something else already in Normal mode.
Visual mode doesn’t have an expansion right now. This is intentional and I am not sure we should do it.

Vim.mapCommand('g+', 'action', 'imageResize', { direction: 'grow' }, { context: 'normal' });
Vim.mapCommand('g-', 'action', 'imageResize', { direction: 'shrink' }, { context: 'normal' });
Vim.mapCommand('g=', 'action', 'imageResetSize', {}, { context: 'normal' });
Vim.mapCommand('g<CR>', 'action', 'imageEdit', {}, { context: 'normal' });

We don’t make the vimrc plugin. From what I read obcommand is used to map obsidian app-level commands (the one you access in command palette or setting>hotkeys. But these are not that kind of commands. So I don’t see how obcommand would work here.

For me, Tab does the trick, but I need to have the image highlighted.
So going to the line with the image, and then one l to highlight it, and then hitting Tab.

  1. selecting the line

  1. hit l

  1. hit Tab

Now I can edit without switching to source mode or doing any vimrc tweaks.

From the release notes:

  1. Live Preview: Added keyboard interactions when an image is selected. Press + or - to resize the selected image, and 0 to reset the image size. Press Enter to edit the image, or Tab to manually edit the image size.
  2. Vim: Added a new :image Ex command to interact with the selected image. Use :image grow and :image shrink to resize the image, and :image reset to reset the image size. It also supports a count, so :5image grow will grow the image 5 times.

Thanks for the explanation. I can see where you’re coming from with this hotkey choice, but from my side it doesn’t add up. Why do users have to look up, then learn and then execute various commands with several keystrokes each time for something that worked perfectly fine without any of that? It then doesn’t function in every case.

I guess we can leave it here. I would prefer an option to remove that though, so that a typical VIM workflow is possible.

@laurensdc Thanks for the pictures. Yes, Tab does work for normal mode.
Best would be if one could see the source right-away, so that navigation like f( works, for example. I use that all the time.

Ok, I this point we have move it from “it doesn’t work” to “I don’t like the change”, which is a fair criticism.

You can

  1. Use source mode
  2. add your voice to one of the following FRs:
    Live preview: Do not hide / always show the link for embedded images (attachments)
    Add option to disable the new image system (show full screen, change resize, view image code)