diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2023-10-12 09:38:39 +0000 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2023-10-12 09:38:39 +0000 |
| commit | 4380cb33da707aaf2c2df9f023c23b213c85b27d (patch) | |
| tree | d2a68f0b589431c1ddb28df66daca845854e31d5 /mut/neovim | |
| parent | ee55a5ab4d4c2006f56f07707699e8d90388e4e2 (diff) | |
fixup
Diffstat (limited to 'mut/neovim')
| -rw-r--r-- | mut/neovim/compiler/nix.lua | 1 | ||||
| -rw-r--r-- | mut/neovim/fnl/conf/init.fnl | 14 |
2 files changed, 11 insertions, 4 deletions
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 "<Plug>OSCYankVisual|gvy") (map :n :<leader>qf cope) @@ -38,6 +37,7 @@ ":Compile<up><c-f>" 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 :<C-e> ":Recompile<CR>") @@ -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 |
