Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you don't use ~/bin, swap that for another directory on your path.
# Usage

```
invim [options] file Edit file in the Neovim running at $NVIM_LISTEN_ADDRESS
invim [options] file Edit file in the Neovim running at $NVIM

Options:
--remote Open the file with :edit. This is the default
Expand Down
10 changes: 5 additions & 5 deletions invim
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env bash
set -o errexit

if [[ ! $NVIM_LISTEN_ADDRESS ]] ; then
echo 'Error: Neovim must be running and have set $NVIM_LISTEN_ADDRESS for invim to communicate with it' >&2
if [[ ! $NVIM ]] ; then
echo 'Error: Neovim must be running and have set $NVIM for invim to communicate with it' >&2
exit 1
fi

# Now that we've checked for NVIM_LISTEN_ADDRESS, we don't want any more undefined
# Now that we've checked for NVIM, we don't want any more undefined
set -o nounset

# Defaults
Expand All @@ -33,7 +33,7 @@ function abspath() {
function usage() {
cat <<'EOF'
Usage:
invim [options] file Edit file in the Neovim running at $NVIM_LISTEN_ADDRESS
invim [options] file Edit file in the Neovim running at $NVIM

Options:
--remote Open the file with :edit. This is the default
Expand Down Expand Up @@ -115,7 +115,7 @@ $COMMAND \
<<EOF
:silent lua <<EOLUA
local wait = $WAIT
local addr = vim.fn.getenv("NVIM_LISTEN_ADDRESS")
local addr = vim.fn.getenv("NVIM")
local chanId = vim.fn.sockconnect('pipe', addr, { rpc = true })
local script = '$OPEN_METHOD ' .. $TO_EDIT
if wait then
Expand Down