nvim: change server socket fallback to user dir
This commit is contained in:
parent
80a206efbf
commit
5c381ad548
|
@ -1,7 +1,8 @@
|
||||||
require('my/plugins')
|
require('my/plugins')
|
||||||
|
|
||||||
local serversock = string.format("%s/nvim.%s.sock",
|
local serversock = (
|
||||||
vim.env['XDG_RUNTIME_DIR'] or '/tmp', vim.env['USER'])
|
vim.env['XDG_RUNTIME_DIR'] or vim.env['XDG_STATE_HOME'] or
|
||||||
|
vim.env['HOME'] .. '/.local/state') .. '/nvim.sock'
|
||||||
if vim.fn.filereadable(serversock) == 0 then
|
if vim.fn.filereadable(serversock) == 0 then
|
||||||
vim.fn.serverstart(serversock);
|
vim.fn.serverstart(serversock);
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,8 +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) \
|
local sockdir="${XDG_RUNTIME_DIR:-${XDG_STATE_HOME:-${HOME}/.local/state}}"
|
||||||
--server ${XDG_RUNTIME_DIR:-/tmp}/nvim.${USER}.sock"
|
VISUAL="$(command -v nvim) --server ${sockdir}/nvim.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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user