From 467a91535cb577ec91686591f6daa408626b03d0 Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Sat, 17 Feb 2024 20:46:11 +0000 Subject: [PATCH] Update Stuff --- lazy-lock.json | 74 ++++++++++--------- lua/core/commands.lua | 6 ++ lua/core/init.lua | 1 + lua/plugins/configs/completion/cmp.lua | 10 +++ lua/plugins/configs/lsp/config.lua | 4 +- lua/plugins/configs/treesitter/init.lua | 10 --- .../configs/treesitter/rainbow-delims.lua | 20 +++++ lua/plugins/specs/LSP.lua | 12 +-- lua/plugins/specs/UI.lua | 69 ++++++++++++----- lua/plugins/specs/editor.lua | 24 ++++-- lua/plugins/specs/telescope.lua | 14 +++- 11 files changed, 167 insertions(+), 77 deletions(-) create mode 100644 lua/core/commands.lua create mode 100644 lua/plugins/configs/treesitter/rainbow-delims.lua diff --git a/lazy-lock.json b/lazy-lock.json index a55d06c..bbb7ec6 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,49 +1,51 @@ { - "LuaSnip": { "branch": "master", "commit": "ea7d7ea510c641c4f15042becd27f35b3e5b3c2b" }, - "bufferline.nvim": { "branch": "main", "commit": "9961d87bb3ec008213c46ba14b3f384a5f520eb5" }, - "calendar-vim": { "branch": "master", "commit": "a7e73e02c92566bf427b2a1d6a61a8f23542cc21" }, + "LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" }, + "bufferline.nvim": { "branch": "main", "commit": "b15c6daf5a64426c69732b31a951f4e438cb6590" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, - "cmp-conjure": { "branch": "master", "commit": "d97816d5007be2b060f3a4e09f5b144d97d96fe8" }, + "cmp-conjure": { "branch": "master", "commit": "8c9a88efedc0e5bf3165baa6af8a407afe29daf6" }, "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "conjure": { "branch": "master", "commit": "58c46d1f4999679659a5918284b574c266a7ac83" }, - "friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" }, - "gruvbox": { "branch": "main", "commit": "7fb36e0f67aa6f3d7f3e54f37ca7032ea1af0b59" }, - "indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conjure": { "branch": "master", "commit": "f50d4db821489f66ff93afe58155eef42c273a5d" }, + "friendly-snippets": { "branch": "main", "commit": "5cc1f45c6aac699ad008fb85f6ae03236062667d" }, + "gentoo-syntax": { "branch": "master", "commit": "382826e8b6fa99a700df9ae23f1fa0f9bff1c53c" }, + "gruvbox": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" }, + "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "knap": { "branch": "main", "commit": "503010f541696e99ed5c62f658620e546cebf8b0" }, - "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, - "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "lspsaga.nvim": { "branch": "main", "commit": "798c1b650d541bb14492fb54d533673162fb848f" }, + "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, + "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, + "lspsaga.nvim": { "branch": "main", "commit": "db74412e0282505ea1e63a42060728fb74c1968e" }, "lualine-spell-status": { "branch": "main", "commit": "aa81c2c9a71e3ed3552c6cd75e150414ff9ac664" }, - "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "20fd7f50f34b59031a7c3bbc2c207f4f60037628" }, - "mason.nvim": { "branch": "main", "commit": "ee6a7f179ebf8aa9da9d53b1cf1b57d292ea0182" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "2d89ca96e08eb6e9c8e50e1bb4738bc5125c9f12" }, - "neodev.nvim": { "branch": "main", "commit": "f0e574687aa51c513017155f003e8e8950ec6ff4" }, - "nerdcommenter": { "branch": "master", "commit": "d2e21d417f6c788b11ae3b90d7ac478930dead36" }, - "noice.nvim": { "branch": "main", "commit": "74c2902146b080035beb19944baf6f014a954720" }, - "nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" }, - "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, - "nvim-lspconfig": { "branch": "master", "commit": "d177ad277a638f262edb73c75ffe33e377b95dc5" }, - "nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" }, - "nvim-treesitter": { "branch": "master", "commit": "96a50241987531fdb8a516998b72c19f563ccd6c" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" }, - "nvim-web-devicons": { "branch": "master", "commit": "ecdeb4e2a4af34fc873bbfbf1f4c4e447e632255" }, - "plenary.nvim": { "branch": "master", "commit": "0232372b906f275f76ac42029eba25eaf95e76b9" }, + "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "fe4cce44dec93c69be17dad79b21de867dde118a" }, + "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, + "neo-tree.nvim": { "branch": "main", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" }, + "neodev.nvim": { "branch": "main", "commit": "de3685b8c1cd439dd96b7958793f6f381f98652d" }, + "nerdcommenter": { "branch": "master", "commit": "e361a44230860d616f799a337bc58f5218ab6e9c" }, + "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, + "nui.nvim": { "branch": "main", "commit": "af7dfee12fbf51d12cfc6ee386fa54f7a5a573c8" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, + "nvim-lspconfig": { "branch": "master", "commit": "d1bab4cf4b69e49d6058028fd933d8ef5e74e680" }, + "nvim-notify": { "branch": "master", "commit": "7138c86b28de61b6866c8cae60289136f0d539fa" }, + "nvim-treesitter": { "branch": "master", "commit": "581e87ba4e509a50689fcdd538e5f9388845eb78" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "dd0b2036c3a27cb6e6486f8bd24188c6ca43af0b" }, + "nvim-web-devicons": { "branch": "master", "commit": "7f30f2da3c3641841ceb0e2c150281f624445e8f" }, + "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "telekasten.nvim": { "branch": "main", "commit": "bd5d323581f24ee124b33688287e6a22244c6f2a" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "586f44d21ef687a4d41b5b24c1566d686ae84250" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" }, - "telescope.nvim": { "branch": "master", "commit": "a19770625aed49ad2a9f591a5e3946707f7359f6" }, - "tidy.nvim": { "branch": "main", "commit": "86eab24e807ed2957d26ca43b2b76b92d0fbf8f4" }, - "ts-rainbow": { "branch": "master", "commit": "b3120cd5ae9ca524af9cb602f41e12e301fa985f" }, - "twilight.nvim": { "branch": "main", "commit": "a4843e6e67092a1e6fa9666f02bf0ab59174c1df" }, + "telescope.nvim": { "branch": "master", "commit": "45d61cc8da213e4052cf698653692b6a4c961760" }, + "tidy.nvim": { "branch": "main", "commit": "2a23ba8cd39d3570595ba4e6890f8de4cd8116fd" }, + "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, + "twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" }, "vim-dispatch-neovim": { "branch": "master", "commit": "c8c4e21a95c25032a041002f9bf6e45a75a73021" }, "vim-jack-in": { "branch": "master", "commit": "4cefab20f02c44249499f43200442a3176315acd" }, - "vimwiki": { "branch": "dev", "commit": "f0fe154ede6b11e3db9b058b930005a056a3d1c6" }, - "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, - "zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" } + "vimwiki": { "branch": "dev", "commit": "fde35bb87e45abe930eebef5ab99a16289e53789" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, + "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" } } \ No newline at end of file diff --git a/lua/core/commands.lua b/lua/core/commands.lua new file mode 100644 index 0000000..75ba6a4 --- /dev/null +++ b/lua/core/commands.lua @@ -0,0 +1,6 @@ +vim.cmd([[ + + command DiffOrig vert new | set buftype=nofile | set previewwindow | read ++edit # | 0d_ | diffthis | wincmd p | diffthis + + command DiffOff diffoff | pclose +]]) diff --git a/lua/core/init.lua b/lua/core/init.lua index 3f1ad88..244b230 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -5,6 +5,7 @@ M.setup = function() require('core.autocommands') require('core.keybinds') require('core.hacks.cellWidths') + require('core.commands') require('plugins') -- always run this last to ensure it ovverides earlier settings diff --git a/lua/plugins/configs/completion/cmp.lua b/lua/plugins/configs/completion/cmp.lua index 26b028b..ffb8bc1 100644 --- a/lua/plugins/configs/completion/cmp.lua +++ b/lua/plugins/configs/completion/cmp.lua @@ -53,6 +53,16 @@ M.cmp = { }, [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + if cmp.visible_docs() then + cmp.close_docs() + else + cmp.open_docs() + end + end + fallback() + end), [''] = cmp.mapping.abort(), }, sources = cmp.config.sources { diff --git a/lua/plugins/configs/lsp/config.lua b/lua/plugins/configs/lsp/config.lua index 0ebac5b..d163464 100644 --- a/lua/plugins/configs/lsp/config.lua +++ b/lua/plugins/configs/lsp/config.lua @@ -7,7 +7,9 @@ M.on_attach = function() local bufnr = args.buf local client = vim.lsp.get_client_by_id(args.data.client_id) if client == nil then return end - if client.server_capabilities.inlayHintProvider then vim.lsp.inlay_hint(bufnr, true) end + if client.server_capabilities.inlayHintProvider then + vim.lsp.inlay_hint.enable(bufnr, true) + end if client.server_capabilities.documentFormattingProvider then vim.keymap.set({ 'n' }, 'lf', function() diff --git a/lua/plugins/configs/treesitter/init.lua b/lua/plugins/configs/treesitter/init.lua index c6beeb7..0dc6279 100644 --- a/lua/plugins/configs/treesitter/init.lua +++ b/lua/plugins/configs/treesitter/init.lua @@ -55,16 +55,6 @@ return { }, }, - rainbow = { - enable = true, - query = { - 'rainbow-parens', - html = 'rainbow-tags', - latex = 'rainbow-blocks', - }, - strategy = require('ts-rainbow').strategy.global, - }, - textobjects = { select = { enable = true, diff --git a/lua/plugins/configs/treesitter/rainbow-delims.lua b/lua/plugins/configs/treesitter/rainbow-delims.lua new file mode 100644 index 0000000..d28a217 --- /dev/null +++ b/lua/plugins/configs/treesitter/rainbow-delims.lua @@ -0,0 +1,20 @@ +local rainbow = require('rainbow-delimiters') +return { + strategy = { + [''] = rainbow.strategy['global'], + }, + query = { + [''] = 'rainbow-delimiters', + lua = 'rainbow-blocks', + latex = 'rainbow-blocks', + }, + highlight = { + 'RainbowDelimiterRed', + 'RainbowDelimiterYellow', + 'RainbowDelimiterBlue', + 'RainbowDelimiterOrange', + 'RainbowDelimiterGreen', + 'RainbowDelimiterViolet', + 'RainbowDelimiterCyan', + }, +} diff --git a/lua/plugins/specs/LSP.lua b/lua/plugins/specs/LSP.lua index a28f54f..a75a5f1 100644 --- a/lua/plugins/specs/LSP.lua +++ b/lua/plugins/specs/LSP.lua @@ -1,23 +1,24 @@ return { - { + { -- mason 'williamboman/mason.nvim', config = true, }, - { + { -- mason-lspconfig 'williamboman/mason-lspconfig.nvim', dependencies = { 'mason.nvim', }, }, - { + { -- nvim-lspconfig 'neovim/nvim-lspconfig', opts = function() return { servers_to_not_setup = {}, servers = { + bashls = {}, lua_ls = { settings = { Lua = { @@ -56,6 +57,7 @@ return { }, texlab = {}, cssls = {}, + clangd = {}, }, setup = {}, } @@ -74,7 +76,7 @@ return { }, }, - { + { -- neodev 'folke/neodev.nvim', opts = { enabled = true, @@ -88,7 +90,7 @@ return { end, }, - { + { -- lspsaga 'nvimdev/lspsaga.nvim', event = 'LspAttach', config = function() diff --git a/lua/plugins/specs/UI.lua b/lua/plugins/specs/UI.lua index 4116702..93dfb52 100644 --- a/lua/plugins/specs/UI.lua +++ b/lua/plugins/specs/UI.lua @@ -1,15 +1,16 @@ -- UI -- These plugins make up a large portion of the UI that I use to interact with nvim + return { - { -- Colorscheme + { -- gruvbox 'ellisonleao/gruvbox.nvim', name = 'gruvbox', priority = 1000, }, - { -- lualine is real light and looks real good + { -- lualine 'nvim-lualine/lualine.nvim', opts = function() return require('plugins.configs.UI.lualine') @@ -22,7 +23,7 @@ return { }, }, - { -- neo-tree the superior filetree + { -- neo-tree 'nvim-neo-tree/neo-tree.nvim', version = '^3', init = function() @@ -49,7 +50,7 @@ return { }, }, - { -- Since I commonly use a lot of buffers it is good to be able to see them. + { -- bufferline 'akinsho/bufferline.nvim', config = true, event = 'VeryLazy', @@ -58,7 +59,7 @@ return { }, }, - { -- Alternative configurable UI for a lot of things + { -- noice 'folke/noice.nvim', opts = function() return require('plugins.configs.UI.noice') @@ -71,7 +72,7 @@ return { }, }, - { + { -- which-key 'folke/which-key.nvim', opts = function() return require('plugins.configs.UI.whichkey') @@ -83,26 +84,31 @@ return { event = 'VeryLazy', }, - { + { -- indent-blankline 'lukas-reineke/indent-blankline.nvim', + main = 'ibl', opts = { - filetype_exclude = { - 'help', - 'alpha', - 'dashboard', - 'neo-tree', - 'Trouble', - 'lazy', - 'mason', - 'notify', - 'oil_preview', - 'vim', + exclude = { + filetypes = { + 'alpha', + 'dashboard', + 'neo-tree', + 'Trouble', + 'lazy', + 'mason', + 'notify', + 'oil_preview', + 'vim', + }, + }, + scope = { + enabled = true, }, }, event = 'BufReadPost', }, - { + { -- zen-mode 'folke/zen-mode.nvim', opts = function() return require('plugins.configs.UI.zen') @@ -120,4 +126,29 @@ return { }, dependencies = 'folke/twilight.nvim', }, + + { -- trouble.nvim + 'folke/trouble.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + cmd = { + 'Trouble', + 'TroubleClose', + 'TroubleToggle', + 'TroubleRefresh', + }, + opts = {}, + }, + + { -- todo-comments + 'folke/todo-comments.nvim', + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = {}, + cmd = { + 'TodoTrouble', + 'TodoTelescope', + }, + event = { + 'BufEnter', + }, + }, } diff --git a/lua/plugins/specs/editor.lua b/lua/plugins/specs/editor.lua index c172216..18306c8 100644 --- a/lua/plugins/specs/editor.lua +++ b/lua/plugins/specs/editor.lua @@ -1,6 +1,6 @@ return { - { + { -- treesitter 'nvim-treesitter/nvim-treesitter', opts = function() return require('plugins.configs.treesitter') @@ -8,8 +8,6 @@ return { config = function(_, opts) -- to ensure the configuration can happen we need to do this here -- otherwise the configuration of treesitter can't find it - require('lazy').load { plugins = { 'ts-rainbow' } } - require('nvim-treesitter.configs').setup(opts) end, init = function() @@ -17,12 +15,23 @@ return { end, build = ':TSUpdate', dependencies = { - { 'HiPhish/nvim-ts-rainbow2', name = 'ts-rainbow' }, { 'nvim-treesitter/nvim-treesitter-textobjects' }, }, }, - { + { -- rainbow-delimiters + 'hiphish/rainbow-delimiters.nvim', + config = false, + event = 'VeryLazy', + dependencies = { + 'nvim-treesitter', + }, + init = function() + vim.g.rainbow_delimiters = require('plugins.configs.treesitter.rainbow-delims') + end, + }, + + { -- nerd commenter 'preservim/nerdcommenter', event = 'VeryLazy', init = function() @@ -51,4 +60,9 @@ return { config = true, event = 'BufWritePre', }, + + { + 'gentoo/gentoo-syntax', + lazy = false, + }, } diff --git a/lua/plugins/specs/telescope.lua b/lua/plugins/specs/telescope.lua index 61b03ed..26a205a 100644 --- a/lua/plugins/specs/telescope.lua +++ b/lua/plugins/specs/telescope.lua @@ -13,6 +13,7 @@ telescope.dependencies = { ---@string[] 'nvim-web-devicons', 'plenary.nvim', 'popup.nvim', + 'project.nvim', } telescope.keys = { ---@LazyKeys[] @@ -75,9 +76,10 @@ end -- TESTS for fzf-native telescope.config = function(_, opts) - require('telescope').setup() + require('telescope').setup(opts.opts) if opts.has_chafa then require('telescope').load_extension('media_files') end if opts.do_fzf then require('telescope').load_extension('fzf') end + require('telescope').load_extension('projects') end return { @@ -89,6 +91,7 @@ return { keys = telescope.keys, dependencies = telescope.dependencies, }, + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make', @@ -96,4 +99,13 @@ return { return vim.fn.has('win32') == 0 and not vim.g.no_fzf end, }, + + { + 'ahmedkhalf/project.nvim', + opts = { + detection_methods = { 'pattern' }, + }, + config = true, + main = 'project_nvim', + }, }