From 4380cb33da707aaf2c2df9f023c23b213c85b27d Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Thu, 12 Oct 2023 09:38:39 +0000 Subject: fixup --- flake.nix | 2 +- mut/neovim/compiler/nix.lua | 1 + mut/neovim/fnl/conf/init.fnl | 14 ++++++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 mut/neovim/compiler/nix.lua diff --git a/flake.nix b/flake.nix index 1ca9da6..e0f21eb 100644 --- a/flake.nix +++ b/flake.nix @@ -54,7 +54,7 @@ (import ./overlays/vimPlugins.nix {inherit pkgs;}) ])]; }) - ./machines/wsl.nix + ./achines/wsl.nix ] ++ (attrValues (attrsets.mergeAttrsList (map modulesIn [ ./profiles/core diff --git a/mut/neovim/compiler/nix.lua b/mut/neovim/compiler/nix.lua new file mode 100644 index 0000000..776e52f --- /dev/null +++ b/mut/neovim/compiler/nix.lua @@ -0,0 +1 @@ +vim.opt.errorformat = "%mat %f:%l:%c,%.%#error:%.%#'%f': %m," diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl index 3b29f40..e3b56d5 100644 --- a/mut/neovim/fnl/conf/init.fnl +++ b/mut/neovim/fnl/conf/init.fnl @@ -21,7 +21,6 @@ {:defaults (vim.tbl_extend :force (themes.get_ivy) {})}) (local cope #(vim.cmd (.. ":copen " (math.floor (/ vim.o.lines 2.6))))) - (let [map vim.keymap.set] (map :v :y "OSCYankVisual|gvy") (map :n :qf cope) @@ -38,6 +37,7 @@ ":Compile" true false true) :n false) (vim.schedule #(do + (vim.cmd "let v:searchforward = 0") (map :n :/ "/Compile.* " {:buffer true}) (map :n :? "?Compile.* " {:buffer true}))))) (map :n : ":Recompile") @@ -76,7 +76,6 @@ _ word (ipairs [(fname e) "|" (pos e) "| " e.text])] (.. l word)))) - (local lines (icollect [_ l (ipairs lines)] (if (not= l "") (prettify l)))) @@ -100,8 +99,15 @@ (add2qf data))) :on_exit (fn [id rc] (set last_job.finished true) - (if (= rc 0) - (cope)))})) + (set winnr (vim.fn.winnr)) + (if (not= rc 0) + (do + (cope) + (if (not= (vim.fn.winnr) winnr) + (do + (vim.notify "going back") + (vim.cmd "wincmd p")))) + (vim.notify (.. "\"" cmd "\" succeeded!"))))})) (set last_job {: cmd -- cgit v1.2.3