Added go.nvim, updated ts script to accept a session argument

This commit is contained in:
Michael Housh
2023-10-01 11:28:24 -04:00
parent 7c5c642ae5
commit 660ff7d94d
9 changed files with 52 additions and 11 deletions

View File

@@ -34,3 +34,14 @@ vim.api.nvim_create_autocmd(
}
)
vim.api.nvim_create_autocmd(
"BufWritePre",
{
pattern = "*.go",
callback = function()
require('go.format').goimport()
end,
group = vim.api.nvim_create_augroup("GoFormat", { clear = true })
}
)

View File

@@ -34,6 +34,8 @@ keymap("n", "<c-n>", "<CMD>:Neotree toggle<CR>", default_options)
-- Toggle Lazy Git
keymap("n", '<leader>gg', ':LazyGit<CR>', default_options)
keymap("n", "<leader>gf", ":Telescope git_files<CR>", default_options)
keymap("n", "<leader>t", ":ToggleTerm<CR>", default_options)
-- Toggle term key maps, that get attached when terminal is opened.
function _G.set_terminal_keymaps()

View File

@@ -95,10 +95,10 @@ return {
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = false
select = true
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then

View File

@@ -0,0 +1,15 @@
return {
"ray-x/go.nvim",
lazy = true,
dependencies = { -- optional packages
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("go").setup()
end,
event = {"CmdlineEnter"},
ft = {"go", 'gomod'},
build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
}

View File

@@ -14,7 +14,8 @@ return {
"ray-x/lsp_signature.nvim",
"neovim/nvim-lspconfig",
"folke/neodev.nvim",
"mhartington/formatter.nvim"
"mhartington/formatter.nvim",
"ray-x/go.nvim",
},
opts = {
ensure_installed = {

View File

@@ -33,6 +33,7 @@ require("lazy").setup({
{ import = 'user.plugin.lualine' },
{ import = 'user.plugin.treesitter' },
{ import = 'user.plugin.formatter' },
{ import = 'user.plugin.go' },
-- Navigation --
{ import = 'user.plugin.neo-tree' },