zed icon indicating copy to clipboard operation
zed copied to clipboard

vim: `ctrl-w ]`/`ctrl-w ctrl-]` doesn't open the "tag" under the cursor in a new split

Open afgomez opened this issue 5 months ago • 1 comments
trafficstars

Summary

Description

The vim keymap is missing two bindings to open a "tag" in a new split. Since zed already maps Ctrl-] to open a new definition, I think it could also map Ctrl-w ] and Ctrl-w Ctrl-] as well.

From the (neo)vim docs:

CTRL-W ]					*CTRL-W_]* *CTRL-W_CTRL-]*
CTRL-W CTRL-]	Split current window in two.  Use identifier under cursor as a
		tag and jump to it in the new upper window.
		In Visual mode uses the Visually selected text as a tag.
		Make new window N high.

Neovim remaps this when an LSP is open to trigger "Go To definition" in a new split.

Steps to reproduce:

  1. Go to a file that is handled by an LSP
  2. Try to go to a definition pressing ctrl-w ctrl-]

Expected Behavior:

The definition opens in a new split

Actual Behavior:

The definition opens in a new tab

Zed Version and System Specs

Zed: v0.189.4 (Zed Preview) OS: macOS 15.5.0 Memory: 48 GiB Architecture: aarch64

afgomez avatar Jun 03 '25 15:06 afgomez