aboutsummaryrefslogtreecommitdiffstats
path: root/nvim/lua/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lua/plugins')
-rw-r--r--nvim/lua/plugins/fugitive.lua6
-rw-r--r--nvim/lua/plugins/harpoon.lua46
-rw-r--r--nvim/lua/plugins/init.lua7
-rw-r--r--nvim/lua/plugins/telescope.lua25
4 files changed, 77 insertions, 7 deletions
diff --git a/nvim/lua/plugins/fugitive.lua b/nvim/lua/plugins/fugitive.lua
new file mode 100644
index 0000000..a203ea8
--- /dev/null
+++ b/nvim/lua/plugins/fugitive.lua
@@ -0,0 +1,6 @@
+return {
+ 'tpope/vim-fugitive', -- close to native git command integrations
+ keys = {
+ {"<leader>gs", vim.cmd.Git, desc = "Git Status"}
+ }
+}
diff --git a/nvim/lua/plugins/harpoon.lua b/nvim/lua/plugins/harpoon.lua
new file mode 100644
index 0000000..061ca9e
--- /dev/null
+++ b/nvim/lua/plugins/harpoon.lua
@@ -0,0 +1,46 @@
+return {
+ 'ThePrimeagen/harpoon', -- quick file navigator
+ branch = "harpoon2",
+ dependencies = 'nvim-lua/plenary.nvim',
+ config = function()
+ require("harpoon"):setup()
+ end,
+ keys = {
+ {"<leader><cr>", function()
+ local harpoon = require("harpoon")
+ harpoon.ui:toggle_quick_menu(harpoon:list())
+ end,
+ desc = "Open Harpoon Quickmenu"
+ },
+ {"<leader>m", function()
+ local harpoon = require("harpoon")
+ harpoon:list():append()
+ end,
+ desc = "Add file to harpoon"
+ },
+ {"<leader>1", function()
+ local harpoon = require("harpoon")
+ harpoon:list():select(1)
+ end,
+ desc = "Navigate to the first file"
+ },
+ {"<leader>2", function()
+ local harpoon = require("harpoon")
+ harpoon:list():select(2)
+ end,
+ desc = "Navigate to the second file"
+ },
+ {"<leader>3", function()
+ local harpoon = require("harpoon")
+ harpoon:list():select(3)
+ end,
+ desc = "Navigate to the third file"
+ },
+ {"<leader>4", function()
+ local harpoon = require("harpoon")
+ harpoon:list():select(4)
+ end,
+ desc = "Navigate to the fourth file"
+ },
+ }
+}
diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua
index c05f0f0..5c90a28 100644
--- a/nvim/lua/plugins/init.lua
+++ b/nvim/lua/plugins/init.lua
@@ -3,10 +3,6 @@ return {
-- common dependacy
"nvim-lua/plenary.nvim",
- -- git
- 'tpope/vim-fugitive', -- close to native git command integrations
-
-
-- completion
-- TODO:config completion and setup binds
'hrsh7th/nvim-cmp',
@@ -23,9 +19,6 @@ return {
dependencies = { 'hrsh7th/nvim-cmp' }
},
-
-
-
{
'numToStr/Comment.nvim', -- faster commentting
lazy = false,
diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua
index 55bc045..360994a 100644
--- a/nvim/lua/plugins/telescope.lua
+++ b/nvim/lua/plugins/telescope.lua
@@ -3,5 +3,30 @@ return {
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons'
+ },
+ keys = {
+ {"<leader>ff", function()
+ require("telescope.builtin").find_files()
+ end,
+ desc = "Search for files (respcting .gitignore)"
+ },
+ {"<Leader>fb", function()
+ require("telescope.builtin").buffers()
+ end
+ },
+ {"<Leader>gf", function()
+ require("telescope.builtin").live_grep()
+ end
+ },
+ {"<Leader>fr", function()
+ -- TODO: if lsp supports reference provider and lsp is attached
+ -- [telescope.builtin.lsp_*]: server does not support referencesProvider
+ if #vim.lsp.get_active_clients({bufnr = 0}) > 0 then
+ require("telescope.builtin").lsp_references()
+ else
+ require("telescope.builtin").grep_string()
+ end
+ end
+ }
}
}