From 27ce53153128a2c8f40c079e617ab9cff122f44d Mon Sep 17 00:00:00 2001 From: iofq Date: Sat, 4 Oct 2025 03:50:17 -0500 Subject: [PATCH] random cleanups --- nix/neovim-overlay.nix | 5 +---- nvim/init.lua | 1 - nvim/lsp/lua_ls.lua | 3 --- nvim/lua/config/init.lua | 1 + nvim/lua/plugins/lib/session_jj.lua | 4 ++-- nvim/lua/plugins/lib/snacks_jj.lua | 16 +++++----------- nvim/lua/plugins/lsp.lua | 21 ++++----------------- nvim/lua/plugins/mini.lua | 8 +------- nvim/lua/plugins/snacks.lua | 8 -------- 9 files changed, 14 insertions(+), 53 deletions(-) diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index d79bef6..7a5074e 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -40,11 +40,8 @@ let # LSPs gopls lua-language-server - nil + nixd basedpyright - - #other - jujutsu ]; in { diff --git a/nvim/init.lua b/nvim/init.lua index 622287b..43d1b43 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -28,7 +28,6 @@ if not LAZY_OPTS then }, } end -vim.cmd('packadd cfilter') vim.cmd('colorscheme iofq') require('lazy').setup(LAZY_OPTS) require('config') diff --git a/nvim/lsp/lua_ls.lua b/nvim/lsp/lua_ls.lua index 4be10e8..f71f2bd 100644 --- a/nvim/lsp/lua_ls.lua +++ b/nvim/lsp/lua_ls.lua @@ -19,9 +19,6 @@ return { end, settings = { Lua = { - codeLens = { - enable = true, - }, hint = { enable = true, arrayIndex = 'Enable', diff --git a/nvim/lua/config/init.lua b/nvim/lua/config/init.lua index f9ba85f..4ba1b24 100644 --- a/nvim/lua/config/init.lua +++ b/nvim/lua/config/init.lua @@ -1,6 +1,7 @@ vim.opt.autowrite = true vim.opt.backspace = 'indent,eol,start' vim.opt.confirm = true +vim.opt.completeopt = "menuone,popup,noselect,fuzzy" vim.opt.diffopt = 'internal,filler,closeoff,inline:char' vim.opt.expandtab = true -- insert tabs as spaces vim.opt.inccommand = 'split' -- incremental live completion diff --git a/nvim/lua/plugins/lib/session_jj.lua b/nvim/lua/plugins/lib/session_jj.lua index ac21e3c..c411d45 100644 --- a/nvim/lua/plugins/lib/session_jj.lua +++ b/nvim/lua/plugins/lib/session_jj.lua @@ -7,7 +7,7 @@ M.setup = function() end vim.keymap.set('n', 'fs', function() - require('plugins.lib.session_jj').load() + M.load() end, { noremap = true, desc = 'mini session select' }) end @@ -50,7 +50,6 @@ M.load = function() if id == '' then return end - vim.opt.shadafile = vim.fn.stdpath('data') .. '/myshada/' .. id .. '.shada' if M.check_exists(id) then vim.ui.select({ 'Yes', @@ -58,6 +57,7 @@ M.load = function() }, { prompt = 'Session found at ' .. id .. ', load it?' }, function(c) if c == 'Yes' then -- load session (buffers, etc) as well as shada (marks) + vim.opt.shadafile = vim.fn.stdpath('data') .. '/myshada/' .. id .. '.shada' MiniSessions.read(id) vim.notify('loaded jj session: ' .. id) end diff --git a/nvim/lua/plugins/lib/snacks_jj.lua b/nvim/lua/plugins/lib/snacks_jj.lua index cee860f..639ecfd 100644 --- a/nvim/lua/plugins/lib/snacks_jj.lua +++ b/nvim/lua/plugins/lib/snacks_jj.lua @@ -6,11 +6,9 @@ function M.status() local files = {} for status in status_raw:gmatch('[^\r\n]+') do - local state, text = string.match(status, '^(%a)%s(.+)$') - - if state and text then - local file = text + local state, file = string.match(status, '^(%a)%s(.+)$') + if state and file then local hl = '' if state == 'A' then hl = 'SnacksPickerGitStatusAdded' @@ -20,15 +18,13 @@ function M.status() hl = 'SnacksPickerGitStatusDeleted' elseif state == 'R' then hl = 'SnacksPickerGitStatusRenamed' - file = string.match(text, '{.-=>%s*(.-)}') + file = string.match(file, '{.-=>%s*(.-)}') end - local diff = vim.fn.system('jj diff ' .. file .. ' --ignore-working-copy --no-pager --stat --git') + local diff = vim.fn.system('jj diff ' .. file .. ' --no-pager --stat --git') table.insert(files, { - text = text, file = file, filename_hl = hl, - state = state, diff = diff, }) end @@ -37,11 +33,9 @@ function M.status() return files end - local files = get_files() - Snacks.picker.pick { source = 'jj_status', - items = files, + items = get_files(), format = 'file', title = 'jj status', preview = function(ctx) diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 432aac4..ae902b2 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -4,7 +4,7 @@ return { event = 'VeryLazy', config = function() vim.lsp.enable { - 'nil_ls', + 'nixd', 'phpactor', 'gopls', 'lua_ls', @@ -34,27 +34,18 @@ return { vim.diagnostic.setqflist() end, { buffer = ev.buf, desc = 'LSP diagnostics' }) - vim.keymap.set('n', 'grc', function() - vim.lsp.buf.incoming_calls() - end, { buffer = ev.buf, desc = 'LSP incoming_calls' }) - vim.keymap.set('n', 'gro', function() - vim.lsp.buf.outgoing_calls() - end, { buffer = ev.buf, desc = 'LSP outgoing_calls' }) - -- Auto-refresh code lenses if client:supports_method('textDocument/codeLens') or client.server_capabilities.codeLensProvider then + vim.lsp.codelens.refresh { bufnr = ev.buf } vim.api.nvim_create_autocmd({ 'InsertLeave', 'TextChanged' }, { - group = vim.api.nvim_create_augroup(string.format('lsp-%s-%s', ev.buf, client.id), {}), callback = function() vim.lsp.codelens.refresh { bufnr = ev.buf } end, buffer = ev.buf, }) - vim.lsp.codelens.refresh() end end, }) - vim.api.nvim_exec_autocmds('FileType', {}) end, }, { @@ -65,7 +56,7 @@ return { '\\f', function() vim.b.disable_autoformat = not vim.b.disable_autoformat - Snacks.notify(string.format('Buffer formatting disabled: %s', vim.b.disable_autoformat)) + vim.notify(string.format('Buffer formatting disabled: %s', vim.b.disable_autoformat)) end, mode = { 'n', 'x' }, desc = 'toggle buffer formatting', @@ -74,7 +65,7 @@ return { '\\F', function() vim.g.disable_autoformat = not vim.g.disable_autoformat - Snacks.notify(string.format('Global formatting disabled: %s', vim.g.disable_autoformat)) + vim.notify(string.format('Global formatting disabled: %s', vim.g.disable_autoformat)) end, mode = { 'n', 'x' }, desc = 'toggle global formatting', @@ -97,10 +88,6 @@ return { end return { timeout_ms = 1500, lsp_format = 'fallback' } end, - default_format_opts = { - timeout_ms = 1500, - lsp_format = 'fallback', - }, }, }, { diff --git a/nvim/lua/plugins/mini.lua b/nvim/lua/plugins/mini.lua index a0b78ff..e64b55f 100644 --- a/nvim/lua/plugins/mini.lua +++ b/nvim/lua/plugins/mini.lua @@ -71,7 +71,6 @@ return { local diff = require('mini.diff') diff.setup { - options = { wrap_goto = true }, source = { require('plugins.lib.minidiff_jj').gen_source(), diff.gen_source.git(), @@ -109,7 +108,6 @@ return { }, windows = { preview = true, - width_focus = 30, width_preview = 50, }, } @@ -120,12 +118,8 @@ return { vim.api.nvim_create_autocmd('User', { pattern = 'MiniFilesBufferCreate', callback = function(args) - vim.keymap.set('n', 'nc', function() - files.synchronize() - files.close() - end, { buffer = args.data.buf_id }) vim.keymap.set('n', '`', function() - local cur_entry_path = MiniFiles.get_fs_entry().path + local _, cur_entry_path = pcall(MiniFiles.get_fs_entry().path) local cur_directory = vim.fs.dirname(cur_entry_path) if cur_directory ~= '' then vim.fn.chdir(cur_directory) diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua index 1fc4baa..952cd00 100644 --- a/nvim/lua/plugins/snacks.lua +++ b/nvim/lua/plugins/snacks.lua @@ -68,14 +68,6 @@ return { mode = { 'n', 't' }, desc = 'terminal open', }, - { - '', - function() - Snacks.terminal.toggle('command -v fish >/dev/null && exec fish || exec bash') - end, - mode = { 'n', 't' }, - desc = 'terminal open', - }, { '', function()