Skip to content

Commit 27c7fdb

Browse files
committed
Improve nvim-tree file visibility and add ripgrep dependency
- Fix nvim-tree configuration to show all files and folders consistently - Enable auto-refresh on file changes and buffer sync - Add ripgrep package for Telescope live_grep functionality - Add keybindings for file tree navigation and refresh
1 parent b582b38 commit 27c7fdb

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

common/claude-code/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
],
1313
"statusLine": {
1414
"type": "command",
15-
"command": "npx -y ccusage@latest statusline"
15+
"command": "npx -y ccusage@latest statusline --visual-burn-rate emoji",
16+
"padding": 0
1617
},
1718
"feedbackSurveyState": {
1819
"lastShownTime": 1754125509075

common/neovim/init.lua

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ local plugins = {
139139
-- Renderer settings for minimal UI
140140
renderer = {
141141
add_trailing = false,
142-
group_empty = true,
142+
group_empty = false, -- Show all directories, don't group empty ones
143143
highlight_git = true,
144144
full_name = false,
145145
highlight_opened_files = "none",
@@ -189,19 +189,19 @@ local plugins = {
189189
},
190190
},
191191

192-
-- Hide dotfiles but show git files
192+
-- Show all files including dotfiles
193193
filters = {
194-
dotfiles = false,
195-
git_clean = false,
196-
no_buffer = false,
197-
custom = { ".DS_Store", "node_modules", "__pycache__", ".turbo", },
198-
exclude = {},
194+
dotfiles = false, -- Show dotfiles (.env, .gitignore, etc.)
195+
git_clean = false, -- Show git-ignored files
196+
no_buffer = false, -- Show all files regardless of buffer status
197+
custom = { ".DS_Store" }, -- Only hide system files
198+
exclude = {}, -- Don't exclude any patterns
199199
},
200200

201201
-- Git integration
202202
git = {
203203
enable = true,
204-
ignore = true,
204+
ignore = false, -- Show git-ignored files (like .env, build files, etc.)
205205
show_on_dirs = true,
206206
show_on_open_dirs = true,
207207
timeout = 400,
@@ -212,9 +212,10 @@ local plugins = {
212212
enable = false, -- Disable to prevent sign conflicts
213213
},
214214

215-
-- Disable update_focused_file to reduce autocmd overhead
215+
-- Enable file sync to keep tree updated with current buffer
216216
update_focused_file = {
217-
enable = false,
217+
enable = true,
218+
update_root = false, -- Don't change root when following files
218219
},
219220

220221
-- Actions
@@ -327,6 +328,16 @@ local plugins = {
327328
end,
328329
})
329330

331+
-- Auto-refresh nvim-tree when files change
332+
vim.api.nvim_create_autocmd({ "BufWritePost", "FileChangedShellPost" }, {
333+
callback = function()
334+
local api = require("nvim-tree.api")
335+
if api.tree.is_visible() then
336+
api.tree.reload()
337+
end
338+
end,
339+
})
340+
330341
-- Fix nvim-tree sign issues by ensuring all signs are properly defined
331342
vim.api.nvim_create_autocmd("VimEnter", {
332343
callback = function()
@@ -652,6 +663,8 @@ keymap("n", "<leader>:", "<cmd>Telescope commands<cr>", { desc = "Commands" })
652663

653664
-- File explorer
654665
keymap("n", "<leader>e", "<cmd>NvimTreeToggle<cr>", { desc = "Toggle file explorer" })
666+
keymap("n", "<leader>E", "<cmd>NvimTreeFindFile<cr>", { desc = "Find current file in explorer" })
667+
keymap("n", "<leader>r", "<cmd>NvimTreeRefresh<cr>", { desc = "Refresh file explorer" })
655668

656669
-- Buffer management
657670
keymap("n", "<leader>w", "<cmd>w<cr>", { desc = "Save file" })

common/packages.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
gh
1818
direnv
1919
ack
20+
ripgrep # Required for Telescope live_grep
2021
pipx
2122
tmux
2223
reattach-to-user-namespace

0 commit comments

Comments
 (0)