diff --git a/init.lua b/init.lua index 2514f9e..ad00f78 100644 --- a/init.lua +++ b/init.lua @@ -1,2 +1,3 @@ -- bootstrap lazy.nvim, LazyVim and your plugins require("config.lazy") +require("config.manual_color") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..e111db1 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,52 @@ +{ + "LazyVim": { "branch": "main", "commit": "3f034d0a7f58031123300309f2efd3bb0356ee21" }, + "blink.cmp": { "branch": "main", "commit": "18b352d12b35bca148427b607098df14b75a218f" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "catppuccin": { "branch": "main", "commit": "4bb938bbba41d306db18bf0eb0633a5f28fd7ba0" }, + "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, + "crates.nvim": { "branch": "main", "commit": "1803c8b5516610ba7cdb759a4472a78414ee6cd4" }, + "duck.nvim": { "branch": "main", "commit": "d8a6b08af440e5a0e2b3b357e2f78bb1883272cd" }, + "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "fzf-lua": { "branch": "main", "commit": "9b84b53f3297d4912d7eb95b979e9b27e2e61281" }, + "gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" }, + "grug-far.nvim": { "branch": "main", "commit": "0e391cc375702299b8dac101ff5a7d418fb193b9" }, + "hardtime.nvim": { "branch": "main", "commit": "b44e11d7a176f184db8b9666a1b41d5890aa5a5b" }, + "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "09220b99d63d5363f219daa2785242ee5fddba7f" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "mini.ai": { "branch": "main", "commit": "6e01c0e5a15554852546fac9853960780ac52ed4" }, + "mini.icons": { "branch": "main", "commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36" }, + "mini.pairs": { "branch": "main", "commit": "1a3e73649c0eaef2f6c48ce1e761c6f0a7c11918" }, + "neo-tree.nvim": { "branch": "main", "commit": "e6f5b5e044ba9f380e82fc942212e0679d83b6f6" }, + "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, + "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, + "nvim-dap": { "branch": "master", "commit": "379cf26e9c457b66a0152cd5d018418c03720d47" }, + "nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, + "nvim-lint": { "branch": "master", "commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8" }, + "nvim-lspconfig": { "branch": "master", "commit": "99c75820f2606b6b446cad7c75ec2ef7ee8a1317" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-treesitter": { "branch": "master", "commit": "93ce9feb4fabbb37b3e7f47d80f27be778f4d956" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, + "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, + "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "011d98eaa3a73b5a51d82ce5bc6b1397dde95562" }, + "render-markdown.nvim": { "branch": "main", "commit": "98a3b7d3a5befe495f0ab6ca967068f5f1da4421" }, + "rustaceanvim": { "branch": "master", "commit": "2b0f0b7e03751cf8ed123322f9b02d8f73fa9df7" }, + "smear-cursor.nvim": { "branch": "main", "commit": "4b7334a09cd2434e73588cc0ea63e71177251249" }, + "snacks.nvim": { "branch": "main", "commit": "e17d60712c96af7359d61540bd2f421352e4f144" }, + "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": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } +} diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 0000000..107c6cf --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,15 @@ +{ + "extras": [ + "lazyvim.plugins.extras.dap.core", + "lazyvim.plugins.extras.editor.harpoon2", + "lazyvim.plugins.extras.lang.markdown", + "lazyvim.plugins.extras.lang.rust", + "lazyvim.plugins.extras.lang.toml", + "lazyvim.plugins.extras.ui.smear-cursor" + ], + "install_version": 7, + "news": { + "NEWS.md": "10960" + }, + "version": 8 +} \ No newline at end of file diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 2c134f7..e8443eb 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -1,3 +1,31 @@ --- 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 +-- Keymaps are automatically loaded on the VeryLazy event +local map = vim.keymap.set + +map("n", ";", "A;") + +-- Lazygit config +local Terminal = require("toggleterm.terminal").Terminal +local lazygit = Terminal:new({ cmd = "lazygit", hidden = true, direction = "tab" }) + +function _lazygit_toggle() + lazygit:toggle() +end +map("n", "gg", "lua _lazygit_toggle()") + +-- Bacon config +local bacon = Terminal:new({ cmd = "bacon --job clippy", hidden = true, direction = "tab" }) + +function _bacon_toggle() + bacon:toggle() +end +map("n", "h", "lua _bacon_toggle()") + +-- Wiki-tui config +local wiki = Terminal:new({ cmd = "wiki-tui", hidden = true, direction = "tab" }) + +function _wiki_toggle() + wiki:toggle() +end +map("n", "sl", "lua _wiki_toggle()") diff --git a/lua/config/keys.lua b/lua/config/keys.lua new file mode 100644 index 0000000..3bf4079 --- /dev/null +++ b/lua/config/keys.lua @@ -0,0 +1,21 @@ +local M = {} + +M.map = function(mode, lhs, rhs, desc) + vim.keymap.set(mode, lhs, rhs, { silent = true, desc = desc }) +end + +M.lsp_map = function(lhs, rhs, bufnr, desc) + vim.keymap.set("n", lhs, rhs, { silent = true, buffer = bufnr, desc = desc }) +end + +M.dap_map = function(mode, lhs, rhs, desc) + M.map(mode, lhs, rhs, desc) +end + +M.set_leader = function(key) + vim.g.mapleader = key + vim.g.maplocalleader = key + M.map({ "n", "v" }, key, "") +end + +return M diff --git a/lua/config/manual_color.lua b/lua/config/manual_color.lua new file mode 100644 index 0000000..6c9188a --- /dev/null +++ b/lua/config/manual_color.lua @@ -0,0 +1,15 @@ +vim.api.nvim_set_hl(0, "String", { fg = "#9ece6a", underline = false, bold = false }) +vim.api.nvim_set_hl(0, "Type", { fg = "#00ff00", underline = false, bold = false }) +vim.api.nvim_set_hl(0, "Structure", { fg = "#00ff00", underline = false, bold = false }) +vim.api.nvim_set_hl(0, "Constant", { fg = "#fab387", underline = false, bold = true }) +vim.api.nvim_set_hl(0, "@lsp.type.selfKeyword.rust", { fg = "#b00202", bold = true, underline = false }) +vim.api.nvim_set_hl(0, "@lsp.type.typeParamater.rust", { fg = "#ffbf00", bold = true, underline = false }) +vim.api.nvim_set_hl(0, "Identifier", { fg = "#ffffff", underline = false, bold = false }) +vim.api.nvim_set_hl(0, "Function", { fg = "#025fb0", underline = false, bold = false }) +vim.api.nvim_set_hl(0, "@lsp.type.enumMember.rust", { fg = "#fab387", underline = false, bold = false }) +vim.api.nvim_set_hl(0, "@lsp.type.interface", { fg = "#a402b0", bold = true, underline = false }) +vim.api.nvim_set_hl(0, "Comment", { fg = "#989898", bold = false, underline = false }) +vim.api.nvim_set_hl(0, "NvimTreeGitDirty", { fg = "#ffaa00", bold = false, underline = false }) +vim.api.nvim_set_hl(0, "@string.escape", { fg = "#aa00ff", bold = false, underline = false }) +vim.api.nvim_set_hl(0, "@type.builtin", { fg = "#00ff00", bold = false, underline = false }) +vim.api.nvim_set_hl(0, "@lsp.mod.unsafe.rust", { bg = "#aa0000" }) diff --git a/lua/config/options.lua b/lua/config/options.lua index 3ea1454..14e5657 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -1,3 +1,6 @@ -- 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.g.snacks_animate = false + +vim.o.shiftwidth = 4 diff --git a/lua/plugins/blink_cmp.lua b/lua/plugins/blink_cmp.lua new file mode 100644 index 0000000..edf6b9d --- /dev/null +++ b/lua/plugins/blink_cmp.lua @@ -0,0 +1,16 @@ +return { + -- "saghen/blink.cmp", + -- dependencies = { "codeium.nvim", "saghen/blink.compat" }, + -- opts = { + -- sources = { + -- compat = { "codeium" }, + -- providers = { + -- codeium = { + -- kind = "Codeium", + -- score_offset = 100, + -- async = true, + -- }, + -- }, + -- }, + -- }, +} diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..130cc28 --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,15 @@ +return { + { + "catppuccin/nvim", + name = "catppuccin", + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "catppuccin", + }, + }, + { + "HiPhish/rainbow-delimiters.nvim", + }, +} diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index 17f53d6..5a2cb9b 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -9,41 +9,41 @@ if true then return {} end -- * disable/enabled LazyVim plugins -- * override the configuration of LazyVim plugins return { - -- add gruvbox - { "ellisonleao/gruvbox.nvim" }, + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, - -- Configure LazyVim to load gruvbox - { - "LazyVim/LazyVim", - opts = { - colorscheme = "gruvbox", + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, }, - }, - -- change trouble config - { - "folke/trouble.nvim", - -- opts will be merged with the parent spec - opts = { use_diagnostic_signs = true }, - }, + -- change trouble config + { + "folke/trouble.nvim", + -- opts will be merged with the parent spec + opts = { use_diagnostic_signs = true }, + }, - -- disable trouble - { "folke/trouble.nvim", enabled = false }, + -- disable trouble + { "folke/trouble.nvim", enabled = false }, - -- override nvim-cmp and add cmp-emoji - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji" }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - table.insert(opts.sources, { name = "emoji" }) - end, - }, + -- override nvim-cmp and add cmp-emoji + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-emoji" }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + table.insert(opts.sources, { name = "emoji" }) + end, + }, - -- change some telescope options and a keymap to browse plugin files - { - "nvim-telescope/telescope.nvim", - keys = { + -- change some telescope options and a keymap to browse plugin files + { + "nvim-telescope/telescope.nvim", + keys = { -- add a keymap to browse plugin files -- stylua: ignore { @@ -51,147 +51,147 @@ return { function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, desc = "Find Plugin File", }, + }, + -- change some options + opts = { + defaults = { + layout_strategy = "horizontal", + layout_config = { prompt_position = "top" }, + sorting_strategy = "ascending", + winblend = 0, + }, + }, }, - -- change some options - opts = { - defaults = { - layout_strategy = "horizontal", - layout_config = { prompt_position = "top" }, - sorting_strategy = "ascending", - winblend = 0, - }, - }, - }, - -- add pyright to lspconfig - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- pyright will be automatically installed with mason and loaded with lspconfig - pyright = {}, - }, + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + }, + }, }, - }, - -- add tsserver and setup with typescript.nvim instead of lspconfig - { - "neovim/nvim-lspconfig", - dependencies = { - "jose-elias-alvarez/typescript.nvim", - init = function() - require("lazyvim.util").lsp.on_attach(function(_, buffer) + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").lsp.on_attach(function(_, buffer) -- stylua: ignore vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) - vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) - end) - end, + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, }, - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- tsserver will be automatically installed with mason and loaded with lspconfig - tsserver = {}, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - tsserver = function(_, opts) - require("typescript").setup({ server = opts }) - return true + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + + -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above + -- would overwrite `ensure_installed` with the new value. + -- If you'd rather extend the default config, use the code below instead: + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add tsx and treesitter + vim.list_extend(opts.ensure_installed, { + "tsx", + "typescript", + }) end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, - }, }, - }, - -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, - -- treesitter, mason and typescript.nvim. So instead of the above, you can use: - { import = "lazyvim.plugins.extras.lang.typescript" }, - - -- add more treesitter parsers - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "tsx", - "typescript", - "vim", - "yaml", - }, - }, - }, - - -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above - -- would overwrite `ensure_installed` with the new value. - -- If you'd rather extend the default config, use the code below instead: - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - -- add tsx and treesitter - vim.list_extend(opts.ensure_installed, { - "tsx", - "typescript", - }) - end, - }, - - -- the opts function can also be used to change the default opts: - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function(_, opts) - table.insert(opts.sections.lualine_x, { - function() - return "😄" + -- the opts function can also be used to change the default opts: + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, { + function() + return "😄" + end, + }) end, - }) - end, - }, - - -- or you can return new options to override all the defaults - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function() - return { - --[[add your custom lualine config here]] - } - end, - }, - - -- use mini.starter instead of alpha - { import = "lazyvim.plugins.extras.ui.mini-starter" }, - - -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc - { import = "lazyvim.plugins.extras.lang.json" }, - - -- add any tools you want to have installed below - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", - }, }, - }, + + -- or you can return new options to override all the defaults + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + --[[add your custom lualine config here]] + } + end, + }, + + -- use mini.starter instead of alpha + { import = "lazyvim.plugins.extras.ui.mini-starter" }, + + -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, + }, + }, } diff --git a/lua/plugins/misc.lua b/lua/plugins/misc.lua new file mode 100644 index 0000000..e77bc6b --- /dev/null +++ b/lua/plugins/misc.lua @@ -0,0 +1,31 @@ +return { + + "tpope/vim-surround", -- Surround stuff with the ys-, cs-, ds- commands + { + "MeanderingProgrammer/render-markdown.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" }, -- if you use standalone mini plugins + ---@module 'render-markdown' + ---@type render.md.UserConfig + opts = {}, + }, + { + "tamton-aquib/duck.nvim", + config = function() + local duck = require("duck") + duck.hatch("🦀", 10) + duck.hatch("🦀", 10) + vim.keymap.set("n", "dn", function() + duck.hatch("🦀", 10) + end, {}) + vim.keymap.set("n", "dk", function() + duck.cook() + end, {}) + end, + }, + { + "m4xshen/hardtime.nvim", + lazy = false, + dependencies = { "MunifTanjim/nui.nvim" }, + opts = {}, + }, +} diff --git a/lua/plugins/neo_tree.lua b/lua/plugins/neo_tree.lua new file mode 100644 index 0000000..3a0ab26 --- /dev/null +++ b/lua/plugins/neo_tree.lua @@ -0,0 +1,8 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + opts = { + close_if_last_window = true, + }, + }, +} diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..d5535ec --- /dev/null +++ b/lua/plugins/toggleterm.lua @@ -0,0 +1,12 @@ +return { + { + "akinsho/toggleterm.nvim", + version = "*", + config = { + direction = "float", + shell = "fish", + float_opts = { border = "curved" }, + open_mapping = [[]], + }, + }, +} diff --git a/stylua.toml b/stylua.toml index 5d6c50d..e55efd5 100644 --- a/stylua.toml +++ b/stylua.toml @@ -1,3 +1,3 @@ indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file +indent_width = 4 +column_width = 120