From da120c60545a479f661f313ef625f288487b867b Mon Sep 17 00:00:00 2001 From: Scott Carroll Date: Tue, 18 Mar 2025 22:34:05 +0000 Subject: [PATCH] Added harpoon, telescope, undotree --- init.lua | 27 +++++++++++++++++++++++++-- lua/plugins/harpoon.lua | 6 ++++++ lua/plugins/lsp_lines.lua | 8 ++++++++ lua/plugins/telescope.lua | 5 +++++ lua/plugins/undotree.lua | 5 +++++ 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 lua/plugins/harpoon.lua create mode 100644 lua/plugins/lsp_lines.lua create mode 100644 lua/plugins/telescope.lua create mode 100644 lua/plugins/undotree.lua diff --git a/init.lua b/init.lua index ecbd8f3..54aeae0 100644 --- a/init.lua +++ b/init.lua @@ -33,12 +33,35 @@ vim.opt.cindent = true -- use language‐specific plugins for indenting (better): vim.cmd("filetype plugin indent on") - - vim.cmd("syntax on") vim.keymap.set('n', 'p', 'pu') +vim.g.mapleader = " " +vim.keymap.set("n", "ll", vim.cmd.Ex) + +-- Telescope +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) +vim.keymap.set('n', 'fg', builtin.git_files, { desc = 'Telescope find git files' }) +vim.keymap.set('n', 'fG', function() + builtin.grep_string({ search = vim.fn.input("grep > ") } ); +end ) + +-- Harpoon +local mark = require("harpoon.mark") +local ui = require("harpoon.ui") + +vim.keymap.set("n", "a", mark.add_file) +vim.keymap.set("n", "", ui.toggle_quick_menu) +vim.keymap.set("n", "", function() ui.nav_file(1) end) +vim.keymap.set("n", "", function() ui.nav_file(2) end) +vim.keymap.set("n", "", function() ui.nav_file(3) end) +vim.keymap.set("n", "", function() ui.nav_file(4) end) + +-- UndoTree +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) + -- Reserve a space in the gutter vim.opt.signcolumn = 'yes' diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..d7b47f9 --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,6 @@ +return { + { + "theprimeagen/harpoon", + } +} + diff --git a/lua/plugins/lsp_lines.lua b/lua/plugins/lsp_lines.lua new file mode 100644 index 0000000..887671e --- /dev/null +++ b/lua/plugins/lsp_lines.lua @@ -0,0 +1,8 @@ +return { + { + "https://git.sr.ht/~whynothugo/lsp_lines.nvim", + config = function() + require("lsp_lines").setup() + end, + } +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..018a3b8 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,5 @@ +return { + 'nvim-telescope/telescope.nvim', tag = '0.1.8', + -- or , branch = '0.1.x', + dependencies = { 'nvim-lua/plenary.nvim' } +} diff --git a/lua/plugins/undotree.lua b/lua/plugins/undotree.lua new file mode 100644 index 0000000..0300021 --- /dev/null +++ b/lua/plugins/undotree.lua @@ -0,0 +1,5 @@ +return { + { + "mbbill/undotree" + } +}