diff --git a/build.zig b/build.zig index ceb7ed381..6f80a8961 100644 --- a/build.zig +++ b/build.zig @@ -630,6 +630,7 @@ pub fn build(b: *std.Build) !void { _ = wf.add("syntax/ghostty.vim", config_vim.syntax); _ = wf.add("ftdetect/ghostty.vim", config_vim.ftdetect); _ = wf.add("ftplugin/ghostty.vim", config_vim.ftplugin); + _ = wf.add("compiler/ghostty.vim", config_vim.compiler); b.installDirectory(.{ .source_dir = wf.getDirectory(), .install_dir = .prefix, @@ -646,6 +647,7 @@ pub fn build(b: *std.Build) !void { _ = wf.add("syntax/ghostty.vim", config_vim.syntax); _ = wf.add("ftdetect/ghostty.vim", config_vim.ftdetect); _ = wf.add("ftplugin/ghostty.vim", config_vim.ftplugin); + _ = wf.add("compiler/ghostty.vim", config_vim.compiler); b.installDirectory(.{ .source_dir = wf.getDirectory(), .install_dir = .prefix, diff --git a/src/config/vim.zig b/src/config/vim.zig index d048fc990..62255bd79 100644 --- a/src/config/vim.zig +++ b/src/config/vim.zig @@ -24,6 +24,21 @@ pub const ftplugin = \\ \\let b:undo_ftplugin = 'setl cms< isk< ofu<' \\ + \\if !exists('current_compiler') + \\ compiler ghostty + \\ let b:undo_ftplugin .= " makeprg< errorformat<" + \\endif + \\ +; +pub const compiler = + \\if exists("current_compiler") + \\ finish + \\endif + \\let current_compiler = "ghostty" + \\ + \\CompilerSet makeprg=ghostty\ +validate-config + \\CompilerSet errorformat=%f:%l:%m + \\ ; /// Generates the syntax file at comptime.