From 22ed68a46ee7b8920eb9ad84655fb22454c01784 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 30 Aug 2025 22:08:02 +0100 Subject: [PATCH] Configure `makeprg` for PHP, AsciiDoc and Go files --- modules/nixvim/ftplugin/asciidoc.nix | 11 +++++++++++ modules/nixvim/ftplugin/go.nix | 9 +++++++++ modules/nixvim/ftplugin/php.nix | 9 +++++++++ modules/nixvim/make.nix | 14 ++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 modules/nixvim/ftplugin/asciidoc.nix create mode 100644 modules/nixvim/ftplugin/go.nix create mode 100644 modules/nixvim/ftplugin/php.nix create mode 100644 modules/nixvim/make.nix diff --git a/modules/nixvim/ftplugin/asciidoc.nix b/modules/nixvim/ftplugin/asciidoc.nix new file mode 100644 index 00000000..08afc452 --- /dev/null +++ b/modules/nixvim/ftplugin/asciidoc.nix @@ -0,0 +1,11 @@ +{ lib, ... }: + +{ + flake.modules.nixvim.custom = + { pkgs, ... }: + { + extraFiles."after/ftplugin/asciidoc.lua".text = '' + vim.opt_local.makeprg = "${lib.getExe pkgs.asciidoctor} %"; + ''; + }; +} diff --git a/modules/nixvim/ftplugin/go.nix b/modules/nixvim/ftplugin/go.nix new file mode 100644 index 00000000..21abe049 --- /dev/null +++ b/modules/nixvim/ftplugin/go.nix @@ -0,0 +1,9 @@ +{ + flake.modules.nixvim.custom = { + extraFiles."after/ftplugin/go.lua".text = + # lua + '' + vim.opt.makeprg = "go run %" + ''; + }; +} diff --git a/modules/nixvim/ftplugin/php.nix b/modules/nixvim/ftplugin/php.nix new file mode 100644 index 00000000..e531157e --- /dev/null +++ b/modules/nixvim/ftplugin/php.nix @@ -0,0 +1,9 @@ +{ + flake.modules.nixvim.custom = { + extraFiles."after/ftplugin/php.lua".text = + # lua + '' + vim.opt_local.makeprg = "php %"; + ''; + }; +} diff --git a/modules/nixvim/make.nix b/modules/nixvim/make.nix new file mode 100644 index 00000000..1a533b9a --- /dev/null +++ b/modules/nixvim/make.nix @@ -0,0 +1,14 @@ +{ + flake.modules.nixvim.custom = + { pkgs, ... }: + { + extraPackages = with pkgs; [ gnumake ]; + + keymaps = [ + { + action = "make"; + key = "r"; + } + ]; + }; +}