added todo-comments.nvim

This commit is contained in:
Gabe Venberg 2023-08-03 16:08:06 -05:00
parent 961b217072
commit fcf48d31e3
3 changed files with 78 additions and 57 deletions

View file

@ -113,7 +113,7 @@ map('n', '<leader>t', ':NvimTreeToggle<CR>', opts)
--open symbols-outline with leader+o --open symbols-outline with leader+o
map('n', '<leader>o', ':SymbolsOutline<CR>', opts) map('n', '<leader>o', ':SymbolsOutline<CR>', opts)
--telescope stuff --telescope stuff
map('n', '<leader>ff', ':lua require "telescope".extensions.file_browser.file_browser()<CR>', opts) map('n', '<leader>ff', ':Telescope find_files<CR>', opts)
map('n', '<leader>fg', ':Telescope live_grep<CR>', opts) map('n', '<leader>fg', ':Telescope live_grep<CR>', opts)
map('n', '<leader>fb', ':Telescope buffers<CR>', opts) map('n', '<leader>fb', ':Telescope buffers<CR>', opts)
map('n', '<leader>fm', ':Telescope marks<CR>', opts) map('n', '<leader>fm', ':Telescope marks<CR>', opts)
@ -124,6 +124,7 @@ map('n', '<leader>fz', ':Telescope current_buffer_fuzzy_find<CR>', opts)
map('n', '<leader>fgc', ':Telescope git_commits<CR>', opts) map('n', '<leader>fgc', ':Telescope git_commits<CR>', opts)
map('n', '<leader>fgb', ':Telescope git_branches<CR>', opts) map('n', '<leader>fgb', ':Telescope git_branches<CR>', opts)
map('n', '<leader>fgs', ':Telescope git_stash<CR>', opts) map('n', '<leader>fgs', ':Telescope git_stash<CR>', opts)
map('n', '<leader>fto', ':TodoTelescope', opts)
map('n', '<leader>ft', ':Telescope treesitter<CR>', opts) map('n', '<leader>ft', ':Telescope treesitter<CR>', opts)
--Treesitter context --Treesitter context
map('n', '<leader>c', ':TSContextToggle<CR>', opts) map('n', '<leader>c', ':TSContextToggle<CR>', opts)

View file

