From 953e5b7d5cf0ca68a648ebef0d42fbaf80c6d80b Mon Sep 17 00:00:00 2001 From: "Paul B. Kim" Date: Tue, 3 Mar 2026 07:39:44 +0900 Subject: [PATCH] =?UTF-8?q?feat(lsp):=20add=20file=20rename=20=E2=86=92=20?= =?UTF-8?q?import=20update=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Switch pyright to basedpyright (willRenameFiles capability) - Add nvim-lsp-file-operations for neo-tree rename → LSP updates - Add Snacks.rename with cR for current-buffer file renames - Harden oil.nvim with lsp_file_methods (2s timeout, autosave unmodified) --- init.lua | 9 ++++----- lua/custom/plugins/lsp_file_operations.lua | 13 +++++++++++++ lua/custom/plugins/oil.lua | 5 +++++ lua/custom/plugins/opencode.lua | 8 +++++++- 4 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 lua/custom/plugins/lsp_file_operations.lua diff --git a/init.lua b/init.lua index f99a9895..47fd96b3 100644 --- a/init.lua +++ b/init.lua @@ -749,13 +749,12 @@ require('lazy').setup({ }, }, }, - pyright = { + basedpyright = { settings = { - python = { + basedpyright = { analysis = { - typeCheckingMode = 'basic', - autoSearchPaths = true, - useLibraryCodeForTypes = true, + typeCheckingMode = 'standard', + diagnosticMode = 'openFilesOnly', }, }, }, diff --git a/lua/custom/plugins/lsp_file_operations.lua b/lua/custom/plugins/lsp_file_operations.lua new file mode 100644 index 00000000..3f27b8ee --- /dev/null +++ b/lua/custom/plugins/lsp_file_operations.lua @@ -0,0 +1,13 @@ +return { + 'antosha417/nvim-lsp-file-operations', + dependencies = { 'nvim-neo-tree/neo-tree.nvim' }, + config = function() + require('lsp-file-operations').setup() + + -- Advertise file operation capabilities to all LSP servers + local file_ops_caps = require('lsp-file-operations').default_capabilities() + vim.lsp.config('*', { + capabilities = file_ops_caps, + }) + end, +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index 8a6d6767..c4fb1abd 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -10,5 +10,10 @@ return { view_options = { show_hidden = true, }, + lsp_file_methods = { + enabled = true, + timeout_ms = 2000, + autosave_changes = 'unmodified', + }, }, } diff --git a/lua/custom/plugins/opencode.lua b/lua/custom/plugins/opencode.lua index 90f51414..56c1346d 100644 --- a/lua/custom/plugins/opencode.lua +++ b/lua/custom/plugins/opencode.lua @@ -4,7 +4,13 @@ return { -- Recommended for `ask()` and `select()`. -- Required for `snacks` provider. ---@module 'snacks' <- Loads `snacks.nvim` types for configuration intellisense. - { 'folke/snacks.nvim', opts = { input = {}, picker = {}, terminal = {} } }, + { + 'folke/snacks.nvim', + opts = { input = {}, picker = {}, terminal = {}, rename = {} }, + keys = { + { 'cR', function() Snacks.rename.rename_file() end, desc = 'Rename File (LSP)' }, + }, + }, }, config = function() local function redact_sensitive(value)