From 85676d41534b4da7cdc03bda1fced79f7e32cbb6 Mon Sep 17 00:00:00 2001 From: voidarclabs Date: Fri, 22 Aug 2025 13:37:35 +0100 Subject: [PATCH] restructure and more plugins --- init.lua | 3 ++ lua/config/lazy.lua | 47 +++++++++++---------- lua/plugins/completion/lspconfig.lua | 62 ++++++++++++---------------- lua/plugins/functional/flash.lua | 48 +++++++++++++++++++++ lua/plugins/functional/mini.lua | 18 ++++++++ lua/plugins/mini.lua | 11 ----- lua/plugins/{ => ui}/cattpuccin.lua | 0 lua/plugins/ui/lualine.lua | 60 +++++++++++++++++++++++++++ lua/plugins/ui/tint.lua | 6 +++ 9 files changed, 187 insertions(+), 68 deletions(-) create mode 100644 lua/plugins/functional/flash.lua create mode 100644 lua/plugins/functional/mini.lua delete mode 100644 lua/plugins/mini.lua rename lua/plugins/{ => ui}/cattpuccin.lua (100%) create mode 100644 lua/plugins/ui/lualine.lua create mode 100644 lua/plugins/ui/tint.lua diff --git a/init.lua b/init.lua index c76e1c6..51155c2 100644 --- a/init.lua +++ b/init.lua @@ -5,7 +5,10 @@ require("config.lazy") vim.opt.splitbelow = true vim.opt.splitright = true +vim.o.winborder = "rounded" + vim.keymap.set("i", "jj", "") +vim.keymap.set("n", "q:", ":", { noremap = true, silent = true }) vim.opt.tabstop = 4 vim.opt.softtabstop = 4 diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index ae23bf5..dc0ffff 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,17 +1,17 @@ -- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end vim.opt.rtp:prepend(lazypath) @@ -23,14 +23,19 @@ vim.g.maplocalleader = "\\" -- Setup lazy.nvim require("lazy").setup({ - spec = { - -- import your plugins - { import = "plugins" }, - { import = "plugins.completion" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "catppuccin" } }, - -- automatically check for plugin updates - checker = { enabled = true }, + spec = { + -- import your plugins + { import = "plugins" }, + { import = "plugins.completion" }, + { import = "plugins.ui" }, + { import = "plugins.functional" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "catppuccin" } }, + ui = { + border = "rounded", + }, + -- automatically check for plugin updates + checker = { enabled = true }, }) diff --git a/lua/plugins/completion/lspconfig.lua b/lua/plugins/completion/lspconfig.lua index 3490287..1abf409 100644 --- a/lua/plugins/completion/lspconfig.lua +++ b/lua/plugins/completion/lspconfig.lua @@ -1,41 +1,31 @@ return { - "neovim/nvim-lspconfig", - dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - }, - config = function() - require("mason").setup() - require("mason-lspconfig").setup({ - ensure_installed = { "ts_ls", "lua_ls", "pyright", "rust_analyzer", "eslint" }, -- Add your desired LSPs - automatic_installation = true, - }) + "neovim/nvim-lspconfig", + config = function() + local lspconfig = require("lspconfig") - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({}) - --Enable (broadcasting) snippet capability for completion - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities.textDocument.completion.completionItem.snippetSupport = true + -- Enable snippet capability for completion + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.completion.completionItem.snippetSupport = true - vim.lsp.config("cssls", { - capabilities = capabilities, - }) - lspconfig.pyright.setup({}) - lspconfig.cssls.setup({}) - lspconfig.ts_ls.setup({ - capabilities = capabilities, - }) - lspconfig.rust_analyzer.setup({}) - lspconfig.emmet_ls.setup({ - capabilities = require("cmp_nvim_lsp").default_capabilities(), - filetypes = { "html", "css", "javascriptreact", "typescriptreact" }, -- Add more if needed - init_options = { - html = { - options = { - ["bem.enabled"] = true, - }, + lspconfig.lua_ls.setup({}) + lspconfig.pyright.setup({}) + lspconfig.cssls.setup({ + capabilities = capabilities, + }) + lspconfig.ts_ls.setup({ + capabilities = capabilities, + }) + lspconfig.rust_analyzer.setup({}) + lspconfig.emmet_ls.setup({ + capabilities = require("cmp_nvim_lsp").default_capabilities(), + filetypes = { "html", "css", "javascriptreact", "typescriptreact" }, + init_options = { + html = { + options = { + ["bem.enabled"] = true, }, }, - }) - end, - } + }, + }) + end, +} diff --git a/lua/plugins/functional/flash.lua b/lua/plugins/functional/flash.lua new file mode 100644 index 0000000..188bc41 --- /dev/null +++ b/lua/plugins/functional/flash.lua @@ -0,0 +1,48 @@ +return { + "folke/flash.nvim", + event = "VeryLazy", + ---@type Flash.Config + opts = {}, + keys = { + { + "s", + mode = { "n", "x", "o" }, + function() + require("flash").jump() + end, + desc = "Flash", + }, + { + "S", + mode = { "n", "x", "o" }, + function() + require("flash").treesitter() + end, + desc = "Flash Treesitter", + }, + { + "r", + mode = "o", + function() + require("flash").remote() + end, + desc = "Remote Flash", + }, + { + "R", + mode = { "o", "x" }, + function() + require("flash").treesitter_search() + end, + desc = "Treesitter Search", + }, + { + "", + mode = { "c" }, + function() + require("flash").toggle() + end, + desc = "Toggle Flash Search", + }, + }, +} diff --git a/lua/plugins/functional/mini.lua b/lua/plugins/functional/mini.lua new file mode 100644 index 0000000..5e3eaa3 --- /dev/null +++ b/lua/plugins/functional/mini.lua @@ -0,0 +1,18 @@ +return { + "echasnovski/mini.nvim", + version = "", + + config = function() + require("mini.pairs").setup() -- Bracket pairs and stuff + require("mini.ai").setup() -- Around and In extension for visual mode + require("mini.surround").setup() -- Suround selections with characters + require("mini.move").setup({ + mappings = { + down = "J", + up = "K", + }, + }) + + require("mini.icons").setup() -- Icon provider + end, +} diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua deleted file mode 100644 index f94ecf8..0000000 --- a/lua/plugins/mini.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "echasnovski/mini.nvim", - version = "", - config = function() - require('mini.pairs').setup() -- Bracket pairs and stuff - require("mini.ai").setup() -- Around and In extension for visual mode - require("mini.surround").setup() -- Suround selections with characters - - require("mini.icons").setup() -- Icon provider - end, -} diff --git a/lua/plugins/cattpuccin.lua b/lua/plugins/ui/cattpuccin.lua similarity index 100% rename from lua/plugins/cattpuccin.lua rename to lua/plugins/ui/cattpuccin.lua diff --git a/lua/plugins/ui/lualine.lua b/lua/plugins/ui/lualine.lua new file mode 100644 index 0000000..54a23c1 --- /dev/null +++ b/lua/plugins/ui/lualine.lua @@ -0,0 +1,60 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("lualine").setup({ + options = { + icons_enabled = true, + theme = "auto", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + refresh_time = 16, -- ~60fps + events = { + "WinEnter", + "BufEnter", + "BufWritePost", + "SessionLoadPost", + "FileChangedShellPost", + "VimResized", + "Filetype", + "CursorMoved", + "CursorMovedI", + "ModeChanged", + }, + }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename" }, + lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_y = { "lsp_status" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, + }) + end, +} diff --git a/lua/plugins/ui/tint.lua b/lua/plugins/ui/tint.lua new file mode 100644 index 0000000..43d965f --- /dev/null +++ b/lua/plugins/ui/tint.lua @@ -0,0 +1,6 @@ +return { + "levouh/tint.nvim", + config = function() + require("tint").setup() + end, +}