From 95d38fef5da33836a7e44ec13f6978da0cdca2a9 Mon Sep 17 00:00:00 2001 From: Gabe Farrell Date: Wed, 10 Apr 2024 15:36:25 -0400 Subject: [PATCH] add todo-comments, trouble --- lazy-lock.json | 2 ++ lua/mappings.lua | 11 +++++++++- lua/plugins/init.lua | 41 +++++++++++++++++++++++++++++++---- lua/plugins/todo-comments.lua | 10 +++++++++ 4 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 lua/plugins/todo-comments.lua diff --git a/lazy-lock.json b/lazy-lock.json index bf9c73a..514b055 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -25,6 +25,8 @@ "nvim-web-devicons": { "branch": "master", "commit": "6e355632387a085f15a66ad68cf681c1d7374a04" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "telescope.nvim": { "branch": "master", "commit": "5a701e99906961218b55d7ad6c2a998f066c6fe0" }, + "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, + "trouble.nvim": { "branch": "dev", "commit": "10eff94809ecd6ee6cc59f42e9521b9b8a14e9ce" }, "ui": { "branch": "v2.5", "commit": "e1af69426b3c4b55c88bd1c81790c1c73b30bfa8" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/lua/mappings.lua b/lua/mappings.lua index 94b381a..cf2f5d9 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -3,7 +3,6 @@ require "nvchad.mappings" -- add yours here local map = vim.keymap.set - -- disable arrow keys map("n", "", "") map("n", "", "") @@ -18,3 +17,13 @@ map("n", "sd", ":s/", { desc = "Shortcut to sed" }) map("n", "qq", ":qa", { desc = "Write all and quit all" }) -- map({ "n", "i", "v" }, "", " w ") +vim.keymap.set("n", "]t", function() + require("todo-comments").jump_next() +end, { desc = "Next todo comment" }) + +vim.keymap.set("n", "[t", function() + require("todo-comments").jump_prev() +end, { desc = "Previous todo comment" }) + +map("n", "tt", ":TodoTelescope", { desc = "View [T]odos in [T]elescope" }) +-- map("n", "tT", ":TodoTrouble", { desc = "View [t]odos in [T]rouble" }) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index eccd162..c157198 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -21,7 +21,6 @@ return { ft = { "go", "gomod", "gowork", "gotmpl" }, build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries }, - -- These are some examples, uncomment them if you want to see them work! { "neovim/nvim-lspconfig", @@ -30,7 +29,6 @@ return { require "configs.lspconfig" end, }, - { "williamboman/mason.nvim", opts = { @@ -47,7 +45,6 @@ return { }, }, }, - { "nvim-tree/nvim-tree.lua", opts = { @@ -67,7 +64,43 @@ return { }, }, }, - + { + "folke/trouble.nvim", + branch = "dev", -- IMPORTANT! + keys = { + { + "tx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "tX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "tL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "tQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, + opts = {}, -- for default options, refer to the configuration section for custom setup. + }, -- "nvim-treesitter/nvim-treesitter", -- opts = { -- ensure_installed = { diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua new file mode 100644 index 0000000..442671a --- /dev/null +++ b/lua/plugins/todo-comments.lua @@ -0,0 +1,10 @@ +return { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + lazy = false, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, +}