nvim: change server socket fallback to user dir
This commit is contained in:
parent
80a206efbf
commit
5c381ad548
|
@ -1,7 +1,8 @@
|
|||
require('my/plugins')
|
||||
|
||||
local serversock = string.format("%s/nvim.%s.sock",
|
||||
vim.env['XDG_RUNTIME_DIR'] or '/tmp', vim.env['USER'])
|
||||
local serversock = (
|
||||
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
|
||||
vim.fn.serverstart(serversock);
|
||||
end
|
||||
|
|
|
@ -22,8 +22,8 @@ if type nvim >& -; then
|
|||
# Open files from :terminal in parent instance
|
||||
VISUAL="${VISUAL} --server ${NVIM} --remote"
|
||||
else
|
||||
VISUAL="$(command -v nvim) \
|
||||
--server ${XDG_RUNTIME_DIR:-/tmp}/nvim.${USER}.sock"
|
||||
local sockdir="${XDG_RUNTIME_DIR:-${XDG_STATE_HOME:-${HOME}/.local/state}}"
|
||||
VISUAL="$(command -v nvim) --server ${sockdir}/nvim.sock"
|
||||
fi
|
||||
elif command -v emacsclient > /dev/null; then
|
||||
# Add Defaults env_keep += "SSH_CONNECTION" to /etc/sudoers.d/ssh_vars
|
||||
|
|
Loading…
Reference in New Issue
Block a user