From f7ed61d5bcf6f33bfa3b136358f20a7efb4846d3 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Fri, 16 Aug 2024 13:05:51 +0200 Subject: [PATCH] Update .config/nvim/lazy-lock.json Update .config/nvim/lua/plugins/alpha.lua Update .config/nvim/lua/plugins/project.lua Update .config/nvim/lua/plugins/statusline.lua Update .config/nvim/lua/plugins/telescope.lua --- dot_config/nvim/lazy-lock.json | 6 ++-- dot_config/nvim/lua/plugins/alpha.lua | 4 +-- dot_config/nvim/lua/plugins/project.lua | 41 +++++++++++++++++++++- dot_config/nvim/lua/plugins/statusline.lua | 2 +- dot_config/nvim/lua/plugins/telescope.lua | 16 ++++----- 5 files changed, 54 insertions(+), 15 deletions(-) diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json index 5bd56a3..a067365 100644 --- a/dot_config/nvim/lazy-lock.json +++ b/dot_config/nvim/lazy-lock.json @@ -12,14 +12,14 @@ "indent-blankline.nvim": { "branch": "master", "commit": "dddb5d21811c319eb6e51a993d8fb44b193aae3f" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "3ed90180e70a6a50cd37ce7ecc3693bcdaa7b290" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1c55991321d1a861537e32446affc5de5d9a6eaf" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "nvim-autopairs": { "branch": "master", "commit": "48ca9aaee733911424646cb1605f27bc01dedbe3" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-lspconfig": { "branch": "master", "commit": "037ea0901ce9a28cfcaa36302618f06d2e164fbf" }, - "nvim-treesitter": { "branch": "master", "commit": "bfb50de9cb0673a3bff620d881f690fb7e0d1328" }, + "nvim-lspconfig": { "branch": "master", "commit": "a89de2e049b5f89a0ee55029d5a31213bd4de6f8" }, + "nvim-treesitter": { "branch": "master", "commit": "59cc5f35656f97bc964229e3ec5066a7b5a8ee5b" }, "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, diff --git a/dot_config/nvim/lua/plugins/alpha.lua b/dot_config/nvim/lua/plugins/alpha.lua index 268f3da..b3606c3 100644 --- a/dot_config/nvim/lua/plugins/alpha.lua +++ b/dot_config/nvim/lua/plugins/alpha.lua @@ -1,7 +1,7 @@ return { 'goolord/alpha-nvim', dependencies = { - "nvim-telescope/telescope.nvim" + "nvim-telescope/telescope.nvim", }, config = function() local alpha = require 'alpha' @@ -34,7 +34,7 @@ return { dashboard.section.buttons.val = { dashboard.button("e", " New file", ":ene startinsert "), dashboard.button("f", "󰈞 Find file", ":Telescope find_files "), - dashboard.button("p", " Open project", ":Telescope project"), + dashboard.button("p", " Open project", ":Telescope projects"), } alpha.setup(dashboard.opts) end diff --git a/dot_config/nvim/lua/plugins/project.lua b/dot_config/nvim/lua/plugins/project.lua index cee7ff1..37ea94c 100644 --- a/dot_config/nvim/lua/plugins/project.lua +++ b/dot_config/nvim/lua/plugins/project.lua @@ -1,6 +1,45 @@ return { "ahmedkhalf/project.nvim", config = function() - require 'project_nvim'.setup {} + require 'project_nvim'.setup { + -- Manual mode doesn't automatically change your root directory, so you have + -- the option to manually do so using `:ProjectRoot` command. + manual_mode = false, + + -- 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", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, + + -- 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 = false, + + -- When set to false, you will get a message when project.nvim changes your + -- directory. + silent_chdir = true, + + -- What scope to change the directory, valid options are + -- * global (default) + -- * tab + -- * win + scope_chdir = 'global', + + -- Path where project.nvim will store the project history for use in + -- telescope + datapath = vim.fn.stdpath("data"), + } end } diff --git a/dot_config/nvim/lua/plugins/statusline.lua b/dot_config/nvim/lua/plugins/statusline.lua index 3a01139..055abdd 100644 --- a/dot_config/nvim/lua/plugins/statusline.lua +++ b/dot_config/nvim/lua/plugins/statusline.lua @@ -2,6 +2,6 @@ return { 'nvim-lualine/lualine.nvim', dependencies = { 'nvim-tree/nvim-web-devicons' }, opts = { - extensions = { "mason" } + extensions = { "mason", "neo-tree" } } } diff --git a/dot_config/nvim/lua/plugins/telescope.lua b/dot_config/nvim/lua/plugins/telescope.lua index 54b5f36..0e2f4d5 100644 --- a/dot_config/nvim/lua/plugins/telescope.lua +++ b/dot_config/nvim/lua/plugins/telescope.lua @@ -4,18 +4,18 @@ return { lazy = true, dependencies = { 'nvim-lua/plenary.nvim', - "nvim-telescope/telescope-project.nvim" + 'ahmedkhalf/project.nvim' }, opts = {}, -- define config options here, or use a config() function config = function() - require('telescope').load_extension('project') + require('telescope').load_extension('projects') end, keys = { - { 'ff', function() require 'telescope.builtin'.find_files() end, desc = 'Find files', mode = 'n' }, - { 'fg', function() require('telescope.builtin').live_grep() end, desc = 'Live grep', mode = 'n' }, - { 'fb', function() require('telescope.builtin').buffers() end, desc = 'Buffers', mode = 'n' }, - { 'fh', function() require('telescope.builtin').help_tags() end, desc = 'Help tags', mode = 'n' }, - { 'fp', function() require('telescope').extensions.project.project {} end, desc = 'Projects', mode = 'n' }, - { 'fd', "Telescope diagnostics", desc = 'Diagnostics', mode = 'n' } + { 'ff', function() require 'telescope.builtin'.find_files() end, desc = 'Find files', mode = 'n' }, + { 'fg', function() require('telescope.builtin').live_grep() end, desc = 'Live grep', mode = 'n' }, + { 'fb', function() require('telescope.builtin').buffers() end, desc = 'Buffers', mode = 'n' }, + { 'fh', function() require('telescope.builtin').help_tags() end, desc = 'Help tags', mode = 'n' }, + { 'fp', function() require('telescope').extensions.projects.projects {} end, desc = 'Projects', mode = 'n' }, + { 'fd', "Telescope diagnostics", desc = 'Diagnostics', mode = 'n' } }, }