diff --git a/lazy-lock.json b/lazy-lock.json index bae718b..25e9e0f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,6 +2,7 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "Korean-IME.nvim": { "branch": "master", "commit": "c733599b9219e25bb05d8aa0467327edc769be94" }, + "aerial.nvim": { "branch": "master", "commit": "5e687b5a14004fa2dd9eccbee042b96869fe1557" }, "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "blink.download": { "branch": "main", "commit": "86361b98f3c8317904a08e3bd12cf3cdcbe3e925" }, "blink.nvim": { "branch": "main", "commit": "16a597e89cf2ee6215a392c5bc5a945477015534" }, @@ -11,6 +12,7 @@ "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "fzf-lua": { "branch": "main", "commit": "d6e899e8dfdaf47bf849c0875ca3ca0e5a0e0d12" }, "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "glance.nvim": { "branch": "master", "commit": "bf86d8b79dce808e65fdb6e9269d0b4ed6d2eefc" }, "hardtime.nvim": { "branch": "main", "commit": "b4e431934af1fe224a3a801f632c008278cb7628" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazygit.nvim": { "branch": "main", "commit": "2305deed25bc61b866d5d39189e9105a45cf1cfb" }, @@ -28,7 +30,6 @@ "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "main", "commit": "32cb9f9b9db71b0dc2454817727cd9a5d840658c" }, "nvim-web-devicons": { "branch": "master", "commit": "c2599a81ecabaae07c49ff9b45dcd032a8d90f1a" }, - "outline.nvim": { "branch": "main", "commit": "6b62f73a6bf317531d15a7ae1b724e85485d8148" }, "peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, diff --git a/lua/plugins/aerial.lua b/lua/plugins/aerial.lua new file mode 100644 index 0000000..4dc2103 --- /dev/null +++ b/lua/plugins/aerial.lua @@ -0,0 +1,22 @@ +return { + 'stevearc/aerial.nvim', + opts = { + backends = { "treesitter", "lsp", "markdown", "asciidoc", "man" }, + + layout = { + min_width = 0.9 + }, + + float = { + relative = "win", + min_height = 0.9 + }, + }, + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons" + }, + keys = { + { "\\", "AerialToggle float", desc = "Aerial toggle floating" } + }, +} diff --git a/lua/plugins/blink-pairs.lua b/lua/plugins/blink-pairs.lua index b606796..7b9e854 100644 --- a/lua/plugins/blink-pairs.lua +++ b/lua/plugins/blink-pairs.lua @@ -1,46 +1,44 @@ return { - 'saghen/blink.pairs', - version = '*', -- (recommended) only required with prebuilt binaries + 'saghen/blink.pairs', - -- download prebuilt binaries from github releases - dependencies = 'saghen/blink.download', - -- OR build from source, requires nightly: - -- https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust - -- build = 'cargo build --release', - -- If you use nix, you can build from source using latest nightly rust with: - -- build = 'nix run .#build-plugin', + -- download prebuilt binaries from github releases + -- OR build from source, requires nightly: + -- https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust with: + -- build = 'nix run .#build-plugin', - --- @module 'blink.pairs' - --- @type blink.pairs.Config - opts = { - mappings = { - -- you can call require("blink.pairs.mappings").enable() - -- and require("blink.pairs.mappings").disable() - -- to enable/disable mappings at runtime - enabled = true, - -- or disable with `vim.g.pairs = false` (global) and `vim.b.pairs = false` (per-buffer) - -- and/or with `vim.g.blink_pairs = false` and `vim.b.blink_pairs = false` - disabled_filetypes = {}, - -- see the defaults: - -- https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/config/mappings.lua#L14 - pairs = {}, - }, - highlights = { - enabled = true, - -- requires require('vim._extui').enable({}), otherwise has no effect - groups = { - 'BlinkPairsOrange', - 'BlinkPairsPurple', - 'BlinkPairsBlue', - }, + --- @module 'blink.pairs' + --- @type blink.pairs.Config + opts = { + mappings = { + -- you can call require("blink.pairs.mappings").enable() + -- and require("blink.pairs.mappings").disable() + -- to enable/disable mappings at runtime + enabled = true, + -- or disable with `vim.g.pairs = false` (global) and `vim.b.pairs = false` (per-buffer) + -- and/or with `vim.g.blink_pairs = false` and `vim.b.blink_pairs = false` + disabled_filetypes = {}, + -- see the defaults: + -- https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/config/mappings.lua#L14 + pairs = {}, + }, + highlights = { + enabled = true, + -- requires require('vim._extui').enable({}), otherwise has no effect + groups = { + 'BlinkPairsOrange', + 'BlinkPairsPurple', + 'BlinkPairsBlue', + }, - -- highlights matching pairs under the cursor - matchparen = { - enabled = true, - -- known issue where typing won't update matchparen highlight, disabled by default - group = 'BlinkPairsMatchParen', - }, - }, - debug = false, - } + -- highlights matching pairs under the cursor + matchparen = { + enabled = true, + -- known issue where typing won't update matchparen highlight, disabled by default + group = 'BlinkPairsMatchParen', + }, + }, + debug = false, + } } diff --git a/lua/plugins/glance.lua b/lua/plugins/glance.lua new file mode 100644 index 0000000..3897e50 --- /dev/null +++ b/lua/plugins/glance.lua @@ -0,0 +1,10 @@ +return { + 'dnlhc/glance.nvim', + cmd = 'Glance', + keys = { + { "gd", "Glance definitions", desc = "Glance definitions" }, + { "gr", "Glance references", desc = "Glance references" }, + { "gy", "Glance type_definitions", desc = "Glance type definitions" }, + { "gm", "Glance implementations", desc = "Glance implementations" }, + }, +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 5278393..b0c82ad 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -1,32 +1,30 @@ return { - 'neovim/nvim-lspconfig', - dependencies = { 'saghen/blink.cmp' }, + 'neovim/nvim-lspconfig', + dependencies = { 'saghen/blink.cmp' }, - lazy = false, + lazy = false, - -- example using `opts` for defining servers - opts = { - inlay_hints = { enabled = true }, - servers = { - lua_ls = {} - } - }, - config = function(_, opts) - local lspconfig = require('lspconfig') - for server, config in pairs(opts.servers) do - -- passing config.capabilities to blink.cmp merges with the capabilities in your - -- `opts[server].capabilities, if you've defined it - config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities) - lspconfig[server].setup(config) - end + -- example using `opts` for defining servers + opts = { + inlay_hints = { enabled = true }, + servers = { + lua_ls = {} + } + }, + config = function(_, opts) + local lspconfig = require('lspconfig') + for server, config in pairs(opts.servers) do + -- passing config.capabilities to blink.cmp merges with the capabilities in your + -- `opts[server].capabilities, if you've defined it + config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities) + lspconfig[server].setup(config) + end - end, + local capabilities = require('blink.cmp').get_lsp_capabilities() - -- example calling setup directly for each LSP - config = function() - local capabilities = require('blink.cmp').get_lsp_capabilities() - local lspconfig = require('lspconfig') - - lspconfig['lua_ls'].setup({ capabilities = capabilities }) - end + lspconfig['clangd'].setup({ + capabilities = capabilities, + cmd = { vim.fn.stdpath("config") .. "/shell/clangd-direnv.sh" } + }) + end, } diff --git a/lua/plugins/mason-lspconfig.lua b/lua/plugins/mason-lspconfig.lua index d63f064..de5a1ac 100644 --- a/lua/plugins/mason-lspconfig.lua +++ b/lua/plugins/mason-lspconfig.lua @@ -2,6 +2,7 @@ return { "mason-org/mason-lspconfig.nvim", opts = { ensure_installed = { "lua_ls", "rust_analyzer", "ts_ls" }, + automatic_enable = { exclude = { "clangd" } } }, lazy = false, dependencies = { diff --git a/lua/plugins/outline.lua b/lua/plugins/outline.lua deleted file mode 100644 index 8e5cdd6..0000000 --- a/lua/plugins/outline.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "hedyhli/outline.nvim", - lazy = true, - cmd = { "Outline", "OutlineOpen" }, - keys = { -- Example mapping to toggle outline - { "o", "Outline", desc = "Toggle outline" }, - }, - opts = { - -- Your setup opts here - }, -} diff --git a/shell/clangd-direnv.sh b/shell/clangd-direnv.sh new file mode 100755 index 0000000..edecd6e --- /dev/null +++ b/shell/clangd-direnv.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if command -v direnv >/dev/null 2>&1; then + direnv exec . clangd "$@" +else + clangd "$@" +fi +