From f3111fdcaaa3c1026b7a9129180d1904e430f8c5 Mon Sep 17 00:00:00 2001 From: Leon Kowarschick Date: Fri, 6 Oct 2023 13:24:40 +0200 Subject: [PATCH] Move to new structure of lazy.vim --- nvim/.config/nvim/.gitignore | 1 + nvim/.config/nvim/.nfnl.fnl | 2 + nvim/.config/nvim/fnl/dots/colors.fnl | 78 ++- nvim/.config/nvim/fnl/dots/help-thingy.fnl | 115 ++--- nvim/.config/nvim/fnl/dots/keybinds.fnl | 32 +- nvim/.config/nvim/fnl/dots/plugins.fnl | 267 ---------- .../nvim/fnl/dots/plugins/bufferline.fnl | 100 ++-- nvim/.config/nvim/fnl/dots/plugins/cmp.fnl | 123 +++-- .../.config/nvim/fnl/dots/plugins/copilot.fnl | 27 +- nvim/.config/nvim/fnl/dots/plugins/crates.fnl | 21 +- .../nvim/fnl/dots/plugins/diffview.fnl | 27 +- nvim/.config/nvim/fnl/dots/plugins/emmet.fnl | 3 +- nvim/.config/nvim/fnl/dots/plugins/feline.fnl | 55 ++- .../nvim/fnl/dots/plugins/gitsigns.fnl | 41 +- nvim/.config/nvim/fnl/dots/plugins/glance.fnl | 11 +- .../nvim/fnl/dots/plugins/gruvbox8.fnl | 225 ++++----- nvim/.config/nvim/fnl/dots/plugins/lsp.fnl | 458 +++++++++--------- .../.config/nvim/fnl/dots/plugins/ltex-ls.fnl | 32 +- nvim/.config/nvim/fnl/dots/plugins/neogit.fnl | 13 +- nvim/.config/nvim/fnl/dots/plugins/noice.fnl | 79 +-- .../nvim/fnl/dots/plugins/nvim-colorizer.fnl | 33 +- .../nvim/fnl/dots/plugins/persistence.fnl | 14 +- .../.config/nvim/fnl/dots/plugins/plugins.fnl | 197 ++++++++ nvim/.config/nvim/fnl/dots/plugins/sneak.fnl | 6 +- .../nvim/fnl/dots/plugins/symbols-outline.fnl | 7 +- .../nvim/fnl/dots/plugins/telescope.fnl | 33 +- .../nvim/fnl/dots/plugins/todo-comments.fnl | 7 +- .../nvim/fnl/dots/plugins/treesitter.fnl | 103 ++-- .../.config/nvim/fnl/dots/plugins/trouble.fnl | 9 +- .../nvim/fnl/dots/plugins/twilight.fnl | 6 +- nvim/.config/nvim/fnl/dots/plugins/vimtex.fnl | 2 +- .../nvim/fnl/dots/plugins/zen-mode.fnl | 5 +- .../nvim/fnl/dots/smart-compe-conjure.fnl | 107 ++-- nvim/.config/nvim/fnl/dots/utils.fnl | 116 +++-- nvim/.config/nvim/fnl/init.fnl | 31 +- nvim/.config/nvim/fnl/macros.fnl | 28 +- nvim/.config/nvim/init.lua | 19 +- nvim/.config/nvim/lazy-lock.json | 14 +- 38 files changed, 1256 insertions(+), 1191 deletions(-) create mode 100644 nvim/.config/nvim/.nfnl.fnl delete mode 100644 nvim/.config/nvim/fnl/dots/plugins.fnl create mode 100644 nvim/.config/nvim/fnl/dots/plugins/plugins.fnl diff --git a/nvim/.config/nvim/.gitignore b/nvim/.config/nvim/.gitignore index 6778162..70bfd1b 100644 --- a/nvim/.config/nvim/.gitignore +++ b/nvim/.config/nvim/.gitignore @@ -1,2 +1,3 @@ lua plugin +lua-old diff --git a/nvim/.config/nvim/.nfnl.fnl b/nvim/.config/nvim/.nfnl.fnl new file mode 100644 index 0000000..311847d --- /dev/null +++ b/nvim/.config/nvim/.nfnl.fnl @@ -0,0 +1,2 @@ +{} + diff --git a/nvim/.config/nvim/fnl/dots/colors.fnl b/nvim/.config/nvim/fnl/dots/colors.fnl index 7f04176..ad7acae 100644 --- a/nvim/.config/nvim/fnl/dots/colors.fnl +++ b/nvim/.config/nvim/fnl/dots/colors.fnl @@ -1,40 +1,38 @@ -(module dots.colors - {} - {:bg_main (if (= "epix" (vim.fn.hostname)) "#1d2021" "#282828") - :bg_second (if (= "epix" (vim.fn.hostname)) "#181A1B" "#1d2021") - :dark0_hard "#1d2021" - :dark0 "#282828" - :dark0_soft "#32302f" - :dark1 "#3c3836" - :dark2 "#504945" - :dark3 "#665c54" - :dark4 "#7c6f64" - :light0_hard "#f9f5d7" - :light0 "#fbf1c7" - :light0_soft "#f2e5bc" - :light1 "#ebdbb2" - :light2 "#d5c4a1" - :light3 "#bdae93" - :light4 "#a89984" - :bright_red "#fb4934" - :bright_green "#b8bb26" - :bright_yellow "#fabd2f" - :bright_blue "#83a598" - :bright_purple "#d3869b" - :bright_aqua "#8ec07c" - :bright_orange "#fe8019" - :neutral_red "#cc241d" - :neutral_green "#98971a" - :neutral_yellow "#d79921" - :neutral_blue "#458588" - :neutral_purple "#b16286" - :neutral_aqua "#689d6a" - :neutral_orange "#d65d0e" - :faded_red "#9d0006" - :faded_green "#79740e" - :faded_yellow "#b57614" - :faded_blue "#076678" - :faded_purple "#8f3f71" - :faded_aqua "#427b58" - :faded_orange "#af3a03" - :gray "#928374"}) +{:bg_main (if (= "epix" (vim.fn.hostname)) "#1d2021" "#282828") + :bg_second (if (= "epix" (vim.fn.hostname)) "#181A1B" "#1d2021") + :dark0_hard "#1d2021" + :dark0 "#282828" + :dark0_soft "#32302f" + :dark1 "#3c3836" + :dark2 "#504945" + :dark3 "#665c54" + :dark4 "#7c6f64" + :light0_hard "#f9f5d7" + :light0 "#fbf1c7" + :light0_soft "#f2e5bc" + :light1 "#ebdbb2" + :light2 "#d5c4a1" + :light3 "#bdae93" + :light4 "#a89984" + :bright_red "#fb4934" + :bright_green "#b8bb26" + :bright_yellow "#fabd2f" + :bright_blue "#83a598" + :bright_purple "#d3869b" + :bright_aqua "#8ec07c" + :bright_orange "#fe8019" + :neutral_red "#cc241d" + :neutral_green "#98971a" + :neutral_yellow "#d79921" + :neutral_blue "#458588" + :neutral_purple "#b16286" + :neutral_aqua "#689d6a" + :neutral_orange "#d65d0e" + :faded_red "#9d0006" + :faded_green "#79740e" + :faded_yellow "#b57614" + :faded_blue "#076678" + :faded_purple "#8f3f71" + :faded_aqua "#427b58" + :faded_orange "#af3a03" + :gray "#928374"} diff --git a/nvim/.config/nvim/fnl/dots/help-thingy.fnl b/nvim/.config/nvim/fnl/dots/help-thingy.fnl index 249a818..facc0a6 100644 --- a/nvim/.config/nvim/fnl/dots/help-thingy.fnl +++ b/nvim/.config/nvim/fnl/dots/help-thingy.fnl @@ -1,67 +1,68 @@ -(module dots.help-thingy - {autoload {utils dots.utils - a aniseed.core - str aniseed.string - popup popup - ts nvim-treesitter} - require-macros [macros]}) +(fn help-thingy-kram [] + (local {: autoload} (require :nfnl.module)) + (local utils (autoload :dots.utils)) + (local a (autoload :aniseed.core)) + (local str (autoload :aniseed.string)) + (local popup (autoload :popup)) + (local ts (autoload :nvim-treesitter)) -(defn pop [text ft] - "Open a popup with the given text and filetype" - (var width 20) - (each [_ line (ipairs text)] - (set width (math.max width (length line)))) - (let [bufnr (vim.api.nvim_create_buf false true)] - (vim.api.nvim_buf_set_option bufnr :bufhidden "wipe") - (vim.api.nvim_buf_set_option bufnr :filetype ft) - (vim.api.nvim_buf_set_lines bufnr 0 -1 true text) - (popup.create bufnr {:padding [1 1 1 1] :width width}))) + (defn pop [text ft] + "Open a popup with the given text and filetype" + (var width 20) + (each [_ line (ipairs text)] + (set width (math.max width (length line)))) + (let [bufnr (vim.api.nvim_create_buf false true)] + (vim.api.nvim_buf_set_option bufnr :bufhidden "wipe") + (vim.api.nvim_buf_set_option bufnr :filetype ft) + (vim.api.nvim_buf_set_lines bufnr 0 -1 true text) + (popup.create bufnr {:padding [1 1 1 1] :width width}))) -(defn get-current-word [] - "Return the word the cursor is currently hovering over" - (let [col (. (vim.api.nvim_win_get_cursor 0) 2) - line (vim.api.nvim_get_current_line)] - (.. (vim.fn.matchstr (line:sub 1 (+ col 1)) "\\k*$") - (string.sub (vim.fn.matchstr (line:sub (+ col 1)) "^\\k*") - 2)))) -(def helpfiles-path (str.join "/" (a.butlast (str.split vim.o.helpfile "/")))) + (defn get-current-word [] + "Return the word the cursor is currently hovering over" + (let [col (. (vim.api.nvim_win_get_cursor 0) 2) + line (vim.api.nvim_get_current_line)] + (.. (vim.fn.matchstr (line:sub 1 (+ col 1)) "\\k*$") + (string.sub (vim.fn.matchstr (line:sub (+ col 1)) "^\\k*") + 2)))) + (def helpfiles-path (str.join "/" (a.butlast (str.split vim.o.helpfile "/")))) -(def tags - (var entries {}) - (each [line _ (io.lines (.. helpfiles-path "/tags"))] - (let [[key file address] (str.split line "\t")] - (tset entries key {:file (.. helpfiles-path "/" file) :address address}))) - entries) + (def tags + (var entries {}) + (each [line _ (io.lines (.. helpfiles-path "/tags"))] + (let [[key file address] (str.split line "\t")] + (tset entries key {:file (.. helpfiles-path "/" file) :address address}))) + entries) -(defn find-help-tag-for [topic] - (or (. tags topic) - (. tags (.. topic "()")) - (. tags (.. (string.gsub topic "vim%.api%." "") "()")) - (. tags (.. (string.gsub topic "vim%.fn%." "") "()")) - (. tags (.. (string.gsub topic "fn%." "") "()")) - (. tags (.. (string.gsub topic "vim%.o%." "") "()")) - (. tags (.. (string.gsub topic "vim%.b%." "") "()")) - (. tags (.. (string.gsub topic "vim%.g%." "") "()")))) + (defn find-help-tag-for [topic] + (or (. tags topic) + (. tags (.. topic "()")) + (. tags (.. (string.gsub topic "vim%.api%." "") "()")) + (. tags (.. (string.gsub topic "vim%.fn%." "") "()")) + (. tags (.. (string.gsub topic "fn%." "") "()")) + (. tags (.. (string.gsub topic "vim%.o%." "") "()")) + (. tags (.. (string.gsub topic "vim%.b%." "") "()")) + (. tags (.. (string.gsub topic "vim%.g%." "") "()")))) -(defn help-for-tag [tag] - (var data nil) - (each [line _ (io.lines tag.file)] - (if (= nil data) - (when (~= -1 (vim.fn.match line (tag.address:sub 2))) - (set data [line])) - (if (or (> 2 (length data)) - (= "" line) - (= " " (line:sub 1 1)) - (= "\t" (line:sub 1 1)) - (= "<" (line:sub 1 1))) - (table.insert data line) - (lua "return data"))))) + (defn help-for-tag [tag] + (var data nil) + (each [line _ (io.lines tag.file)] + (if (= nil data) + (when (~= -1 (vim.fn.match line (tag.address:sub 2))) + (set data [line])) + (if (or (> 2 (length data)) + (= "" line) + (= " " (line:sub 1 1)) + (= "\t" (line:sub 1 1)) + (= "<" (line:sub 1 1))) + (table.insert data line) + (lua "return data"))))) -(fn _G.get_help [] - (if-let [help-tag (find-help-tag-for (get-current-word))] - (pop (help-for-tag help-tag) :help))) + (fn _G.get_help [] + (if-let [help-tag (find-help-tag-for (get-current-word))] + (pop (help-for-tag help-tag) :help))) -(utils.keymap :n :ML ":call v:lua.get_help()") + (utils.keymap :n :ML ":call v:lua.get_help()")) +[] diff --git a/nvim/.config/nvim/fnl/dots/keybinds.fnl b/nvim/.config/nvim/fnl/dots/keybinds.fnl index 955417a..c5fe7c7 100644 --- a/nvim/.config/nvim/fnl/dots/keybinds.fnl +++ b/nvim/.config/nvim/fnl/dots/keybinds.fnl @@ -1,14 +1,12 @@ -(module dots.keybinds - {autoload {a aniseed.core - str aniseed.string - nvim aniseed.nvim - utils dots.utils - wk which-key - treesitter-selection nvim-treesitter.incremental_selection - lspactions lspactions - glance glance - crates crates} - require-macros [macros]}) +(import-macros {: al} :macros) +(al a nfnl.core) +(al str nfnl.string) +(al utils dots.utils) +(al wk which-key) +; (al treesitter-selection nvim-treesitter.incremental_selection) +(al lspactions lspactions) +(al glance glance) +(al crates crates) ; undo autopairs fuckup (set vim.g.AutoPairsShortcutBackInsert "") @@ -52,7 +50,7 @@ ;(utils.keymap [:n] :j "gj") ;(utils.keymap [:n] :k "gk") -(defn open-selection-zotero [] +(fn open-selection-zotero [] (let [(_ _ sel) (utils.get-selection)] (vim.cmd (.. "silent !xdg-open zotero://select/items/@" (str.join sel))))) @@ -62,21 +60,21 @@ (fn rebind [s desc] [s desc]) -(defn format [] +(fn format [] (if (a.some #$1.server_capabilities.documentFormattingProvider (vim.lsp.get_active_clients)) (vim.lsp.buf.format {:async true}) (vim.cmd "Neoformat"))) -(defn open-rename [] +(fn open-rename [] (vim.api.nvim_feedkeys (.. ":IncRename " (vim.fn.expand "")) "n" "")) -(defn toggle-lsp-lines [] +(fn toggle-lsp-lines [] (let [lsp-lines (require "lsp_lines")] (vim.diagnostic.config {:virtual_lines (not (. (vim.diagnostic.config) :virtual_lines))}) ; TODO: this doesn't seem to work... (vim.diagnostic.config {:virtual_text (not (. (vim.diagnostic.config) :virtual_lines))}))) -(defn toggle-lsp-lines-current [] +(fn toggle-lsp-lines-current [] (let [lsp-lines (require "lsp_lines")] (vim.diagnostic.config {:virtual_lines {:only_current_line true}}))) @@ -191,5 +189,5 @@ :mode "v"}) -(set nvim.o.timeoutlen 200) +(set vim.o.timeoutlen 200) diff --git a/nvim/.config/nvim/fnl/dots/plugins.fnl b/nvim/.config/nvim/fnl/dots/plugins.fnl deleted file mode 100644 index 83b78bf..0000000 --- a/nvim/.config/nvim/fnl/dots/plugins.fnl +++ /dev/null @@ -1,267 +0,0 @@ -(module dots.plugins - {autoload {a aniseed.core - lazy lazy} - require-macros [macros]}) - - - -(defn- safe-req-conf [name] - "safely require a plugins configuration module, prepending 'dots.plugins.' to the given module name" - (let [(ok? val-or-err) (pcall require (.. "dots.plugins." name))] - (when (not ok?) - (print (.. "Plugin config error: " val-or-err))))) - -(defn setup-lazy [...] - (let [pkgs [...]] - (local args []) - (for [i 1 (a.count pkgs) 2] - (let [name (. pkgs i) - opts (. pkgs (+ i 1))] - (table.insert args (a.assoc opts 1 name)))) - (lazy.setup args {:colorscheme "gruvbox8"}))) - - - -(macro cfg [config-mod opts] - (let [a (require "aniseed.core")] - (a.assoc (or opts {}) - :opt `false - :config `#(require ,config-mod)))) - -(macro setup [name opts] - `((. (require ,name) :setup) ,opts)) - -(setup-lazy - ; TODO sort me pls - - ; sorted from here! - :Olical/aniseed {:branch "develop"} - ; :lewis6991/impatient.nvim {} - :nvim-lua/plenary.nvim {} - :norcalli/nvim.lua {} - :lifepillar/vim-gruvbox8 {:lazy false :priority 1000 :config #(require "dots.plugins.gruvbox8")} - :kyazdani42/nvim-web-devicons {} - :folke/which-key.nvim {} - :folke/todo-comments.nvim {:lazy true - :event "VeryLazy" - :config #(require "dots.plugins.todo-comments")} - - :Famiu/feline.nvim {:config #(require "dots.plugins.feline")} - :akinsho/nvim-bufferline.lua {:config #(require "dots.plugins.bufferline") - :tag "v1.1.1"} - :ckipp01/nvim-jenkinsfile-linter {:dependencies ["nvim-lua/plenary.nvim"]} - - :psliwka/vim-smoothie {} - :norcalli/nvim-colorizer.lua {:event "VeryLazy" - :lazy true - :config #(require "dots.plugins.nvim-colorizer")} - :nathanaelkane/vim-indent-guides {:cmd ["IndentGuidesToggle"]} - :luukvbaal/stabilize.nvim {:config #(setup :stabilize)} - - :stevearc/dressing.nvim {:config #(setup :dressing)} - - :tweekmonster/startuptime.vim {:cmd ["StartupTime"]} - :folke/noice.nvim {:config #(require "dots.plugins.noice") - :dependencies [:MunifTanjim/nui.nvim]} - :folke/persistence.nvim {:config #(require "dots.plugins.persistence")} - :folke/zen-mode.nvim {:config #(require "dots.plugins.zen-mode") - :cmd ["ZenMode"]} - :folke/twilight.nvim {:config #(require "dots.plugins.twilight")} - :moll/vim-bbye {:lazy true :cmd [:Bdelete :Bwipeout]} - :nvim-telescope/telescope.nvim {:config #(require "dots.plugins.telescope") - :cmd ["Telescope"] - :dependencies [:nvim-lua/popup.nvim - :nvim-lua/plenary.nvim]} - - :petertriho/nvim-scrollbar {:event "VeryLazy" - :lazy true - :config #(setup :scrollbar)} - - "https://git.sr.ht/~whynothugo/lsp_lines.nvim" {:config #(do (setup :lsp_lines) - (vim.diagnostic.config {:virtual_lines false}))} - - - ; editing and movement <<< - :jiangmiao/auto-pairs {} - :tpope/vim-repeat {} - :preservim/nerdcommenter {:event "VeryLazy" - :lazy true - :priority 1000} - :godlygeek/tabular {:cmd ["Tabularize"]} - :tpope/vim-surround {} - :hauleth/sad.vim {} - :wellle/targets.vim {} ; more text objects. IE: cin (change in next parens). generally better handling of surrounding objects. - :mg979/vim-visual-multi {:lazy true :event "VeryLazy"} - :tommcdo/vim-exchange {} - :phaazon/hop.nvim {:lazy true - :event "VeryLazy" - :config #(setup "hop" {:keys "jfkdls;amvieurow"})} - ;:justinmk/vim-sneak {:lazy true} - ;:config #(require "dots.plugins.sneak")} - ; >>> - - ; treesitter <<< - :nvim-treesitter/nvim-treesitter {:config #(require "dots.plugins.treesitter") - :lazy true - :event ["VeryLazy"] - :build ":TSUpdate"} - :RRethy/nvim-treesitter-textsubjects {:dependencies [:nvim-treesitter/nvim-treesitter] - :lazy true - :event ["VeryLazy"]} - - :JoosepAlviste/nvim-ts-context-commentstring {:event ["VeryLazy"] - :lazy true - :dependencies [:nvim-treesitter/nvim-treesitter]} - - :nvim-treesitter/playground {:event ["VeryLazy"] - :lazy true - :dependencies [:nvim-treesitter/nvim-treesitter]} - ; >>> - - ; debugger <<< - :rcarriga/nvim-dap-ui {:lazy true - :config #(setup :dapui) - :dependencies [:mfussenegger/nvim-dap]} - :mfussenegger/nvim-dap {:lazy true} - :nvim-telescope/telescope-dap.nvim {:lazy true - :dependencies [:nvim-telescope/telescope.nvim - :mfussenegger/nvim-dap]} - - - - ; >>> - - ; git stuff <<< - :ldelossa/gh.nvim {:lazy true - :config #(do ((. (require "litee.lib") :setup)) - ((. (require "litee.gh") :setup))) - :dependencies [:ldelossa/litee.nvim]} - :pwntester/octo.nvim {:lazy true - :dependencies [:nvim-lua/plenary.nvim - :nvim-telescope/telescope.nvim - :kyazdani42/nvim-web-devicons] - :config #(setup :octo)} - :sindrets/diffview.nvim {:cmd ["DiffviewOpen" "DiffviewToggleFiles"] - :config #(require "dots.plugins.diffview")} - - :lewis6991/gitsigns.nvim {:dependencies [:vim-gruvbox8 - :petertriho/nvim-scrollbar] - :config #(require "dots.plugins.gitsigns")} - - - - :ruanyl/vim-gh-line {} - :rhysd/conflict-marker.vim {} - :tpope/vim-fugitive {:lazy true :event "VeryLazy"} - :TimUntersberger/neogit {:config #(require "dots.plugins.neogit") - :cmd ["Neogit"]} - - ; >>> - - ; lsp <<< - :ray-x/lsp_signature.nvim {:event :BufEnter} - :weilbith/nvim-code-action-menu {:cmd "CodeActionMenu" - :config #(set vim.g.code_action_menu_show_details false)} - - :folke/trouble.nvim {:lazy true - :config #(require "dots.plugins.trouble") - :cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"]} - - ; :elkowar/trouble.nvim {:branch "fix_error_on_nil_window" - ; :config #(require "dots.plugins.trouble") - ; :cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"]} - - :simrat39/symbols-outline.nvim {:lazy true - :cmd ["SymbolsOutline" "SymbolsOutlineClose" "SymbolsOutlineOpen"] - :config #(require "dots.plugins.symbols-outline")} - - :neovim/nvim-lspconfig {:event "VeryLazy" - :lazy true} - - :smjonas/inc-rename.nvim {:config #(setup :inc_rename {:input_buffer_type "dressing"})} - :dnlhc/glance.nvim {:lazy true :config #(require "dots.plugins.glance")} - ; >>> - - ; cmp <<< - :hrsh7th/vim-vsnip {:lazy true :event ["VeryLazy"]} - :hrsh7th/vim-vsnip-integ {:lazy true :event ["VeryLazy"]} - :rafamadriz/friendly-snippets {} - - :hrsh7th/nvim-cmp {:lazy true - :event ["VeryLazy"] - :dependencies [[:hrsh7th/cmp-nvim-lsp] - [:hrsh7th/cmp-buffer] - [:hrsh7th/cmp-vsnip] - [:hrsh7th/cmp-nvim-lua] - [:hrsh7th/cmp-calc] - [:hrsh7th/cmp-path] - [:hrsh7th/cmp-nvim-lsp-signature-help] - [:davidsierradz/cmp-conventionalcommits] - [:hrsh7th/cmp-omni]] - :config #(require "dots.plugins.cmp")} - ; >>> - - ; code-related ----------------------------------------- <<< - ;:github/copilot.vim {:cmd ["Copilot"]} - :zbirenbaum/copilot.lua {:cmd "Copilot" - :event "InsertEnter" - :config #(require "dots.plugins.copilot")} - - :monkoose/nvlime {:ft ["lisp"] :dependencies [:monkoose/parsley]} - - :tpope/vim-sleuth {} - :editorconfig/editorconfig-vim {} - :pechorin/any-jump.vim {} - :sbdchd/neoformat {} - :elkowar/antifennel-nvim {:config #(set vim.g.antifennel_executable "/home/leon/tmp/antifennel/antifennel")} - :Olical/conjure {:ft ["fennel"]} - :eraserhd/parinfer-rust {:build "cargo build --release"} - - :lervag/vimtex {:ft ["latex" "tex"] - :config #(require :dots.plugins.vimtex)} - :kmonad/kmonad-vim {} - :elkowar/yuck.vim {:ft ["yuck"]} - :cespare/vim-toml {:ft ["toml"]} - :bduggan/vim-raku {:ft ["raku"]} - :LnL7/vim-nix {:ft ["nix"]} - :kevinoid/vim-jsonc {} - :pangloss/vim-javascript {:ft ["javascript"]} ; syntax highlighting JS - :ianks/vim-tsx {:ft ["typescript-react"]} - :leafgarland/typescript-vim {:ft ["typescript" "typescript-react" "javascript"]} - :HerringtonDarkholme/yats.vim {} ; typescript syntax highlighting - :mxw/vim-jsx {} - :mattn/emmet-vim {:lazy true - :config #(require "dots.plugins.emmet")} - :purescript-contrib/purescript-vim {:ft ["purescript"]} - :derekelkins/agda-vim {:ft ["agda"]} - :neovimhaskell/haskell-vim { :ft ["haskell"]} - :monkoose/nvlime {:ft ["lisp"] :dependencies ["monkoose/parsley"] :config #(set vim.g.vlime_overlay "slimv")} - - - :rust-lang/rust.vim {:ft ["rust"] - :dependencies ["mattn/webapi-vim"] - :config #(do (set vim.g.rustfmt_fail_silently 1))} - - :simrat39/rust-tools.nvim {:ft ["rust" "toml"] - :dependencies ["nvim-lua/popup.nvim" "nvim-lua/plenary.nvim"]} - - :Saecki/crates.nvim {:dependencies ["nvim-lua/plenary.nvim"] - :dir "/Users/leon/tmp/crates.nvim" - :event ["BufRead Cargo.toml"] - :lazy true - :config #(require :dots.plugins.crates)} - - :qnighy/lalrpop.vim {} - :edwinb/idris2-vim {:ft ["idris2"]} - :vmchale/ats-vim {:ft ["ats" "dats" "sats"]} - :bakpakin/fennel.vim {:ft ["fennel"]} - :evanleck/vim-svelte {}) - - -; >>> - -;(require "packer_compiled") - -; vim:foldmarker=<<<,>>> - - diff --git a/nvim/.config/nvim/fnl/dots/plugins/bufferline.fnl b/nvim/.config/nvim/fnl/dots/plugins/bufferline.fnl index d2561d5..9481fc0 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/bufferline.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/bufferline.fnl @@ -1,57 +1,59 @@ -(module dots.plugins.bufferline - {autoload {a aniseed.core - nvim aniseed.nvim - utils dots.utils - colors dots.colors - bufferline bufferline} - require-macros [macros]}) +(import-macros {: al} :macros) +(al a nfnl.core) +(al utils dots.utils) +(al colors dots.colors) +(al bufferline bufferline) -; :h bufferline-lua-highlights -(let [selected {:guibg colors.neutral_aqua :guifg colors.bg_main :gui "NONE"} - visible {:guibg colors.dark1 :guifg colors.neutral_aqua}] - (bufferline.setup - {:options - {:diagnostics "nvim_lsp" - :diagnostics_indicator (fn [cnt lvl diagnostics-dict] (.. " (" cnt ")")) - :show_buffer_close_icons false - :show_buffer_icons false - :show_close_icon false - :show_tab_indicators false - :enforce_regular_tabs false - :tab_size 10} +(fn setup [] + ; :h bufferline-lua-highlights + (let [selected {:guibg colors.neutral_aqua :guifg colors.bg_main :gui "NONE"} + visible {:guibg colors.dark1 :guifg colors.neutral_aqua}] + (bufferline.setup + {:options + {:diagnostics "nvim_lsp" + :diagnostics_indicator (fn [cnt lvl diagnostics-dict] (.. " (" cnt ")")) + :show_buffer_close_icons false + :show_buffer_icons false + :show_close_icon false + :show_tab_indicators false + :enforce_regular_tabs false + :tab_size 10} - ; https://github.com/akinsho/nvim-bufferline.lua/blob/4ebab39af2376b850724dd29c29579c8e024abe6/lua/bufferline/config.lua#L74 - :highlights - {:fill {:guibg colors.bg_main :guifg colors.light0} - :background visible - :buffer_visible visible - :buffer_selected selected - :modified visible :modified_selected selected :modified_visible visible - :info visible :info_selected selected :info_visible visible - :warning visible :warning_selected selected :warning_visible visible - :error visible :error_selected selected :error_visible visible - :duplicate visible :duplicate_selected selected :duplicate_visible visible + ; https://github.com/akinsho/nvim-bufferline.lua/blob/4ebab39af2376b850724dd29c29579c8e024abe6/lua/bufferline/config.lua#L74 + :highlights + {:fill {:guibg colors.bg_main :guifg colors.light0} + :background visible + :buffer_visible visible + :buffer_selected selected + :modified visible :modified_selected selected :modified_visible visible + :info visible :info_selected selected :info_visible visible + :warning visible :warning_selected selected :warning_visible visible + :error visible :error_selected selected :error_visible visible + :duplicate visible :duplicate_selected selected :duplicate_visible visible - :diagnostic {:guibg colors.dark1 :guifg colors.neutral_red} - :diagnostic_visible {:guibg colors.dark1 :guifg colors.neutral_red} - :diagnostic_selected {:guibg colors.neutral_aqua :guifg colors.faded_redu} + :diagnostic {:guibg colors.dark1 :guifg colors.neutral_red} + :diagnostic_visible {:guibg colors.dark1 :guifg colors.neutral_red} + :diagnostic_selected {:guibg colors.neutral_aqua :guifg colors.faded_redu} - :info_diagnostic {:guibg colors.dark1 :guifg colors.neutral_blue} - :info_diagnostic_visible {:guibg colors.dark1 :guifg colors.neutral_blue} - :info_diagnostic_selected {:guibg colors.neutral_aqua :guifg colors.faded_blue} + :info_diagnostic {:guibg colors.dark1 :guifg colors.neutral_blue} + :info_diagnostic_visible {:guibg colors.dark1 :guifg colors.neutral_blue} + :info_diagnostic_selected {:guibg colors.neutral_aqua :guifg colors.faded_blue} - :warning_diagnostic {:guibg colors.dark1 :guifg colors.neutral_yellow} - :warning_diagnostic_visible {:guibg colors.dark1 :guifg colors.neutral_yellow} - :warning_diagnostic_selected {:guibg colors.neutral_aqua :guifg colors.faded_yellow} + :warning_diagnostic {:guibg colors.dark1 :guifg colors.neutral_yellow} + :warning_diagnostic_visible {:guibg colors.dark1 :guifg colors.neutral_yellow} + :warning_diagnostic_selected {:guibg colors.neutral_aqua :guifg colors.faded_yellow} - :error_diagnostic {:guibg colors.dark1 :guifg colors.neutral_red} - :error_diagnostic_visible {:guibg colors.dark1 :guifg colors.neutral_red} - :error_diagnostic_selected {:guibg colors.neutral_aqua :guifg colors.red} + :error_diagnostic {:guibg colors.dark1 :guifg colors.neutral_red} + :error_diagnostic_visible {:guibg colors.dark1 :guifg colors.neutral_red} + :error_diagnostic_selected {:guibg colors.neutral_aqua :guifg colors.red} - :separator visible - :indicator_selected {:guibg colors.neutral_aqua :guifg colors.neutral_aqua} + :separator visible + :indicator_selected {:guibg colors.neutral_aqua :guifg colors.neutral_aqua} - ; stuff I've never seen before :thonk: - :pick_selected {:guibg colors.bright_red :guifg colors.bright_red} - :tab_selected {:guibg colors.bright_green :guifg colors.bright_green} - :tab {:guibg colors.bright_yellow :guifg colors.bright_yellow}}})) + ; stuff I've never seen before :thonk: + :pick_selected {:guibg colors.bright_red :guifg colors.bright_red} + :tab_selected {:guibg colors.bright_green :guifg colors.bright_green} + :tab {:guibg colors.bright_yellow :guifg colors.bright_yellow}}}))) + +[(utils.plugin :akinsho/nvim-bufferline.lua + {:config setup :tag "v1.1.1"})] diff --git a/nvim/.config/nvim/fnl/dots/plugins/cmp.fnl b/nvim/.config/nvim/fnl/dots/plugins/cmp.fnl index d681127..41df439 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/cmp.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/cmp.fnl @@ -1,57 +1,74 @@ -(module dots.plugins.cmp - {autoload {a aniseed.core - cmp cmp}}) - -; check this for coloring maybe -; https://github.com/hrsh7th/nvim-cmp/blob/ada9ddeff71e82ad0e52c9a280a1e315a8810b9a/lua/cmp/entry.lua#L199 -(defn item-formatter [item vim-item] - (let [padding (string.rep " " (- 10 (vim.fn.strwidth vim-item.abbr))) - details (?. item :completion_item :detail)] - (when details - (set vim-item.abbr (.. vim-item.abbr padding " " details)))) - vim-item) +(import-macros {: al} :macros) +(al a nfnl.core) +(al cmp cmp) +(al utils dots.utils) -(cmp.setup - {:snippet {:expand (fn [args] ((. vim.fn :vsnip#anonymous) args.body))} - - :completion {:autocomplete false} - - :mapping (cmp.mapping.preset.insert - {: (cmp.mapping.scroll_docs -4) - : (cmp.mapping.scroll_docs 4) - : (cmp.mapping.complete) - : #(do (cmp.mapping.close) (vim.cmd "stopinsert")) - : (cmp.mapping.confirm {:select true})}) - - :experimental {:custom_menu true} - - :sources [{:name "nvim_lsp" :priority 5} - {:name "vsnip" :priority 3} - ; {:name "omni"} ; this prints the completion thing, for some reason,.... - {:name "nvim_lua"} - {:name "calc"} - {:name "path"} - {:name "nvim_lsp_signature_help"} - {:name "conventionalcommits"} - {:name "crates"}] - ;{:name "buffer"}] - - :formatting {:format item-formatter} - - :sorting {:priority_weight 2 - :comparators [#(do (if (and (= 15 ($1:get_kind)) (= 15 ($2:get_kind))) nil - (= 15 ($1:get_kind)) false - (= 15 ($2:get_kind)) true - nil)) ; 15 means "SNIPPET", see https://github.com/hrsh7th/nvim-cmp/blob/main/lua/cmp/types/lsp.lua - cmp.config.compare.offset - cmp.config.compare.exact - cmp.config.compare.score - cmp.config.compare.kind - cmp.config.compare.sort_text - cmp.config.compare.length - cmp.config.compare.order]}}) - -(cmp.setup.cmdline "/" {:sources [{:name :buffer}]}) +(fn setup [] + ; check this for coloring maybe + ; https://github.com/hrsh7th/nvim-cmp/blob/ada9ddeff71e82ad0e52c9a280a1e315a8810b9a/lua/cmp/entry.lua#L199 + (fn item-formatter [item vim-item] + (let [padding (string.rep " " (- 10 (vim.fn.strwidth vim-item.abbr))) + details (?. item :completion_item :detail)] + (when details + (set vim-item.abbr (.. vim-item.abbr padding " " details)))) + vim-item) + (cmp.setup + {:snippet {:expand (fn [args] ((. vim.fn :vsnip#anonymous) args.body))} + + :completion {:autocomplete false} + + :mapping (cmp.mapping.preset.insert + {: (cmp.mapping.scroll_docs -4) + : (cmp.mapping.scroll_docs 4) + : (cmp.mapping.complete) + : #(do (cmp.mapping.close) (vim.cmd "stopinsert")) + : (cmp.mapping.confirm {:select true})}) + + :experimental {:custom_menu true} + + :sources [{:name "nvim_lsp" :priority 5} + {:name "vsnip" :priority 3} + ; {:name "omni"} ; this prints the completion thing, for some reason,.... + {:name "nvim_lua"} + {:name "calc"} + {:name "path"} + {:name "nvim_lsp_signature_help"} + {:name "conventionalcommits"} + {:name "crates"}] + ;{:name "buffer"}] + + :formatting {:format item-formatter} + + :sorting {:priority_weight 2 + :comparators [#(do (if (and (= 15 ($1:get_kind)) (= 15 ($2:get_kind))) nil + (= 15 ($1:get_kind)) false + (= 15 ($2:get_kind)) true + nil)) ; 15 means "SNIPPET", see https://github.com/hrsh7th/nvim-cmp/blob/main/lua/cmp/types/lsp.lua + cmp.config.compare.offset + cmp.config.compare.exact + cmp.config.compare.score + cmp.config.compare.kind + cmp.config.compare.sort_text + cmp.config.compare.length + cmp.config.compare.order]}}) + + (cmp.setup.cmdline "/" {:sources [{:name :buffer}]})) + +[(utils.plugin :hrsh7th/vim-vsnip {:lazy true :event ["VeryLazy"]}) + (utils.plugin :hrsh7th/vim-vsnip-integ {:lazy true :event ["VeryLazy"]}) + (utils.plugin :rafamadriz/friendly-snippets) + (utils.plugin :hrsh7th/nvim-cmp {:lazy true + :event ["VeryLazy"] + :dependencies [[:hrsh7th/cmp-nvim-lsp] + [:hrsh7th/cmp-buffer] + [:hrsh7th/cmp-vsnip] + [:hrsh7th/cmp-nvim-lua] + [:hrsh7th/cmp-calc] + [:hrsh7th/cmp-path] + [:hrsh7th/cmp-nvim-lsp-signature-help] + [:davidsierradz/cmp-conventionalcommits] + [:hrsh7th/cmp-omni]] + :config setup})] diff --git a/nvim/.config/nvim/fnl/dots/plugins/copilot.fnl b/nvim/.config/nvim/fnl/dots/plugins/copilot.fnl index 5740aee..86e0e88 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/copilot.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/copilot.fnl @@ -1,11 +1,18 @@ -(module dots.plugins.copilot - {autoload {copilot copilot} - require-macros [macros]}) +(import-macros {: al} :macros) +(al copilot copilot) +(al utils dots.utils) -(copilot.setup - {:panel {:enabled false} - :suggestion {:enabled true - :auto_trigger :true - :keymap {:accept "" - :next ""}}}) - +(fn setup [] + (copilot.setup + {:panel {:enabled false} + :suggestion {:enabled true + :auto_trigger :true + :keymap {:accept "" + :next ""}}})) + + ;:github/copilot.vim {:cmd ["Copilot"]} +;[(utils.plugin :zbirenbaum/copilot.lua +; {:cmd "Copilot" +; :event "InsertEnter" +; :config setup}})) +[] diff --git a/nvim/.config/nvim/fnl/dots/plugins/crates.fnl b/nvim/.config/nvim/fnl/dots/plugins/crates.fnl index d14874e..753761a 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/crates.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/crates.fnl @@ -1,7 +1,18 @@ -(module dots.plugins.crates - {autoload {a aniseed.core - crates crates}}) +(import-macros {: al} :macros) + +(al utils dots.utils) +(al crates crates) + +(fn setup [] + (crates.setup {:disable_invalid_feature_diagnostic true + :enable_update_available_warning false})) + -(crates.setup {:disable_invalid_feature_diagnostic true - :enable_update_available_warning false}) +[(utils.plugin :Saecki/crates.nvim + {:dependencies ["nvim-lua/plenary.nvim"] + :dir "/Users/leon/tmp/crates.nvim" + :event ["BufRead Cargo.toml"] + :lazy true + :config setup})] + diff --git a/nvim/.config/nvim/fnl/dots/plugins/diffview.fnl b/nvim/.config/nvim/fnl/dots/plugins/diffview.fnl index 574544d..c32251b 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/diffview.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/diffview.fnl @@ -1,11 +1,18 @@ -(module dots.plugins.diffview - {autoload {diffview diffview - cb diffview.config}}) +(import-macros m :macros) +(m.al diffview diffview) +(m.al cb diffview.config) +(m.al utils dots.utils) + +(fn setup [] + (diffview.setup + {:diff_binaries false + :file_panel {:width 35 + :use_icons false} + :key_bindings {:view {:dn (cb.diffview_callback "select_next_entry") + :dp (cb.diffview_callback "select_prev_entry") + :dd (cb.diffview_callback "toggle_files")}}})) +[(utils.plugin + :sindrets/diffview.nvim + {:cmd ["DiffviewOpen" "DiffviewToggleFiles"] + :config #setup})] -(diffview.setup - {:diff_binaries false - :file_panel {:width 35 - :use_icons false} - :key_bindings {:view {:dn (cb.diffview_callback "select_next_entry") - :dp (cb.diffview_callback "select_prev_entry") - :dd (cb.diffview_callback "toggle_files")}}}) diff --git a/nvim/.config/nvim/fnl/dots/plugins/emmet.fnl b/nvim/.config/nvim/fnl/dots/plugins/emmet.fnl index 22f1402..a38407c 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/emmet.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/emmet.fnl @@ -1,7 +1,8 @@ -(module dots.plugins.emmet {}) +(import-macros m :macros) (set vim.g.user_emmet_mode "n") (set vim.g.user_emmet_leader_key "e") (set vim.g.user_emmet_settings {:javascript.jsx {:extends "jsx"} :typescript.jsx {:extends "jsx"}}) +[] diff --git a/nvim/.config/nvim/fnl/dots/plugins/feline.fnl b/nvim/.config/nvim/fnl/dots/plugins/feline.fnl index 230fff0..630e3f9 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/feline.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/feline.fnl @@ -1,15 +1,13 @@ -(module dots.plugins.feline - {autoload {a aniseed.core - nvim aniseed.nvim - utils dots.utils - str aniseed.string - colors dots.colors - view aniseed.view - feline feline - feline-git feline.providers.git - feline-lsp feline.providers.lsp} - require-macros [macros]}) +(import-macros m :macros) +(m.al a nfnl.core) +(m.al utils dots.utils) +(m.al str nfnl.string) +(m.al colors dots.colors) +(m.al feline feline) +(m.al feline-git feline.providers.git) +(m.al feline-lsp feline.providers.lsp) +(fn setup []) (set vim.opt.termguicolors true) (local modes @@ -31,31 +29,31 @@ :V {:text "VISUAL LINE" :color colors.neutral_blue} "" {:text "VISUAL BLOCK" :color colors.neutral_blue}}) -(def bar-bg colors.bg_main) -(def horiz-separator-color colors.light1) +(local bar-bg colors.bg_main) +(local horiz-separator-color colors.light1) -(defn or-empty [x] (or x "")) -(defn spaces [x] (if x (.. " " x " ") "")) +(fn or-empty [x] (or x "")) +(fn spaces [x] (if x (.. " " x " ") "")) -(defn get-current-filepath [] +(fn get-current-filepath [] (let [file (utils.shorten-path (vim.fn.bufname) 30 30)] (if (a.empty? file) "" - nvim.bo.readonly (.. "RO " file) - (and nvim.bo.modifiable nvim.bo.modified) (.. file " ●") + vim.bo.readonly (.. "RO " file) + (and vim.bo.modifiable vim.bo.modified) (.. file " ●") (.. file " ")))) -(defn vim-mode-hl [use-as-fg?] +(fn vim-mode-hl [use-as-fg?] (let [color (. modes (vim.fn.mode) :color)] (if use-as-fg? {:bg bar-bg :fg color} {:bg color :fg bar-bg}))) -(defn git-status-provider [] +(fn git-status-provider [] (or-empty (utils.keep-if #(~= "master" $1) (?. vim.b :gitsigns_status_dict :head)))) -(defn vim-mode [] +(fn vim-mode [] (.. " " (or (. modes (vim.fn.mode) :text) vim.fn.mode) " ")) -(defn lsp-progress-provider [] +(fn lsp-progress-provider [] (let [msgs (vim.lsp.util.get_progress_messages) s (icollect [_ msg (ipairs msgs)] (when msg.message @@ -64,25 +62,25 @@ -(defn lsp-diagnostic-component [kind color] +(fn lsp-diagnostic-component [kind color] {:enabled #(~= 0 (length (vim.diagnostic.get 0 {:severity kind}))) :provider #(spaces (length (vim.diagnostic.get 0 {:severity kind}))) :left_sep "" :right_sep "" :hl {:fg bar-bg :bg color}}) -(defn coordinates [] +(fn coordinates [] (let [[line col] (vim.api.nvim_win_get_cursor 0)] (.. " " line " "))) -; Fills the bar with an horizontal line -(defn inactive-separator-provider [] + ; Fills the bar with an horizontal line +(fn inactive-separator-provider [] (if (not= (vim.fn.winnr) (vim.fn.winnr :j)) (string.rep "─" (vim.api.nvim_win_get_width 0)) "")) - -(def components {:active {} :inactive {}}) + +(local components {:active {} :inactive {}}) (tset components.active 1 [{:provider vim-mode :hl #(vim-mode-hl false)} @@ -114,3 +112,4 @@ (feline.setup {:theme {:fg colors.light1 :bg colors.bg_main} :components components}) +[(utils.plugin :Famiu/feline.nvim {:config setup})] diff --git a/nvim/.config/nvim/fnl/dots/plugins/gitsigns.fnl b/nvim/.config/nvim/fnl/dots/plugins/gitsigns.fnl index 85f6cc7..1a766de 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/gitsigns.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/gitsigns.fnl @@ -1,20 +1,27 @@ -(module dots.plugins.gitsigns - {autoload {utils dots.utils - colors dots.colors - gitsigns gitsigns}}) +(import-macros m :macros) +(m.al utils dots.utils) +(m.al colors dots.colors) +(m.al gitsigns gitsigns) -; https://github.com/lewis6991/gitsigns.nvim -(gitsigns.setup - {:signs {:add {:text "▍"} - :change {:text "▍"} - :delete {:text "▍"} - :topdelete {:text "▍"} - :changedelete {:text "▍"}} - :keymaps {:noremap true - :buffer true} - :current_line_blame false - :update_debounce 100}) +(fn setup [] + (gitsigns.setup + {:signs {:add {:text "▍"} + :change {:text "▍"} + :delete {:text "▍"} + :topdelete {:text "▍"} + :changedelete {:text "▍"}} +; :keymaps {:noremap true +; :buffer true} + :current_line_blame false + :update_debounce 100}) -(let [scrollbar-gitsigns (require "scrollbar.handlers.gitsigns")] - (scrollbar-gitsigns.setup)) + (let [scrollbar-gitsigns (require "scrollbar.handlers.gitsigns")] + (scrollbar-gitsigns.setup))) + +[(utils.plugin + :lewis6991/gitsigns.nvim + {:dependencies [:vim-gruvbox8 + :petertriho/nvim-scrollbar] + :config setup})] + diff --git a/nvim/.config/nvim/fnl/dots/plugins/glance.fnl b/nvim/.config/nvim/fnl/dots/plugins/glance.fnl index 4b14221..6ea840a 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/glance.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/glance.fnl @@ -1,5 +1,8 @@ -(module dots.plugins.glance - {autoload {a aniseed.core - glance glance}}) +(import-macros m :macros) +(m.al a aniseed.core) +(m.al glance glance) +(m.al utils dots.utils) -(glance.setup) +[(utils.plugin + :dnlhc/glance.nvim + {:lazy true :config #(glance.setup)})] diff --git a/nvim/.config/nvim/fnl/dots/plugins/gruvbox8.fnl b/nvim/.config/nvim/fnl/dots/plugins/gruvbox8.fnl index 7a609dd..0c86fb8 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/gruvbox8.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/gruvbox8.fnl @@ -1,144 +1,145 @@ -(module dots.plugins.gruvbox8 - {autoload {utils dots.utils - colors dots.colors} - require-macros [macros]}) +(import-macros {: al} :macros) +(al utils dots.utils) +(al colors dots.colors) -(set vim.g.gruvbox_italics 0) -(set vim.g.gruvbox_italicise_strings 0) -(set vim.g.gruvbox_filetype_hi_groups 1) -(set vim.g.gruvbox_plugin_hi_groups 1) + +(fn setup [] + (set vim.g.gruvbox_italics 0) + (set vim.g.gruvbox_italicise_strings 0) + (set vim.g.gruvbox_filetype_hi_groups 1) + (set vim.g.gruvbox_plugin_hi_groups 1) -(defn- setup-colors [] - (utils.highlight-add - ["GruvboxBlueSign" "GruvboxAquaSign" "GruvboxRedSign" "GruvboxYellowSign" "GruvboxGreenSign" "GruvboxOrangeSign" "GruvboxPurpleSign"] - {:bg "NONE"}) + (fn setup-colors [] + (utils.highlight-add + ["GruvboxBlueSign" "GruvboxAquaSign" "GruvboxRedSign" "GruvboxYellowSign" "GruvboxGreenSign" "GruvboxOrangeSign" "GruvboxPurpleSign"] + {:bg "NONE"}) - ; hide empty line ~'s - (utils.highlight :EndOfBuffer {:bg "NONE" :fg colors.bg_main}) - (utils.highlight :LineNr {:bg "NONE"}) + ; hide empty line ~'s + (utils.highlight :EndOfBuffer {:bg "NONE" :fg colors.bg_main}) + (utils.highlight :LineNr {:bg "NONE"}) - (utils.highlight-add :Pmenu {:bg colors.bg_second}) - (utils.highlight-add :PmenuSel {:bg colors.bright_aqua}) - (utils.highlight-add :PmenuSbar {:bg colors.bg_second}) - (utils.highlight-add :PmenuThumb {:bg colors.dark1}) - (utils.highlight-add :NormalFloat {:bg colors.bg_second}) - (utils.highlight-add :SignColumn {:bg colors.bg_main}) + (utils.highlight-add :Pmenu {:bg colors.bg_second}) + (utils.highlight-add :PmenuSel {:bg colors.bright_aqua}) + (utils.highlight-add :PmenuSbar {:bg colors.bg_second}) + (utils.highlight-add :PmenuThumb {:bg colors.dark1}) + (utils.highlight-add :NormalFloat {:bg colors.bg_second}) + (utils.highlight-add :SignColumn {:bg colors.bg_main}) - (utils.highlight-add :FloatBorder {:bg colors.bg_second}) - (utils.highlight-add :SpecialComment {:fg colors.dark4}) + (utils.highlight-add :FloatBorder {:bg colors.bg_second}) + (utils.highlight-add :SpecialComment {:fg colors.dark4}) - (utils.highlight-add - [:LspDiagnosticsSignError :LspDiagnosticsSignWarning :LspDiagnosticsSignInformation :LspDiagnosticsSignHint] - {:bg "NONE"}) + (utils.highlight-add + [:LspDiagnosticsSignError :LspDiagnosticsSignWarning :LspDiagnosticsSignInformation :LspDiagnosticsSignHint] + {:bg "NONE"}) - (utils.highlight-add :DiagnosticError {:fg colors.bright_red}) - (utils.highlight-add :DiagnosticWarning {:fg colors.bright_orange}) - (utils.highlight-add :DiagnosticInformation {:fg colors.bright_aqua}) - (utils.highlight-add :DiagnosticHint {:fg colors.bright_yellow}) + (utils.highlight-add :DiagnosticError {:fg colors.bright_red}) + (utils.highlight-add :DiagnosticWarning {:fg colors.bright_orange}) + (utils.highlight-add :DiagnosticInformation {:fg colors.bright_aqua}) + (utils.highlight-add :DiagnosticHint {:fg colors.bright_yellow}) - (utils.highlight-add :DiagnosticVirtualTextError {:bg "#342828" :fg colors.bright_red}) - (utils.highlight-add :DiagnosticVirtualTextWarning {:bg "#473027" :fg colors.bright_orange}) - (utils.highlight-add :DiagnosticVirtualTextWarning {:bg "#3b2c28" :fg colors.bright_orange}) - (utils.highlight-add :DiagnosticVirtualTextInformation {:bg "#272d2f" :fg colors.bright_aqua}) - (utils.highlight-add :DiagnosticVirtualTextHint {:bg "#272d2f" :fg colors.bright_yellow}) + (utils.highlight-add :DiagnosticVirtualTextError {:bg "#342828" :fg colors.bright_red}) + (utils.highlight-add :DiagnosticVirtualTextWarning {:bg "#473027" :fg colors.bright_orange}) + (utils.highlight-add :DiagnosticVirtualTextWarning {:bg "#3b2c28" :fg colors.bright_orange}) + (utils.highlight-add :DiagnosticVirtualTextInformation {:bg "#272d2f" :fg colors.bright_aqua}) + (utils.highlight-add :DiagnosticVirtualTextHint {:bg "#272d2f" :fg colors.bright_yellow}) - (utils.highlight :LspDiagnosticsUnderlineError {:gui "undercurl"}) + (utils.highlight :LspDiagnosticsUnderlineError {:gui "undercurl"}) - (vim.fn.sign_define :LspDiagnosticsSignError {:text "◆"}) - (vim.fn.sign_define :LspDiagnosticsSignWarning {:text "◆"}) - (vim.fn.sign_define :LspDiagnosticsSignHint {:text "◆"}) - (vim.fn.sign_define :LspDiagnosticsSignInformation {:text "◆"}) + ;(vim.fn.sign_localine :LspDiagnosticsSignError {:text "◆"}) + ;(vim.fn.sign_localine :LspDiagnosticsSignWarning {:text "◆"}) + ;(vim.fn.sign_localine :LspDiagnosticsSignHint {:text "◆"}) + ;(vim.fn.sign_localine :LspDiagnosticsSignInformation {:text "◆"}) - (utils.highlight :StatusLine {:bg colors.dark1 :fg colors.light0}) + (utils.highlight :StatusLine {:bg colors.dark1 :fg colors.light0}) - (vim.cmd "highlight link Function GruvboxGreen") - (utils.highlight-add :Function {:gui "NONE"})) + (vim.cmd "highlight link Function GruvboxGreen") + (utils.highlight-add :Function {:gui "NONE"})) -(defn setup-telescope-theme [] - (def prompt "blacker") - (if - (= prompt "bright") - (let [promptbg "#689d6a"] - (utils.highlight-add :TelescopePromptBorder {:bg promptbg :fg promptbg}) - (utils.highlight-add :TelescopePromptNormal {:bg promptbg :fg colors.bg_main}) - (utils.highlight-add :TelescopePromptTitle {:bg promptbg :fg colors.dark1})) + (fn setup-telescope-theme [] + (local prompt "blacker") + (if + (= prompt "bright") + (let [promptbg "#689d6a"] + (utils.highlight-add :TelescopePromptBorder {:bg promptbg :fg promptbg}) + (utils.highlight-add :TelescopePromptNormal {:bg promptbg :fg colors.bg_main}) + (utils.highlight-add :TelescopePromptTitle {:bg promptbg :fg colors.dark1})) - (= prompt "dark") - (let [promptbg "#252525"] - (utils.highlight-add :TelescopePromptBorder {:bg promptbg :fg promptbg}) - (utils.highlight-add :TelescopePromptNormal {:bg promptbg :fg colors.light2}) - (utils.highlight-add :TelescopePromptPrefix {:bg promptbg :fg colors.neutral_aqua}) - (utils.highlight-add :TelescopePromptTitle {:bg colors.neutral_blue :fg colors.dark1})) + (= prompt "dark") + (let [promptbg "#252525"] + (utils.highlight-add :TelescopePromptBorder {:bg promptbg :fg promptbg}) + (utils.highlight-add :TelescopePromptNormal {:bg promptbg :fg colors.light2}) + (utils.highlight-add :TelescopePromptPrefix {:bg promptbg :fg colors.neutral_aqua}) + (utils.highlight-add :TelescopePromptTitle {:bg colors.neutral_blue :fg colors.dark1})) - (= prompt "black") - (let [promptbg "#212526"] - (utils.highlight-add :TelescopePromptBorder {:bg promptbg :fg promptbg}) - (utils.highlight-add :TelescopePromptNormal {:bg promptbg :fg colors.light2}) - (utils.highlight-add :TelescopePromptPrefix {:bg promptbg :fg colors.neutral_aqua}) - (utils.highlight-add :TelescopePromptTitle {:bg colors.neutral_green :fg colors.dark1})) + (= prompt "black") + (let [promptbg "#212526"] + (utils.highlight-add :TelescopePromptBorder {:bg promptbg :fg promptbg}) + (utils.highlight-add :TelescopePromptNormal {:bg promptbg :fg colors.light2}) + (utils.highlight-add :TelescopePromptPrefix {:bg promptbg :fg colors.neutral_aqua}) + (utils.highlight-add :TelescopePromptTitle {:bg colors.neutral_green :fg colors.dark1})) - (= prompt "blacker") - (let [promptbg "#1f2324"] - (utils.highlight-add :TelescopePromptBorder {:bg promptbg :fg promptbg}) - (utils.highlight-add :TelescopePromptNormal {:bg promptbg :fg colors.light2}) - (utils.highlight-add :TelescopePromptPrefix {:bg promptbg :fg colors.neutral_aqua}) - (utils.highlight-add :TelescopePromptTitle {:bg colors.neutral_blue :fg colors.dark1}))) + (= prompt "blacker") + (let [promptbg "#1f2324"] + (utils.highlight-add :TelescopePromptBorder {:bg promptbg :fg promptbg}) + (utils.highlight-add :TelescopePromptNormal {:bg promptbg :fg colors.light2}) + (utils.highlight-add :TelescopePromptPrefix {:bg promptbg :fg colors.neutral_aqua}) + (utils.highlight-add :TelescopePromptTitle {:bg colors.neutral_blue :fg colors.dark1}))) - (def side "darker") - (if - (= side "brighter") - (let [previewbg "#1f2324"] - (utils.highlight-add :TelescopePreviewNormal {:bg previewbg}) - (utils.highlight-add :TelescopePreviewBorder {:bg previewbg :fg previewbg})) + (local side "darker") + (if + (= side "brighter") + (let [previewbg "#1f2324"] + (utils.highlight-add :TelescopePreviewNormal {:bg previewbg}) + (utils.highlight-add :TelescopePreviewBorder {:bg previewbg :fg previewbg})) - (= side "darker") - (let [previewbg "#1a1e1f"] - (utils.highlight-add :TelescopePreviewNormal {:bg previewbg}) - (utils.highlight-add :TelescopePreviewBorder {:bg previewbg :fg previewbg}))) + (= side "darker") + (let [previewbg "#1a1e1f"] + (utils.highlight-add :TelescopePreviewNormal {:bg previewbg}) + (utils.highlight-add :TelescopePreviewBorder {:bg previewbg :fg previewbg}))) - (utils.highlight-add :TelescopeBorder {:bg colors.bg_second :fg colors.bg_second}) - (utils.highlight-add :TelescopeNormal {:bg colors.bg_second}) - (utils.highlight-add :TelescopePreviewTitle {:bg colors.neutral_green :fg colors.dark1}) - (utils.highlight-add :TelescopeResultsTitle {:bg colors.neutral_aqua :fg colors.dark1}) + (utils.highlight-add :TelescopeBorder {:bg colors.bg_second :fg colors.bg_second}) (utils.highlight-add :TelescopeNormal {:bg colors.bg_second}) + (utils.highlight-add :TelescopePreviewTitle {:bg colors.neutral_green :fg colors.dark1}) + (utils.highlight-add :TelescopeResultsTitle {:bg colors.neutral_aqua :fg colors.dark1}) - (utils.highlight-add :TelescopeSelection {:bg colors.neutral_aqua :fg colors.dark1})) + (utils.highlight-add :TelescopeSelection {:bg colors.neutral_aqua :fg colors.dark1})) -(defn- setup-noice-theme [] - (utils.highlight-add :NoicePopupmenu {:bg colors.bg_second}) - (utils.highlight-add :NoiceCmdline {:bg "#1f2324"}) - (utils.highlight-add :NoiceCmdlinePopup {:bg "#1f2324"}) - (utils.highlight-add :NoiceCmdlinePrompt {:bg "#1f2324"}) - (utils.highlight-add :NoiceCmdlinePopupBorder {:fg colors.bright_aqua}) - (utils.highlight-add :NoiceCmdlineIcon {:fg colors.bright_aqua})) + (fn setup-noice-theme [] + (utils.highlight-add :NoicePopupmenu {:bg colors.bg_second}) + (utils.highlight-add :NoiceCmdline {:bg "#1f2324"}) + (utils.highlight-add :NoiceCmdlinePopup {:bg "#1f2324"}) + (utils.highlight-add :NoiceCmdlinePrompt {:bg "#1f2324"}) + (utils.highlight-add :NoiceCmdlinePopupBorder {:fg colors.bright_aqua}) + (utils.highlight-add :NoiceCmdlineIcon {:fg colors.bright_aqua})) -(vim.api.nvim_create_autocmd "ColorScheme" {:pattern "*" :callback setup-colors}) -(setup-colors) -(vim.api.nvim_create_autocmd "ColorScheme" {:pattern "*" :callback setup-telescope-theme}) -(setup-telescope-theme) -(vim.api.nvim_create_autocmd "ColorScheme" {:pattern "*" :callback setup-noice-theme}) -(setup-noice-theme) + (vim.api.nvim_create_autocmd "ColorScheme" {:pattern "*" :callback setup-colors}) + (setup-colors) + (vim.api.nvim_create_autocmd "ColorScheme" {:pattern "*" :callback setup-telescope-theme}) + (setup-telescope-theme) + (vim.api.nvim_create_autocmd "ColorScheme" {:pattern "*" :callback setup-noice-theme}) + (setup-noice-theme) -(vim.api.nvim_create_autocmd - "ColorScheme" - {:pattern "*" - :callback - (fn [] - (utils.highlight-add "GitSignsAdd" {:gui "NONE" :bg "NONE" :fg colors.bright_aqua}) - (utils.highlight-add "GitSignsDelete" {:gui "NONE" :bg "NONE" :fg colors.neutral_red}) - (utils.highlight-add "GitSignsChange" {:gui "NONE" :bg "NONE" :fg colors.bright_blue}) - (utils.highlight-add "ScrollbarGitAdd" {:gui "NONE" :bg "NONE" :fg colors.bright_aqua}) - (utils.highlight-add "ScrollbarGitDelete" {:gui "NONE" :bg "NONE" :fg colors.neutral_red}) - (utils.highlight-add "ScrollbarGitChange" {:gui "NONE" :bg "NONE" :fg colors.bright_blue}))}) - + (vim.api.nvim_create_autocmd + "ColorScheme" + {:pattern "*" + :callback + (fn [] + (utils.highlight-add "GitSignsAdd" {:gui "NONE" :bg "NONE" :fg colors.bright_aqua}) + (utils.highlight-add "GitSignsDelete" {:gui "NONE" :bg "NONE" :fg colors.neutral_red}) + (utils.highlight-add "GitSignsChange" {:gui "NONE" :bg "NONE" :fg colors.bright_blue}) + (utils.highlight-add "ScrollbarGitAdd" {:gui "NONE" :bg "NONE" :fg colors.bright_aqua}) + (utils.highlight-add "ScrollbarGitDelete" {:gui "NONE" :bg "NONE" :fg colors.neutral_red}) + (utils.highlight-add "ScrollbarGitChange" {:gui "NONE" :bg "NONE" :fg colors.bright_blue}))}) + -(if (= "epix" (vim.fn.hostname)) - (vim.cmd "colorscheme gruvbox8_hard") - (vim.cmd "colorscheme gruvbox8")) + (if (= "epix" (vim.fn.hostname)) + (vim.cmd "colorscheme gruvbox8_hard") + (vim.cmd "colorscheme gruvbox8"))) +[(utils.plugin :lifepillar/vim-gruvbox8 {:lazy false :priority 1000 :config setup})] diff --git a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl index 3302a24..119ce44 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl @@ -1,259 +1,269 @@ -(module dots.plugins.lsp - {autoload {a aniseed.core - str aniseed.string - lsp lspconfig - lsp-configs lspconfig/configs - utils dots.utils - ltex-ls dots.plugins.ltex-ls - cmp_nvim_lsp cmp_nvim_lsp} +(import-macros {: al} :macros) +(al a aniseed.core) +(al str aniseed.string) +(al lsp lspconfig) +(al lsp-configs lspconfig/configs) +(al utils dots.utils) +(al ltex-ls dots.plugins.ltex-ls) +(al cmp_nvim_lsp cmp_nvim_lsp) - require-macros [macros]}) +(fn setup [] + ; TODO check https://github.com/neovim/nvim-lspconfig/blob/master/ADVANCED_README.md for default config for all of them -; TODO check https://github.com/neovim/nvim-lspconfig/blob/master/ADVANCED_README.md for default config for all of them - -(tset vim.lsp.handlers :textDocument/publishDiagnostics - (vim.lsp.with vim.lsp.diagnostic.on_publish_diagnostics - {:update_in_insert false - :virtual_text {:prefix "◆"} - :signs false - :severity_sort true})) + (tset vim.lsp.handlers :textDocument/publishDiagnostics + (vim.lsp.with vim.lsp.diagnostic.on_publish_diagnostics + {:update_in_insert false + :virtual_text {:prefix "◆"} + :signs false + :severity_sort true})) -(fn on_attach [client bufnr] - ;(pkg lsp_signature.nvim [lsp_signature (require "lsp_signature")] - ;(lsp_signature.on_attach {:bind true - ;:hint_scheme "String" - ;:hint_prefix "ƒ " - ;:handler_opts {:border "single"} - ;:use_lspsaga false - ;:decorator ["`" "`"]})) + (fn on_attach [client bufnr] + ;(pkg lsp_signature.nvim [lsp_signature (require "lsp_signature")] + ;(lsp_signature.on_attach {:bind true + ;:hint_scheme "String" + ;:hint_prefix "ƒ " + ;:handler_opts {:border "single"} + ;:use_lspsaga false + ;:decorator ["`" "`"]})) - ;(req dots.utils.highlight :LspDiagnosticsUnderlineError {:gui "underline"}) - (if client.server_capabilities.documentHighlight - (do - (utils.highlight "LspReferenceRead" {:gui "underline"}) - (utils.highlight "LspReferenceText" {:gui "underline"}) - (utils.highlight "LspReferenceWrite" {:gui "underline"}) - (vim.api.nvim_exec - "augroup lsp_document_highlight - autocmd! * - autocmd CursorHold lua vim.lsp.buf.document_highlight() - autocmd CursorMoved lua vim.lsp.buf.clear_references() - augroup END" - false)))) + ;(req dots.utils.highlight :LspDiagnosticsUnderlineError {:gui "underline"}) + (if client.server_capabilities.documentHighlight + (do + (utils.highlight "LspReferenceRead" {:gui "underline"}) + (utils.highlight "LspReferenceText" {:gui "underline"}) + (utils.highlight "LspReferenceWrite" {:gui "underline"}) + (vim.api.nvim_exec + "augroup lsp_document_highlight + autocmd! * + autocmd CursorHold lua vim.lsp.buf.document_highlight() + autocmd CursorMoved lua vim.lsp.buf.clear_references() + augroup END" + false)))) -(fn better_root_pattern [patterns except-patterns] - "match path if one of the given patterns is matched, EXCEPT if one of the except-patterns is matched" - (fn [path] - (when (not ((lsp.util.root_pattern except-patterns) path)) - ((lsp.util.root_pattern patterns) path)))) + (fn better_root_pattern [patterns except-patterns] + "match path if one of the given patterns is matched, EXCEPT if one of the except-patterns is matched" + (fn [path] + (when (not ((lsp.util.root_pattern except-patterns) path)) + ((lsp.util.root_pattern patterns) path)))) -; advertise snippet support -(def default-capabilities - (let [capabilities (vim.lsp.protocol.make_client_capabilities)] - (set capabilities.textDocument.completion.completionItem.snippetSupport true) - (cmp_nvim_lsp.default_capabilities capabilities))) + ; advertise snippet support + (def default-capabilities + (let [capabilities (vim.lsp.protocol.make_client_capabilities)] + (set capabilities.textDocument.completion.completionItem.snippetSupport true) + (cmp_nvim_lsp.default_capabilities capabilities))) -(fn init-lsp [lsp-name ?opts] - "initialize a language server with defaults" - (let [merged-opts (a.merge {:on_attach on_attach :capabilities default-capabilities} (or ?opts {}))] - ((. lsp lsp-name :setup) merged-opts))) + (fn init-lsp [lsp-name ?opts] + "initialize a language server with defaults" + (let [merged-opts (a.merge {:on_attach on_attach :capabilities default-capabilities} (or ?opts {}))] + ((. lsp lsp-name :setup) merged-opts))) -(init-lsp :jsonls {:commands {:Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}}) -(init-lsp :denols {:root_dir (better_root_pattern [".git"] ["package.json"])}) -(init-lsp :hls {:settings {:languageServerHaskell {:formattingProvider "stylish-haskell"}}}) -(init-lsp :ocamllsp) -(init-lsp :vimls) -(init-lsp :gopls) -(init-lsp :bashls) -(init-lsp :erlangls) -(init-lsp :yamlls) -(init-lsp :html) -(init-lsp :svelte) -(init-lsp :elmls) -(init-lsp :texlab) -(init-lsp :pyright) -;(init-lsp :ltex {:settings {:ltex {:dictionary {:de-DE [":~/.config/ltex-ls/dictionary.txt"]} - ;:disabledRules {:de-DE [":~/.config/ltex-ls/disabledRules.txt"]} - ;:hiddenFalsePositives {:de-DE [":~/.config/ltex-ls/hiddenFalsePositives.txt"]} - ;:additionalRules {:motherTongue "de-DE"}}}}) -(init-lsp :vls) -;(init-lsp :clangd) -;(init-lsp :ccls) + (init-lsp :jsonls {:commands {:Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}}) + (init-lsp :denols {:root_dir (better_root_pattern [".git"] ["package.json"])}) + (init-lsp :hls {:settings {:languageServerHaskell {:formattingProvider "stylish-haskell"}}}) + (init-lsp :ocamllsp) + (init-lsp :vimls) + (init-lsp :gopls) + (init-lsp :bashls) + (init-lsp :erlangls) + (init-lsp :yamlls) + (init-lsp :html) + (init-lsp :svelte) + (init-lsp :elmls) + (init-lsp :texlab) + (init-lsp :pyright) + ;(init-lsp :ltex {:settings {:ltex {:dictionary {:de-DE [":~/.config/ltex-ls/dictionary.txt"]} + ;:disabledRules {:de-DE [":~/.config/ltex-ls/disabledRules.txt"]} + ;:hiddenFalsePositives {:de-DE [":~/.config/ltex-ls/hiddenFalsePositives.txt"]} + ;:additionalRules {:motherTongue "de-DE"}}}}) + (init-lsp :vls) + ;(init-lsp :clangd) + ;(init-lsp :ccls) -(init-lsp :perlls) + (init-lsp :perlls) + + (init-lsp :powershell_es {:bundle_path "/home/leon/powershell"}) + ;(ltex-ls.init) + + + + + + (init-lsp :clangd) -(init-lsp :powershell_es {:bundle_path "/home/leon/powershell"}) -;(ltex-ls.init) + + (init-lsp :cssls {:filestypes ["css" "scss" "less" "stylus"] + :root_dir (lsp.util.root_pattern ["package.json" ".git"]) + :settings {:css {:validate true} + :less {:validate true} + :scss {:validate true}}}) - - - + (lsp.tsserver.setup {:root_dir (lsp.util.root_pattern "package.json") + :on_attach (fn [client bufnr] + (set client.resolved_capabilities.document_formatting false) + (on_attach client bufnr))}) -(init-lsp :clangd) + (let [rust-tools (require "rust-tools") + rust-tools-dap (require "rust-tools.dap") + extension-path "/home/leon/.vscode/extensions/vadimcn.vscode-lldb-1.6.8/" + codelldb-path (.. extension-path "adapter/codelldb") + liblldb-path (.. extension-path "lldb/lib/liblldb.so") + features nil] + (rust-tools.setup {:tools {:inlay_hints {:show_parameter_hints false} + ;:auto false} + :autoSetHints false} + :dap {:adapter (rust-tools-dap.get_codelldb_adapter codelldb-path liblldb-path)} + :server {:on_attach on_attach + :capabilities default-capabilities + :settings {:rust-analyzer {:cargo {:loadOutDirsFromCheck true + :features (or features "all") + :noDefaultFeatures (~= nil features)} + :procMacro {:enable true} + :diagnostics {:enable false ;; native rust analyzer diagnostics + :experimental {:enable false}} + :checkOnSave {:overrideCommand ["cargo" "clippy" "--workspace" "--message-format=json" "--all-targets" "--all-features"]}}}}})) + + ;:cmd ["/home/leon/coding/prs/rust-analyzer/target/release/rust-analyzer"]}})) + + (when (not lsp.fennel_language_server) + (tset lsp-configs :fennel_language_server + {:default_config {:cmd "/Users/leon/.cargo/bin/fennel-language-server" + :filetypes [:fennel] + :single_file_support true + :root_dir (lsp.util.root_pattern "fnl") + :settings {:fennel {:workspace {:library (vim.api.nvim_list_runtime_paths)} + :diagnostics {:globals [:vim]}}}}})) + + (init-lsp :fennel_language_server) +; +; - -(init-lsp :cssls {:filestypes ["css" "scss" "less" "stylus"] - :root_dir (lsp.util.root_pattern ["package.json" ".git"]) - :settings {:css {:validate true} - :less {:validate true} - :scss {:validate true}}}) + ; (let [sumneko_root_path (.. vim.env.HOME "/.local/share/lua-language-server") + ; sumneko_binary (.. sumneko_root_path "/bin/Linux/lua-language-server")) + ; (init-lsp + ; :lua_ls + ; {:cmd [sumneko_binary "-E" (.. sumneko_root_path "/main.lua")] + ; :settings {:Lua {:runtime {:version "LuaJIT" + ; :path (vim.split package.path ";")} + ; :diagnostics {:globals ["vim"]} + ; :workspace {:library {(vim.fn.expand "$VIMRUNTIME/lua") true + ; (vim.fn.expand "$VIMRUNTIME/lua/vim/lsp") true}} + ; :telemetry false}}})) -(lsp.tsserver.setup {:root_dir (lsp.util.root_pattern "package.json") - :on_attach (fn [client bufnr] - (set client.resolved_capabilities.document_formatting false) - (on_attach client bufnr))}) + (comment + (when (not lsp.prolog_lsp) + (tset lsp-configs :prolog_lsp + {:default_config {:cmd ["swipl" "-g" "use_module(library(lsp_server))." "-g" "lsp_server:main" "-t" "halt" "--" "stdio"] + :filetypes ["prolog"] + :root_dir (fn [fname] (or (lsp.util.find_git_ancestor fname) (vim.loop.os_homedir))) + :settings {}}})) -(let [rust-tools (require "rust-tools") - rust-tools-dap (require "rust-tools.dap") - extension-path "/home/leon/.vscode/extensions/vadimcn.vscode-lldb-1.6.8/" - codelldb-path (.. extension-path "adapter/codelldb") - liblldb-path (.. extension-path "lldb/lib/liblldb.so") - features nil] - (rust-tools.setup {:tools {:inlay_hints {:show_parameter_hints false} - ;:auto false} - :autoSetHints false} - :dap {:adapter (rust-tools-dap.get_codelldb_adapter codelldb-path liblldb-path)} - :server {:on_attach on_attach - :capabilities default-capabilities - :settings {:rust-analyzer {:cargo {:loadOutDirsFromCheck true - :features (or features "all") - :noDefaultFeatures (~= nil features)} - :procMacro {:enable true} - :diagnostics {:enable false ;; native rust analyzer diagnostics - :experimental {:enable false}} - :checkOnSave {:overrideCommand ["cargo" "clippy" "--workspace" "--message-format=json" "--all-targets" "--all-features"]}}}}})) - - ;:cmd ["/home/leon/coding/prs/rust-analyzer/target/release/rust-analyzer"]}})) + (lsp.prolog_lsp.setup {})) -; (let [sumneko_root_path (.. vim.env.HOME "/.local/share/lua-language-server") -; sumneko_binary (.. sumneko_root_path "/bin/Linux/lua-language-server")) -; (init-lsp -; :lua_ls -; {:cmd [sumneko_binary "-E" (.. sumneko_root_path "/main.lua")] -; :settings {:Lua {:runtime {:version "LuaJIT" -; :path (vim.split package.path ";")} -; :diagnostics {:globals ["vim"]} -; :workspace {:library {(vim.fn.expand "$VIMRUNTIME/lua") true -; (vim.fn.expand "$VIMRUNTIME/lua/vim/lsp") true}} -; :telemetry false}}})) - -(comment - (when (not lsp.prolog_lsp) - (tset lsp-configs :prolog_lsp - {:default_config {:cmd ["swipl" "-g" "use_module(library(lsp_server))." "-g" "lsp_server:main" "-t" "halt" "--" "stdio"] - :filetypes ["prolog"] - :root_dir (fn [fname] (or (lsp.util.find_git_ancestor fname) (vim.loop.os_homedir))) - :settings {}}})) - - (lsp.prolog_lsp.setup {})) - - -(comment - (let [ewwls-path "/home/leon/coding/projects/ls-eww/crates/ewwls/target/debug/ewwls"] - (when (vim.fn.filereadable ewwls-path) - (when (not lsp.ewwls) - (set lsp-configs.ewwls - {:default_config {:cmd [ewwls-path] - :filetypes ["yuck"] - :root_dir (fn [fname] (or (lsp.util.find_git_ancestor fname) (vim.loop.os_homedir))) - :settings {}}})) - (init-lsp :ewwls)))) + (comment + (let [ewwls-path "/home/leon/coding/projects/ls-eww/crates/ewwls/target/debug/ewwls"] + (when (vim.fn.filereadable ewwls-path) + (when (not lsp.ewwls) + (set lsp-configs.ewwls + {:default_config {:cmd [ewwls-path] + :filetypes ["yuck"] + :root_dir (fn [fname] (or (lsp.util.find_git_ancestor fname) (vim.loop.os_homedir))) + :settings {}}})) + (init-lsp :ewwls)))) -; Idris2 ----------------------------------------------------------- <<<<< + ; Idris2 ----------------------------------------------------------- <<<<< -(def autostart-semantic-highlighting true) -(defn refresh-semantic-highlighting [] - (when autostart-semantic-highlighting - (vim.lsp.buf_request 0 - :textDocument/semanticTokens/full - {:textDocument (vim.lsp.util.make_text_document_params)} - nil) - vim.NIL)) + (def autostart-semantic-highlighting true) + (fn refresh-semantic-highlighting [] + (when autostart-semantic-highlighting + (vim.lsp.buf_request 0 + :textDocument/semanticTokens/full + {:textDocument (vim.lsp.util.make_text_document_params)} + nil) + vim.NIL)) -(when (not lsp.idris2_lsp) - (set lsp-configs.idris2_lsp - {:default_config - {:cmd [:idris2-lsp] - :filetypes [:idris2] - :on_new_config (fn [new-config new-root-dir] - (set new-config.cmd {1 :idris2-lsp}) - (set new-config.capabilities.workspace.semanticTokens {:refreshSupport true})) - :root_dir (fn [fname] - (local scandir (require :plenary.scandir)) - (fn find-ipkg-ancestor [fname] - (lsp.util.search_ancestors - fname - (fn [path] - (local res (scandir.scan_dir path {:depth 1 :search_pattern ".+%.ipkg"})) - (when (not (vim.tbl_isempty res)) path)))) + (when (not lsp.idris2_lsp) + (set lsp-configs.idris2_lsp + {:default_config + {:cmd [:idris2-lsp] + :filetypes [:idris2] + :on_new_config (fn [new-config new-root-dir] + (set new-config.cmd {1 :idris2-lsp}) + (set new-config.capabilities.workspace.semanticTokens {:refreshSupport true})) + :root_dir (fn [fname] + (local scandir (require :plenary.scandir)) + (fn find-ipkg-ancestor [fname] + (lsp.util.search_ancestors + fname + (fn [path] + (local res (scandir.scan_dir path {:depth 1 :search_pattern ".+%.ipkg"})) + (when (not (vim.tbl_isempty res)) path)))) - (or (or (find-ipkg-ancestor fname) - (lsp.util.find_git_ancestor fname)) - (vim.loop.os_homedir))) - :settings {}}})) -(lsp.idris2_lsp.setup - {:on_attach refresh-semantic-highlighting - :autostart true - :handlers {:workspace/semanticTokens/refresh refresh-semantic-highlighting - :textDocument/semanticTokens/full - (fn [err method result client-id bufnr config] - (let [client (vim.lsp.get_client_by_id client-id) - legend client.server_capabilities.semanticTokensProvider.legend - token-types legend.tokenTypes - data result.data - ns (vim.api.nvim_create_namespace :nvim-lsp-semantic)] - (vim.api.nvim_buf_clear_namespace bufnr ns 0 (- 1)) - (local tokens {}) - (var (prev-line prev-start) (values nil 0)) - (for [i 1 (length data) 5] - (local delta-line (. data i)) - (set prev-line - (or (and prev-line (+ prev-line delta-line)) - delta-line)) - (local delta-start (. data (+ i 1))) - (set prev-start (or (and (= delta-line 0) (+ prev-start delta-start)) - delta-start)) - (local token-type (. token-types (+ (. data (+ i 3)) 1))) - (vim.api.nvim_buf_add_highlight bufnr - ns - (.. :LspSemantic_ token-type) - prev-line - prev-start - (+ prev-start (. data (+ i 2)))))))}}) + (or (or (find-ipkg-ancestor fname) + (lsp.util.find_git_ancestor fname)) + (vim.loop.os_homedir))) + :settings {}}})) + (lsp.idris2_lsp.setup + {:on_attach refresh-semantic-highlighting + :autostart true + :handlers {:workspace/semanticTokens/refresh refresh-semantic-highlighting + :textDocument/semanticTokens/full + (fn [err method result client-id bufnr config] + (let [client (vim.lsp.get_client_by_id client-id) + legend client.server_capabilities.semanticTokensProvider.legend + token-types legend.tokenTypes + data result.data + ns (vim.api.nvim_create_namespace :nvim-lsp-semantic)] + (vim.api.nvim_buf_clear_namespace bufnr ns 0 (- 1)) + (local tokens {}) + (var (prev-line prev-start) (values nil 0)) + (for [i 1 (length data) 5] + (local delta-line (. data i)) + (set prev-line + (or (and prev-line (+ prev-line delta-line)) + delta-line)) + (local delta-start (. data (+ i 1))) + (set prev-start (or (and (= delta-line 0) (+ prev-start delta-start)) + delta-start)) + (local token-type (. token-types (+ (. data (+ i 3)) 1))) + (vim.api.nvim_buf_add_highlight bufnr + ns + (.. :LspSemantic_ token-type) + prev-line + prev-start + (+ prev-start (. data (+ i 2)))))))}}) -(vim.cmd "highlight link LspSemantic_type Include") -(vim.cmd "highlight link LspSemantic_function Identifier") -(vim.cmd "highlight link LspSemantic_struct Number") -(vim.cmd "highlight LspSemantic_variable guifg=gray") -(vim.cmd "highlight link LspSemantic_keyword Structure") + (vim.cmd "highlight link LspSemantic_type Include") + (vim.cmd "highlight link LspSemantic_function Identifier") + (vim.cmd "highlight link LspSemantic_struct Number") + (vim.cmd "highlight LspSemantic_variable guifg=gray") + (vim.cmd "highlight link LspSemantic_keyword Structure") -; --------------------------------- >>>>> + ; --------------------------------- >>>>> -(set vim.opt.signcolumn "yes") - -; Cleanup links in markdown documentation -(defn- cleanup-markdown [contents] - (if (= contents.kind "markdown") - (tset contents :value (string.gsub contents.value "%[([^%]]+)%]%(([^%)]+)%)" "[%1]"))) - contents) - -(let [previous-handler (. vim.lsp.handlers :textDocument/hover)] - (tset vim.lsp.handlers :textDocument/hover - (fn [a result b c] - (if (not (and result result.contents)) - (previous-handler a result b c) - (let [new-contents (cleanup-markdown result.contents)] - (tset result :contents new-contents) - (previous-handler a result b c)))))) + (set vim.opt.signcolumn "yes") + ; Cleanup links in markdown documentation + (fn cleanup-markdown [contents] + (if (= contents.kind "markdown") + (tset contents :value (string.gsub contents.value "%[([^%]]+)%]%(([^%)]+)%)" "[%1]"))) + contents) + (let [previous-handler (. vim.lsp.handlers :textDocument/hover)] + (tset vim.lsp.handlers :textDocument/hover + (fn [a result b c] + (if (not (and result result.contents)) + (previous-handler a result b c) + (let [new-contents (cleanup-markdown result.contents)] + (tset result :contents new-contents) + (previous-handler a result b c))))))) +[(utils.plugin :neovim/nvim-lspconfig {:event "VeryLazy" :lazy true})] ; vim:foldmarker=<<<<<,>>>>> diff --git a/nvim/.config/nvim/fnl/dots/plugins/ltex-ls.fnl b/nvim/.config/nvim/fnl/dots/plugins/ltex-ls.fnl index e369a6a..c526fd0 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/ltex-ls.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/ltex-ls.fnl @@ -1,29 +1,29 @@ -(module dots.plugins.ltex-ls - {autoload {a aniseed.core - str aniseed.string - lsp lspconfig - configs lspconfig/configs - lsputil lspconfig/util - utils dots.utils - cmp_nvim_lsp cmp_nvim_lsp}}) +(import-macros m :macros) +(m.al a aniseed.core) +(m.al str aniseed.string) +(m.al lsp lspconfig) +(m.al configs lspconfig/configs) +(m.al lsputil lspconfig/util) +(m.al utils dots.utils) +(m.al cmp_nvim_lsp cmp_nvim_lsp) -(defn cmds [xs] +(fn cmds [xs] (icollect [_ x (ipairs xs)] (.. "\\" x "{}"))) -(def latex-command-settings +(local latex-command-settings {:dummy (cmds ["texttt" "scripture" "lstref" "figref" "tblref" "secref" "personaltextcite" "personalparencite" "textcite" "parencite" "parencite[]" "game" "acsu" "enquote" "name" "item" "reqref" "gamebtn" "fs" "cs" "appref" "sorty"]) :ignore (cmds ["urlfootnote" "caption" "todo"])}) -(def Dictionary-file {:de-DE [(.. (vim.fn.getenv "HOME") "/.config/ltex-ls/dictionary.txt")]}) -(def Disabled-rules-file {:de-DE [(.. (vim.fn.getenv "HOME") "/.config/ltex-ls/disable.txt")]}) -(def False-positives-file {:de-DE [(.. (vim.fn.getenv "HOME") "/.config/ltex-ls/false.txt")]}) +(local Dictionary-file {:de-DE [(.. (vim.fn.getenv "HOME") "/.config/ltex-ls/dictionary.txt")]}) +(local Disabled-rules-file {:de-DE [(.. (vim.fn.getenv "HOME") "/.config/ltex-ls/disable.txt")]}) +(local False-positives-file {:de-DE [(.. (vim.fn.getenv "HOME") "/.config/ltex-ls/false.txt")]}) -(def latex-command-settings-formatted +(local latex-command-settings-formatted (let [tbl {}] (each [option commands (pairs latex-command-settings)] (each [_ command (ipairs commands)] @@ -107,7 +107,7 @@ (add-to-file filetype lang file value))) -(defn init [] +(fn init [] (set configs.ltex {:default_config {:cmd [:ltex-ls] :filetypes [:tex :latex :bib] @@ -153,4 +153,4 @@ (orig-execute-command command))))) - +[] diff --git a/nvim/.config/nvim/fnl/dots/plugins/neogit.fnl b/nvim/.config/nvim/fnl/dots/plugins/neogit.fnl index edc2746..5dd72af 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/neogit.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/neogit.fnl @@ -1,6 +1,9 @@ -(module dots.plugins.neogit - {autoload {a aniseed.core - neogit neogit}}) +(import-macros m :macros) +(m.al neogit neogit) +(m.al utils dots.utils) + +[(utils.plugin :TimUntersberger/neogit + {:config #(neogit.setup {:integrations {:diffview true}}) + :cmd ["Neogit"]})] + -(neogit.setup - {:integrations {:diffview true}}) diff --git a/nvim/.config/nvim/fnl/dots/plugins/noice.fnl b/nvim/.config/nvim/fnl/dots/plugins/noice.fnl index 4c681e3..6032b81 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/noice.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/noice.fnl @@ -1,40 +1,43 @@ -(module dots.plugins.noice - {autoload {a aniseed.core - lazy lazy - noice noice - colors dots.colors - utils dots.utils} +(import-macros m :macros) +(m.al utils dots.utils) +(fn setup [] + (m.al a nfnl.core) + (m.al lazy lazy) + (m.al noice noice) + (m.al colors dots.colors) + (noice.setup + {:presets {:inc_rename true + :long_message_to_split true + :bottom_search true} + ;:command_palette true} + :lsp {:override {:vim.lsp.util.convert_input_to_markdown_lines true + :vim.lsp.util.stylize_markdown true + :cmp.entry.get_documentation true}} + :views {:cmdline_popup {:border {:style "none" :padding [1 1]} + :position {:row 5 :col "50%"} + :size {:width 60 :height "auto"}} + :popupmenu {:relative "editor" + :border {:style "none" :padding [1 1]} + :position {:row 8 :col "50%"} + :size {:width 60 :height 10}} + :mini {:max_height 5}} + :cmdline {:view "cmdline" ; change to cmdline_popup + :format {:cmdline {:icon ":"} + :lua false + :help false}} + :messages {:view "mini" + :view_error "cmdline_output" + :view_warn "mini" + :view_search "virtualtext"} + :markdown {:hover {"|(%S-)|" vim.cmd.help}} + :routes [{:view "notify" :filter {:event "msg_showmode"}} + {:view "mini" + :filter {:error true :max_height 5}} + {:view "cmdline_output" + :filter {:error true :min_height 6}}]})) - require-macros [macros]}) - -(noice.setup - {:presets {:inc_rename true - :long_message_to_split true - :bottom_search true} - ;:command_palette true} - :lsp {:override {:vim.lsp.util.convert_input_to_markdown_lines true - :vim.lsp.util.stylize_markdown true - :cmp.entry.get_documentation true}} - :views {:cmdline_popup {:border {:style "none" :padding [1 1]} - :position {:row 5 :col "50%"} - :size {:width 60 :height "auto"}} - :popupmenu {:relative "editor" - :border {:style "none" :padding [1 1]} - :position {:row 8 :col "50%"} - :size {:width 60 :height 10}} - :mini {:max_height 5}} - :cmdline {:view "cmdline_popup" ; change to cmdline - :format {:cmdline {:icon ":"} - :lua false - :help false}} - :messages {:view "mini" - :view_error "cmdline_output" - :view_warn "mini" - :view_search "virtualtext"} - :markdown {:hover {"|(%S-)|" vim.cmd.help}} - :routes [{:view "notify" :filter {:event "msg_showmode"}} - {:view "mini" - :filter {:error true :max_height 5}} - {:view "cmdline_output" - :filter {:error true :min_height 6}}]}) +;[(utils.plugin :folke/noice.nvim +; {:config setup +; :dependencies [:MunifTanjim/nui.nvim]}}]})) +[] diff --git a/nvim/.config/nvim/fnl/dots/plugins/nvim-colorizer.fnl b/nvim/.config/nvim/fnl/dots/plugins/nvim-colorizer.fnl index f615ea2..d13c918 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/nvim-colorizer.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/nvim-colorizer.fnl @@ -1,16 +1,23 @@ -(module dots.plugins.nvim-colorizer - {autoload {colorizer colorizer}}) +(import-macros m :macros) +(m.al colorizer colorizer) +(m.al utils dots.utils) -; this really shouldn't be necessary,.. but it is -(set vim.o.termguicolors true) +(fn setup [] + ; this really shouldn't be necessary,.. but it is + (set vim.o.termguicolors true) -(colorizer.setup - ["*"] - {:RGB true - :RRGGBB true - :names true - :RRGGBBAA true - :rgb_fn true - :hsl_fn true - :mode "background"}) + (colorizer.setup + ["*"] + {:RGB true + :RRGGBB true + :names true + :RRGGBBAA true + :rgb_fn true + :hsl_fn true + :mode "background"})) + +[(utils.plugin :norcalli/nvim-colorizer.lua + {:event "VeryLazy" + :lazy true + :config setup})] diff --git a/nvim/.config/nvim/fnl/dots/plugins/persistence.fnl b/nvim/.config/nvim/fnl/dots/plugins/persistence.fnl index 12dac50..944fb9c 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/persistence.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/persistence.fnl @@ -1,5 +1,11 @@ -(module dots.plugins.persistence - {autoload {persistence persistence}}) +(import-macros m :macros) +(m.al persistence persistence) +(m.al utils dots.utils) -(persistence.setup - {:dir (vim.fn.expand (.. (vim.fn.stdpath "cache") "/sessions/"))}) + +(fn setup [] + (persistence.setup + {:dir (vim.fn.expand (.. (vim.fn.stdpath "cache") "/sessions/"))})) + +[(utils.plugin :folke/persistence.nvim + {:config setup})] diff --git a/nvim/.config/nvim/fnl/dots/plugins/plugins.fnl b/nvim/.config/nvim/fnl/dots/plugins/plugins.fnl new file mode 100644 index 0000000..3a1b427 --- /dev/null +++ b/nvim/.config/nvim/fnl/dots/plugins/plugins.fnl @@ -0,0 +1,197 @@ +(import-macros {: al} :macros) +(al a nfnl.core) +(al lazy lazy) + + +(macro setup [name opts] + `((. (require ,name) :setup) ,opts)) + +(macro plugin [name ?opts] + (if (= nil ?opts) + name + (do (tset ?opts 1 name) ?opts))) + +[(plugin :Olical/aniseed) + (plugin :Olical/nfnl) + (plugin :nvim-lua/plenary.nvim) + (plugin :norcalli/nvim.lua) + (plugin :kyazdani42/nvim-web-devicons) + (plugin :folke/which-key.nvim) + (plugin :folke/todo-comments.nvim + {:lazy true + :event "VeryLazy" + :config #(require "dots.plugins.todo-comments")}) + (plugin :ckipp01/nvim-jenkinsfile-linter + {:dependencies ["nvim-lua/plenary.nvim"]}) + (plugin :psliwka/vim-smoothie) + (plugin :nathanaelkane/vim-indent-guides + {:cmd ["IndentGuidesToggle"]}) + (plugin :luukvbaal/stabilize.nvim + {:config #(setup :stabilize)}) + + (plugin :stevearc/dressing.nvim + {:config #(setup :dressing)}) + + (plugin :tweekmonster/startuptime.vim + {:cmd ["StartupTime"]}) + (plugin :folke/zen-mode.nvim + {:config #(require "dots.plugins.zen-mode") + :cmd ["ZenMode"]}) + (plugin :folke/twilight.nvim + {:config #(require "dots.plugins.twilight")}) + (plugin :moll/vim-bbye + {:lazy true :cmd [:Bdelete :Bwipeout]}) + (plugin :petertriho/nvim-scrollbar + {:event "VeryLazy" + :lazy true + :config #(setup :scrollbar)}) + + (plugin "https://git.sr.ht/~whynothugo/lsp_lines.nvim" + {:config #(do (setup :lsp_lines) + (vim.diagnostic.config {:virtual_lines false}))}) + + ; editing and movement <<< + (plugin :jiangmiao/auto-pairs) + (plugin :tpope/vim-repeat) + (plugin :preservim/nerdcommenter + {:event "VeryLazy" + :lazy true + :priority 1000}) + (plugin :godlygeek/tabular + {:cmd ["Tabularize"]}) + (plugin :tpope/vim-surround) + (plugin :hauleth/sad.vim) + (plugin :wellle/targets.vim) ; more text objects. IE: cin (change in next parens). generally better handling of surrounding objects. + (plugin :mg979/vim-visual-multi + {:lazy true :event "VeryLazy"}) + (plugin :tommcdo/vim-exchange) + (plugin :phaazon/hop.nvim + {:lazy true + :event "VeryLazy" + :config #(setup "hop" {:keys "jfkdls;amvieurow"})}) + ; >>> + + ; debugger <<< + (plugin :rcarriga/nvim-dap-ui + {:lazy true + :config #(setup :dapui) + :dependencies [:mfussenegger/nvim-dap]}) + (plugin :mfussenegger/nvim-dap + {:lazy true}) + (plugin :nvim-telescope/telescope-dap.nvim + {:lazy true + :dependencies [:nvim-telescope/telescope.nvim + :mfussenegger/nvim-dap]}) + + ; >>> + + ; git stuff <<< + (plugin :ldelossa/gh.nvim + {:lazy true + :config #(do ((. (require "litee.lib") :setup)) + ((. (require "litee.gh") :setup))) + :dependencies [:ldelossa/litee.nvim]}) + (plugin :pwntester/octo.nvim + {:lazy true + :dependencies [:nvim-lua/plenary.nvim + :nvim-telescope/telescope.nvim + :kyazdani42/nvim-web-devicons] + :config #(setup :octo)}) + + (plugin :ruanyl/vim-gh-line) + (plugin :rhysd/conflict-marker.vim) + (plugin :tpope/vim-fugitive + {:lazy true :event "VeryLazy"}) + ; >>> + + ; lsp <<< + (plugin :ray-x/lsp_signature.nvim + {:event :BufEnter}) + (plugin :weilbith/nvim-code-action-menu + {:cmd "CodeActionMenu" + :config #(set vim.g.code_action_menu_show_details false)}) + + (plugin :folke/trouble.nvim + {:lazy true + :config #(require "dots.plugins.trouble") + :cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"]}) + + ; :elkowar/trouble.nvim {:branch "fix_error_on_nil_window" + ; :config #(require "dots.plugins.trouble") + ; :cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"]} + + (plugin :simrat39/symbols-outline.nvim + {:lazy true + :cmd ["SymbolsOutline" "SymbolsOutlineClose" "SymbolsOutlineOpen"] + :config #(require "dots.plugins.symbols-outline")}) + + + (plugin :smjonas/inc-rename.nvim + {:config #(setup :inc_rename {:input_buffer_type "dressing"})}) + ; >>> + + ; cmp <<< + ; >>> + + ; code-related ----------------------------------------- <<< + + (plugin :monkoose/nvlime + {:ft ["lisp"] :dependencies [:monkoose/parsley]}) + + (plugin :tpope/vim-sleuth) + (plugin :editorconfig/editorconfig-vim) + (plugin :pechorin/any-jump.vim) + (plugin :sbdchd/neoformat) + (plugin :elkowar/antifennel-nvim + {:config #(set vim.g.antifennel_executable "/home/leon/tmp/antifennel/antifennel")}) + (plugin :Olical/conjure {:ft ["fennel"]}) + (plugin :eraserhd/parinfer-rust {:build "cargo build --release"}) + + (plugin :lervag/vimtex + {:ft ["latex" "tex"] + :config #(require :dots.plugins.vimtex)}) + (plugin :kmonad/kmonad-vim) + (plugin :elkowar/yuck.vim {:ft ["yuck"]}) + (plugin :cespare/vim-toml {:ft ["toml"]}) + (plugin :bduggan/vim-raku {:ft ["raku"]}) + (plugin :LnL7/vim-nix {:ft ["nix"]}) + (plugin :kevinoid/vim-jsonc {}) + (plugin :pangloss/vim-javascript {:ft ["javascript"]}) ; syntax highlighting JS + (plugin :ianks/vim-tsx {:ft ["typescript-react"]}) + (plugin :leafgarland/typescript-vim {:ft ["typescript" "typescript-react" "javascript"]}) + (plugin :HerringtonDarkholme/yats.vim {}) ; typescript syntax highlighting + (plugin :mxw/vim-jsx {}) + (plugin :mattn/emmet-vim + {:lazy true + :config #(require "dots.plugins.emmet")}) + (plugin :purescript-contrib/purescript-vim {:ft ["purescript"]}) + (plugin :derekelkins/agda-vim {:ft ["agda"]}) + (plugin :neovimhaskell/haskell-vim { :ft ["haskell"]}) + (plugin :monkoose/nvlime + {:ft ["lisp"] + :dependencies ["monkoose/parsley"] + :config #(set vim.g.vlime_overlay "slimv")}) + + + (plugin :rust-lang/rust.vim + {:ft ["rust"] + :dependencies ["mattn/webapi-vim"] + :config #(do (set vim.g.rustfmt_fail_silently 1))}) + + (plugin :simrat39/rust-tools.nvim + {:ft ["rust" "toml"] + :dependencies ["nvim-lua/popup.nvim" "nvim-lua/plenary.nvim"]}) + + + (plugin :qnighy/lalrpop.vim {}) + (plugin :edwinb/idris2-vim {:ft ["idris2"]}) + (plugin :vmchale/ats-vim {:ft ["ats" "dats" "sats"]}) + (plugin :bakpakin/fennel.vim {:ft ["fennel"]}) + (plugin :evanleck/vim-svelte {})] + + +; >>> + +; vim:foldmarker=<<<,>>> + + diff --git a/nvim/.config/nvim/fnl/dots/plugins/sneak.fnl b/nvim/.config/nvim/fnl/dots/plugins/sneak.fnl index 363c2b2..52813ff 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/sneak.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/sneak.fnl @@ -1,7 +1,9 @@ -(module dots.plugins.sneak - {autoload {utils dots.utils}}) +(import-macros m :macros) +(m.al utils dots.utils) (set vim.g.sneak#label 1) (utils.keymap [:n :o] : "Sneak_s" {:noremap false}) (utils.keymap [:n :o] : "Sneak_S" {:noremap false}) + +[] diff --git a/nvim/.config/nvim/fnl/dots/plugins/symbols-outline.fnl b/nvim/.config/nvim/fnl/dots/plugins/symbols-outline.fnl index 5cfeffb..ebd785f 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/symbols-outline.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/symbols-outline.fnl @@ -1,4 +1,5 @@ -(module dots.plugins.symbols-outline - {require {symbols-outline symbols-outline}}) +(import-macros m :macros) +(local symbols-outline (require :symbols-outline)) -(symbols-outline.setup {:highlight_hovered_item true :show_guides true}) +; (symbols-outline.setup {:highlight_hovered_item true :show_guides true}) +[] diff --git a/nvim/.config/nvim/fnl/dots/plugins/telescope.fnl b/nvim/.config/nvim/fnl/dots/plugins/telescope.fnl index d91eec3..893155c 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/telescope.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/telescope.fnl @@ -1,16 +1,23 @@ -(module dots.plugins.telescope - {autoload {utils dots.utils - telescope telescope - actions telescope.actions - colors dots.colors}}) +(import-macros {: al} :macros) +(al utils dots.utils) +(al telescope telescope) +(al actions telescope.actions) +(al colors dots.colors) -(telescope.setup - {:defaults {:mappings {:i {: actions.close}} - :file_ignore_patterns ["Cargo.lock" ".*.snap" "docs/theme/.*" "node%_modules/.*" "target/.*"]} - :extensions {:ui-select [((. (require "telescope.themes") :get_dropdown))]}}) - -(telescope.load_extension "dap") -;(telescope.load_extension "ui-select") +(fn setup [] + (telescope.setup + {:defaults {:mappings {:i {: actions.close}} + :file_ignore_patterns ["Cargo.lock" ".*.snap" "docs/theme/.*" "node%_modules/.*" "target/.*"]} + :extensions {:ui-select [((. (require "telescope.themes") :get_dropdown))]}}) + + (telescope.load_extension "dap") + ;(telescope.load_extension "ui-select") -(utils.keymap :n : ":Telescope find_files") + (utils.keymap :n : ":Telescope find_files")) + +[(utils.plugin :nvim-telescope/telescope.nvim + {:config setup + :cmd ["Telescope"] + :dependencies [:nvim-lua/popup.nvim + :nvim-lua/plenary.nvim]})] diff --git a/nvim/.config/nvim/fnl/dots/plugins/todo-comments.fnl b/nvim/.config/nvim/fnl/dots/plugins/todo-comments.fnl index b8fceba..3570f81 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/todo-comments.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/todo-comments.fnl @@ -1,6 +1,6 @@ -(module dots.plugins.todo-comments - {autoload {a aniseed.core - todo-comments todo-comments}}) +(import-macros m :macros) +(m.al a aniseed.core) +(m.al todo-comments todo-comments) (todo-comments.setup {:keywords {:TODO {:icon " "} @@ -9,3 +9,4 @@ :FIX {:icon " " :alt [:FIXME :BUG :FIXIT :ISSUE :PHIX]} :PERF {:icon " " :alt [:OPTIM :PERFORMANCE :OPTIMIZE]} :HACK {:icon " "}}}) +[] diff --git a/nvim/.config/nvim/fnl/dots/plugins/treesitter.fnl b/nvim/.config/nvim/fnl/dots/plugins/treesitter.fnl index cf14e53..e12c0bd 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/treesitter.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/treesitter.fnl @@ -1,51 +1,64 @@ -(module dots.plugins.treesitter - {autoload {utils dots.utils - a aniseed.core} - require {configs nvim-treesitter.configs} - require-macros [macros]}) +(import-macros m :macros) +(m.al utils dots.utils) +(m.al a nfnl.core) -(configs.setup - {:ensure_installed ["rust" "fennel" "commonlisp" "vim" "regex" "lua" "bash" "markdown" "markdown_inline"] - ; :ensure_installed "maintained" - :highlight {:enable false - :disable ["fennel" "rust" "haskell"]} +(fn setup []) - :incremental_selection {:enable false - :keymaps {:init_selection "gss" - :node_incremental "gsl" - :node_decremental "gsh" - :scope_incremental "gsj" - :scope_decremental "gsk"}} - :textsubjects {:enable true - :disable ["noice"] - :prev_selection "," - :keymaps {"." "textsubjects-smart"}} +(fn setup1 [] + (local configs (require :nvim-treesitter.configs)) + (configs.setup + {:ensure_installed ["rust" "fennel" "commonlisp" "vim" "regex" "lua" "bash" "markdown" "markdown_inline"] + ; :ensure_installed "maintained" + :highlight {:enable false + :disable ["fennel" "rust" "haskell"]} - ; Might fuck with gitsigns - ;:rainbow {:enable true} - ;:extended_mode true} - :context_commentstring {:enable true :disable ["rust" "fennel"]} + :incremental_selection {:enable false + :keymaps {:init_selection "gss" + :node_incremental "gsl" + :node_decremental "gsh" + :scope_incremental "gsj" + :scope_decremental "gsk"}} + :textsubjects {:enable true + :disable ["noice"] + :prev_selection "," + :keymaps {"." "textsubjects-smart"}} - :playground - {:enable false - :disable ["fennel"] - :updatetime 25 ; Debounced time for highlighting nodes in the playground from source code - :persist_queries false ; Whether the query persists across vim sessions - :keybindings - {:toggle_query_editor "o" - :toggle_hl_groups "i" - :toggle_injected_languages "t" - :toggle_anonymous_nodes "a" - :toggle_language_display "I" - :focus_language "f" - :unfocus_language "F" - :update "R" - :goto_node "" - :show_help "?"}}}) - - - - ;:indent {:enable true} - ;:disable ["lua"] + ; Might fuck with gitsigns + ;:rainbow {:enable true} + ;:extended_mode true} + :context_commentstring {:enable true :disable ["rust" "fennel"]} + :playground + {:enable false + :disable ["fennel"] + :updatetime 25 ; Debounced time for highlighting nodes in the playground from source code + :persist_queries false ; Whether the query persists across vim sessions + :keybindings + {:toggle_query_editor "o" + :toggle_hl_groups "i" + :toggle_injected_languages "t" + :toggle_anonymous_nodes "a" + :toggle_language_display "I" + :focus_language "f" + :unfocus_language "F" + :update "R" + :goto_node "" + :show_help "?"}}})) +[(utils.plugin :nvim-treesitter/nvim-treesitter + {:config setup + :lazy true + :event ["VeryLazy"] + :build ":TSUpdate"}) + (utils.plugin :RRethy/nvim-treesitter-textsubjects + {:dependencies [:nvim-treesitter/nvim-treesitter] + :lazy true + :event ["VeryLazy"]}) + (utils.plugin :JoosepAlviste/nvim-ts-context-commentstring + {:event ["VeryLazy"] + :lazy true + :dependencies [:nvim-treesitter/nvim-treesitter]}) + (utils.plugin :nvim-treesitter/playground + {:event ["VeryLazy"] + :lazy true + :dependencies [:nvim-treesitter/nvim-treesitter]})] diff --git a/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl b/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl index d675d38..46661b9 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl @@ -1,7 +1,7 @@ -(module dots.plugins.trouble - {autoload {utils dots.utils - colors dots.colors} - require {trouble trouble}}) +(import-macros m :macros) +(m.al utils dots.utils) +(m.al colors dots.colors) +(local trouble (require :trouble)) (trouble.setup {:icons false @@ -25,3 +25,4 @@ (utils.highlight "TroubleSignWarning" {:bg "NONE" :fg colors.bright_yellow}) (utils.highlight "TroubleSignInformation" {:bg "NONE" :fg colors.bright_aqua}) (utils.highlight "TroubleSignHint" {:bg "NONE" :fg colors.bright_blue}) +[] diff --git a/nvim/.config/nvim/fnl/dots/plugins/twilight.fnl b/nvim/.config/nvim/fnl/dots/plugins/twilight.fnl index 56fd052..3664b60 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/twilight.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/twilight.fnl @@ -1,5 +1,5 @@ - -(module dots.plugins.twilight - {autoload {twilight twilight}}) +(import-macros m :macros) +(m.al twilight twilight) (twilight.setup) +[] diff --git a/nvim/.config/nvim/fnl/dots/plugins/vimtex.fnl b/nvim/.config/nvim/fnl/dots/plugins/vimtex.fnl index 0c122da..ee51a04 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/vimtex.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/vimtex.fnl @@ -1,4 +1,3 @@ -(module dots.plugins.vimtex) ;(set vim.g.vimtex_quickfix_enabled 0) @@ -40,3 +39,4 @@ +[] diff --git a/nvim/.config/nvim/fnl/dots/plugins/zen-mode.fnl b/nvim/.config/nvim/fnl/dots/plugins/zen-mode.fnl index 0cb4e95..9e4c18a 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/zen-mode.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/zen-mode.fnl @@ -1,7 +1,8 @@ -(module dots.plugins - {autoload {zen-mode zen-mode}}) +(import-macros m :macros) +(m.al zen-mode zen-mode) (zen-mode.setup {:window {:options {:wrap true}}}) +[] diff --git a/nvim/.config/nvim/fnl/dots/smart-compe-conjure.fnl b/nvim/.config/nvim/fnl/dots/smart-compe-conjure.fnl index 02d38e1..f41e6c7 100644 --- a/nvim/.config/nvim/fnl/dots/smart-compe-conjure.fnl +++ b/nvim/.config/nvim/fnl/dots/smart-compe-conjure.fnl @@ -1,61 +1,58 @@ -(module dots.smart-compe-conjure - {autoload {utils dots.utils - a aniseed.core - str aniseed.string - view aniseed.view - popup popup - compe compe} - ;help dots.help-thingy} - require-macros [macros]}) +(al utils dots.utils) +(al a aniseed.core) +(al str aniseed.string) +(al view aniseed.view) +(al popup popup) +(al compe compe) + +(defn setup [] + (def fuck (require "compe_conjure")) -(def fuck (require "compe_conjure")) + (def my_source {}) + (set my_source.new + (fn [] + (setmetatable {} {:__index my_source}))) + + (set my_source.determine fuck.determine) + (set my_source.get_metadata fuck.get_metadata) + (set my_source.complete fuck.complete) + (set my_source.abort fuck.abort) + (set my_source.documentation + (fn [self args] + (a.println (view.serialise args)) + (args.callback + (let [help-tag (help.find-help-tag-for args.completed_item.word)] + (when help-tag + (var lines ["```help"]) + (each [_ line (ipairs (help.help-for-tag help-tag))] + (table.insert lines line)) + (table.insert lines "```") + lines))))) + + (compe.register_source :epic (my_source.new)) -(def my_source {}) -(set my_source.new - (fn [] - (setmetatable {} {:__index my_source}))) - -(set my_source.determine fuck.determine) -(set my_source.get_metadata fuck.get_metadata) -(set my_source.complete fuck.complete) -(set my_source.abort fuck.abort) -(set my_source.documentation - (fn [self args] - (a.println (view.serialise args)) - (args.callback - (let [help-tag (help.find-help-tag-for args.completed_item.word)] - (when help-tag - (var lines ["```help"]) - (each [_ line (ipairs (help.help-for-tag help-tag))] - (table.insert lines line)) - (table.insert lines "```") - lines))))) - -(compe.register_source :epic (my_source.new)) - - -(compe.setup - {:enabled true - :autocomplete false - :debug false - :min_length 1 - :preselect "enable" - :throttle_time 80 - :source_timeout 200 - :incomplete_delay 400 - :max_abbr_width 100 - :max_kind_width 100 - :max_menu_width 100 - :documentation true - :source {:path true - :buffer true - :calc true - :nvim_lsp true - :nvim_lua true - :vsnip false - :epic true}}) - + (compe.setup + {:enabled true + :autocomplete false + :debug false + :min_length 1 + :preselect "enable" + :throttle_time 80 + :source_timeout 200 + :incomplete_delay 400 + :max_abbr_width 100 + :max_kind_width 100 + :max_menu_width 100 + :documentation true + :source {:path true + :buffer true + :calc true + :nvim_lsp true + :nvim_lua true + :vsnip false + :epic true}})) +[] diff --git a/nvim/.config/nvim/fnl/dots/utils.fnl b/nvim/.config/nvim/fnl/dots/utils.fnl index 8686faf..853dc79 100644 --- a/nvim/.config/nvim/fnl/dots/utils.fnl +++ b/nvim/.config/nvim/fnl/dots/utils.fnl @@ -1,29 +1,31 @@ -(module dots.utils - {autoload {a aniseed.core - nvim aniseed.nvim - str aniseed.string} - require-macros [macros]}) +(import-macros {: al} :macros) +(al a nfnl.core) +(al str nfnl.string) -(defn plugin-installed? [name] - (~= nil (. packer_plugins name))) +(fn plugin [name ?opts] + (if (= nil ?opts) + name + (do + (tset ?opts 1 name) + ?opts))) -(defn all [f xs] +(fn all [f xs] (not (a.some #(not (f $1))))) -(defn single-to-list [x] +(fn single-to-list [x] "Returns the list given to it. If given a single value, wraps it in a list" (if (a.table? x) x [x])) -(defn contains? [list elem] +(fn contains? [list elem] (or (a.some #(= elem $1) list)) false) -(defn filter-table [f t] +(fn filter-table [f t] (collect [k v (pairs t)] (when (f k v) (values k v)))) -(defn split-last [s sep] +(fn split-last [s sep] "split a string at the last occurrence of a separator" (for [i (length s) 1 -1] (let [c (s:sub i i)] @@ -33,21 +35,21 @@ (lua "return { left, right }"))))) [s]) -(defn find-where [pred xs] +(fn find-where [pred xs] (each [_ x (ipairs xs)] (when (pred x) (lua "return x")))) -(defn find-map [f xs] +(fn find-map [f xs] (each [_ x (ipairs xs)] (let [res (f x)] (when (~= nil res) (lua "return res"))))) -(defn keep-if [f x] +(fn keep-if [f x] (when (f x) x)) -(defn map-values [f t] +(fn map-values [f t] "Map over the values of a table, keeping the keys intact" (let [tbl {}] (each [k v (pairs t)] (tset tbl k (f v))) @@ -55,27 +57,25 @@ -(defn without-keys [keys t] +(fn without-keys [keys t] (filter-table #(not (contains? keys $1)) t)) -(defn keymap [modes from to ?opts] +(fn keymap [modes from to ?opts] "Set a mapping in the given modes, and some optional parameters, defaulting to {:noremap true :silent true}. If :buffer is set, uses buf_set_keymap rather than set_keymap" (let [full-opts (->> (or ?opts {}) (a.merge {:noremap true :silent true}) (without-keys [:buffer]))] (each [_ mode (ipairs (single-to-list modes))] - (if (-?> ?opts (. :buffer)) - (nvim.buf_set_keymap 0 mode from to full-opts) - (nvim.set_keymap mode from to full-opts))))) + (let [keymap-opts (if (-?> ?opts (. :buffer)) (a.assoc full-opts :buffer 0) full-opts)] + (vim.keymap.set mode from to keymap-opts))))) -(defn del-keymap [mode from ?buf-local] +(fn del-keymap [mode from ?buf-local] "Remove a keymap. Arguments: mode, mapping, bool if mapping should be buffer-local." - (if ?buf-local - (nvim.buf_del_keymap 0 mode from) - (nvim.del_keymap mode from))) + (vim.keymap.del mode from + (if ?buf-local {:buffer 0} {}))) -(defn safe-require [name] +(fn safe-require [name] (xpcall #( ;do @@ -86,24 +86,24 @@ (a.println (.. "Error sourcing " name ":\n" (fennel.traceback $1)))))) -(defn buffer-content [bufnr] +(fn buffer-content [bufnr] "Returns a table of lines in the given buffer" (vim.api.nvim_buf_get_lines bufnr 0 -1 false)) -(defn surround-if-present [a mid b] +(fn surround-if-present [a mid b] (if mid (.. a mid b) "")) -(defn highlight [group-arg colset] +(fn highlight [group-arg colset] (let [default { :fg "NONE" :bg "NONE" :gui "NONE"} opts (a.merge default colset)] (each [_ group (ipairs (single-to-list group-arg))] - (nvim.command (.. "hi! "group" guifg='"opts.fg"' guibg='"opts.bg"' gui='"opts.gui"'"))))) + (vim.cmd (.. "hi! "group" guifg='"opts.fg"' guibg='"opts.bg"' gui='"opts.gui"'"))))) -(defn highlight-add [group-arg colset] +(fn highlight-add [group-arg colset] (each [_ group (ipairs (single-to-list group-arg))] - (nvim.command + (vim.cmd (.. "hi! " group (surround-if-present " guibg='"colset.bg"'") @@ -115,7 +115,7 @@ -(defn shorten-path [path seg-length shorten-after] +(fn shorten-path [path seg-length shorten-after] "shorten a filepath by truncating the segments to n characters, if the path exceeds a given length" (let [segments (str.split path "/")] (if (or (> shorten-after (length path)) @@ -126,7 +126,7 @@ shortened-segs (a.map #(string.sub $1 1 seg-length) init)] (.. (str.join "/" shortened-segs) "/" filename))))) -(defn comp [f g] +(fn comp [f g] (fn [...] (f (g ...)))) @@ -138,28 +138,56 @@ (var deferred-funs []) (var did-exec-deferred false) -(defn clear-deferred [] (set deferred-funs [])) +(fn clear-deferred [] (set deferred-funs [])) ; defer a function. If deferred funcs have already been ran, ; assume we're reloading config because the user is configuring, and just execute immediately -(defn defer-to-end [f] +(fn defer-to-end [f] (if did-exec-deferred (f) (table.insert deferred-funs f))) -(defn run-deferred [] +(fn run-deferred [] (set did-exec-deferred true) (each [_ f (ipairs deferred-funs)] (f))) - -(defn get-selection [] +(fn get-selection [] (let [[_ s-start-line s-start-col] (vim.fn.getpos "'<") [_ s-end-line s-end-col] (vim.fn.getpos "'>") n-lines (+ 1 (math.abs (- s-end-line s-start-line))) lines (vim.api.nvim_buf_get_lines 0 (- s-start-line 1) s-end-line false)] - (tset lines 1 (string.sub (. lines 1) s-start-col -1)) - (if (= 1 n-lines) - (tset lines n-lines (string.sub (. lines n-lines) 1 (+ 1 (- s-end-col s-start-col)))) - (tset lines n-lines (string.sub (. lines n-lines) 1 s-end-col))) - (values s-start-line s-end-line lines))) + (if (= nil (. lines 1)) + (values s-start-line s-end-line lines) + (do + (tset lines 1 (string.sub (. lines 1) s-start-col -1)) + (if (= 1 n-lines) + (tset lines n-lines (string.sub (. lines n-lines) 1 (+ 1 (- s-end-col s-start-col)))) + (tset lines n-lines (string.sub (. lines n-lines) 1 s-end-col))) + (values s-start-line s-end-line lines))))) + +{: plugin + : plugin-installed? + : all + : single-to-list + : contains? + : filter-table + : split-last + : find-where + : find-map + : keep-if + : map-values + : without-keys + : keymap + : del-keymap + : safe-require + : buffer-content + : surround-if-present + : highlight + : highlight-add + : shorten-path + : comp + : clear-deferred + : defer-to-end + : run-deferred + : get-selection} diff --git a/nvim/.config/nvim/fnl/init.fnl b/nvim/.config/nvim/fnl/init.fnl index 647f173..a3b526b 100644 --- a/nvim/.config/nvim/fnl/init.fnl +++ b/nvim/.config/nvim/fnl/init.fnl @@ -1,20 +1,27 @@ -(module init - {autoload {utils dots.utils - nvim aniseed.nvim - a aniseed.core - str aniseed.string - colors dots.colors} - require-macros [macros]}) +(import-macros {: al : vim-let} :macros) +(al a nfnl.core) +(al utils dots.utils) +(al str nfnl.string) +(al colors dots.colors) +(local lazy (require :lazy)) + (utils.clear-deferred) +;(macro make-errors-epic [f] +; `(xpcall #,f #(let [fennel# (require :aniseed.fennel)] +; (a.println (fennel#.traceback $1))))) (macro make-errors-epic [f] - `(xpcall #,f #(let [fennel# (require :aniseed.fennel)] - (a.println (fennel#.traceback $1))))) + f) (when (vim.fn.has "termguicolors") (set vim.opt.termguicolors true)) -(make-errors-epic (require "dots.plugins")) +;(make-errors-epic (require "dots.plugins")) + +(vim-let mapleader "\\") +(vim-let maplocalleader ",") + +(lazy.setup {:import "dots.plugins" :install {:colorscheme "gruvbox8"}}) ; (require "impatient") @@ -27,8 +34,6 @@ ; Basic setup --------------------------------------- foldstart -(vim-let mapleader "\\") -(vim-let maplocalleader ",") (vim.cmd "filetype plugin indent on") (vim.cmd "syntax on") @@ -140,7 +145,7 @@ (vim.cmd "command! -nargs=1 L :lua print(vim.inspect())") -(vim.cmd "Copilot enable") +; (vim.cmd "Copilot enable") (utils.run-deferred) diff --git a/nvim/.config/nvim/fnl/macros.fnl b/nvim/.config/nvim/fnl/macros.fnl index 70abf66..8d9f504 100644 --- a/nvim/.config/nvim/fnl/macros.fnl +++ b/nvim/.config/nvim/fnl/macros.fnl @@ -1,3 +1,5 @@ +;; [nfnl-macro] + {:augroup (fn [name ...] `(do @@ -6,6 +8,11 @@ ,... (nvim.ex.augroup :END))) + :al + (fn [name thing] + `(local ,name ((. (require :nfnl.module) :autoload) ,(tostring thing)))) + + :defer (fn [...] `(let [utils# (require :dots.utils)] @@ -14,8 +21,8 @@ :req (fn [name ...] - (let [str (require :aniseed.string) - a (require :aniseed.core) + (let [str (require :nfnl.string) + a (require :nfnl.core) segs (str.split (tostring name) "%.") mod (str.join "." (a.butlast segs)) func (a.last segs)] @@ -33,19 +40,6 @@ (fn [name] `(.. "lua require('" *module-name* "')['" ,(tostring name) "']()")) - :dbg - (fn [x] - `(let [view# (require "aniseed.view")] - (print (.. `,(tostring x) " => " (view#.serialise ,x))) - ,x)) - - :dbg-call - (fn [x ...] - `(do - (let [a# (require "aniseed.core")] - (a#.println ,...)) - (,x ,...))) - :pkg (fn [name mappings ...] `(if (~= nil (. packer_plugins `,(tostring name))) @@ -60,7 +54,7 @@ :each-pair (fn [args ...] (let [[l# r# d#] args] - `(let [a# (require "aniseed.core") + `(let [a# (require "nfnl.core") data# ,d#] (for [i# 1 (a#.count data#) 2] (let [,l# (. data# i#) @@ -69,7 +63,7 @@ :packer-use (fn [...] - (let [a (require "aniseed.core") + (let [a (require "nfnl.core") args [...] use-statements []] (for [i 1 (a.count args) 2] diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 87ce709..6511ad8 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,7 +1,3 @@ - - - - -- not even used, but epic. stores the path to the root config directory. local vim_config_root = vim.fn.expand(":p:h") @@ -33,15 +29,22 @@ end -- Bootstrap essential plugins required for installing and loading the rest. --ensure("wbthomason", "packer.nvim", "master") -ensure("Olical", "aniseed", "master") +--ensure("Olical", "aniseed", "master") +ensure("Olical", "nfnl", "main") + +-- require('nfnl')['compile-all-files']() + +require("lua.init") + + -- ensure("lewis6991", "impatient.nvim", "main") -- require("impatient") -vim.g["aniseed#env"] = { - compile = true -} +-- vim.g["aniseed#env"] = { +-- compile = true +-- } --require("aniseed.env").init({compile = true}) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index bc70576..753caec 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,6 +1,6 @@ { "agda-vim": { "branch": "master", "commit": "4a0f475aaef756702222bdd5b01e25f814f5691f" }, - "aniseed": { "branch": "develop", "commit": "1ed7d5cad835a4aad86ddc5432b71254d4758ada" }, + "aniseed": { "branch": "master", "commit": "7bc09736f3651c10d29b82d1a465b7f540614be1" }, "antifennel-nvim": { "branch": "master", "commit": "79261d02213a5093135e5d02431682f04459f0f7" }, "any-jump.vim": { "branch": "master", "commit": "770ef708ae3f13322430fcc663d7dfb864756b9b" }, "ats-vim": { "branch": "master", "commit": "8e3e722b6d09ed81313573b4e7b108b265628ff1" }, @@ -16,17 +16,14 @@ "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, "conflict-marker.vim": { "branch": "master", "commit": "11a4d42244755505b66b15cd4496a150432eb5e3" }, "conjure": { "branch": "master", "commit": "58c46d1f4999679659a5918284b574c266a7ac83" }, - "copilot.lua": { "branch": "master", "commit": "1a8032ae496916ccc7a7a52ee79194fbef29f462" }, - "crates.nvim": { "branch": "main", "commit": "86b31c92bbcb56d01dff85b07aa008591c848416" }, "diffview.nvim": { "branch": "main", "commit": "0437ef8bfdd67156d87140d692840a3c2824fa20" }, "dressing.nvim": { "branch": "master", "commit": "8f4d62b7817455896a3c73cab642002072c114bc" }, "editorconfig-vim": { "branch": "master", "commit": "0d54ea863089fb13be423b4aed6cca35f3a5d778" }, "emmet-vim": { "branch": "master", "commit": "def5d57a1ae5afb1b96ebe83c4652d1c03640f4d" }, - "feline.nvim": { "branch": "master", "commit": "3587f57480b88e8009df7b36dc84e9c7ff8f2c49" }, "fennel.vim": { "branch": "master", "commit": "30b9beabad2c4f09b9b284caf5cd5666b6b4dc89" }, "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, "gh.nvim": { "branch": "main", "commit": "2b5551656c1b896bf4ae06546eaaab00311f9a18" }, - "gitsigns.nvim": { "branch": "main", "commit": "292938621016a9eb8f266398383fca5cf531c985" }, + "gitsigns.nvim": { "branch": "main", "commit": "ff01d34daaed72f271a8ffa088a7e839a60c640f" }, "glance.nvim": { "branch": "master", "commit": "8ed5cf3b3b1231ea696d88c9efd977027429d869" }, "haskell-vim": { "branch": "master", "commit": "f35d02204b4813d1dbe8b0e98cc39701a4b8e15e" }, "hop.nvim": { "branch": "master", "commit": "1a1eceafe54b5081eae4cb91c723abd1d450f34b" }, @@ -41,9 +38,10 @@ "neoformat": { "branch": "master", "commit": "aedb6f9d3f53d5da229095f7d761d749f8c5c7e0" }, "neogit": { "branch": "master", "commit": "ed99c59d7fda3ba5e2ce9a3adc0a8eb5ebfa6c8f" }, "nerdcommenter": { "branch": "master", "commit": "d2e21d417f6c788b11ae3b90d7ac478930dead36" }, - "noice.nvim": { "branch": "main", "commit": "f77689c9b2436bcd70741a20311496233acb4fb9" }, + "nfnl": { "branch": "main", "commit": "979dbfc48bcb601a9107764a99f9459cb5bd4051" }, + "noice.nvim": { "branch": "main", "commit": "7cf858c30841c9c41601ce58e5bc2023228037ef" }, "nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" }, - "nvim-bufferline.lua": { "branch": "main", "commit": "874f869a24e568980294b3200fc9dd842db65a36" }, + "nvim-bufferline.lua": { "branch": "main", "commit": "357cc8f8eeb64702e6fcf2995e3b9becee99a5d3" }, "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, "nvim-code-action-menu": { "branch": "main", "commit": "e4399dbaf6eabff998d3d5f1cbcd8d9933710027" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, @@ -52,7 +50,7 @@ "nvim-jenkinsfile-linter": { "branch": "main", "commit": "6e740a9e42251452cbc79808ea894f5233a93e92" }, "nvim-lspconfig": { "branch": "master", "commit": "2b361e043810d5587d9af0787f8ce40da92ec5e9" }, "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, - "nvim-treesitter": { "branch": "master", "commit": "db7adb21e6f17528b0f639f36641ce59d65eb68f" }, + "nvim-treesitter": { "branch": "master", "commit": "10bfa4826f2235c600c073a82e0d78718aa7240e" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "48b3bf54e32f23e2299c59ff76fa3b0599565b39" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "7241635869b7a8115893ffa67bab3907756caf4f" }, "nvim-web-devicons": { "branch": "master", "commit": "45d0237c427baba8cd05e0ab26d30e2ee58c2c82" },