From 83f1e0c977ddcc98192b72fad1745db6c3582e6d Mon Sep 17 00:00:00 2001 From: Ivar Fatland Date: Wed, 1 Apr 2026 13:36:23 +0200 Subject: [PATCH] remove specific makeprg per filetype and instead use just just is a fine generic command runner, and cross-platform. --- nvim/.config/nvim/init.lua | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 5b73ec8..ab5e5ad 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -27,6 +27,7 @@ vim.cmd [[ set noswapfile set list set ignorecase + set makeprg=just nnoremap ,co :copen nnoremap ,cc :cclose @@ -171,47 +172,25 @@ local file_specific = { lua = function () end, go = function() - vim.bo.makeprg = 'go' end, c = function() - if not has_makefile() then - vim.bo.makeprg = 'tcc -run %' - end vim.bo.expandtab = false end, cs = function() - vim.bo.makeprg = "dotnet" vim.bo.errorformat = "%f(%l\\,%c):\\ %t%*[^:]:\\ %m" vim.bo.errorformat = vim.bo.errorformat .. ",%\\s%#at\\ %m\\ in\\ %f:line\\ %l" end, - python = function() - vim.bo.makeprg = 'basedpyright' - end, - swift = function() - vim.bo.makeprg = 'swift' - end, tsv = function() vim.bo.tabstop = 32 vim.bo.expandtab = false end, odin = function() vim.bo.expandtab = false - vim.bo.makeprg = 'odin run .' end } vim.api.nvim_create_autocmd('BufEnter', { callback = function() - do - local line = vim.api.nvim_buf_get_lines(0, 0, 1, false)[1] - if line then - local first_two = line:sub(1, 2) - if first_two == '#!' then - vim.bo.makeprg = './%' - return - end - end - end local conf = file_specific[vim.bo.filetype] if conf then conf() end end,