From 881cbb357572a6cc2b1cd3b87ee798639ba014bd Mon Sep 17 00:00:00 2001 From: jc <46619361+juancwu@users.noreply.github.com> Date: Mon, 30 Dec 2024 06:51:08 -0500 Subject: [PATCH] (nvim) update --- nvim/lazy-lock.json | 52 ++++--- nvim/lua/juancwu/plugins/lsp/init.lua | 4 +- nvim/lua/juancwu/plugins/treesitter.lua | 189 ++++++++++++------------ nvim/lua/juancwu/utils/colors.lua | 2 +- 4 files changed, 123 insertions(+), 124 deletions(-) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index c6ee28e..9b1d2e7 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -15,33 +15,31 @@ "lsp-zero.nvim": { "branch": "v2.x", "commit": "ffebf6f7b0649f1eb81b37c37b75552f8ff96337" }, "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" }, - "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, - "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, - "neodev.nvim": { "branch": "main", "commit": "be6bf4f5d2d3b173c9291f074130a3d29e1af78a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, - "nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" }, - "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, - "nvim-dap": { "branch": "master", "commit": "d7749eb3d9933a75d2244820308ce442f646c7ae" }, - "nvim-lspconfig": { "branch": "master", "commit": "eb81c7ea08d6f01d5fa4cf09e58c708efadf9b2f" }, - "nvim-treesitter": { "branch": "master", "commit": "25ddfde8d7167d7d81403d6809242439037d2b68" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" }, - "nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" }, - "nvim-web-devicons": { "branch": "master", "commit": "a1425903ab52a0a0460622519e827f224e5b4fee" }, - "obsidian.nvim": { "branch": "main", "commit": "b5945fb94db35220b85c7e3ea7bc58a0b11c2ebc" }, - "onedark.nvim": { "branch": "master", "commit": "c5476a091b0f1b4e853db91c91ff941f848a1cdd" }, - "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, - "rose-pine": { "branch": "main", "commit": "92762f4fa2144c05db760ea254f4c399a56a7ef5" }, - "solarized-osaka.nvim": { "branch": "main", "commit": "83b7026ac7a4e185d4ecbe99926fd94b5735e2ea" }, - "telescope-dap.nvim": { "branch": "master", "commit": "4e2d5efb92062f0b865fe59b200b5ed7793833bf" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "98101b22402cd6d1c7e9a7e0c4718bfc98cb1625" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, - "telescope.nvim": { "branch": "master", "commit": "6213322ab56eb27356fdc09a5078e41e3ea7f3bc" }, - "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" }, - "tokyonight.nvim": { "branch": "main", "commit": "f247ee700b569ed43f39320413a13ba9b0aef0db" }, - "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, + "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, + "nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, + "nvim-lspconfig": { "branch": "master", "commit": "1aa9f36b6d542dafc0b4a38c48969d036003b00a" }, + "nvim-treesitter": { "branch": "master", "commit": "69170c93149ddb71a22bd954514806395c430c02" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, + "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" }, + "nvim-web-devicons": { "branch": "master", "commit": "203da76ecfbb4b192cf830665b03eb651b635c94" }, + "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, + "onedark.nvim": { "branch": "master", "commit": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "rose-pine": { "branch": "main", "commit": "07a887a7bef4aacea8c7caebaf8cbf808cdc7a8e" }, + "solarized-osaka.nvim": { "branch": "main", "commit": "b023c3f3b9f1ce5b67c22e4401563d03554921cf" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, + "tokyonight.nvim": { "branch": "main", "commit": "3d02469b98396dc03e87a4f4b64e109801ef6890" }, + "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, "vim-closetag": { "branch": "master", "commit": "d0a562f8bdb107a50595aefe53b1a690460c3822" }, - "vim-floaterm": { "branch": "master", "commit": "3f01a623376957437f9376327637491b74719e38" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } + "vim-floaterm": { "branch": "master", "commit": "4e28c8dd0271e10a5f55142fb6fe9b1599ee6160" }, + "which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" } } diff --git a/nvim/lua/juancwu/plugins/lsp/init.lua b/nvim/lua/juancwu/plugins/lsp/init.lua index 9dad1b3..9224258 100644 --- a/nvim/lua/juancwu/plugins/lsp/init.lua +++ b/nvim/lua/juancwu/plugins/lsp/init.lua @@ -111,7 +111,7 @@ return { local status, lspconfig = pcall(require, "lspconfig") if status then - lspconfig.tsserver.setup({}) + lspconfig.ts_ls.setup({}) lspconfig.tailwindcss.setup({ filetypes = { "templ", @@ -130,7 +130,7 @@ return { lspconfig.zls.setup({}) lspconfig.rust_analyzer.setup({}) lspconfig.gopls.setup({}) - lspconfig.html.setup({}) + -- lspconfig.html.setup({}) vim.filetype.add({ extension = { templ = "templ", diff --git a/nvim/lua/juancwu/plugins/treesitter.lua b/nvim/lua/juancwu/plugins/treesitter.lua index 0b98904..d2925ae 100644 --- a/nvim/lua/juancwu/plugins/treesitter.lua +++ b/nvim/lua/juancwu/plugins/treesitter.lua @@ -1,97 +1,98 @@ return { - 'nvim-treesitter/nvim-treesitter', - build = ":TSUpdate", - event = { - "BufReadPost", - "BufNewFile" - }, - dependencies = { - "nvim-treesitter/nvim-treesitter-textobjects", - }, - config = function() - local treesitter = require("nvim-treesitter.configs") + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + event = { + "BufReadPost", + "BufNewFile", + }, + branch = "master", + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + }, + config = function() + local treesitter = require("nvim-treesitter.configs") - treesitter.setup { - -- A list of parser names, or "all" - ensure_installed = { - "vimdoc", - "javascript", - "typescript", - "c", - "lua", - "rust", - "go", - "gosum", - "gomod", - }, - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - -- Automatically install missing parsers when entering buffer - auto_install = true, - indent = { - enable = true, - }, - highlight = { - enable = true, - additional_vim_regex_highlighting = true, - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = 'c', - node_incremental = "", - scope_incremental = "", - node_decremental = "" - } - }, - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', - }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', - }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', - }, - }, - swap = { - enable = true, - swap_next = { - [']'] = '@parameter.inner', - }, - swap_previous = { - ['['] = '@parameter.inner', - }, - }, - }, - autotag = { - enable = true, - enable_close_on_slash = false, - } - } - end + treesitter.setup({ + -- A list of parser names, or "all" + ensure_installed = { + "vimdoc", + "javascript", + "typescript", + "c", + "lua", + "rust", + "go", + "gosum", + "gomod", + }, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + -- Automatically install missing parsers when entering buffer + auto_install = true, + indent = { + enable = true, + }, + highlight = { + enable = true, + additional_vim_regex_highlighting = true, + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "c", + node_incremental = "", + scope_incremental = "", + node_decremental = "", + }, + }, + textobjects = { + select = { + enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["aa"] = "@parameter.outer", + ["ia"] = "@parameter.inner", + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = "@class.outer", + }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", + }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = "@class.outer", + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", + }, + }, + swap = { + enable = true, + swap_next = { + ["]"] = "@parameter.inner", + }, + swap_previous = { + ["["] = "@parameter.inner", + }, + }, + }, + autotag = { + enable = false, + enable_close_on_slash = false, + }, + }) + end, } diff --git a/nvim/lua/juancwu/utils/colors.lua b/nvim/lua/juancwu/utils/colors.lua index f966d7d..553ba36 100644 --- a/nvim/lua/juancwu/utils/colors.lua +++ b/nvim/lua/juancwu/utils/colors.lua @@ -7,7 +7,7 @@ local dark = "catppuccin-mocha" function M.is_daytime() -- check if command exists or not local cmd_name = "asadesuka" - local cmd_flags = "-offset 0" + local cmd_flags = "-offset 30" local has_asadesuka = require("juancwu.utils.os").cmd_exists(cmd_name) if has_asadesuka then local handle = io.popen(cmd_name .. " " .. cmd_flags)