diff --git a/nvim/lua/olinpin/plugins/smart-open.lua b/nvim/lua/olinpin/plugins/smart-open.lua new file mode 100644 index 0000000..1416adf --- /dev/null +++ b/nvim/lua/olinpin/plugins/smart-open.lua @@ -0,0 +1,14 @@ +return { + "danielfalk/smart-open.nvim", + branch = "0.2.x", + config = function() + require("telescope").load_extension("smart_open") + end, + dependencies = { + "kkharji/sqlite.lua", + -- -- Only required if using match_algorithm fzf + -- { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + -- -- Optional. If installed, native fzy will be used when match_algorithm is fzy + -- { "nvim-telescope/telescope-fzy-native.nvim" }, + }, +} diff --git a/nvim/lua/olinpin/plugins/telescope.lua b/nvim/lua/olinpin/plugins/telescope.lua index 2da65a1..b6e0925 100644 --- a/nvim/lua/olinpin/plugins/telescope.lua +++ b/nvim/lua/olinpin/plugins/telescope.lua @@ -88,11 +88,17 @@ return { end, }) end + + local function smart_open() + require("telescope").extensions.smart_open.smart_open() + end + vim.keymap.set("n", "ft", grepInFiles, { desc = "Live grep by filetype" }) vim.keymap.set("n", "*", builtin.grep_string, { desc = "Grep current string" }) - vim.keymap.set("n", "ff", builtin.find_files, { desc = "Find files" }) + vim.keymap.set("n", "fs", builtin.find_files, { desc = "Find files" }) vim.keymap.set("n", "fg", builtin.git_branches, { desc = "Find Git branches" }) vim.keymap.set("n", "fc", builtin.git_commits, { desc = "Find Commits" }) vim.keymap.set("n", "fw", builtin.live_grep, { desc = "Find Words" }) + vim.keymap.set("n", "ff", smart_open, { desc = "Smart Open" }) end, }