You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go.nvim/playground/init_packer.lua

73 lines
2.0 KiB
Lua

vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/site]])
2 years ago
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
2 years ago
local plugin_folder = function()
2 years ago
local host = os.getenv('HOST_NAME')
if host and (host:find('Ray') or host:find('ray')) then
2 years ago
return [[~/github/]] -- vim.fn.expand("$HOME") .. '/github/'
else
2 years ago
return ''
2 years ago
end
end
local function load_plugins()
2 years ago
require('packer').startup({
function(use)
2 years ago
use({ 'wbthomason/packer.nvim' })
use({
2 years ago
'nvim-treesitter/nvim-treesitter',
config = function()
2 years ago
require('nvim-treesitter.configs').setup({
ensure_installed = { 'go' },
highlight = { enable = true },
})
end,
2 years ago
run = ':TSUpdate',
})
2 years ago
use({ 'neovim/nvim-lspconfig' })
use({
2 years ago
plugin_folder() .. 'ray-x/go.nvim',
requires = {
2 years ago
'mfussenegger/nvim-dap', -- Debug Adapter Protocol
'rcarriga/nvim-dap-ui',
'theHamsta/nvim-dap-virtual-text',
'ray-x/guihua.lua',
},
config = function()
2 years ago
require('go').setup({
2 years ago
verbose = true,
goimports = 'gopls',
2 years ago
lsp_cfg = {
handlers = {
['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
run_in_floaterm = true,
})
end,
})
end,
config = {
package_root = package_root,
2 years ago
compile_path = install_path .. '/plugin/packer_compiled.lua',
},
})
end
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system({
2 years ago
'git',
'clone',
'https://github.com/wbthomason/packer.nvim',
install_path,
})
load_plugins()
2 years ago
require('packer').sync()
else
load_plugins()
end
2 years ago
vim.cmd('colorscheme murphy')