From 6a9fd3965335004d56bbcd7a25ac6981f6a87397 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 29 Dec 2023 16:26:21 +0100 Subject: up --- .config/nvim/after/plugin/nerd-commenter.lua | 14 -------------- .config/nvim/after/plugin/telescope.lua | 16 ++++++++++++++++ .config/nvim/after/plugin/treesitter.lua | 2 +- .config/nvim/after/plugin/trouble.lua | 17 +++++++++++++++++ .config/nvim/after/plugin/whichkey.lua | 28 +++++++++++++++++++--------- .config/nvim/lua/pack.lua | 6 ------ .config/nvim/lua/settings.lua | 2 +- 7 files changed, 54 insertions(+), 31 deletions(-) delete mode 100644 .config/nvim/after/plugin/nerd-commenter.lua create mode 100644 .config/nvim/after/plugin/telescope.lua create mode 100644 .config/nvim/after/plugin/trouble.lua (limited to '.config') diff --git a/.config/nvim/after/plugin/nerd-commenter.lua b/.config/nvim/after/plugin/nerd-commenter.lua deleted file mode 100644 index ddfadf2..0000000 --- a/.config/nvim/after/plugin/nerd-commenter.lua +++ /dev/null @@ -1,14 +0,0 @@ --- NERD Commenter -vim.g.NERDSpaceDelims = 1 -vim.g.NERDCompactSexyComs = 1 -vim.g.NERDDefaultAlign = 'left' -vim.g.NERDAltDelims_java = 1 -vim.g.NERDCustomDelimiters = { - c = { - left = '/*', - right = '*/', - } -} -vim.g.NERDCommentEmptyLines = 1 -vim.g.NERDTrimTrailingWhitespace = 1 -vim.g.NERDToggleCheckAllLines = 1 diff --git a/.config/nvim/after/plugin/telescope.lua b/.config/nvim/after/plugin/telescope.lua new file mode 100644 index 0000000..99e1ad9 --- /dev/null +++ b/.config/nvim/after/plugin/telescope.lua @@ -0,0 +1,16 @@ +local tele = require('telescope') + +tele.setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = false, + [""] = require('telescope.actions').move_selection_next, + [""] = require('telescope.actions').move_selection_previous, + }, + }, + }, +} + +pcall(tele.load_extension, 'fzf') diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua index c34af23..4e27946 100644 --- a/.config/nvim/after/plugin/treesitter.lua +++ b/.config/nvim/after/plugin/treesitter.lua @@ -13,7 +13,7 @@ require'nvim-treesitter.configs'.setup { 'regex', 'markdown', 'markdown_inline', - 'comment' + 'comment', }, -- Install parsers synchronously (only applied to `ensure_installed`) diff --git a/.config/nvim/after/plugin/trouble.lua b/.config/nvim/after/plugin/trouble.lua new file mode 100644 index 0000000..f2a74fb --- /dev/null +++ b/.config/nvim/after/plugin/trouble.lua @@ -0,0 +1,17 @@ +require('trouble').setup { + icons = true, +} + +-- Diagnostic signs +-- https://github.com/folke/trouble.nvim/issues/52 +local signs = { + Error = " ", + Warn = " ", + Hint = " ", + Info = " " +} + +for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl}) +end diff --git a/.config/nvim/after/plugin/whichkey.lua b/.config/nvim/after/plugin/whichkey.lua index 4e539db..b96a4bc 100644 --- a/.config/nvim/after/plugin/whichkey.lua +++ b/.config/nvim/after/plugin/whichkey.lua @@ -10,25 +10,34 @@ local ts = require('telescope.builtin') require('telescope').load_extension('harpoon') local wk = require('which-key') wk.register({ + -- harpoon a = { name = 'harpoon', - a = { function() harpoon:list():append() end, 'add file', noremap = true, silent = true }, + a = { function() harpoon:list():append() end, 'add file', noremap = true, silent = true }, e = { function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, 'harpoon ui', noremap = true, silent = true }, - f = { ':Telescope harpoon marks', 'harpoon telescope ui', noremap = true, silent = true }, + f = { ':Telescope harpoon marks', 'harpoon telescope ui', noremap = true, silent = true }, }, - b = { ':Buffers', 'buffers', noremap = true, silent = true }, - c = { name = '+nerd-commenter' }, d = { ':bd', 'close buffer', noremap = true, silent = true }, D = { '"-ddk:put = strftime(\' * %c\')', 'insert date', noremap = true, silent = true }, - e = { ':Telescope find_files', 'find files', noremap = true, silent = true }, - G = { ':FloatermNew lazygit', 'lazygit', noremap = true, silent = true }, h = { ':Startify', 'startify', noremap = true, silent = true }, k = { ':w:bp:bd #', 'write and close buffer', noremap = true, silent = false }, u = { vim.cmd.UndotreeToggle, 'undotree', noremap = true, silent = true }, w = { ':w', 'write buffer', noremap = true, silent = false }, - x = { ':w:bp:bd #', 'write and close buffer', noremap = true, silent = false }, + -- trouble + x = { + name = 'trouble', + x = { vim.cmd.TroubleToggle, 'toggle', noremap = true, silent = true }, + w = { ':TroubleToggle workspace_diagnostics', 'workspace', noremap = true, silent = true }, + d = { ':TroubleToggle document_diagnostics', 'document', noremap = true, silent = true }, + l = { ':TroubleToggle loclist', 'local list', noremap = true, silent = true }, + q = { ':TroubleToggle quickfix', 'quickfix', noremap = true, silent = true }, + r = { ':TroubleToggle lsp_references', 'lsp', noremap = true, silent = true }, + }, + -- telescope f = { name = 'telescope', + b = { ts.buffers, 'buffers', noremap = true, silent = true }, + d = { ts.diagnostics, 'diagnostics', noremap = true, silent = true }, e = { ':Telescope harpoon marks', 'harpoon marks', noremap = true, silent = true }, f = { ts.find_files, 'find files', noremap = true, silent = true }, g = { ts.git_files, 'git files', noremap = true, silent = true }, @@ -37,13 +46,16 @@ wk.register({ end, 'grep string', noremap = true, silent = true }, t = { ':TodoTelescope keywords=TODO,HACK,WARN,PERF,NOTE,TEST', 'todo', noremap = true, silent = true } }, + -- git g = { name = 'git', g = { vim.cmd.Git, 'git' }, + l = { ':FloatermNew lazygit', 'lazygit', noremap = true, silent = true }, -- a = { ':Ag', 'the_silver_searcher', noremap = true, silent = true }, -- g = { ':Grep', 'grep', noremap = true, silent = true }, -- r = { ':Rg', 'ripgrep', noremap = true, silent = true }, }, + -- neovim v = { name = 'nvim', v = { vim.cmd.Ex, 'explorer', noremap = true, silent = true }, @@ -65,5 +77,3 @@ wk.setup({ triggers = { "" }, triggers_nowait = { "d" }, }) - -vim.keymap.set('n', '', ts.git_files) diff --git a/.config/nvim/lua/pack.lua b/.config/nvim/lua/pack.lua index 854afe8..1ddb1b3 100644 --- a/.config/nvim/lua/pack.lua +++ b/.config/nvim/lua/pack.lua @@ -16,7 +16,6 @@ return require('packer').startup({function(use) use 'folke/which-key.nvim' use 'mhinz/vim-signify' use 'mhinz/vim-startify' - use 'morhetz/gruvbox' use 'mg979/vim-visual-multi' use 'preservim/tagbar' -- use 'preservim/nerdcommenter' @@ -92,11 +91,6 @@ return require('packer').startup({function(use) requires = { {'nvim-tree/nvim-web-devicons'}, }, - config = function() - require('trouble').setup { - icons = true, - } - end, }) use { 'lukas-reineke/indent-blankline.nvim', diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index a5bbd3f..6deddff 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -14,7 +14,7 @@ vim.opt.completeopt = 'menuone,noinsert,noselect,preview' vim.opt.cursorline = true vim.opt.encoding = 'utf-8' -- vim.opt.go = 'a' -vim.opt.termguicolors = false +vim.opt.termguicolors = true vim.opt.hidden = true vim.opt.makeprg = 'make' vim.opt.mouse = 'a' -- cgit v1.2.3