oil.nvim configured
This commit is contained in:
parent
02df315571
commit
443364e23e
|
|
@ -143,10 +143,16 @@ Source of truth for the step-by-step rebuild. Keep this concise and up to date.
|
|||
- [x] Minimal UI: dropdown theme for files/buffers, no previewer for quick selection
|
||||
|
||||
## Phase 4.4 — Oil.nvim for file manipulation
|
||||
- [ ] Add `stevearc/oil.nvim` for filesystem operations (rename, create, delete, copy, move)
|
||||
- [ ] Configure to handle buffer name sync on file operations
|
||||
- [ ] Keep minimal - use only when shell operations would cause buffer issues
|
||||
- [ ] Note: Evaluate practicality; can switch to `mini.files` if preferred
|
||||
- [x] Add `stevearc/oil.nvim` for filesystem operations (rename, create, delete, copy, move)
|
||||
- [x] Configure to handle buffer name sync on file operations
|
||||
- [x] Keep minimal - use only when shell operations would cause buffer issues
|
||||
- [x] Keymaps configured:
|
||||
- `<leader>fo` - Open Oil file browser (regular buffer)
|
||||
- `<leader>fO` - Open Oil in floating window (with floating previews)
|
||||
- `<C-p>` in Oil - Preview files (vertical split to right for regular, floating window for float mode)
|
||||
- [x] Preview splits open to the right via `vertical = true` and `split = 'belowright'`
|
||||
- [x] Floating window preview direction: `preview_split = "right"`
|
||||
- [x] Note: Evaluate practicality; can switch to `mini.files` if preferred
|
||||
|
||||
## Phase 5 — Treesitter
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,12 @@ Record every decision here with a short rationale. Append new entries; do not re
|
|||
- 2025-12-06: Plugin approval policy — other plugins are allowed, but do not install any plugin not listed without explicit confirmation.
|
||||
- 2025-12-07: **CRITICAL REGRESSION FIX**: Neovim 0.11+ does NOT support `on_new_config` callback in `vim.lsp.config()`. Project-local settings (`.nvim.lua`) must be loaded via `LspAttach` autocmd instead. The `on_new_config` hook was silently ignored, causing empty settings and breaking goto-definition for external includes. Solution: Use `LspAttach` to load project settings, merge into `client.settings`, and send `workspace/didChangeConfiguration` notification.
|
||||
- 2025-12-07: Native `exrc` + `.nvim.lua` finalized as project-local config approach (replaces neoconf, which is incompatible with Neovim 0.11+ native LSP API). Security via `vim.opt.secure = true`.
|
||||
- 2025-12-07: Navigation Phase 4 decisions:
|
||||
- Skip Neo-tree in favor of netrw for project visualization
|
||||
- Use Telescope as primary "find file" tool with fuzzy finding
|
||||
- Add Oil.nvim for file manipulation (rename/move/delete with buffer sync)
|
||||
- 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
|
||||
|
||||
## Project-Local Configuration (design)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9c923997123ff9071198ea3b594d4c1931fab169" },
|
||||
"oil.nvim": { "branch": "master", "commit": "cbcb3f997f6f261c577b943ec94e4ef55108dd95" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,115 @@
|
|||
-- Oil.nvim: file manipulation with buffer sync
|
||||
-- Handles rename/move/delete operations that would break buffer names
|
||||
-- Use when shell operations would cause buffer issues
|
||||
|
||||
return {
|
||||
'stevearc/oil.nvim',
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ '<leader>fo', '<cmd>Oil<cr>', desc = 'Open Oil file browser' },
|
||||
{ '<leader>fO', '<cmd>Oil --float<cr>', desc = 'Open Oil in floating window' },
|
||||
},
|
||||
opts = {
|
||||
-- Columns shown in the oil buffer
|
||||
columns = {
|
||||
'icon',
|
||||
-- 'permissions',
|
||||
-- 'size',
|
||||
-- 'mtime',
|
||||
},
|
||||
-- Buffer-local options to use for oil buffers
|
||||
buf_options = {
|
||||
buflisted = false,
|
||||
bufhidden = 'hide',
|
||||
},
|
||||
-- Window-local options to use for oil buffers
|
||||
win_options = {
|
||||
wrap = false,
|
||||
signcolumn = 'no',
|
||||
cursorcolumn = false,
|
||||
foldcolumn = '0',
|
||||
spell = false,
|
||||
list = false,
|
||||
conceallevel = 3,
|
||||
concealcursor = 'nvic',
|
||||
},
|
||||
-- Delete to trash instead of permanently deleting
|
||||
delete_to_trash = false,
|
||||
-- Skip confirmation for simple operations
|
||||
skip_confirm_for_simple_edits = false,
|
||||
-- Prompt before deleting a directory
|
||||
prompt_save_on_select_new_entry = true,
|
||||
-- Use default keymaps (see :help oil-actions)
|
||||
use_default_keymaps = true,
|
||||
-- Set to false to disable all of the above keymaps
|
||||
keymaps = {
|
||||
['g?'] = 'actions.show_help',
|
||||
['<CR>'] = 'actions.select',
|
||||
['<C-s>'] = 'actions.select_vsplit',
|
||||
['<C-h>'] = 'actions.select_split',
|
||||
['<C-t>'] = 'actions.select_tab',
|
||||
-- Preview opens to the right via vertical split
|
||||
['<C-p>'] = {
|
||||
'actions.preview',
|
||||
opts = { vertical = true, split = 'belowright' },
|
||||
},
|
||||
['<C-c>'] = 'actions.close',
|
||||
['<C-l>'] = 'actions.refresh',
|
||||
['-'] = 'actions.parent',
|
||||
['_'] = 'actions.open_cwd',
|
||||
['`'] = 'actions.cd',
|
||||
['~'] = 'actions.tcd',
|
||||
['gs'] = 'actions.change_sort',
|
||||
['gx'] = 'actions.open_external',
|
||||
['g.'] = 'actions.toggle_hidden',
|
||||
['g\\'] = 'actions.toggle_trash',
|
||||
},
|
||||
-- Configuration for the floating window in oil.open_float
|
||||
float = {
|
||||
-- Padding around the floating window
|
||||
padding = 2,
|
||||
max_width = 0,
|
||||
max_height = 0,
|
||||
border = 'rounded',
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
-- Preview split direction for floating Oil windows
|
||||
preview_split = "right",
|
||||
},
|
||||
-- Configuration for the actions floating preview window
|
||||
preview = {
|
||||
-- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
max_width = 0.9,
|
||||
-- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
|
||||
min_width = { 40, 0.4 },
|
||||
-- optionally define an integer/float for the exact width of the preview window
|
||||
width = nil,
|
||||
-- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
max_height = 0.9,
|
||||
min_height = { 5, 0.1 },
|
||||
height = nil,
|
||||
border = 'rounded',
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
-- Preview split direction: "auto" (floating), "left", "right", "above", "below"
|
||||
-- This setting is deprecated; use keymap opts or float.preview_split instead
|
||||
-- preview_split = "right",
|
||||
-- Configuration for the floating progress window
|
||||
progress = {
|
||||
max_width = 0.9,
|
||||
min_width = { 40, 0.4 },
|
||||
width = nil,
|
||||
max_height = { 10, 0.9 },
|
||||
min_height = { 5, 0.1 },
|
||||
height = nil,
|
||||
border = 'rounded',
|
||||
minimized_border = 'none',
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Reference in New Issue