Skip to content

Commit

Permalink
Update lspconfig floating LSP preview borders
Browse files Browse the repository at this point in the history
Fix nvim-tree init
Add barbecue-nvim for breadcrumb support
Add TMUX binding for last active session
  • Loading branch information
bcampolo committed Mar 14, 2024
1 parent adf9532 commit 95b8227
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
1 change: 1 addition & 0 deletions .config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -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" },
Expand Down
16 changes: 16 additions & 0 deletions .config/nvim/lua/plugins/barbecue-nvim.lua
Original file line number Diff line number Diff line change
@@ -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
},
}
13 changes: 8 additions & 5 deletions .config/nvim/lua/plugins/nvim-lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand All @@ -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
}

2 changes: 1 addition & 1 deletion .config/nvim/lua/plugins/nvim-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 %
Expand Down

0 comments on commit 95b8227

Please sign in to comment.