diff --git a/after/ftplugin/bru.lua b/after/ftplugin/bru.lua new file mode 100644 index 0000000..7c8fdcc --- /dev/null +++ b/after/ftplugin/bru.lua @@ -0,0 +1,3 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 +vim.opt_local.softtabstop = 2 diff --git a/after/ftplugin/sql.lua b/after/ftplugin/sql.lua index 7c8fdcc..db9b490 100644 --- a/after/ftplugin/sql.lua +++ b/after/ftplugin/sql.lua @@ -1,3 +1,3 @@ -vim.opt_local.tabstop = 2 -vim.opt_local.shiftwidth = 2 -vim.opt_local.softtabstop = 2 +vim.opt_local.tabstop = 4 +vim.opt_local.shiftwidth = 4 +vim.opt_local.softtabstop = 4 diff --git a/after/plugin/snips/python.lua b/after/plugin/snips/python.lua index 3828968..fb55dc3 100644 --- a/after/plugin/snips/python.lua +++ b/after/plugin/snips/python.lua @@ -11,18 +11,89 @@ local c = ls.choice_node ls.add_snippets("python", { s( - "main", + "logger", fmt( [[ - def main() -> None: - {} - - - if __name__ == "__main__": - main() + import logging + logger = logging.getLogger(__name__) + ]], + {} + ) + ), + s( + "dbg", + fmt( + [[ + logger.debug({}) ]], { - i(1, "pass"), + i(0), + } + ) + ), + s( + "info", + fmt( + [[ + logger.info({}) + ]], + { + i(0), + } + ) + ), + s( + "warn", + fmt( + [[ + logger.warning({}) + ]], + { + i(0), + } + ) + ), + s( + "err", + fmt( + [[ + logger.error({}) + ]], + { + i(0), + } + ) + ), + s( + "exc", + fmt( + [[ + logger.exception({}) + ]], + { + i(0), + } + ) + ), + s( + "crit", + fmt( + [[ + logger.critical({}) + ]], + { + i(0), + } + ) + ), + s( + "fatal", + fmt( + [[ + logger.fatal({}) + ]], + { + i(0), } ) ), diff --git a/after/plugin/snips/rust.lua b/after/plugin/snips/rust.lua index 1153cdb..0d1b8fe 100644 --- a/after/plugin/snips/rust.lua +++ b/after/plugin/snips/rust.lua @@ -37,7 +37,6 @@ ls.add_snippets("rust", { {} ) ), - s("pd", fmt([[println!("{}: {{:?}}", {});]], { same(1), i(1) })), s( "dead", fmt( @@ -48,17 +47,98 @@ ls.add_snippets("rust", { ) ), s( - "some", + "component", fmt( [[ - if let Some({}) = torrent.{}{{ - torrent_fields.push({}.to_string()); - }} + #[derive(Debug, Reflect, Component)] + #[reflect(Component)] + struct {} + ]], + { + i(1), + } + ) + ), + s( + "event", + fmt( + [[ + #[derive(Debug, Event)] + struct {} + ]], + { + i(1), + } + ) + ), + s( + "resource", + fmt( + [[ + #[derive(Debug, Default, Reflect, Resource)] + #[reflect(Resource)] + struct {} + ]], + { + i(1), + } + ) + ), + s( + "schedule", + fmt( + [[ + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, ScheduleLabel)] + struct {} + ]], + { + i(1), + } + ) + ), + s( + "states", + fmt( + [[ + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, States)] + enum {} {{ + #[default] + {} + }} + ]], + { + i(1), + i(2), + } + ) + ), + s( + "systemset", + fmt( + [[ + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, SystemSet)] + enum {} {{ + {} + }} + ]], + { + i(1), + i(2), + } + ) + ), + s( + "plugin", + fmt( + [[ + use bevy::prelude::*; + + pub(super) fn plugin(app: &mut App) {{ + {} + }} ]], { - same(1), i(1), - same(1), } ) ), diff --git a/after/plugin/sql_automagic.lua b/after/plugin/sql_automagic.lua new file mode 100644 index 0000000..2951431 --- /dev/null +++ b/after/plugin/sql_automagic.lua @@ -0,0 +1,101 @@ +local run_formatter = function(text) + local split = vim.split(text, "\n") + local result = table.concat(vim.list_slice(split, 2, #split - 1), "\n") + + local j = require("plenary.job"):new({ + command = "pg_format", + writer = { result }, + }) + return j:sync() +end +local literals = { + rust = { "string_literal", "raw_string_literal" }, + python = { "string_content" }, +} + +local function generate_query(lang, nodes) + local node_string = table.concat(nodes, ")\n\t\t(") + local query = string.format( + [[ + ([ + (%s) + ] @sql + (#match? @sql "(SELECT|select|INSERT|insert|UPDATE|update|DELETE|delete).+(FROM|from|INTO|into|VALUES|values|SET|set).*(WHERE|where|GROUP BY|group by)?") + (#offset! @sql 1 0 -1 0)) +]], + node_string + ) + return lang, query +end + +local queries = {} +for lang, nodes in pairs(literals) do + local language, query_string = generate_query(lang, nodes) + queries[lang] = { + language = language, + query = query_string, + } +end + +local get_root = function(bufnr, lang) + local parser = vim.treesitter.get_parser(bufnr, lang, {}) + local tree = parser:parse()[1] + return tree:root() +end + +local format_dat_sql = function(bufnr) + bufnr = bufnr or vim.api.nvim_get_current_buf() + + local changes = {} + for _, query in pairs(queries) do + local root = get_root(bufnr, query.language) + -- if vim.bo[bufnr].filetype ~= query.language then + -- vim.notify("can only be used in {}", query.language) + -- return + -- end + local embedded_sql = vim.treesitter.query.parse(query.language, query.query) + for id, node in embedded_sql:iter_captures(root, bufnr, 0, -1) do + local name = embedded_sql.captures[id] + if name == "sql" then + -- { start row, start col, end row, end col } + local range = { node:range() } + local indentation = string.rep(" ", range[2]) + + -- Run the formatter, based on the node text + local formatted = run_formatter(vim.treesitter.get_node_text(node, bufnr)) + + -- Add some indentation (can be anything you like!) + for idx, line in ipairs(formatted) do + formatted[idx] = indentation .. line + end + + -- Keep track of changes + -- But insert them in reverse order of the file, + -- so that when we make modifications, we don't have + -- any out of date line numbers + table.insert(changes, 1, { + start = range[1] + 1, + final = range[3], + formatted = formatted, + }) + end + end + end + + for _, change in ipairs(changes) do + vim.api.nvim_buf_set_lines(bufnr, change.start, change.final, false, change.formatted) + end +end + +vim.api.nvim_create_user_command("SqlMagic", function() + format_dat_sql() +end, {}) + +local group = vim.api.nvim_create_augroup("rust-sql-magic", { clear = true }) +vim.api.nvim_create_autocmd("BufWritePre", { + group = group, + pattern = "*.rs", + callback = function() + format_dat_sql() + end, +}) diff --git a/after/plugin/sql_rust_automagic.lua b/after/plugin/sql_rust_automagic.lua deleted file mode 100644 index 5209e77..0000000 --- a/after/plugin/sql_rust_automagic.lua +++ /dev/null @@ -1,88 +0,0 @@ -local run_formatter = function(text) - local split = vim.split(text, "\n") - local result = table.concat(vim.list_slice(split, 2, #split - 1), "\n") - - -- Finds sql-format-via-python somewhere in your nvim config path - local bin = vim.api.nvim_get_runtime_file("bin/sql-format-via-python.py", false)[1] - - local j = require("plenary.job"):new({ - command = "python", - args = { bin }, - writer = { result }, - }) - return j:sync() -end - -local embedded_sql = vim.treesitter.query.parse( - "rust", - [[ - ([ - (string_literal) - (raw_string_literal) - ] @sql - (#match? @sql "(SELECT|select|INSERT|insert|UPDATE|update|DELETE|delete).+(FROM|from|INTO|into|VALUES|values|SET|set).*(WHERE|where|GROUP BY|group by)?") - (#offset! @sql 0 1 0 -1)) -]] -) - -local get_root = function(bufnr) - local parser = vim.treesitter.get_parser(bufnr, "rust", {}) - local tree = parser:parse()[1] - return tree:root() -end - -local format_dat_sql = function(bufnr) - bufnr = bufnr or vim.api.nvim_get_current_buf() - - if vim.bo[bufnr].filetype ~= "rust" then - vim.notify("can only be used in rust") - return - end - - local root = get_root(bufnr) - - local changes = {} - for id, node in embedded_sql:iter_captures(root, bufnr, 0, -1) do - local name = embedded_sql.captures[id] - if name == "sql" then - -- { start row, start col, end row, end col } - local range = { node:range() } - local indentation = string.rep(" ", range[2]) - - -- Run the formatter, based on the node text - local formatted = run_formatter(vim.treesitter.get_node_text(node, bufnr)) - - -- Add some indentation (can be anything you like!) - for idx, line in ipairs(formatted) do - formatted[idx] = indentation .. line - end - - -- Keep track of changes - -- But insert them in reverse order of the file, - -- so that when we make modifications, we don't have - -- any out of date line numbers - table.insert(changes, 1, { - start = range[1] + 1, - final = range[3], - formatted = formatted, - }) - end - end - - for _, change in ipairs(changes) do - vim.api.nvim_buf_set_lines(bufnr, change.start, change.final, false, change.formatted) - end -end - -vim.api.nvim_create_user_command("SqlMagic", function() - format_dat_sql() -end, {}) - -local group = vim.api.nvim_create_augroup("rust-sql-magic", { clear = true }) -vim.api.nvim_create_autocmd("BufWritePre", { - group = group, - pattern = "*.rs", - callback = function() - format_dat_sql() - end, -}) diff --git a/after/queries/python/injections.scm b/after/queries/python/injections.scm new file mode 100644 index 0000000..a133f14 --- /dev/null +++ b/after/queries/python/injections.scm @@ -0,0 +1,7 @@ +;extends +([ + (string_content) + ] @injection.content + (#match? @injection.content "(SELECT|select|INSERT|insert|UPDATE|update|DELETE|delete).+(FROM|from|INTO|into|VALUES|values|SET|set).*(WHERE|where|GROUP BY|group by)?") + (#offset! @injection.content 0 1 0 -1) +(#set! injection.language "sql")) diff --git a/after/queries/rust/injections.scm b/after/queries/rust/injections.scm new file mode 100644 index 0000000..d9968b1 --- /dev/null +++ b/after/queries/rust/injections.scm @@ -0,0 +1,9 @@ +;extends +;; Inject into sqlx::query!(r#"..."#, ...) as sql +([ + (string_literal) + (raw_string_literal) + ] @injection.content + (#match? @injection.content "(SELECT|select|INSERT|insert|UPDATE|update|DELETE|delete).+(FROM|from|INTO|into|VALUES|values|SET|set).*(WHERE|where|GROUP BY|group by)?") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.language "sql")) diff --git a/bin/sql-format-via-python.py b/bin/sql-format-via-python.py deleted file mode 100644 index d5345af..0000000 --- a/bin/sql-format-via-python.py +++ /dev/null @@ -1,30 +0,0 @@ -import sys - -import sqlparse - -# TODO: Decide what to do about $/? -# contents = contents.replace(f"${identifier}", f"__id_{identifier}") - -contents = sys.stdin.read() -for identifier in range(10): - contents = contents.replace(f"?{identifier}", f"__id_{identifier}") - -# for nightshadedude -comma_first = False - -result = sqlparse.format( - contents, - indent_columns=True, - keyword_case="upper", - identifier_case="lower", - reindent=True, - output_format="sql", - indent_after_first=True, - wrap_after=80, - comma_first=comma_first, -) - -for identifier in range(10): - result = result.replace(f"__id_{identifier}", f"?{identifier}") - -print(result.strip()) diff --git a/lazy-lock.json b/lazy-lock.json index 174eb0f..bcfb0c5 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -3,12 +3,12 @@ "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, - "catppuccin.nvim": { "branch": "main", "commit": "4fd72a9ab64b393c2c22b168508fd244877fec96" }, - "ccc.nvim": { "branch": "main", "commit": "4fb5abaef2f2e0540fe22d4d74a9841205fff9e4" }, + "catppuccin.nvim": { "branch": "main", "commit": "7be452ee067978cdc8b2c5f3411f0c71ffa612b9" }, + "ccc.nvim": { "branch": "main", "commit": "7c639042583c7bdc7ce2e37e5a0e0aa6d0659c6a" }, "cellular-automaton.nvim": { "branch": "main", "commit": "11aea08aa084f9d523b0142c2cd9441b8ede09ed" }, "cheatsheet.nvim": { "branch": "master", "commit": "8ee4d76b6f902c4017dc28eddd79d925dfc55066" }, "cloak.nvim": { "branch": "main", "commit": "648aca6d33ec011dc3166e7af3b38820d01a71e4" }, - "cmake-tools.nvim": { "branch": "master", "commit": "4be3c229fe932043fd83ad52fdf0ba9af7297789" }, + "cmake-tools.nvim": { "branch": "master", "commit": "f1f917b584127b673c25138233cebf1d61a19f35" }, "cmp-async-path": { "branch": "main", "commit": "9d581eec5acf812316913565c135b0d1ee2c9a71" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, @@ -21,128 +21,140 @@ "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-pypi": { "branch": "main", "commit": "a73411e5935caa23c6feab34980bb435deadd482" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "code-playground.nvim": { "branch": "main", "commit": "7b257911268ecf7ee11d6fe806193bda2c889e86" }, "codeium.nvim": { "branch": "main", "commit": "d3b88eb3aa1de6da33d325c196b8a41da2bcc825" }, - "conform.nvim": { "branch": "master", "commit": "62eba813b7501b39612146cbf29cd07f1d4ac29c" }, + "conform.nvim": { "branch": "master", "commit": "40d4e98fcc3e6f485f0e8924c63734bc7e305967" }, + "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "crates.nvim": { "branch": "main", "commit": "1c924d5a9ea3496c4e1a02d0d51388ba809f8468" }, - "curl.nvim": { "branch": "main", "commit": "4576324dc6d1b86744459031d2dc44fa3e40c7d3" }, + "cratesearch.nvim": { "branch": "master", "commit": "9d09625d017f6b2e116503f935bc6862961313fa" }, + "curl.nvim": { "branch": "main", "commit": "e3e70d8b2cce6b45291a25156fbb50921e3ae941" }, "darkplus.nvim": { "branch": "master", "commit": "c7fff5ce62406121fc6c9e4746f118b2b2499c4c" }, - "darkvoid.nvim": { "branch": "master", "commit": "8c637ccf504f6ea8efd181bdb278f36b77086f94" }, - "decisive.nvim": { "branch": "main", "commit": "74f74436d9db014e63d3cb60629bce7aeb6a38ee" }, - "demicolon.nvim": { "branch": "main", "commit": "d3237e1691276fa6f538b18f7a85d49b6362ccdf" }, + "darkvoid.nvim": { "branch": "master", "commit": "5a002864757b6778a8bf0ece18a7003ed0b39cdc" }, + "decisive.nvim": { "branch": "main", "commit": "a7251adebccbc9c899cff39a524b20d06e2b78b5" }, + "demicolon.nvim": { "branch": "main", "commit": "d5738af20d231bc7b10a0e03c4f9cf306300f516" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dracula.nvim": { "branch": "main", "commit": "fdf503e52ec1c8aae07353604d891fe5a3ed5201" }, - "flow.nvim": { "branch": "main", "commit": "3af4d4d1b8a99c34e060de6fdaa5babc596a50c1" }, - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "garbage-day.nvim": { "branch": "main", "commit": "4a1160bfffb2f499fb55a54333f29d160ab3c8a1" }, + "flow.nvim": { "branch": "main", "commit": "c8f467af401de5356e2ca98388499489e8ad282f" }, + "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "garbage-day.nvim": { "branch": "main", "commit": "750ef08ae6031ee3683014c5349144340c08ead6" }, "git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" }, "gitignore.nvim": { "branch": "master", "commit": "2455191ec94da8ed222806a4fe3aa358eac1e558" }, "gitpad.nvim": { "branch": "main", "commit": "1e0f6fa335c72c05d1d3635120c572e198e5ae0d" }, - "gitsigns.nvim": { "branch": "main", "commit": "562dc47189ad3c8696dbf460d38603a74d544849" }, - "gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" }, + "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, + "gruvbox.nvim": { "branch": "main", "commit": "49d9c0b150ba70efcd831ec7b3cb8ee740067045" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, - "harpoon-lualine": { "branch": "master", "commit": "d1b873c19b701fd80d60a67d086dbb3bcc4eb00e" }, + "harpoon-lualine": { "branch": "master", "commit": "eae10bc6bddddbc73daa0956ba4ee5cc29cf9a49" }, + "hot-reload.nvim": { "branch": "main", "commit": "9094182138635747158da64490a838ba46cf2d6c" }, "http-codes.nvim": { "branch": "main", "commit": "a610788dff2fb5df05b230d73a926c8dc3173c16" }, "hypersonic.nvim": { "branch": "main", "commit": "734dfbfbe51952f102a9b439d53d4267bb0024cd" }, "in-and-out.nvim": { "branch": "master", "commit": "ab24cafadc3418dffb0c7e9b0621cff60b9ac551" }, - "indent-blankline.nvim": { "branch": "master", "commit": "3fe94b8034dd5241cb882bb73847303b58857ecf" }, - "inlay-hint.nvim": { "branch": "main", "commit": "c31047c9b3943b29bd4839c7fe5b08dc12730469" }, - "inlay-hints.nvim": { "branch": "master", "commit": "e81444416eea7fe5f19a6bc8336a7aed628f3663" }, - "kanagawa.nvim": { "branch": "master", "commit": "e5f7b8a804360f0a48e40d0083a97193ee4fcc87" }, - "lackluster.nvim": { "branch": "main", "commit": "2fcf09e7492ff50067ac9c0ca4bd81563499c410" }, - "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "indent-blankline.nvim": { "branch": "master", "commit": "e7a4442e055ec953311e77791546238d1eaae507" }, + "inlay-hint.nvim": { "branch": "main", "commit": "eb5f0579537db271dfedd7f38460cdacb238176f" }, + "inlay-hints.nvim": { "branch": "master", "commit": "af84dee42cd118af6d592b06c1c0e45d6432a6c0" }, + "jq.nvim": { "branch": "main", "commit": "85ec70f4676363d4ce27403420b798ad5c182077" }, + "kanagawa.nvim": { "branch": "master", "commit": "f491b0fe68fffbece7030181073dfe51f45cda81" }, + "lackluster.nvim": { "branch": "main", "commit": "59d03c9e92cb03351af2904a26e16b6627d2d5db" }, + "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, + "lualine-lsp-status": { "branch": "main", "commit": "1218d51d4d0b8881a598a77e5d9f334ac31c6cc7" }, "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, "markdown-table-mode.nvim": { "branch": "main", "commit": "f830cd15a97deb3acc53d9f6607bc609f7f32e49" }, "markdown-togglecheck": { "branch": "main", "commit": "5e9ee3184109a102952c01ef816babe8835b299a" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "482350b050bd413931c2cdd4857443c3da7d57cb" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "melange.nvim": { "branch": "master", "commit": "e84f8bc2abc5d6edaa7bd48a16c3078504ecb713" }, - "neoconf.nvim": { "branch": "main", "commit": "59b5aa97496b074ebee43b97cfd9beb57ea1a312" }, + "melange.nvim": { "branch": "master", "commit": "706a33f0a883fae9ec00ad648586792248a0575e" }, + "neoconf.nvim": { "branch": "main", "commit": "edeae20b6811e361d3a6b2967879612a4a11ece2" }, + "neocord": { "branch": "main", "commit": "aa7a58023166533da83ca7b11c0d2569e45d7381" }, "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "neogen": { "branch": "main", "commit": "dc50715c009f89b8111197fd2f282f6042daa7ea" }, "neogit": { "branch": "master", "commit": "16ee9ae957db2142fb189f5f2556123e24c5b7fb" }, "neorg": { "branch": "main", "commit": "81ee90cb2d72ac43bfadb7dd276646f34c8f85be" }, "neorg-telescope": { "branch": "main", "commit": "ddb2556644cae922699a239bbb0fe16e25b084b7" }, - "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, - "neotest-gtest": { "branch": "main", "commit": "b44c8afc26cea75ffc80617ce07b4e745a56e589" }, - "neotest-python": { "branch": "master", "commit": "72603dfdbaad5695160268cb10531a14cc37236e" }, + "neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, + "neotest-gtest": { "branch": "main", "commit": "16989561a6356878ec4ecd6afed4f0d7a471d1db" }, + "neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" }, "neotest-vim-test": { "branch": "master", "commit": "75c4228882ae4883b11bfce9b8383e637eb44192" }, - "nightfly.nvim": { "branch": "master", "commit": "19efaf31cbe15a429cb3ca6ac9c9fce13275045b" }, - "nightfox.nvim": { "branch": "main", "commit": "d3e8b1acc095baf57af81bb5e89fe7c4359eb619" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim-autopairs": { "branch": "master", "commit": "19606af7c039271d5aa96bceff101e7523af3136" }, + "nightfly.nvim": { "branch": "master", "commit": "f4f932d3129fee10a0e944445fe6be5abf76465c" }, + "nightfox.nvim": { "branch": "main", "commit": "7557f26defd093c4e9bc17f28b08403f706f5a44" }, + "nui-components.nvim": { "branch": "main", "commit": "caecfe2089e5ffbe99c2b0e0468da91990263a90" }, + "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, + "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-cmp-lsp-rs": { "branch": "main", "commit": "d9ebeca9ea07ba2fd57f997b2d6a8bc7da51abed" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "194ec600488f7c7229668d0e80bd197f3a2b84ff" }, - "nvim-dap": { "branch": "master", "commit": "281a2e4cd1e7a17cea7ecb1745d84a8ab1249925" }, - "nvim-dap-python": { "branch": "master", "commit": "7c427e2bbc72d46ea3c9602bede6465ef61b8c19" }, - "nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "484995d573c0f0563f6a66ebdd6c67b649489615" }, + "nvim-cmp-lsp-rs": { "branch": "main", "commit": "d6a5249948b0334be361788fe88a81e476e7a7ee" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "0671e0eabc6842676d3310370e8fae4e1c51d7f9" }, + "nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" }, + "nvim-dap-python": { "branch": "master", "commit": "03fe9592409236b9121c03b66a682dfca15a5cac" }, + "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "52638640ae309cacdaff785fdbb854437bd1ee5c" }, "nvim-dbee": { "branch": "master", "commit": "21d2cc0844a16262bb6ea93ab3d0a0f20bd87853" }, - "nvim-lint": { "branch": "master", "commit": "debabca63c0905b59ce596a55a8e33eafdf66342" }, - "nvim-lspconfig": { "branch": "master", "commit": "b21c166bbf337734f2a39734a905c1c3e298205c" }, + "nvim-lint": { "branch": "master", "commit": "f707b3ae50417067fa63fdfe179b0bff6b380da1" }, + "nvim-lspconfig": { "branch": "master", "commit": "c38af37e4ee71d70b7d60267d96b0a83e5d346f5" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-silicon": { "branch": "main", "commit": "feb882f04c992b797daa118101a239fb3bedfc04" }, + "nvim-silicon": { "branch": "main", "commit": "9fe6001dc8cad4d9c53bcfc8649e3dc76ffa169c" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "0b8b78f9d08dc338a146eb4cd4bcbed8dd36a783" }, - "nvim-treesitter-context": { "branch": "master", "commit": "0f3332788e0bd37716fbd25f39120dcfd557c90f" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "41e3abf6bfd9a9a681eb1f788bdeba91c9004b2b" }, - "nvim-ts-autotag": { "branch": "main", "commit": "0cb76eea80e9c73b88880f0ca78fbd04c5bdcac7" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" }, - "nvim-ufo": { "branch": "main", "commit": "7dcb8fea3e7b3ccdb50f2c3ae7c248cdf6fe1ae1" }, - "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, + "nvim-treesitter": { "branch": "master", "commit": "84bdd59c0365944e8914697e508d1c087977ee33" }, + "nvim-treesitter-context": { "branch": "master", "commit": "78a81c7494e7d1a08dd1200b556933e513fd9f29" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "b91c98afa6c42819aea6cbc1ba38272f5456a5cf" }, + "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" }, + "nvim-ufo": { "branch": "main", "commit": "203c9f434feec57909ab4b1e028abeb3349b7847" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, "ohne-accidents": { "branch": "main", "commit": "832b942a928e74b537a2526eacc6285e26af9589" }, - "oil.nvim": { "branch": "master", "commit": "a632c898fbe0e363ef89b9577f1a7714ab67d682" }, + "oil.nvim": { "branch": "master", "commit": "ccab9d5e09e2d0042fbbe5b6bd05e82426247067" }, "onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" }, - "otter.nvim": { "branch": "main", "commit": "3b4fa74f0a385207fa9c29b61b07178345a3dab2" }, - "pathlib.nvim": { "branch": "main", "commit": "7a5a6facd29e306bc73a37719fa67c0d2226f852" }, + "otter.nvim": { "branch": "main", "commit": "ca9ce67d0399380b659923381b58d174344c9ee7" }, + "pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" }, "peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" }, "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, - "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "9f3d10e66a79e8975926f8cb930856e4930d9da4" }, + "py-requirements.nvim": { "branch": "main", "commit": "ab86e8832635b0e74a4ce2ed5a023ff99e651951" }, + "pymple.nvim": { "branch": "main", "commit": "eff337420a294e68180c5ee87f03994c0b176dd4" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "d227e6c9879bb50af35cd733461198666981d482" }, "rainbow_csv.nvim": { "branch": "main", "commit": "7f3fddfe813641035fac2cdf94c2ff69bb0bf0b9" }, - "rose-pine.nvim": { "branch": "main", "commit": "256d086c218a282ae5de79d2c091b1e592a65367" }, + "rest.nvim": { "branch": "main", "commit": "113dce7749eb22b84cbde052d1cdc1f70702ed58" }, + "rose-pine.nvim": { "branch": "main", "commit": "d396005db5bbd1d4ec7772a7c96c96f4c4802328" }, "runner.nvim": { "branch": "main", "commit": "9ae6f56b73471174c6c4d47581007c6781fb6b6e" }, - "rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" }, + "rustaceanvim": { "branch": "master", "commit": "29f42cc149f915d771c550b6dfe7c788d856cf04" }, "spellwarn.nvim": { "branch": "main", "commit": "2f4dbc58bb90bc63b295461216b91ccf4e7f782d" }, + "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "tagbar": { "branch": "master", "commit": "d55d454bd3d5b027ebf0e8c75b8f88e4eddad8d8" }, - "tailwind-fold.nvim": { "branch": "main", "commit": "28a4190a97af3c5cc4885c228ec61e331d1296ea" }, + "tailwind-fold.nvim": { "branch": "main", "commit": "5544fa59307e4ce5ad3e07ef3ddb231775dc5cda" }, "telescope-bibtex.nvim": { "branch": "master", "commit": "289a6f86ebec06e8ae1590533b732b9981d84900" }, + "telescope-frecency.nvim": { "branch": "master", "commit": "f67baca08423a6fd00167801a54db38e0b878063" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-git-diffs.nvim": { "branch": "main", "commit": "366df26227e6d478d5c55e04771d61875c4f22ac" }, "telescope-heading.nvim": { "branch": "main", "commit": "e85c0f69cb64048f56e76548dcb2f10277576df9" }, - "telescope-import.nvim": { "branch": "main", "commit": "e60ca0fea71432ed578e17d8f1b153da3fa4555d" }, - "telescope-lazy.nvim": { "branch": "main", "commit": "7b87a3bc80443849e29bd871f00d41dfd8d90e41" }, + "telescope-import.nvim": { "branch": "main", "commit": "abce03c71791bd27fc9043b62b5483467875b758" }, + "telescope-lazy.nvim": { "branch": "main", "commit": "32d007e0728ccf77c8b9fd7bbd612a2c9040d13b" }, "telescope-luasnip.nvim": { "branch": "master", "commit": "11668478677de360dea45cf2b090d34f21b8ae07" }, "telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" }, "telescope-software-licenses.nvim": { "branch": "master", "commit": "fb5fc33b6afc994756e2f372423c365bf66f2256" }, "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, - "tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, + "tokyonight.nvim": { "branch": "main", "commit": "2c85fad417170d4572ead7bf9fdd706057bd73d7" }, "tree-sitter-hyprlang": { "branch": "master", "commit": "6858695eba0e63b9e0fceef081d291eb352abce8" }, "treesitter-utils": { "branch": "main", "commit": "df621499e4227f0476f6f4bdb75a9d8dd18d16f2" }, - "trouble.nvim": { "branch": "main", "commit": "40c5317a6e90fe3393f07b0fee580d9e93a216b4" }, + "trouble.nvim": { "branch": "main", "commit": "254145ffd528b98eb20be894338e2d5c93fa02c2" }, "twilight.nvim": { "branch": "main", "commit": "1584c0b0a979b71fd86b18d302ba84e9aba85b1b" }, "typecheck.nvim": { "branch": "main", "commit": "38f3c135572a287f468bae269f956f4ba53dbddf" }, "typescript-tools.nvim": { "branch": "master", "commit": "f8c2e0b36b651c85f52ad5c5373ff8b07adc15a7" }, - "typst-preview.nvim": { "branch": "master", "commit": "15eaaffc0a2d8cd871f485f399d1d67ed3322a0b" }, - "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, + "typst-preview.nvim": { "branch": "master", "commit": "0354cc1a7a5174a2e69cdc21c4db9a3ee18bb20a" }, + "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, "vim-closetag": { "branch": "master", "commit": "d0a562f8bdb107a50595aefe53b1a690460c3822" }, "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-log-highlighting": { "branch": "master", "commit": "1037e26f3120e6a6a2c0c33b14a84336dee2a78f" }, "vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" }, - "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, - "vimtex": { "branch": "master", "commit": "76ef99f73a5ff10be59836a4af4f928eaa8ad284" }, - "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }, + "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, + "vimtex": { "branch": "master", "commit": "f2168870455800451b38eb8ea19d565a8aa2da3d" }, + "which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" }, "yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" }, "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" } } diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index bcf197e..bce9db7 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -18,8 +18,10 @@ return { "saadparwaiz1/cmp_luasnip", "hrsh7th/cmp-calc", "Exafunction/codeium.nvim", + "zbirenbaum/copilot-cmp", "petertriho/cmp-git", "davidsierradz/cmp-conventionalcommits", + "supermaven-inc/supermaven-nvim", "zjp-CN/nvim-cmp-lsp-rs", { "MattiasMTS/cmp-dbee", @@ -64,6 +66,7 @@ return { TypeParameter = "", Copilot = "", Codeium = "", + Supermaven = "", } opts = { mapping = { @@ -86,15 +89,17 @@ return { { name = "crates" }, { name = "async_path" }, { name = "cmp-dbee" }, - { name = "luasnip" }, { name = "buffer", keyword_length = 4 }, + { name = "luasnip" }, { name = "neorg" }, { name = "pypi" }, - { name = "env" }, + { name = "dotenv" }, { name = "calc" }, - { name = "codeium" }, { name = "git" }, { name = "conventionalcommits" }, + { name = "supermaven" }, + -- { name = "copilot" }, + -- { name = "codeium" }, }, snippet = { expand = function(args) @@ -113,12 +118,14 @@ return { nvim_lua = "[lua]", async_path = "[path]", codeium = "[codeium]", + copilot = "[copilot]", luasnip = "[snip]", neorg = "[neorg]", crates = "[crates]", pypi = "[pypi]", - env = "[env]", + dotenv = "[env]", buffer = "[buf]", + supermaven = "[AI]", ["cmp-dbee"] = "[DB]", })[entry.source.name] return vim_item diff --git a/lua/plugins/code-playground.lua b/lua/plugins/code-playground.lua new file mode 100644 index 0000000..afbbe14 --- /dev/null +++ b/lua/plugins/code-playground.lua @@ -0,0 +1,7 @@ +return { + "GustavEikaas/code-playground.nvim", + cmd = { "Code" }, + config = function() + require("code-playground").setup() + end, +} diff --git a/lua/plugins/codeium.lua b/lua/plugins/codeium.lua index 4db5ed4..49e6aee 100644 --- a/lua/plugins/codeium.lua +++ b/lua/plugins/codeium.lua @@ -1,10 +1,10 @@ return { "Exafunction/codeium.nvim", + enabled = false, dependencies = { "nvim-lua/plenary.nvim", "hrsh7th/nvim-cmp", }, - commit = "d3b88eb3aa1de6da33d325c196b8a41da2bcc825", cmd = { "Codeium" }, opts = { enable_chat = true, diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index 37c2ccc..9525a01 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -25,7 +25,7 @@ return { vimwiki = { "cbfmt", "markdownlint", "markdown-toc" }, json = { "jq" }, c = { "clang-format" }, - -- toml = { "taplo" }, + toml = { "taplo" }, cpp = { "clang-format" }, cmake = { "cmake_format" }, htmldjango = { "djlint", "rustywind" }, diff --git a/lua/plugins/crates.lua b/lua/plugins/crates.lua index f63f0dc..fe6f9ca 100644 --- a/lua/plugins/crates.lua +++ b/lua/plugins/crates.lua @@ -1,143 +1,155 @@ return { - "Saecki/crates.nvim", - tag = "stable", - event = { "BufRead Cargo.toml" }, - keys = { - { - "ru", - require("crates").upgrade_all_crates, - desc = "[U]pgrade all crates", - ft = { "rust", "toml" }, + { + + "Saecki/crates.nvim", + tag = "stable", + event = { "BufRead Cargo.toml" }, + keys = { + { + "ru", + require("crates").upgrade_all_crates, + desc = "[U]pgrade all crates", + ft = { "rust", "toml" }, + }, }, - }, - opts = { - smart_insert = true, - insert_closing_quote = true, - autoload = true, - autoupdate = true, - loading_indicator = true, - date_format = "%d-%m-%Y", - thousands_separator = ".", - notification_title = "Crates", - -- disable_invalid_feature_diagnostic = false, - text = { - loading = "  Loading", - version = "  %s", - prerelease = "  %s", - yanked = "  %s", - nomatch = "  No match", - upgrade = "  %s", - error = "  Error fetching crate", - }, - highlight = { - loading = "CratesNvimLoading", - version = "CratesNvimVersion", - prerelease = "CratesNvimPreRelease", - yanked = "CratesNvimYanked", - nomatch = "CratesNvimNoMatch", - upgrade = "CratesNvimUpgrade", - error = "CratesNvimError", - }, - popup = { - autofocus = false, - copy_register = '"', - style = "minimal", - border = "none", - show_version_date = false, - show_dependency_version = true, - max_height = 30, - min_width = 20, - padding = 1, + opts = { + smart_insert = true, + insert_closing_quote = true, + autoload = true, + autoupdate = true, + loading_indicator = true, + date_format = "%d-%m-%Y", + thousands_separator = ".", + notification_title = "Crates", + -- disable_invalid_feature_diagnostic = false, text = { - title = " %s", - pill_left = "", - pill_right = "", - description = "%s", - created_label = " created ", - created = "%s", - updated_label = " updated ", - updated = "%s", - downloads_label = " downloads ", - downloads = "%s", - homepage_label = " homepage ", - homepage = "%s", - repository_label = " repository ", - repository = "%s", - documentation_label = " documentation ", - documentation = "%s", - crates_io_label = " crates.io ", - crates_io = "%s", - categories_label = " categories ", - keywords_label = " keywords ", - version = " %s", - prerelease = " %s", - yanked = " %s", - version_date = " %s", - feature = " %s", - enabled = " %s", - transitive = " %s", - normal_dependencies_title = " Dependencies", - build_dependencies_title = " Build dependencies", - dev_dependencies_title = " Dev dependencies", - dependency = " %s", - optional = " %s", - dependency_version = " %s", - loading = "  ", + loading = "  Loading", + version = "  %s", + prerelease = "  %s", + yanked = "  %s", + nomatch = "  No match", + upgrade = "  %s", + error = "  Error fetching crate", }, highlight = { - title = "CratesNvimPopupTitle", - pill_text = "CratesNvimPopupPillText", - pill_border = "CratesNvimPopupPillBorder", - description = "CratesNvimPopupDescription", - created_label = "CratesNvimPopupLabel", - created = "CratesNvimPopupValue", - updated_label = "CratesNvimPopupLabel", - updated = "CratesNvimPopupValue", - downloads_label = "CratesNvimPopupLabel", - downloads = "CratesNvimPopupValue", - homepage_label = "CratesNvimPopupLabel", - homepage = "CratesNvimPopupUrl", - repository_label = "CratesNvimPopupLabel", - repository = "CratesNvimPopupUrl", - documentation_label = "CratesNvimPopupLabel", - documentation = "CratesNvimPopupUrl", - crates_io_label = "CratesNvimPopupLabel", - crates_io = "CratesNvimPopupUrl", - categories_label = "CratesNvimPopupLabel", - keywords_label = "CratesNvimPopupLabel", - version = "CratesNvimPopupVersion", - prerelease = "CratesNvimPopupPreRelease", - yanked = "CratesNvimPopupYanked", - version_date = "CratesNvimPopupVersionDate", - feature = "CratesNvimPopupFeature", - enabled = "CratesNvimPopupEnabled", - transitive = "CratesNvimPopupTransitive", - normal_dependencies_title = "CratesNvimPopupNormalDependenciesTitle", - build_dependencies_title = "CratesNvimPopupBuildDependenciesTitle", - dev_dependencies_title = "CratesNvimPopupDevDependenciesTitle", - dependency = "CratesNvimPopupDependency", - optional = "CratesNvimPopupOptional", - dependency_version = "CratesNvimPopupDependencyVersion", - loading = "CratesNvimPopupLoading", + loading = "CratesNvimLoading", + version = "CratesNvimVersion", + prerelease = "CratesNvimPreRelease", + yanked = "CratesNvimYanked", + nomatch = "CratesNvimNoMatch", + upgrade = "CratesNvimUpgrade", + error = "CratesNvimError", }, - keys = { - hide = { "q", "" }, - open_url = { "" }, - select = { "" }, - select_alt = { "s" }, - toggle_feature = { "" }, - copy_value = { "yy" }, - goto_item = { "gd", "K", "" }, - jump_forward = { "" }, - jump_back = { "", "" }, + popup = { + autofocus = false, + copy_register = '"', + style = "minimal", + border = "none", + show_version_date = false, + show_dependency_version = true, + max_height = 30, + min_width = 20, + padding = 1, + text = { + title = " %s", + pill_left = "", + pill_right = "", + description = "%s", + created_label = " created ", + created = "%s", + updated_label = " updated ", + updated = "%s", + downloads_label = " downloads ", + downloads = "%s", + homepage_label = " homepage ", + homepage = "%s", + repository_label = " repository ", + repository = "%s", + documentation_label = " documentation ", + documentation = "%s", + crates_io_label = " crates.io ", + crates_io = "%s", + categories_label = " categories ", + keywords_label = " keywords ", + version = " %s", + prerelease = " %s", + yanked = " %s", + version_date = " %s", + feature = " %s", + enabled = " %s", + transitive = " %s", + normal_dependencies_title = " Dependencies", + build_dependencies_title = " Build dependencies", + dev_dependencies_title = " Dev dependencies", + dependency = " %s", + optional = " %s", + dependency_version = " %s", + loading = "  ", + }, + highlight = { + title = "CratesNvimPopupTitle", + pill_text = "CratesNvimPopupPillText", + pill_border = "CratesNvimPopupPillBorder", + description = "CratesNvimPopupDescription", + created_label = "CratesNvimPopupLabel", + created = "CratesNvimPopupValue", + updated_label = "CratesNvimPopupLabel", + updated = "CratesNvimPopupValue", + downloads_label = "CratesNvimPopupLabel", + downloads = "CratesNvimPopupValue", + homepage_label = "CratesNvimPopupLabel", + homepage = "CratesNvimPopupUrl", + repository_label = "CratesNvimPopupLabel", + repository = "CratesNvimPopupUrl", + documentation_label = "CratesNvimPopupLabel", + documentation = "CratesNvimPopupUrl", + crates_io_label = "CratesNvimPopupLabel", + crates_io = "CratesNvimPopupUrl", + categories_label = "CratesNvimPopupLabel", + keywords_label = "CratesNvimPopupLabel", + version = "CratesNvimPopupVersion", + prerelease = "CratesNvimPopupPreRelease", + yanked = "CratesNvimPopupYanked", + version_date = "CratesNvimPopupVersionDate", + feature = "CratesNvimPopupFeature", + enabled = "CratesNvimPopupEnabled", + transitive = "CratesNvimPopupTransitive", + normal_dependencies_title = "CratesNvimPopupNormalDependenciesTitle", + build_dependencies_title = "CratesNvimPopupBuildDependenciesTitle", + dev_dependencies_title = "CratesNvimPopupDevDependenciesTitle", + dependency = "CratesNvimPopupDependency", + optional = "CratesNvimPopupOptional", + dependency_version = "CratesNvimPopupDependencyVersion", + loading = "CratesNvimPopupLoading", + }, + keys = { + hide = { "q", "" }, + open_url = { "" }, + select = { "" }, + select_alt = { "s" }, + toggle_feature = { "" }, + copy_value = { "yy" }, + goto_item = { "gd", "K", "" }, + jump_forward = { "" }, + jump_back = { "", "" }, + }, }, - }, - --[[ src = { + --[[ src = { insert_closing_quote = true, text = { prerelease = "  pre-release ", yanked = "  yanked ", }, }, ]] + }, + }, + { + "Aityz/cratesearch.nvim", + event = { "BufRead Cargo.toml" }, + ft = { "rust" }, + cmd = { "CrateSearch" }, + config = function() + require("cratesearch").setup() + end, }, } diff --git a/lua/plugins/dbee.lua b/lua/plugins/dbee.lua index c973b15..ab80184 100644 --- a/lua/plugins/dbee.lua +++ b/lua/plugins/dbee.lua @@ -3,12 +3,20 @@ return { dependencies = { "MunifTanjim/nui.nvim", }, + keys = { + { + + "od", + function() + require("dbee").toggle() + end, + desc = "Toggle Dbee", + }, + }, cmd = "Dbee", build = function() - -- Install tries to automatically detect the install method. - -- if it fails, try calling it with one of these parameters: - -- "curl", "wget", "bitsadmin", "go" - require("dbee").install("curl") + -- go install github.com/kndndrj/nvim-dbee/dbee@latest + require("dbee").install("go") end, opts = { --- https://github.com/kndndrj/nvim-dbee/blob/master/lua/dbee/config.lua diff --git a/lua/plugins/hot-reload.lua b/lua/plugins/hot-reload.lua new file mode 100644 index 0000000..9e9575a --- /dev/null +++ b/lua/plugins/hot-reload.lua @@ -0,0 +1,6 @@ +return { + "Zeioth/hot-reload.nvim", + dependencies = "nvim-lua/plenary.nvim", + event = "BufEnter", + opts = {}, +} diff --git a/lua/plugins/jq.lua b/lua/plugins/jq.lua new file mode 100644 index 0000000..e6a831a --- /dev/null +++ b/lua/plugins/jq.lua @@ -0,0 +1,45 @@ +return { + "cenk1cenk2/jq.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + "grapp-dev/nui-components.nvim", + }, + opts = { + keymap = { + close = "", + focus_next = "", + focus_prev = "", + focus_left = "", + focus_right = "", + focus_up = "", + focus_down = "", + }, + }, + config = function(_, opts) + require("jq").setup(opts) + vim.api.nvim_create_user_command("JQ", function() + require("jq").run({ + --- you can pass additional options to configure the current instance + -- if you want to toggle from the memory + toggle = true, + -- commands for the instance else it will use the default + -- the default command would be the first one in the table + commands = { + { + -- command to be run + command = "jq", + -- filetype of the output + filetype = "json", + -- hidden arguments that will not be shown in the ui + arguments = "-r", + }, + }, + -- arguments to start with in the ui + arguments = "", + -- query to start with, if not provided it will use the default + query = ".", + }) + end, {}) + end, +} diff --git a/lua/plugins/lsp/typst.lua b/lua/plugins/lsp/typst.lua new file mode 100644 index 0000000..0f10abe --- /dev/null +++ b/lua/plugins/lsp/typst.lua @@ -0,0 +1,13 @@ +local M = {} + +M.setup = function(lsp, capabilities) + lsp.tinymist.setup({ + capabilities = capabilities, + settings = { + exportPdf = "onType", + outputPath = "$root/target/$dir/$name", + }, + }) +end + +return M diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 9bbb029..6b2e9a2 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -9,6 +9,7 @@ return { "folke/trouble.nvim", "folke/neoconf.nvim", "piersolenski/telescope-import.nvim", + "mrcjkb/rustaceanvim", }, config = function() @@ -106,7 +107,7 @@ return { focusable = true, style = "minimal", border = "rounded", - source = "always", + source = true, header = "", prefix = "", }, @@ -169,6 +170,9 @@ return { html = function() require("plugins.lsp.html").setup(lsp, lsp_capabilities) end, + tinymist = function() + require("plugins.lsp.typst").setup(lsp, lsp_capabilities) + end, }, }) end, diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index e3dd553..b78ea21 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -2,6 +2,7 @@ return { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons", + "pnx/lualine-lsp-status", "arkav/lualine-lsp-progress", { "letieu/harpoon-lualine", dependencies = { "ThePrimeagen/harpoon", @@ -47,7 +48,7 @@ return { sections = { lualine_a = { "mode" }, lualine_b = { "branch" }, - lualine_c = { "filename", "diff", "harpoon2", "lsp_progress" }, + lualine_c = { "filename", "diff", "harpoon2", "lsp-status", "lsp_progress" }, lualine_x = { "diagnostics", "encoding", "filetype", "filesize" }, lualine_y = { "progress" }, lualine_z = { "location" }, diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua index a044024..73e30ce 100644 --- a/lua/plugins/luasnip.lua +++ b/lua/plugins/luasnip.lua @@ -2,12 +2,13 @@ return { { "L3MON4D3/LuaSnip", build = "make install_jsregexp", - version = "v2.*", + version = "*", dependencies = { "rafamadriz/friendly-snippets", -- a bunch of snippets to use "saadparwaiz1/cmp_luasnip", }, - config = function() + opts = {}, + config = function(_, opts) local ls = require("luasnip") local s = ls.snippet @@ -60,7 +61,7 @@ return { end end, { silent = true }) - ls.config.set_config({ + opts = { -- This tells LuaSnip to remember to keep around the last snippet. -- You can jump back into it even if you move outside of the selection history = true, @@ -76,8 +77,14 @@ return { }, }, }, - }) - require("luasnip.loaders.from_vscode").lazy_load() + } + + ls.config.setup(opts) + + -- require("luasnip.loaders.from_vscode").load({ exclude = { "python" } }) + vim.tbl_map(function(type) + require("luasnip.loaders.from_" .. type).lazy_load() + end, { "vscode", "snipmate", "lua" }) end, }, } diff --git a/lua/plugins/presence.lua b/lua/plugins/neocord.lua similarity index 65% rename from lua/plugins/presence.lua rename to lua/plugins/neocord.lua index 83b1349..e0dffeb 100644 --- a/lua/plugins/presence.lua +++ b/lua/plugins/neocord.lua @@ -1,18 +1,18 @@ return { - "andweeb/presence.nvim", + "IogaMaster/neocord", + event = "VeryLazy", opts = { -- General options - auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`) - neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image - main_image = "neovim", -- Main image display (either "neovim" or "file") - -- client_id = "", -- Use your own Discord application client id (not recommended) + logo = "auto", -- "auto" or url + logo_tooltip = nil, -- nil or string + main_image = "language", -- "language" or "logo" log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error") debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(, true)`) - enable_line_number = false, -- Displays the current line number instead of the current project - blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches - buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "