fix working directory issues
This commit is contained in:
parent
6aeb4ae913
commit
4e9e22da00
6 changed files with 21 additions and 1 deletions
|
|
@ -20,7 +20,9 @@ vim.g.netrw_alto = 0
|
|||
-- 50% split when pressing 'p'
|
||||
vim.g.netrw_winsize = 50
|
||||
|
||||
vim.g.netrw_keepdir = 0
|
||||
-- Keep working directory unchanged when browsing (1 = don't change directory)
|
||||
-- Setting to 1 prevents netrw from changing vim's working directory
|
||||
vim.g.netrw_keepdir = 1
|
||||
|
||||
-- Open files in the same window (replace netrw buffer)
|
||||
-- Options: 0=same window, 1=horizontal split, 2=vertical split, 3=new tab, 4=previous window
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ return {
|
|||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
-- Always search from project root (where Neovim was opened)
|
||||
cwd = vim.g.project_root,
|
||||
|
||||
-- Minimal UI, keep it clean
|
||||
prompt_prefix = '> ',
|
||||
selection_caret = '> ',
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ vim.g.loaded_node_provider = 0
|
|||
-- Used by netrw navigation to return to project root after following symlinks
|
||||
vim.g.project_root = vim.fn.getcwd()
|
||||
|
||||
-- Prevent automatic directory changes when switching files
|
||||
vim.opt.autochdir = false -- Keep working directory at project root
|
||||
|
||||
-- Enable project-local configuration files
|
||||
vim.opt.exrc = true -- Load .nvim.lua from project root
|
||||
vim.opt.secure = true -- Prompt before loading untrusted files
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue