diff --git a/lazy-lock.json b/lazy-lock.json index e9bcf076..4c639640 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,35 +1,44 @@ { "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" }, - "cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" }, - "cloak.nvim": { "branch": "main", "commit": "951b163e55ce7639eb320c450bde9283c4fe968b" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot.vim": { "branch": "release", "commit": "22fd9542e3c47552abab5e685fefd760e4f405b2" }, - "editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" }, - "fidget.nvim": { "branch": "main", "commit": "1d1042d418ee8cb70d68f1e38db639844331c093" }, - "friendly-snippets": { "branch": "main", "commit": "b8fae73a479ae0a1c54f5c98fa687ae8a0addc53" }, - "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "2b3d247fce06f53934174f5dfe0362c42d65c00c" }, - "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, - "neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" }, - "neotest": { "branch": "master", "commit": "73043d666780e35185a77589e01bec96a52db910" }, - "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" }, - "neotest-vitest": { "branch": "main", "commit": "87e91bfd9419a8c74bf0d105e2ae31b9692daf0b" }, - "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, - "nvim-lspconfig": { "branch": "master", "commit": "1759ea68fbbb1303192020d3e59936189359e0ed" }, - "nvim-treesitter": { "branch": "master", "commit": "364b86ec8ea88e4a77ba676b93fb10829d6a9cb3" }, - "plenary": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, - "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, - "rose-pine": { "branch": "main", "commit": "9d7474f80afe2f0cfcb4fabfc5451f509d844b85" }, + "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "brightburn.vim": { "branch": "master", "commit": "fc0d2fafc51e86d6065acd54b5e82e686019ff2f" }, + "cellular-automaton.nvim": { "branch": "main", "commit": "1606e9d5d04ff254023c3f3c62842d065708d6d3" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" }, + "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gruvbox": { "branch": "main", "commit": "00e38a379bab3389e187b3953566d67d494dfddd" }, + "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, + "hererocks": { "branch": "master", "commit": "344c46ed54df9a4dbc2d2bf510dcd9a9d90497bf" }, + "kanagawa.nvim": { "branch": "master", "commit": "debe91547d7fb1eef34ce26a5106f277fbfdd109" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3856bbb0da214d1f2f3d5a2dd3fea26591f930f9" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, + "mason.nvim": { "branch": "main", "commit": "9eaedb864cdadc29c6eb7d761a6c0d8aee26c91b" }, + "neotest": { "branch": "master", "commit": "862afb2a2219d9ca565f67416fb7003cc0f22c4f" }, + "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" }, + "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, + "nvim-lspconfig": { "branch": "master", "commit": "f610208989e9c03561f9f601db3133f6ae398fcd" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, + "nvim-treesitter-context": { "branch": "master", "commit": "4976d8b90401cba9b85f6861e4e5a6edef2f2086" }, + "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, + "octo.nvim": { "branch": "master", "commit": "e122af3c5cc34054f9f9f6c1bdc004c6109193ff" }, + "peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" }, + "plenary": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "rose-pine": { "branch": "main", "commit": "6b9840790cc7acdfadde07f308d34b62dd9cc675" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, - "tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" }, - "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, - "undotree": { "branch": "master", "commit": "a1758ba9990b7189f601a3a5acdfc8ca3907a700" }, - "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, - "vim-fugitive": { "branch": "master", "commit": "f116dcc8e21021e6fbfb6b0a9f8f7b9566d933f4" }, - "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" } -} \ No newline at end of file + "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" }, + "vim-be-good": { "branch": "master", "commit": "0ae3de14eb8efc6effe7704b5e46495e91931cc5" }, + "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, + "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" } +} diff --git a/lua/theprimeagen/init.lua b/lua/theprimeagen/init.lua index 02b01bca..15d69ecf 100644 --- a/lua/theprimeagen/init.lua +++ b/lua/theprimeagen/init.lua @@ -46,16 +46,16 @@ autocmd({"BufWritePre"}, { command = [[%s/\s\+$//e]], }) -autocmd('BufEnter', { - group = ThePrimeagenGroup, - callback = function() - if vim.bo.filetype == "zig" then - vim.cmd.colorscheme("tokyonight-night") - else - vim.cmd.colorscheme("rose-pine-moon") - end - end -}) +-- autocmd('BufEnter', { +-- group = ThePrimeagenGroup, +-- callback = function() +-- if vim.bo.filetype == "zig" then +-- vim.cmd.colorscheme("tokyonight-night") +-- else +-- vim.cmd.colorscheme("rose-pine-moon") +-- end +-- end +-- }) autocmd('LspAttach', { diff --git a/lua/theprimeagen/lazy/cloak.lua b/lua/theprimeagen/lazy/cloak.lua deleted file mode 100644 index 2dd083fe..00000000 --- a/lua/theprimeagen/lazy/cloak.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - "laytan/cloak.nvim", - config = function() - require("cloak").setup({ - enabled = true, - cloak_character = "*", - -- The applied highlight group (colors) on the cloaking, see `:h highlight`. - highlight_group = "Comment", - patterns = { - { - -- Match any file starting with ".env". - -- This can be a table to match multiple file patterns. - file_pattern = { - ".env*", - "wrangler.toml", - ".dev.vars", - }, - -- Match an equals sign and any character after it. - -- This can also be a table of patterns to cloak, - -- example: cloak_pattern = { ":.+", "-.+" } for yaml files. - cloak_pattern = "=.+" - }, - }, - }) - end -} diff --git a/lua/theprimeagen/lazy/colors.lua b/lua/theprimeagen/lazy/colors.lua index c345f9df..445dfa6f 100644 --- a/lua/theprimeagen/lazy/colors.lua +++ b/lua/theprimeagen/lazy/colors.lua @@ -1,5 +1,5 @@ function ColorMyPencils(color) - color = color or "rose-pine-moon" + color = color or "kanagawa-dragon" vim.cmd.colorscheme(color) vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) @@ -12,6 +12,10 @@ return { "erikbackman/brightburn.vim", }, + { + "rebelot/kanagawa.nvim", + }, + { "folke/tokyonight.nvim", lazy = false, diff --git a/lua/theprimeagen/lazy/copilot.lua b/lua/theprimeagen/lazy/copilot.lua deleted file mode 100644 index 02640a85..00000000 --- a/lua/theprimeagen/lazy/copilot.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - config = function() - require("copilot").setup({ - suggestion = { - enabled = true, - auto_trigger = false, - hide_during_completion = false, - debounce = 25, - keymap = { - accept = false, - accept_word = false, - accept_line = "", - next = false, - prev = false, - dismiss = false, - }, - }, - }) - end, - }, -} diff --git a/lua/theprimeagen/lazy/harpoon.lua b/lua/theprimeagen/lazy/harpoon.lua new file mode 100644 index 00000000..3cfe846f --- /dev/null +++ b/lua/theprimeagen/lazy/harpoon.lua @@ -0,0 +1,16 @@ +return { + "ThePrimeagen/harpoon", + lazy = false, + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = true, + keys = { + { "a", "lua require('harpoon.mark').add_file()"}, + { "", "lua require('harpoon.ui').toggle_quick_menu()"}, + { "1", "lua require('harpoon.ui').nav_file(1)"}, + { "2", "lua require('harpoon.ui').nav_file(2)"}, + { "3", "lua require('harpoon.ui').nav_file(3)"}, + { "4", "lua require('harpoon.ui').nav_file(4)"}, + }, +} diff --git a/lua/theprimeagen/lazy/jai.lua b/lua/theprimeagen/lazy/jai.lua deleted file mode 100644 index 58cab1f3..00000000 --- a/lua/theprimeagen/lazy/jai.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "rluba/jai.vim", -} - diff --git a/lua/theprimeagen/lazy/local.lua b/lua/theprimeagen/lazy/local.lua deleted file mode 100644 index ff8d5707..00000000 --- a/lua/theprimeagen/lazy/local.lua +++ /dev/null @@ -1,68 +0,0 @@ - -local local_plugins = { - { - "cockpit", - dir = "~/personal/cockpit", - config = function() - require("cockpit") - vim.keymap.set("n", "ct", "CockpitTest") - vim.keymap.set("n", "cr", "CockpitRefresh") - end, - }, - - { - "streamer", - dir = "~/personal/eleven-streamer", - dependencies = { - "livinglogic-nl/ws.nvim" - }, - config = function() end - }, - - - { - "caleb", - dir = "~/personal/caleb", - config = function() end - }, - { - "harpoon", - dir = "~/personal/harpoon", - config = function() - local harpoon = require("harpoon") - - harpoon:setup() - - vim.keymap.set("n", "A", function() harpoon:list():prepend() end) - vim.keymap.set("n", "a", function() harpoon:list():add() end) - vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) - - vim.keymap.set("n", "", function() harpoon:list():select(1) end) - vim.keymap.set("n", "", function() harpoon:list():select(2) end) - vim.keymap.set("n", "", function() harpoon:list():select(3) end) - vim.keymap.set("n", "", function() harpoon:list():select(4) end) - vim.keymap.set("n", "", function() harpoon:list():replace_at(1) end) - vim.keymap.set("n", "", function() harpoon:list():replace_at(2) end) - vim.keymap.set("n", "", function() harpoon:list():replace_at(3) end) - vim.keymap.set("n", "", function() harpoon:list():replace_at(4) end) - end - }, - { - "vim-apm", dir = "~/personal/vim-apm", - config = function() - --[[ - local apm = require("vim-apm") - - apm:setup({}) - vim.keymap.set("n", "apm", function() apm:toggle_monitor() end) - --]] - end - }, - { - "vim-with-me", dir = "~/personal/vim-with-me", - config = function() end - }, -} - -return local_plugins - diff --git a/lua/theprimeagen/lazy/lsp.lua b/lua/theprimeagen/lazy/lsp.lua index 264ff22e..77985f86 100644 --- a/lua/theprimeagen/lazy/lsp.lua +++ b/lua/theprimeagen/lazy/lsp.lua @@ -33,7 +33,6 @@ return { ensure_installed = { "lua_ls", "rust_analyzer", - "gopls", }, handlers = { function(server_name) -- default handler (optional) @@ -99,7 +98,14 @@ return { }) vim.diagnostic.config({ - -- update_in_insert = true, + virtual_text = { + prefix = "", -- 如果不想要前綴符號 + source = "always", -- 顯示錯誤來源 + spacing = 2, -- 訊息與程式碼間的距離 + }, + signs = false, -- 關閉符號 + underline = true, -- 啟用底線 + update_in_insert = false, -- 避免在插入模式更新 float = { focusable = false, style = "minimal", diff --git a/lua/theprimeagen/lazy/neotest.lua b/lua/theprimeagen/lazy/neotest.lua index 20bb1c3c..67d92d49 100644 --- a/lua/theprimeagen/lazy/neotest.lua +++ b/lua/theprimeagen/lazy/neotest.lua @@ -5,14 +5,17 @@ return { "nvim-lua/plenary.nvim", "antoinemadec/FixCursorHold.nvim", "nvim-treesitter/nvim-treesitter", - "fredrikaverpil/neotest-golang", - "leoluz/nvim-dap-go", + "nvim-neotest/neotest-jest", }, config = function() require("neotest").setup({ adapters = { - require("neotest-golang")({ - dap = { justMyCode = false }, + require('neotest-jest')({ + jestCommand = "pnpm test", + jestConfigFile = 'package.json', + cwd = function() + return vim.fn.getcwd() + end, }), }, }) @@ -50,6 +53,5 @@ return { vim.keymap.set("n", "ta", function() require("neotest").run.run(vim.fn.getcwd()) end, { desc = "Debug: Open test output" }) - end } diff --git a/lua/theprimeagen/lazy/octo.lua b/lua/theprimeagen/lazy/octo.lua new file mode 100644 index 00000000..01d99890 --- /dev/null +++ b/lua/theprimeagen/lazy/octo.lua @@ -0,0 +1,11 @@ +return { + 'pwntester/octo.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope.nvim', + 'nvim-tree/nvim-web-devicons', + }, + config = function () + require("octo").setup() + end +} diff --git a/lua/theprimeagen/lazy/telescope.lua b/lua/theprimeagen/lazy/telescope.lua index 185e3533..21cd4f7d 100644 --- a/lua/theprimeagen/lazy/telescope.lua +++ b/lua/theprimeagen/lazy/telescope.lua @@ -25,6 +25,7 @@ return { builtin.grep_string({ search = vim.fn.input("Grep > ") }) end) vim.keymap.set('n', 'vh', builtin.help_tags, {}) + vim.keymap.set("n", "pr", builtin.resume, {}) end } diff --git a/lua/theprimeagen/lazy/tj.lua b/lua/theprimeagen/lazy/tj.lua deleted file mode 100644 index 6ce56ef2..00000000 --- a/lua/theprimeagen/lazy/tj.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "tjdevries/php.nvim", - dependencies = { - "nvim-treesitter/nvim-treesitter" - }, - config = function() - require("php").setup({}) - end -} diff --git a/lua/theprimeagen/remap.lua b/lua/theprimeagen/remap.lua index ab27d958..f50356d6 100644 --- a/lua/theprimeagen/remap.lua +++ b/lua/theprimeagen/remap.lua @@ -1,7 +1,10 @@ +vim.opt.laststatus = 3 +vim.opt.clipboard = "unnamedplus" vim.g.mapleader = " " vim.keymap.set("n", "pv", vim.cmd.Ex) +vim.keymap.set('n', 'us', ':bmodified', { noremap = true, silent = true }) vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") @@ -24,8 +27,36 @@ end) vim.keymap.set("x", "p", [["_dP]]) -- next greatest remap ever : asbjornHaland -vim.keymap.set({"n", "v"}, "y", [["+y]]) -vim.keymap.set("n", "Y", [["+Y]]) +function isMacos() + local handle = io.popen("uname") + if (handle == nil) + then + return + end + local result = handle:read("*a") + handle:close() + return result:match("Darwin") ~= nil +end + +function sendClipboardToMac() + if (isMacos() == true) + then + return + end + local clipboard_text = vim.fn.getreg("+") + local command = string.format("echo %s | ssh mac pbcopy", vim.fn.shellescape(clipboard_text)) + os.execute(command) +end + +function insertFullPath() + local filepath = vim.fn.expand('%') + vim.fn.setreg('+', filepath) -- write to clippoard +end + +vim.keymap.set("n", "fp", " lua insertFullPath() sendClipboardToMac()", { silent = true }) + +vim.keymap.set({"n", "v"}, "y", "\"+y lua sendClipboardToMac()") +vim.keymap.set("n", "Y", "\"+Y lua sendClipboardToMac()") vim.keymap.set({"n", "v"}, "d", "\"_d") @@ -72,6 +103,6 @@ vim.keymap.set("n", "ca", function() require("cellular-automaton").start_animation("make_it_rain") end) -vim.keymap.set("n", "", function() - vim.cmd("so") -end) +-- vim.keymap.set("n", "", function() +-- vim.cmd("so") +-- end)