@ -28,6 +28,8 @@ local on_attach = function()
set_keymap('', '<leader>ln', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) set_keymap('', '<leader>ln', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
set_keymap('', '<leader>lp', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) set_keymap('', '<leader>lp', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
set_keymap('', '<leader>lm', '<cmd>lua vim.lsp.buf.format {async=true}<CR>', opts) set_keymap('', '<leader>lm', '<cmd>lua vim.lsp.buf.format {async=true}<CR>', opts)
set_keymap('', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
set_keymap('', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
end end
require("mason-lspconfig").setup_handlers({ require("mason-lspconfig").setup_handlers({
function(server_name) function(server_name)

View file

@ -146,6 +146,73 @@ return require('packer').startup(function(use)
end end
} }
use { 'folke/trouble.nvim',
requires = "kyazdani42/nvim-web-devicons",
config = function()
require("trouble").setup {
position = "bottom", -- position of the list can be: bottom, top, left, right
height = 10, -- height of the trouble list when position is top or bottom
width = 50, -- width of the list when position is left or right
icons = true, -- use devicons for filenames
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
fold_open = "", -- icon used for open folds
fold_closed = "", -- icon used for closed folds
group = true, -- group results by file
padding = true, -- add an extra new line on top of the list
action_keys = {
-- key mappings for actions in the trouble list
-- map to {} to remove a mapping, for example:
-- close = {},
close = "q", -- close the list
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
refresh = "r", -- manually refresh
jump = { "<cr>", "<tab>" }, -- jump to the diagnostic or open / close folds
open_split = { "<c-x>" }, -- open buffer in new split
open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
open_tab = { "<c-t>" }, -- open buffer in new tab
jump_close = { "o" }, -- jump to the diagnostic and close the list
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
toggle_preview = "P", -- toggle auto_preview
hover = "K", -- opens a small popup with the full multiline message
preview = "p", -- preview the diagnostic location
close_folds = { "zM", "zm" }, -- close all folds
open_folds = { "zR", "zr" }, -- open all folds
toggle_fold = { "zA", "za", '<space>' }, -- toggle fold of current file
previous = "k", -- previous item
next = "j" -- next item
},
indent_lines = true, -- add an indent guide below the fold icons
auto_open = false, -- automatically open the list when you have diagnostics
auto_close = false, -- automatically close the list when you have no diagnostics
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
auto_fold = false, -- automatically fold a file trouble list at creation
auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
signs = {
-- icons / text used for a diagnostic
error = "",
warning = "",
hint = "",
information = "",
other = ""
},
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
}
end
}
use {
"folke/todo-comments.nvim",
requires = { "nvim-lua/plenary.nvim" },
config = function()
local opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
require("todo-comments").setup(opts)
end
}
--file browser --file browser
use { 'kyazdani42/nvim-tree.lua', use { 'kyazdani42/nvim-tree.lua',
requires = { requires = {
@ -158,8 +225,13 @@ return require('packer').startup(function(use)
local api = require('nvim-tree.api') local api = require('nvim-tree.api')
local function opts(desc) local function opts(desc)
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, return {
nowait = true } desc = 'nvim-tree: ' .. desc,
buffer = bufnr,
noremap = true,
silent = true,
nowait = true
}
end end
@ -357,60 +429,6 @@ return require('packer').startup(function(use)
requires = { { 'hoob3rt/lualine.nvim', opt = true }, { 'kyazdani42/nvim-web-devicons', opt = true } } requires = { { 'hoob3rt/lualine.nvim', opt = true }, { 'kyazdani42/nvim-web-devicons', opt = true } }
} }
use { 'folke/trouble.nvim',
requires = "kyazdani42/nvim-web-devicons",
config = function()
require("trouble").setup {
position = "bottom", -- position of the list can be: bottom, top, left, right
height = 10, -- height of the trouble list when position is top or bottom
width = 50, -- width of the list when position is left or right
icons = true, -- use devicons for filenames
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
fold_open = "", -- icon used for open folds
fold_closed = "", -- icon used for closed folds
group = true, -- group results by file
padding = true, -- add an extra new line on top of the list
action_keys = {
-- key mappings for actions in the trouble list
-- map to {} to remove a mapping, for example:
-- close = {},
close = "q", -- close the list
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
refresh = "r", -- manually refresh
jump = { "<cr>", "<tab>" }, -- jump to the diagnostic or open / close folds
open_split = { "<c-x>" }, -- open buffer in new split
open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
open_tab = { "<c-t>" }, -- open buffer in new tab
jump_close = { "o" }, -- jump to the diagnostic and close the list
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
toggle_preview = "P", -- toggle auto_preview
hover = "K", -- opens a small popup with the full multiline message
preview = "p", -- preview the diagnostic location
close_folds = { "zM", "zm" }, -- close all folds
open_folds = { "zR", "zr" }, -- open all folds
toggle_fold = { "zA", "za", '<space>' }, -- toggle fold of current file
previous = "k", -- previous item
next = "j" -- next item
},
indent_lines = true, -- add an indent guide below the fold icons
auto_open = false, -- automatically open the list when you have diagnostics
auto_close = false, -- automatically close the list when you have no diagnostics
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
auto_fold = false, -- automatically fold a file trouble list at creation
auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
signs = {
-- icons / text used for a diagnostic
error = "",
warning = "",
hint = "",
information = "",
other = ""
},
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
}
end
}
use { 'romgrk/nvim-treesitter-context', use { 'romgrk/nvim-treesitter-context',
requires = 'nvim-treesitter/nvim-treesitter', requires = 'nvim-treesitter/nvim-treesitter',
config = function() config = function()