nvim: add ${USER} to socket name

This commit is contained in:
tastytea 2022-08-24 16:13:39 +02:00
parent ce0cba8ff2
commit 027f2066b6
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
require('my/plugins') require('my/plugins')
local serversock = (vim.env['XDG_RUNTIME_DIR'] or '/tmp') .. '/nvim.sock' local serversock = string.format("%s/nvim.%s.sock",
vim.env['XDG_RUNTIME_DIR'] or '/tmp', vim.env['USER'])
if vim.fn.filereadable(serversock) == 0 then if vim.fn.filereadable(serversock) == 0 then
vim.fn.serverstart(serversock); vim.fn.serverstart(serversock);
end end

View File

@ -22,7 +22,8 @@ if type nvim >& -; then
# Open files from :terminal in parent instance # Open files from :terminal in parent instance
VISUAL="${VISUAL} --server ${NVIM} --remote" VISUAL="${VISUAL} --server ${NVIM} --remote"
else else
VISUAL="$(command -v nvim) --server ${XDG_RUNTIME_DIR:-/tmp}/nvim.sock" VISUAL="$(command -v nvim) \
--server ${XDG_RUNTIME_DIR:-/tmp}/nvim.${USER}.sock"
fi fi
elif command -v emacsclient > /dev/null; then elif command -v emacsclient > /dev/null; then
# Add Defaults env_keep += "SSH_CONNECTION" to /etc/sudoers.d/ssh_vars # Add Defaults env_keep += "SSH_CONNECTION" to /etc/sudoers.d/ssh_vars