1
0
Fork 0

neovim: Remove PATH-specific VIML

This commit is contained in:
Daniel Kempkens 2022-08-27 00:07:22 +02:00
parent 3205d00f06
commit ec05f799ea
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
2 changed files with 11 additions and 9 deletions

View file

@ -1,7 +1,14 @@
;; 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
move-paths ":/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin"
new-path (-> current-path (string.gsub move-paths "") (.. move-paths))]
(set vim.env.PATH new-path))
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))
(set vim.env.PATH (table.concat new-path ":")))

View file

@ -15,13 +15,8 @@ in
withPython3 = false;
extraConfig = ''
" Move these paths to the end of $PATH to prevent triggering the XCode CLI popup
let xcode_paths = [':/usr/local/bin:', ':/usr/bin:', ':/usr/sbin:', ':/bin:', ':/sbin:']
for xcode_path in xcode_paths
let $PATH = substitute($PATH, xcode_path, ":", "") . substitute(xcode_path, ":$", "", "")
endfor
lua << EOF
require('nifoc.nix')
require('impatient')
require('configuration.init')
EOF