Richardgill Nix Nvim

Open Files in Nvim

tomevault-io Updated

File contents

Open Files in Nvim

Open files in the running nvim instance connected to this tmux session.

Command

nvim --server "$NVIM_SOCKET" --remote <files...>

Environment

  • $NVIM_SOCKET - Path to the nvim socket (set automatically in worktree sessions)

Examples

# Open a single file
nvim --server "$NVIM_SOCKET" --remote src/index.ts

# Open multiple files
nvim --server "$NVIM_SOCKET" --remote src/index.ts src/utils.ts

# Open file at specific line (use +line before filename)
nvim --server "$NVIM_SOCKET" --remote +42 src/index.ts

Troubleshooting

  • Socket not set: Ensure you're in a worktree session, or manually set NVIM_SOCKET
  • Connection refused: The nvim instance may have closed; restart nvim with v . --listen $NVIM_SOCKET
  • File not opening: Verify the file path is correct and accessible

Notes

  • The socket is set via tmux set-environment at session creation
  • New panes/windows in the session inherit NVIM_SOCKET

$ARGUMENTS


Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/richardgill--nix--nvim commit c1f76f2974

Frequently asked questions

npx skillmds@latest add tomevault-io/richardgill-nix-nvim