From f1a0c48d9805e61b8c73d5fdb919aa1b53f104ea Mon Sep 17 00:00:00 2001 From: t0xa Date: Sun, 22 Feb 2026 15:44:31 +0300 Subject: [PATCH] Draft: Trying to make a compiler for ivlint --- compiler/mypy.vim | 6 ++++++ lua/custom/compilers/mypy.lua | 12 ++++++++++++ lua/custom/trouble.lua | 8 ++++++++ 3 files changed, 26 insertions(+) create mode 100644 compiler/mypy.vim create mode 100644 lua/custom/compilers/mypy.lua diff --git a/compiler/mypy.vim b/compiler/mypy.vim new file mode 100644 index 0000000..b8fb241 --- /dev/null +++ b/compiler/mypy.vim @@ -0,0 +1,6 @@ +if exists("current_compiler") + finish +endif +let current_compiler = "mypy" + +lua require("custom.compilers.mypy").setup() diff --git a/lua/custom/compilers/mypy.lua b/lua/custom/compilers/mypy.lua new file mode 100644 index 0000000..1ddb2db --- /dev/null +++ b/lua/custom/compilers/mypy.lua @@ -0,0 +1,12 @@ +local M = {} + +function M.setup() + vim.opt_local.makeprg = "mypy ." + vim.opt_local.errorformat = table.concat({ + "%f:%l:%c:%t%*[^:]: %m", + "%f:%l:%t%*[^:]: %m", + "%f:%l: %m", + }, ",") +end + +return M diff --git a/lua/custom/trouble.lua b/lua/custom/trouble.lua index 6a3899b..3854da9 100644 --- a/lua/custom/trouble.lua +++ b/lua/custom/trouble.lua @@ -28,3 +28,11 @@ if ok then }, }) end + +-- For fzf-lua settings +local ok_fzf, fzf_lua_config = pcall(require, "fzf-lua.config") +if ok_fzf then + local actions = require("trouble.sources.fzf").actions + fzf_lua_config.defaults.actions.files["ctrl-t"] = actions.open +end +