13 lines
377 B
Bash
Executable file
13 lines
377 B
Bash
Executable file
#!/bin/sh
|
|
|
|
file="$1"
|
|
line="$2"
|
|
|
|
for sock in /run/user/"$(id -u)"/nvim.*.0; do
|
|
[ -S "$sock" ] || continue
|
|
result=$(nvim --headless --server "$sock" --remote-expr "bufnr('$file')" 2>/dev/null)
|
|
if [ "$result" != "-1" ] && [ -n "$result" ]; then
|
|
nvim --headless --server "$sock" --remote-expr "execute('b +$line $file | normal! zz')" >/dev/null 2>&1
|
|
exit 0
|
|
fi
|
|
done
|