diff --git a/nvim/.config/nvim/README.md b/nvim/.config/nvim/README.md index 230e030..008b291 100644 --- a/nvim/.config/nvim/README.md +++ b/nvim/.config/nvim/README.md @@ -59,6 +59,13 @@ Browse files with: dl ``` +Telescope shortcuts: + +- `ff` find files +- `fg` live grep +- `fb` list buffers +- `fh` browse help tags + Oil usage: - `dl` opens the parent directory of the current file diff --git a/nvim/.config/nvim/lua/romanzy/plugins.lua b/nvim/.config/nvim/lua/romanzy/plugins.lua index feef861..a114780 100644 --- a/nvim/.config/nvim/lua/romanzy/plugins.lua +++ b/nvim/.config/nvim/lua/romanzy/plugins.lua @@ -1,5 +1,6 @@ require("romanzy.plugins.rose-pine") require("romanzy.plugins.oil") +require("romanzy.plugins.telescope") require("romanzy.plugins.nvim-treesitter") require("romanzy.plugins.lsp") require("romanzy.plugins.header42") diff --git a/nvim/.config/nvim/lua/romanzy/plugins/telescope.lua b/nvim/.config/nvim/lua/romanzy/plugins/telescope.lua new file mode 100644 index 0000000..540fcdb --- /dev/null +++ b/nvim/.config/nvim/lua/romanzy/plugins/telescope.lua @@ -0,0 +1,12 @@ +vim.pack.add({ + { + src = "https://github.com/nvim-telescope/telescope.nvim", + name = "telescope.nvim", + }, + { + src = "https://github.com/nvim-lua/plenary.nvim", + name = "plenary.nvim", + }, +}) + +require("telescope").setup({}) diff --git a/nvim/.config/nvim/lua/romanzy/remap.lua b/nvim/.config/nvim/lua/romanzy/remap.lua index a73dd46..073b436 100644 --- a/nvim/.config/nvim/lua/romanzy/remap.lua +++ b/nvim/.config/nvim/lua/romanzy/remap.lua @@ -1,8 +1,18 @@ vim.g.mapleader = " " vim.g.maplocalleader = " " +local function telescope_picker(picker) + return function() + require("telescope.builtin")[picker]() + end +end + vim.keymap.set("n", "dl", "Oil") vim.keymap.set("n", "nl", vim.cmd.Ex) +vim.keymap.set("n", "ff", telescope_picker("find_files")) +vim.keymap.set("n", "fg", telescope_picker("live_grep")) +vim.keymap.set("n", "fb", telescope_picker("buffers")) +vim.keymap.set("n", "fh", telescope_picker("help_tags")) vim.keymap.set("n", "s", ":set spell!") vim.keymap.set("n", "sv", "vs") diff --git a/nvim/.config/nvim/nvim-pack-lock.json b/nvim/.config/nvim/nvim-pack-lock.json index ba8be4f..531abdc 100644 --- a/nvim/.config/nvim/nvim-pack-lock.json +++ b/nvim/.config/nvim/nvim-pack-lock.json @@ -24,9 +24,17 @@ "rev": "b73018b75affd13fa38e2fc94ef753b465f770d7", "src": "https://github.com/stevearc/oil.nvim" }, + "plenary.nvim": { + "rev": "74b06c6c75e4eeb3108ec01852001636d85a932b", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, "rose-pine": { "rev": "ff483051a47e27d84bdef47703538df1ed9f4a47", "src": "https://github.com/rose-pine/neovim" + }, + "telescope.nvim": { + "rev": "427b576c16792edad01a92b89721d923c19ad60f", + "src": "https://github.com/nvim-telescope/telescope.nvim" } } }