From c40184cd843166fc5cc0922192b9784fb3b64402 Mon Sep 17 00:00:00 2001 From: Noah Pederson Date: Wed, 4 Jun 2025 12:07:31 -0500 Subject: [PATCH] AUTOFORMAT: ADD: ambient AI tools --- flake.nix | 7 +- nvim/init.lua | 54 +-- nvim/lua/ambient.lua | 8 + nvim/lua/lsp.lua | 212 ++++++------ nvim/lua/plugins.lua | 802 ++++++++++++++++++++++--------------------- 5 files changed, 560 insertions(+), 523 deletions(-) create mode 100644 nvim/lua/ambient.lua diff --git a/flake.nix b/flake.nix index 7663962..5764fef 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,8 @@ # If your hooks are intrusive, avoid running on each commit with a default_states like this: # default_stages = ["manual" "push"]; hooks = { - nixpkgs-fmt.enable = true; + #nixpkgs-fmt.enable = true; + nixfmt-rfc-style.enable = true; nil.enable = true; luacheck.enable = true; }; @@ -46,7 +47,9 @@ inherit (self.checks.${system}.pre-commit-check) shellHook; #packages = with pkgs; [ nil lua-language-server nixpkgs-fmt ]; buildInputs = self.checks.${system}.pre-commit-check.enabledPackages; - + packages = [ + pkgs.nodePackages_latest.lua-fmt + ]; }; }; } diff --git a/nvim/init.lua b/nvim/init.lua index 305358a..84c071a 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -32,15 +32,15 @@ vim.cmd [[ colorscheme catppuccin-latte ]] -- Force OSC-52 vim.g.clipboard = { - name = 'OSC 52', - copy = { - ['+'] = require('vim.ui.clipboard.osc52').copy('+'), - ['*'] = require('vim.ui.clipboard.osc52').copy('*'), - }, - paste = { - ['+'] = require('vim.ui.clipboard.osc52').paste('+'), - ['*'] = require('vim.ui.clipboard.osc52').paste('*'), - }, + name = 'OSC 52', + copy = { + ['+'] = require('vim.ui.clipboard.osc52').copy('+'), + ['*'] = require('vim.ui.clipboard.osc52').copy('*'), + }, + paste = { + ['+'] = require('vim.ui.clipboard.osc52').paste('+'), + ['*'] = require('vim.ui.clipboard.osc52').paste('*'), + }, } -- CTags @@ -51,25 +51,25 @@ vim.opt.tags = vim.opt.tags + vim.fn.expand("~/.local/tmp/ctags") + -- Gerbil Scheme local set_gerbil = function() - vim.g["conjure#client#scheme#stdio#command"] = "gxi" - vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "%d*> " - vim.g["conjure#client#scheme#stdio#value_prefix_pattern"] = false + vim.g["conjure#client#scheme#stdio#command"] = "gxi" + vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "%d*> " + vim.g["conjure#client#scheme#stdio#value_prefix_pattern"] = false end set_gerbil() vim.api.nvim_create_user_command("ConjureGerbil", set_gerbil, {}) -- Chibi-scheme local set_chibi = function() - vim.g["conjure#client#scheme#stdio#command"] = "chibi-scheme -R" - vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "=> $?" - vim.g["conjure#client#scheme#stdio#value_prefix_pattern"] = true + vim.g["conjure#client#scheme#stdio#command"] = "chibi-scheme -R" + vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "=> $?" + vim.g["conjure#client#scheme#stdio#value_prefix_pattern"] = true end vim.api.nvim_create_user_command("ConjureChibi", set_chibi, {}) -- Chicken Scheme local set_chicken = function() - vim.g["conjure#client#scheme#stdio#command"] = "csi -quiet -:c" - vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "\n-#;%d-> " - vim.g["conjure#client#scheme#stdio#value_prefix_pattern"] = true + vim.g["conjure#client#scheme#stdio#command"] = "csi -quiet -:c" + vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "\n-#;%d-> " + vim.g["conjure#client#scheme#stdio#value_prefix_pattern"] = true end vim.api.nvim_create_user_command("ConjureChicken", set_chicken, {}) @@ -142,15 +142,15 @@ keymap("n", "g", "Neogit", silentnoremap) -- Autoformat! vim.api.nvim_create_user_command("Format", function(args) - local range = nil - if args.count ~= -1 then - local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1] - range = { - start = { args.line1, 0 }, - ["end"] = { args.line2, end_line:len() }, - } - end - require("conform").format({ async = true, lsp_format = "fallback", range = range }) + local range = nil + if args.count ~= -1 then + local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1] + range = { + start = { args.line1, 0 }, + ["end"] = { args.line2, end_line:len() }, + } + end + require("conform").format({ async = true, lsp_format = "fallback", range = range }) end, { range = true }) keymap("n", "", "Format", silentnoremap) diff --git a/nvim/lua/ambient.lua b/nvim/lua/ambient.lua new file mode 100644 index 0000000..2ae7a26 --- /dev/null +++ b/nvim/lua/ambient.lua @@ -0,0 +1,8 @@ +function setup() + return require("codecompanion.adapters").extend("openai_compatible", { + env = { + url = "http://34.46.152.76", + chat_url = "/run-auction" + } + }) +end diff --git a/nvim/lua/lsp.lua b/nvim/lua/lsp.lua index 253317e..28678aa 100644 --- a/nvim/lua/lsp.lua +++ b/nvim/lua/lsp.lua @@ -9,133 +9,133 @@ local util = require("lspconfig.util") -- Rust -- Python LSP nvim_lsp.pylsp.setup({ - -- cmd = {"/home/noah/.envs/nvim/bin/pylsp"}, - root_dir = function(fname) - local root_files = { - "pants.toml", "pyproject.toml", "setup.py", "setup.cfg", "Pipfile" - } - return util.find_git_ancestor(fname) or - util.root_pattern(unpack(root_files))(fname) - end + -- cmd = {"/home/noah/.envs/nvim/bin/pylsp"}, + root_dir = function(fname) + local root_files = { + "pants.toml", "pyproject.toml", "setup.py", "setup.cfg", "Pipfile" + } + return util.find_git_ancestor(fname) or + util.root_pattern(unpack(root_files))(fname) + end }) nvim_lsp.lua_ls.setup { - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = "LuaJIT" - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { "vim" } - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true) - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { enable = false } - } - } + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT" + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" } + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true) + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { enable = false } + } + } } nvim_lsp.janet_lsp.setup { - cmd = { - "janet", - "-i", - "/home/noah/repos/janet-lsp/jpm_tree/lib/janet-lsp.jimage", - "--stdio", - } + cmd = { + "janet", + "-i", + "/home/noah/repos/janet-lsp/jpm_tree/lib/janet-lsp.jimage", + "--stdio", + } } -- LSPs that just use default config local simple_lsps = { - --"htmx", - "nil_ls", "bzl", "buf_ls", "crystalline", "dockerls", - "erlangls", "elixirls", "fortls", "gleam", "gopls", "hls", "jsonls", - "vimls", "asm_lsp", "ccls", "pyright", - "ruff", "clojure_lsp", "guile_ls", - -- Of course the Java-based ones are verbose af - "kotlin_language_server", "java_language_server", "jsonls", "pest_ls", - "ocamllsp", "reason_ls", "racket_langserver", "rust_analyzer", - "scheme_langserver", "sqls", "thriftls", "tinymist", "vhdl_ls", "yamlls", - "zls", "ts_ls", "eslint", "metals", "futhark_lsp", "roc_ls", "sourcekit" - -- disabled because it's broken - -- "scheme_langserver", + --"htmx", + "nil_ls", "bzl", "buf_ls", "crystalline", "dockerls", + "erlangls", "elixirls", "fortls", "gleam", "gopls", "hls", "jsonls", + "vimls", "asm_lsp", "ccls", "pyright", + "ruff", "clojure_lsp", "guile_ls", + -- Of course the Java-based ones are verbose af + "kotlin_language_server", "java_language_server", "jsonls", "pest_ls", + "ocamllsp", "reason_ls", "racket_langserver", "rust_analyzer", + "scheme_langserver", "sqls", "thriftls", "tinymist", "vhdl_ls", "yamlls", + "zls", "ts_ls", "eslint", "metals", "futhark_lsp", "roc_ls", "sourcekit" + -- disabled because it's broken + -- "scheme_langserver", } -- #simple_lsps is the length of the table when treated as a list... funky! for _, v in pairs(simple_lsps) do - nvim_lsp[v].setup { - capabilities = capabilities - } + nvim_lsp[v].setup { + capabilities = capabilities + } end nvim_lsp.fennel_ls.setup({ - capabilities = capabilities, - root_dir = nvim_lsp.util.root_pattern(".git", "fnl") + capabilities = capabilities, + root_dir = nvim_lsp.util.root_pattern(".git", "fnl") }) -- Whenever an LSP is attached to a buffer local on_attach = function(ev) - -- Enable completion triggered by - vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' + -- Enable completion triggered by + vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' - local opts = { noremap = true, silent = true, buffer = ev.buf } - local protocol = require("vim.lsp.protocol") - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) - vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) - vim.keymap.set("n", "", vim.lsp.buf.signature_help, opts) - vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, opts) - vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, opts) - vim.keymap.set("n", "wl", function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, opts) - vim.keymap.set("n", "D", vim.lsp.buf.type_definition, opts) - vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) - vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) - vim.keymap.set("n", "e", vim.diagnostic.open_float, opts) - vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) - vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) - vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) - vim.keymap.set("n", "f", - function() vim.lsp.buf.format { async = true } end, opts) - vim.keymap.set("n", "s", vim.lsp.buf.workspace_symbol, opts) + local opts = { noremap = true, silent = true, buffer = ev.buf } + local protocol = require("vim.lsp.protocol") + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) + vim.keymap.set("n", "", vim.lsp.buf.signature_help, opts) + vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, opts) + vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, opts) + vim.keymap.set("n", "wl", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, opts) + vim.keymap.set("n", "D", vim.lsp.buf.type_definition, opts) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) + vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) + vim.keymap.set("n", "e", vim.diagnostic.open_float, opts) + vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) + vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) + vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) + vim.keymap.set("n", "f", + function() vim.lsp.buf.format { async = true } end, opts) + vim.keymap.set("n", "s", vim.lsp.buf.workspace_symbol, opts) - -- require'completion'.on_attach(client, bufnr) - protocol.CompletionItemKind = { - "", -- Text - "⋙", -- Method - "𝑓", -- Function - "", -- Constructor - "", -- Field - "", -- Variable - "", -- Class - "ﰮ", -- Interface - "", -- Module - "", -- Property - "", -- Unit - "", -- Value - "", -- Enum - "", -- Keyword - "﬌", -- Snippet - "", -- Color - "", -- File - "", -- Reference - "", -- Folder - "", -- EnumMember - "", -- Constant - "", -- Struct - "", -- Event - "ﬦ", -- Operator - "" -- TypeParameter - } + -- require'completion'.on_attach(client, bufnr) + protocol.CompletionItemKind = { + "", -- Text + "⋙", -- Method + "𝑓", -- Function + "", -- Constructor + "", -- Field + "", -- Variable + "", -- Class + "ﰮ", -- Interface + "", -- Module + "", -- Property + "", -- Unit + "", -- Value + "", -- Enum + "", -- Keyword + "﬌", -- Snippet + "", -- Color + "", -- File + "", -- Reference + "", -- Folder + "", -- EnumMember + "", -- Constant + "", -- Struct + "", -- Event + "ﬦ", -- Operator + "" -- TypeParameter + } end vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('UserLspConfig', {}), - callback = on_attach + group = vim.api.nvim_create_augroup('UserLspConfig', {}), + callback = on_attach }) diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 2cc83e0..c5f3592 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -1,401 +1,427 @@ -- Bootstrap lazy.nvim local ensure_lazy = function() - local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" - if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", "clone", "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release - lazypath - }) - end - vim.opt.rtp:prepend(lazypath) + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", "clone", "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release + lazypath + }) + end + vim.opt.rtp:prepend(lazypath) end local lazy_bootstrap = ensure_lazy() if lazy_bootstrap then print("Bootstrapped lazy.nvim") end require("lazy").setup({ - install = { colorscheme = { "catppuccin-latte" } }, - checker = { enabled = false }, - spec = { - -- Color themes - { "shaunsingh/nord.nvim", priority = 1000, lazy = true }, - { "shaunsingh/moonlight.nvim", priority = 1000, lazy = true }, - { "folke/tokyonight.nvim", priority = 1000, lazy = true }, - { "cranberry-clockworks/coal.nvim", priority = 1000, lazy = true }, - { "hardselius/warlock", priority = 1000, lazy = true }, - { "sontungexpt/witch", priority = 1000, lazy = true, config = true }, - { "catppuccin/nvim", name = "catppuccin", priority = 1000, lazy = true }, - { - "neanias/everforest-nvim", - version = false, - lazy = true, - priority = 1000, -- make sure to load this before all the other start plugins - main = "everforest", - opts = { background = "hard" } - }, - { "rebelot/kanagawa.nvim", opts = { compile = true }, priority = 1000, lazy = true }, - { - 'jesseleite/nvim-noirbuddy', - dependencies = { - 'tjdevries/colorbuddy.nvim', - 'nvim-lualine/lualine.nvim' - }, - lazy = true, - priority = 1000, - config = function(_, opts) - -- configure lualine - require('noirbuddy').setup(opts) - local noirbuddy_lualine = require("noirbuddy.plugins.lualine") - require("lualine").setup { - options = { - icons_enabled = true, - --theme = "auto" - theme = noirbuddy_lualine.theme - }, - sections = noirbuddy_lualine.sections, - inactive_sections = noirbuddy_lualine.inactive_sections, - } - end, - opts = { - -- All of your `setup(opts)` will go here - preset = "oxide", - colors = { - noir_8 = "#3A4649" - } - }, - }, - { - "plan9-for-vimspace/acme-colors" - }, - -- Completion - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-vsnip", - "hrsh7th/vim-vsnip", - "petertriho/cmp-git", - "hrsh7th/cmp-cmdline" - }, - config = require('completion') - }, -- nvim lsp plugins - { - "neovim/nvim-lspconfig", - }, - -- LSP Goodness - { - "ray-x/navigator.lua", - dependencies = { - { 'ray-x/guihua.lua', build = 'cd lua/fzy && make' }, - { 'neovim/nvim-lspconfig' }, - } + install = { colorscheme = { "catppuccin-latte" } }, + checker = { enabled = false }, + spec = { + -- Color themes + { "shaunsingh/nord.nvim", priority = 1000, lazy = true }, + { "shaunsingh/moonlight.nvim", priority = 1000, lazy = true }, + { "folke/tokyonight.nvim", priority = 1000, lazy = true }, + { "cranberry-clockworks/coal.nvim", priority = 1000, lazy = true }, + { "hardselius/warlock", priority = 1000, lazy = true }, + { "sontungexpt/witch", priority = 1000, lazy = true, config = true }, + { "catppuccin/nvim", name = "catppuccin", priority = 1000, lazy = true }, + { + "neanias/everforest-nvim", + version = false, + lazy = true, + priority = 1000, -- make sure to load this before all the other start plugins + main = "everforest", + opts = { background = "hard" } + }, + { "rebelot/kanagawa.nvim", opts = { compile = true }, priority = 1000, lazy = true }, + { + 'jesseleite/nvim-noirbuddy', + dependencies = { + 'tjdevries/colorbuddy.nvim', + 'nvim-lualine/lualine.nvim' + }, + lazy = true, + priority = 1000, + config = function(_, opts) + -- configure lualine + require('noirbuddy').setup(opts) + local noirbuddy_lualine = require("noirbuddy.plugins.lualine") + require("lualine").setup { + options = { + icons_enabled = true, + --theme = "auto" + theme = noirbuddy_lualine.theme + }, + sections = noirbuddy_lualine.sections, + inactive_sections = noirbuddy_lualine.inactive_sections, + } + end, + opts = { + -- All of your `setup(opts)` will go here + preset = "oxide", + colors = { + noir_8 = "#3A4649" + } + }, + }, + { + "plan9-for-vimspace/acme-colors" + }, + -- Completion + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-vsnip", + "hrsh7th/vim-vsnip", + "petertriho/cmp-git", + "hrsh7th/cmp-cmdline" + }, + config = require('completion') + }, -- nvim lsp plugins + { + "neovim/nvim-lspconfig", + }, + -- LSP Goodness + { + "ray-x/navigator.lua", + dependencies = { + { 'ray-x/guihua.lua', build = 'cd lua/fzy && make' }, + { 'neovim/nvim-lspconfig' }, + } - }, - { - -- Syntax Highlighting from the future - "nvim-treesitter/nvim-treesitter", - --init = function() vim.cmd([[":TSUpdate"]]) end, - main = "nvim-treesitter.configs", - opts = { - ensure_installed = 'all', - ignore_install = { 'norg' }, - sync_intall = true, - highlight = { - enable = true, - }, - indent = { - enable = false, - }, - }, - build = ":TSUpdate", - version = false, - dependencies = { - "nvim-treesitter/nvim-treesitter-textobjects", - "nvim-treesitter/nvim-treesitter-context", - }, - }, -- Git stuff - -- GitGutter, shows inline difs - "airblade/vim-gitgutter", - { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", -- required - "sindrets/diffview.nvim", -- optional - Diff integration - "nvim-telescope/telescope.nvim" - }, - config = true - }, - -- Auto format tool - { - "stevearc/conform.nvim", - lazy = true, - opts = { - python = { "isort", "black" }, - lua = { "lua-format" }, - clojure = { "cljfmt" }, - rust = { "rustfmt" }, - haskell = { "ormolu", "stylish-haskell" }, - go = { "goimports", "gofmt" }, - java = { "google-java-format" }, - javascript = { "prettier" }, - html = { "prettier" }, - yaml = { "prettier" }, - sh = { "shfmt" }, - c = { "clang-format" }, - } - }, - { - "hedyhli/outline.nvim", - lazy = true, - cmd = { "Outline", "OutlineOpen" }, - config = true, - keys = { - { "o", "Outline", desc = "Toggle outline" }, - }, - }, - { - "ray-x/go.nvim", - ft = "go", - lazy = true, - dependencies = { - "ray-x/guihua.lua", "neovim/nvim-lspconfig", - "nvim-treesitter/nvim-treesitter" - } - }, - { - "nvim-lualine/lualine.nvim", - config = true, - dependencies = { "nvim-tree/nvim-web-devicons" } - }, - -- Fuzzy finding stuff - --"junegunn/fzf.vim", - "ibhagwan/fzf-lua", - -- A lua + nvim stdlib sort of thing - { "nvim-lua/plenary.nvim", lazy = true, }, - -- Telescope, find anything fast - { - "nvim-telescope/telescope.nvim", - config = true, - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope-symbols.nvim", - "nvim-telescope/telescope-fzf-native.nvim" - } - }, - { - "folke/trouble.nvim", - dependencies = "nvim-tree/nvim-web-devicons", - config = true, - }, - -- Which key is bound? - -- literally the best plugin ever - { - "folke/which-key.nvim", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - config = true - }, - -- Developing my neovim - { - "folke/lazydev.nvim", - config = true, - ft = "lua", - lazy = true, - opts = { - library = { - path = "luvit-meta/library", words = { "vim%.uv" }, - }, - }, - dependencies = { - "Bilal2453/luvit-meta" - }, - }, - -- Lithsps - { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = function() - local pairs = require("nvim-autopairs") + }, + { + -- Syntax Highlighting from the future + "nvim-treesitter/nvim-treesitter", + --init = function() vim.cmd([[":TSUpdate"]]) end, + main = "nvim-treesitter.configs", + opts = { + ensure_installed = 'all', + ignore_install = { 'norg' }, + sync_intall = true, + highlight = { + enable = true, + }, + indent = { + enable = false, + }, + }, + build = ":TSUpdate", + version = false, + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + "nvim-treesitter/nvim-treesitter-context", + }, + }, -- Git stuff + -- GitGutter, shows inline difs + "airblade/vim-gitgutter", + { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration + "nvim-telescope/telescope.nvim" + }, + config = true + }, + -- Auto format tool + { + "stevearc/conform.nvim", + lazy = true, + opts = { + python = { "isort", "black" }, + lua = { "lua-format" }, + clojure = { "cljfmt" }, + rust = { "rustfmt" }, + haskell = { "ormolu", "stylish-haskell" }, + go = { "goimports", "gofmt" }, + java = { "google-java-format" }, + javascript = { "prettier" }, + html = { "prettier" }, + yaml = { "prettier" }, + sh = { "shfmt" }, + c = { "clang-format" }, + } + }, + { + "hedyhli/outline.nvim", + lazy = true, + cmd = { "Outline", "OutlineOpen" }, + config = true, + keys = { + { "o", "Outline", desc = "Toggle outline" }, + }, + }, + { + "ray-x/go.nvim", + ft = "go", + lazy = true, + dependencies = { + "ray-x/guihua.lua", "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter" + } + }, + { + "nvim-lualine/lualine.nvim", + config = true, + dependencies = { "nvim-tree/nvim-web-devicons" } + }, + -- Fuzzy finding stuff + --"junegunn/fzf.vim", + "ibhagwan/fzf-lua", + -- A lua + nvim stdlib sort of thing + { "nvim-lua/plenary.nvim", lazy = true, }, + -- Telescope, find anything fast + { + "nvim-telescope/telescope.nvim", + config = true, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-symbols.nvim", + "nvim-telescope/telescope-fzf-native.nvim" + } + }, + { + "folke/trouble.nvim", + dependencies = "nvim-tree/nvim-web-devicons", + config = true, + }, + -- Which key is bound? + -- literally the best plugin ever + { + "folke/which-key.nvim", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + config = true + }, + -- Developing my neovim + { + "folke/lazydev.nvim", + config = true, + ft = "lua", + lazy = true, + opts = { + library = { + path = "luvit-meta/library", words = { "vim%.uv" }, + }, + }, + dependencies = { + "Bilal2453/luvit-meta" + }, + }, + -- Lithsps + { + "windwp/nvim-autopairs", + event = "InsertEnter", + config = function() + local pairs = require("nvim-autopairs") - pairs.setup({ - check_ts = true, - enable_check_bracket_line = false, - }) + pairs.setup({ + check_ts = true, + enable_check_bracket_line = false, + }) - pairs.get_rules("`")[1].not_filetypes = { "clojure", "scheme", "scm", "janet" } - pairs.get_rules("'")[1].not_filetypes = { "clojure", "scheme", "scm", "janet", "rust" } - end, - }, - -- This gives me the paredit engine, it's pretty nifty - { - "gpanders/nvim-parinfer", - ft = { "hy", "scheme", "scm", "clojure", "fennel", "janet", "lisp", "python", "lua" }, - lazy = true, - config = function() - --vim.g.parinfer_comment_chars = { ";" } - vim.g.parinfer_force_balance = true - end - }, -- )))))) - -- This one gives me vim-sexp like structural editing - { - "julienvincent/nvim-paredit", - config = function() - local paredit = require('nvim-paredit') - paredit.setup({ - indent = { - enabled = true, - }, - --filetypes = {"clojure", "fennel", "janet"}, - keys = { - ["w"] = { - function() - -- place cursor and set mode to `insert` - paredit.cursor.place_cursor( - -- wrap element under cursor with `( ` and `)` - paredit.wrap.wrap_element_under_cursor("( ", ")"), - -- cursor placement opts - { placement = "inner_start", mode = "insert" } - ) - end, - "Wrap element insert head", - }, + pairs.get_rules("`")[1].not_filetypes = { "clojure", "scheme", "scm", "janet" } + pairs.get_rules("'")[1].not_filetypes = { "clojure", "scheme", "scm", "janet", "rust" } + end, + }, + -- This gives me the paredit engine, it's pretty nifty + { + "gpanders/nvim-parinfer", + ft = { "hy", "scheme", "scm", "clojure", "fennel", "janet", "lisp", "python", "lua" }, + lazy = true, + config = function() + --vim.g.parinfer_comment_chars = { ";" } + vim.g.parinfer_force_balance = true + end + }, -- )))))) + -- This one gives me vim-sexp like structural editing + { + "julienvincent/nvim-paredit", + config = function() + local paredit = require('nvim-paredit') + paredit.setup({ + indent = { + enabled = true, + }, + --filetypes = {"clojure", "fennel", "janet"}, + keys = { + ["w"] = { + function() + -- place cursor and set mode to `insert` + paredit.cursor.place_cursor( + -- wrap element under cursor with `( ` and `)` + paredit.wrap.wrap_element_under_cursor("( ", ")"), + -- cursor placement opts + { placement = "inner_start", mode = "insert" } + ) + end, + "Wrap element insert head", + }, - ["W"] = { - function() - paredit.cursor.place_cursor( - paredit.wrap.wrap_element_under_cursor("(", ")"), - { placement = "inner_end", mode = "insert" } - ) - end, - "Wrap element insert tail", - }, - -- same as above but for enclosing form - ["i"] = { - function() - paredit.cursor.place_cursor( - paredit.wrap.wrap_enclosing_form_under_cursor( - "( ", ")"), - { placement = "inner_start", mode = "insert" } - ) - end, - "Wrap form insert head", - }, - ["I"] = { - function() - paredit.cursor.place_cursor( - paredit.wrap.wrap_enclosing_form_under_cursor( - "(", ")"), - { placement = "inner_end", mode = "insert" } - ) - end, - "Wrap form insert tail", - }, - ["["] = { - function() - paredit.cursor.place_cursor( - paredit.wrap.wrap_enclosing_form_under_cursor( - "[", "]"), - { placement = "inner_start", mode = "insert" } - ) - end, - }, - ["{"] = { - function() - paredit.cursor.place_cursor( - paredit.wrap.wrap_enclosing_form_under_cursor( - "{", "}"), - { placement = "inner_end", mode = "insert" } - ) - end, - }, - }, - }) - end, - lazy = true, - ft = { "hy", "scheme", "scm", "clojure", "fennel", "janet", "lisp", "python", "lua" } - }, - --{ "hiphish/rainbow-delimiters.nvim", priority = 1050, }, - -- Conjure, lisp is magical - { - "Olical/conjure", - dependencies = { "PaterJason/cmp-conjure" }, - config = function() - vim.g["conjure#client#scheme#stdio#command"] = "gxi" - vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "%d*> $?" - end, - lazy = true, - ft = { "scheme", "scm", "lisp", "fennel", "clojure", "lua", "janet" }, - }, - { "PaterJason/cmp-conjure", lazy = true }, - { "p1xelHer0/gerbil.nvim", lazy = true, ft = "scheme", config = true }, -- Fennel, Luasthp - { "jaawerth/fennel.vim", lazy = true, ft = "fennel", config = true }, - { "rktjmp/hotpot.nvim", lazy = true, ft = "fennel", config = true }, - { "Olical/nfnl", lazy = true, ft = "fennel", config = true }, -- Rust stuff - { - "simrat39/rust-tools.nvim", - lazy = true, - ft = { "rust" }, - config = function() - local rt = require("rust-tools") - rt.setup({ - server = { - on_attach = function(_, bufnr) - -- Hover actions - vim.keymap.set("n", "", - rt.hover_actions.hover_actions, - { buffer = bufnr }) - -- Code action groups - vim.keymap.set("n", "a", - rt.code_action_group.code_action_group, - { buffer = bufnr }) - end - } - }) - end, - dependencies = { "nvim-lua/plenary.nvim" } - }, - { "mfussenegger/nvim-dap", lazy = true, ft = { "c", "rust" } }, - { - "saecki/crates.nvim", - tag = "v0.4.0", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() require("crates").setup() end, - lazy = true, - ft = { "rust" } - }, -- RISC-V Assembly syntax highlighting - { "kylelaker/riscv.vim", ft = "riscv" }, -- Hare Stuff - -- Hare stuff - -- Haredoc - { - url = "https://git.sr.ht/~torresjrjr/vim-haredoc", - lazy = true, - ft = { "hare" }, - branch = "dev" - }, - { url = "https://git.sr.ht/~sircmpwn/hare.vim", ft = { "hare" } }, - -- TCL - { "lewis6991/tree-sitter-tcl", lazy = true, build = "make" }, - -- LF - { - "ptzz/lf.vim", - lazy = true, - cmd = { "Lf" }, - dependencies = { "voldikss/vim-floaterm" } - }, - -- SuperMaven, another AI coding tool - { - "supermaven-inc/supermaven-nvim", - opts = { keymaps = { accept_suggestion = "" } }, - --lazy = true, - priority = 10000, - cmd = "SupermavenStart" - }, - { "imsnif/kdl.vim", lazy = true, ft = "kdl" }, - { "catgoose/nvim-colorizer.lua", lazy = true, ft = {"css", "html", "toml", "conf"}} - } + ["W"] = { + function() + paredit.cursor.place_cursor( + paredit.wrap.wrap_element_under_cursor("(", ")"), + { placement = "inner_end", mode = "insert" } + ) + end, + "Wrap element insert tail", + }, + -- same as above but for enclosing form + ["i"] = { + function() + paredit.cursor.place_cursor( + paredit.wrap.wrap_enclosing_form_under_cursor( + "( ", ")"), + { placement = "inner_start", mode = "insert" } + ) + end, + "Wrap form insert head", + }, + ["I"] = { + function() + paredit.cursor.place_cursor( + paredit.wrap.wrap_enclosing_form_under_cursor( + "(", ")"), + { placement = "inner_end", mode = "insert" } + ) + end, + "Wrap form insert tail", + }, + ["["] = { + function() + paredit.cursor.place_cursor( + paredit.wrap.wrap_enclosing_form_under_cursor( + "[", "]"), + { placement = "inner_start", mode = "insert" } + ) + end, + }, + ["{"] = { + function() + paredit.cursor.place_cursor( + paredit.wrap.wrap_enclosing_form_under_cursor( + "{", "}"), + { placement = "inner_end", mode = "insert" } + ) + end, + }, + }, + }) + end, + lazy = true, + ft = { "hy", "scheme", "scm", "clojure", "fennel", "janet", "lisp", "python", "lua" } + }, + --{ "hiphish/rainbow-delimiters.nvim", priority = 1050, }, + -- Conjure, lisp is magical + { + "Olical/conjure", + dependencies = { "PaterJason/cmp-conjure" }, + config = function() + vim.g["conjure#client#scheme#stdio#command"] = "gxi" + vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "%d*> $?" + end, + lazy = true, + ft = { "scheme", "scm", "lisp", "fennel", "clojure", "lua", "janet" }, + }, + { "PaterJason/cmp-conjure", lazy = true }, + { "p1xelHer0/gerbil.nvim", lazy = true, ft = "scheme", config = true }, -- Fennel, Luasthp + { "jaawerth/fennel.vim", lazy = true, ft = "fennel", config = true }, + { "rktjmp/hotpot.nvim", lazy = true, ft = "fennel", config = true }, + { "Olical/nfnl", lazy = true, ft = "fennel", config = true }, -- Rust stuff + { + "simrat39/rust-tools.nvim", + lazy = true, + ft = { "rust" }, + config = function() + local rt = require("rust-tools") + rt.setup({ + server = { + on_attach = function(_, bufnr) + -- Hover actions + vim.keymap.set("n", "", + rt.hover_actions.hover_actions, + { buffer = bufnr }) + -- Code action groups + vim.keymap.set("n", "a", + rt.code_action_group.code_action_group, + { buffer = bufnr }) + end + } + }) + end, + dependencies = { "nvim-lua/plenary.nvim" } + }, + { "mfussenegger/nvim-dap", lazy = true, ft = { "c", "rust" } }, + { + "saecki/crates.nvim", + tag = "v0.4.0", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() require("crates").setup() end, + lazy = true, + ft = { "rust" } + }, -- RISC-V Assembly syntax highlighting + { "kylelaker/riscv.vim", ft = "riscv" }, -- Hare Stuff + -- Hare stuff + -- Haredoc + { + url = "https://git.sr.ht/~torresjrjr/vim-haredoc", + lazy = true, + ft = { "hare" }, + branch = "dev" + }, + { url = "https://git.sr.ht/~sircmpwn/hare.vim", ft = { "hare" } }, + -- TCL + { "lewis6991/tree-sitter-tcl", lazy = true, build = "make" }, + -- LF + { + "ptzz/lf.vim", + lazy = true, + cmd = { "Lf" }, + dependencies = { "voldikss/vim-floaterm" } + }, + -- SuperMaven, another AI coding tool + --{ + -- "supermaven-inc/supermaven-nvim", + -- opts = { keymaps = { accept_suggestion = "" } }, + -- --lazy = true, + -- priority = 10000, + -- cmd = "SupermavenStart" + --}, + { + "olimorris/codecompanion.nvim", + opts = { + adapters = { + ambient = function() + return require("codecompanion.adapters").extend("openai_compatible", { + env = { + url = "http://34.46.152.76", + chat_url = "/run-auction" + } + }) + end, + ollama = function() + return require("codecompanion.adapters").extend("ollama", { + env = { + url = "http://localhost:11434", + }, + parameters = { + sync = false, + } + }) + end + }, + }, + priority = 10000, + }, + { "imsnif/kdl.vim", lazy = true, ft = "kdl" }, + { "catgoose/nvim-colorizer.lua", lazy = true, ft = { "css", "html", "toml", "conf" } } + } }) -- 2.51.2