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 +