From 0846455551a71a01a430f8ab45c8a3f6f6e72401 Mon Sep 17 00:00:00 2001 From: servostar Date: Fri, 23 Feb 2024 19:23:02 +0100 Subject: [PATCH] added files for rework v1 --- init.lua | 22 ++- lua/bootstrap.lua | 38 ++++ lua/core/autocmds.lua | 3 - lua/core/bootstrap.lua | 117 ------------ lua/core/language-server.lua | 23 --- lua/core/options.lua | 59 ------ lua/{core => }/keymaps.lua | 12 +- lua/options.lua | 75 ++++++++ lua/plugins/aerial.lua | 43 ----- lua/plugins/barbecue.lua | 19 -- .../{indent-blankline.lua => blankline.lua} | 1 + lua/plugins/cokeline.lua | 76 ++++---- lua/plugins/coq.lua | 42 +++++ lua/plugins/dashboard.lua | 119 ------------ lua/plugins/dressing.lua | 42 ----- lua/plugins/gitsigns.lua | 30 ++-- lua/plugins/lsp.lua | 53 ++++++ lua/plugins/lualine.lua | 130 +++++--------- lua/plugins/luasnip.lua | 10 -- lua/plugins/mini-bufremove.lua | 5 - lua/plugins/navic.lua | 23 --- lua/plugins/neo-tree.lua | 65 ------- lua/plugins/neotree.lua | 67 +++++++ lua/plugins/noice.lua | 58 +++--- lua/plugins/nui.lua | 6 - lua/plugins/nvim-cmp.lua | 75 -------- lua/plugins/nvim-lspconfig.lua | 170 ------------------ lua/plugins/nvim-notify.lua | 35 ---- lua/plugins/nvim-scrollview.lua | 15 -- lua/plugins/nvim-ufo.lua | 25 --- lua/plugins/plenary.lua | 6 - lua/plugins/smart-splits.lua | 16 -- lua/plugins/statuscol.lua | 1 + lua/plugins/telescope.lua | 23 ++- lua/plugins/todo-comments.lua | 20 --- lua/plugins/toggleterm.lua | 15 -- lua/plugins/tokyonight.lua | 23 --- lua/plugins/treesitter.lua | 91 +++------- lua/plugins/trouble.lua | 9 - lua/plugins/ufo.lua | 25 --- lua/plugins/vim-fugitive.lua | 5 - lua/plugins/vim-illuminate.lua | 33 ---- lua/plugins/vscode-theme.lua | 11 ++ lua/plugins/which-key.lua | 32 ---- 44 files changed, 478 insertions(+), 1290 deletions(-) create mode 100644 lua/bootstrap.lua delete mode 100644 lua/core/autocmds.lua delete mode 100644 lua/core/bootstrap.lua delete mode 100644 lua/core/language-server.lua delete mode 100644 lua/core/options.lua rename lua/{core => }/keymaps.lua (63%) create mode 100644 lua/options.lua delete mode 100644 lua/plugins/aerial.lua delete mode 100644 lua/plugins/barbecue.lua rename lua/plugins/{indent-blankline.lua => blankline.lua} (99%) create mode 100644 lua/plugins/coq.lua delete mode 100644 lua/plugins/dashboard.lua delete mode 100644 lua/plugins/dressing.lua create mode 100644 lua/plugins/lsp.lua delete mode 100644 lua/plugins/luasnip.lua delete mode 100644 lua/plugins/mini-bufremove.lua delete mode 100644 lua/plugins/navic.lua delete mode 100644 lua/plugins/neo-tree.lua create mode 100644 lua/plugins/neotree.lua delete mode 100644 lua/plugins/nui.lua delete mode 100644 lua/plugins/nvim-cmp.lua delete mode 100644 lua/plugins/nvim-lspconfig.lua delete mode 100644 lua/plugins/nvim-notify.lua delete mode 100644 lua/plugins/nvim-scrollview.lua delete mode 100644 lua/plugins/nvim-ufo.lua delete mode 100644 lua/plugins/plenary.lua delete mode 100644 lua/plugins/smart-splits.lua delete mode 100644 lua/plugins/todo-comments.lua delete mode 100644 lua/plugins/toggleterm.lua delete mode 100644 lua/plugins/tokyonight.lua delete mode 100644 lua/plugins/trouble.lua delete mode 100644 lua/plugins/ufo.lua delete mode 100644 lua/plugins/vim-fugitive.lua delete mode 100644 lua/plugins/vim-illuminate.lua create mode 100644 lua/plugins/vscode-theme.lua delete mode 100644 lua/plugins/which-key.lua diff --git a/init.lua b/init.lua index 88801ba..86c62a8 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,18 @@ -require('core.options') -require('core.keymaps') -require('core.autocmds') -require("core.bootstrap") +require('bootstrap') +-- custom key maps +require('keymaps') + +-- load options +local options = require('options') + +-- set neovim options +for k, v in pairs(options.vim) do + vim.opt[k] = v +end + +-- apply color theme +local status, _ = pcall(vim.cmd, "colorscheme " .. options.ui.theme) +if not status then + print("Colorscheme not found: " .. options.ui.theme) -- Print an error message if the colorscheme is not installed + return +end diff --git a/lua/bootstrap.lua b/lua/bootstrap.lua new file mode 100644 index 0000000..310980c --- /dev/null +++ b/lua/bootstrap.lua @@ -0,0 +1,38 @@ +-- Bootstrap lazy.nvim plugin manager + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +local options = require("options") +require("lazy").setup({ + spec = { + { + import = "plugins" + } + }, + install = { + missing = options.lazy.install_missing, + colorscheme = { + options.ui.theme + } + }, + ui = { + size = { + width = options.ui.popup.width, + height = options.ui.popup.height + }, + border = options.ui.border, + wrap = true, + icons = options.lazy.icons, + } +}) diff --git a/lua/core/autocmds.lua b/lua/core/autocmds.lua deleted file mode 100644 index 27e9e06..0000000 --- a/lua/core/autocmds.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Autocmds are automatically loaded on the VeryLazy event --- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua --- Add any additional autocmds here diff --git a/lua/core/bootstrap.lua b/lua/core/bootstrap.lua deleted file mode 100644 index c498b45..0000000 --- a/lua/core/bootstrap.lua +++ /dev/null @@ -1,117 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath }) -end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) - -require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim" }, - -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, - -- { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, - -- import/override with your plugins - { import = "plugins" }, - }, - defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = false, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver - keymaps = true, - }, - -- install = { colorscheme = { "tokyonight" } }, - checker = { enabled = true }, -- automatically check for plugin updates - performance = { - rtp = { - -- disable some rtp plugins - disabled_plugins = { - "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, - icons = { - ft = "", - lazy = "󰂠 ", - loaded = "", - not_loaded = "", - misc = { - dots = "󰇘", - }, - dap = { - Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" }, - Breakpoint = " ", - BreakpointCondition = " ", - BreakpointRejected = { " ", "DiagnosticError" }, - LogPoint = ".>", - }, - diagnostics = { - Error = " ", - Warn = " ", - Hint = " ", - Info = " ", - }, - git = { - added = "+", - modified = "~", - removed = "-", - }, - kinds = { - Array = " ", - Boolean = "󰨙 ", - Class = " ", - Codeium = "󰘦 ", - Color = " ", - Control = " ", - Collapsed = " ", - Constant = "󰏿 ", - Constructor = " ", - Copilot = " ", - Enum = " ", - EnumMember = " ", - Event = " ", - Field = " ", - File = " ", - Folder = " ", - Function = "󰊕 ", - Interface = " ", - Key = " ", - Keyword = " ", - Method = "󰊕 ", - Module = " ", - Namespace = "󰦮 ", - Null = " ", - Number = "󰎠 ", - Object = " ", - Operator = " ", - Package = " ", - Property = " ", - Reference = " ", - Snippet = " ", - String = " ", - Struct = "󰆼 ", - TabNine = "󰏚 ", - Text = " ", - TypeParameter = " ", - Unit = " ", - Value = " ", - Variable = "󰀫 ", - }, - }, -}) diff --git a/lua/core/language-server.lua b/lua/core/language-server.lua deleted file mode 100644 index 772b866..0000000 --- a/lua/core/language-server.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - lua_ls = { - mason = false - }, - bashls = { - mason = false, - }, - clangd = { - mason = false - }, - arduino_language_server = { - mason = false - }, - pyright = { - mason = false - }, - html = { - mason = false - }, - gopls = { - mason = false - } -} diff --git a/lua/core/options.lua b/lua/core/options.lua deleted file mode 100644 index e855e72..0000000 --- a/lua/core/options.lua +++ /dev/null @@ -1,59 +0,0 @@ -local opt = vim.opt - -opt.swapfile = false -- disable swapfiles because they are fucking garbage -opt.autowrite = true -- Enable auto write -opt.clipboard = "unnamedplus" -- Sync with system clipboard -opt.completeopt = "menu,menuone,noselect" -opt.conceallevel = 3 -- Hide * markup for bold and italic -opt.confirm = true -- Confirm to save changes before exiting modified buffer -opt.cursorline = true -- Enable highlighting of the current line -opt.expandtab = true -- Use spaces instead of tabs -opt.formatoptions = "jcroqlnt" -- tcqj -opt.grepformat = "%f:%l:%c:%m" -opt.grepprg = "rg --vimgrep" -opt.ignorecase = true -- Ignore case -opt.inccommand = "nosplit" -- preview incremental substitute -opt.laststatus = 3 -- global statusline -opt.list = true -- Show some invisible characters (tabs... -opt.mouse = "a" -- Enable mouse mode -opt.number = true -- Print line number -opt.pumblend = 10 -- Popup blend -opt.pumheight = 10 -- Maximum number of entries in a popup -opt.relativenumber = false -- Relative line numbers -opt.scrolloff = 4 -- Lines of context -opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" } -opt.shiftround = true -- Round indent -opt.shiftwidth = 4 -- Size of an indent -opt.shortmess:append({ W = true, I = true, c = true, C = true }) -opt.showmode = false -- Dont show mode since we have a statusline -opt.sidescrolloff = 8 -- Columns of context -opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time -opt.smartcase = false -- Don't ignore case with capitals -opt.smartindent = true -- Insert indents automatically -opt.spelllang = { "en" } -opt.splitbelow = false -- Put new windows below current -opt.splitkeep = "screen" -opt.splitright = true -- Put new windows right of current -opt.tabstop = 4 -- Number of spaces tabs count for -opt.termguicolors = true -- True color support -opt.timeoutlen = 300 -opt.undofile = true -opt.foldcolumn = '1' -opt.foldlevel = 99 -opt.foldlevelstart = 99 -opt.showtabline = 2 -opt.foldenable = true -opt.undolevels = 10000 -opt.updatetime = 200 -- Save swap file and trigger CursorHold -opt.virtualedit = "block" -- Allow cursor to move where there is no text in visual block mode -opt.wildmode = "longest:full,full" -- Command-line completion mode -opt.winminwidth = 5 -- Minimum window width -opt.wrap = false -- Disable line wrap -opt.fillchars = { - foldopen = "", - foldclose = "", - fold = " ", - foldsep = " ", - diff = "╱", - eob = " ", -} diff --git a/lua/core/keymaps.lua b/lua/keymaps.lua similarity index 63% rename from lua/core/keymaps.lua rename to lua/keymaps.lua index e67d896..223c2f2 100644 --- a/lua/core/keymaps.lua +++ b/lua/keymaps.lua @@ -1,6 +1,6 @@ -local map = vim.keymap.set +-- Custom keymaps -map({ 'n', 'i' }, '', 'Telescope', { noremap = true }) +local map = vim.keymap.set -- save file on map({ "i", "x", "n", "s" }, "", "w", { desc = "Save file" }) @@ -8,8 +8,10 @@ map({ "i", "x", "n", "s" }, "", "w", { desc = "Save file" }) -- new file map("n", "", "enew", { desc = "New File" }) -map({ 'n', 'i' }, '', 'u') -map({ 'n', 'i' }, '', 'redo') +map({ 'n', 'i' }, '', 'u') -- undo with STRG + z +map({ 'n', 'i' }, '', 'redo') -- redo with STRG + y --- shift back command +-- Shift + Tab remove one tab map({ 'n', 'i' }, '', '<') + +map({ 'n', 'i' }, '', 'Telescope', { noremap = true }) diff --git a/lua/options.lua b/lua/options.lua new file mode 100644 index 0000000..0fcde68 --- /dev/null +++ b/lua/options.lua @@ -0,0 +1,75 @@ +return { + vim = { + swapfile = false, -- disable swap files cuz they are garbage + clipboard = "unnamedplus", -- Sync with system clipboard + expandtab = true, -- spaces instead of tabs + shiftwidth = 4, -- tab width in spaces + tabstop = 4, -- Number of spaces tabs count for + completeopt = "menu,menuone,noselect", + confirm = true, -- Confirm to save changes before exiting modified buffer + cursorline = true, -- Enable highlighting of the current line + ignorecase = true, -- Ignore case + laststatus = 3, -- global statusline + mouse = "a", -- Enable mouse mode + number = true, -- Print line number + pumblend = 0, -- Popup pseudo transparency + showmode = false, -- Dont show mode since we have a statusline + smartindent = true, -- Insert indents automatically + termguicolors = true, -- True color support + virtualedit = "block", -- Allow cursor to move where there is no text in visual block mode + wrap = false, + }, + ui = { + theme = "vscode", + border = "rounded", + popup = { + width = 0.6, + height = 0.8 + } + }, + lsp = { + icons = { + Error = " ", + Warn = " ", + Hint = " ", + Info = " ", + }, + }, + git = { + icons = { + add = "│", + change = "┆", + delete = "", + topdelete = "", + changedelete = "│", + untracked = "│" + }, + }, + lazy = { + install_missing = true, + icons = { + cmd = " ", + config = "", + event = "", + ft = " ", + init = " ", + import = " ", + keys = " ", + lazy = "󰒲 ", + loaded = "●", + not_loaded = "○", + plugin = " ", + runtime = " ", + require = "󰢱 ", + source = " ", + start = "", + task = "✔ ", + list = { + "●", + "➜", + "★", + "‒", + }, + }, + }, +} diff --git a/lua/plugins/aerial.lua b/lua/plugins/aerial.lua deleted file mode 100644 index e81bb8b..0000000 --- a/lua/plugins/aerial.lua +++ /dev/null @@ -1,43 +0,0 @@ -return { - { - "stevearc/aerial.nvim", - opts = { - backends = { - "treesitter", - "lsp", - "markdown", - "man", - }, - layout = { - default_direction = "prefer_right", - placement = "edge", - resize_to_content = true, - preserve_equality = true, - }, - -- Disable aerial on files with this many lines - disable_max_lines = 10000, - -- Disable aerial on files this size or larger (in bytes) - disable_max_size = 2000000, -- Default 2MB - filter_kind = false, - highlight_on_hover = true, - nerd_font = "auto", - update_events = "TextChanged,InsertLeave", - show_guides = true, - autojump = true, - guides = { - -- When the child item has a sibling below it - mid_item = "│ ", - -- When the child item is the last in the list - last_item = "└ ", - -- When there are nested child guides to the right - nested_top = "│ ", - -- Raw indentation - whitespace = " ", - }, - lsp = { - diagnostics_trigger_update = true, - update_when_errors = true, - }, - } - } -} diff --git a/lua/plugins/barbecue.lua b/lua/plugins/barbecue.lua deleted file mode 100644 index 4e1c8df..0000000 --- a/lua/plugins/barbecue.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - { - "utilyre/barbecue.nvim", - name = "barbecue", - version = "*", - dependencies = { - "SmiteshP/nvim-navic", - "nvim-tree/nvim-web-devicons", -- optional dependency - }, - opts = { - exclude_filetypes = { - "netrw", - "toggleterm", - "neo-tree", - "outline" - }, - }, - } -} diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/blankline.lua similarity index 99% rename from lua/plugins/indent-blankline.lua rename to lua/plugins/blankline.lua index a02443f..6df7a3c 100644 --- a/lua/plugins/indent-blankline.lua +++ b/lua/plugins/blankline.lua @@ -26,3 +26,4 @@ return { } }, } + diff --git a/lua/plugins/cokeline.lua b/lua/plugins/cokeline.lua index 9d4b5ef..2f6c28b 100644 --- a/lua/plugins/cokeline.lua +++ b/lua/plugins/cokeline.lua @@ -1,8 +1,9 @@ return { - { + { "willothy/nvim-cokeline", config = true, opts = { + fill_hl = "BufferInactive", show_if_buffers_are_at_least = 1, buffers = { focus_on_delete = "next", @@ -16,24 +17,21 @@ return { if buffer.is_focused then return "Normal" end - return "ColorColumn" + return "BufferInactive" end, fg = function(buffer) if buffer.is_focused then return "Normal" end - return "TabLine" - end, - bold = function(buffer) - return buffer.is_focused + return "BufferInactive" end, }, components = { { - text = function(buffer) - if buffer.is_focused then - return "▎" - end + text = ' ', + }, + { + text = function(_) return " " end, fg = "Normal" @@ -46,18 +44,18 @@ return { text = function(buffer) return ' ' .. buffer.filename .. ' ' end, }, { - text = function(buffer) - if buffer.is_modified then - return ' ' - elseif buffer.is_readonly then - return ' ' - else - return '' - end - end + text = ' ', }, { - text = '󰅖', + text = function(buffer) + if buffer.is_modified then + return '' + elseif buffer.is_readonly then + return '' + else + return '󰅖' + end + end, on_click = function(_, _, _, _, buffer) buffer:delete() end @@ -75,53 +73,47 @@ return { end, bg = function(tabpage) if tabpage.is_active then - return "TabLineSel" + return "Normal" end - return "ColorColumn" + return "BufferInactive" end, fg = function(tabpage) if tabpage.is_active then - return "TabLine" + return "Normal" end - return "Normal" - end, - bold = true + return "BufferInactive" + end }, { text = function(tabpage) if tabpage.is_active then - return "󰅖 " + return "󰅙 " end return "" end, on_click = function(_, _, _, _, tabpage) tabpage:close() end, - bg = function(tabpage) - if tabpage.is_active then - return "TabLineSel" - end - return "ColorColumn" - end, - fg = function(tabpage) - if tabpage.is_active then - return "TabLine" - end + bg = function(_) return "Normal" end, - bold = true - }, - } + fg = function(_) + return "Normal" + end + } + }, }, sidebar = { filetype = { "NvimTree", "neo-tree", "SidebarNvim" }, components = { { - text = "Explorer", - bg = "ColorColumn" + text = "", + bg = "Normal", + fg = "Normal" } }, }, } } } + diff --git a/lua/plugins/coq.lua b/lua/plugins/coq.lua new file mode 100644 index 0000000..4dbd91d --- /dev/null +++ b/lua/plugins/coq.lua @@ -0,0 +1,42 @@ +return { + { + "ms-jpq/coq_nvim", + branch = 'coq', + build = function(_) + vim.cmd("COQdeps") + end, + config = function(_,_) + vim.cmd("COQnow -s") + end, + init = function(_) + vim.g.coq_settings = { + display = { + ghost_text = { + enabled = true, + context = { "", "" }, + highlight_group = "CursorLineFold" + }, + pum = { + fast_close = false, + kind_context = { " ", " " }, + source_context = { "", " " }, + }, + icons = { + spacing = 1, + mode = "short" + }, + } + } + end, + dependencies = { + { + 'ms-jpq/coq.artifacts', + branch = "artifacts" + }, + { + "ms-jpq/coq.thirdparty", + branch = "3p" + } + } + } +} diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua deleted file mode 100644 index bc3dc68..0000000 --- a/lua/plugins/dashboard.lua +++ /dev/null @@ -1,119 +0,0 @@ -return { - { - "nvimdev/dashboard-nvim", - event = "VimEnter", - opts = function() - local logo = [[ - ⠀⠀⠀⢠⣤⣤⣤⣤⣤⣤⣤⠀⠀⠀⠀⠀⠀⠀⠀⣤⣤⣤⠀⣤⣤⡤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠ - ⠀⠀⠀⣾⣿⡿⠿⠿⠿⠿⠇⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⡇⢸⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⡟ - ⠀⠀⢰⣿⣿⠃⠀⠀⠀⠀⠀⣀⣀⣀⣀⡀⠀⠀⣼⣿⣿⠀⣿⣿⡿⠀⠀⣀⣀⡀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⠃ - ⠀⠀⣿⣿⡟⠀⠀⠀⠀⢰⣿⣿⡟⢻⣿⣿⡆⢀⣿⣿⡇⢸⣿⣿⠃⢰⣿⣿⠋⢀⣿⣿⡆⢸⣿⣿⠃⠀⣿⣿⡟⢰⣿⣿⣿⣿⣿ - ⠀⢠⣿⣿⣿⣶⣶⣶⠀⠿⠿⠿⠀⢸⣿⣿⠃⣼⣿⣿⠁⣾⣿⡿⠀⣿⡿⠃⢀⣾⣿⣿⠁⣾⣿⡿⠀⢰⣿⣿⠃⠀⣼⣿⣿⠃⠀ - ⠀⣾⣿⡿⠛⠛⠛⠃⠀⣠⣤⣴⣴⣿⣿⡟⢠⣿⣿⡏⢰⣿⣿⠃⡸⠋⠀⠀⠚⠛⠛⡋⢰⣿⣿⠃⠀⣿⣿⡟⠀⢠⣿⣿⡟⠀⠀ - ⢰⣿⣿⠇⠀⠀⠀⢀⣾⣿⡟⠉⣹⣿⣿⠁⣼⣿⣿⠁⣾⣿⡟⢠⣥⣤⣤⠄⠀⢀⣼⠁⣾⣿⡟⠀⣸⣿⣿⠃⠀⣼⣿⣿⠃⠀⠀ - ⣼⣿⣿⠀⠀⠀⠀⢸⣿⣿⠇⠀⣿⣿⡿⢠⣿⣿⡇⢸⣿⣿⠇⣸⣿⣿⡏⠀⢀⣿⡏⢸⣿⣿⡇⠀⣿⣿⡿⠀⢠⣿⣿⡏⠀⠀⠀ - ⣿⣿⡇⠀⠀⠀⠀⣿⣿⣿⣶⣾⣿⣿⠃⣼⣿⣿⠁⣾⣿⡿⠀⢿⣿⣿⠁⣰⣿⡿⠀⢸⣿⣿⣷⣾⣿⣿⠃⠀⢸⣿⣿⣷⡆⠀⠀ - ⠉⠀⠀⠀⠀⠀⠈⠙⠉⠀⠉⠉⠉⠀⠉⠉⠁⠀⠉⠉⠁⠀⠀⠉⢁⠞⠉⠁⠀⠀⠈⠉⠉⠀⠉⠉⠉⠀⠀⠀⠉⠉⠉⠁⠀⠀ - ]] - - logo = string.rep("\n", 8) .. logo .. "\n\n" - - local opts = { - theme = "doom", - hide = { - -- this is taken care of by lualine - -- enabling this messes up the actual laststatus setting after loading a file - statusline = false, - tabline = true, - winbar = true - }, - config = { - header = vim.split(logo, "\n"), - -- stylua: ignore - center = { - { - action = "Telescope find_files", - desc = " Find file", - icon = - " ", - key = - "f" - }, - { - action = "ene | startinsert", - desc = " New file", - icon = - " ", - key = - "n" - }, - { - action = "Telescope oldfiles", - desc = " Recent files", - icon = - " ", - key = - "r" - }, - { - action = [[lua require("lazyvim.util").telescope.config_files()()]], - desc = " Config", - icon = - " ", - key = - "c" - }, - { - action = 'lua require("persistence").load()', - desc = " Restore Session", - icon = - " ", - key = - "s" - }, - { - action = "Lazy", - desc = " Lazy", - icon = - "󰒲 ", - key = - "l" - }, - { - action = "qa", - desc = " Quit", - icon = - " ", - key = - "q" - }, - }, - footer = function() - local stats = require("lazy").stats() - local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) - return { "⚡ Neovim loaded " .. - stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" } - end, - }, - } - - for _, button in ipairs(opts.config.center) do - button.desc = button.desc .. string.rep(" ", 43 - #button.desc) - button.key_format = " %s" - end - - -- close Lazy and re-open when the dashboard is ready - if vim.o.filetype == "lazy" then - vim.cmd.close() - vim.api.nvim_create_autocmd("User", { - pattern = "DashboardLoaded", - callback = function() - require("lazy").show() - end, - }) - end - - return opts - end, - } -} diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua deleted file mode 100644 index 39dff23..0000000 --- a/lua/plugins/dressing.lua +++ /dev/null @@ -1,42 +0,0 @@ -return { - { - "stevearc/dressing.nvim", - opts = { - input = { - enabled = true, - -- When true, will close the modal - insert_only = true, - -- These are passed to nvim_open_win - border = "rounded", - -- 'editor' and 'win' will default to being centered - relative = "cursor", - mappings = { - n = { - [""] = "Close", - [""] = "Confirm", - }, - i = { - [""] = "Close", - [""] = "Confirm", - [""] = "HistoryPrev", - [""] = "HistoryNext", - }, - }, - }, - select = { - -- Set to false to disable the vim.ui.select implementation - enabled = true, - nui = { - border = { - style = "rounded", - }, - } - }, - builtin = { - border = "rounded", - -- 'editor' and 'win' will default to being centered - relative = "editor", - } - } - } -} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 298cb55..7e7a977 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,19 +1,23 @@ return { { "lewis6991/gitsigns.nvim", - opts = { - signs = { - add = { text = "│" }, - change = { text = "┆" }, - delete = { text = "" }, - topdelete = { text = "" }, - changedelete = { text = "│" }, - untracked = { text = "│" }, - }, - signcolumn = true, - preview_config = { - border = 'single' + opts = function() + local options = require('options') + return { + signs = { + add = { text = options.git.icons.add }, + change = { text = options.git.icons.change }, + delete = { text = options.git.icons.delete }, + topdelete = { text = options.git.icons.topdelete }, + changedelete = { text = options.git.icons.changedelete }, + untracked = { text = options.git.icons.untracked }, + }, + signcolumn = true, + preview_config = { + border = 'rounded' + } } - } + end } } + diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..8731425 --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,53 @@ +return { + { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim" + }, + opts = { + diagnostics = { + underline = true, + update_in_insert = true, + virtual_text = { + spacing = 4, + source = "if_many", + prefix = "●", + }, + severity_sort = true, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = require("options").lsp.icons.Error, + [vim.diagnostic.severity.WARN] = require("options").lsp.icons.Warn, + [vim.diagnostic.severity.HINT] = require("options").lsp.icons.Hint, + [vim.diagnostic.severity.INFO] = require("options").lsp.icons.Info, + }, + }, + }, + }, + config = function(_, opts) + local options = require("options") + + require("mason").setup() + require("mason-lspconfig").setup() + + -- automatically register lsp handler installed with mason + require("mason-lspconfig").setup_handlers { + -- The first entry (without a key) will be the default handler + -- and will be called for each installed server that doesn't have + -- a dedicated handler. + function (server_name) -- default handler (optional) + require("lspconfig")[server_name].setup {} + end, + } + + -- set custom icons + for name, icon in pairs(options.lsp.icons) do + name = "DiagnosticSign" .. name + vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + end + + vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) + end + } +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 0500bb5..4ca3bae 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,104 +1,66 @@ -local icons = require("lazyvim.config").icons - return { { "nvim-lualine/lualine.nvim", - opts = { + opts = function() + local options = require('options') + return { options = { - theme = 'tokyonight', - icons_enabled = true, - globalstatus = true, - section_separators = { left = '', right = '' }, - component_separators = { left = ' ', right = ' ' }, - disabled_filetypes = { - statusline = { - 'help', - 'startify', - 'dashboard', - 'packer', - 'neogitstatus', - -- 'NvimTree', - 'Trouble', - 'alpha', - 'lir', - 'Outline', - 'neo-tree', - 'spectre_panel', - 'toggleterm', - 'qf', - }, - winbar = { - 'help', - 'startify', - 'dashboard', - 'packer', - 'neogitstatus', - 'NvimTree', - 'neo-tree', - 'Trouble', - 'alpha', - 'lir', - 'Outline', - 'spectre_panel', - 'toggleterm', - 'qf', - } - }, + theme = "vscode", + component_separators = { left = '', right = '' }, }, sections = { - lualine_a = { 'mode' }, + lualine_a = { + 'mode', + }, lualine_b = { { 'branch', - on_click = function(_, _) - vim.defer_fn(function() - vim.cmd("LazyGit") - end, 100) - end - } - }, - lualine_c = { + }, { 'diff', symbols = { added = '+', modified = '~', removed = '-', - }, - colored = true, - on_click = function(_, _) - vim.defer_fn(function() - vim.cmd("Gitsigns diffthis") - end, 100) - end + } }, { - "diagnostics", - sources = { 'nvim_diagnostic' }, + 'diagnostics', symbols = { - error = icons.diagnostics.Error, - warn = icons.diagnostics.Warn, - info = icons.diagnostics.Info, - hint = icons.diagnostics.Hint, + error = options.lsp.icons.Error, + warn = options.lsp.icons.Warn, + info = options.lsp.icons.Info, + hint = options.lsp.icons.Hint, }, - colored = true, - on_click = function(_, _) - require("trouble").toggle({ mode = "document_diagnostics" }) - end - }, + sources = { + 'nvim_diagnostic' + }, + update_in_insert = true + } + }, + lualine_c = { { 'filename', - file_status = true, - path = 0, symbols = { modified = '[+]', -- Text to show when the file is modified. readonly = '[-]', -- Text to show when the file is non-modifiable or readonly. - unnamed = '[No Name]', -- Text to show for unnamed buffers. - newfile = '[New]', -- Text to show for newly created file before first write + unnamed = '', -- Text to show for unnamed buffers. + newfile = '[New]', -- Text to show for newly created file before first write } - }, + } }, lualine_x = { + { + function () + local client_id = vim.lsp.get_client_by_id(1) + return ' ' .. client_id.name + end, + on_click = function () + vim.defer_fn(function() + vim.cmd("LspInfo") + end, 100) + end + }, 'encoding', 'fileformat', { @@ -111,14 +73,18 @@ return { end } }, - lualine_y = { 'progress' }, - lualine_z = { 'location' }, + lualine_y = {'progress'}, + lualine_z = {'location'} }, - }, - dependencies = { - 'nvim-tree/nvim-web-devicons', - "SmiteshP/nvim-navic", - 'kdheepak/lazygit.nvim' + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + } } - }, + end + } } diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua deleted file mode 100644 index edbee50..0000000 --- a/lua/plugins/luasnip.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - { - "L3MON4D3/LuaSnip", - opts = { - history = true, - delete_check_events = "TextChanged", - } - } -} - diff --git a/lua/plugins/mini-bufremove.lua b/lua/plugins/mini-bufremove.lua deleted file mode 100644 index 750b5a2..0000000 --- a/lua/plugins/mini-bufremove.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - { - "echasnovski/mini.bufremove", - }, -} \ No newline at end of file diff --git a/lua/plugins/navic.lua b/lua/plugins/navic.lua deleted file mode 100644 index 28259aa..0000000 --- a/lua/plugins/navic.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - { - "SmiteshP/nvim-navic", - lazy = true, - init = function() - vim.g.navic_silence = true - require("lazyvim.util").lsp.on_attach(function(client, buffer) - if client.supports_method("textDocument/documentSymbol") then - require("nvim-navic").attach(client, buffer) - end - end) - end, - opts = function() - return { - separator = " ", - highlight = true, - depth_limit = 5, - icons = require("lazyvim.config").icons.kinds, - lazy_update_context = true, - } - end, - } -} diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua deleted file mode 100644 index 9937a01..0000000 --- a/lua/plugins/neo-tree.lua +++ /dev/null @@ -1,65 +0,0 @@ -return { - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information - }, - opts = { - popup_border_style = "rounded", - close_if_last_window = true, - enable_git_status = true, - enable_diagnostics = true, - open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes - default_component_configs = { - indent = { - indent_size = 2, - padding = 1, -- extra padding on left hand side - -- indent guides - with_markers = true, - indent_marker = "│", - last_indent_marker = "└", - highlight = "NeoTreeIndentMarker", - -- expander config, needed for nesting files - with_expanders = true, -- if nil and file nesting is enabled, will enable expanders - expander_collapsed = "", - expander_expanded = "", - expander_highlight = "NeoTreeExpander", - }, - git_status = { - symbols = { - -- Change type - added = "+", -- or "✚", but this is redundant info if you use git_status_colors on the name - modified = "M", -- or "", but this is redundant info if you use git_status_colors on the name - deleted = "D", -- this can only be used in the git_status source - renamed = "󰁕", -- this can only be used in the git_status source - -- Status type - untracked = "", - ignored = "", - unstaged = "U", - staged = "S", - conflict = " ", - } - }, - modified = { - symbol = "+", - highlight = "NeoTreeModified", - }, - buffers = { - follow_current_file = { - enabled = true, - }, - }, - }, - filesystem = { - use_libuv_file_watcher = true, - follow_current_file = { - enabled = true - } - } - } - } -} diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua new file mode 100644 index 0000000..13d9ad3 --- /dev/null +++ b/lua/plugins/neotree.lua @@ -0,0 +1,67 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim" + }, + opts = function(_,_) + local options = require("options") + + return { + popup_border_style = options.ui.border, + default_component_configs = { + container = { + enable_character_fade = true + }, + indent = { + indent_size = 2, + padding = 1, -- extra padding on left hand side + -- indent guides + with_markers = false, + with_expanders = true, -- if nil and file nesting is enabled, will enable expanders + expander_collapsed = "", + expander_expanded = "", + expander_highlight = "NeoTreeExpander", + }, + modified = { + symbol = "", + }, + git_status = { + symbols = { + -- Change type + added = "A", -- or "✚", but this is redundant info if you use git_status_colors on the name + modified = "M", -- or "", but this is redundant info if you use git_status_colors on the name + deleted = "D",-- this can only be used in the git_status source + renamed = "R",-- this can only be used in the git_status source + -- Status type + untracked = "U", + ignored = "", + unstaged = "", + staged = "S", + conflict = "C", + } + } + }, + window = { + position = "left", + width = 40 + }, + filesystem = { + filtered_items = { + visible = true, + hide_dotfiles = false, + hide_gitignored = false, + hide_hidden = false, + }, + follow_current_file = { + enabled = true, + leave_dirs_open = true + } + } + } + end + } +} diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua index 4690885..e875dad 100644 --- a/lua/plugins/noice.lua +++ b/lua/plugins/noice.lua @@ -1,35 +1,39 @@ return { - { + { "folke/noice.nvim", event = "VeryLazy", - opts = { - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - }, - routes = { - { - filter = { - event = "msg_show", - any = { - { find = "%d+L, %d+B" }, - { find = "; after #%d+" }, - { find = "; before #%d+" }, + dependencies = { + "rcarriga/nvim-notify", -- fancy notifications + "MunifTanjim/nui.nvim", -- gui component library + }, + opts = function(_,_) + local options = require("options") + return { + cmdline = { + enabled = true, + format = { + cmdline = { + pattern = "^:", + icon = " ", + lang = "vim" }, }, - view = "mini", + opts = { + win_options = { + winhighlight = { + FloatBorder = "LspInfoBorder" + } + }, + position = { + row = 5, + col = "50%", + }, + } }, - }, - presets = { - bottom_search = true, - command_palette = true, - long_message_to_split = true, - inc_rename = true, - lsp_doc_border = true, - }, - }, + views = { + + } + } + end } } diff --git a/lua/plugins/nui.lua b/lua/plugins/nui.lua deleted file mode 100644 index 603b907..0000000 --- a/lua/plugins/nui.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - { - "MunifTanjim/nui.nvim", - lazy = true, - } -} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua deleted file mode 100644 index 3c83810..0000000 --- a/lua/plugins/nvim-cmp.lua +++ /dev/null @@ -1,75 +0,0 @@ -return { - { - "hrsh7th/nvim-cmp", - opts = function() - vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) - local cmp = require("cmp") - local defaults = require("cmp.config.default")() - return { - window = { - completion = { - border = "rounded", - scrollbar = false, - winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenu,Search:None" - }, - documentation = { - border = "rounded", - scrollbar = false, - winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenu,Search:None" - }, - }, - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = function(fallback) - cmp.abort() - fallback() - end, - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "path" }, - }, { - { name = "buffer" }, - }), - formatting = { - format = function(_, item) - local icons = require("lazyvim.config").icons.kinds - if icons[item.kind] then - item.kind = icons[item.kind] .. item.kind - end - return item - end, - }, - experimental = { - ghost_text = { - hl_group = "CmpGhostText", - }, - }, - sorting = defaults.sorting, - } - end, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - 'hrsh7th/cmp-cmdline', - "saadparwaiz1/cmp_luasnip", - } - } -} diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua deleted file mode 100644 index 98e1d15..0000000 --- a/lua/plugins/nvim-lspconfig.lua +++ /dev/null @@ -1,170 +0,0 @@ -return { - { - "neovim/nvim-lspconfig", - dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim" - }, - ---@class PluginLspOpts - opts = { - -- options for vim.diagnostic.config() - diagnostics = { - underline = true, - update_in_insert = false, - virtual_text = { - spacing = 4, - source = "if_many", - prefix = "●", - -- this will set set the prefix to a function that returns the diagnostics icon based on the severity - -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported - -- prefix = "icons", - }, - severity_sort = true, - float = { - border = "rounded" - } - }, - -- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0 - -- Be aware that you also will need to properly configure your LSP server to - -- provide the inlay hints. - inlay_hints = { - enabled = false, - }, - -- add any global capabilities here - capabilities = {}, - -- options for vim.lsp.buf.format - -- `bufnr` and `filter` is handled by the LazyVim formatter, - -- but can be also overridden when specified - format = { - formatting_options = nil, - timeout_ms = nil, - }, - servers = require("core.language-server"), - setup = { - } - }, - ---@param opts PluginLspOpts - config = function(_, opts) - local Util = require("lazyvim.util") - if Util.has("neoconf.nvim") then - local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"] - require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false)) - end - - -- setup autoformat - Util.format.register(Util.lsp.formatter()) - - -- deprectaed options - if opts.autoformat ~= nil then - vim.g.autoformat = opts.autoformat - Util.deprecate("nvim-lspconfig.opts.autoformat", "vim.g.autoformat") - end - - -- setup keymaps - Util.lsp.on_attach(function(client, buffer) - require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) - end) - - local register_capability = vim.lsp.handlers["client/registerCapability"] - - vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx) - local ret = register_capability(err, res, ctx) - local client_id = ctx.client_id - ---@type lsp.Client - local client = vim.lsp.get_client_by_id(client_id) - local buffer = vim.api.nvim_get_current_buf() - require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) - return ret - end - - -- diagnostics - for name, icon in pairs(require("lazyvim.config").icons.diagnostics) do - name = "DiagnosticSign" .. name - vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) - end - - local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint - - if opts.inlay_hints.enabled and inlay_hint then - Util.lsp.on_attach(function(client, buffer) - if client.supports_method("textDocument/inlayHint") then - inlay_hint(buffer, true) - end - end) - end - - if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then - opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" - or function(diagnostic) - local icons = require("lazyvim.config").icons.diagnostics - for d, icon in pairs(icons) do - if diagnostic.severity == vim.diagnostic.severity[d:upper()] then - return icon - end - end - end - end - - vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) - - local servers = opts.servers - local has_cmp, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") - local capabilities = vim.tbl_deep_extend( - "force", - {}, - vim.lsp.protocol.make_client_capabilities(), - has_cmp and cmp_nvim_lsp.default_capabilities() or {}, - opts.capabilities or {} - ) - - local function setup(server) - local server_opts = vim.tbl_deep_extend("force", { - capabilities = vim.deepcopy(capabilities), - }, servers[server] or {}) - - if opts.setup[server] then - if opts.setup[server](server, server_opts) then - return - end - elseif opts.setup["*"] then - if opts.setup["*"](server, server_opts) then - return - end - end - require("lspconfig")[server].setup(server_opts) - end - - -- get all the servers that are available through mason-lspconfig - local have_mason, mlsp = pcall(require, "mason-lspconfig") - local all_mslp_servers = {} - if have_mason then - all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package) - end - - local ensure_installed = {} ---@type string[] - for server, server_opts in pairs(servers) do - if server_opts then - server_opts = server_opts == true and {} or server_opts - -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig - if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then - setup(server) - else - ensure_installed[#ensure_installed + 1] = server - end - end - end - - if have_mason then - mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } }) - end - - if Util.lsp.get_config("denols") and Util.lsp.get_config("tsserver") then - local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc") - Util.lsp.disable("tsserver", is_deno) - Util.lsp.disable("denols", function(root_dir) - return not is_deno(root_dir) - end) - end - end, - } -} diff --git a/lua/plugins/nvim-notify.lua b/lua/plugins/nvim-notify.lua deleted file mode 100644 index eadc7aa..0000000 --- a/lua/plugins/nvim-notify.lua +++ /dev/null @@ -1,35 +0,0 @@ -return { - { - "rcarriga/nvim-notify", - keys = { - { - "un", - function() - require("notify").dismiss({ silent = true, pending = true }) - end, - desc = "Dismiss all Notifications", - }, - }, - opts = { - timeout = 3000, - max_height = function() - return math.floor(vim.o.lines * 0.75) - end, - max_width = function() - return math.floor(vim.o.columns * 0.75) - end, - on_open = function(win) - vim.api.nvim_win_set_config(win, { zindex = 100 }) - end, - }, - init = function() - local Util = require("lazyvim.util") - -- when noice is not enabled, install notify on VeryLazy - if not Util.has("noice.nvim") then - Util.on_very_lazy(function() - vim.notify = require("notify") - end) - end - end, - } -} diff --git a/lua/plugins/nvim-scrollview.lua b/lua/plugins/nvim-scrollview.lua deleted file mode 100644 index 79ac62d..0000000 --- a/lua/plugins/nvim-scrollview.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - { - "dstein64/nvim-scrollview", - opts = { - excluded_filetypes = { - 'dashboard' - }, - signs_on_startup = { - 'conflicts', - 'search', - 'cursor' - }, - } - } -} diff --git a/lua/plugins/nvim-ufo.lua b/lua/plugins/nvim-ufo.lua deleted file mode 100644 index da4e99a..0000000 --- a/lua/plugins/nvim-ufo.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - { - "kevinhwang91/nvim-ufo", - event = { - "InsertEnter" - }, - dependencies = { - "kevinhwang91/promise-async" - }, - opts = { - preview = { - mappings = { - scrollB = "", - scrollF = "", - scrollU = "", - scrollD = "", - }, - }, - -- register treesitter as source for scopes - provider_selector = function(bufnr, filetype, buftype) - return {'treesitter', 'indent'} - end - } - } -} diff --git a/lua/plugins/plenary.lua b/lua/plugins/plenary.lua deleted file mode 100644 index 894ed2a..0000000 --- a/lua/plugins/plenary.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - { - 'nvim-lua/plenary.nvim' - } -} - diff --git a/lua/plugins/smart-splits.lua b/lua/plugins/smart-splits.lua deleted file mode 100644 index ad5d5f9..0000000 --- a/lua/plugins/smart-splits.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - { - "mrjones2014/smart-splits.nvim", - opts = { - ignored_filetypes = { - "nofile", - "quickfix", - "qf", - "prompt" - }, - ignored_buftypes = { - "nofile" - } - }, - } -} diff --git a/lua/plugins/statuscol.lua b/lua/plugins/statuscol.lua index 344874b..a91a025 100644 --- a/lua/plugins/statuscol.lua +++ b/lua/plugins/statuscol.lua @@ -41,3 +41,4 @@ return { end, } } + diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 7f6b1a6..3d6f91d 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,18 +1,23 @@ return { { "nvim-telescope/telescope.nvim", - opts = { - defaults = { - layout_strategy = "horizontal", - layout_config = { prompt_position = "top" }, - sorting_strategy = "ascending", - winblend = 0, - }, - }, dependencies = { "sharkdp/fd", "nvim-lua/plenary.nvim", 'nvim-tree/nvim-web-devicons' }, + opts = { + defaults = { + layout_strategy = "horizontal", + layout_config = { + prompt_position = "top" + }, + sorting_strategy = "ascending", + winblend = 0, + }, + extensions = { + } + } }, -} \ No newline at end of file +} + diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua deleted file mode 100644 index b184eef..0000000 --- a/lua/plugins/todo-comments.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - cmd = { "TodoTrouble", "TodoTelescope" }, - config = true, - keys = { - { "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" }, - { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" }, - { "xt", "TodoTrouble", desc = "Todo (Trouble)" }, - { "xT", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme (Trouble)" }, - { "st", "TodoTelescope", desc = "Todo" }, - { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, - }, - ops = { - signs = true, - sign_priority = 8, -- sign priority - } - } -} diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua deleted file mode 100644 index 1ce0418..0000000 --- a/lua/plugins/toggleterm.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - { - "akinsho/toggleterm.nvim", - opts = { - open_mapping = '', - start_in_insert = true, - direction = 'float', - shade_terminals = true, - shading_factor = -30, - float_opts = { - border = 'curved', - }, - }, - }, -} diff --git a/lua/plugins/tokyonight.lua b/lua/plugins/tokyonight.lua deleted file mode 100644 index 6d79c71..0000000 --- a/lua/plugins/tokyonight.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - { - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - opts = { - style = "night", - transparent = false, - styles = { - sidebars = "dark", - floats = "normal", - }, - sidebars = { "qf", "help", "neo-tree", "aerial" }, - }, - }, - -- Configure LazyVim to load tokyonight - { - "LazyVim/LazyVim", - opts = { - colorscheme = "tokyonight", - }, - } -} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 2bdba20..72bebc7 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,83 +1,34 @@ return { { "nvim-treesitter/nvim-treesitter", - version = false, -- last release is way too old and doesn't work on Windows build = ":TSUpdate", - dependencies = { - "nvim-treesitter/nvim-treesitter-textobjects", - }, - cmd = { - "TSUpdateSync", - "TSUpdate", - "TSInstall" + event = { + "VeryLazy" }, + init = function(plugin) + -- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early + -- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which + -- no longer trigger the **nvim-treeitter** module to be loaded in time. + -- Luckily, the only thins that those plugins need are the custom queries, which we make available + -- during startup. + require("lazy.core.loader").add_to_rtp(plugin) + require("nvim-treesitter.query_predicates") + end, opts = { - autotag = { - enable = true - }, + auto_install = true, highlight = { - enable = true - }, - indent = { - enable = true - }, - ensure_installed = { - "bash", - "c", - "diff", - "html", - "javascript", - "jsdoc", - "json", - "jsonc", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "toml", - "tsx", - "typescript", - "vim", - "vimdoc", - "xml", - "yaml", - }, - incremental_selection = { enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", - }, - }, - textobjects = { - move = { - enable = true, - goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" }, - goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" }, - goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" }, - goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" }, - }, - }, + disable = function(_, buf) + local max_filesize = 1000 * 1024 -- 1 MB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + } }, config = function(_, opts) - if type(opts.ensure_installed) == "table" then - ---@type table - local added = {} - opts.ensure_installed = vim.tbl_filter(function(lang) - if added[lang] then - return false - end - added[lang] = true - return true - end, opts.ensure_installed) - end require("nvim-treesitter.configs").setup(opts) - end, + end } } diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua deleted file mode 100644 index 5a25a61..0000000 --- a/lua/plugins/trouble.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - "folke/trouble.nvim", - opts = { - use_diagnostic_signs = true - }, - } -} - diff --git a/lua/plugins/ufo.lua b/lua/plugins/ufo.lua deleted file mode 100644 index 469c7ce..0000000 --- a/lua/plugins/ufo.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - { - "kevinhwang91/nvim-ufo", - event = { - "InsertEnter" - }, - dependencies = { - "kevinhwang91/promise-async" - }, - opts = { - preview = { - mappings = { - scrollB = "", - scrollF = "", - scrollU = "", - scrollD = "", - }, - }, - -- register treesitter as source for scopes - provider_selector = function(_, _, _) - return { 'treesitter', 'indent' } - end - } - } -} diff --git a/lua/plugins/vim-fugitive.lua b/lua/plugins/vim-fugitive.lua deleted file mode 100644 index c17bbba..0000000 --- a/lua/plugins/vim-fugitive.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - { - "tpope/vim-fugitive", - } -} diff --git a/lua/plugins/vim-illuminate.lua b/lua/plugins/vim-illuminate.lua deleted file mode 100644 index 04169c8..0000000 --- a/lua/plugins/vim-illuminate.lua +++ /dev/null @@ -1,33 +0,0 @@ -return { - { - "RRethy/vim-illuminate", - opts = { - delay = 200, - large_file_cutoff = 2000, - large_file_overrides = { - providers = { "lsp" }, - }, - }, - config = function(_, opts) - require("illuminate").configure(opts) - - local function map(key, dir, buffer) - vim.keymap.set("n", key, function() - require("illuminate")["goto_" .. dir .. "_reference"](false) - end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer }) - end - - map("]]", "next") - map("[[", "prev") - - -- also set it after loading ftplugins, since a lot overwrite [[ and ]] - vim.api.nvim_create_autocmd("FileType", { - callback = function() - local buffer = vim.api.nvim_get_current_buf() - map("]]", "next", buffer) - map("[[", "prev", buffer) - end, - }) - end, - } -} diff --git a/lua/plugins/vscode-theme.lua b/lua/plugins/vscode-theme.lua new file mode 100644 index 0000000..c340379 --- /dev/null +++ b/lua/plugins/vscode-theme.lua @@ -0,0 +1,11 @@ +return { + { + "Mofiqul/vscode.nvim", + priority = 1, + opts = { + style = "dark", + transparent = false, + italic_comments = false + } + } +} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua deleted file mode 100644 index fef4d12..0000000 --- a/lua/plugins/which-key.lua +++ /dev/null @@ -1,32 +0,0 @@ -return { - { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - plugins = { spelling = true }, - defaults = { - mode = { "n", "v" }, - ["g"] = { name = "+goto" }, - ["gs"] = { name = "+surround" }, - ["]"] = { name = "+next" }, - ["["] = { name = "+prev" }, - [""] = { name = "+tabs" }, - ["b"] = { name = "+buffer" }, - ["c"] = { name = "+code" }, - ["f"] = { name = "+file/find" }, - ["g"] = { name = "+git" }, - ["gh"] = { name = "+hunks" }, - ["q"] = { name = "+quit/session" }, - ["s"] = { name = "+search" }, - ["u"] = { name = "+ui" }, - ["w"] = { name = "+windows" }, - ["x"] = { name = "+diagnostics/quickfix" }, - }, - }, - config = function(_, opts) - local wk = require("which-key") - wk.setup(opts) - wk.register(opts.defaults) - end, - } -} \ No newline at end of file