diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..8504e10 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,54 @@ +{ + "LazyVim": { "branch": "main", "commit": "25abbf546d564dc484cf903804661ba12de45507" }, + "SchemaStore.nvim": { "branch": "main", "commit": "433a310de5cbab41f1eb3424332a583e21e39f5c" }, + "auto-session": { "branch": "main", "commit": "7d37d1cae7a39ff57da9a452d21b5dbfc5636c18" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "catppuccin": { "branch": "main", "commit": "30fa4d122d9b22ad8b2e0ab1b533c8c26c4dde86" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-dbee": { "branch": "main", "commit": "1650f67b9bf43c029fc37570665ca895a33cdf5a" }, + "cmp-mini-snippets": { "branch": "main", "commit": "582aea215ce2e65b880e0d23585c20863fbb7604" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "conform.nvim": { "branch": "master", "commit": "a0ab60ed666c56b37fd7ed1847d2ac52f2482ce0" }, + "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "grug-far.nvim": { "branch": "main", "commit": "385d1949dc21d0c39e7a74b4f4a25da18817bc86" }, + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "mini.ai": { "branch": "main", "commit": "1cd4f021a05c29acd4ab511c0981da14217daf38" }, + "mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" }, + "mini.pairs": { "branch": "main", "commit": "1e1ca3f60f58d4050bf814902b472eec9963a5dd" }, + "mini.snippets": { "branch": "main", "commit": "752765aa04185d499e4f43506c434602eeb04e33" }, + "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-dbee": { "branch": "master", "commit": "dda517694889a5d238d7aa407403984da9f80cc0" }, + "nvim-lint": { "branch": "master", "commit": "ee04d481d4e6089892c2fb2ad8924b1a053591e1" }, + "nvim-lspconfig": { "branch": "master", "commit": "16878c7a018cba66a6e990286bdb6afc29ca13d3" }, + "nvim-surround": { "branch": "main", "commit": "d56752df477ebd808cb82cea2fc68cf7455abb21" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" }, + "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, + "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "render-markdown.nvim": { "branch": "main", "commit": "c4ff9acddcf0f79b3187393319adb5cac5865bd3" }, + "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, + "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, + "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" }, + "vim-be-good": { "branch": "master", "commit": "0ae3de14eb8efc6effe7704b5e46495e91931cc5" }, + "vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" }, + "vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" }, + "vim-dadbod-ui": { "branch": "master", "commit": "2900a1617b3df1a48683d872eadbe1101146a49a" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, + "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" } +} diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 0000000..bcd9016 --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,20 @@ +{ + "extras": [ + "lazyvim.plugins.extras.coding.mini-snippets", + "lazyvim.plugins.extras.coding.nvim-cmp", + "lazyvim.plugins.extras.coding.yanky", + "lazyvim.plugins.extras.formatting.prettier", + "lazyvim.plugins.extras.lang.json", + "lazyvim.plugins.extras.lang.markdown", + "lazyvim.plugins.extras.lang.sql", + "lazyvim.plugins.extras.lang.toml", + "lazyvim.plugins.extras.lang.typescript", + "lazyvim.plugins.extras.util.dot" + ], + "install_version": 8, + "news": { + "NEWS.md": "10960" + }, + "version": 8 +} + diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 2c134f7..e2df7a8 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -1,3 +1,6 @@ -- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here + +vim.keymap.set("n", "td", ':lua require("dbee").toggle()', { desc = "Toggle the database viewer" }) +vim.keymap.set("t", "", "", { desc = "Exit Terminal Mode" }) diff --git a/lua/config/options.lua b/lua/config/options.lua index 3ea1454..9203de2 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -1,3 +1,8 @@ -- Options are automatically loaded before lazy.nvim startup -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua -- Add any additional options here + +vim.o.tabstop = 4 -- A TAB character looks like 4 spaces +vim.o.expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character +vim.o.softtabstop = 4 -- Number of spaces inserted instead of a TAB character +vim.o.shiftwidth = 4 -- Number of spaces inserted when indenting diff --git a/lua/plugins/folke.lua b/lua/plugins/folke.lua new file mode 100644 index 0000000..20df53c --- /dev/null +++ b/lua/plugins/folke.lua @@ -0,0 +1,60 @@ +local snacksRootDirDesc = "Explorer Snacks (Root Dir)" +local snacksCwdDesc = "Explorer Snacks (cwd)" + +local pickerCwdDesc = "Find Files (cwd)" + +local exploreExclude = { "**/node_modules/**" } +local pickerExclude = { "**/node_modules/**", "**/.next/**", "**/.idea/**", "**/.vscode/**" } + +return { + { + "folke/snacks.nvim", + opts = { + picker = { + sources = { + explorer = { + auto_close = true, + layout = { + layout = { + position = "right", + }, + }, + }, + }, + }, + }, + keys = { + { + "fF", + function() + Snacks.picker.files({ cwd = LazyVim.root(), hidden = true, ignored = true, exclude = pickerExclude }) + end, + desc = "Find Files (Root Dir)", + }, + { + "ff", + function() + Snacks.picker.files({ hidden = true, ignored = true, exclude = pickerExclude }) + end, + desc = pickerCwdDesc, + }, + { + "fe", + function() + Snacks.explorer({ exclude = exploreExclude }) + end, + desc = snacksCwdDesc, + }, + { + "fE", + function() + Snacks.explorer({ cwd = LazyVim.root(), exclude = exploreExclude }) + end, + desc = snacksRootDirDesc, + }, + { "", "ff", desc = pickerCwdDesc, remap = true }, + { "e", "fe", desc = snacksCwdDesc, remap = true }, + { "E", "fE", desc = snacksRootDirDesc, remap = true }, + }, + }, +} diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..4aacfe5 --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,72 @@ +return { + { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local leader = "h" + local harpoon = require("harpoon") + + -- REQUIRED + harpoon:setup({ + default = { + create_list_item = function() + local file_path = vim.fn.expand("%:p") -- Absolute file path + local line_number = vim.fn.line(".") + + if file_path == "" then + ---@diagnostic disable-next-line: return-type-mismatch + return nil + end + + return { + value = file_path .. ":" .. line_number, + context = { file_path = file_path, line_number = line_number }, + } + end, + + select = function(list_item) + vim.cmd("edit " .. list_item.context.file_path) + + -- Jump to the line + vim.api.nvim_win_set_cursor(0, { list_item.context.line_number, 0 }) + end, + }, + }) + -- REQUIRED + + vim.keymap.set("n", "a", function() + harpoon:list():add() + end, { desc = "Add Current File to Harpoon" }) + + vim.keymap.set("n", leader .. "h", function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, { desc = "List Harpoon Files" }) + + for i = 1, 4 do + vim.keymap.set("n", leader .. i, function() + harpoon:list():select(i) + end, { desc = "Select Harpoon File (" .. i .. ")" }) + + vim.keymap.set("n", leader .. "a" .. i, function() + harpoon:list():replace_at(i) + end, { desc = "Set Current File to Harpoon #" .. i }) + + vim.keymap.set("n", leader .. "d" .. i, function() + harpoon:list():remove_at(i) + end, { desc = "Delete Harpoon File #" .. i }) + end + + vim.keymap.set("n", leader .. "p", function() + harpoon:list():prev() + end, { desc = "Select Prev Harpoon File" }) + vim.keymap.set("n", leader .. "n", function() + harpoon:list():next() + end, { desc = "Select Next Harpoon File" }) + + vim.keymap.set("n", leader .. "dd", function() + harpoon:list():clear() + end, { desc = "Clear Harpoon List" }) + end, + }, +} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..f25931a --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,64 @@ +return { + { "ThePrimeagen/vim-be-good" }, + { "tpope/vim-sleuth" }, + + -- AutoSession + { + "rmagatti/auto-session", + lazy = false, + + ---enables autocomplete for opts + ---@module "auto-session" + ---@type AutoSession.Config + opts = { + suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" }, + -- log_level = 'debug', + }, + }, + -- DBee (Database UI) + { + "kndndrj/nvim-dbee", + dependencies = { + "MunifTanjim/nui.nvim", + }, + 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() + end, + config = function() + require("dbee").setup(--[[optional config]]) + end, + }, + + -- Surround + { + "kylechui/nvim-surround", + version = "^3.0.0", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({ + -- Configuration here, or leave empty to use defaults + }) + end, + }, + + -- Toggleterm + { + "akinsho/toggleterm.nvim", + version = "*", + config = true, + }, + + -- LazyDev (Lua plugin typedefs) + { + "folke/lazydev.nvim", + ft = "lua", + opts = { + library = { + "~/.local/share/nvim-lazy/lazy/ ", -- Path to your lazy.nvim plugins + }, + }, + }, +} diff --git a/lua/plugins/supertab.lua b/lua/plugins/supertab.lua new file mode 100644 index 0000000..6bee098 --- /dev/null +++ b/lua/plugins/supertab.lua @@ -0,0 +1,64 @@ +return { + { + "hrsh7th/nvim-cmp", + dependencies = { + { + "MattiasMTS/cmp-dbee", + dependencies = { + { "kndndrj/nvim-dbee" }, + }, + ft = "sql", -- optional but good to have + opts = {}, -- needed + }, + }, + opts = function(_, opts) + -- opts.sources = { + -- { "cmp-dbee" }, + -- } + + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local cmp = require("cmp") + + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.close() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + -- You could replace select_next_item() with confirm({ select = true }) to get VS Code autocompletion behavior + --cmp.select_next_item() + cmp.confirm({ select = true }) + elseif vim.snippet.active({ direction = 1 }) then + vim.schedule(function() + vim.snippet.jump(1) + end) + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif vim.snippet.active({ direction = -1 }) then + vim.schedule(function() + vim.snippet.jump(-1) + end) + else + fallback() + end + end, { "i", "s" }), + }) + end, + }, +}