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

@@ -8,23 +8,25 @@
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-spell": { "branch": "master", "commit": "32a0867efa59b43edbb2db67b0871cfad90c9b66" }, "cmp-spell": { "branch": "master", "commit": "32a0867efa59b43edbb2db67b0871cfad90c9b66" },
"formatter.nvim": { "branch": "master", "commit": "34dcdfa0c75df667743b2a50dd99c84a557376f0" }, "formatter.nvim": { "branch": "master", "commit": "34dcdfa0c75df667743b2a50dd99c84a557376f0" },
"lazy.nvim": { "branch": "main", "commit": "6a2c47e6424a3f1e373bfeb714b716f6be13501c" }, "go.nvim": { "branch": "master", "commit": "2f573a297bea3a483a3607ae7c607a8a08d27993" },
"guihua.lua": { "branch": "master", "commit": "5ad8dba19ce9b9fd8965598984dfdc9c119f97e4" },
"lazy.nvim": { "branch": "main", "commit": "59335c5b9d116f5d3948f833288a89e2a829a005" },
"lazygit.nvim": { "branch": "main", "commit": "de35012036d43bca03628d40d083f7c02a4cda3f" }, "lazygit.nvim": { "branch": "main", "commit": "de35012036d43bca03628d40d083f7c02a4cda3f" },
"lsp_signature.nvim": { "branch": "master", "commit": "bdf3dc7bb03edd25c2173e0e31c2fb122052ed23" }, "lsp_signature.nvim": { "branch": "master", "commit": "bdf3dc7bb03edd25c2173e0e31c2fb122052ed23" },
"lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "81e30dd629de24cbb26d08073ee938ab40006695" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "48025d62f45af52ba47e4193b854864839392e4c" },
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" }, "mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "71f1841ba6c652908678cece623f52c1fea8a6cd" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "71f1841ba6c652908678cece623f52c1fea8a6cd" },
"neodev.nvim": { "branch": "main", "commit": "58b1c0740e8ad79ce71e2649a449bb90536435cf" }, "neodev.nvim": { "branch": "main", "commit": "41581561a0ffc6ea6a191ee90a23f8c1c7f470fb" },
"nightfox.nvim": { "branch": "main", "commit": "fe2fc7b93d66349eff2c5baa6cec922ee3958f56" }, "nightfox.nvim": { "branch": "main", "commit": "fe2fc7b93d66349eff2c5baa6cec922ee3958f56" },
"noice.nvim": { "branch": "main", "commit": "396f9146529130904e07c45e90ecdbfa607534f3" }, "noice.nvim": { "branch": "main", "commit": "396f9146529130904e07c45e90ecdbfa607534f3" },
"nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" }, "nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" },
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-lsp-installer": { "branch": "main", "commit": "17e0bfa5f2c8854d1636fcd036dc8284db136baa" }, "nvim-lsp-installer": { "branch": "main", "commit": "17e0bfa5f2c8854d1636fcd036dc8284db136baa" },
"nvim-lspconfig": { "branch": "master", "commit": "576c8a5987bb276d234dd1d04e6c9fe60da1185d" }, "nvim-lspconfig": { "branch": "master", "commit": "fabd2578cbce0a76d48afa4b369f27a08f03ead3" },
"nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" },
"nvim-treesitter": { "branch": "master", "commit": "16ea2969ea0a5ba902fceece9b2db10c7c9ba2d6" }, "nvim-treesitter": { "branch": "master", "commit": "776e4d341b5416c995e74c3abbf75f9cec26aa5e" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" },
"nvim-web-devicons": { "branch": "master", "commit": "45d0237c427baba8cd05e0ab26d30e2ee58c2c82" }, "nvim-web-devicons": { "branch": "master", "commit": "45d0237c427baba8cd05e0ab26d30e2ee58c2c82" },
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" }, "plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },

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 -- Toggle Lazy Git
keymap("n", '<leader>gg', ':LazyGit<CR>', default_options) 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. -- Toggle term key maps, that get attached when terminal is opened.
function _G.set_terminal_keymaps() function _G.set_terminal_keymaps()

View File

@@ -95,10 +95,10 @@ return {
["<C-d>"] = cmp.mapping.scroll_docs(-4), ["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(), ["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm { ["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = false select = true
}, },
["<Tab>"] = cmp.mapping(function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then 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", "ray-x/lsp_signature.nvim",
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
"folke/neodev.nvim", "folke/neodev.nvim",
"mhartington/formatter.nvim" "mhartington/formatter.nvim",
"ray-x/go.nvim",
}, },
opts = { opts = {
ensure_installed = { ensure_installed = {

View File

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

View File

@@ -1,4 +1,14 @@
#!/bin/sh #!/bin/sh
session=$(tmux list-sessions -F \#S | gum filter --placeholder "Pick a session...") session=${1}
tmux switch-client -t "$session" || tmux attach -t "$session"
if [ -z "$session" ]; then
session=$(tmux list-sessions -F \#S | gum filter --placeholder "Pick a session...")
tmux switch-client -t "$session" || tmux attach -t "$session"
else
if [ ! -z "$(tmux list-sessions -F \#S | grep $session)" ]; then
tmux switch-client -t "$session" || tmux attach -t "$session"
else
echo "No session found for: $session"
fi
fi

View File

@@ -64,7 +64,6 @@ bind -T prefix l select-pane -R
bind -n S-Left previous-window bind -n S-Left previous-window
bind -n S-Right next-window bind -n S-Right next-window
# reload new changes # reload new changes
bind-key R source-file ~/.config/tmux/tmux.conf\; \display-message "source-file done" bind-key R source-file ~/.config/tmux/tmux.conf\; \display-message "source-file done"