use vim API in init_lazy.lua

pull/445/head
ray-x 3 months ago
parent c7b4b1ae10
commit 872612174c

@ -1,7 +1,11 @@
-- NOTE: this setup should work for both Mac and Linux
-- change the slash to backslash in PATH for Windows
vim.cmd([[set runtimepath=$VIMRUNTIME]]) vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/lazy]]) local tmpdir = vim.loop.os_tmpdir() .. '/nvim'
packpath = tmpdir .. '/lazy'
vim.cmd([[set packpath=]] .. packpath)
local package_root = '/tmp/nvim/lazy' local package_root = packpath
local plugin_folder = function() local plugin_folder = function()
local host = os.getenv('HOST_NAME') local host = os.getenv('HOST_NAME')
if host and (host:find('Ray') or host:find('ray')) then if host and (host:find('Ray') or host:find('ray')) then
@ -40,7 +44,7 @@ local function load_plugins()
'ray-x/go.nvim', 'ray-x/go.nvim',
dev = (plugin_folder() ~= ''), dev = (plugin_folder() ~= ''),
-- dev = true, -- dev = true,
ft = 'go', ft = { 'go', 'gomod', 'gosum', 'gotmpl', 'gohtmltmpl', 'gotexttmpl' },
dependencies = { dependencies = {
'mfussenegger/nvim-dap', -- Debug Adapter Protocol 'mfussenegger/nvim-dap', -- Debug Adapter Protocol
'rcarriga/nvim-dap-ui', 'rcarriga/nvim-dap-ui',
@ -50,16 +54,9 @@ local function load_plugins()
config = true, config = true,
opts = { opts = {
verbose = true, verbose = true,
lsp_cfg = { -- log_path = '~/tmp/go.log',
handlers = { lsp_cfg = true,
['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'double' }),
['textDocument/signatureHelp'] = vim.lsp.with(
vim.lsp.handlers.signature_help,
{ border = 'round' }
),
}, },
}, -- false: do nothing
}
}, },
} }
end end

Loading…
Cancel
Save