summaryrefslogtreecommitdiffstats
path: root/tv/2configs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-02-02 20:14:29 +0100
committerlassulus <lassulus@lassul.us>2019-02-08 05:19:48 +0100
commit1c4810bd407c8ff992eeffa24d5234fefff4826e (patch)
tree305893d255ba43b85d558757f494f122eac57f6c /tv/2configs
parentcdb548ac3050c2e9f61a07e6f5eff88383e1114c (diff)
tv vim-syntax-nix-nested: add writer{Ext,Name}
Diffstat (limited to 'tv/2configs')
-rw-r--r--tv/2configs/vim.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix
index 3794628c1..9f78d6e0b 100644
--- a/tv/2configs/vim.nix
+++ b/tv/2configs/vim.nix
@@ -250,6 +250,9 @@ let {
def = k: ''${k}[ \t\r\n]*='';
writer = k: ''write${k}[^ \t\r\n]*[ \t\r\n]*\("[^"]*"\|[a-z]\+\)'';
+ writerExt = k: writerName ''[^"]*\.${k}'';
+ writerName = k: ''write[^ \t\r\n]*[ \t\r\n]*"${k}"'';
+
in {
c = {};
cabal = {};
@@ -257,7 +260,7 @@ let {
haskell = {};
jq.extraStart = alts [
(writer "Jq")
- ''write[^ \t\r\n]*[ \t\r\n]*"[^"]*\.jq"''
+ (writerExt "jq")
];
javascript.extraStart = ''/\* js \*/'';
lua = {};
@@ -287,8 +290,10 @@ let {
(writer (alts (map capitalize shells)))
];
yaml = {};
- vim.extraStart =
- ''write[^ \t\r\n]*[ \t\r\n]*"\(\([^"]*\.\)\?vimrc\|[^"]*\.vim\)"'';
+ vim.extraStart = alts [
+ (writerExt "vim")
+ (writerName ''\([^"]*\.\)\?vimrc'')
+ ];
xdefaults = {};
}))}