summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Vink <>2023-04-19 12:42:59 +0200
committerMike Vink <>2023-04-19 12:42:59 +0200
commit156cb0752c624161b74f3fc8d01e8f4607e1d76b (patch)
tree4710136189ad254a88f83087f91ab113f0b80b27
parent358919a8607b3b0ff71113f191a8174ad210326d (diff)
racket compiler starts working!
-rw-r--r--compiler/racket.vim25
-rw-r--r--fnl/conf/events.fnl1
-rw-r--r--fnl/conf/init.fnl5
-rw-r--r--fnl/conf/pkgs/cmp.fnl2
4 files changed, 32 insertions, 1 deletions
diff --git a/compiler/racket.vim b/compiler/racket.vim
new file mode 100644
index 0000000..4a3227b
--- /dev/null
+++ b/compiler/racket.vim
@@ -0,0 +1,25 @@
+if exists('current_compiler')
+ finish
+endif
+let current_compiler = 'go-test'
+
+if exists(':CompilerSet') != 2
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+" The errorformat can also use vim's regular expression syntax (albeit in a rather awkward way) which gives us a solution to the problem. We can use a non-capturing group and a zero-width assertion to require the presence of these signaling phrases without consuming them. This then allows the %m to pick them up. As plain regular expression syntax this zero-width assertion looks like:
+"
+" \%(undefined reference\|multiple definition\)\@=
+"
+" But in order to use it in efm we need to replace \ by %\ and % by %%
+
+
+CompilerSet makeprg=racket\ -l\ errortrace
+CompilerSet errorformat=\%Z%*\\S%.%#,
+ \%C\ \ \ %f:%l:%c,
+ \%C\ \ \ %f:%l:%c:\ %m,
+ \%C\ \ %.%#%\\%%(at\:%\\\|in\:%\\\|expected\:%\\\|given\:%\\)%\\@=%m,
+ \%C\ %.%#,
+ \%E%\\%%(%\\w%\\)%\\@=%f:%*\\d:%*\\d:\ %m,
+ \%E%*\\f:%*\\d:%*\\d:\ %m,
+" vim: sw=2 sts=2 et
diff --git a/fnl/conf/events.fnl b/fnl/conf/events.fnl
index c4e5679..909eee1 100644
--- a/fnl/conf/events.fnl
+++ b/fnl/conf/events.fnl
@@ -6,6 +6,7 @@
pattern))
(vim.cmd "hi link TrailingWhitespace IncSearch"))
trim [:*.fnl
+ :*.rkt
:*.nix
:*.md
:*.hcl
diff --git a/fnl/conf/init.fnl b/fnl/conf/init.fnl
index 64502b2..b548d04 100644
--- a/fnl/conf/init.fnl
+++ b/fnl/conf/init.fnl
@@ -43,3 +43,8 @@
(os.getenv :HOME) "/flake#"
(. ctx.fargs 1))))
{:nargs 1})
+
+(vim.api.nvim_create_user_command :Gpush
+ (fn [ctx]
+ (vim.cmd ":Dispatch git push"))
+ {})
diff --git a/fnl/conf/pkgs/cmp.fnl b/fnl/conf/pkgs/cmp.fnl
index 99fa55d..51a88f0 100644
--- a/fnl/conf/pkgs/cmp.fnl
+++ b/fnl/conf/pkgs/cmp.fnl
@@ -1,6 +1,6 @@
(local cmp (require :cmp))
(local compare (require :cmp.config.compare))
-(local always-first [:write :edit :split :quit])
+(local always-first [:write :edit :split :quit :cfirst])
(fn string-startswith? [str start]
(= start (string.sub str 1 (string.len start))))