1
0
Fork 0

nvim: deactivate project.nvim

I don't really use it, autocwd seems more useful.
This commit is contained in:
tastytea 2022-11-14 14:15:39 +01:00
parent 8b4730420d
commit 19e76a16d8
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
4 changed files with 17 additions and 12 deletions

View File

@ -23,12 +23,12 @@ require('luasnip.loaders.from_lua').load({
paths = vim.fn.stdpath('config') .. '/snippets' paths = vim.fn.stdpath('config') .. '/snippets'
}) })
require('project_nvim').setup({ -- require('project_nvim').setup({
detection_methods = { 'pattern', 'lsp' }, -- detection_methods = { 'pattern', 'lsp' },
patterns = require('my.functions').project_root_markers, -- patterns = require('my.functions').project_root_markers,
show_hidden = false, -- show_hidden = false,
fallback_buffer_dir = true -- fallback_buffer_dir = true
}) -- })
-- icons for diagnostics in the symbol column -- icons for diagnostics in the symbol column
local signs = { Error = "", Warn = "", Hint = "", Info = "" } local signs = { Error = "", Warn = "", Hint = "", Info = "" }

View File

@ -72,6 +72,11 @@ M.project_root_markers = {
} }
function M.get_project_root() 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 path = vim.api.nvim_buf_get_name(0)
local sep = '/' local sep = '/'

View File

@ -165,10 +165,10 @@ require('packer').startup({ function(use)
} }
use { 'https://github.com/windwp/nvim-autopairs' } use { 'https://github.com/windwp/nvim-autopairs' }
use { 'https://github.com/L3MON4D3/LuaSnip' } use { 'https://github.com/L3MON4D3/LuaSnip' }
-- use { 'https://github.com/ahmedkhalf/project.nvim' } -- -- use { 'https://github.com/ahmedkhalf/project.nvim' }
use { -- <https://github.com/ahmedkhalf/project.nvim/pull/89> -- use { -- <https://github.com/ahmedkhalf/project.nvim/pull/89>
'https://github.com/tastytea/project.nvim', -- 'https://github.com/tastytea/project.nvim',
branch = 'fallback_current_dir' } -- branch = 'fallback_current_dir' }
use { use {
'https://github.com/mfussenegger/nvim-dap', 'https://github.com/mfussenegger/nvim-dap',
tag = '*' tag = '*'

View File

@ -3,7 +3,7 @@ require('which-key').setup({})
local map = require('my.functions').map local map = require('my.functions').map
local telescope = require('telescope') local telescope = require('telescope')
local t_actions = require('telescope.actions') local t_actions = require('telescope.actions')
telescope.load_extension('projects') -- telescope.load_extension('projects')
telescope.load_extension('dap') telescope.load_extension('dap')
telescope.load_extension('fzf') telescope.load_extension('fzf')
@ -43,7 +43,7 @@ map('n', '<Leader>tm', t_builtin.man_pages, 'Man pages')
map('n', '<Leader>tr', t_builtin.registers, 'Registers') map('n', '<Leader>tr', t_builtin.registers, 'Registers')
map('n', '<Leader>gh', t_builtin.git_bcommits, 'History of this file') map('n', '<Leader>gh', t_builtin.git_bcommits, 'History of this file')
map('n', '<F7>', t_builtin.diagnostics, 'Show diagnostics') map('n', '<F7>', t_builtin.diagnostics, 'Show diagnostics')
map('n', '<Leader>tp', telescope.extensions.projects.projects, 'Projects') -- map('n', '<Leader>tp', telescope.extensions.projects.projects, 'Projects')
map('n', '<Leader>tt', map('n', '<Leader>tt',
require("telescope._extensions.todo-comments").exports.todo, require("telescope._extensions.todo-comments").exports.todo,
'Display TODO comments in project') 'Display TODO comments in project')