update
This commit is contained in:
parent
21d788c46e
commit
b1967bc6a1
2
LOG.md
2
LOG.md
|
|
@ -30,6 +30,8 @@ Record every decision here with a short rationale. Append new entries; do not re
|
|||
- netrw for tree view and preview splits; Oil for operations that would break buffer names
|
||||
- PHP `gf` enhancement via `includeexpr` for WordPress/PHP path resolution
|
||||
- **Working directory locked to project root**: Disabled `autochdir`, set `netrw_keepdir = 1`, captured initial cwd in `vim.g.project_root`, configured Telescope to always search from project root regardless of current buffer
|
||||
- 2026-07-06: **Alternate-buffer netrw skip**: Added a lightweight real-file buffer tracker and mapped `<C-6>`/`<C-^>` so alternate-buffer jumps skip netrw explorer buffers when `#` points at netrw. Netrw buffers are also marked unlisted on FileType to reduce their impact on buffer navigation while preserving netrw browsing behavior. Fallback uses explicit `:buffer #` instead of `:normal! <C-^>` so regular alternate-file switching still works from the Lua mapping.
|
||||
- 2026-07-07: **Netrw alternate detection fix**: Real netrw alternate buffers can lose `filetype=netrw` and remain as an unlisted `NetrwTreeListing` buffer. The alternate-buffer skip now detects that buffer name as netrw so `<C-6>` returns to the previous real file instead of reopening an empty explorer buffer.
|
||||
- 2025-12-07: Treesitter Phase 5 decisions:
|
||||
- Focus on core languages: PHP, HTML, JavaScript, TypeScript, CSS, Markdown, Lua, Bash, JSON
|
||||
- Enable syntax highlighting with performance safeguard (disable for files >100KB)
|
||||
|
|
|
|||
|
|
@ -481,6 +481,7 @@ Source of truth for the step-by-step rebuild. Keep this concise and up to date.
|
|||
- [ ] Validate netrw browsing and preview splits
|
||||
- [ ] Validate Oil.nvim file operations
|
||||
- [x] Fix working directory behavior (disabled autochdir, locked Telescope to project root)
|
||||
- [x] Make alternate-buffer jumps skip netrw explorer buffers when returning to the last real file
|
||||
|
||||
## Phase 12.5 — Language tooling validation
|
||||
- [ ] Validate HTML/PHP/JS/Markdown tooling
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ Core keymaps available globally (not plugin-specific). These provide fallbacks f
|
|||
| n | `<leader>nt` | Open netrw in new tab at current file's directory |
|
||||
| n | `<leader>nT` | Open netrw in new tab at project root |
|
||||
| n | `<leader>nr` | Open netrw in current window at project root |
|
||||
| n | `<C-6>` / `<C-^>` | Jump to alternate file, skipping netrw explorer buffers |
|
||||
|
||||
**Note:** Project root is stored as the initial working directory when Neovim starts. This allows navigation back to the project root even after following symlinks to external directories.
|
||||
|
||||
|
|
@ -504,4 +505,4 @@ The working directory (`:pwd`) is locked to the directory where you opened Neovi
|
|||
- `netrw_keepdir = 1` prevents netrw from changing directory when browsing
|
||||
- Project root is captured at startup in `vim.g.project_root` (used by Telescope and netrw)
|
||||
- Telescope searches from the initial project root regardless of current buffer
|
||||
- Use `:cd <path>` to manually change directory if needed (affects Telescope search scope)
|
||||
- Use `:cd <path>` to manually change directory if needed (affects Telescope search scope)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,46 @@
|
|||
local map = vim.keymap.set
|
||||
local last_file_buf
|
||||
local previous_file_buf
|
||||
|
||||
local function is_real_file_buffer(buf)
|
||||
return vim.api.nvim_buf_is_valid(buf)
|
||||
and vim.bo[buf].buflisted
|
||||
and vim.bo[buf].buftype == ''
|
||||
and vim.bo[buf].filetype ~= 'netrw'
|
||||
and vim.api.nvim_buf_get_name(buf) ~= ''
|
||||
end
|
||||
|
||||
local function is_netrw_buffer(buf)
|
||||
if not vim.api.nvim_buf_is_valid(buf) then
|
||||
return false
|
||||
end
|
||||
|
||||
return vim.bo[buf].filetype == 'netrw' or vim.api.nvim_buf_get_name(buf):match('NetrwTreeListing$') ~= nil
|
||||
end
|
||||
|
||||
local function switch_to_buffer(buf)
|
||||
vim.cmd('buffer ' .. buf)
|
||||
end
|
||||
|
||||
local function switch_to_native_alternate()
|
||||
pcall(vim.cmd, 'buffer #')
|
||||
end
|
||||
|
||||
local function jump_to_alternate_file()
|
||||
local alternate = vim.fn.bufnr('#')
|
||||
|
||||
if is_real_file_buffer(alternate) then
|
||||
switch_to_buffer(alternate)
|
||||
return
|
||||
end
|
||||
|
||||
if is_netrw_buffer(alternate) and is_real_file_buffer(previous_file_buf) then
|
||||
switch_to_buffer(previous_file_buf)
|
||||
return
|
||||
end
|
||||
|
||||
switch_to_native_alternate()
|
||||
end
|
||||
|
||||
-- Netrw configuration for file browsing
|
||||
-- Native Neovim file explorer (no plugins required)
|
||||
|
|
@ -56,10 +98,28 @@ end, { desc = 'Netrw: Tab at project root', silent = true })
|
|||
map('n', '<leader>nr', function()
|
||||
vim.cmd('Explore ' .. vim.fn.fnameescape(vim.g.project_root))
|
||||
end, { desc = 'Netrw: Open at project root', silent = true })
|
||||
|
||||
map('n', '<C-6>', jump_to_alternate_file, { desc = 'Buffer: Alternate file skipping netrw', silent = true })
|
||||
map('n', '<C-^>', jump_to_alternate_file, { desc = 'Buffer: Alternate file skipping netrw', silent = true })
|
||||
|
||||
vim.api.nvim_create_autocmd('BufEnter', {
|
||||
desc = 'Track recent real file buffers for alternate-buffer jumps',
|
||||
callback = function(args)
|
||||
local buf = args.buf
|
||||
|
||||
if is_real_file_buffer(buf) and buf ~= last_file_buf then
|
||||
previous_file_buf = last_file_buf
|
||||
last_file_buf = buf
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Enable line numbers in netrw buffers
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'netrw',
|
||||
desc = 'Configure netrw buffer-local options',
|
||||
callback = function()
|
||||
vim.bo.buflisted = false
|
||||
vim.opt_local.number = true
|
||||
vim.opt_local.relativenumber = true
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -93,6 +93,10 @@ return {
|
|||
configure("bashls")
|
||||
configure("marksman")
|
||||
configure("intelephense", {
|
||||
init_options = {
|
||||
storagePath = vim.fn.stdpath("cache") .. "/intelephense",
|
||||
globalStoragePath = vim.fn.stdpath("data") .. "/intelephense",
|
||||
},
|
||||
single_file_support = false,
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -813,3 +813,23 @@ Jax
|
|||
APA
|
||||
RIS
|
||||
mathjax
|
||||
wp
|
||||
Imagick
|
||||
Gipitty
|
||||
sudo
|
||||
render_box_row
|
||||
microservices
|
||||
Saa
|
||||
tradeoffs
|
||||
deduplication
|
||||
signoff
|
||||
wireframing
|
||||
LOA
|
||||
max
|
||||
Nau
|
||||
hardcode
|
||||
NauSYS
|
||||
rdv
|
||||
Marmaris
|
||||
EL2
|
||||
RigPro
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue