diff --git a/nvim/m-housh/lazy-lock.json b/nvim/m-housh/lazy-lock.json index cd3a630..9f41e7a 100644 --- a/nvim/m-housh/lazy-lock.json +++ b/nvim/m-housh/lazy-lock.json @@ -38,5 +38,6 @@ "telescope.nvim": { "branch": "0.1.x", "commit": "54930e1abfc94409e1bb9266e752ef8379008592" }, "toggleterm.nvim": { "branch": "main", "commit": "61e8ad370d4da5d84c77e31671027bc094ac06ca" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, - "wrapping.nvim": { "branch": "master", "commit": "e1ce68aae5ea729fc20e5bc17fb569314f76b9bb" } + "wrapping.nvim": { "branch": "master", "commit": "e1ce68aae5ea729fc20e5bc17fb569314f76b9bb" }, + "zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" } } \ No newline at end of file diff --git a/nvim/m-housh/lua/user/mappings.lua b/nvim/m-housh/lua/user/mappings.lua index 72531d1..4b6ba16 100644 --- a/nvim/m-housh/lua/user/mappings.lua +++ b/nvim/m-housh/lua/user/mappings.lua @@ -37,6 +37,9 @@ keymap("n", 'gg', ':LazyGit', default_options) keymap("n", "gf", ":Telescope git_files", default_options) keymap("n", "t", ":ToggleTerm", default_options) +-- Zen Mode Toggle +keymap('n', 'z', ":ZenMode", default_options) + -- Toggle term key maps, that get attached when terminal is opened. function _G.set_terminal_keymaps() local opts = { buffer = 0 } diff --git a/nvim/m-housh/lua/user/plugin/cmp.lua b/nvim/m-housh/lua/user/plugin/cmp.lua index 6e92480..2d2b5a1 100644 --- a/nvim/m-housh/lua/user/plugin/cmp.lua +++ b/nvim/m-housh/lua/user/plugin/cmp.lua @@ -112,10 +112,10 @@ return { [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() --- elseif luasnip.expandable() then --- luasnip.expand() --- elseif luasnip.expand_or_jumpable() then --- luasnip.expand_or_jump() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() elseif has_words_before() then cmp.complete() else diff --git a/nvim/m-housh/lua/user/plugin/lsp.lua b/nvim/m-housh/lua/user/plugin/lsp.lua index 52806f5..1765026 100644 --- a/nvim/m-housh/lua/user/plugin/lsp.lua +++ b/nvim/m-housh/lua/user/plugin/lsp.lua @@ -82,6 +82,7 @@ return { buf_set_keymap("n", "q", "lua vim.lsp.diagnostic.set_loclist()", opts) buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') end -- Use a loop to conveniently call 'setup' on multiple servers and @@ -109,7 +110,14 @@ return { on_attach = on_attach, capabilities = capabilities, settings = { - gopls = {analyses = {unusedparams = false}, staticcheck = true}, + gopls = { + experimentalPostfixCompletions = true, + analyses = { + unusedparams = true, + shadow = true + }, + staticcheck = true + }, lua_ls = { Lua = { completion = { diff --git a/nvim/m-housh/lua/user/plugins.lua b/nvim/m-housh/lua/user/plugins.lua index 8356256..488f859 100644 --- a/nvim/m-housh/lua/user/plugins.lua +++ b/nvim/m-housh/lua/user/plugins.lua @@ -45,5 +45,9 @@ require("lazy").setup({ { import = 'user.plugin.toggleterm' }, { import = 'user.plugin.which-key' }, { import = 'user.plugin.wrapping' }, + { + "folke/zen-mode.nvim", + opts = { } + }, }) diff --git a/scripts/scripts/ts b/scripts/scripts/ts index 2525583..7e7e968 100755 --- a/scripts/scripts/ts +++ b/scripts/scripts/ts @@ -3,12 +3,8 @@ session=${1} 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" + choice=$(tmux list-sessions -F \#S | gum filter --placeholder "Pick a session...") + tmux switch-client -t "$choice" || tmux attach -t "$choice" 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 + tmux switch-client -t "$session" || tmux attach -t "$session" fi