diff --git a/lazy-lock.json b/lazy-lock.json index aece157..8dec556 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -13,7 +13,6 @@ "crates.nvim": { "branch": "main", "commit": "d1be10c1fcf4adb1eed2f2f510176db035efc68d" }, "cspell.nvim": { "branch": "main", "commit": "508b64a23bd8f9473c59d083a92712486f6f138d" }, "editorconfig-vim": { "branch": "master", "commit": "8b7da79e9daee7a3f3a8d4fe29886b9756305aff" }, - "fastaction.nvim": { "branch": "master", "commit": "89c64a4906df97e766208640f6e80a96d5e4abb4" }, "fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" }, "formatter.nvim": { "branch": "master", "commit": "ad246d34ce7a32f752071ed81b09b94e6b127fad" }, "gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" }, @@ -57,6 +56,7 @@ "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "statuscol.nvim": { "branch": "main", "commit": "93d8bcda516fc86e11c03f9ef577bae9a72fba0e" }, "supermaven-nvim": { "branch": "main", "commit": "d71257f431e190d9236d7f30da4c2d659389e91f" }, + "tailwind-tools.nvim": { "branch": "master", "commit": "48523580c6af449a7a57610ce5596c716cf4363a" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "10b8a82b042caf50b78e619d92caf0910211973d" }, "template-string.nvim": { "branch": "main", "commit": "419bfb2e4d5f0e6ddd0d4435f85b69da0d88d524" }, diff --git a/lua/keys.lua b/lua/keys.lua index 020f7ea..b17f26f 100644 --- a/lua/keys.lua +++ b/lua/keys.lua @@ -43,43 +43,16 @@ vim.api.nvim_set_keymap("", "", "", {silent = true}) vim.api.nvim_set_keymap("", "", "", {silent = true}) vim.api.nvim_set_keymap("", "", "", {silent = true}) vim.api.nvim_set_keymap("", "", "", {silent = true}) -vim.api.nvim_set_keymap("", "", "", {silent = true}) +vim.api.nvim_set_keymap("", "", "", {silent = true, noremap = true}) -function _G.toggle_venn() - local venn_enabled = vim.inspect(vim.b.venn_enabled) - if (venn_enabled == "nil") then - vim.b.venn_enabled = true - vim.cmd [[setlocal ve=all]] - -- draw a line on HJKL keystokes - vim.api.nvim_buf_set_keymap(0, "n", "J", "j:VBox", {noremap = true}) - vim.api.nvim_buf_set_keymap(0, "n", "K", "k:VBox", {noremap = true}) - vim.api.nvim_buf_set_keymap(0, "n", "L", "l:VBox", {noremap = true}) - vim.api.nvim_buf_set_keymap(0, "n", "H", "h:VBox", {noremap = true}) - -- draw a box by pressing "b" with visual selection - vim.api.nvim_buf_set_keymap(0, "v", "b", ":VBox", {noremap = true}) - else - vim.cmd [[setlocal ve=]] - vim.cmd [[mapclear ]] - vim.b.venn_enabled = nil - end +local insert_random_uuid = function() + local id, _ = vim.fn.system("uuidgen"):gsub("\n", ""):gsub("-", ""):upper() + vim.api.nvim_put({id}, "c", true, true) end --- toggle keymappings for venn using v -vim.api.nvim_set_keymap("n", "v", ":lua toggle_venn()", {noremap = true}) -vim.api.nvim_set_keymap( - "v", - "mc", - "lua require('nvim-magic.flows').append_completion(require('nvim-magic').backends.default)", - {} -) -vim.api.nvim_set_keymap( - "v", - "ma", - "lua require('nvim-magic.flows').suggest_alteration(require('nvim-magic').backends.default)", - {} -) -vim.api.nvim_set_keymap( - "v", - "md", - "lua require('nvim-magic.flows').suggest_docstring(require('nvim-magic').backends.default)", - {} -) +local insert_random_uuid_dashed = function() + local id, _ = vim.fn.system("uuidgen"):gsub("\n", ""):upper() + vim.api.nvim_put({id}, "c", true, true) +end + +vim.keymap.set("n", "u", insert_random_uuid, {noremap = true, silent = true}) +vim.keymap.set("n", "U", insert_random_uuid_dashed, {noremap = true, silent = true}) diff --git a/lua/plugins.lua b/lua/plugins.lua index 88acf94..5b84d98 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -13,10 +13,6 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) -local quick_prompts = { - ["Code actions"] = true -} - require("lazy").setup( { "wbthomason/packer.nvim", @@ -87,6 +83,28 @@ require("lazy").setup( "jay-babu/mason-null-ls.nvim" } }, + { + "luckasRanarison/tailwind-tools.nvim", + dependencies = {"nvim-treesitter/nvim-treesitter"}, + opts = { + document_color = { + enabled = true, -- can be toggled by commands + kind = "inline", -- "inline" | "foreground" | "background" + inline_symbol = "󰝤 ", -- only used in inline mode + debounce = 200 -- in milliseconds, only applied in insert mode + }, + conceal = { + enabled = false, -- can be toggled by commands + min_length = nil, -- only conceal classes exceeding the provided length + symbol = "󱏿", -- only a single character is allowed + highlight = { + -- extmark highlight options, see :h 'highlight' + fg = "#38BDF8" + } + }, + custom_filetypes = {} -- see the extension section to learn how it works + } -- your configuration + }, { "nvim-telescope/telescope.nvim", config = function() diff --git a/lua/plugins/formatter.lua b/lua/plugins/formatter.lua index d00b550..ec12171 100644 --- a/lua/plugins/formatter.lua +++ b/lua/plugins/formatter.lua @@ -95,3 +95,12 @@ vim.api.nvim_create_autocmd( group = formatGrp } ) + +-- local function organize_imports() +-- local params = { +-- command = "typescript.organizeImports", +-- arguments = {vim.api.nvim_buf_get_name(0)}, +-- title = "" +-- } +-- vim.lsp.buf.execute_command(params) +-- end diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 938b2de..e4502e6 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -33,7 +33,8 @@ local extra_servers = { "eslint", "jsonls", "omnisharp", - "rust_analyzer" + "rust_analyzer", + "tailwindcss" } -- Ensure that required tools are installed @@ -172,6 +173,54 @@ for _, lsp in ipairs(common_servers) do } end +local path = vim.uv.cwd() +local config_path = path .. "/.vscode/settings.json" +local tailwindcss_settings = {} +function patch_tailwindcss_settings() + if vim.uv.fs_stat(config_path) then + local file = vim.fn.readfile(config_path) + local vscode_settings = vim.fn.json_decode(file) + tailwindcss_settings = + vim.tbl_deep_extend( + "force", + tailwindcss_settings, + { + tailwindCSS = { + rootFontSize = vscode_settings["tailwindCSS.rootFontSize"] + } + } + ) + end +end +pcall(patch_tailwindcss_settings) +nvim_lsp.tailwindcss.setup { + on_attach = on_attach, + flags = { + debounce_text_changes = 150 + }, + capabilities = capabilities, + -- on_init = function(client) + -- local path = client.workspace_folders and client.workspace_folders[1] and client.workspace_folders[1].name + -- local config_path = path .. "/.vscode/settings.json" + -- if vim.uv.fs_stat(config_path) then + -- local file = vim.fn.readfile(config_path) + -- local vscode_settings = vim.fn.json_decode(file) + -- client.config.settings = + -- vim.tbl_deep_extend( + -- "force", + -- client.config.settings, + -- { + -- tailwindCSS = { + -- rootFontSize = vscode_settings["tailwindCSS.rootFontSize"] + -- } + -- } + -- ) + -- client.notify(vim.lsp.protocol.Methods.workspace_didChangeConfiguration, {settings = client.config.settings}) + -- end + -- end, + settings = tailwindcss_settings +} + nvim_lsp.omnisharp.setup { cmd = {"OmniSharp"}, enable_editorconfig_support = true, diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua index 0472386..ed1825b 100644 --- a/lua/plugins/neotest.lua +++ b/lua/plugins/neotest.lua @@ -3,7 +3,10 @@ require("neotest").setup( adapters = { require("neotest-jest")( { - jestCommand = "npx jest" + jestCommand = "npx jest --bail --ci", + env = { + NODE_OPTIONS = "--no-deprecation" + } } ), require("neotest-zig")