From 19e76a16d81a1b68437c49f189bc7d2fabaf6e12 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 14 Nov 2022 14:15:39 +0100 Subject: [PATCH] nvim: deactivate project.nvim I don't really use it, autocwd seems more useful. --- .config/nvim/lua/my/coding.lua | 12 ++++++------ .config/nvim/lua/my/functions.lua | 5 +++++ .config/nvim/lua/my/plugins.lua | 8 ++++---- .config/nvim/lua/my/tools.lua | 4 ++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.config/nvim/lua/my/coding.lua b/.config/nvim/lua/my/coding.lua index b31df4f..33a58a7 100644 --- a/.config/nvim/lua/my/coding.lua +++ b/.config/nvim/lua/my/coding.lua @@ -23,12 +23,12 @@ require('luasnip.loaders.from_lua').load({ paths = vim.fn.stdpath('config') .. '/snippets' }) -require('project_nvim').setup({ - detection_methods = { 'pattern', 'lsp' }, - patterns = require('my.functions').project_root_markers, - show_hidden = false, - fallback_buffer_dir = true -}) +-- require('project_nvim').setup({ +-- detection_methods = { 'pattern', 'lsp' }, +-- patterns = require('my.functions').project_root_markers, +-- show_hidden = false, +-- fallback_buffer_dir = true +-- }) -- icons for diagnostics in the symbol column local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } diff --git a/.config/nvim/lua/my/functions.lua b/.config/nvim/lua/my/functions.lua index 778e0d4..5125dcb 100644 --- a/.config/nvim/lua/my/functions.lua +++ b/.config/nvim/lua/my/functions.lua @@ -72,6 +72,11 @@ M.project_root_markers = { } function M.get_project_root() + local lsp_root = vim.lsp.buf.list_workspace_folders()[1] + if lsp_root ~= nil then + return lsp_root + end + local path = vim.api.nvim_buf_get_name(0) local sep = '/' diff --git a/.config/nvim/lua/my/plugins.lua b/.config/nvim/lua/my/plugins.lua index 89031e3..796ff2c 100644 --- a/.config/nvim/lua/my/plugins.lua +++ b/.config/nvim/lua/my/plugins.lua @@ -165,10 +165,10 @@ require('packer').startup({ function(use) } use { 'https://github.com/windwp/nvim-autopairs' } use { 'https://github.com/L3MON4D3/LuaSnip' } - -- use { 'https://github.com/ahmedkhalf/project.nvim' } - use { -- - 'https://github.com/tastytea/project.nvim', - branch = 'fallback_current_dir' } + -- -- use { 'https://github.com/ahmedkhalf/project.nvim' } + -- use { -- + -- 'https://github.com/tastytea/project.nvim', + -- branch = 'fallback_current_dir' } use { 'https://github.com/mfussenegger/nvim-dap', tag = '*' diff --git a/.config/nvim/lua/my/tools.lua b/.config/nvim/lua/my/tools.lua index 86fa262..9314d6b 100644 --- a/.config/nvim/lua/my/tools.lua +++ b/.config/nvim/lua/my/tools.lua @@ -3,7 +3,7 @@ require('which-key').setup({}) local map = require('my.functions').map local telescope = require('telescope') local t_actions = require('telescope.actions') -telescope.load_extension('projects') +-- telescope.load_extension('projects') telescope.load_extension('dap') telescope.load_extension('fzf') @@ -43,7 +43,7 @@ map('n', 'tm', t_builtin.man_pages, 'Man pages') map('n', 'tr', t_builtin.registers, 'Registers') map('n', 'gh', t_builtin.git_bcommits, 'History of this file') map('n', '', t_builtin.diagnostics, 'Show diagnostics') -map('n', 'tp', telescope.extensions.projects.projects, 'Projects') +-- map('n', 'tp', telescope.extensions.projects.projects, 'Projects') map('n', 'tt', require("telescope._extensions.todo-comments").exports.todo, 'Display TODO comments in project')