diff options
| author | Mike Vink <59492084+ivi-vink@users.noreply.github.com> | 2024-10-19 17:30:24 +0000 |
|---|---|---|
| committer | Mike Vink <59492084+ivi-vink@users.noreply.github.com> | 2024-10-19 17:30:24 +0000 |
| commit | 62c02a6e17080eb4bde2d09982ab934dc8bbc750 (patch) | |
| tree | 976a25b1bc34c48224306b3db49a0cf0e5926433 | |
| parent | 914b52c618c263be0f22a50f91fa870f6cf717e4 (diff) | |
switch to lua again...
31 files changed, 33 insertions, 1402 deletions
@@ -30,14 +30,17 @@ deploy-rs, ... }: let - withLibs = nixpkgs.lib.foldl + withLibs = + nixpkgs.lib.foldl (acc: inputLib: acc.extend (_: _: inputLib)) nixpkgs.lib; - lib = (withLibs [ - inputs.nix-darwin.lib - home-manager.lib - ]).extend + lib = + (withLibs [ + inputs.nix-darwin.lib + home-manager.lib + ]) + .extend (import ./lib inputs); nixosSystems = with lib; { @@ -76,8 +79,8 @@ ++ modulesIn ./profiles/homeserver; opts = { isServer = true; - ipv4 = [ "192.168.2.13" ]; - ipv6 = [ "2a02:a46b:ee73:1:c240:4bcb:9fc3:71ab" ]; + ipv4 = ["192.168.2.13"]; + ipv6 = ["2a02:a46b:ee73:1:c240:4bcb:9fc3:71ab"]; tailnet = { ipv4 = "100.90.145.95"; ipv6 = "fd7a:115c:a1e0::e2da:915f"; @@ -100,8 +103,8 @@ ++ modulesIn ./profiles/server; opts = { isServer = true; - ipv4 = [ "65.109.143.65" ]; - ipv6 = [ "2a01:4f9:c012:ccc2::1" ]; + ipv4 = ["65.109.143.65"]; + ipv6 = ["2a01:4f9:c012:ccc2::1"]; }; }; @@ -116,7 +119,7 @@ ./profiles/core/neovim.nix ] ++ modulesIn ./profiles/graphical; - opts = { }; + opts = {}; }; vm-aarch64 = { @@ -182,16 +185,18 @@ }; devShells.x86_64-linux.hetzner = let - pkgs = (import nixpkgs {system = "x86_64-linux";}); - in with pkgs; mkShell { - name = "deploy"; - buildInputs = [ - pkgs.bashInteractive - deploy-rs.packages."${system}".default - ]; - shellHook = '' - export HCLOUD_TOKEN="$(pass show personal/hetzner-token)" - ''; - }; - }; + pkgs = import nixpkgs {system = "x86_64-linux";}; + in + with pkgs; + mkShell { + name = "deploy"; + buildInputs = [ + pkgs.bashInteractive + deploy-rs.packages."${system}".default + ]; + shellHook = '' + export HCLOUD_TOKEN="$(pass show personal/hetzner-token)" + ''; + }; + }; } diff --git a/mut/lf/icons b/mut/lf/icons index 2260f2b..e313a59 120000 --- a/mut/lf/icons +++ b/mut/lf/icons @@ -1 +1 @@ -/nix/store/q8hdr7j1k3mwdjh63n3i0m10d098s60n-home-manager-files/.config/lf/icons
\ No newline at end of file +/nix/store/bfam7g4dqxwxkg8lnar25n5b4497ir15-home-manager-files/.config/lf/icons
\ No newline at end of file diff --git a/mut/neovim/fnl/conf/diagnostic.fnl b/mut/neovim/fnl/conf/diagnostic.fnl deleted file mode 100644 index 7ef1dd3..0000000 --- a/mut/neovim/fnl/conf/diagnostic.fnl +++ /dev/null @@ -1,16 +0,0 @@ -(fn m [mode key cb] - (vim.keymap.set mode key cb {:silent true :noremap true})) - -(m :n :<leader>ge (fn [] - (vim.diagnostic.open_float))) - -(vim.diagnostic.config {:virtual_text false}) - -(vim.keymap.set :n :<Leader>l (let [l (require :lsp_lines)] - l.toggle) - {:desc "Toggle lsp_lines"}) - -(vim.api.nvim_set_hl 0 :VirtualTextWarning {:link :Grey}) -(vim.api.nvim_set_hl 0 :VirtualTextError {:link :DiffDelete}) -(vim.api.nvim_set_hl 0 :VirtualTextInfo {:link :DiffChange}) -(vim.api.nvim_set_hl 0 :VirtualTextHint {:link :DiffAdd}) diff --git a/mut/neovim/fnl/conf/events.fnl b/mut/neovim/fnl/conf/events.fnl deleted file mode 100644 index a2c9e68..0000000 --- a/mut/neovim/fnl/conf/events.fnl +++ /dev/null @@ -1,94 +0,0 @@ -(local lspconfig (require :lspconfig)) -(local configs (require :lspconfig.configs)) -(local {: attach} (require :conf.lsp)) - -(local event vim.api.nvim_create_autocmd) -(local command vim.api.nvim_create_user_command) - -(vim.api.nvim_create_augroup "my" {:clear true}) -(vim.api.nvim_create_augroup "conf#events" {:clear true}) - -(command :Event - (fn [cmd] - (let [del cmd.bang - [event_name & command] cmd.fargs] - (P cmd) - (local c (vim.iter command)) - (if del - (do - (local events - (vim.iter - (vim.api.nvim_get_autocmds - {:group :my - :event event_name - :buffer 0}))) - (events:map (fn [e] (vim.api.nvim_del_autocmd e.id)))) - (event - event_name - {:group :my - :buffer 0 - :callback #(vim.cmd (.. "silent " (c:join " ")))})))) - {:bang true :nargs :* :complete :file :force true}) -(let [map vim.keymap.set] - (map :n :<c-e> ":Event BufWritePost <up>") - (map :n :<M-e> ":Event! BufWritePost ")) - -(event - :LspAttach - {:group "conf#events" - :pattern ["*"] - :callback attach}) - -(local oil (require :oil)) -(event - :User - {:group "conf#events" - :pattern ["ZoxideDirChanged"] - :callback #(vim.schedule #(oil.open (vim.fn.getcwd)))}) - -(event - :BufReadPost - {:pattern ["*"] - :callback (fn [] - (local pattern "'\\s\\+$'") - (vim.cmd (.. "syn match TrailingWhitespace " - pattern)) - (vim.cmd "hi link TrailingWhitespace IncSearch")) - :group "conf#events"}) - -(event - :BufWritePost - {:group "conf#events" - :callback #(do (local lint (require :lint)) - (lint.try_lint) - (vim.schedule #(vim.diagnostic.setloclist {:open false})))}) - -;; (event -;; [:BufEnter] -;; {:group "conf#events" -;; :callback -;; #(do (var dir (vim.fn.fnamemodify (vim.fn.expand "%") ":h")) -;; (if (vim.startswith dir "oil://") (set dir (dir:sub (+ 1 (length "oil://"))))) -;; (vim.cmd (.. "silent !lf -remote \"send cd '" dir "'\"")))}) - - -(local session-file (.. vim.env.HOME "/.vimsession.vim")) -(event - :VimLeave - {:group "conf#events" - :pattern ["*"] - :callback #(vim.cmd (.. "mksession! " session-file))}) -;; (event -;; :VimEnter -;; {:group "conf#events" -;; :pattern ["*"] -;; :callback #(if (= 1 (vim.fn.filereadable session-file)) -;; (do -;; (local start-with-arg (>= 1 (vim.fn.argc))) -;; (local file (vim.fn.argv 0)) -;; (local cwd (vim.fn.getcwd)) -;; (if start-with-arg (do -;; (vim.schedule #(vim.cmd (.. "source " session-file))) -;; (vim.schedule #(do -;; (vim.cmd (.. "cd " cwd)) -;; (vim.cmd (.. "e " file))))))))}) diff --git a/mut/neovim/fnl/conf/filetype.fnl b/mut/neovim/fnl/conf/filetype.fnl deleted file mode 100644 index 29f64b0..0000000 --- a/mut/neovim/fnl/conf/filetype.fnl +++ /dev/null @@ -1,44 +0,0 @@ -(fn playbook? [filename] - (P filename) - (local pattern (vim.regex :^playbook.*)) - (pattern:match_str filename)) - -(fn group-vars? [relative-dir] - (local pattern (vim.regex :group_vars$)) - (pattern:match_str relative-dir)) - -(fn roles? [relative-dir] - (local pattern (vim.regex :roles$)) - (pattern:match_str relative-dir)) - -(fn task? [relative-file] - (local pattern (vim.regex :.*tasks.*)) - (pattern:match_str relative-file)) - -(fn ansible-files? [items] - (local [item & rest] items) - (if (not item) :yaml - (task? item) :yaml.ansible - (roles? item) :yaml.ansible - (group-vars? item) :yaml.ansible - (ansible-files? rest))) - -(fn yaml-filetype [path buf] - (local [repo?] - (vim.fs.find :.git - {:upward true - :path (vim.fs.dirname path) - :stop (vim.fs.dirname (vim.loop.cwd))})) - (local files (or (not repo?) (icollect [path file-or-dir (vim.fs.dir (vim.fs.dirname repo?) - {:skip #(not= "." - ($1:sub 1 - 1)) - :depth 2})] - (do - path)))) - (if (and repo? (playbook? (vim.fn.fnamemodify path ":t"))) :yaml.ansible - (and repo? (task? (vim.fn.fnamemodify path ":."))) :yaml.ansible - repo? (ansible-files? files) - :yaml)) - -(vim.filetype.add {:extension {:yml yaml-filetype :yaml yaml-filetype}}) diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl deleted file mode 100644 index 9a776ce..0000000 --- a/mut/neovim/fnl/conf/init.fnl +++ /dev/null @@ -1,369 +0,0 @@ -(require :conf.settings) -(require :conf.nix-develop) -(require :conf.diagnostic) -(require :conf.events) -(require :conf.pkgs) - -(vim.schedule #(vim.cmd "colorscheme kanagawa-wave")) -(vim.cmd "filetype plugin on") -(vim.cmd "filetype indent on") -(vim.cmd "highlight WinSeparator guibg=None") -(vim.cmd "packadd cfilter") - -(vim.opt.clipboard:append ["unnamedplus"]) - -(local osc52 (require :vim.ui.clipboard.osc52)) -(let - [paste - (fn [] [(vim.fn.split (vim.fn.getreg "") "\n") (vim.fn.getregtype "")]) - xclip - (fn [lines] - (vim.system [:xclip] {:text true :stdin lines} (fn [exitobj])) - (vim.system [:xclip :-selection :clipboard] {:text true :stdin lines} (fn [exitobj])) - nil)] - (set - vim.g.clipboard - {:name "OSC 52" - :copy {:+ xclip - :* xclip} - :paste {:+ paste - :* paste}})) - - -(tset _G :P (lambda [...] - (let [inspected (icollect [_ v (ipairs [...])] - (vim.inspect v))] - (each [_ printer (ipairs inspected)] - (print printer))))) - -(local fzf (require :fzf-lua)) -(local action (require :fzf-lua.actions)) -(fzf.setup [:max-perf]) - -(local - draw - (fn [toggle] - (if - toggle - (do - (vim.cmd "set virtualedit=all") - (vim.keymap.set :v "<leader>;" "<esc>:VBox<CR>") - (vim.keymap.set "n" "J" "<C-v>j:VBox<CR>") - (vim.keymap.set "n" "K" "<C-v>k:VBox<CR>") - (vim.keymap.set "n" "L" "<C-v>l:VBox<CR>") - (vim.keymap.set "n" "H" "<C-v>h:VBox<CR>")) - (do - (vim.cmd "set virtualedit=") - (vim.keymap.del :v "<leader>;") - (vim.keymap.del "n" "J") - (vim.keymap.del "n" "K") - (vim.keymap.del "n" "L") - (vim.keymap.del "n" "H"))))) - -(local commenter (require :nvim_comment)) -(commenter.setup) -; (local cinnamon (require :cinnamon)) -; (cinnamon.setup { -; :extra_keymaps true -; :override_keymaps true -; :max_length 200 -; :horizontal_scroll false -; :default_delay 7 -; :scroll_limit -1}) - - -(fn i-grep [word file] - (vim.api.nvim_feedkeys - (vim.api.nvim_replace_termcodes - (.. ":silent grep " (if (not= "" word) (.. word " ") "") (file:gsub "oil://" "") "<c-f>B<left>i<space>") true false true) - :n false)) - -(local cope #(vim.cmd (.. ":botright copen " (math.floor (/ vim.o.lines 2.1))))) -(local oil (require :oil.actions)) -(let [map vim.keymap.set] - (map :n :gb ":GBrowse<CR>") - (map :n :g<cr> ::G<cr>) - ;(map :n :ga "<Plug>(EasyAlign)") - ;(map :x :ga "<Plug>(EasyAlign)") - ; (map :n :<leader>d<cr> (fn [] (draw true))) - ; (map :n :<leader>d<bs> (fn [] (draw false))) - (map :n :- ::Oil<cr>) - (map :n :_ #(oil.open_cwd.callback)) - (map :n :<leader>qf cope) - (map :n :<leader>q<BS> ":cclose<cr>") - (map :n :<leader>ll ":lopen<cr>") - (map :n :<leader>l<BS> ":lclose<cr>") - (map :n "<M-h>" cope) - (map :n "<C-n>" ":cnext<cr>") - (map :n "<C-p>" ":cprev<cr>") - (map :n :<C-a> ":Recompile<CR>") - (map :n :<C-s> - #(do - (vim.api.nvim_feedkeys - (vim.api.nvim_replace_termcodes - ":Sh<up><c-f>" true false true) - :n false) - (vim.schedule #(do - (vim.cmd "let v:searchforward = 0") - (map :n :/ "/Sh.*" {:buffer true}) - (map :n :? "?Sh.*" {:buffer true}))))) - (map :n :<C-x> - #(do - (vim.api.nvim_feedkeys - (vim.api.nvim_replace_termcodes - ":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 "[q" ":cprevious<cr>") - (map :n "]q" ":cnext<cr>") - (map :n "[x" ":lprevious<cr>") - (map :n "]x" ":lnext<cr>") - (map :n "[g" ":GV<cr>") - (map :n "]g" ":GV?<cr>") - (map :n "]G" ":GV!<cr>") - (map :n :<leader>xp #(fzf.files)) - (map :n "<leader>:" #(i-grep "<c-r><c-w>" (vim.fn.bufname "%"))) - (map :v "<leader>:" ":Vgrep!<cr>") - (map :n "<leader>;" #(i-grep "" (vim.fn.fnamemodify (vim.fn.bufname "%") ":h"))) - (map :v "<leader>;" ":Vgrep<cr>") - (map :n "<leader>'" ":silent args `fd `<left>") - (map :n :<leader>xa #(fzf.args)) - (map :n "<leader>x;" #(fzf.quickfix)) - (map :n :<leader>xb #(fzf.buffers - {:keymap {:fzf {"alt-a" "toggle-all"}} - :actions {:default {:fn action.buf_edit_or_qf}}})) - (map :n :<leader>x<cr> #(vim.cmd "b #")) - (map :n :<C-w>d - #(do - (local uis (vim.iter (vim.api.nvim_list_uis))) - (uis:map (fn [ui] (vim.fn.chanclose ui.chan)))))) - -(do - (local obsidian (require "obsidian")) - (obsidian.setup - { :workspaces - [{ - :name "notes" - :path (if (= 1 (vim.fn.isdirectory (vim.fn.expand "~/Sync/my/notes"))) "~/Sync/my/notes" "~/sync/my/notes")}]})) - - -(do - (local fzf (require "fzf-lua")) - ((. fzf "register_ui_select"))) - -(vim.api.nvim_create_user_command - :Vgrep - (fn [{: bang}] - (local [buf <row <col] (vim.fn.getpos "'<")) - (local [buf >row >col] (vim.fn.getpos "'>")) - (local [line & rest] (vim.api.nvim_buf_get_text 0 (- <row 1) (- <col 1) (- >row 1) >col {})) - (if bang - (i-grep line (vim.fn.bufname "%")) - (i-grep line (vim.fn.fnamemodify (vim.fn.bufname "%") ":h")))) - {:range 1 :bang true}) - -(vim.api.nvim_create_user_command - :NixEdit - (fn [{: args}] - (local f (io.popen (.. "nix eval --raw /nix-config#nixosConfigurations." (vim.fn.hostname) ".pkgs." args))) - (vim.cmd (.. "e " (f:read)))) - {:nargs 1}) - -(local qf - (fn [{: id : title}] - (fn [lines] - (local s (fn [line pattern] - (let [(result n) (line:gsub pattern "")] - (match n - nil line - _ result)))) - (local prettify #(-> $1 - (s "%c+%[[0-9:;<=>?]*[!\"#$%%&'()*+,-./]*[@A-Z%[%]^_`a-z{|}~]*;?[A-Z]?"))) - (vim.schedule - #(do - (local is-qf (= (vim.opt_local.buftype:get) "quickfix")) - (local is-at-last-line (let [[row col] (vim.api.nvim_win_get_cursor 0) - last-line (vim.api.nvim_buf_line_count 0)] - (do - (= row last-line)))) - (vim.fn.setqflist - [] :a - {: id : title - :lines - (icollect [l lines] - (do - (if (not= l "") - (prettify l))))}) - (if (or - (not is-qf) - (and is-at-last-line is-qf)) - (vim.cmd ":cbottom"))))))) - -(var last_job_state nil) -(var last_job_thunk nil) -(local qfjob - (fn [cmd stdin] - (local title (table.concat cmd " ")) - (vim.fn.setqflist [] " " {: title}) - (local add2qf (qf (vim.fn.getqflist {:id 0 :title 1}))) - (set - last_job_state - (vim.system - cmd - {: stdin - :stdout (fn [err data] - (if data - (add2qf (string.gmatch data "[^\n]+")))) - :stderr (fn [err data] - (if data - (add2qf (string.gmatch data "[^\n]+"))))} - (fn [obj] - (vim.schedule - #(do - (set winnr (vim.fn.winnr)) - (if (not= obj.code 0) - (do - (cope) - (if (not= (vim.fn.winnr) winnr) - (do - (vim.notify (.. title " failed, going back")) - (vim.cmd "wincmd p | cbot")) - (vim.notify (.. title "failed, going back")))) - (vim.notify (.. "\"" title "\" succeeded!")))))))))) - -(vim.api.nvim_create_user_command - :Compile - (fn [cmd] - (local thunk #(qfjob cmd.fargs nil)) - (set last_job_thunk thunk) - (thunk)) - {:nargs :* :bang true :complete "file"}) -(vim.api.nvim_create_user_command - :Sh - (fn [cmd] - (local thunk #(qfjob [:zshcmd cmd.args] nil)) - (set last_job_thunk thunk) - (thunk)) - {:nargs :* :bang true :complete :shellcmd}) -(vim.api.nvim_create_user_command - :Recompile - (fn [] - (if (= nil last_job_state) - (vim.notify "nothing to recompile") - (if (not (last_job_state:is_closing)) - (vim.notify "Last job not finished") - (last_job_thunk)))) - {:bang true}) -(vim.api.nvim_create_user_command - :Stop - (fn [] - (if (not= nil last_job_state) - (do - (last_job_state:kill) - (vim.notify "killed job")) - (vim.notify "nothing to do"))) - {:bang true}) -(vim.api.nvim_create_user_command - :Args - (fn [obj] - (if (not= 0 (length obj.fargs)) - (do - (local thunk #(qfjob [:sh :-c obj.args] (vim.fn.argv))) - (set last_job_thunk thunk) - (thunk)))) - {:nargs :* :bang true :complete :shellcmd}) - - - -(fn browse_git_remote - [data] - (P data) - (local - {: commit - : git_dir - : line1 - : line2 - : path - : remote - : remote_name - : repo - : type } data) - - (local - oilpath - (case (vim.fn.bufname "%") - (where oilbuf (vim.startswith oilbuf "oil://")) - (do - (local d (.. "oil://" (vim.fs.dirname git_dir) "/")) - (oilbuf:sub (+ 1 (d:len)) (oilbuf:len))) - _ - "")) - - (local [home repo] - (case remote - (where s (vim.startswith s "git@")) - (do - (or - (case [(s:match "(git@)([^:]+):(.*)(%.git)")] - ["git@" home repo ".git"] - [home repo]) - (case [(s:match "(git@)([^:]+):.*/(.*)/(.*)/(.*)")] - ["git@" home org project repo] - [(home:gsub "ssh%." "") [(.. org "/" project) repo]]))))) - - (case [home repo] - (where ["bitbucket.org" repo]) - (do - (case [path type] - ["" "tree"] - (.. "https://" home "/" repo "/src/" commit "/" (or oilpath path "")) - [path "blob"] - (.. "https://" home "/" repo "/src/" commit "/" path) - [path "commit"] - (.. "https://" home "/" repo "/commits/" commit) - [path "ref"] - (.. "https://" home "/" repo "/commits/" commit))) - (where ["dev.azure.com" [org repo]]) - (do - (case [path type] - ["" "tree"] - (.. "https://" home "/" org "/_git/" repo "?version=GB" commit "&path=/" (or oilpath path "")) - [path "blob"] - (.. "https://" home "/" org "/_git/" repo "?version=GB" commit "&path=/" path) - [path "commit"] - (.. "https://" home "/" org "/_git/" repo "/commit/" commit) - [path "ref"] - (.. "https://" home "/" org "/_git/" repo "/commit/" commit))) - (where ["gitlab.com" repo]) - (do - (case [path type] - ["" "tree"] - (.. "https://" home "/" repo "/-/tree/" commit "/" (or oilpath "")) - [path "commit"] - (.. "https://" home "/" repo "/-/commit/" commit) - [path "ref"] - (.. "https://" home "/" repo "/-/commit/" commit) - [path "blob"] - (.. "https://" home "/" repo "/-/blob/" commit "/" path))) - (where ["github.com" repo]) - (do - (case [path type] - ["" "tree"] - (.. "https://" home "/" repo "/tree/" commit "/" (or oilpath "")) - [path "commit"] - (.. "https://" home "/" repo "/commit/" commit) - [path "ref"] - (.. "https://" home "/" repo "/commit/" commit) - [path "blob"] - (.. "https://" home "/" repo "/blob/" commit "/" path))))) - -(vim.api.nvim_create_user_command - :Browse - (fn [{: args}] (vim.system ["xdg-open" args] {} (fn []))) - {:nargs 1}) - -(set vim.g.fugitive_browse_handlers - [browse_git_remote]) diff --git a/mut/neovim/fnl/conf/lsp.fnl b/mut/neovim/fnl/conf/lsp.fnl deleted file mode 100644 index 3982fe6..0000000 --- a/mut/neovim/fnl/conf/lsp.fnl +++ /dev/null @@ -1,76 +0,0 @@ -(fn map-to-capabilities [{: client : buf}] - (fn bo [name value] - (vim.api.nvim_buf_set_option buf name value)) - - (fn bm [mode key cb] - (vim.keymap.set mode key cb {:silent true :noremap true :buffer buf})) - - (fn lspdo [action] - (. vim.lsp.buf action)) - - (fn use [cpb] - (match cpb - :completionProvider (bo :omnifunc "v:lua.vim.lsp.omnifunc") - :renameProvider (bm :n :<leader>gr (lspdo :rename)) - :signatureHelpProvider (bm :n :<leader>gs (lspdo :signature_help)) - :definitionProvider (bm :n :<leader>gd (lspdo :definition)) - :declaration (bm :n :<leader>gD (lspdo :declaration)) - :implementationProvider (bm :n :<leader>gi (lspdo :implementation)) - :referencesProvider (bm :n :<leader>gg (lspdo :references)) - :documentSymbolProvider (bm :n :<leader>gds (lspdo :workspace_symbol)) - :codeActionProvider (bm :n :<leader>ga (lspdo :code_action)) - :codeLensProvider (bm :n :<leader>gl #(vim.lsp.codelens.run)) - :hoverProvider (bo :keywordprg ":LspHover") - :inlayHintProvider (do - (vim.lsp.inlay_hint.enable true) - (bm :n :<leader>gh #(vim.lsp.inlay_hint.enable 0 (not (vim.lsp.inlay_hint.is_enabled 0))))) - :documentFormattingProvider (do - (bo :formatexpr - "v:lua.vim.lsp.format()") - (bm :n :<leader>gq - #(vim.lsp.buf.format {:async true}))))) - - (each [cpb enabled? (pairs client.server_capabilities)] - (if enabled? - (use cpb))) - {: client : buf}) - -(fn register-handlers [{: client : buf}] - (tset (. client :handlers) :textDocument/publishDiagnostics - (vim.lsp.with - (fn [_ result ctx config] - (vim.lsp.diagnostic.on_publish_diagnostics _ result ctx - config) - (vim.diagnostic.setloclist {:open false})) - {:virtual_text false - :underline true - :update_in_insert false - :severity_sort true})) - {: client : buf}) - -(var format-on-save true) -(fn toggle-format-on-save [] - (set format-on-save (not format-on-save))) - -(vim.api.nvim_create_user_command :LspToggleOnSave toggle-format-on-save - {:nargs 1 :complete (fn [] [:format])}) - -(fn events [{: client : buf}] - (match client.server_capabilities - {:documentFormattingProvider true} - (vim.api.nvim_create_autocmd - :BufWritePre - {:group - (vim.api.nvim_create_augroup :format-events {:clear true}) - :buffer buf - :callback #(if format-on-save (vim.lsp.buf.format))}))) - -(fn attach [ev] - (local client (vim.lsp.get_client_by_id ev.data.client_id)) - (local buf ev.buf) - (-> {: client : buf} - (register-handlers) - (map-to-capabilities) - (events))) - -{: attach} diff --git a/mut/neovim/fnl/conf/macros.fnl b/mut/neovim/fnl/conf/macros.fnl deleted file mode 100644 index 9ce8b26..0000000 --- a/mut/neovim/fnl/conf/macros.fnl +++ /dev/null @@ -1,45 +0,0 @@ -(fn by-two [l] - (fn iter [t i] - (let [k (. l (- i 1)) - v (. l i)] - (when (and (not= k nil) (not= v nil)) - (values (+ i 2) [k v])))) - - (values iter l 2)) - -(fn decode-opt-value [v] - (fn symbol-luatype [s] - (let [t (tostring s)] - (match t - :on true - :off false - _ t))) - - (if (sym? v) (symbol-luatype v) v)) - -(fn opt-template [o] - (fn remove/append [target value mode] - `(let [target# (. vim :opt ,target) - value# ,value] - ,(match mode - :append `(target#:append value#) - :remove `(target#:remove value#)))) - - (fn [v] - (match (string.sub o 1 1) - "-" (remove/append (string.sub o 2) v :remove) - "+" (remove/append (string.sub o 2) v :append) - _ `(tset (. vim :opt) ,o ,v)))) - -(fn settings [...] - `,(icollect [_ [o v] (by-two [...])] - ((opt-template (tostring o)) (decode-opt-value v)))) - -(fn globals [...] - (local globa (icollect [_ [k v] (by-two [...])] - [(tostring k) v])) - `(let [l# ,globa] - (each [a# b# (ipairs l#)] - (tset (. vim :g) (. b# 1) (. b# 2))))) - -{: settings : globals} diff --git a/mut/neovim/fnl/conf/nix-develop/init.fnl b/mut/neovim/fnl/conf/nix-develop/init.fnl deleted file mode 100644 index fe9ea1e..0000000 --- a/mut/neovim/fnl/conf/nix-develop/init.fnl +++ /dev/null @@ -1,123 +0,0 @@ -(local loop vim.loop) - -(var original-env {}) -(local ignored-variables {:SHELL true - :BASHOPTS true - :HOME true - :NIX_BUILD_TOP true - :NIX_ENFORCE_PURITY true - :NIX_LOG_FD true - :NIX_REMOTE true - :PPID true - :SHELL true - :SHELLOPTS true - :SSL_CERT_FILE true - :TEMP true - :TEMPDIR true - :TERM true - :TMP true - :TMPDIR true - :TZ true - :UID true}) - -(local separated-dirs {:PATH ":" :XDG_DATA_DIRS ":"}) - -(fn set-env [key value] - (if (not (. original-env key)) - (tset original-env key (or (. vim.env key) :nix-develop-nil))) - (local sep (. separated-dirs key)) - (if sep - (do - (local suffix (or (. vim.env key) "")) - (tset vim.env key (.. value sep suffix))) - (tset vim.env key value))) - -(fn unload-env [] - (each [k v (pairs original-env)] - (if (= v :nix-develop-nil) - (tset vim.env k nil) - (tset vim.env k v)))) - -(fn ignored? [key] - (. ignored-variables (string.upper key))) - -(fn exported? [Type] - (= Type :exported)) - -(fn handle-shellhook [shellhook] ; (P :handle-shellhook shellhook) - (var shellhook-env "") - (local stdin (loop.new_pipe)) - (local stdout (loop.new_pipe)) - (local p - (loop.spawn :bash {:stdio [stdin stdout nil]} - (fn [code signal] - (vim.schedule #(vim.notify (.. "shellhook: exit code " - code " " signal)))))) - (loop.read_start stdout - (fn [err data] - (assert (not err) err) - (if data - (set shellhook-env (.. shellhook-env data)) - (do - (if (not= shellhook-env "") - (vim.schedule (fn [] - (local json - (vim.fn.json_decode shellhook-env)) - (each [key value (pairs json)] - (set-env key value))))))))) - (stdin:write (.. shellhook "jq -n 'env'\n\n")) - (stdin:close)) - -(fn handle-nix-print-dev-env [str] - (vim.schedule - (fn [] - (local json (. (vim.fn.json_decode str) :variables)) - (-> (icollect [key {: type : value} (pairs json)] - (do - (if (and (exported? type) (not (ignored? key))) - (set-env key value)) - (if (= key :shellHook) - value))) - (#(each [_ shellhook (ipairs $1)] - (handle-shellhook shellhook))))))) - -(fn nix-develop [fargs unload] - (if unload - (unload-env)) - (local cmd :nix) - (local fargs (or fargs [])) - (local args [:print-dev-env :--json (unpack fargs)]) - (local stdout (loop.new_pipe)) - (local stdio [nil stdout nil]) - (var nix-print-dev-env "") - (local p - (loop.spawn cmd {: args : stdio} - (fn [code signal] - (if (not= code 0) - (vim.schedule #(vim.notify (.. "nix-develop: exit code " - code " " signal))))))) - (loop.read_start stdout - (fn [err data] - (assert (not err) err) - (if data - (do - (set nix-print-dev-env (.. nix-print-dev-env data))) - (do - (vim.schedule #(vim.notify "nix-develop: stdout end")) - (if (not= nix-print-dev-env "") - (handle-nix-print-dev-env nix-print-dev-env))))))) - -(vim.api.nvim_create_user_command :NixDevelop - (fn [ctx] - (nix-develop ctx.fargs true)) - {:nargs "*"}) - -(vim.api.nvim_create_augroup :nix-develop {:clear true}) -(vim.api.nvim_create_autocmd [:DirChanged :VimEnter] - {:pattern ["*"] - :callback (fn [ctx] - (unload-env) - (if (= 1 - (vim.fn.filereadable (.. ctx.file - :/flake.nix))) - (nix-develop false)))}) diff --git a/mut/neovim/fnl/conf/pkgs.fnl b/mut/neovim/fnl/conf/pkgs.fnl deleted file mode 100644 index 832f336..0000000 --- a/mut/neovim/fnl/conf/pkgs.fnl +++ /dev/null @@ -1,13 +0,0 @@ -(require :conf.pkgs.cmp) -(require :conf.pkgs.lspconfig) -(require :conf.pkgs.treesitter) -(require :conf.pkgs.dap) -(require :conf.pkgs.venn) -(require :conf.pkgs.gitsigns) -(require :conf.pkgs.oil) -(require :conf.pkgs.lint) -(require :conf.pkgs.lualine) -(require :conf.pkgs.go) -(require :conf.pkgs.luasnip) -;; (require :conf.pkgs.lsp_lines) -;; (require :conf.pkgs.null-ls) diff --git a/mut/neovim/fnl/conf/pkgs/cmp.fnl b/mut/neovim/fnl/conf/pkgs/cmp.fnl deleted file mode 100644 index b219d39..0000000 --- a/mut/neovim/fnl/conf/pkgs/cmp.fnl +++ /dev/null @@ -1,122 +0,0 @@ -(local cmp (require :cmp)) - -(fn has-words-before? [] - (local [line col] (vim.api.nvim_win_get_cursor 0)) - (local [word & rest] (vim.api.nvim_buf_get_lines 0 (- line 1) line true)) - (local before (word:sub col col)) - (local is_string (before:match "%s")) - (and (not= col 0) (= is_string nil))) - -(fn edit? [line] - (or (not= nil (line:match "^.* %.?.*$")) (not= nil (line:match "^ed?i?t? .*$")))) - -(fn endswith? [line char] - (not= nil (line:match (.. ".*" char "$")))) - -(fn replace-tail [line] - (let [(result n) (line:gsub "(.*/)[^/]*/$" "%1")] - (if (not= nil n) - result - line))) - -(fn enum [types key] - (. (. cmp types) key)) - -(fn cmp-setup [cmp autocomplete] - (let [luasnip (require :luasnip) - snip (fn [args] - (luasnip.lsp_expand (. args :body)))] - (local cfg - {:experimental {:ghost_text true} - :snippet {:expand snip} - :preselect cmp.PreselectMode.None - :mapping {:<Tab> (cmp.mapping (fn [fallback] - (if (cmp.visible) - (cmp.select_next_item) - (luasnip.expand_or_jumpable) - (luasnip.expand_or_jump) - (has-words-before?) - (cmp.complete) - (fallback)) - [:i :s])) - :<S-Tab> (cmp.mapping (fn [fallback] - (if (cmp.visible) - (cmp.select_prev_item) - (luasnip.jumpable -1) - (luasnip.jump -1) - (fallback)) - [:i :s])) - :<C-b> (cmp.mapping.scroll_docs -4) - :<C-f> (cmp.mapping.scroll_docs 4) - :<C-j> (cmp.mapping.complete) - :<CR> (cmp.mapping.confirm {:behavior (enum :ConfirmBehavior - :Insert) - :select true})} - :sources (cmp.config.sources [{:name :nvim_lsp} - {:name :path} - {:name :luasnip}])}) - - ; This tries to emulate somewhat ido mode to find files - ; todo sorting based on least recently used - (cmp.setup.cmdline - ":" - {:enabled (fn [] - (local val (edit? (vim.fn.getcmdline))) - (if (not val) - (cmp.close)) - val) - :completion {:completeopt "menu,menuone,noinsert"} - :mapping {:<C-n> (cmp.mapping - (fn [fallback] - (if (cmp.visible) - (cmp.select_next_item) - (cmp.complete))) - [:i :c]) - :<C-p> (cmp.mapping - (fn [fallback] - (if (cmp.visible) - (cmp.select_prev_item) - (cmp.complete))) - [:i :c]) - :<BS> (cmp.mapping - (fn [fallback] - (local line (vim.fn.getcmdline)) - (if (not (endswith? line "/")) - (fallback) - (do - (vim.fn.setcmdline (replace-tail line)) - (vim.fn.feedkeys (vim.api.nvim_replace_termcodes "<C-g><BS>" true false true) false) - (vim.schedule cmp.complete)))) - [:i :c]) - :<CR> (cmp.mapping - (fn [fallback] - (local entry (cmp.get_selected_entry)) - (local line (vim.fn.getcmdline)) - (if (or (= nil entry) (not (edit? line))) - (do - (vim.schedule fallback)) - (do - (cmp.confirm {:select true :behavior cmp.ConfirmBehavior.Replace}) - (if (entry.completion_item.label:match "%.*/$") - (do - (vim.defer_fn cmp.complete 10)) - (do - (vim.schedule fallback)))))) - [:i :c])} - :sources (cmp.config.sources [{:name :path}])} - - - - (if (not autocomplete) (tset cfg :completion {:autocomplete false})) - ;; (print (vim.inspect cfg)) - (cmp.setup cfg)))) - -(let [map vim.keymap.set] - (map :n :<leader>xf (fn [] - (local fname (vim.fn.fnamemodify - (vim.fn.bufname (vim.api.nvim_get_current_buf)) - ::p:h)) - (vim.api.nvim_feedkeys (.. ":e " fname) :c false) - (vim.defer_fn #(vim.api.nvim_feedkeys "/" :c false) 10)))) - -(cmp-setup (require :cmp) true) diff --git a/mut/neovim/fnl/conf/pkgs/conjure.fnl b/mut/neovim/fnl/conf/pkgs/conjure.fnl deleted file mode 100644 index 3bdc32c..0000000 --- a/mut/neovim/fnl/conf/pkgs/conjure.fnl +++ /dev/null @@ -1,17 +0,0 @@ -;; (tset vim.g "conjure#log#wrap" true) -;; -;; (tset vim.g "conjure#client#python#stdio#command" "python -iq") -;; -;; (vim.api.nvim_create_user_command :ConjurePythonCommand -;; (fn [opts] -;; (tset vim.g -;; "conjure#client#python#stdio#command" -;; opts.args)) -;; {:nargs 1}) -;; -;; (let [group (vim.api.nvim_create_augroup "conf#pkgs#conjure" {:clear true})] -;; (vim.api.nvim_create_autocmd [:BufEnter] -;; {: group -;; :callback (fn [opts] -;; (vim.diagnostic.disable opts.buf)) -;; :pattern [:conjure-log*]})) diff --git a/mut/neovim/fnl/conf/pkgs/dap.fnl b/mut/neovim/fnl/conf/pkgs/dap.fnl deleted file mode 100644 index 08dae2e..0000000 --- a/mut/neovim/fnl/conf/pkgs/dap.fnl +++ /dev/null @@ -1,122 +0,0 @@ -(local dap (require :dap)) -(local adapters (. dap :adapters)) -(local configurations (. dap :configurations)) - -(local dapui (require :dapui)) -(local dap-py (require :dap-python)) - -(tset adapters :delve - {:type :server - :port "${port}" - :executable {:command :dlv :args [:dap :-l "127.0.0.1:${port}"]}}) - -(tset configurations :go - [{:type :delve - :name :Debug - :request :launch - :env {:CGO_CFLAGS :-Wno-error=cpp} - :program "${file}"} - {:type :delve - :name :DebugTest - :request :launch - :mode :test - :env {:CGO_CFLAGS :-Wno-error=cpp} - :program "${file}"} - {:type :delve - :name :DebugTerraform - :request :launch - :program "${file}" - :env {:CGO_CFLAGS :-Wno-error=cpp} - :args [:-debug]} - {:type :delve - :name :DebugTerraformAcc - :request :launch - :program "${file}" - :mode :test - :env {:CGO_CFLAGS :-Wno-error=cpp :TF_ACC :1}} - {:type :delve - :name :DebugTestSuite - :request :launch - :mode :test - :env {:CGO_CFLAGS :-Wno-error=cpp} - :program "${fileDirname}"}]) - -(set dap.defaults.fallback.external_terminal - {:command :/Applications/Alacritty.app/Contents/MacOS/alacritty - :args [:-T :dap :-e]}) - - -(dapui.setup - {:expand_lines false - :layouts - [{:position :bottom :size 10 :elements [{:id :repl :size 0.5} {:id :console :size 0.5}]} - {:position :left :size 40 :elements [{:id :breakpoints :size 0.25} {:id :stacks :size 0.25} {:id :watches :size 0.25} {:id :scopes :size 0.25}]} - {:position :bottom :size 25 :elements [{:id :repl :size 0.35} {:id :watches :size 0.65}]}]}) -(dap-py.setup nil {:console :externalTerminal}) -(tset (. configurations.python 1) :waitOnNormalExit true) -(tset (. configurations.python 1) :waitOnAbnormalExit true) - -(local run_table - {:python - (fn [fname] - { - :name (.. "Launch " fname) - :program fname - :console "externalTerminal" - :request "launch" - :type "python" - :cwd :/Users/ivi/Programming - :waitOnAbnormalExit true - :waitOnNormalExit true})}) - -(vim.keymap.set - :n - "s;" - (fn [] - (local fname (vim.fn.fnamemodify (vim.fn.bufname "%") ":p")) - (local get_config (. run_table (vim.opt_local.ft:get))) - - (set dap.defaults.fallback.external_terminal - {:command :/Applications/Alacritty.app/Contents/MacOS/alacritty - :args [:-T :dap :--working-directory (vim.fn.getcwd) :-e]}) - - (if get_config - (dap.run (get_config fname))))) - - -(vim.keymap.set :n :si (lambda [] - (dapui.toggle {:layout 1 :reset true}) - (dapui.toggle {:layout 2 :reset true})) {:silent true}) -(vim.keymap.set :n :s<enter> #(dapui.toggle {:layout 3 :reset true}) {:silent true}) -;; "breakpoints", -;; "repl", -;; "scopes", -;; "stacks", -;; "watches", -;; "hover", -;; "console",) -(vim.keymap.set :n :sfw - (lambda [] - (dapui.float_element :watches - {:width (vim.api.nvim_win_get_width 0) :height 30 :enter true}))) -(vim.keymap.set :n :sfs - (lambda [] - (dapui.float_element :scopes - {:width (vim.api.nvim_win_get_width 0) :height 30 :enter true}))) - -(vim.keymap.set :n :sq dap.terminate {:silent true}) -(vim.keymap.set :n :sc dap.continue {:silent true}) -(vim.keymap.set :n :sr dap.run_to_cursor {:silent true}) -(vim.keymap.set :n :sn dap.step_over {:silent true}) -(vim.keymap.set :n :ss dap.step_into {:silent true}) -(vim.keymap.set :n :so dap.step_out {:silent true}) -(vim.keymap.set :n :sb dap.toggle_breakpoint {:silent true}) -(vim.keymap.set :n :sB dap.set_breakpoint {:silent true}) -(vim.keymap.set :n :slp - (fn [] - (dap.set_breakpoint nil nil - (vim.fn.input "Log point message: "))) - {:silent true}) - -(vim.keymap.set :n :st dap.repl.toggle {:silent true}) -(vim.keymap.set :n :sl dap.run_last {:silent true}) diff --git a/mut/neovim/fnl/conf/pkgs/gitsigns.fnl b/mut/neovim/fnl/conf/pkgs/gitsigns.fnl deleted file mode 100644 index 813d410..0000000 --- a/mut/neovim/fnl/conf/pkgs/gitsigns.fnl +++ /dev/null @@ -1,2 +0,0 @@ -(local gitsigns (require :gitsigns)) -(gitsigns.setup) diff --git a/mut/neovim/fnl/conf/pkgs/go.fnl b/mut/neovim/fnl/conf/pkgs/go.fnl deleted file mode 100644 index 6c287e1..0000000 --- a/mut/neovim/fnl/conf/pkgs/go.fnl +++ /dev/null @@ -1,35 +0,0 @@ -(local go (require :go)) -(go.setup - { - :goimports false - :fillstruct false - :gofmt false - :max_line_len nil - :tag_transform false - :test_dir false - :comment_placeholder " " - :icons false - :verbose false - :log_path (.. (vim.fn.expand "$HOME") "/tmp/gonvim.log") - :lsp_cfg false - :lsp_gofumpt false - :lsp_on_attach nil - :lsp_keymaps false - :lsp_codelens false - :diagnostic false - :lsp_inlay_hints {:enable false} - :gopls_remote_auto false - :gocoverage_sign "█" - :sign_priority 7 - :dap_debug false - :dap_debug_gui false - :dap_debug_keymap false - :dap_vt false - :textobjects false - :gopls_cmd nil - :build_tags "" - :test_runner "go" - :run_in_floaterm false - :luasnip true - :iferr_vertical_shift 4}) - diff --git a/mut/neovim/fnl/conf/pkgs/lint.fnl b/mut/neovim/fnl/conf/pkgs/lint.fnl deleted file mode 100644 index 078dc3e..0000000 --- a/mut/neovim/fnl/conf/pkgs/lint.fnl +++ /dev/null @@ -1,24 +0,0 @@ -(local lint (require :lint)) - -(fn executable? [program] - (fn [] - (= 1 (vim.fn.executable program)))) - -(set - lint.linters_by_ft - {:markdown (if (executable? :vale) [:vale] []) - :python (if (executable? :ruff) [:ruff] []) - :sh [:shellcheck]}) - - -(local conform (require :conform)) -(conform.setup - {:formatters_by_ft - {:python [:ruff_format :isort] - :go [:goimports] - :nix [:alejandra] - :terraform [:terraform_fmt] - :hcl [:terraform_fmt]} - :format_on_save - {:timeout_ms 500 - :lsp_fallback false}}) diff --git a/mut/neovim/fnl/conf/pkgs/lsp_lines.fnl b/mut/neovim/fnl/conf/pkgs/lsp_lines.fnl deleted file mode 100644 index 7194bd9..0000000 --- a/mut/neovim/fnl/conf/pkgs/lsp_lines.fnl +++ /dev/null @@ -1,2 +0,0 @@ -(let [l (require :lsp_lines)] - (l.setup)) diff --git a/mut/neovim/fnl/conf/pkgs/lsp_signature.fnl b/mut/neovim/fnl/conf/pkgs/lsp_signature.fnl deleted file mode 100644 index 7fecc9e..0000000 --- a/mut/neovim/fnl/conf/pkgs/lsp_signature.fnl +++ /dev/null @@ -1,3 +0,0 @@ -(local lsp_signature (require :lsp_signature)) - -(lsp_signature.setup) diff --git a/mut/neovim/fnl/conf/pkgs/lspconfig.fnl b/mut/neovim/fnl/conf/pkgs/lspconfig.fnl deleted file mode 100644 index d1121f2..0000000 --- a/mut/neovim/fnl/conf/pkgs/lspconfig.fnl +++ /dev/null @@ -1,46 +0,0 @@ -(local lspconfig (require :lspconfig)) -(local configs (require :lspconfig.configs)) - -(lspconfig.nil_ls.setup {}) - -(lspconfig.rust_analyzer.setup - {:autostart false - :settings - {:rust-analyzer - {:cargo {:buildScripts {:enable true}} - :procMacro {:enable true :attributes {:enable true}} - :inlayHints {:enable true}}} - :root_dir - (lspconfig.util.root_pattern - :.git - (vim.fn.getcwd))}) - -(lspconfig.pyright.setup - {:root_dir - (lspconfig.util.root_pattern - :.git - (vim.fn.getcwd)) - :settings - {:venvPath (.. (vim.fn.getcwd) :.venv)}}) - -(lspconfig.ts_ls.setup - {:root_dir - (lspconfig.util.root_pattern - :.git - (vim.fn.getcwd))}) - -(lspconfig.gopls.setup - {:root_dir (lspconfig.util.root_pattern :.git - (vim.fn.getcwd)) - :settings {:gopls {:codelenses {:test true :bench true} - ;; Show a code lens toggling the display of gc's choices.} - :buildFlags [:-tags=all]}}}) - -(lspconfig.ansiblels.setup - {:ansible {:ansible {:path :ansible} - :executionEnvironment {:enabled false} - :python {:interpreterPath :python} - :validation {:enabled true - :lint {:enabled false - :arguments " --profile=production --write=all " - :path :ansible-lint}}}}) diff --git a/mut/neovim/fnl/conf/pkgs/lualine.fnl b/mut/neovim/fnl/conf/pkgs/lualine.fnl deleted file mode 100644 index 4f57425..0000000 --- a/mut/neovim/fnl/conf/pkgs/lualine.fnl +++ /dev/null @@ -1,17 +0,0 @@ -(local lualine (require :lualine)) -(local clients #(do - (local bn (vim.fn.fnamemodify (vim.fn.bufname :%) ::p)) - (local m (bn:match ".*clients/([a-z]+)/.*")) - (if (not= nil m) - m - ""))) -(lualine.setup - {:extensions [:quickfix :fugitive :oil :fzf :nvim-dap-ui] - :sections - {:lualine_c ["%=" {1 clients :color :WarningMsg}]} - :winbar - {:lualine_a [:filename]} - :inactive_winbar - {:lualine_a [:filename]} - :tabline - {:lualine_a [:tabs]}}) diff --git a/mut/neovim/fnl/conf/pkgs/luasnip.fnl b/mut/neovim/fnl/conf/pkgs/luasnip.fnl deleted file mode 100644 index 221c4ea..0000000 --- a/mut/neovim/fnl/conf/pkgs/luasnip.fnl +++ /dev/null @@ -1,6 +0,0 @@ -(local ls (require :luasnip)) - -(vim.keymap.set ["i"] "<C-K>" #(ls.expand) {:silent true}) -(vim.keymap.set ["i" "s"] "<C-L>" #(ls.jump 1) {:silent true}) -(vim.keymap.set ["i" "s"] "<C-J>" #(ls.jump -1) {:silent true}) -(vim.keymap.set ["i" "s"] "<C-E>" #(if (ls.choice_active) (ls.change_choice 1)) {:silent true}) diff --git a/mut/neovim/fnl/conf/pkgs/null-ls.fnl b/mut/neovim/fnl/conf/pkgs/null-ls.fnl deleted file mode 100644 index 9908823..0000000 --- a/mut/neovim/fnl/conf/pkgs/null-ls.fnl +++ /dev/null @@ -1,21 +0,0 @@ -(local lsp-conf (require :conf.lsp)) -(local null-ls (require :null-ls)) - -(local fmt null-ls.builtins.formatting) -(local diag null-ls.builtins.diagnostics) - -(fn executable? [program] - (fn [] - (= 1 (vim.fn.executable program)))) - -(null-ls.setup {:update_in_insert false - :debug true - :on_attach (fn [client buf] - (lsp-conf.attach client buf true)) - :sources [fmt.alejandra - fmt.fnlfmt - (fmt.black.with {:condition (executable? :black)}) - (fmt.goimports.with {:condition (executable? :goimports)}) - (fmt.gofumpt.with {:condition (executable? :gofumpt)}) - (fmt.raco_fmt.with {:condition (executable? :raco)}) - (fmt.terraform_fmt.with {:condition (executable? :terraform)})]}) diff --git a/mut/neovim/fnl/conf/pkgs/oil.fnl b/mut/neovim/fnl/conf/pkgs/oil.fnl deleted file mode 100644 index 7d9959e..0000000 --- a/mut/neovim/fnl/conf/pkgs/oil.fnl +++ /dev/null @@ -1,61 +0,0 @@ -(local oil (require :oil)) -(local fzf (require :fzf-lua)) - -(oil.setup - { - :default_file_explorer true - :skip_confirm_for_simple_edits true - - :columns [:size :permissions] - :view_options - { - :show_hidden false - :is_hidden_file (fn [name bufnr] - (vim.startswith name ".")) - :is_always_hidden (fn [name bufnr] false) - :sort [["type" "asc"] ["name" "asc"]]} - - - :keymaps - { - "g?" "actions.show_help" - "<CR>" "actions.select" - "<C-s>" - #(do - (vim.api.nvim_feedkeys - (vim.api.nvim_replace_termcodes - ":Sh<up><c-f>" true false true) - :n false) - (vim.schedule #(do - (vim.cmd "let v:searchforward = 0") - (vim.keymap.set :n :/ "/Sh.*" {:buffer true}) - (vim.keymap.set :n :? "?Sh.*" {:buffer true})))) - "<C-h>" "actions.select_split" - "<C-t>" "actions.select_tab" - "<C-p>" #(fzf.files) - "<C-c>" "actions.close" - "<C-l>" "actions.refresh" - "." "actions.open_cmdline" - "gx" {:callback (fn [] - (local file (oil.get_cursor_entry)) - (local dir (oil.get_current_dir)) - (if (and dir file) - (do - (vim.cmd (.. :argadd " " dir file.name) - (vim.cmd :args)))))} - "gX" {:callback (fn [] - (local file (oil.get_cursor_entry)) - (local dir (oil.get_current_dir)) - (if (and dir file) - (do - (vim.cmd (.. :argdel " " dir file.name) - (vim.cmd :args)))))} - "gc" {:callback (fn [] - (vim.cmd "argdel *") - (vim.cmd "args"))} - "-" "actions.parent" - "_" "actions.open_cwd" - "cd" "actions.cd" - "~" "actions.tcd" - "gs" "actions.change_sort" - "g." "actions.toggle_hidden"}}) diff --git a/mut/neovim/fnl/conf/pkgs/treesitter.fnl b/mut/neovim/fnl/conf/pkgs/treesitter.fnl deleted file mode 100644 index c613be0..0000000 --- a/mut/neovim/fnl/conf/pkgs/treesitter.fnl +++ /dev/null @@ -1,2 +0,0 @@ -(let [ts (require :nvim-treesitter.configs)] - (ts.setup {:highlight {:enable true}})) diff --git a/mut/neovim/fnl/conf/pkgs/venn.fnl b/mut/neovim/fnl/conf/pkgs/venn.fnl deleted file mode 100644 index 064e84e..0000000 --- a/mut/neovim/fnl/conf/pkgs/venn.fnl +++ /dev/null @@ -1,18 +0,0 @@ -;; venn.nvim: enable or disable keymappings -(fn toggle-venn [] - (if (not vim.b.venn_enabled) - (do - (set vim.b.venn_enabled true) - (vim.cmd "setlocal ve=all") ; draw a line on HJKL keystokes - (vim.keymap.set [:n] :J "<C-v>j:VBox<CR>" {:noremap true :buffer 0}) - (vim.keymap.set [:n] :K "<C-v>k:VBox<CR>" {:noremap true :buffer 0}) - (vim.keymap.set [:n] :L "<C-v>l:VBox<CR>" {:noremap true :buffer 0}) - (vim.keymap.set [:n] :H "<C-v>h:VBox<CR>" {:noremap true :buffer 0}) ; draw a box by pres]sing "f" with visual selection) - (vim.keymap.set [:v] :f ":VBox<CR>" {:noremap true :buffer 0})) - (do - (vim.cmd "setlocal ve=") - (vim.cmd "mapclear <buffer>") - (set vim.b.venn_enabled nil)))) - -; toggle keymappings for venn using <leader>v) -(vim.keymap.set [:n] :<leader>v toggle-venn {:noremap true}) diff --git a/mut/neovim/fnl/conf/settings.fnl b/mut/neovim/fnl/conf/settings.fnl deleted file mode 100644 index f6abcf1..0000000 --- a/mut/neovim/fnl/conf/settings.fnl +++ /dev/null @@ -1,74 +0,0 @@ -(import-macros {: settings : globals} :conf.macros) - -(globals - codeium_enabled false - loaded_2html_plugin true - loaded_fzf false - ;; loaded_man true - ;; loaded_gzip true - loaded_health false - loaded_matchit false - loaded_matchparen false - loaded_netrwPlugin false - loaded_rplugin false - loaded_shada false - ;; loaded_spellfile true - ;; loaded_tarPlugin true - loaded_tohtml false - loaded_tutor false - ;; loaded_zipPlugin true - - zoxide_use_select true - zoxide_hook "pwd" - mapleader " " - maplocalleader " " - dirvish_mode ":sort | sort ,^.*[^/]$, r") - -(settings - grepprg "rg --vimgrep" - grepformat "%f:%l:%c:%m" - +shortmess "c" - +diffopt vertical - +isfname "@-@" - wmw 10 - inccommand split - signcolumn yes - smd off - scrolloff 8 - termguicolors on - incsearch on - undofile on - undodir (.. (os.getenv :HOME) :/.local/share/nvim/undo) - backup off - backupcopy yes - swapfile off - wrap off - splitbelow on - magic on - showbreak "+++" - ; listchars {:eol ""} - list on - autoread on - autoindent on - smartindent on - expandtab on - tabstop 4 - softtabstop 4 - shiftwidth 4 - hidden on - number on - relativenumber on - exrc on - secure on - ; completeopt "menu,longest,preview" - wmnu on - wop "pum" - ; wildmode "list:longest" - complete ".,w,k,kspell,b" - foldopen "block,hor,jump,mark,percent,quickfix,search,tag" - laststatus 3 - ; winbar "%=%m %f" - winbar "" - hlsearch off - showtabline 1 - cmdheight 1) diff --git a/mut/neovim/fnl/conf/test.sh b/mut/neovim/fnl/conf/test.sh deleted file mode 100644 index 6d94847..0000000 --- a/mut/neovim/fnl/conf/test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -echo "##vso[task.setvariable variable=version;isOutput=true]$VERSION"; -cd "$CHART_CONTEXT_PATH" || { echo "Coulnd't find ./destination"; ls; exit 1; } -case "$BUILD_SOURCEBRANCH" in - refs/heads/*) - echo "Seting version to sha prerelease $VERSION" - yq -i ' - .appVersion = ("'"$VERSION"'" | . style="double") - | .version = "0.0.0-'"$VERSION"'" - ' Chart.yaml - ;; - refs/tags/*) - echo "Seting version to tag $VERSION" - yq -i ' - .appVersion = ("'"$VERSION"'" | . style="double") - | .version = "'"$VERSION"'" - ' Chart.yaml - ;; -esac -cd .. diff --git a/mut/neovim/init.fnl b/mut/neovim/init.fnl deleted file mode 100644 index a46445c..0000000 --- a/mut/neovim/init.fnl +++ /dev/null @@ -1 +0,0 @@ -(require :conf) diff --git a/mut/neovim/init.lua b/mut/neovim/init.lua index bf643df..7ab99c8 100644 --- a/mut/neovim/init.lua +++ b/mut/neovim/init.lua @@ -1 +1 @@ -return require("conf")
\ No newline at end of file +return require("my") diff --git a/profiles/core/git.nix b/profiles/core/git.nix index a09552f..f651f65 100644 --- a/profiles/core/git.nix +++ b/profiles/core/git.nix @@ -19,7 +19,7 @@ with lib; { }; includes = let - no-reply-email = { + gh-no-reply-email = { user = { email = "59492084+ivi-vink@users.noreply.github.com"; }; @@ -27,11 +27,11 @@ with lib; { in [ { condition = "hasconfig:remote.*.url:git@github.com:**/**"; - contents = no-reply-email; + contents = gh-no-reply-email; } { condition = "hasconfig:remote.*.url:https://github.com/**/**"; - contents = no-reply-email; + contents = gh-no-reply-email; } ]; diff --git a/profiles/core/neovim.nix b/profiles/core/neovim.nix index a9be1c4..9e32c93 100644 --- a/profiles/core/neovim.nix +++ b/profiles/core/neovim.nix @@ -90,10 +90,9 @@ cmp_luasnip # trying out lisp - # conjure + conjure vim-racket nvim-parinfer - hotpot-nvim ]; }; }; |
