From f2dbbdf77914402e8f9ca83b75f84a6022325c59 Mon Sep 17 00:00:00 2001 From: Steven Proctor Date: Tue, 10 Mar 2026 11:10:03 -0500 Subject: [PATCH] start of move to lazy.nvim for plugin management --- nvim/.config/nvim/flsproject.fnl | 14 + nvim/.config/nvim/flsproject.lua | 3 + nvim/.config/nvim/fnl/dotfiles/init.fnl | 2 +- .../nvim/fnl/dotfiles/plugin/paredit.fnl | 2 +- nvim/.config/nvim/fnl/dotfiles/plugins.fnl | 301 +++++++-------- nvim/.config/nvim/fnl/plugins/cmp.fnl | 60 +++ nvim/.config/nvim/fnl/plugins/colorscheme.fnl | 3 + nvim/.config/nvim/fnl/plugins/conjure.fnl | 17 + nvim/.config/nvim/fnl/plugins/fennel.fnl | 3 + nvim/.config/nvim/fnl/plugins/lsp.fnl | 343 ++++++++++++++++++ nvim/.config/nvim/fnl/plugins/nfnl.fnl | 5 + .../nvim/fnl/plugins/nvim-neo-tree.fnl | 10 + nvim/.config/nvim/fnl/plugins/paredit.fnl | 88 +++++ nvim/.config/nvim/fnl/plugins/plenary.fnl | 3 + nvim/.config/nvim/fnl/plugins/rainbow.fnl | 3 + nvim/.config/nvim/fnl/plugins/smartsplits.fnl | 23 ++ nvim/.config/nvim/fnl/plugins/telescope.fnl | 50 +++ nvim/.config/nvim/fnl/plugins/tpope.fnl | 28 ++ nvim/.config/nvim/fnl/plugins/tree-sitter.fnl | 45 +++ nvim/.config/nvim/init.lua | 2 + nvim/.config/nvim/lazy-lock.json | 43 +++ nvim/.config/nvim/lua/config/lazy.lua | 32 ++ nvim/.config/nvim/lua/dotfiles/init.lua | 1 - .../nvim/lua/dotfiles/plugin/paredit.lua | 1 - nvim/.config/nvim/lua/dotfiles/plugins.lua | 29 +- nvim/.config/nvim/lua/plugins/cmp.lua | 7 + nvim/.config/nvim/lua/plugins/colorscheme.lua | 2 + nvim/.config/nvim/lua/plugins/conjure.lua | 6 + nvim/.config/nvim/lua/plugins/fennel.lua | 2 + nvim/.config/nvim/lua/plugins/lsp.lua | 147 ++++++++ nvim/.config/nvim/lua/plugins/nfnl.lua | 2 + .../nvim/lua/plugins/nvim-neo-tree.lua | 2 + nvim/.config/nvim/lua/plugins/paredit.lua | 95 +++++ nvim/.config/nvim/lua/plugins/plenary.lua | 2 + nvim/.config/nvim/lua/plugins/rainbow.lua | 2 + nvim/.config/nvim/lua/plugins/smartsplits.lua | 20 + nvim/.config/nvim/lua/plugins/telescope.lua | 25 ++ nvim/.config/nvim/lua/plugins/tpope.lua | 12 + nvim/.config/nvim/lua/plugins/tree-sitter.lua | 16 + 39 files changed, 1269 insertions(+), 182 deletions(-) create mode 100644 nvim/.config/nvim/flsproject.fnl create mode 100644 nvim/.config/nvim/flsproject.lua create mode 100644 nvim/.config/nvim/fnl/plugins/cmp.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/colorscheme.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/conjure.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/fennel.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/lsp.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/nfnl.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/nvim-neo-tree.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/paredit.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/plenary.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/rainbow.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/smartsplits.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/telescope.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/tpope.fnl create mode 100644 nvim/.config/nvim/fnl/plugins/tree-sitter.fnl create mode 100644 nvim/.config/nvim/lazy-lock.json create mode 100644 nvim/.config/nvim/lua/config/lazy.lua create mode 100644 nvim/.config/nvim/lua/plugins/cmp.lua create mode 100644 nvim/.config/nvim/lua/plugins/colorscheme.lua create mode 100644 nvim/.config/nvim/lua/plugins/conjure.lua create mode 100644 nvim/.config/nvim/lua/plugins/fennel.lua create mode 100644 nvim/.config/nvim/lua/plugins/lsp.lua create mode 100644 nvim/.config/nvim/lua/plugins/nfnl.lua create mode 100644 nvim/.config/nvim/lua/plugins/nvim-neo-tree.lua create mode 100644 nvim/.config/nvim/lua/plugins/paredit.lua create mode 100644 nvim/.config/nvim/lua/plugins/plenary.lua create mode 100644 nvim/.config/nvim/lua/plugins/rainbow.lua create mode 100644 nvim/.config/nvim/lua/plugins/smartsplits.lua create mode 100644 nvim/.config/nvim/lua/plugins/telescope.lua create mode 100644 nvim/.config/nvim/lua/plugins/tpope.lua create mode 100644 nvim/.config/nvim/lua/plugins/tree-sitter.lua diff --git a/nvim/.config/nvim/flsproject.fnl b/nvim/.config/nvim/flsproject.fnl new file mode 100644 index 0000000..a18417b --- /dev/null +++ b/nvim/.config/nvim/flsproject.fnl @@ -0,0 +1,14 @@ +(comment + (local config (require :nfnl.config)) + (let [{:fennel-path fennel-path + :fennel-macro-path macro-path} + (config.default + {:root-dir "." + :rtp-patterns ["."]})] + {:extra-globals "vim" + :lua-version "lua5.1" + : fennel-path + : macro-path})) + +{:extra-globals "vim" + :lua-version "lua5.1"} diff --git a/nvim/.config/nvim/flsproject.lua b/nvim/.config/nvim/flsproject.lua new file mode 100644 index 0000000..ff36510 --- /dev/null +++ b/nvim/.config/nvim/flsproject.lua @@ -0,0 +1,3 @@ +-- [nfnl] flsproject.fnl +--[[ (local config (require "nfnl.config")) (let [{:fennel-macro-path macro-path :fennel-path fennel-path} (config.default {:root-dir "." :rtp-patterns ["."]})] {:extra-globals "vim" :fennel-path fennel-path :lua-version "lua5.1" :macro-path macro-path}) ]] +return {["extra-globals"] = "vim", ["lua-version"] = "lua5.1"} diff --git a/nvim/.config/nvim/fnl/dotfiles/init.fnl b/nvim/.config/nvim/fnl/dotfiles/init.fnl index 3198b3b..798826f 100644 --- a/nvim/.config/nvim/fnl/dotfiles/init.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/init.fnl @@ -13,7 +13,7 @@ ;; (require-all) (require :dotfiles.core) -(require :dotfiles.plugins) +;; (require :dotfiles.plugins) (require :dotfiles.mapping) (require :dotfiles.conceal) (require :dotfiles.zoom-toggle) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/paredit.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/paredit.fnl index 33b7f61..a1e2d86 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/paredit.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/paredit.fnl @@ -1,5 +1,5 @@ (local a (require :nfnl.core)) -(local treesitter (require :dotfiles.plugin.treesitter)) +;; (local treesitter (require :dotfiles.plugin.treesitter)) (local ts-parsers (require :nvim-treesitter.parsers)) (local ts-utils (require :nvim-treesitter.ts_utils)) (local languagetree (require :vim.treesitter.languagetree)) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl index 8d15cd2..8a763d7 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl @@ -1,150 +1,151 @@ -(local packer (require :packer)) -(local core (require :nfnl.core)) - -(fn safe-require-plugin-config [name] - (let [(ok? val-or-err) (pcall require (.. :dotfiles.plugin. name))] - (when (not ok?) - (print (.. "dotfiles error: " val-or-err))))) - -(fn use [pkgs] - "Iterates through the arguments as pairs and calls packer's use function for - each of them. Works around Fennel not liking mixed associative and sequential - tables as well." - (packer.startup (fn [use] - (each [name opts (pairs pkgs)] - (-?> (. opts :mod) (safe-require-plugin-config)) - (use (core.assoc opts 1 name)))))) - -(local packages {:Olical/nfnl {} - :Olical/conjure {:mod :conjure} - :Olical/fennel.vim {} - :ahmedkhalf/project.nvim {} - :airblade/vim-gitgutter {} - :akinsho/toggleterm.nvim {:mod :toggleterm} - :clojure-vim/vim-jack-in {} - :christianrondeau/vim-base64 {} - :dhruvasagar/vim-table-mode {} - :folke/lsp-colors.nvim {} - :folke/which-key.nvim {:mod :whichkey} - :gbprod/yanky.nvim {:mod :yanky} - :hashivim/vim-terraform {} - :HiPhish/rainbow-delimiters.nvim {} - :hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer - :hrsh7th/cmp-emoji - :hrsh7th/cmp-nvim-lsp - :hrsh7th/cmp-nvim-lua - :hrsh7th/cmp-path - :hrsh7th/cmp-vsnip - :hrsh7th/vim-vsnip-integ - :L3MON4D3/LuaSnip - :PaterJason/cmp-conjure - :saadparwaiz1/cmp_luasnip] - :mod :cmp} - :hrsh7th/vim-vsnip {} - :hrsh7th/vim-vsnip-integ {} - :Iron-E/nvim-soluarized {} - :jiangmiao/auto-pairs {} - :nvimtools/none-ls.nvim {:mod :null-ls - :requires [:nvim-lua/plenary.nvim]} - :junegunn/vim-easy-align {:mod :easyalign} - :kovisoft/paredit {:mod :paredit - :require [:nvim-treesitter/nvim-treesitter]} - :kristijanhusak/vim-dadbod-completion {} - :kristijanhusak/vim-dadbod-ui {} - :L3MON4D3/LuaSnip {:mod :luasnip} - :lifepillar/vim-solarized8 {} - :lukas-reineke/headlines.nvim {:mod :headlines} - ; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun} - :mrjones2014/smart-splits.nvim {:mod :smartsplits} - :mechatroner/rainbow_csv {} - :MunifTanjim/nui.nvim {} - :neovim/nvim-lspconfig {:mod :lspconfig} - :norcalli/nvim-colorizer.lua {:mod :colorizer} - :nvim-neo-tree/neo-tree.nvim {:branch :v3.x - :require [:nvim-lua/plenary.nvim - :nvim-tree/nvim-web-devicons - ; not strictly required, but recommended - :MunifTanjim/nui.nvim - ; :3rd/image.nvim, ; Optional image support in preview window: See `# Preview Mode` for more information - ]} - :nvim-orgmode/orgmode {:mod :orgmode} - :nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] - [:nvim-lua/plenary.nvim]] - :mod :telescope} - :nvim-tree/nvim-web-devicons {} - :nvim-treesitter/nvim-treesitter {:run ":TSUpdate" - :mod :treesitter} - :nvim-treesitter/playground {} - :radenling/vim-dispatch-neovim {} - :RaafatTurki/hex.nvim {:mod :hex} - :rafamadriz/friendly-snippets {} - :skywind3000/asyncrun.vim {} - ;; :tjdevries/sg.nvim {:run "cargo build --workspace" - ;; :dependencies [:nvim-lua/plenary.nvim]} - ;; :tpope/vim-classpath {} - :tpope/vim-dadbod {} - :tpope/vim-dispatch {} - :tpope/vim-fugitive {:mod :fugitive} - :tpope/vim-git {} - :tpope/vim-pathogen {} - :tpope/vim-rails {} - :tpope/vim-repeat {} - :tpope/vim-rhubarb {} - :tpope/vim-surround {} - :tpope/vim-unimpaired {} - :tpope/vim-vinegar {} - :wbthomason/packer.nvim {:mod :packer} - ;; :williamboman/nvim-lsp-installbuilder {} - :williamboman/mason.nvim {:mod :mason - :requires [:williamboman/mason-lspconfig.nvim - :neovim/nvim-lspconfig]} - ; NeoVim lsp server installs - ; :p00f/nvim-ts-rainbow {} - ; :luochen1990/rainbow {} - ; :thecontinium/asyncomplete-conjure.vim {} - ; :jose-elias-alvarez/null-ls.nvim {:mod :null-ls - ; :requires [:nvim-lua/plenary.nvim]} - } - ; :tpope/vim-fireplace {} ; Clojure ; :tpope/vim-sexp-mappings-for-regular-people {} - ) - -(use packages) - -;; call minpac#add('dense-analysis/ale') " Linting -;; call minpac#add('editorconfig/editorconfig-vim') -;; call minpac#add('elixir-lang/vim-elixir') " Elixir -;; call minpac#add('ElmCast/elm-vim') " Elm -;; call minpac#add('jgdavey/tslime.vim', {'branch': 'main'}) " Send to Tmux -;; call minpac#add('leafgarland/typescript-vim') " TypeScript -;; call minpac#add('idris-hackers/idris-vim') " Idris -;; call minpac#add('mxw/vim-jsx') " React JSX support -;; call minpac#add('neomake/neomake') " Linting/Make -;; call minpac#add('nvie/vim-flake8') " Python -;; call minpac#add('pangloss/vim-javascript') " JavaScript -;; call minpac#add('prabirshrestha/async.vim') " Vim/NeoVim async normalization -;; call minpac#add('prabirshrestha/asyncomplete.vim') " Language Server Protocol -;; call minpac#add('raichoo/purescript-vim') " PureScript -;; call minpac#add('reasonml-editor/vim-reason') " ReasonML -;; call minpac#add('thoughtbot/vim-rspec') -;; call minpac#add('vim-erlang/erlang-motions.vim') " Erlang -;; call minpac#add('vim-erlang/vim-erlang-runtime') " Erlang -;; call minpac#add('vim-erlang/vim-erlang-compiler') " Erlang -;; call minpac#add('vim-erlang/vim-erlang-omnicomplete') " Erlang -;; call minpac#add('vim-erlang/vim-erlang-tags') " Erlang -;; call minpac#add('vim-erlang/vim-erlang-skeletons') " Erlang -;; call minpac#add('vim-ruby/vim-ruby') " Ruby -;; call minpac#add('vim-syntastic/syntastic') -;; call minpac#add('vim-jp/syntax-vim-ex') -;; call minpac#add('tsandall/vim-rego') " Rego -;; - -;; " call minpac#add('guns/vim-clojure-static') " Clojure -;; "" call minpac#add('guns/vim-sexp') " Lisps -;; " call minpac#add('ncm2/float-preview.nvim') " autocomplete with preview -;; " call minpac#add('Shougo/deoplete.nvim') " async completion -;; " call minpac#add('prabirshrestha/vim-lsp') " Language Server Protocol -;; " call minpac#add('rhysd/vim-lsp-ale') " vim-lsp + ALE -;; " call minpac#add('mattn/vim-lsp-settings') " Generic LSP Server install and settings for all languages -;; " call minpac#add('prabirshrestha/asyncomplete-lsp.vim') " Language Server Protocol -;; " call minpac#add('prabirshrestha/vim-lsp') " Language Server Protocol -;; " call minpac#add('rhysd/vim-lsp-ale') " vim-lsp + ALE +;; (local packer (require :packer)) +;; (local core (require :nfnl.core)) +;; +;; (fn safe-require-plugin-config [name] +;; (let [(ok? val-or-err) (pcall require (.. :dotfiles.plugin. name))] +;; (when (not ok?) +;; (print (.. "dotfiles error: " val-or-err))))) +;; +;; (fn use [pkgs] +;; "Iterates through the arguments as pairs and calls packer's use function for +;; each of them. Works around Fennel not liking mixed associative and sequential +;; tables as well." +;; (packer.startup (fn [use] +;; (each [name opts (pairs pkgs)] +;; (-?> (. opts :mod) (safe-require-plugin-config)) +;; (use (core.assoc opts 1 name)))))) +;; +;; (local packages { +;; :Olical/nfnl {} +;; :Olical/conjure {:mod :conjure} +;; :Olical/fennel.vim {} +;; :ahmedkhalf/project.nvim {} +;; :airblade/vim-gitgutter {} +;; :akinsho/toggleterm.nvim {:mod :toggleterm} +;; :clojure-vim/vim-jack-in {} +;; :christianrondeau/vim-base64 {} +;; :dhruvasagar/vim-table-mode {} +;; :folke/lsp-colors.nvim {} +;; :folke/which-key.nvim {:mod :whichkey} +;; :gbprod/yanky.nvim {:mod :yanky} +;; :hashivim/vim-terraform {} +;; :HiPhish/rainbow-delimiters.nvim {} +;; :hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer +;; :hrsh7th/cmp-emoji +;; :hrsh7th/cmp-nvim-lsp +;; :hrsh7th/cmp-nvim-lua +;; :hrsh7th/cmp-path +;; :hrsh7th/cmp-vsnip +;; :hrsh7th/vim-vsnip-integ +;; :L3MON4D3/LuaSnip +;; :PaterJason/cmp-conjure +;; :saadparwaiz1/cmp_luasnip] +;; :mod :cmp} +;; :hrsh7th/vim-vsnip {} +;; :hrsh7th/vim-vsnip-integ {} +;; :Iron-E/nvim-soluarized {} +;; :jiangmiao/auto-pairs {} +;; :nvimtools/none-ls.nvim {:mod :null-ls +;; :requires [:nvim-lua/plenary.nvim]} +;; :junegunn/vim-easy-align {:mod :easyalign} +;; :kovisoft/paredit {:mod :paredit +;; :require [:nvim-treesitter/nvim-treesitter]} +;; :kristijanhusak/vim-dadbod-completion {} +;; :kristijanhusak/vim-dadbod-ui {} +;; :L3MON4D3/LuaSnip {:mod :luasnip} +;; :lifepillar/vim-solarized8 {} +;; :lukas-reineke/headlines.nvim {:mod :headlines} +;; ; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun} +;; :mrjones2014/smart-splits.nvim {:mod :smartsplits} +;; :mechatroner/rainbow_csv {} +;; :MunifTanjim/nui.nvim {} +;; :neovim/nvim-lspconfig {:mod :lspconfig} +;; :norcalli/nvim-colorizer.lua {:mod :colorizer} +;; :nvim-neo-tree/neo-tree.nvim {:branch :v3.x +;; :require [:nvim-lua/plenary.nvim +;; :nvim-tree/nvim-web-devicons +;; ; not strictly required, but recommended +;; :MunifTanjim/nui.nvim +;; ; :3rd/image.nvim, ; Optional image support in preview window: See `# Preview Mode` for more information +;; ]} +;; :nvim-orgmode/orgmode {:mod :orgmode} +;; :nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] +;; [:nvim-lua/plenary.nvim]] +;; :mod :telescope} +;; :nvim-tree/nvim-web-devicons {} +;; :nvim-treesitter/nvim-treesitter {:run ":TSUpdate" +;; :mod :treesitter} +;; :nvim-treesitter/playground {} +;; :radenling/vim-dispatch-neovim {} +;; :RaafatTurki/hex.nvim {:mod :hex} +;; :rafamadriz/friendly-snippets {} +;; :skywind3000/asyncrun.vim {} +;; ;; :tjdevries/sg.nvim {:run "cargo build --workspace" +;; ;; :dependencies [:nvim-lua/plenary.nvim]} +;; ;; :tpope/vim-classpath {} +;; :tpope/vim-dadbod {} +;; :tpope/vim-dispatch {} +;; :tpope/vim-fugitive {:mod :fugitive} +;; :tpope/vim-git {} +;; :tpope/vim-pathogen {} +;; :tpope/vim-rails {} +;; :tpope/vim-repeat {} +;; :tpope/vim-rhubarb {} +;; :tpope/vim-surround {} +;; :tpope/vim-unimpaired {} +;; :tpope/vim-vinegar {} +;; :wbthomason/packer.nvim {:mod :packer} +;; ;; :williamboman/nvim-lsp-installbuilder {} +;; :williamboman/mason.nvim {:mod :mason +;; :requires [:williamboman/mason-lspconfig.nvim +;; :neovim/nvim-lspconfig]} +;; ; NeoVim lsp server installs +;; ; :p00f/nvim-ts-rainbow {} +;; ; :luochen1990/rainbow {} +;; ; :thecontinium/asyncomplete-conjure.vim {} +;; ; :jose-elias-alvarez/null-ls.nvim {:mod :null-ls +;; ; :requires [:nvim-lua/plenary.nvim]} +;; } +;; ; :tpope/vim-fireplace {} ; Clojure ; :tpope/vim-sexp-mappings-for-regular-people {} +;; ) +;; +;; (use packages) +;; +;; ;; call minpac#add('dense-analysis/ale') " Linting +;; ;; call minpac#add('editorconfig/editorconfig-vim') +;; ;; call minpac#add('elixir-lang/vim-elixir') " Elixir +;; ;; call minpac#add('ElmCast/elm-vim') " Elm +;; ;; call minpac#add('jgdavey/tslime.vim', {'branch': 'main'}) " Send to Tmux +;; ;; call minpac#add('leafgarland/typescript-vim') " TypeScript +;; ;; call minpac#add('idris-hackers/idris-vim') " Idris +;; ;; call minpac#add('mxw/vim-jsx') " React JSX support +;; ;; call minpac#add('neomake/neomake') " Linting/Make +;; ;; call minpac#add('nvie/vim-flake8') " Python +;; ;; call minpac#add('pangloss/vim-javascript') " JavaScript +;; ;; call minpac#add('prabirshrestha/async.vim') " Vim/NeoVim async normalization +;; ;; call minpac#add('prabirshrestha/asyncomplete.vim') " Language Server Protocol +;; ;; call minpac#add('raichoo/purescript-vim') " PureScript +;; ;; call minpac#add('reasonml-editor/vim-reason') " ReasonML +;; ;; call minpac#add('thoughtbot/vim-rspec') +;; ;; call minpac#add('vim-erlang/erlang-motions.vim') " Erlang +;; ;; call minpac#add('vim-erlang/vim-erlang-runtime') " Erlang +;; ;; call minpac#add('vim-erlang/vim-erlang-compiler') " Erlang +;; ;; call minpac#add('vim-erlang/vim-erlang-omnicomplete') " Erlang +;; ;; call minpac#add('vim-erlang/vim-erlang-tags') " Erlang +;; ;; call minpac#add('vim-erlang/vim-erlang-skeletons') " Erlang +;; ;; call minpac#add('vim-ruby/vim-ruby') " Ruby +;; ;; call minpac#add('vim-syntastic/syntastic') +;; ;; call minpac#add('vim-jp/syntax-vim-ex') +;; ;; call minpac#add('tsandall/vim-rego') " Rego +;; ;; +;; +;; ;; " call minpac#add('guns/vim-clojure-static') " Clojure +;; ;; "" call minpac#add('guns/vim-sexp') " Lisps +;; ;; " call minpac#add('ncm2/float-preview.nvim') " autocomplete with preview +;; ;; " call minpac#add('Shougo/deoplete.nvim') " async completion +;; ;; " call minpac#add('prabirshrestha/vim-lsp') " Language Server Protocol +;; ;; " call minpac#add('rhysd/vim-lsp-ale') " vim-lsp + ALE +;; ;; " call minpac#add('mattn/vim-lsp-settings') " Generic LSP Server install and settings for all languages +;; ;; " call minpac#add('prabirshrestha/asyncomplete-lsp.vim') " Language Server Protocol +;; ;; " call minpac#add('prabirshrestha/vim-lsp') " Language Server Protocol +;; ;; " call minpac#add('rhysd/vim-lsp-ale') " vim-lsp + ALE diff --git a/nvim/.config/nvim/fnl/plugins/cmp.fnl b/nvim/.config/nvim/fnl/plugins/cmp.fnl new file mode 100644 index 0000000..de5dbc1 --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/cmp.fnl @@ -0,0 +1,60 @@ +(import-macros {: tx} :config.macros) + +(tx "hrsh7th/nvim-cmp" + {:event "VeryLazy" + :main "cmp" + :dependencies ["hrsh7th/cmp-nvim-lsp" + "hrsh7th/cmp-buffer" + "hrsh7th/cmp-path" + "hrsh7th/cmp-cmdline" + :hrsh7th/vim-vsnip + :hrsh7th/vim-vsnip-integ + "PaterJason/cmp-conjure" + "Olical/conjure" + "nvim-lua/plenary.nvim"] + + :config + (fn [] + (let [cmp (require :cmp)] + (cmp.setup + {:sources (cmp.config.sources + [{:name "nvim_lsp" :group_index 2} + {:name "nvim_lua" :group_index 2} + {:name "vsnip" :group_index 2} + {:name "conjure" :group_index 2} + {:name "buffer" :group_index 2} + {:name :orgmode :group_index 2} + {:name :emoji :group_index 2 :max_item_count 8}]) + :sorting {:priority_weight 2 + :comparators [;; Below is the default comparator list and order for nvim-cmp + cmp.config.compare.offset + ;; cmp.config.compare.scopes --this is commented in nvim-cmp too + cmp.config.compare.exact + cmp.config.compare.score + cmp.config.compare.recently_used + cmp.config.compare.locality + cmp.config.compare.kind + cmp.config.compare.sort_text + cmp.config.compare.length + cmp.config.compare.order]} + :window {:completion (cmp.config.window.bordered) + :documentation (cmp.config.window.bordered)} + :mapping (cmp.mapping.preset.insert + {: (cmp.mapping.select_prev_item) + : (cmp.mapping.select_next_item) + "" (cmp.mapping.scroll_docs -4) + "" (cmp.mapping.scroll_docs 4) + "" (cmp.mapping.complete) + "" (cmp.mapping.abort) + "" (cmp.mapping.confirm {:select true})})}) + + ; (cmp.setup.cmdline + ; ["/" "?"] + ; {:mapping (cmp.mapping.preset.cmdline) + ; :sources [{:name "buffer"}]}) + + (cmp.setup.cmdline + ":" + {:mapping (cmp.mapping.preset.cmdline) + :sources (cmp.config.sources [{:name "path"} {:name "cmdline"}]) + :matching {:disallow_symbol_nonprefix_matching false}})))}) diff --git a/nvim/.config/nvim/fnl/plugins/colorscheme.fnl b/nvim/.config/nvim/fnl/plugins/colorscheme.fnl new file mode 100644 index 0000000..e401626 --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/colorscheme.fnl @@ -0,0 +1,3 @@ +(import-macros {: tx} :config.macros) + +(tx :lifepillar/vim-solarized8 {}) diff --git a/nvim/.config/nvim/fnl/plugins/conjure.fnl b/nvim/.config/nvim/fnl/plugins/conjure.fnl new file mode 100644 index 0000000..460f29b --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/conjure.fnl @@ -0,0 +1,17 @@ +(import-macros {: tx} :config.macros) + +;; (local conjure-config (require :conjure.config)) + +; (set nvim.g.conjure#eval#result_register "*") +; (set nvim.g.conjure#log#botright true) +(set vim.g.conjure#mapping#doc_word :gk) +(set vim.g.conjure#client#clojure#nrepl#mapping#session_clone :sC) +(set vim.g.conjure#extract#tree_sitter#enabled true) +(set vim.g.conjure#filetype#fennel "conjure.client.fennel.nfnl") + +;; (conjure-config.assoc-in [:filetypes] +;; (core.concat (conjure-config.filetypes) [:markdown])) + +;; (conjure-config.assoc-in [:filetype :markdown] :conjure.client.clojure.nrepl) +(tx "Olical/conjure" + {:event "VeryLazy"}) diff --git a/nvim/.config/nvim/fnl/plugins/fennel.fnl b/nvim/.config/nvim/fnl/plugins/fennel.fnl new file mode 100644 index 0000000..15b741e --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/fennel.fnl @@ -0,0 +1,3 @@ +(import-macros {: tx} :config.macros) + +(tx "micampe/fennel.vim") diff --git a/nvim/.config/nvim/fnl/plugins/lsp.fnl b/nvim/.config/nvim/fnl/plugins/lsp.fnl new file mode 100644 index 0000000..69123ab --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/lsp.fnl @@ -0,0 +1,343 @@ +(import-macros {: tx} :config.macros) +; +; + +(vim.diagnostic.config {:signs {:text {vim.diagnostic.severity.ERROR "☢️" + vim.diagnostic.severity.WARN "⚠️" + vim.diagnostic.severity.INFO "ℹ️" + vim.diagnostic.severity.HINT "🔎"} + ;; :linehl {vim.diagnostic.severity.ERROR :ErrorMsg} + ;; :numhl {vim.diagnostic.severity.WARN :WarningMsg} + }}) + +(local client-nmappings {:clojure_lsp {;;:cn "call LspExecuteCommand('clean-ns')" + ;; :ref "call LspExecuteCommand('extract-function', input('Function name: '))" + ;; :id "call LspExecuteCommand('inline-symbol')" + ;; :il "call LspExecuteCommand('introduce-let', input('Binding name: '))" + ;;:m2l "call LspExecuteCommand('move-to-let', input('Binding name: '))" + }}) + +(local client-command-lnmappings + {:clojure_lsp {:ai [:add-import-to-namespace + [(lambda [] (vim.fn.input "Namespace name: "))]] + :am [:add-missing-libspec []] + :as [:add-require-suggestion + [(lambda [] (vim.fn.input "Namespace name: ")) + (lambda [] (vim.fn.input "Namespace as: ")) + (lambda [] (vim.fn.input "Namespace name: "))]] + :cc [:cycle-coll []] + :cn [:clean-ns []] + :cp [:cycle-privacy []] + :ct [:create-test []] + :df [:drag-forward []] + :db [:drag-backward []] + :df [:drag-forward []] + :dk [:destructure-keys []] + :ed [:extract-to-def + [(lambda [] (vim.fn.input "Definition name: "))]] + :ref [:extract-function + [(lambda [] (vim.fn.input "Function name: "))]] + :el [:expand-let []] + :fe [:create-function []] + :il [:introduce-let + [(lambda [] (vim.fn.input "Binding name: "))]] + :is [:inline-symbol []] + :ma [:resolve-macro-as []] + :mf [:move-form + [(lambda [] (vim.fn.input "File name: "))]] + :ml [:move-to-let + [(lambda [] (vim.fn.input "Binding name: "))]] + :pf [:promote-fn + [(lambda [] (vim.fn.input "Function name: "))]] + :sc [:change-collection + [(lambda [] (vim.fn.input "")) + "input('Collection type: ')"]] + :sm [:sort-map []] + :tf [:thread-first-all []] + :tF [:thread-first []] + :tl [:thread-last-all []] + :tL [:thread-last []] + :ua [:unwind-all []] + :uw [:unwind-thread []]}}) + +; +; (local server-specific-opts {}) +; +; (local base-server-opts +; (let [capabilities (cmp_nvim_lsp.default_capabilities (lsp.protocol.make_client_capabilities))] +; {: on_attach : capabilities :flags {:debounce_text_changes 150}})) + +; (vim.api.nvim_create_user_command :LspExecuteCommand lsp-execute-command +; {:nargs "+"}) + +(local vim _G.vim) + +(local lsps [:clojure_lsp + ; "fennel_ls" + :lua_ls + :jsonls + :yamlls + :marksman + :html + :basedpyright + :ts_ls + :terraformls + ; "tailwindcss" + :dockerls + :docker_compose_language_service + :bashls + :taplo + :sqlls]) + +(local filetype->formatters + {:lua [:stylua] + :sh [:shfmt] + :python [:ruff_organize_imports :ruff_format] + :rust [:rustfmt] + :toml [:taplo] + :clojure [:cljfmt] + :json [:prettierd] + :javascript [:prettierd] + :typescript [:prettierd] + :jsx [:prettierd] + :html [:prettierd] + :css [:prettierd] + :yaml [:prettierd] + :markdown [:prettierd] + :fennel [:fnlfmt] + :sql [:sqlfmt] + :gleam [:gleam] + :* [:trim_whitespace :trim_newlines]}) + +(local formatter->package {:ruff_organize_imports :ruff :ruff_format :ruff}) + +(local disable-formatter-on-save + ;; These mess with the buffer, so we keep them available for manual invocation but never automatic. + {:fennel true :sql true}) + +(local disable-formatter-auto-install + ;; These need to be installed outside of Mason. + {:cljfmt true + :fnlfmt true + :rustfmt true + :trim_whitespace true + :trim_newlines true + :gleam true}) + +(vim.lsp.enable [:clojure :fennel-ls :typedclojure]) + +[(tx :folke/lsp-colors.nvim {}) + (tx :williamboman/mason.nvim {:tag :v1.11.0 :opts {}}) + ; (tx :stevearc/conform.nvim + ; {:dependencies [:rcarriga/nvim-notify] + ; :opts {:default_format_opts {:lsp_format :fallback} + ; :formatters_by_ft filetype->formatters + ; :format_on_save (fn [_buf] + ; (when (and vim.g.dotfiles_format_on_save + ; (or (= nil + ; vim.b.dotfiles_format_on_save) + ; vim.b.dotfiles_format_on_save) + ; (not (. disable-formatter-on-save + ; vim.bo.filetype))) + ; {:timeout_ms 500 :lsp_format :fallback}))} + ; :config (fn [_ opts] + ; (let [conform (require :conform) + ; registry (require :mason-registry) + ; formatters-for-mason {}] + ; (set conform.formatters.shfmt {:prepend_args [:-i :2 :-ci]}) + ; (vim.schedule (fn [] + ; (each [_ft formatters (pairs filetype->formatters)] + ; (each [_idx formatter (ipairs formatters)] + ; (when (not (. disable-formatter-auto-install + ; formatter)) + ; (tset formatters-for-mason + ; (or (. formatter->package + ; formatter) + ; formatter) + ; true)))) + ; (each [formatter _true (pairs formatters-for-mason)] + ; (let [pkg (registry.get_package formatter)] + ; (when (not (pkg:is_installed)) + ; (vim.notify (.. "Automatically installing " + ; formatter " with Mason.")) + ; (pkg:install)))))) + ; (set vim.g.dotfiles_format_on_save true) + ; (conform.setup opts) + ; (set vim.o.formatexpr "v:lua.require'conform'.formatexpr()"))) + ; :keys [(tx :tf + ; (fn [] + ; (set vim.b.dotfiles_format_on_save + ; (if (= nil vim.b.dotfiles_format_on_save) false + ; (not vim.b.dotfiles_format_on_save))) + ; (vim.notify (.. "Set vim.b.dotfiles_format_on_save to " + ; (tostring vim.b.dotfiles_format_on_save)))) + ; {:desc "Toggle buffer formatting"}) + ; (tx :tF + ; (fn [] + ; (set vim.g.dotfiles_format_on_save + ; (not vim.g.dotfiles_format_on_save)) + ; (vim.notify (.. "Set vim.g.dotfiles_format_on_save to " + ; (tostring vim.g.dotfiles_format_on_save)))) + ; {:desc "Toggle global formatting"})]}) + (tx :williamboman/mason-lspconfig.nvim + {:tag :v1.32.0 + :dependencies [:williamboman/mason.nvim] + :opts {:ensure_installed lsps :automatic_installation true}}) + (tx :neovim/nvim-lspconfig + {:lazy false + :dependencies [:williamboman/mason-lspconfig.nvim + :hrsh7th/cmp-nvim-lsp + :stevearc/conform.nvim + :Olical/nfnl] + :keys [(tx :ca #(vim.lsp.buf.code_action) + {:desc "Invoke code_action, prompting for an action to take at the cursor"}) + (tx :fa vim.lsp.buf.format + ; (fn [] ((. (require :conform) :format))) + {:desc "LSP format"}) + (tx :rn vim.lsp.buf.rename {:desc "LSP rename"}) + (tx :gd vim.lsp.buf.definition {:desc "Go to Definition"}) + (tx :gD vim.lsp.buf.declaration {:desc "Go to Declaration"}) + (tx :gi vim.lsp.buf.implementation {:desc "Go to Implementation"}) + (tx :gr vim.lsp.buf.references {:desc "Show References"}) + (tx :K vim.lsp.buf.hover {:desc "LSP Hover"}) + (tx "[g" vim.lsp.diagnostic.goto_prev + {:desc "Previous Diagnostic"}) + (tx "]g" vim.lsp.diagnostic.goto_next {:desc "Next Diagnostic"}) + (tx : vim.lsp.buf.signature_help {:desc "Signature Help"}) + ; :cl "lua vim.lsp.codelens.run()" + ; :ic "lua vim.lsp.buf.incoming_calls()" + ; ;; TODO: think of new mapping; conficts with org mode + ; ;; :oc "lua vim.lsp.buf.outgoing_calls()" + ; :sld "lua vim.diagnostic.open_float(nil, {source = 'always'})" + ; :rn "lua vim.lsp.buf.rename()" + ; :fa "lua vim.lsp.buf.format()"} + ] + :config (fn [] + (let [caps ((. (require :cmp_nvim_lsp) :default_capabilities)) + mlsp (require :mason-lspconfig) + a (require :nfnl.core) + u (require :dotfiles.util) + lsp (require :vim.lsp) + lspconfig (require :lspconfig) + cmp_nvim_lsp (require :cmp_nvim_lsp)] + (vim.lsp.enable :gleam) + + (fn bufmap [mode from to opts] + (u.noremap mode from to (a.merge {:local? true} opts))) + + (fn nbufmap [from to opts] (bufmap :n from to opts)) + + (fn xbufmap [from to opts] (bufmap :x from to opts)) + + (u.nnoremap :li :LspInfo) + + (fn lsp-execute-command [client cmd ...] + (let [buf-uri (vim.uri_from_bufnr 0) + cursor (vim.api.nvim_win_get_cursor 0) + r (- (a.first cursor) 1) + c (a.second cursor) + opts [buf-uri r c] + args (a.concat opts [...])] + ;;(client.exec_cmd {:command cmd :arguments args} {:bufnr 0}) + (client.request_sync :workspace/executeCommand + {:command cmd :arguments args} nil 0))) + + (fn bind-client-mappings [client] + (let [client-name (a.get client :name) + mappings (a.get client-nmappings client-name) + command-lnmappings (a.get client-command-lnmappings + client-name)] + (when mappings + (each [mapping cmd (pairs mappings)] + (nbufmap mapping cmd {}))) + (when command-lnmappings + (each [lnmapping command-mapping (pairs command-lnmappings)] + (let [lsp-cmd (a.first command-mapping) + ;;lsp-cmd (.. client-name "." (a.first command-mapping)) + ;;opts (a.second command-mapping) + mapping (.. : lnmapping) + cmd (lambda [] + (let [opts (accumulate [s "" _i opt (ipairs (a.second command-mapping))] + (.. s + (if (= :function + (type opt)) + (opt) + opt)))] + (lsp-execute-command client lsp-cmd + opts)))] + (nbufmap mapping cmd + {:desc (.. "LSP command `" lsp-cmd "`")})))))) + + (fn on_attach [client bufnr] + ;(each [mapping cmd (pairs core-nmappings)] ; (nbufmap mapping cmd {})) ; x mode mappings + ;(xbufmap :fa "lua vim.lsp.buf.format()" + ; {:desc "Format buffer"}) ; -- buf_set_keymap('n', 'gs', 'lua vim.lsp.buf.document_symbol()', opts) + ; -- buf_set_keymap('n', 'gS', 'lua vim.lsp.buf.workspace_symbol()', opts) + ; -- buf_set_keymap('n', 'gt', 'lua vim.lsp.buf.type_definition()', opts) + ; -- buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + ; -- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + ; -- buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + ; -- buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) + ; -- buf_set_keymap('n', 'ic', "lua vim.lsp.buf.incoming_calls()", opts) + ; -- buf_set_keymap('x', 'ic', "lua vim.lsp.buf.incoming_calls()", opts) + (vim.api.nvim_set_option_value :omnifunc + "v:lua.vim.lsp.omnifunc" + {:buf 0}) + (bind-client-mappings client) + (when client.server_capabilities.documentHighlightProvider + (each [hlgroup base-group (pairs {:LspReferenceRead :SpecialKey + :LspReferenceText :SpecialKey + :LspReferenceWrite :SpecialKey})] + (vim.api.nvim_set_hl 0 hlgroup + (a.merge (vim.api.nvim_get_hl_by_name base-group + true) + {:italic true + :foreground "#6c71c4" + :background :NONE}))) + (let [group (vim.api.nvim_create_augroup :LspDocumentHighlight + {:clear true})] + (vim.api.nvim_create_autocmd [:CursorHold :CursorHoldI] + {: group + :pattern : + :callback (lambda [] + (vim.lsp.buf.document_highlight))}) + (vim.api.nvim_create_autocmd [:CursorMoved] + {: group + :pattern : + :callback (lambda [] + (vim.lsp.buf.clear_references))}))) + (if client.server_capabilities.documentFormattingProvider + (vim.api.nvim_create_autocmd [:BufWritePre] + {:pattern : + :callback vim.lsp.buf.format})) + (print "LSP Client Attached.")) + + (mlsp.setup_handlers (tx (fn [server-name] + (vim.lsp.config server-name + {:capabilities caps + : on_attach}) + (vim.lsp.enable server-name)) + {; :tailwindcss + ; (fn [] + ; ;; https://github.com/tailwindlabs/tailwindcss/discussions/7554#discussioncomment-12991596 + ; ;; https://github.com/tailwindlabs/tailwindcss-intellisense/issues/401#issuecomment-2336568169 + ; ;; https://github.com/tailwindlabs/tailwindcss-intellisense/issues/400#issuecomment-2664427180 + ; (vim.lsp.config "tailwindcss" + ; {:settings + ; {:tailwindCSS + ; {:experimental + ; {:classRegex [["\\[:[^.\\s]*((?:\\.[^.\\s\\]]*)+)[\\s\\]]" "\\.([^.]*)"] + ; ["\\:(\\.[^\\s#]+(?:\\.[^\\s#]+)*)" "\\.([^\\.\\s#]+)"] + ; ["class\\s+(\\:[^\\s\\}]*)[\\s\\}]" "[\\:.]([^.]*)"] + ; ["class\\s+(\"[^\\}\"]*)\"" "[\"\\s]([^\\s\"]*)"] + ; ["class\\s+\\[([\\s\\S]*)\\]" "[\"\\:]([^\\s\"]*)[\"]?"] + ; ["class\\s+'\\[([\\s\\S]*)\\]" "([^\\s]*)?"]]} + ; :includeLanguages {:clojure "html" + ; :clojurescript "html"}}}}) + ; (vim.lsp.enable "tailwindcss")) + }))))}) + (tx :RubixDev/mason-update-all {:cmd :MasonUpdateAll + :dependencies [:williamboman/mason.nvim + :Olical/nfnl] + :main :mason-update-all + :opts {}})] diff --git a/nvim/.config/nvim/fnl/plugins/nfnl.fnl b/nvim/.config/nvim/fnl/plugins/nfnl.fnl new file mode 100644 index 0000000..1f1e66e --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/nfnl.fnl @@ -0,0 +1,5 @@ +(import-macros {: tx} :config.macros) + +(tx "Olical/nfnl" {:lazy false + ;;:ft "fennel" + }) diff --git a/nvim/.config/nvim/fnl/plugins/nvim-neo-tree.fnl b/nvim/.config/nvim/fnl/plugins/nvim-neo-tree.fnl new file mode 100644 index 0000000..c6fddcc --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/nvim-neo-tree.fnl @@ -0,0 +1,10 @@ +(import-macros {: tx} :config.macros) + +(tx :nvim-neo-tree/neo-tree.nvim + {:branch :v3.x + :dependencies [:nvim-tree/nvim-web-devicons + ; not strictly required, but recommended + :MunifTanjim/nui.nvim + ; :3rd/image.nvim, ; Optional image support in preview window: See `# Preview Mode` for more information + ] + :lazy false}) diff --git a/nvim/.config/nvim/fnl/plugins/paredit.fnl b/nvim/.config/nvim/fnl/plugins/paredit.fnl new file mode 100644 index 0000000..6da6200 --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/paredit.fnl @@ -0,0 +1,88 @@ +(import-macros {: tx} :config.macros) + +(set vim.g.paredit_smartjump 1) + +(fn list-member? [xs x] + (a.some #(= x $1) (a.vals xs))) + +(fn bool->int [bool] (if bool 1 0)) + +(fn int->bool [x] (if (= 0 x) false true)) + +(fn toggle-global! [x] + (->> (a.get vim.g x) + (int->bool) + (not) + (bool->int) + (tset vim.g x))) + +(local paredit-langs [:clojure + :fennel + :hy + :janet + :julia + :lfe + :lisp + :racket + :scheme + :shen]) + +(local paredit-host-langs [:org :markdown :asciidoc]) + +(fn paredit-lang? [lang] (list-member? paredit-langs lang)) + + +(vim.api.nvim_create_autocmd [:FileType] + {:pattern :ruby + :callback (lambda [] + (vim.fn.PareditInitBalancingAllBracketsBuffer))}) + +(vim.api.nvim_create_autocmd [:FileType] + {:pattern :javascript + :callback (lambda [] + (vim.fn.PareditInitBalancingAllBracketsBuffer))}) + +(vim.api.nvim_create_autocmd [:FileType] + {:pattern :terraform + :callback (lambda [] + (vim.fn.PareditInitBalancingAllBracketsBuffer))}) + + + +(tx :kovisoft/paredit + {:dependencies [:nvim-treesitter/nvim-treesitter] + :config (fn [] + (let [a (require :nfnl.core) + ;; treesitter (require :dotfiles.plugin.treesitter) + ts-parsers (require :nvim-treesitter.parsers) + ;; ts-utils (require :nvim-treesitter.utils) + languagetree (require :vim.treesitter.languagetree)] + +(fn language-at-cursor [] + (let [parser (ts-parsers.get_parser) + current-node (vim.treesitter.get_node {:bufnr 0}) + range (if current-node [(current-node:range)]) + lang (if range + (languagetree.language_for_range parser range))] + (if lang + (lang:lang)))) + +(fn parser-language [] + (let [parser (ts-parsers.get_parser)] + (when parser + (parser:lang)))) + +(fn host-lang-in? [langs] (list-member? langs (parser-language))) + + +(fn TreeSitterLangParedit [] + (when (host-lang-in? paredit-host-langs) + (let [cursor-lang (language-at-cursor)] + (when cursor-lang + (->> cursor-lang + (paredit-lang?) + (bool->int) + (set vim.g.paredit_mode)) + (vim.fn.PareditInitBuffer))))) + + ))}) diff --git a/nvim/.config/nvim/fnl/plugins/plenary.fnl b/nvim/.config/nvim/fnl/plugins/plenary.fnl new file mode 100644 index 0000000..051e073 --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/plenary.fnl @@ -0,0 +1,3 @@ +(import-macros {: tx} :config.macros) + +(tx :nvim-lua/plenary.nvim {}) diff --git a/nvim/.config/nvim/fnl/plugins/rainbow.fnl b/nvim/.config/nvim/fnl/plugins/rainbow.fnl new file mode 100644 index 0000000..d41b970 --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/rainbow.fnl @@ -0,0 +1,3 @@ +(import-macros {: tx} :config.macros) + +(tx :HiPhish/rainbow-delimiters.nvim {:verion "*"}) diff --git a/nvim/.config/nvim/fnl/plugins/smartsplits.fnl b/nvim/.config/nvim/fnl/plugins/smartsplits.fnl new file mode 100644 index 0000000..a337bab --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/smartsplits.fnl @@ -0,0 +1,23 @@ +(import-macros {: tx} :config.macros) + + +(let [smart-splits (require :smart-splits)] + (when smart-splits + ;; recommended mappings + ;; resizing splits + ;; these keymaps will also accept a range, + ;; for example `10` will `resize_left` by `(10 * config.default_amount)` + (vim.keymap.set :n : smart-splits.resize_left) + (vim.keymap.set :n : smart-splits.resize_down) + (vim.keymap.set :n : smart-splits.resize_up) + (vim.keymap.set :n : smart-splits.resize_right) ; ; moving between splits + (vim.keymap.set :n : smart-splits.move_cursor_left) + (vim.keymap.set :n : smart-splits.move_cursor_down) + (vim.keymap.set :n : smart-splits.move_cursor_up) + (vim.keymap.set :n : smart-splits.move_cursor_right) ; ; swapping buffers between windows + (vim.keymap.set :n :h smart-splits.swap_buf_left) + (vim.keymap.set :n :j smart-splits.swap_buf_down) + (vim.keymap.set :n :k smart-splits.swap_buf_up) + (vim.keymap.set :n :l smart-splits.swap_buf_right))) + +(tx :mrjones2014/smart-splits.nvim {:lazy false}) diff --git a/nvim/.config/nvim/fnl/plugins/telescope.fnl b/nvim/.config/nvim/fnl/plugins/telescope.fnl new file mode 100644 index 0000000..14608fb --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/telescope.fnl @@ -0,0 +1,50 @@ +(import-macros {: tx} :config.macros) + +(local util (require :dotfiles.util)) +(local vimgrep_arguments [:ag + :--nocolor + :--noheading + :--number + :--column + :--nobreak + :--smart-case + :--hidden + ; "--skip-vcs-ignores" + ; "-g" "!.git/" + :--ignore + :.git + :--follow]) + + +(util.lnnoremap :fc "Telescope commands") +(util.lnnoremap :fC "Telescope command_history") +(util.lnnoremap :ff "Telescope git_files hidden=true") +(util.lnnoremap :f- "Telescope find_files") +(util.lnnoremap :fg "Telescope live_grep") +(util.lnnoremap "*" "Telescope grep_string") +(util.lnnoremap :fb "Telescope buffers") +(util.lnnoremap :fd "Telescope diagnostics") +(util.lnnoremap :fH "Telescope help_tags") +(util.lnnoremap :fh "Telescope oldfiles") +(util.lnnoremap :fp "Telescope projects") +(util.lnnoremap :fm "Telescope keymaps") +(util.lnnoremap :fM "Telescope marks") +(util.lnnoremap :ft "Telescope filetypes") +(util.lnnoremap :fq "Telescope quickfix") +(util.lnnoremap :fl "Telescope loclist") +(util.lnnoremap :fsi "Telescope lsp_implementations") +(util.lnnoremap :fsr "Telescope lsp_references") +(util.lnnoremap :fsS "Telescope lsp_document_symbols") +(util.lnnoremap :fss "Telescope lsp_workspace_symbols") +(util.lnnoremap :fy "Telescope yank_history") + +(tx :nvim-telescope/telescope.nvim + { + "version" "*" + :dependencies [[:nvim-lua/popup.nvim] + [:nvim-lua/plenary.nvim]] + + :pickers {:buffers {:mappings {:n {:d :delete_buffer}}}} + :extensions {:projects {:projects {}} + :yank_history {}}}) + diff --git a/nvim/.config/nvim/fnl/plugins/tpope.fnl b/nvim/.config/nvim/fnl/plugins/tpope.fnl new file mode 100644 index 0000000..f24ea7c --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/tpope.fnl @@ -0,0 +1,28 @@ +(import-macros {: tx} :config.macros) + +(local util (require :dotfiles.util)) +;; Determine load time of fugitive +;; (vim.api.nvim_create_autocmd [:FileType] {:pattern ftype :callback setup-conceals}) + +(fn bufmap [mode from to] (util.noremap mode from to {:local? true})) + +(fn map-fugitive-keys [] + (bufmap :n :gp ":Git pull") + (bufmap :n :gP ":Git push") + (bufmap :n :gF ":Git push -f")) + +(vim.api.nvim_create_autocmd [:FileType] + {:pattern :fugitive :callback map-fugitive-keys}) + +[(tx :tpope/vim-dadbod {}) +(tx :tpope/vim-dispatch {}) +(tx :tpope/vim-fugitive {}) +(tx :tpope/vim-git {:lazy false}) +(tx :tpope/vim-pathogen {}) +(tx :tpope/vim-rails {}) +(tx :tpope/vim-repeat {}) +(tx :tpope/vim-rhubarb {}) +(tx :tpope/vim-surround {}) +(tx :tpope/vim-unimpaired {}) +(tx :tpope/vim-vinegar {:lazy false})] + diff --git a/nvim/.config/nvim/fnl/plugins/tree-sitter.fnl b/nvim/.config/nvim/fnl/plugins/tree-sitter.fnl new file mode 100644 index 0000000..3148b7f --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/tree-sitter.fnl @@ -0,0 +1,45 @@ +(import-macros {: tx} :config.macros) + +(vim.api.nvim_create_autocmd + "FileType" + {:pattern ["*"] + :callback #(vim.schedule #(pcall #(vim.treesitter.start)))}) + +(tx + "nvim-treesitter/nvim-treesitter" + {:main :nvim-treesitter.configs + :branch "main" + :build ":TSUpdate" + :config (fn [] + + (let [ treesitter-configs (require :nvim-treesitter.config)] + + (treesitter-configs.setup {:highlight {:enable true + ;; :additional_vim_regex_highlighting false + :additional_vim_regex_highlighting [:org]} + :ensure_installed :all + ; [:org] + :rainbow {:enable true + :extended_mode true + ; Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean + :max_file_lines 10000 + ; Do not enable for files with more than 1000 lines, int + :colors ["#dc322f" + ; red + "#b58900" + ; yellow + "#d33682" + ; magenta + "#859900" + ; green + "#2aa198" + ; cyan + "#268bd2" + ; blue + "#6c71c4" + ; violet / brmagenta + ] + ; table of hex strings + }})) + ) + }) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index bcbf93e..942f366 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,6 +1,8 @@ local execute = vim.api.nvim_command local fn = vim.fn +require 'config.lazy' + local pack_path = fn.stdpath("data") .. "/site/pack" local fmt = string.format diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..e741551 --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,43 @@ +{ + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, + "cmp-conjure": { "branch": "master", "commit": "8c9a88efedc0e5bf3165baa6af8a407afe29daf6" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, + "conjure": { "branch": "main", "commit": "42048ce74a7d86dd85091d7d8cebb78d25761da3" }, + "fennel.vim": { "branch": "main", "commit": "0a5c89e7f31d2721a36f7043ee98e24e22e6325e" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason-update-all": { "branch": "main", "commit": "332aa2586295f93a32643eb2b580f899458215a1" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "9d6826582a3e8c84787bd7355df22a2812a1ad59" }, + "nfnl": { "branch": "main", "commit": "f39a7ec6fe0ace2b2ea108ce04d954549e36c76d" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, + "nvim-lspconfig": { "branch": "master", "commit": "d8bf4c47385340ab2029402201d4d7c9f99f437a" }, + "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, + "nvim-treesitter": { "branch": "main", "commit": "5cb05e1b0fa3c469958a2b26f36b3fe930af221c" }, + "nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" }, + "paredit": { "branch": "master", "commit": "60203e50698ed2211b4434a66ab2258a1a6ac3b5" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "01993eb20c6cdc1d33e7e98252368840309f99b9" }, + "smart-splits.nvim": { "branch": "master", "commit": "25bf40abf79720ebfa98e09259b7c42942055f4c" }, + "telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }, + "vim-dadbod": { "branch": "master", "commit": "6d1d41da4873a445c5605f2005ad2c68c99d8770" }, + "vim-dispatch": { "branch": "master", "commit": "a2ff28abdb2d89725192db5b8562977d392a4d3f" }, + "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, + "vim-git": { "branch": "master", "commit": "485e38f29494e46a9998100e707c755d114155f1" }, + "vim-pathogen": { "branch": "master", "commit": "ac4dd9494fa9008754e49dff85bff1b5746c89b4" }, + "vim-rails": { "branch": "master", "commit": "b0a5c76f86ea214ade36ab0b811e730c3f0add67" }, + "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, + "vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" }, + "vim-solarized8": { "branch": "master", "commit": "345e6b423a6df53e41324ff633d62265f465edec" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vim-unimpaired": { "branch": "master", "commit": "db65482581a28e4ccf355be297f1864a4e66985c" }, + "vim-vinegar": { "branch": "master", "commit": "bb1bcddf43cfebe05eb565a84ab069b357d0b3d6" }, + "vim-vsnip": { "branch": "master", "commit": "9bcfabea653abdcdac584283b5097c3f8760abaa" }, + "vim-vsnip-integ": { "branch": "master", "commit": "c7c93934dece8315db3649bdc6898b76358a8b8d" } +} diff --git a/nvim/.config/nvim/lua/config/lazy.lua b/nvim/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..3ddf246 --- /dev/null +++ b/nvim/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,32 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + change_detection = { + notify = false, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "solarized8" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/nvim/.config/nvim/lua/dotfiles/init.lua b/nvim/.config/nvim/lua/dotfiles/init.lua index d79999c..84ca30f 100644 --- a/nvim/.config/nvim/lua/dotfiles/init.lua +++ b/nvim/.config/nvim/lua/dotfiles/init.lua @@ -16,7 +16,6 @@ local function require_all() return a.map(_1_, a.filter(_2_, a.map(_3_, fs.relglob("fnl/dotfiles", "*.fnl")))) end require("dotfiles.core") -require("dotfiles.plugins") require("dotfiles.mapping") require("dotfiles.conceal") require("dotfiles.zoom-toggle") diff --git a/nvim/.config/nvim/lua/dotfiles/plugin/paredit.lua b/nvim/.config/nvim/lua/dotfiles/plugin/paredit.lua index 967372a..8598385 100644 --- a/nvim/.config/nvim/lua/dotfiles/plugin/paredit.lua +++ b/nvim/.config/nvim/lua/dotfiles/plugin/paredit.lua @@ -1,6 +1,5 @@ -- [nfnl] fnl/dotfiles/plugin/paredit.fnl local a = require("nfnl.core") -local treesitter = require("dotfiles.plugin.treesitter") local ts_parsers = require("nvim-treesitter.parsers") local ts_utils = require("nvim-treesitter.ts_utils") local languagetree = require("vim.treesitter.languagetree") diff --git a/nvim/.config/nvim/lua/dotfiles/plugins.lua b/nvim/.config/nvim/lua/dotfiles/plugins.lua index ec9bcae..dd9f865 100644 --- a/nvim/.config/nvim/lua/dotfiles/plugins.lua +++ b/nvim/.config/nvim/lua/dotfiles/plugins.lua @@ -1,29 +1,2 @@ -- [nfnl] fnl/dotfiles/plugins.fnl -local packer = require("packer") -local core = require("nfnl.core") -local function safe_require_plugin_config(name) - local ok_3f, val_or_err = pcall(require, ("dotfiles.plugin." .. name)) - if not ok_3f then - return print(("dotfiles error: " .. val_or_err)) - else - return nil - end -end -local function use(pkgs) - local function _2_(use0) - for name, opts in pairs(pkgs) do - do - local tmp_3_ = opts.mod - if (nil ~= tmp_3_) then - safe_require_plugin_config(tmp_3_) - else - end - end - use0(core.assoc(opts, 1, name)) - end - return nil - end - return packer.startup(_2_) -end -local packages = {["Olical/nfnl"] = {}, ["Olical/conjure"] = {mod = "conjure"}, ["Olical/fennel.vim"] = {}, ["ahmedkhalf/project.nvim"] = {}, ["airblade/vim-gitgutter"] = {}, ["akinsho/toggleterm.nvim"] = {mod = "toggleterm"}, ["clojure-vim/vim-jack-in"] = {}, ["christianrondeau/vim-base64"] = {}, ["dhruvasagar/vim-table-mode"] = {}, ["folke/lsp-colors.nvim"] = {}, ["folke/which-key.nvim"] = {mod = "whichkey"}, ["gbprod/yanky.nvim"] = {mod = "yanky"}, ["hashivim/vim-terraform"] = {}, ["HiPhish/rainbow-delimiters.nvim"] = {}, ["hrsh7th/nvim-cmp"] = {requires = {"hrsh7th/cmp-buffer", "hrsh7th/cmp-emoji", "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-path", "hrsh7th/cmp-vsnip", "hrsh7th/vim-vsnip-integ", "L3MON4D3/LuaSnip", "PaterJason/cmp-conjure", "saadparwaiz1/cmp_luasnip"}, mod = "cmp"}, ["hrsh7th/vim-vsnip"] = {}, ["hrsh7th/vim-vsnip-integ"] = {}, ["Iron-E/nvim-soluarized"] = {}, ["jiangmiao/auto-pairs"] = {}, ["nvimtools/none-ls.nvim"] = {mod = "null-ls", requires = {"nvim-lua/plenary.nvim"}}, ["junegunn/vim-easy-align"] = {mod = "easyalign"}, ["kovisoft/paredit"] = {mod = "paredit", require = {"nvim-treesitter/nvim-treesitter"}}, ["kristijanhusak/vim-dadbod-completion"] = {}, ["kristijanhusak/vim-dadbod-ui"] = {}, ["L3MON4D3/LuaSnip"] = {mod = "luasnip"}, ["lifepillar/vim-solarized8"] = {}, ["lukas-reineke/headlines.nvim"] = {mod = "headlines"}, ["mrjones2014/smart-splits.nvim"] = {mod = "smartsplits"}, ["mechatroner/rainbow_csv"] = {}, ["MunifTanjim/nui.nvim"] = {}, ["neovim/nvim-lspconfig"] = {mod = "lspconfig"}, ["norcalli/nvim-colorizer.lua"] = {mod = "colorizer"}, ["nvim-neo-tree/neo-tree.nvim"] = {branch = "v3.x", require = {"nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons", "MunifTanjim/nui.nvim"}}, ["nvim-orgmode/orgmode"] = {mod = "orgmode"}, ["nvim-telescope/telescope.nvim"] = {requires = {{"nvim-lua/popup.nvim"}, {"nvim-lua/plenary.nvim"}}, mod = "telescope"}, ["nvim-tree/nvim-web-devicons"] = {}, ["nvim-treesitter/nvim-treesitter"] = {run = ":TSUpdate", mod = "treesitter"}, ["nvim-treesitter/playground"] = {}, ["radenling/vim-dispatch-neovim"] = {}, ["RaafatTurki/hex.nvim"] = {mod = "hex"}, ["rafamadriz/friendly-snippets"] = {}, ["skywind3000/asyncrun.vim"] = {}, ["tpope/vim-dadbod"] = {}, ["tpope/vim-dispatch"] = {}, ["tpope/vim-fugitive"] = {mod = "fugitive"}, ["tpope/vim-git"] = {}, ["tpope/vim-pathogen"] = {}, ["tpope/vim-rails"] = {}, ["tpope/vim-repeat"] = {}, ["tpope/vim-rhubarb"] = {}, ["tpope/vim-surround"] = {}, ["tpope/vim-unimpaired"] = {}, ["tpope/vim-vinegar"] = {}, ["wbthomason/packer.nvim"] = {mod = "packer"}, ["williamboman/mason.nvim"] = {mod = "mason", requires = {"williamboman/mason-lspconfig.nvim", "neovim/nvim-lspconfig"}}} -return use(packages) + diff --git a/nvim/.config/nvim/lua/plugins/cmp.lua b/nvim/.config/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..9ab5c5c --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,7 @@ +-- [nfnl] fnl/plugins/cmp.fnl +local function _1_() + local cmp = require("cmp") + cmp.setup({sources = cmp.config.sources({{name = "nvim_lsp", group_index = 2}, {name = "nvim_lua", group_index = 2}, {name = "vsnip", group_index = 2}, {name = "conjure", group_index = 2}, {name = "buffer", group_index = 2}, {name = "orgmode", group_index = 2}, {name = "emoji", group_index = 2, max_item_count = 8}}), sorting = {priority_weight = 2, comparators = {cmp.config.compare.offset, cmp.config.compare.exact, cmp.config.compare.score, cmp.config.compare.recently_used, cmp.config.compare.locality, cmp.config.compare.kind, cmp.config.compare.sort_text, cmp.config.compare.length, cmp.config.compare.order}}, window = {completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered()}, mapping = cmp.mapping.preset.insert({[""] = cmp.mapping.select_prev_item(), [""] = cmp.mapping.select_next_item(), [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({select = true})})}) + return cmp.setup.cmdline(":", {mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({{name = "path"}, {name = "cmdline"}}), matching = {disallow_symbol_nonprefix_matching = false}}) +end +return {"hrsh7th/nvim-cmp", config = _1_, dependencies = {"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", "hrsh7th/cmp-cmdline", "hrsh7th/vim-vsnip", "hrsh7th/vim-vsnip-integ", "PaterJason/cmp-conjure", "Olical/conjure", "nvim-lua/plenary.nvim"}, event = "VeryLazy", main = "cmp"} diff --git a/nvim/.config/nvim/lua/plugins/colorscheme.lua b/nvim/.config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..d23bd2c --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,2 @@ +-- [nfnl] fnl/plugins/colorscheme.fnl +return {"lifepillar/vim-solarized8"} diff --git a/nvim/.config/nvim/lua/plugins/conjure.lua b/nvim/.config/nvim/lua/plugins/conjure.lua new file mode 100644 index 0000000..f295b09 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/conjure.lua @@ -0,0 +1,6 @@ +-- [nfnl] fnl/plugins/conjure.fnl +vim.g["conjure#mapping#doc_word"] = "gk" +vim.g["conjure#client#clojure#nrepl#mapping#session_clone"] = "sC" +vim.g["conjure#extract#tree_sitter#enabled"] = true +vim.g["conjure#filetype#fennel"] = "conjure.client.fennel.nfnl" +return {"Olical/conjure", event = "VeryLazy"} diff --git a/nvim/.config/nvim/lua/plugins/fennel.lua b/nvim/.config/nvim/lua/plugins/fennel.lua new file mode 100644 index 0000000..2447ec4 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/fennel.lua @@ -0,0 +1,2 @@ +-- [nfnl] fnl/plugins/fennel.fnl +return {"micampe/fennel.vim"} diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..bd04a82 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,147 @@ +-- [nfnl] fnl/plugins/lsp.fnl +vim.diagnostic.config({signs = {text = {[vim.diagnostic.severity.ERROR] = "\226\152\162\239\184\143", [vim.diagnostic.severity.WARN] = "\226\154\160\239\184\143", [vim.diagnostic.severity.INFO] = "\226\132\185\239\184\143", [vim.diagnostic.severity.HINT] = "\240\159\148\142"}}}) +local client_nmappings = {clojure_lsp = {}} +local client_command_lnmappings +local function _1_() + return vim.fn.input("Namespace name: ") +end +local function _2_() + return vim.fn.input("Namespace name: ") +end +local function _3_() + return vim.fn.input("Namespace as: ") +end +local function _4_() + return vim.fn.input("Namespace name: ") +end +local function _5_() + return vim.fn.input("Definition name: ") +end +local function _6_() + return vim.fn.input("Function name: ") +end +local function _7_() + return vim.fn.input("Binding name: ") +end +local function _8_() + return vim.fn.input("File name: ") +end +local function _9_() + return vim.fn.input("Binding name: ") +end +local function _10_() + return vim.fn.input("Function name: ") +end +local function _11_() + return vim.fn.input("") +end +client_command_lnmappings = {clojure_lsp = {ai = {"add-import-to-namespace", {_1_}}, am = {"add-missing-libspec", {}}, as = {"add-require-suggestion", {_2_, _3_, _4_}}, cc = {"cycle-coll", {}}, cn = {"clean-ns", {}}, cp = {"cycle-privacy", {}}, ct = {"create-test", {}}, df = {"drag-forward", {}}, db = {"drag-backward", {}}, dk = {"destructure-keys", {}}, ed = {"extract-to-def", {_5_}}, ref = {"extract-function", {_6_}}, el = {"expand-let", {}}, fe = {"create-function", {}}, il = {"introduce-let", {_7_}}, is = {"inline-symbol", {}}, ma = {"resolve-macro-as", {}}, mf = {"move-form", {_8_}}, ml = {"move-to-let", {_9_}}, pf = {"promote-fn", {_10_}}, sc = {"change-collection", {_11_, "input('Collection type: ')"}}, sm = {"sort-map", {}}, tf = {"thread-first-all", {}}, tF = {"thread-first", {}}, tl = {"thread-last-all", {}}, tL = {"thread-last", {}}, ua = {"unwind-all", {}}, uw = {"unwind-thread", {}}}} +local vim = _G.vim +local lsps = {"clojure_lsp", "lua_ls", "jsonls", "yamlls", "marksman", "html", "basedpyright", "ts_ls", "terraformls", "dockerls", "docker_compose_language_service", "bashls", "taplo", "sqlls"} +local filetype__3eformatters = {lua = {"stylua"}, sh = {"shfmt"}, python = {"ruff_organize_imports", "ruff_format"}, rust = {"rustfmt"}, toml = {"taplo"}, clojure = {"cljfmt"}, json = {"prettierd"}, javascript = {"prettierd"}, typescript = {"prettierd"}, jsx = {"prettierd"}, html = {"prettierd"}, css = {"prettierd"}, yaml = {"prettierd"}, markdown = {"prettierd"}, fennel = {"fnlfmt"}, sql = {"sqlfmt"}, gleam = {"gleam"}, ["*"] = {"trim_whitespace", "trim_newlines"}} +local formatter__3epackage = {ruff_organize_imports = "ruff", ruff_format = "ruff"} +local disable_formatter_on_save = {fennel = true, sql = true} +local disable_formatter_auto_install = {cljfmt = true, fnlfmt = true, rustfmt = true, trim_whitespace = true, trim_newlines = true, gleam = true} +vim.lsp.enable({"clojure", "fennel-ls", "typedclojure"}) +local function _12_() + local caps = require("cmp_nvim_lsp").default_capabilities() + local mlsp = require("mason-lspconfig") + local a = require("nfnl.core") + local u = require("dotfiles.util") + local lsp = require("vim.lsp") + local lspconfig = require("lspconfig") + local cmp_nvim_lsp = require("cmp_nvim_lsp") + vim.lsp.enable("gleam") + local function bufmap(mode, from, to, opts) + return u.noremap(mode, from, to, a.merge({["local?"] = true}, opts)) + end + local function nbufmap(from, to, opts) + return bufmap("n", from, to, opts) + end + local function xbufmap(from, to, opts) + return bufmap("x", from, to, opts) + end + u.nnoremap("li", "LspInfo") + local function lsp_execute_command(client, cmd, ...) + local buf_uri = vim.uri_from_bufnr(0) + local cursor = vim.api.nvim_win_get_cursor(0) + local r = (a.first(cursor) - 1) + local c = a.second(cursor) + local opts = {buf_uri, r, c} + local args = a.concat(opts, {...}) + return client.request_sync("workspace/executeCommand", {command = cmd, arguments = args}, nil, 0) + end + local function bind_client_mappings(client) + local client_name = a.get(client, "name") + local mappings = a.get(client_nmappings, client_name) + local command_lnmappings = a.get(client_command_lnmappings, client_name) + if mappings then + for mapping, cmd in pairs(mappings) do + nbufmap(mapping, cmd, {}) + end + else + end + if command_lnmappings then + for lnmapping, command_mapping in pairs(command_lnmappings) do + local lsp_cmd = a.first(command_mapping) + local mapping = ("" .. lnmapping) + local cmd + local function _14_() + local opts + do + local s = "" + for _i, opt in ipairs(a.second(command_mapping)) do + local _15_ + if ("function" == type(opt)) then + _15_ = opt() + else + _15_ = opt + end + s = (s .. _15_) + end + opts = s + end + return lsp_execute_command(client, lsp_cmd, opts) + end + cmd = _14_ + nbufmap(mapping, cmd, {desc = ("LSP command `" .. lsp_cmd .. "`")}) + end + return nil + else + return nil + end + end + local function on_attach(client, bufnr) + vim.api.nvim_set_option_value("omnifunc", "v:lua.vim.lsp.omnifunc", {buf = 0}) + bind_client_mappings(client) + if client.server_capabilities.documentHighlightProvider then + for hlgroup, base_group in pairs({LspReferenceRead = "SpecialKey", LspReferenceText = "SpecialKey", LspReferenceWrite = "SpecialKey"}) do + vim.api.nvim_set_hl(0, hlgroup, a.merge(vim.api.nvim_get_hl_by_name(base_group, true), {italic = true, foreground = "#6c71c4", background = "NONE"})) + end + local group = vim.api.nvim_create_augroup("LspDocumentHighlight", {clear = true}) + local function _18_() + return vim.lsp.buf.document_highlight() + end + vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI"}, {group = group, pattern = "", callback = _18_}) + local function _19_() + return vim.lsp.buf.clear_references() + end + vim.api.nvim_create_autocmd({"CursorMoved"}, {group = group, pattern = "", callback = _19_}) + else + end + if client.server_capabilities.documentFormattingProvider then + vim.api.nvim_create_autocmd({"BufWritePre"}, {pattern = "", callback = vim.lsp.buf.format}) + else + end + return print("LSP Client Attached.") + end + local function _22_(server_name) + vim.lsp.config(server_name, {capabilities = caps, on_attach = on_attach}) + return vim.lsp.enable(server_name) + end + return mlsp.setup_handlers({_22_}) +end +local function _23_() + return vim.lsp.buf.code_action() +end +return {{"folke/lsp-colors.nvim"}, {"williamboman/mason.nvim", opts = {}, tag = "v1.11.0"}, {"williamboman/mason-lspconfig.nvim", dependencies = {"williamboman/mason.nvim"}, opts = {ensure_installed = lsps, automatic_installation = true}, tag = "v1.32.0"}, {"neovim/nvim-lspconfig", config = _12_, dependencies = {"williamboman/mason-lspconfig.nvim", "hrsh7th/cmp-nvim-lsp", "stevearc/conform.nvim", "Olical/nfnl"}, keys = {{"ca", _23_, desc = "Invoke code_action, prompting for an action to take at the cursor"}, {"fa", vim.lsp.buf.format, desc = "LSP format"}, {"rn", vim.lsp.buf.rename, desc = "LSP rename"}, {"gd", vim.lsp.buf.definition, desc = "Go to Definition"}, {"gD", vim.lsp.buf.declaration, desc = "Go to Declaration"}, {"gi", vim.lsp.buf.implementation, desc = "Go to Implementation"}, {"gr", vim.lsp.buf.references, desc = "Show References"}, {"K", vim.lsp.buf.hover, desc = "LSP Hover"}, {"[g", vim.lsp.diagnostic.goto_prev, desc = "Previous Diagnostic"}, {"]g", vim.lsp.diagnostic.goto_next, desc = "Next Diagnostic"}, {"", vim.lsp.buf.signature_help, desc = "Signature Help"}}, lazy = false}, {"RubixDev/mason-update-all", cmd = "MasonUpdateAll", dependencies = {"williamboman/mason.nvim", "Olical/nfnl"}, main = "mason-update-all", opts = {}}} diff --git a/nvim/.config/nvim/lua/plugins/nfnl.lua b/nvim/.config/nvim/lua/plugins/nfnl.lua new file mode 100644 index 0000000..490c50a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/nfnl.lua @@ -0,0 +1,2 @@ +-- [nfnl] fnl/plugins/nfnl.fnl +return {"Olical/nfnl", lazy = false} diff --git a/nvim/.config/nvim/lua/plugins/nvim-neo-tree.lua b/nvim/.config/nvim/lua/plugins/nvim-neo-tree.lua new file mode 100644 index 0000000..a4eae50 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/nvim-neo-tree.lua @@ -0,0 +1,2 @@ +-- [nfnl] fnl/plugins/nvim-neo-tree.fnl +return {"nvim-neo-tree/neo-tree.nvim", branch = "v3.x", dependencies = {"nvim-tree/nvim-web-devicons", "MunifTanjim/nui.nvim"}, lazy = false} diff --git a/nvim/.config/nvim/lua/plugins/paredit.lua b/nvim/.config/nvim/lua/plugins/paredit.lua new file mode 100644 index 0000000..9d0fbb6 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/paredit.lua @@ -0,0 +1,95 @@ +-- [nfnl] fnl/plugins/paredit.fnl +vim.g.paredit_smartjump = 1 +local function list_member_3f(xs, x) + local function _1_(_241) + return (x == _241) + end + return a.some(_1_, a.vals(xs)) +end +local function bool__3eint(bool) + if bool then + return 1 + else + return 0 + end +end +local function int__3ebool(x) + if (0 == x) then + return false + else + return true + end +end +local function toggle_global_21(x) + vim.g[x] = bool__3eint(not int__3ebool(a.get(vim.g, x))) + return nil +end +local paredit_langs = {"clojure", "fennel", "hy", "janet", "julia", "lfe", "lisp", "racket", "scheme", "shen"} +local paredit_host_langs = {"org", "markdown", "asciidoc"} +local function paredit_lang_3f(lang) + return list_member_3f(paredit_langs, lang) +end +local function _4_() + return vim.fn.PareditInitBalancingAllBracketsBuffer() +end +vim.api.nvim_create_autocmd({"FileType"}, {pattern = "ruby", callback = _4_}) +local function _5_() + return vim.fn.PareditInitBalancingAllBracketsBuffer() +end +vim.api.nvim_create_autocmd({"FileType"}, {pattern = "javascript", callback = _5_}) +local function _6_() + return vim.fn.PareditInitBalancingAllBracketsBuffer() +end +vim.api.nvim_create_autocmd({"FileType"}, {pattern = "terraform", callback = _6_}) +local function _7_() + local a = require("nfnl.core") + local ts_parsers = require("nvim-treesitter.parsers") + local languagetree = require("vim.treesitter.languagetree") + local function language_at_cursor() + local parser = ts_parsers.get_parser() + local current_node = vim.treesitter.get_node({bufnr = 0}) + local range + if current_node then + range = {current_node:range()} + else + range = nil + end + local lang + if range then + lang = languagetree.language_for_range(parser, range) + else + lang = nil + end + if lang then + return lang:lang() + else + return nil + end + end + local function parser_language() + local parser = ts_parsers.get_parser() + if parser then + return parser:lang() + else + return nil + end + end + local function host_lang_in_3f(langs) + return list_member_3f(langs, parser_language()) + end + local function TreeSitterLangParedit() + if host_lang_in_3f(paredit_host_langs) then + local cursor_lang = language_at_cursor() + if cursor_lang then + vim.g.paredit_mode = bool__3eint(paredit_lang_3f(cursor_lang)) + return vim.fn.PareditInitBuffer() + else + return nil + end + else + return nil + end + end + return TreeSitterLangParedit +end +return {"kovisoft/paredit", config = _7_, dependencies = {"nvim-treesitter/nvim-treesitter"}} diff --git a/nvim/.config/nvim/lua/plugins/plenary.lua b/nvim/.config/nvim/lua/plugins/plenary.lua new file mode 100644 index 0000000..feb576c --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/plenary.lua @@ -0,0 +1,2 @@ +-- [nfnl] fnl/plugins/plenary.fnl +return {"nvim-lua/plenary.nvim"} diff --git a/nvim/.config/nvim/lua/plugins/rainbow.lua b/nvim/.config/nvim/lua/plugins/rainbow.lua new file mode 100644 index 0000000..3312077 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/rainbow.lua @@ -0,0 +1,2 @@ +-- [nfnl] fnl/plugins/rainbow.fnl +return {"HiPhish/rainbow-delimiters.nvim", verion = "*"} diff --git a/nvim/.config/nvim/lua/plugins/smartsplits.lua b/nvim/.config/nvim/lua/plugins/smartsplits.lua new file mode 100644 index 0000000..905adad --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/smartsplits.lua @@ -0,0 +1,20 @@ +-- [nfnl] fnl/plugins/smartsplits.fnl +do + local smart_splits = require("smart-splits") + if smart_splits then + vim.keymap.set("n", "", smart_splits.resize_left) + vim.keymap.set("n", "", smart_splits.resize_down) + vim.keymap.set("n", "", smart_splits.resize_up) + vim.keymap.set("n", "", smart_splits.resize_right) + vim.keymap.set("n", "", smart_splits.move_cursor_left) + vim.keymap.set("n", "", smart_splits.move_cursor_down) + vim.keymap.set("n", "", smart_splits.move_cursor_up) + vim.keymap.set("n", "", smart_splits.move_cursor_right) + vim.keymap.set("n", "h", smart_splits.swap_buf_left) + vim.keymap.set("n", "j", smart_splits.swap_buf_down) + vim.keymap.set("n", "k", smart_splits.swap_buf_up) + vim.keymap.set("n", "l", smart_splits.swap_buf_right) + else + end +end +return {"mrjones2014/smart-splits.nvim", lazy = false} diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..beaa1f8 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,25 @@ +-- [nfnl] fnl/plugins/telescope.fnl +local util = require("dotfiles.util") +local vimgrep_arguments = {"ag", "--nocolor", "--noheading", "--number", "--column", "--nobreak", "--smart-case", "--hidden", "--ignore", ".git", "--follow"} +util.lnnoremap("fc", "Telescope commands") +util.lnnoremap("fC", "Telescope command_history") +util.lnnoremap("ff", "Telescope git_files hidden=true") +util.lnnoremap("f-", "Telescope find_files") +util.lnnoremap("fg", "Telescope live_grep") +util.lnnoremap("*", "Telescope grep_string") +util.lnnoremap("fb", "Telescope buffers") +util.lnnoremap("fd", "Telescope diagnostics") +util.lnnoremap("fH", "Telescope help_tags") +util.lnnoremap("fh", "Telescope oldfiles") +util.lnnoremap("fp", "Telescope projects") +util.lnnoremap("fm", "Telescope keymaps") +util.lnnoremap("fM", "Telescope marks") +util.lnnoremap("ft", "Telescope filetypes") +util.lnnoremap("fq", "Telescope quickfix") +util.lnnoremap("fl", "Telescope loclist") +util.lnnoremap("fsi", "Telescope lsp_implementations") +util.lnnoremap("fsr", "Telescope lsp_references") +util.lnnoremap("fsS", "Telescope lsp_document_symbols") +util.lnnoremap("fss", "Telescope lsp_workspace_symbols") +util.lnnoremap("fy", "Telescope yank_history") +return {"nvim-telescope/telescope.nvim", dependencies = {{"nvim-lua/popup.nvim"}, {"nvim-lua/plenary.nvim"}}, extensions = {projects = {projects = {}}, yank_history = {}}, pickers = {buffers = {mappings = {n = {d = "delete_buffer"}}}}, version = "*"} diff --git a/nvim/.config/nvim/lua/plugins/tpope.lua b/nvim/.config/nvim/lua/plugins/tpope.lua new file mode 100644 index 0000000..59d79bb --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/tpope.lua @@ -0,0 +1,12 @@ +-- [nfnl] fnl/plugins/tpope.fnl +local util = require("dotfiles.util") +local function bufmap(mode, from, to) + return util.noremap(mode, from, to, {["local?"] = true}) +end +local function map_fugitive_keys() + bufmap("n", "gp", ":Git pull") + bufmap("n", "gP", ":Git push") + return bufmap("n", "gF", ":Git push -f") +end +vim.api.nvim_create_autocmd({"FileType"}, {pattern = "fugitive", callback = map_fugitive_keys}) +return {{"tpope/vim-dadbod"}, {"tpope/vim-dispatch"}, {"tpope/vim-fugitive"}, {"tpope/vim-git", lazy = false}, {"tpope/vim-pathogen"}, {"tpope/vim-rails"}, {"tpope/vim-repeat"}, {"tpope/vim-rhubarb"}, {"tpope/vim-surround"}, {"tpope/vim-unimpaired"}, {"tpope/vim-vinegar", lazy = false}} diff --git a/nvim/.config/nvim/lua/plugins/tree-sitter.lua b/nvim/.config/nvim/lua/plugins/tree-sitter.lua new file mode 100644 index 0000000..e3f21e2 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/tree-sitter.lua @@ -0,0 +1,16 @@ +-- [nfnl] fnl/plugins/tree-sitter.fnl +local function _1_() + local function _2_() + local function _3_() + return vim.treesitter.start() + end + return pcall(_3_) + end + return vim.schedule(_2_) +end +vim.api.nvim_create_autocmd("FileType", {pattern = {"*"}, callback = _1_}) +local function _4_() + local treesitter_configs = require("nvim-treesitter.config") + return treesitter_configs.setup({highlight = {enable = true, additional_vim_regex_highlighting = {"org"}}, ensure_installed = "all", rainbow = {enable = true, extended_mode = true, max_file_lines = 10000, colors = {"#dc322f", "#b58900", "#d33682", "#859900", "#2aa198", "#268bd2", "#6c71c4"}}}) +end +return {"nvim-treesitter/nvim-treesitter", branch = "main", build = ":TSUpdate", config = _4_, main = "nvim-treesitter.configs"}