From e72a9544538e4ec10802df6c9d1a83672c5aa595 Mon Sep 17 00:00:00 2001 From: Henrik Bakken Date: Mon, 19 Oct 2026 12:30:00 +0200 Subject: [PATCH] nvim ftplugin bugfixes --- CONFIG/nvim/after/ftplugin/javascript.lua | 9 --------- CONFIG/nvim/after/ftplugin/lua.lua | 11 ++--------- CONFIG/nvim/after/ftplugin/python.lua | 8 -------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/CONFIG/nvim/after/ftplugin/javascript.lua b/CONFIG/nvim/after/ftplugin/javascript.lua index 5f3e201..6ed7f86 100644 --- a/CONFIG/nvim/after/ftplugin/javascript.lua +++ b/CONFIG/nvim/after/ftplugin/javascript.lua @@ -1,6 +1,3 @@ -local bufname = vim.api.nvim_buf_get_name(0) -local filename_arg = bufname ~= "" and (" --stdin-filepath " .. vim.fn.shellescape(bufname)) or "" - -- Indentation & Layout vim.opt_local.colorcolumn = "100" vim.opt_local.textwidth = 100 @@ -12,9 +9,3 @@ vim.opt_local.expandtab = true -- Formatting Behavior vim.opt_local.formatoptions:remove("t") -- Don't autowrap while typing vim.opt_local.formatoptions:append("j") -- Remove comment markers when joining lines - --- gq Formatters (Prettier fallback, LSP primary) --- Prefers local/global binary first to avoid slow npx invocation overhead -local prettier_bin = vim.fn.executable("prettier") == 1 and "prettier" or "npx prettier" -vim.bo.formatprg = prettier_bin .. filename_arg -vim.bo.formatexpr = "v:lua.vim.lsp.formatexpr()" diff --git a/CONFIG/nvim/after/ftplugin/lua.lua b/CONFIG/nvim/after/ftplugin/lua.lua index b634210..3317d6e 100644 --- a/CONFIG/nvim/after/ftplugin/lua.lua +++ b/CONFIG/nvim/after/ftplugin/lua.lua @@ -1,6 +1,3 @@ -local bufname = vim.api.nvim_buf_get_name(0) -local filename_arg = bufname ~= "" and ("--stdin-filepath " .. vim.fn.shellescape(bufname) .. " ") or "" - -- Indentation & Layout vim.opt_local.colorcolumn = "120" vim.opt_local.textwidth = 120 @@ -10,9 +7,5 @@ vim.opt_local.softtabstop = 4 vim.opt_local.expandtab = true -- Formatting Behavior -vim.opt_local.formatoptions:remove("t") -vim.opt_local.formatoptions:append("j") - --- gq Formatters (StyLua fallback, LSP primary) -vim.bo.formatprg = "stylua " .. filename_arg .. "-" -vim.bo.formatexpr = "v:lua.vim.lsp.formatexpr()" +vim.opt_local.formatoptions:remove("t") -- Don't autowrap while typing +vim.opt_local.formatoptions:append("j") -- Remove comment markers when joining lines diff --git a/CONFIG/nvim/after/ftplugin/python.lua b/CONFIG/nvim/after/ftplugin/python.lua index acd57a1..6ed7f86 100644 --- a/CONFIG/nvim/after/ftplugin/python.lua +++ b/CONFIG/nvim/after/ftplugin/python.lua @@ -1,6 +1,3 @@ -local bufname = vim.api.nvim_buf_get_name(0) -local filename_arg = bufname ~= "" and ("--stdin-filename " .. vim.fn.shellescape(bufname) .. " ") or "" - -- Indentation & Layout vim.opt_local.colorcolumn = "100" vim.opt_local.textwidth = 100 @@ -12,8 +9,3 @@ vim.opt_local.expandtab = true -- Formatting Behavior vim.opt_local.formatoptions:remove("t") -- Don't autowrap while typing vim.opt_local.formatoptions:append("j") -- Remove comment markers when joining lines - --- gq Formatters (Ruff fallback, LSP primary) --- The trailing '-' is required for Ruff to read from stdin -vim.bo.formatprg = "ruff format " .. filename_arg .. "-" -vim.bo.formatexpr = "v:lua.vim.lsp.formatexpr()"