From 9e694c03721af13a31aedbfc365203cf66b370b4 Mon Sep 17 00:00:00 2001 From: Squibid Date: Mon, 26 Jun 2023 11:35:24 -0400 Subject: add plugin configs & mess with the binds --- after/plugin/glance.lua | 30 ++++++++++++++++++++++++++++ after/plugin/lightbulb.lua | 23 ++++++++++++++++++++++ after/plugin/todo-comments.lua | 18 +++++++++++++++++ lua/core/binds.lua | 44 +++++++++++++++++------------------------- lua/core/highlight.lua | 3 +++ 5 files changed, 92 insertions(+), 26 deletions(-) create mode 100644 after/plugin/glance.lua create mode 100644 after/plugin/lightbulb.lua create mode 100644 after/plugin/todo-comments.lua diff --git a/after/plugin/glance.lua b/after/plugin/glance.lua new file mode 100644 index 0000000..08f90d1 --- /dev/null +++ b/after/plugin/glance.lua @@ -0,0 +1,30 @@ +local status_ok, glance = pcall(require, "glance") +if not status_ok then + return +end + +local actions = glance.actions +glance.setup { + detached = function(winid) + return vim.api.nvim_win_get_width(winid) < 100 + end, + + border = { + enable = true, + top_char = '', + }, + theme = { + enable = false, + }, + folds = { + fold_closed = '>', + fold_open = 'V', + folded = true, + }, + indent_lines = { + enable = false, + }, + winbar = { + enable = true, + }, +} diff --git a/after/plugin/lightbulb.lua b/after/plugin/lightbulb.lua new file mode 100644 index 0000000..00fcfcc --- /dev/null +++ b/after/plugin/lightbulb.lua @@ -0,0 +1,23 @@ +local status_ok, lightbulb = pcall(require, "nvim-lightbulb") +if not status_ok then + return +end + +lightbulb.setup { + sign = { + enabled = true, + priority = 10000, -- make this really high so it always shows + }, + autocmd = { + enabled = true, + pattern = {"*"}, + events = {"CursorHold", "CursorHoldI"} + } +} + +vim.fn.sign_define('LightBulbSign', { + text = "f", + texthl = "LightBulbSignTxthl", + linehl="", + numhl="", +}) diff --git a/after/plugin/todo-comments.lua b/after/plugin/todo-comments.lua new file mode 100644 index 0000000..af67d49 --- /dev/null +++ b/after/plugin/todo-comments.lua @@ -0,0 +1,18 @@ +local status_ok, todocomments = pcall(require, "todo-comments") +if not status_ok then + return +end + +todocomments.setup { + keywords = { + FIX = { + icon = " ", -- icon used for the sign, and in search results + }, + TODO = { icon = " ", color = "info" }, + HACK = { icon = "* ", color = "warning" }, + WARN = { icon = "! ", color = "warning", alt = { "WARNING", "XXX" } }, + PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, + NOTE = { icon = "i ", color = "hint", alt = { "INFO" } }, + TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, + }, +} diff --git a/lua/core/binds.lua b/lua/core/binds.lua index 66a2af5..0783615 100644 --- a/lua/core/binds.lua +++ b/lua/core/binds.lua @@ -69,43 +69,35 @@ map('n', 'gi', 'Glance implementations') local treesj = require('treesj') -- treesj map('n', 'j', treesj.toggle) --- telescope -local telebuilt = require('telescope.builtin') +local telebuilt = require('telescope.builtin') -- telescope map('n', 'sf', telebuilt.find_files) map('n', 'sg', telebuilt.git_files) map('n', 'sp', function() - telebuilt.grep_string({ search = vim.fn.input('Find string in project > ') }); + telebuilt.grep_string({ search = vim.fn.input('Find string in project > ') }) end) map('n', 'so', telebuilt.oldfiles) --- intellitab -local intellitab = require('intellitab') +local intellitab = require('intellitab') -- intellitab map('n', '', intellitab.indent) --- undo tree -map('n', 'u', 'UndotreeToggle') +map('n', 'u', 'UndotreeToggle') -- undo tree +map('n', 'f', 'SFMToggle') -- sfm +map('n', 'b', 'JABSOpen') -- switch between previous buffers +map('n', 'tt', 'TroubleToggle') -- trouble (lsp error view) +map('n', 'tc', 'TodoTrouble') -- todo trouble +map('n', '', 'IconPickerYank') -- icon picker --- sfm -map('n', 'f', 'SFMToggle') - --- dap ui -local dapui = require('dapui') +local dapui = require('dapui') -- dap ui map('n', 'd', dapui.toggle) --- switch between previous buffers -map('n', 'b', 'JABSOpen') - --- resizing buffers (toggleable) -local smartsplits = require('smart-splits') +local smartsplits = require('smart-splits') -- resizing buffers (toggleable) map('n', 'r', smartsplits.start_resize_mode) --- trouble (lsp error view) -map('n', 't', 'TroubleToggle') - --- icon picker -map('n', '', 'IconPickerYank') +-- toggle term (don't use leader key in these binds) +map({'n', 't'}, '', 'ToggleTerm direction=float') +map({'n', 't'}, '', 'lua _glow()') --- toggle term -map('t', '', '') -- make work in terminals -map({'n', 't'}, '', 'ToggleTerm size=20') -map({'n', 't'}, 'gl', 'lua _glow()') +-- true zen +map('n', 'zf', 'lua require("true-zen.focus").toggle()') +map('n', 'zm', 'lua require("true-zen.minimalist").toggle()') +map('n', 'za', 'lua require("true-zen.ataraxis").toggle()') diff --git a/lua/core/highlight.lua b/lua/core/highlight.lua index 4cd4d55..d1f09db 100644 --- a/lua/core/highlight.lua +++ b/lua/core/highlight.lua @@ -41,3 +41,6 @@ highlight('AlphaHeader', { fg = c.blue }) -- fidget highlight('FidgetTask', { fg = c.fg }) + +-- quick fix sign +highlight('LightBulbSignTxthl', {fg = c.bright_magenta}) -- cgit v1.2.1