From de330ad8d0d41d96d04559e7a78efd013f181a2d Mon Sep 17 00:00:00 2001 From: Noah Pederson Date: Sat, 25 Oct 2025 12:37:44 -0500 Subject: [PATCH] NVIM: sync from aleister --- flake.lock | 12 +- nvim/init.lua | 75 ++--- nvim/lua/ambient.lua | 8 + nvim/lua/lsp.lua | 202 +++++------- nvim/lua/lsp/fennel_ls.lua | 3 + nvim/lua/lsp/janet_lsp.lua | 8 + nvim/lua/lsp/lua_ls.lua | 20 ++ nvim/lua/lsp/pylsp.lua | 4 + nvim/lua/plugins.lua | 660 ++++++++++++++++++------------------- nvim/syntax/infsh.vim | 133 ++++++++ nvim/syntax/mkfile.vim | 97 ++++++ 11 files changed, 707 insertions(+), 515 deletions(-) create mode 100644 nvim/lua/ambient.lua create mode 100644 nvim/lua/lsp/fennel_ls.lua create mode 100644 nvim/lua/lsp/janet_lsp.lua create mode 100644 nvim/lua/lsp/lua_ls.lua create mode 100644 nvim/lua/lsp/pylsp.lua create mode 100644 nvim/syntax/infsh.vim create mode 100644 nvim/syntax/mkfile.vim diff --git a/flake.lock b/flake.lock index 8f754ac..b145c7c 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1758589230, - "narHash": "sha256-zMTCFGe8aVGTEr2RqUi/QzC1nOIQ0N1HRsbqB4f646k=", + "lastModified": 1761173472, + "narHash": "sha256-m9W0dYXflzeGgKNravKJvTMR4Qqa2MVD11AwlGMufeE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d1d883129b193f0b495d75c148c2c3a7d95789a0", + "rev": "c8aa8cc00a5cb57fada0851a038d35c08a36a2bb", "type": "github" }, "original": { @@ -39,11 +39,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1758427187, - "narHash": "sha256-pHpxZ/IyCwoTQPtFIAG2QaxuSm8jWzrzBGjwQZIttJc=", + "lastModified": 1761114652, + "narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "554be6495561ff07b6c724047bdd7e0716aa7b46", + "rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c", "type": "github" }, "original": { diff --git a/nvim/init.lua b/nvim/init.lua index 7aea6b0..0200569 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -8,7 +8,8 @@ require("plugins") -- vim.g.nord_italic = false -- vim.g.nord_bold = false -- vim.opt.background = "light" ---vim.opt.background = "dark" +vim.opt.background = "dark" +vim.cmd[[colorscheme nord]] -- Formatting and vim config vim.opt.expandtab = true @@ -29,31 +30,17 @@ vim.opt.lcs = vim.opt.lcs + "space:ยท" vim.opt.list = true vim.opt.textwidth = 88 --- LuaLine Config - -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, -} - -- 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 @@ -64,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, {}) @@ -155,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) @@ -175,3 +162,7 @@ vim.g.python3_host_prog = vim.fn.expand("~/.envs/nvim/bin/python3") -- ######################## -- LSP require("lsp") + +if vim.uv.fs_stat(vim.fn.stdpath("config") .. "/lua/local.lua") then + require("local") +end 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 b464775..4b6e7fa 100644 --- a/nvim/lua/lsp.lua +++ b/nvim/lua/lsp.lua @@ -1,142 +1,90 @@ -local nvim_lsp = require("lspconfig") local capabilities = require('cmp_nvim_lsp').default_capabilities() -- ######################## -- #### Set up LSPs #### -- ######################## +require('lspconfig') -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 +vim.lsp.config("*", { + capabilities = capabilities }) -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 } - } - } -} - -nvim_lsp.janet_lsp.setup { - 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", "ruby_lsp", - "sourcekit", "uiua" - -- disabled because it's broken - -- "scheme_langserver", +local servers = { + "pylsp", "lua_ls", "janet_lsp", + --"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 - } -end - -nvim_lsp.fennel_ls.setup({ - capabilities = capabilities, - root_dir = nvim_lsp.util.root_pattern(".git", "fnl") -}) +vim.lsp.enable(servers) --- 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/lsp/fennel_ls.lua b/nvim/lua/lsp/fennel_ls.lua new file mode 100644 index 0000000..ec47434 --- /dev/null +++ b/nvim/lua/lsp/fennel_ls.lua @@ -0,0 +1,3 @@ +return { + root_markers = {".git", "fnl"}, +} diff --git a/nvim/lua/lsp/janet_lsp.lua b/nvim/lua/lsp/janet_lsp.lua new file mode 100644 index 0000000..c3f4b56 --- /dev/null +++ b/nvim/lua/lsp/janet_lsp.lua @@ -0,0 +1,8 @@ +return { + cmd = { + "janet", + "-i", + "/home/noah/repos/janet-lsp/jpm_tree/lib/janet-lsp.jimage", + "--stdio", + } +} diff --git a/nvim/lua/lsp/lua_ls.lua b/nvim/lua/lsp/lua_ls.lua new file mode 100644 index 0000000..fa9700a --- /dev/null +++ b/nvim/lua/lsp/lua_ls.lua @@ -0,0 +1,20 @@ +return { + 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", "vis" } + }, + 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 } + } + } +} diff --git a/nvim/lua/lsp/pylsp.lua b/nvim/lua/lsp/pylsp.lua new file mode 100644 index 0000000..92ca1f1 --- /dev/null +++ b/nvim/lua/lsp/pylsp.lua @@ -0,0 +1,4 @@ +return { + -- cmd = {"/home/noah/.envs/nvim/bin/pylsp"}, + root_markers = { "pants.toml", "pyproject.toml", "setup.py", "setup.cfg", "Pipfile" }, +} diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 82bc533..e75bc85 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -1,352 +1,332 @@ -- 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 = { "noirbuddy" } }, - 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', - }, - lazy = true, - priority = 1000, - 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 = { "nord" } }, + 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 }, + { "rose-pine/neovim", priority = 1000, lazy = 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 = function(_spec, _opt) - local noirbuddy_lualine = require("noirbuddy.plugins.lualine") - require("lualine").setup { - options = { - icons_enabled = true, - -- when not using noirbuddy, uncomment this - --theme = "auto" - theme = noirbuddy_lualine.theme - }, - sections = noirbuddy_lualine.sections, - inactive_sections = noirbuddy_lualine.inactive_sections, - } - end, - dependencies = { "nvim-tree/nvim-web-devicons", "jesseleite/nvim-noirbuddy" } - }, - -- Fuzzy finding stuff - "junegunn/fzf.vim", - -- 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 - { - "chiefnoah/nvim-paredit", - opts = { - indent = { - enabled = true, - }, - }, - lazy = true, - ft = { "scheme", "scm", "clojure", "fennel", "janet", "lisp" } - }, - { - "chiefnoah/nvim-paredit-janet", - dependencies = { "julienvincent/nvim-paredit" }, - lazy = true, - ft = { "janet" }, - config = function() - require("nvim-paredit-janet").setup() - end, - }, - { - "julienvincent/nvim-paredit-fennel", - dependencies = { "julienvincent/nvim-paredit" }, - lazy = true, - ft = { "fennel" }, - config = true, - }, - { - "ekaitz-zarraga/nvim-paredit-scheme", - lazy = true, - ft = { "scheme" }, - config = function() - require("nvim-paredit-scheme").setup(require("nvim-paredit")) - end, - }, - { "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, - cmd = "SupermavenStart" - }, - { "imsnif/kdl.vim", lazy = true, ft = "kdl" }, - } + 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" }, + }) + 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" } + }, + { "imsnif/kdl.vim", lazy = true, ft = "kdl" }, + { "catgoose/nvim-colorizer.lua", lazy = true, ft = { "css", "html", "toml", "conf" } }, + { "github/copilot.vim", lazy = true, cmd = { "Copilot" } } + } }) diff --git a/nvim/syntax/infsh.vim b/nvim/syntax/infsh.vim new file mode 100644 index 0000000..8efe52d --- /dev/null +++ b/nvim/syntax/infsh.vim @@ -0,0 +1,133 @@ +" Vim syntax file +" Language: OS Inferno sh +" Maintainer: Alex Efros +" URL: http://powerman.name/download/vim/syntax/infsh.vim +" Version: 1.10 +" Last Change: 2012-12-09 + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + + +syn cluster infshTOP contains=infshError +" usual typo +syn match infshError +"+ + +syn cluster infshTOP add=infshSubst,infshCmdOut,infshBlock +" substitution command +syn region infshSubst matchgroup=infshSubstDelimiter keepend extend start="\$["#]\?{\w\@=" end="}" contains=@infshTOP,@NoSpell +syn match infshSubstName contained "\(\$["#]\?{\)\@<=\w\+" containedin=infshSubst +" get command output +syn region infshCmdOut matchgroup=infshCmdOutDelimiter keepend extend start="[`"]{" end="}" contains=@infshTOP,@NoSpell +" command block +syn region infshBlock matchgroup=infshDelimiter keepend extend start="{" end="}" contains=@infshTOP,@NoSpell + +syn cluster infshTOP add=infshDelimiter,infshRedir,infshConditional,infshOperator,infshPatternClass,infshPattern +" top-level delimiters +syn match infshDelimiter "[;&()]" +syn match infshRedir "[|<>]\(\[\d\+\(=\d\+\)\?\]\)\?" +syn match infshConditional "&&\|||" +syn match infshOperator "\(:=\|=\|\^\)" +syn region infshPatternClass matchgroup=infshPattern keepend extend oneline start="\[^\?" end="\]" contains=infshPatternInClass +syn match infshPatternInClass contained "\(\[^\?\)\@^|}]\@=" +syn match infshError "\$["#]\?\((\s*)\)\@=" +syn match infshError "\$["#]\?\(''[^']\@=\)\@=" +syn match infshError "\$["#]\?\([`]{\@!\)\@=" +syn match infshError "\$["#]\(["]{\@!\)\@=" +syn match infshError "\$["#][#]\@=" + +syn cluster infshTOP add=infshStr,infshComment,infshShebang +" quoted string +syn region infshStr matchgroup=infshStrQ keepend extend start="'" skip="''" end="'" contains=infshStrQQ +syn match infshStrQQ contained "''" +" comment +syn match infshComment "#.*" contains=infshTodo,@Spell extend +syn keyword infshTodo contained TODO TBD FIXME XXX NOTE BUG WARNING DEBUG OPTIMIZATION WORKAROUND +" shebang +syn match infshShebang "^#!/dis/sh\(\.dis\)\?\(\s\+-[nlvx]\+\)*\s*$" contains=infshOpts +syn match infshOpts contained "-[nlvx]\+" + +syn cluster infshTOP add=infshStatement,infshConditional,infshRepeat,infshOperator,infshKeyword,infshException,infshPctlType +" keywords +syn keyword infshStatement fn subfn +syn keyword infshConditional and or if +syn keyword infshRepeat apply getlines for in while +syn keyword infshOperator run builtin exit load unload +syn keyword infshOperator no pctl status +syn match infshOperator "[@!~]" +syn keyword infshKeyword flag loaded whatis +syn keyword infshException raise rescue +syn keyword infshPctlType newfd forkfd newns forkns newpgrp nodevs + + +if version >= 508 || !exists("did_infsh_syn_inits") + if version < 508 + let did_infsh_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink infshSubstDelimiter Identifier + HiLink infshSubstName Operator + + HiLink infshCmdOutDelimiter Include + + HiLink infshDelimiter Delimiter + HiLink infshRedir Type + HiLink infshConditional Conditional + HiLink infshOperator Operator + HiLink infshPattern SpecialChar + HiLink infshPatternInClass SpecialChar + + HiLink infshVar Identifier + HiLink infshSpecVar Special + + HiLink infshError Error + + HiLink infshStr String + HiLink infshStrQ String + HiLink infshStrQQ SpecialChar + + HiLink infshComment Comment + HiLink infshTodo Todo + HiLink infshShebang Comment + HiLink infshOpts PreProc + + HiLink infshStatement Statement + HiLink infshConditional Conditional + HiLink infshRepeat Repeat + HiLink infshOperator Operator + HiLink infshKeyword Keyword + HiLink infshException Exception + HiLink infshPctlType Type + + delcommand HiLink +endif + +let b:current_syntax = "infsh" diff --git a/nvim/syntax/mkfile.vim b/nvim/syntax/mkfile.vim new file mode 100644 index 0000000..4441599 --- /dev/null +++ b/nvim/syntax/mkfile.vim @@ -0,0 +1,97 @@ +" Vim syntax file +" Language: mkfile (used by OS Inferno mk(1)) +" Maintainer: Alex Efros +" URL: http://powerman.name/download/vim/syntax/mkfile.vim +" Version: 1.10 +" Last Change: 2012-12-09 + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + + +syn include @ShOs syntax/sh.vim +unlet b:current_syntax +syn include @ShInferno syntax/infsh.vim +unlet b:current_syntax + + +syn match mkfileComment "\\\@= 508 || !exists("did_mkfile_syn_inits") + if version < 508 + let did_mkfile_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink mkfileError Error + HiLink mkfileComment Comment + HiLink mkfileTodo Todo + HiLink mkfileEscaped Special + + HiLink mkfileDelimiter Operator + HiLink mkfileNextLine Special + + HiLink mkfileVarValue Identifier + HiLink mkfileVarSubst String + HiLink mkfileVarDelimiter Delimiter + + HiLink mkfileVar Identifier + HiLink mkfileVarAttr Type + + HiLink mkfileTargets Function + HiLink mkfileTargetAttr Type + + delcommand HiLink +endif + +let b:current_syntax = "mkfile" -- 2.51.2