From bad3683c8980ce28d1bee6d9d96bc41b899f9dbd Mon Sep 17 00:00:00 2001 From: Arnold Lei Date: Sun, 5 Oct 2025 20:24:11 -0600 Subject: [PATCH] attempting to update --- init.lua | 66 ++++++++++++++++++++++++++--------------- lazy-lock.json | 57 ++++++++++++++++++----------------- lua/arnoldlei/remap.lua | 20 +++++++++++-- lua/plugins/curl.lua | 31 +++++++++++++++++++ lua/plugins/harpoon.lua | 9 +++--- lua/plugins/oil.lua | 11 +++++++ 6 files changed, 136 insertions(+), 58 deletions(-) create mode 100644 lua/plugins/curl.lua create mode 100644 lua/plugins/oil.lua diff --git a/init.lua b/init.lua index 2b1bfc6f..635afd10 100644 --- a/init.lua +++ b/init.lua @@ -28,7 +28,7 @@ vim.opt.rtp:prepend(lazypath) -- as they will be available in your neovim runtime. require('lazy').setup({ -- NOTE: First, some plugins that don't require any configuration - {import = "plugins"}, + { import = "plugins" }, -- Git related plugins "tpope/vim-fugitive", 'tpope/vim-rhubarb', @@ -48,7 +48,7 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, + { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', @@ -90,33 +90,33 @@ require('lazy').setup({ -- don't override the built-in and fugitive keymaps local gs = package.loaded.gitsigns - vim.keymap.set({'n', 'v'}, ']c', function() + vim.keymap.set({ 'n', 'v' }, ']c', function() if vim.wo.diff then return ']c' end vim.schedule(function() gs.next_hunk() end) return '' - end, {expr=true, buffer = bufnr, desc = "Jump to next hunk"}) - vim.keymap.set({'n', 'v'}, '[c', function() + end, { expr = true, buffer = bufnr, desc = "Jump to next hunk" }) + vim.keymap.set({ 'n', 'v' }, '[c', function() if vim.wo.diff then return '[c' end vim.schedule(function() gs.prev_hunk() end) return '' - end, {expr=true, buffer = bufnr, desc = "Jump to previous hunk"}) + end, { expr = true, buffer = bufnr, desc = "Jump to previous hunk" }) end, }, }, - -- { + -- { -- "nyoom-engineering/oxocarbon.nvim", -- config = function() -- vim.cmd([[colorscheme oxocarbon]]) -- end, - -- -- Add in any other configuration; - -- -- event = foo, + -- -- Add in any other configuration; + -- -- event = foo, -- -- config = bar -- -- end, -- }, { "folke/tokyonight.nvim", - lazy = false, -- make sure we load this during startup if it is your main colorscheme + lazy = false, -- make sure we load this during startup if it is your main colorscheme priority = 1000, -- make sure to load this before all the other start plugins config = function() -- load the colorscheme here @@ -134,7 +134,7 @@ require('lazy').setup({ component_separators = '|', section_separators = '', 'filename', - path=1, + path = 1, }, }, }, @@ -144,7 +144,7 @@ require('lazy').setup({ 'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help indent_blankline.txt` - main="ibl", + main = "ibl", opts = {}, }, @@ -172,7 +172,7 @@ require('lazy').setup({ }, }, defaults = { - vimgrep_arguments = { 'rg',}, + vimgrep_arguments = { 'rg', }, }, }, @@ -278,7 +278,7 @@ require('telescope').setup { -- Enable telescope fzf native, if installed pcall(require('telescope').load_extension, 'fzf') --- Enable telescope ui select +-- Enable telescope ui select require("telescope").load_extension("ui-select") -- See `:help telescope.builtin` @@ -293,23 +293,25 @@ vim.keymap.set('n', '/', function() end, { desc = '[/] Fuzzily search in current buffer' }) vim.keymap.set('n', '', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) -vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) -vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) -vim.keymap.set('n', '', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) -vim.keymap.set('n', '', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) -vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) -vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]resume' }) -vim.keymap.set('n', 'sb', require('telescope.builtin').buffers, { desc = '[S]earch [B]uffers' }) +vim.keymap.set('n', 'ff', require('telescope.builtin').find_files, { desc = '[f]ind [f]iles' }) +vim.keymap.set('n', 'fF', function() require('telescope.builtin').find_files({ hidden = true }) end, { desc = '[f]ind [F]iles (hidden)' }) +vim.keymap.set('n', 'fh', require('telescope.builtin').help_tags, { desc = '[f]ind [H]elp' }) +-- vim.keymap.set('n', 'fg', require('telescope.builtin').grep_string, { desc = '[f]ind [g]rep' }) +vim.keymap.set('n', 'fg', require('telescope.builtin').live_grep, { desc = '[f]ind by [G]rep' }) +vim.keymap.set('n', 'fd', require('telescope.builtin').diagnostics, { desc = '[f]ind [D]iagnostics' }) +vim.keymap.set('n', 'fr', require('telescope.builtin').resume, { desc = '[f]ind [R]resume' }) +vim.keymap.set('n', 'fb', require('telescope.builtin').buffers, { desc = '[f]ind [B]uffers' }) -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'ruby'}, + ensure_installed = + { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, - modules={}, + modules = {}, sync_install = false, ignore_install = {}, parser_install_dir = nil, @@ -427,6 +429,22 @@ local servers = { -- pyright = {}, -- rust_analyzer = {}, tsserver = {}, + volar = { + filetypes = { 'vue', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact' }, + init_options = { + vue = { + hybridMode = false, + }, + typescript = { + -- Global install of typescript + --tsdk = '~/.nvm/versions/node/v20.11.1/lib/node_modules/typescript', + -- Current project version and what I will likely use + tsdk = vim.fn.getcwd() .. "node_modules/typescript/lib", + + }, + }, + }, + -- html = { filetypes = { 'html', 'twig', 'hbs'} }, lua_ls = { @@ -475,7 +493,7 @@ cmp.setup { luasnip.lsp_expand(args.body) end, }, - revision=1, + revision = 1, mapping = cmp.mapping.preset.insert { [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.select_prev_item(), diff --git a/lazy-lock.json b/lazy-lock.json index 0de30573..a872c75a 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,30 +1,33 @@ { - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "LuaSnip": { "branch": "master", "commit": "73813308abc2eaeff2bc0d3f2f79270c491be9d7" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "curl.nvim": { "branch": "main", "commit": "3ee14fbafc8169fc803e80562ce7ac5b4474bdff" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, - "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, - "git-blame.nvim": { "branch": "master", "commit": "a0282d05adbee80aaf4e2ff35b81b52940b67bed" }, - "gitsigns.nvim": { "branch": "main", "commit": "4e348641b8206c3b8d23080999e3ddbe4ca90efc" }, - "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, - "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" }, - "lualine.nvim": { "branch": "master", "commit": "26dac2fcadb6e622790ab08e36d0dba3d3765398" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "55716a879568a498fa236593c8119789054a3b8e" }, - "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, - "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" }, - "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, - "nvim-lspconfig": { "branch": "master", "commit": "4bdd3800b4148f670c6cf55ef65f490148eeb550" }, - "nvim-treesitter": { "branch": "master", "commit": "904f373fc4e6fb474e3df35b57f78edee8e45267" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "d2a4ffc22d9d38d44edb73da007b3cf43451e9b4" }, - "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "git-blame.nvim": { "branch": "master", "commit": "9874ec1ec8bc53beb33b7cd82c092b85271a578b" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" }, + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "lazy.nvim": { "branch": "main", "commit": "59334064f8604ca073791c25dcc5c9698865406e" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "155eac5d8609a2f110041f8ac3491664cc126354" }, + "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-lspconfig": { "branch": "master", "commit": "e688b486fe9291f151eae7e5c0b5a5c4ef980847" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" }, + "oil.nvim": { "branch": "master", "commit": "919e155fdf38e9148cdb5304faaaf53c20d703ea" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, - "tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" }, - "vim-fugitive": { "branch": "master", "commit": "41beedabc7e948c787ea5696e04c3544c3674e23" }, - "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, - "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } -} \ No newline at end of file + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "tokyonight.nvim": { "branch": "main", "commit": "4d159616aee17796c2c94d2f5f87d2ee1a3f67c7" }, + "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, + "vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" } +} diff --git a/lua/arnoldlei/remap.lua b/lua/arnoldlei/remap.lua index 12d710e8..f606fe48 100644 --- a/lua/arnoldlei/remap.lua +++ b/lua/arnoldlei/remap.lua @@ -1,5 +1,17 @@ vim.g.mapleader = " " -vim.keymap.set("n", "pv", vim.cmd.Ex) +-- vim.keymap.set("n", "pv", vim.cmd.Ex) +vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) +vim.keymap.set("n", "pv", "Oil", { desc = "Open parent directory" }) + +-- Window splits +vim.keymap.set("n", "|", "vsplit", { desc = "Split window vertically" }) +vim.keymap.set("n", "_", "split", { desc = "Split window horizontally" }) + +-- Window navigation +vim.keymap.set("n", "", "h", { desc = "Move to left window" }) +vim.keymap.set("n", "", "j", { desc = "Move to window below" }) +vim.keymap.set("n", "", "k", { desc = "Move to window above" }) +vim.keymap.set("n", "", "l", { desc = "Move to right window" }) vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") @@ -14,10 +26,10 @@ vim.keymap.set("n", "N", "Nzzzv") vim.keymap.set("x", "p", [["_dP]]) -- next greatest remap ever : asbjornHaland -vim.keymap.set({"n", "v"}, "y", [["+y]]) +vim.keymap.set({ "n", "v" }, "y", [["+y]]) vim.keymap.set("n", "Y", [["+Y]]) -vim.keymap.set({"n", "v"}, "d", [["_d]]) +vim.keymap.set({ "n", "v" }, "d", [["_d]]) -- This is going to get me cancelled vim.keymap.set("i", "", "") @@ -37,6 +49,8 @@ vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) vim.keymap.set("n", "vpp", "e ~/.dotfiles/nvim/.config/nvim/lua/theprimeagen/packer.lua"); vim.keymap.set("n", "mr", "CellularAutomaton make_it_rain"); +vim.keymap.set("n", "sf", ":source $HOME/.config/nvim/init.lua ", { desc = "Source Neovim config" }) + vim.keymap.set("n", "", function() vim.cmd("so") end) diff --git a/lua/plugins/curl.lua b/lua/plugins/curl.lua new file mode 100644 index 00000000..293d8265 --- /dev/null +++ b/lua/plugins/curl.lua @@ -0,0 +1,31 @@ +return { + "oysandvik94/curl.nvim", + cmd = { "CurlOpen" }, + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = true, + keys = { + { "cc", "lua require('curl').open_curl_tab()", desc = "Open a curl tab scoped to the current working directory" }, + { "csc", "lua require('curl').create_scoped_collection()", desc = "Create or open a collection with a name from user input" }, + { "cgc", "lua require('curl').create_global_collection()", desc = "Create or open a global collection with a name from user input" }, + }, + on_attach = function (bufnr) + -- These commands will prompt you for a name for your collection + vim.keymap.set("n", "csc", function() + curl.create_scoped_collection() + end, { desc = "Create or open a collection with a name from user input" }) + + vim.keymap.set("n", "cgc", function() + curl.create_global_collection() + end, { desc = "Create or open a global collection with a name from user input" }) + + vim.keymap.set("n", "fsc", function() + curl.pick_scoped_collection() + end, { desc = "Choose a scoped collection and open it" }) + + vim.keymap.set("n", "fgc", function() + curl.pick_global_collection() + end, { desc = "Choose a global collection and open it" }) + end +} diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index 2dc8a720..d7c3e97c 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -1,5 +1,6 @@ return { "ThePrimeagen/harpoon", + branch = "harpoon2", lazy = false, dependencies = { "nvim-lua/plenary.nvim", @@ -8,10 +9,10 @@ return { keys = { { "a", "lua require('harpoon.mark').add_file()", desc = "Mark file with harpoon" }, { "", "lua require('harpoon.ui').toggle_quick_menu()", desc = "Show harpoon marks" }, - { "", "lua require('harpoon.ui').nav_file(1)", desc = "Navigate to first file in Harpoon" }, - { "", "lua require('harpoon.ui').nav_file(2)", desc = "Navigate to second file in Harpoon" }, - { "", "lua require('harpoon.ui').nav_file(3)", desc = "Navigate to third file in Harpoon" }, - { "", "lua require('harpoon.ui').nav_file(4)", desc = "Navigate to fourth file in Harpoon" }, + -- { "", "lua require('harpoon.ui').nav_file(1)", desc = "Navigate to first file in Harpoon" }, + -- { "", "lua require('harpoon.ui').nav_file(2)", desc = "Navigate to second file in Harpoon" }, + -- { "", "lua require('harpoon.ui').nav_file(3)", desc = "Navigate to third file in Harpoon" }, + -- { "", "lua require('harpoon.ui').nav_file(4)", desc = "Navigate to fourth file in Harpoon" }, }, } diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 00000000..8f5d6ff5 --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,11 @@ +return { + 'stevearc/oil.nvim', + ---@module 'oil' + ---@type oil.SetupOpts + opts = {}, + -- Optional dependencies + dependencies = { { "nvim-mini/mini.icons", opts = {} } }, + -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons + -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations. + lazy = false, +}