Created
June 8, 2025 19:37
-
-
Save Loupax/0d92f49c110128dff92db235a86c31d7 to your computer and use it in GitHub Desktop.
Edit function that, when called from inside a nvim terminal, it will open the file in the already existing nvim instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
edit() { | |
if [ -z "$NVIM" ]; then | |
nvim "$1" | |
return | |
fi | |
nvim --server "$NVIM" --remote-send "<C-\\><C-N><C-w>t:edit $1<CR>" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment