From 3a9e7c1b6d9073a7dc8acdfd2b193f00571d387a Mon Sep 17 00:00:00 2001 From: Graham McMillan <30657475+gmcmillan82@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:24:01 +0200 Subject: [PATCH] Add trouble keybindings and some cleanup --- init.lua | 4 +++ lua/custom/plugins/colorscheme.lua | 2 +- lua/custom/plugins/lualine.lua | 40 ++++++------------------------ lua/custom/plugins/trouble.lua | 38 ++++++++++++++++++++++++---- 4 files changed, 45 insertions(+), 39 deletions(-) diff --git a/init.lua b/init.lua index 372bf593..5a737ca6 100644 --- a/init.lua +++ b/init.lua @@ -302,6 +302,8 @@ require('lazy').setup({ { 'd_', hidden = true }, { 'h', group = 'Git [H]unk' }, { 'h_', hidden = true }, + { 'n', group = '[N]eogit' }, + { 'n_', hidden = false }, { 'r', group = '[R]ename' }, { 'r_', hidden = true }, { 's', group = '[S]earch' }, @@ -310,6 +312,8 @@ require('lazy').setup({ { 't_', hidden = true }, { 'w', group = '[W]orkspace' }, { 'w_', hidden = true }, + { 'x', group = 'Trouble' }, + { '_x', hidden = true }, { 'h', desc = 'Git [H]unk', mode = 'v' }, } end, diff --git a/lua/custom/plugins/colorscheme.lua b/lua/custom/plugins/colorscheme.lua index 8ddf4b1e..6f1c4776 100644 --- a/lua/custom/plugins/colorscheme.lua +++ b/lua/custom/plugins/colorscheme.lua @@ -22,7 +22,7 @@ return { priority = 1000, config = function() require('tokyonight').setup { - style = 'night', + style = 'moon', } vim.cmd [[colorscheme tokyonight]] end, diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua index c63a3225..903f243c 100644 --- a/lua/custom/plugins/lualine.lua +++ b/lua/custom/plugins/lualine.lua @@ -1,51 +1,25 @@ --- return { --- { --- "nvim-lualine/lualine.nvim", --- dependencies = { --- 'nvim-tree/nvim-web-devicons', --- }, --- config = function() --- require("lualine").setup({ --- options = { --- theme = "catppuccin", --- icons_enabled = true, --- section_separators = '', --- component_separators = '', --- }, --- sections = { --- lualine_a = { --- "mode", --- "buffers", --- }, --- lualine_c = {}, --- }, --- }) --- end, --- }, --- } - return { { -- Set lualine as statusline 'nvim-lualine/lualine.nvim', -- See `:help lualine.txt` config = function() - require("lualine").setup({ + require('lualine').setup { options = { icons_enabled = true, theme = 'auto', component_separators = '|', --section_separators = { left = '', right = '' }, - section_separators = { left = ' ', right = ' '}, + section_separators = { left = ' ', right = ' ' }, }, sections = { lualine_a = { - "mode", - "buffers", + 'mode', + 'buffers', }, lualine_c = {}, - } - }) - end + }, + } + end, }, } diff --git a/lua/custom/plugins/trouble.lua b/lua/custom/plugins/trouble.lua index 97eb8e93..58e45986 100644 --- a/lua/custom/plugins/trouble.lua +++ b/lua/custom/plugins/trouble.lua @@ -1,11 +1,39 @@ return { { 'folke/trouble.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - lazy = true, + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = 'Trouble', + keys = { + { + 'xx', + 'Trouble diagnostics toggle', + desc = 'Diagnostics (Trouble)', + }, + { + 'xX', + '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)', + }, + { + 'xL', + 'Trouble loclist toggle', + desc = 'Location List (Trouble)', + }, + { + 'xQ', + 'Trouble qflist toggle', + desc = 'Quickfix List (Trouble)', + }, }, }, }