diff --git a/init.lua b/init.lua index 749913d..14c6281 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ vim.g.loaded_netrwPlugin = 1 vim.opt.termguicolors = true -- nvchad ui stuff -vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46_cache/" +-- vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46_cache/" vim.g.mapleader = " " vim.keymap.set({ "n", "v" }, "", "") @@ -38,11 +38,17 @@ require("lazy").setup { import = "plugins" } -- dofile(vim.g.base46_cache .. "nvimtree") -- or if you want to load all base46 integrations at startup itself -local integrations = require("nvconfig").base46.integrations - -for _, name in ipairs(integrations) do - dofile(vim.g.base46_cache .. name) -end +-- local integrations = require("nvconfig").base46.integrations +-- +-- for _, name in ipairs(integrations) do +-- dofile(vim.g.base46_cache .. name) +-- end + +-- start lualine +local lineopts = require "configs.lualine" +require("lualine").setup(lineopts) +local bufferline = require "bufferline" +bufferline.setup {} vim.o.number = true -- require("nvim-tree.api").tree.open() -- open tree on start diff --git a/lazy-lock.json b/lazy-lock.json index c50ffbd..a1fa551 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,7 +1,8 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" }, - "base46": { "branch": "v2.5", "commit": "adb64a6ae70f8c61c5ab8892f07d29dafd4d47ad" }, + "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, + "catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, @@ -13,6 +14,7 @@ "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "ca9eaccc154578064366d99de7b02f8231c383eb" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, @@ -22,8 +24,8 @@ "nvim-tree.lua": { "branch": "master", "commit": "ddd1d6eb21c45433bdc65cc8015f2457998f2bf2" }, "nvim-treesitter": { "branch": "master", "commit": "2a95ff14764af20d32ec1edb27e11c38a84b9478" }, "nvim-web-devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" }, + "nvimgelion": { "branch": "main", "commit": "28f3b71f8545ff002a1c08ca928799cdf660eccf" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "telescope.nvim": { "branch": "master", "commit": "4d4ade7f2b8f403e8816ca50c05ed16e259b21fb" }, - "ui": { "branch": "v2.5", "commit": "e1af69426b3c4b55c88bd1c81790c1c73b30bfa8" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" } } \ No newline at end of file diff --git a/lua/configs/gitsigns.lua b/lua/configs/gitsigns.lua index d09e967..0cf926a 100644 --- a/lua/configs/gitsigns.lua +++ b/lua/configs/gitsigns.lua @@ -7,18 +7,18 @@ return { changedelete = { text = "~" }, untracked = { text = "│" }, }, - - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - local function opts(desc) - return { buffer = bufnr, desc = desc } - end - - local map = vim.keymap.set - - map("n", "rh", gs.reset_hunk, opts "Reset Hunk") - map("n", "ph", gs.preview_hunk, opts "Preview Hunk") - map("n", "gb", gs.blame_line, opts "Blame Line") - end, + -- + -- on_attach = function(bufnr) + -- local gs = package.loaded.gitsigns + -- + -- local function opts(desc) + -- return { buffer = bufnr, desc = desc } + -- end + -- + -- local map = vim.keymap.set + -- + -- map("n", "rh", gs.reset_hunk, opts "Reset Hunk") + -- map("n", "ph", gs.preview_hunk, opts "Preview Hunk") + -- map("n", "gb", gs.blame_line, opts "Blame Line") + -- end, } diff --git a/lua/configs/lualine.lua b/lua/configs/lualine.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/lua/configs/lualine.lua @@ -0,0 +1 @@ +return {} diff --git a/lua/options.lua b/lua/options.lua index 037d8b8..0982212 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -3,7 +3,7 @@ local o = vim.o local g = vim.g -------------------------------------- globals ----------------------------------------- -g.toggle_theme_icon = "  " +-- g.toggle_theme_icon = "  " -------------------------------------- options ------------------------------------------ o.laststatus = 3 -- this line is necessary otherwise statusline breaks @@ -67,3 +67,6 @@ vim.api.nvim_create_autocmd("TextYankPost", { vim.highlight.on_yank { timeout = 500 } end, }) + +-- set colorscheme +vim.cmd.colorscheme "catppuccin-mocha" diff --git a/lua/plugins/base46.lua b/lua/plugins/base46.lua index 94799fb..2fd71c2 100644 --- a/lua/plugins/base46.lua +++ b/lua/plugins/base46.lua @@ -1,8 +1,8 @@ return { - "NvChad/base46", - branch = "v2.5", - lazy = true, - build = function() - require("base46").load_all_highlights() - end, + -- "NvChad/base46", + -- branch = "v2.5", + -- lazy = true, + -- build = function() + -- require("base46").load_all_highlights() + -- end, } diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua new file mode 100644 index 0000000..4c62288 --- /dev/null +++ b/lua/plugins/bufferline.lua @@ -0,0 +1 @@ +return { "akinsho/bufferline.nvim", version = "*", dependencies = "nvim-tree/nvim-web-devicons" } diff --git a/lua/plugins/catppuccin.lua b/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..bb21140 --- /dev/null +++ b/lua/plugins/catppuccin.lua @@ -0,0 +1,39 @@ +return { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + config = function() + require("catppuccin").setup { + color_overrides = { + mocha = { + rosewater = "#efc9c2", + flamingo = "#ebb2b2", + pink = "#f2a7de", + mauve = "#b889f4", + red = "#ea7183", + maroon = "#ea838c", + peach = "#f39967", + yellow = "#eaca89", + green = "#96d382", + teal = "#78cec1", + sky = "#91d7e3", + sapphire = "#68bae0", + blue = "#739df2", + lavender = "#a0a8f6", + text = "#b5c1f1", + subtext1 = "#a6b0d8", + subtext0 = "#959ec2", + overlay2 = "#848cad", + overlay1 = "#717997", + overlay0 = "#63677f", + surface2 = "#505469", + surface1 = "#3e4255", + surface0 = "#2c2f40", + base = "#1a1c2a", + mantle = "#141620", + crust = "#0e0f16", + }, + }, + } + end, +} diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index 08c4c11..67a11c1 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -28,6 +28,7 @@ return { yaml = { { "prettierd", "prettier" } }, markdown = { { "prettierd", "prettier" } }, ["markdown.mdx"] = { { "prettierd", "prettier" } }, + ruby = { { "prettierd", "prettier" } }, }, }, config = function(_, opts) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index e5dfa05..5d63fc4 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -2,7 +2,8 @@ return { "lewis6991/gitsigns.nvim", event = "User FilePost", opts = function() - return require "configs.gitsigns" + -- return require "configs.gitsigns" + return {} end, config = function(_, opts) dofile(vim.g.base46_cache .. "git") diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua index eb93ad0..dd6f13c 100644 --- a/lua/plugins/indent-blankline.lua +++ b/lua/plugins/indent-blankline.lua @@ -11,6 +11,6 @@ return { hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level) require("ibl").setup(opts) - dofile(vim.g.base46_cache .. "blankline") + -- dofile(vim.g.base46_cache .. "blankline") end, } diff --git a/lua/plugins/lsp-zero.lua b/lua/plugins/lsp-zero.lua index 3348834..9970ecd 100644 --- a/lua/plugins/lsp-zero.lua +++ b/lua/plugins/lsp-zero.lua @@ -3,7 +3,7 @@ return { "williamboman/mason.nvim", cmd = { "Mason", "MasonInstall", "MasonUpdate" }, config = function(_, opts) - dofile(vim.g.base46_cache .. "mason") + -- dofile(vim.g.base46_cache .. "mason") require("mason").setup(opts) end, }, @@ -46,43 +46,4 @@ return { }, { "neovim/nvim-lspconfig" }, { "hrsh7th/cmp-nvim-lsp" }, - { - "hrsh7th/nvim-cmp", - dependencies = { - { - -- snippet plugin - "L3MON4D3/LuaSnip", - dependencies = "rafamadriz/friendly-snippets", - opts = { history = true, updateevents = "TextChanged,TextChangedI" }, - config = function(_, opts) - require("luasnip").config.set_config(opts) - require "configs.luasnip" - end, - }, - - -- autopairing of (){}[] etc - { - "windwp/nvim-autopairs", - opts = { - fast_wrap = {}, - disable_filetype = { "TelescopePrompt", "vim" }, - }, - config = function(_, opts) - require("nvim-autopairs").setup(opts) - - -- setup cmp for autopairs - local cmp_autopairs = require "nvim-autopairs.completion.cmp" - require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, - }, - - -- cmp sources plugins - { - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - }, - }, - }, } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..4a641db --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,4 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, +} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..312b82e --- /dev/null +++ b/lua/plugins/nvim-cmp.lua @@ -0,0 +1,39 @@ +return { + "hrsh7th/nvim-cmp", + dependencies = { + { + -- snippet plugin + "L3MON4D3/LuaSnip", + dependencies = "rafamadriz/friendly-snippets", + opts = { history = true, updateevents = "TextChanged,TextChangedI" }, + config = function(_, opts) + require("luasnip").config.set_config(opts) + require "configs.luasnip" + end, + }, + + -- autopairing of (){}[] etc + { + "windwp/nvim-autopairs", + opts = { + fast_wrap = {}, + disable_filetype = { "TelescopePrompt", "vim" }, + }, + config = function(_, opts) + require("nvim-autopairs").setup(opts) + + -- setup cmp for autopairs + local cmp_autopairs = require "nvim-autopairs.completion.cmp" + require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, + }, + + -- cmp sources plugins + { + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + }, + }, +} diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua index 28c4929..620c7b9 100644 --- a/lua/plugins/nvim-tree.lua +++ b/lua/plugins/nvim-tree.lua @@ -12,7 +12,7 @@ return { require "configs.nvim-tree" end, config = function(_, opts) - dofile(vim.g.base46_cache .. "devicons") + -- dofile(vim.g.base46_cache .. "devicons") require("nvim-web-devicons").setup(opts) end, }, diff --git a/lua/plugins/nvimgelion.lua b/lua/plugins/nvimgelion.lua new file mode 100644 index 0000000..fb2ecae --- /dev/null +++ b/lua/plugins/nvimgelion.lua @@ -0,0 +1,6 @@ +return { + "nyngwang/nvimgelion", + config = function() + -- do whatever you want for further customization~ + end, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index b9fbda7..5227008 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -2,4 +2,13 @@ local map = vim.keymap.set return { "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("telescope").setup { + pickers = { + colorscheme = { + enable_preview = true, + }, + }, + } + end, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index da5fbd6..e49a869 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -7,8 +7,8 @@ return { return require "configs.treesitter" end, config = function(_, opts) - dofile(vim.g.base46_cache .. "syntax") - dofile(vim.g.base46_cache .. "treesitter") + -- dofile(vim.g.base46_cache .. "syntax") + -- dofile(vim.g.base46_cache .. "treesitter") require("nvim-treesitter.configs").setup(opts) end, } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index d179f2a..d5b9787 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,8 +1,8 @@ return { - "NvChad/ui", - lazy = false, - branch = "v2.5", - config = function() - require "nvchad" - end, + -- "NvChad/ui", + -- lazy = false, + -- branch = "v2.5", + -- config = function() + -- require "nvchad" + -- end, } diff --git a/lua/remaps.lua b/lua/remaps.lua index 27716ed..28872fa 100644 --- a/lua/remaps.lua +++ b/lua/remaps.lua @@ -20,9 +20,14 @@ map("n", "fh", builtin.help_tags, { desc = "[f]ind [h]elp" }) map("n", "fg", "Telescope current_buffer_fuzzy_find", { desc = "[f]ile [g]rep" }) map("n", "cm", "Telescope git_commits", { desc = "Telescope Git commits" }) map("n", "gt", "Telescope git_status", { desc = "Telescope Git status" }) +map("n", "th", "Telescope colorscheme", { desc = "[th]eme switcher" }) -- base46 maps -map("n", "th", "Telescope themes", { desc = "[th]emes" }) +map("n", "rt", function() + os.execute('rm -r "' .. vim.g.base46_cache .. '"') + require("base46").load_all_highlights() + vim.api.nvim_exec_autocmds("User", { pattern = "NvChadThemeReload" }) +end) -- nvim-tree mapping map("n", "e", "NvimTreeOpen") @@ -33,17 +38,9 @@ map("n", "/", function() end, { desc = "Comment Toggle" }) -- tabufline -map("n", "", function() - require("nvchad.tabufline").next() -end, { desc = "Buffer Goto next" }) - -map("n", "", function() - require("nvchad.tabufline").prev() -end, { desc = "Buffer Goto prev" }) - -map("n", "x", function() - require("nvchad.tabufline").close_buffer() -end, { desc = "Buffer Close" }) +map("n", "", "BufferLineCycleNext", { desc = "Buffer Goto next" }) +map("n", "", "BufferLineCyclePrev", { desc = "Buffer Goto Prev" }) +map("n", "x", "bdelete", { desc = "Buffer Close" }) -- lsp map("n", "lf", vim.diagnostic.open_float, { desc = "Lsp floating diagnostics" })