From d94b454eb61a0d0a99f9939560506c2db24f3315 Mon Sep 17 00:00:00 2001 From: Squibid Date: Tue, 30 Jan 2024 21:52:24 -0500 Subject: way too lazy to sort this out, adding kitchen sink --- lua/conf/binds.lua | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'lua/conf/binds.lua') diff --git a/lua/conf/binds.lua b/lua/conf/binds.lua index 3e9a3aa..11c791c 100644 --- a/lua/conf/binds.lua +++ b/lua/conf/binds.lua @@ -93,15 +93,8 @@ if pcall(require, "telescope") then -- search for vim options map('n', 'sv', telebuilt.vim_options, { desc = 'Find vim options.' }) -- search for string in project - map('n', 'sp', function() - vim.ui.input({ prompt = 'Find string in project' }, function(input) - if not input or input == '' then - vim.notify('No query!', vim.log.levels.WARN, { title = misc.appid }) - return nil - end - telebuilt.grep_string({ search = input }) - end) - end, { desc = 'Find string in project.' }) + map('n', 'sp', telebuilt.live_grep, { desc = 'Find string in project.' }) + -- Code Actions (requires telescope) if pcall(require, "actions-preview") then map({ "n", "v" }, "ca", require("actions-preview").code_actions, { @@ -110,6 +103,24 @@ if pcall(require, "telescope") then end end +-- harpoon +if pcall(require, 'harpoon') then + local mark = require("harpoon.mark") + local ui = require("harpoon.ui") + + map("n", "a", function() + mark.add_file() + vim.notify('added new file to quickmarks', vim.log.levels.INFO, { + title = misc.appid, + }) + end) + map("n", "", ui.toggle_quick_menu) + map('n', '', function() ui.nav_file(1) end) + map('n', '', function() ui.nav_file(2) end) + map('n', '', function() ui.nav_file(3) end) + map('n', '', function() ui.nav_file(4) end) +end + map('n', 'u', 'UndotreeToggle', { desc = 'Open undo tree.' }) map('n', 'f', 'SFMToggle', { desc = 'Open file tree view.' }) map('n', 'b', 'JABSOpen', { desc = 'Switch between buffers.' }) @@ -119,10 +130,6 @@ if pcall(require, "smart-splits") then map('n', 'r', smartsplits.start_resize_mode) end --- toggle term (don't use leader key in these binds) -map({'n', 't'}, '', 'ToggleTerm direction=float') -map({'n', 't'}, '', 'lua _glow()') - -- git map('n', 'gp', 'Gitsigns preview_hunk_inline') map('n', 'gs', 'Gitsigns stage_hunk') -- cgit v1.2.1