1
0
Fork 0
dotfiles/home/config/nvim/nifoc/nix.fnl

16 lines
649 B
Text
Raw Normal View History

2022-04-24 11:30:38 +00:00
;; Move certain PATH entries to the end of the variable, because XCode CLI is not installed
;; (and I don't want to see the prompt)
(let [current-path vim.env.PATH
2022-08-26 22:07:22 +00:00
move-paths [:/usr/local/bin :/usr/bin :/usr/sbin :/bin :/sbin]]
(var new-path [])
(var append-path [])
;; Loop over PATH and prepare the value tables
(each [part (string.gmatch current-path "[^:]+")]
(if (vim.tbl_contains move-paths part) (table.insert append-path part)
(table.insert new-path part)))
(each [_ part (ipairs append-path)]
(table.insert new-path part))
2022-08-27 22:10:02 +00:00
(local joined-path (table.concat new-path ":"))
(set vim.env.PATH joined-path))
2022-04-24 11:30:38 +00:00