From 027f2066b632d8a674ee3f659e795b654272b90a Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 24 Aug 2022 16:13:39 +0200 Subject: [PATCH] nvim: add ${USER} to socket name --- .config/nvim/lua/my/net.lua | 3 ++- .config/zsh/.zprofile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/my/net.lua b/.config/nvim/lua/my/net.lua index 6a0f4c8..3fc9f44 100644 --- a/.config/nvim/lua/my/net.lua +++ b/.config/nvim/lua/my/net.lua @@ -1,6 +1,7 @@ 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 vim.fn.serverstart(serversock); end diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 6175008..2d4172b 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -22,7 +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.sock" + VISUAL="$(command -v nvim) \ + --server ${XDG_RUNTIME_DIR:-/tmp}/nvim.${USER}.sock" fi elif command -v emacsclient > /dev/null; then # Add Defaults env_keep += "SSH_CONNECTION" to /etc/sudoers.d/ssh_vars