1
0
Fork 0

Update deps

This commit is contained in:
Daniel Kempkens 2023-08-09 20:33:03 +02:00
parent 27145cd80d
commit 1a7664b8ed
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
3 changed files with 26 additions and 29 deletions

View file

@ -415,11 +415,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1691506824, "lastModified": 1691599243,
"narHash": "sha256-Z2Ms7036CCEAfCmDBDy+sFauO6/7fx2UN3aoPCpp4tA=", "narHash": "sha256-Lw3VRCFFbjQLxZu37rL/o2RBb95VG8iThEhEkqo3SV8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "7b8d43fbaf8450c30caaed5eab876897d0af891b", "rev": "a8f8f48320c64bd4e3a266a850bbfde2c6fe3a04",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -3,7 +3,13 @@
format-core (require :core) format-core (require :core)
toml (require :toml) toml (require :toml)
treefmt-config-file vim.env.TREEFMT_CONFIG_FILE treefmt-config-file vim.env.TREEFMT_CONFIG_FILE
treefmt-exts []] treefmt-exts []
level vim.log.levels]
(var latest-used-formatter :unknown)
(fn notify [msg lvl]
(vim.notify (.. msg " [" latest-used-formatter "]") lvl {:title :Format}))
(fn read-file [file] (fn read-file [file]
(with-open [f (io.open file :rb)] (with-open [f (io.open file :rb)]
(f:read :*all))) (f:read :*all)))
@ -17,12 +23,16 @@
(let [ext (format-core.file.extension file-path) (let [ext (format-core.file.extension file-path)
ext-glob (.. "*." ext)] ext-glob (.. "*." ext)]
(if (vim.list_contains treefmt-exts ext-glob) (if (vim.list_contains treefmt-exts ext-glob)
[{:cmd :treefmt (do
:args [file-path] (set latest-used-formatter :treefmt)
:ignore_err (fn [err data] [{:cmd :treefmt
(and (= err nil) (not (string.find data :Error))))}] :args [file-path]
:ignore_err (fn [err data]
(and (= err nil) (not (string.find data :Error))))}])
(= (vim.fn.executable fallback.cmd) 1) (= (vim.fn.executable fallback.cmd) 1)
[fallback] (do
(set latest-used-formatter fallback.cmd)
[fallback])
[]))) [])))
(fn formatter-prettier [file-path] (fn formatter-prettier [file-path]
@ -58,21 +68,8 @@
:yaml (fn [file-path] :yaml (fn [file-path]
(treefmt-or-fallback file-path (treefmt-or-fallback file-path
{:cmd :yamlfmt {:cmd :yamlfmt
:args [file-path]}))}}) :args [file-path]}))}
;; (formatter.setup {:format_on_save #(not= vim.b.nifoc_formatter_disabled 1) :hooks {:on_success #(notify "Formatting Succeed" level.INFO)
;; :filetype {:css #(do-format :prettier (args-prettier :css)) :on_err #(notify "Formatting Failed" level.ERROR)
;; :fennel #(do-format :fnlfmt {:args ["-"]}) :on_timeout #(notify "Formatting Timeout" level.ERROR)}})
;; :fish #(do-format :fish_indent {})
;; :html #(do-format :prettier
;; (args-prettier :html))
;; :javascript #(do-format :prettier
;; (args-prettier :javascript))
;; :json #(do-format :prettier
;; (args-prettier :json))
;; :sh #(do-format :shfmt (args-shfmt))
;; :toml #(do-format :taplo {:args [:fmt "-"]})
;; :typescript #(do-format :prettier
;; (args-prettier :typescript))
;; :yaml #(do-format :yamlfmt {:args [:-in]})}
;; :lsp [:elixirls :nil_ls]})
M) M)

View file

@ -140,12 +140,12 @@ in
}; };
rainbow-delimiters-nvim = buildVimPluginFrom2Nix { rainbow-delimiters-nvim = buildVimPluginFrom2Nix {
pname = "rainbow-delimiters.nvim"; pname = "rainbow-delimiters.nvim";
version = "2023-08-01"; version = "2023-08-09";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "HiPhish"; owner = "HiPhish";
repo = "rainbow-delimiters.nvim"; repo = "rainbow-delimiters.nvim";
rev = "c6380e218a2b4ffcc957a71606900a24e5c7b618"; rev = "8c6697b293d44b9bbbbdcf37e200cd01c9b66355";
sha256 = "1r0ws77n012wf0y12kql28fqqr8x3ywhllw1r5ywp519r8zag1ql"; sha256 = "16kk83f5rpv9vj0y7q4bkp3vrpprzwpijk2pdfi6vwg9gcv6ggy7";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };