1
0
Fork 0

nvim: create socket dir if it doesn't exist

This commit is contained in:
tastytea 2022-08-27 17:54:29 +02:00
parent f3621425c8
commit 0dba88f1d5
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 5 additions and 5 deletions

View File

@ -1,10 +1,10 @@
require('my/plugins')
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);
local sockdir = (vim.env['XDG_RUNTIME_DIR']
or vim.env['XDG_STATE_HOME'] or vim.env['HOME'] .. '/.local/state')
vim.fn.mkdir(sockdir, 'p')
if vim.fn.filereadable(sockdir .. '/nvim.sock') == 0 then
vim.fn.serverstart(sockdir .. '/nvim.sock');
end
if vim.g.started_by_firenvim then