From 95b82272207649860a2b608a3d8c20987a4f0250 Mon Sep 17 00:00:00 2001 From: bcampolo Date: Wed, 13 Mar 2024 21:13:52 -0400 Subject: [PATCH] Update lspconfig floating LSP preview borders Fix nvim-tree init Add barbecue-nvim for breadcrumb support Add TMUX binding for last active session --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/barbecue-nvim.lua | 16 ++++++++++++++++ .config/nvim/lua/plugins/nvim-lspconfig.lua | 13 ++++++++----- .config/nvim/lua/plugins/nvim-tree.lua | 2 +- .tmux.conf | 6 +++--- 5 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 .config/nvim/lua/plugins/barbecue-nvim.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 6441884..97e6dce 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,5 +1,6 @@ { "LuaSnip": { "branch": "master", "commit": "1f4ad8bb72bdeb60975e98652636b991a9b7475d" }, + "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, diff --git a/.config/nvim/lua/plugins/barbecue-nvim.lua b/.config/nvim/lua/plugins/barbecue-nvim.lua new file mode 100644 index 0000000..97aeee3 --- /dev/null +++ b/.config/nvim/lua/plugins/barbecue-nvim.lua @@ -0,0 +1,16 @@ +-- Display LSP-based breadcrumbs +return { + -- https://github.com/utilyre/barbecue.nvim + "utilyre/barbecue.nvim", + name = "barbecue", + version = "*", + dependencies = { + -- https://github.com/SmiteshP/nvim-navic + "SmiteshP/nvim-navic", + -- https://github.com/nvim-tree/nvim-web-devicons + "nvim-tree/nvim-web-devicons", -- optional dependency + }, + opts = { + -- configurations go here + }, +} diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 8cd49e6..15330b7 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -49,11 +49,6 @@ return { lspconfig[server_name].setup({ on_attach = lsp_attach, capabilities = lsp_capabilities, - handlers = { - -- Add borders to LSP popups - ["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {border = 'rounded'}), - ["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {border = 'rounded' }), - } }) end }) @@ -70,6 +65,14 @@ return { }, } + -- Globally configure all LSP floating preview popups (like hover, signature help, etc) + local open_floating_preview = vim.lsp.util.open_floating_preview + function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) + opts = opts or {} + opts.border = opts.border or "rounded" -- Set border to rounded + return open_floating_preview(contents, syntax, opts, ...) + end + end } diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua index 658fb02..49f497d 100644 --- a/.config/nvim/lua/plugins/nvim-tree.lua +++ b/.config/nvim/lua/plugins/nvim-tree.lua @@ -17,7 +17,7 @@ return { }, config = function (_, opts) -- Recommended settings to disable default netrw file explorer - vim.g.loaded = 1 + vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 require("nvim-tree").setup(opts) end diff --git a/.tmux.conf b/.tmux.conf index 4294502..7805df1 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -12,9 +12,9 @@ set -g default-terminal 'tmux-256color' set-option -sa terminal-overrides ",xterm*:Tc" # Session management bindings -# Update the below line to bind prefix + 1 to a named TMUX Session -bind 1 switchc -t 'My Session 1' -bind 2 switchc -t 'My Session 2' +bind 1 switchc -t 'My Session 1' # prefix + 1 switches to a named session +bind 2 switchc -t 'My Session 2' # prefix + 2 switches to a named session +bind a switch-client -l # switch to last active session # Split window bindings unbind %