Skip to content

Instantly share code, notes, and snippets.

@yebt
Last active January 31, 2026 16:27
Show Gist options
  • Select an option

  • Save yebt/7f2abe154a5849ff3c073e9058e19d8f to your computer and use it in GitHub Desktop.

Select an option

Save yebt/7f2abe154a5849ff3c073e9058e19d8f to your computer and use it in GitHub Desktop.
## In console
export LAUNCH_EDITOR=nvsr
## Create an alias for nvs
nvim --listen ~/.cache/nvim/server.pipe
## Create a script for nvsr in:
## ~/.local/bin/nvsr
#!/bin/bash
# gets called with 3 args: filename, line, column
filename=$1
line=$2
column=$3
# call your editor with whatever args it expects
# my-editor -l $line -c $column -f $filename
# nvim --server ~/.cache/nvim/server.pipe --remote $filename
nvim --server ~/.cache/nvim/server.pipe --remote-send \
"<Esc>:e ${filename}<CR>:silent call cursor(${line},${column})<CR>"
#!/bin/bash
# gets called with 3 args: filename, line, column
filename=$1
line=$2
column=$3
# call your editor with whatever args it expects
# my-editor -l $line -c $column -f $filename
# nvim --server ~/.cache/nvim/server.pipe --remote $filename
nvim --server ~/.cache/nvim/server.pipe --remote-send \
"<Esc>:e ${filename}<CR>:silent call cursor(${line},${column})<CR>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment