diff --git a/nvim-fredrik/lazy-lock.json b/nvim-fredrik/lazy-lock.json index 5a83c6da..0931af9a 100644 --- a/nvim-fredrik/lazy-lock.json +++ b/nvim-fredrik/lazy-lock.json @@ -1,5 +1,6 @@ { "ChatGPT.nvim": { "branch": "main", "commit": "df53728e05129278d6ea26271ec086aa013bed90" }, + "CopilotChat.nvim": { "branch": "canary", "commit": "60f53cff55e775645cb74b7c11228da9a80e42d6" }, "FTerm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "878ace11983444d865a72e1759dbcc331d1ace4c" }, @@ -15,6 +16,7 @@ "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" }, "conform.nvim": { "branch": "master", "commit": "f3b930db4964d60e255c8f9e37b7f2218dfc08cb" }, + "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "crates.nvim": { "branch": "main", "commit": "8437522d12a8c523da2aee9db2979d070b2ecc33" }, "diffview.nvim": { "branch": "main", "commit": "3afa6a053f680e9f1329c4a151db988a482306cd" }, "dressing.nvim": { "branch": "master", "commit": "3c38ac861e1b8d4077ff46a779cde17330b29f3a" }, @@ -62,6 +64,7 @@ "obsidian.nvim": { "branch": "main", "commit": "db41b1f20459293436fab510bec58c82a73bd1f7" }, "persistence.nvim": { "branch": "main", "commit": "5fe077056c821aab41f87650bd6e1c48cd7dd047" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, "promise-async": { "branch": "main", "commit": "93540c168c5ed2b030ec3e6c40ab8bbb85e36355" }, "rest.nvim": { "branch": "main", "commit": "f96edb54a2940322bc7ed81a1031be04db7d3a99" }, "rustaceanvim": { "branch": "master", "commit": "2fa45427c01ded4d3ecca72e357f8a60fd8e46d4" }, diff --git a/nvim-fredrik/lua/config/keymaps.lua b/nvim-fredrik/lua/config/keymaps.lua index 78d1c35a..9335789a 100644 --- a/nvim-fredrik/lua/config/keymaps.lua +++ b/nvim-fredrik/lua/config/keymaps.lua @@ -248,6 +248,10 @@ end function M.setup_telescope_keymaps() map_normal_mode("", require("telescope.builtin").find_files, "Find Files") + -- file + map_normal_mode("fp", "Telescope projects", "File from other project") + map_normal_mode("fr", "Telescope oldfiles", "Recent files") + -- git map_normal_mode("sc", "Telescope git_commits", "[s]earch git [c]ommits") map_normal_mode("sg", "Telescope git_status", "[s]earch git changes") diff --git a/nvim-fredrik/lua/plugins/telescope.lua b/nvim-fredrik/lua/plugins/telescope.lua index 97cf9911..2be7f460 100644 --- a/nvim-fredrik/lua/plugins/telescope.lua +++ b/nvim-fredrik/lua/plugins/telescope.lua @@ -16,6 +16,55 @@ return { "nvim-telescope/telescope-live-grep-args.nvim", }, { "smartpde/telescope-recent-files" }, + { + "ahmedkhalf/project.nvim", + opts = { + { + -- Manual mode doesn't automatically change your root directory, so you have + -- the option to manually do so using `:ProjectRoot` command. + manual_mode = true, + + -- Methods of detecting the root directory. **"lsp"** uses the native neovim + -- lsp, while **"pattern"** uses vim-rooter like glob pattern matching. Here + -- order matters: if one is not detected, the other is used as fallback. You + -- can also delete or rearangne the detection methods. + detection_methods = { "lsp", "pattern" }, + + -- All the patterns used to detect root dir, when **"pattern"** is in + -- detection_methods + patterns = { ".git" }, + + -- Table of lsp clients to ignore by name + -- eg: { "efm", ... } + ignore_lsp = {}, + + -- Don't calculate root dir on specific directories + -- Ex: { "~/.cargo/*", ... } + exclude_dirs = {}, + + -- Show hidden files in telescope + show_hidden = true, + + -- When set to false, you will get a message when project.nvim changes your + -- directory. + silent_chdir = false, + + -- What scope to change the directory, valid options are + -- * global (default) + -- * tab + -- * win + scope_chdir = "win", + + -- Path where project.nvim will store the project history for use in + -- telescope + datapath = vim.fn.stdpath("data"), + }, + }, + event = "VeryLazy", + config = function(_, opts) + require("project_nvim").setup(opts) + end, + }, { "rcarriga/nvim-notify" }, { "folke/trouble.nvim" }, -- for trouble.sources.telescope }, @@ -68,6 +117,7 @@ return { telescope.load_extension("live_grep_args") telescope.load_extension("ui-select") telescope.load_extension("recent_files") + telescope.load_extension("projects") telescope.load_extension("notify") require("config.keymaps").setup_telescope_keymaps()