commit 95dc3b686ad55b50272e8f1d74af0cbbc3f477b8 Author: faumaray Date: Fri Apr 17 00:23:01 2026 +0300 initial Signed-off-by: faumaray diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..154f3e1 --- /dev/null +++ b/init.lua @@ -0,0 +1,27 @@ +--[[ + File: init.lua + Description: Entry point file for neovim +]] + +vim.g.mapleader = ' ' -- Use Space, like key for alternative hotkeys + +-- Bootsraping plugin manager +vim.pack.add({ 'https://github.com/zuqini/zpack.nvim' }) + + +-- Settings +require "settings" +require('zpack').setup() + +vim.opt.background = "dark" -- set this to dark or light +vim.cmd("colorscheme teide-darker") +require "keyboard" + +vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*", + callback = function(args) + require("conform").format({ bufnr = args.buf }) + end, +}) +vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" +-- vim:tabstop=2 shiftwidth=2 expandtab syntax=lua foldmethod=marker foldlevelstart=0 foldlevel=0 \ No newline at end of file diff --git a/lua/defaults.lua b/lua/defaults.lua new file mode 100644 index 0000000..2b1cd5d --- /dev/null +++ b/lua/defaults.lua @@ -0,0 +1,59 @@ +return { + -- icons used by other plugins + icons = { + debugger = { + DapBreakpoint = "î®› ", --â–¶ï¸�breakpoints + DapBreakpointCondition = " ", --conditional breakpoints + DapLogPoint = " ", --log points + DapStopped = " ", --🟥indicate where the debugee is stopped + DapBreakpointRejected = " ", --indicate breakpoints rejected by the debug + }, + git = { + add = { text = "│" }, --" ","â–Ž" + change = { text = "!" }, --"ï…‹ ", + delete = { text = "_" }, --"ï…† ","" + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + untracked = { text = "┆" }, + }, + kinds = { + Array = " ", + Boolean = "îª� ", + Class = "î­› ", --"ó° ± ", + Color = "î­œ ", --"ó°�˜ ", "󰸌 " + Constant = " ", + Constructor = "ï�£", + Copilot = " ", + Enum = " ", + EnumMember = "ï…�", + Event = " ", --"", + Field = "ó°„¶ ", --"󰘻 ","ó°„· " + File = "󰈙", -- ó°·ˆ 󱪗 ó±ª� + Folder = "ï�» ", --󰉋  + Function = "ó°Š•", --"ó°¡± " + Interface = "î­¡ ", --"", + Keyword = "󰌋 ", --"󱕵" + Method = "󰆧 ", + Module = " ", + Namespace = " ", + Null = " ", + Number = "îª� ", + Object = " ", + Operator = "î­¤ ", --"󰆕", + Package = "ó°�— ", + Property = "î­¥ ", --" ",󱉯 + Reference = " ", --"ï’�", + Snippet = "ï‘� ", + String = "î®� ", + Struct = " ", --" ", + Text = "ó°Š„ ", --" ",ó°šž + TypeParameter = " ", + Unit = " ", --"", + Value = "ó°Ž ", + Variable = "󰘛 ", + }, + }, + -- options from nvim_open_win()| vim.diagnostic.open_float() + -- | vim.lsp.util.open_floating_preview()| vim.diagnostic.config() + ---@type table +} diff --git a/lua/helpers/globals.lua b/lua/helpers/globals.lua new file mode 100644 index 0000000..c65233b --- /dev/null +++ b/lua/helpers/globals.lua @@ -0,0 +1,7 @@ +cmd = vim.cmd; -- Command function +api = vim.api; -- Neovim API +lsp = vim.lsp; -- LSP API +fn = vim.fn; -- Vim function +g = vim.g; -- Vim globals +opt = vim.opt; -- Vim optionals +theme = "vitesse" -- FIXME : CHANGE THEME \ No newline at end of file diff --git a/lua/keyboard.lua b/lua/keyboard.lua new file mode 100644 index 0000000..e7e36b3 --- /dev/null +++ b/lua/keyboard.lua @@ -0,0 +1,63 @@ +-- This file is intentionally left empty +-- Put your keybindings with wk package here + +local wk = require('which-key') +local function mdesc(opt, description) + return vim.tbl_extend("force", opt, { desc = description }) +end +local map = function(mode, lhs, rhs, opts, desc) + opts = opts and opts or {} + opts = mdesc(opts, desc) + vim.keymap.set(mode, lhs, rhs, opts) +end +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) +vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) +vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) +vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) +map({ "t", "i" }, "", [[h]]) +map({ "t", "i" }, "", [[j]]) +map({ "t", "i" }, "", [[k]]) +map({ "t", "i" }, "", [[l]]) +-- Move to window using the hjkl keys +map("n", "", "h", { desc = "Go to left window" }) +map("n", "", "j", { desc = "Go to lower window" }) +map("n", "", "k", { desc = "Go to upper window" }) +map("n", "", "l", { desc = "Go to right window" }) +map("n", "", "resize +2", { desc = "Increase window height" }) +map("n", "", "resize -2", { desc = "Decrease window height" }) +map( + "n", + "", + "vertical resize -2", + { desc = "Decrease window width" } +) +map( + "n", + "", + "vertical resize +2", + { desc = "Increase window width" } +) +map("n", "sh", "s", { desc = "Split window below" }) +map("n", "sv", "v", { desc = "Split window right" }) + +map({ "i", "v", "n", "s" }, "", function() + vim.cmd([[w]]) +end, { desc = "Save file" }) + +map({ "i", "v", "n", "s" }, "ww", function() + vim.cmd([[w]]) +end, { desc = "Save file" }) + +map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) + +-- === Terminal === " +-- Mapping to open terminal emulator in nvim +-- open terminal on alt+t +map({ "n", "t" }, "", function() + vim.cmd.split({ "term://" .. vim.env.SHELL }) + vim.cmd.resize({ 15 }) +end) +-- mapping to close terminal emulator +map("t", "", [[:bd!]]) \ No newline at end of file diff --git a/lua/plugins/blink.lua b/lua/plugins/blink.lua new file mode 100644 index 0000000..0f044c5 --- /dev/null +++ b/lua/plugins/blink.lua @@ -0,0 +1,183 @@ +return { + 'saghen/blink.cmp', + -- optional: provides snippets for the snippet source + dependencies = { 'rafamadriz/friendly-snippets', "onsails/lspkind.nvim", "xzbdmw/colorful-menu.nvim", "nvim-tree/nvim-web-devicons"}, + + -- use a release tag to download pre-built binaries + version = "v1.10.2", + -- AND/OR build from source + -- build = 'cargo build --release', + -- If you use nix, you can build from source with: + -- build = 'nix run .#build-plugin', + + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) + -- 'super-tab' for mappings similar to vscode (tab to accept) + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- C-space: Open menu or open docs if already open + -- C-n/C-p or Up/Down: Select next/previous item + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + -- + -- See :h blink-cmp-config-keymap for defining your own keymap + -- in your blink configuration + keymap = { + preset = 'none', + + -- If completion hasn't been triggered yet, insert the first suggestion; if it has, cycle to the next suggestion. + [''] = { 'show', 'show_documentation', 'hide_documentation' }, + [''] = { 'hide', 'fallback' }, + + [""] = { "select_next", "snippet_forward", "fallback" }, + [""] = { "select_prev", "snippet_backward", "fallback" }, + + -- Selection with Enter + [""] = { "accept", "fallback" }, + + [''] = { 'select_prev', 'fallback' }, + [''] = { 'select_next', 'fallback' }, + [''] = { 'select_prev', 'fallback_to_mappings' }, + [''] = { 'select_next', 'fallback_to_mappings' }, + + [''] = { 'scroll_documentation_up', 'fallback' }, + [''] = { 'scroll_documentation_down', 'fallback' }, + + [''] = { 'show_signature', 'hide_signature', 'fallback' }, + }, + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = 'mono' + }, + + -- (Default) Only show the documentation popup when manually triggered + completion = { + ghost_text = { + enabled = true + }, + accept = { + create_undo_point = true, + auto_brackets = { + enabled = true, + kind_resolution = { + enabled = true, + }, + semantic_token_resolution = { + enabled = true, + }, + }, + }, + menu = { + direction_priority = function() + local ctx = require('blink.cmp').get_context() + local item = require('blink.cmp').get_selected_item() + if ctx == nil or item == nil then return { 's', 'n' } end + + local item_text = item.textEdit ~= nil and item.textEdit.newText or item.insertText or item.label + local is_multi_line = item_text:find('\n') ~= nil + + -- after showing the menu upwards, we want to maintain that direction + -- until we re-open the menu, so store the context id in a global variable + if is_multi_line or vim.g.blink_cmp_upwards_ctx_id == ctx.id then + vim.g.blink_cmp_upwards_ctx_id = ctx.id + return { 'n', 's' } + end + return { 's', 'n' } + end, + columns = { { "kind_icon" }, { "label", gap = 1 } }, + components = { + kind_icon = { + text = function(ctx) + local icon = ctx.kind_icon + if vim.tbl_contains({ "Path" }, ctx.source_name) then + local dev_icon, _ = require("nvim-web-devicons").get_icon(ctx.label) + if dev_icon then + icon = dev_icon + end + else + icon = require("lspkind").symbol_map[ctx.kind] or "" + end + + return icon .. ctx.icon_gap + end, + + -- Optionally, use the highlight groups from nvim-web-devicons + -- You can also add the same function for `kind.highlight` if you want to + -- keep the highlight groups in sync with the icons. + highlight = function(ctx) + local hl = ctx.kind_hl + if vim.tbl_contains({ "Path" }, ctx.source_name) then + local dev_icon, dev_hl = require("nvim-web-devicons").get_icon(ctx.label) + if dev_icon then + hl = dev_hl + end + end + return hl + end, + }, + label = { + width = { fill = true, max = 60 }, + text = function(ctx) + local highlights_info = require("colorful-menu").blink_highlights(ctx) + if highlights_info ~= nil then + -- Or you want to add more item to label + return highlights_info.label + else + return ctx.label + end + end, + highlight = function(ctx) + local highlights = {} + local highlights_info = require("colorful-menu").blink_highlights(ctx) + if highlights_info ~= nil then + highlights = highlights_info.highlights + end + for _, idx in ipairs(ctx.label_matched_indices) do + table.insert(highlights, { idx, idx + 1, group = "BlinkCmpLabelMatch" }) + end + -- Do something else + return highlights + end, + }, + }, + }, + documentation = { + auto_show = true, + draw = function(opts) + if opts.item and opts.item.documentation and opts.item.documentation.value then + local out = require("pretty_hover.parser").parse(opts.item.documentation.value) + opts.item.documentation.value = out:string() + end + + opts.default_implementation(opts) + end, + }, + list = { + selection = { + preselect = false, + auto_insert = false + } + } + }, + + -- Default list of enabled providers defined so that you can extend it + -- elsewhere in your config, without redefining it, due to `opts_extend` + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, + + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance + -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, + -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` + -- + -- See the fuzzy documentation for more information + fuzzy = { implementation = "prefer_rust_with_warning" }, + signature = { enabled = true } + }, + opts_extend = { "sources.default" } +} \ No newline at end of file diff --git a/lua/plugins/clangd.lua b/lua/plugins/clangd.lua new file mode 100644 index 0000000..19085ca --- /dev/null +++ b/lua/plugins/clangd.lua @@ -0,0 +1,5 @@ +return { + url = "https://git.sr.ht/~chinmay/clangd_extensions.nvim", + event = "LspAttach", + opts = {} +} \ No newline at end of file diff --git a/lua/plugins/colors.lua b/lua/plugins/colors.lua new file mode 100644 index 0000000..6e98b3e --- /dev/null +++ b/lua/plugins/colors.lua @@ -0,0 +1,97 @@ +return { + "xzbdmw/colorful-menu.nvim", + config = function() + -- You don't need to set these options. + require("colorful-menu").setup({ + ls = { + lua_ls = { + -- Maybe you want to dim arguments a bit. + arguments_hl = "@comment", + }, + gopls = { + -- By default, we render variable/function's type in the right most side, + -- to make them not to crowd together with the original label. + + -- when true: + -- foo *Foo + -- ast "go/ast" + + -- when false: + -- foo *Foo + -- ast "go/ast" + align_type_to_right = true, + -- When true, label for field and variable will format like "foo: Foo" + -- instead of go's original syntax "foo Foo". If align_type_to_right is + -- true, this option has no effect. + add_colon_before_type = false, + -- See https://github.com/xzbdmw/colorful-menu.nvim/pull/36 + preserve_type_when_truncate = true, + }, + -- for lsp_config or typescript-tools + ts_ls = { + -- false means do not include any extra info, + -- see https://github.com/xzbdmw/colorful-menu.nvim/issues/42 + extra_info_hl = "@comment", + }, + vtsls = { + -- false means do not include any extra info, + -- see https://github.com/xzbdmw/colorful-menu.nvim/issues/42 + extra_info_hl = "@comment", + }, + ["rust-analyzer"] = { + -- Such as (as Iterator), (use std::io). + extra_info_hl = "@comment", + -- Similar to the same setting of gopls. + align_type_to_right = true, + -- See https://github.com/xzbdmw/colorful-menu.nvim/pull/36 + preserve_type_when_truncate = true, + }, + clangd = { + -- Such as "From ". + extra_info_hl = "@comment", + -- Similar to the same setting of gopls. + align_type_to_right = true, + -- the hl group of leading dot of "•std::filesystem::permissions(..)" + import_dot_hl = "@comment", + -- See https://github.com/xzbdmw/colorful-menu.nvim/pull/36 + preserve_type_when_truncate = true, + }, + zls = { + -- Similar to the same setting of gopls. + align_type_to_right = true, + }, + roslyn = { + extra_info_hl = "@comment", + }, + dartls = { + extra_info_hl = "@comment", + }, + -- The same applies to pyright/pylance + basedpyright = { + -- It is usually import path such as "os" + extra_info_hl = "@comment", + }, + pylsp = { + extra_info_hl = "@comment", + -- Dim the function argument area, which is the main + -- difference with pyright. + arguments_hl = "@comment", + }, + -- If true, try to highlight "not supported" languages. + fallback = true, + -- this will be applied to label description for unsupport languages + fallback_extra_info_hl = "@comment", + }, + -- If the built-in logic fails to find a suitable highlight group for a label, + -- this highlight is applied to the label. + fallback_highlight = "@variable", + -- If provided, the plugin truncates the final displayed text to + -- this width (measured in display cells). Any highlights that extend + -- beyond the truncation point are ignored. When set to a float + -- between 0 and 1, it'll be treated as percentage of the width of + -- the window: math.floor(max_width * vim.api.nvim_win_get_width(0)) + -- Default 60. + max_width = 60, + }) + end, +} diff --git a/lua/plugins/edit.lua b/lua/plugins/edit.lua new file mode 100644 index 0000000..2886018 --- /dev/null +++ b/lua/plugins/edit.lua @@ -0,0 +1,29 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + } +} diff --git a/lua/plugins/edit.lua~ b/lua/plugins/edit.lua~ new file mode 100644 index 0000000..4bf3dab --- /dev/null +++ b/lua/plugins/edit.lua~ @@ -0,0 +1,119 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗]], + [[████╗ ██║██╔â•�â•�â•�â•�â•�██╔â•�â•�â•�██╗██║ ██║██║████╗ ████║]], + [[██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║]], + [[██║╚██╗██║██╔â•�â•�â•� ██║ ██║╚██╗ â–ˆâ +–ˆâ•”â•�██║██║╚██╔â•�██║]], + [[██║ ╚████║███████╗╚██████╔â•� ╚████╔â•� ██║██║ ╚â•�â•� ██║]], + [[╚â•�â•� ╚â•�â•�â•�â•�╚â•�â•�â•�â•�â•�â•�â•� ╚â•�â•�â•�â•�â•�â•� ╚â•�â•�â•�â•� ╚â•�â•�╚â•�â•� ╚â•�â•�]], + [[]], + }, + shortcut = { + { + icon = " ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = " Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "ï…› New file", + group = "Macro", + key = "n", + action = "NvimTreeToggle", + }, + { + desc = "ï�£ Config", + group = "DiagnosticHint", + key = "c", + action = "e $MYVIMRC ", + }, + { + desc = "ï�¦ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.lup~ b/lua/plugins/edit.lup~ new file mode 100644 index 0000000..ba63a53 --- /dev/null +++ b/lua/plugins/edit.lup~ @@ -0,0 +1,106 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = "¿ ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = "¿ Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "¿ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.luq~ b/lua/plugins/edit.luq~ new file mode 100644 index 0000000..ba63a53 --- /dev/null +++ b/lua/plugins/edit.luq~ @@ -0,0 +1,106 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = "¿ ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = "¿ Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "¿ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.lur~ b/lua/plugins/edit.lur~ new file mode 100644 index 0000000..1408d24 --- /dev/null +++ b/lua/plugins/edit.lur~ @@ -0,0 +1,112 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = "¿ ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = "¿ Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "¿ Config", + group = "DiagnosticHint", + key = "c", + action = "e $MYVIMRC ", + }, + { + desc = "¿ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.lus~ b/lua/plugins/edit.lus~ new file mode 100644 index 0000000..1408d24 --- /dev/null +++ b/lua/plugins/edit.lus~ @@ -0,0 +1,112 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = "¿ ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = "¿ Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "¿ Config", + group = "DiagnosticHint", + key = "c", + action = "e $MYVIMRC ", + }, + { + desc = "¿ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.lut~ b/lua/plugins/edit.lut~ new file mode 100644 index 0000000..1408d24 --- /dev/null +++ b/lua/plugins/edit.lut~ @@ -0,0 +1,112 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = "¿ ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = "¿ Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "¿ Config", + group = "DiagnosticHint", + key = "c", + action = "e $MYVIMRC ", + }, + { + desc = "¿ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.luu~ b/lua/plugins/edit.luu~ new file mode 100644 index 0000000..1408d24 --- /dev/null +++ b/lua/plugins/edit.luu~ @@ -0,0 +1,112 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = "¿ ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = "¿ Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "¿ Config", + group = "DiagnosticHint", + key = "c", + action = "e $MYVIMRC ", + }, + { + desc = "¿ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.luv~ b/lua/plugins/edit.luv~ new file mode 100644 index 0000000..1408d24 --- /dev/null +++ b/lua/plugins/edit.luv~ @@ -0,0 +1,112 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = "¿ ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = "¿ Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "¿ Config", + group = "DiagnosticHint", + key = "c", + action = "e $MYVIMRC ", + }, + { + desc = "¿ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.luw~ b/lua/plugins/edit.luw~ new file mode 100644 index 0000000..1408d24 --- /dev/null +++ b/lua/plugins/edit.luw~ @@ -0,0 +1,112 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = "¿ ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = "¿ Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "¿ Config", + group = "DiagnosticHint", + key = "c", + action = "e $MYVIMRC ", + }, + { + desc = "¿ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.lux~ b/lua/plugins/edit.lux~ new file mode 100644 index 0000000..1408d24 --- /dev/null +++ b/lua/plugins/edit.lux~ @@ -0,0 +1,112 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = "¿ ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = "¿ Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "¿ Config", + group = "DiagnosticHint", + key = "c", + action = "e $MYVIMRC ", + }, + { + desc = "¿ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.luy~ b/lua/plugins/edit.luy~ new file mode 100644 index 0000000..161b5fa --- /dev/null +++ b/lua/plugins/edit.luy~ @@ -0,0 +1,112 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = " ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = " Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "ï�£ Config", + group = "DiagnosticHint", + key = "c", + action = "e $MYVIMRC ", + }, + { + desc = "ï�¦ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/edit.luz~ b/lua/plugins/edit.luz~ new file mode 100644 index 0000000..fa65fcb --- /dev/null +++ b/lua/plugins/edit.luz~ @@ -0,0 +1,118 @@ +return { + { + "windwp/nvim-autopairs", + event = "VeryLazy", + config = function(_, opts) + require("nvim-autopairs").setup(opts) + end, + }, + { + "numToStr/Comment.nvim", + event = "VeryLazy", + config = function(_, opts) + require("Comment").setup(opts) + end, + }, + { + "folke/todo-comments.nvim", + event = "VeryLazy", + cmd = { "TodoTelescope", "TodoLocList" }, + config = true, + -- stylua: ignore + 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" }, + { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, + { "tl", "TodoLocList", desc = "List Todo in LocList" }, + }, + }, + { + "nvimdev/dashboard-nvim", + init = function() + vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) + vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) + vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) + vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) + end, + opts = { + theme = "hyper", + config = { + header = { + [[]], + [[¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿]], + [[¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿]], + [[¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿ ¿¿¿]], + [[¿¿¿ ¿¿¿¿¿¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿]], + [[]], + }, + shortcut = { + { + icon = " ", -- + desc = " Files", + group = "Label", + key = "f", + action = "Telescope find_files", + }, + { + desc = " Find text", + group = "@property", + key = "g", + action = "Telescope live_grep ", + }, + { + desc = "ï…› New file", + group = "Macro", + key = "n", + action = "NvimTreeToggle", + }, + { + desc = "ï�£ Config", + group = "DiagnosticHint", + key = "c", + action = "e $MYVIMRC ", + }, + { + desc = "ï�¦ Quit", + group = "Number", + key = "q", + action = "qa", + }, + -- { + -- desc = " Recent files", + -- group = "", + -- key = "r", + -- action = "Telescope oldfiles ", + -- }, + -- { + -- desc = "󰊳 Update", + -- group = "@property", + -- key = "u", + -- action = "Lazy update", + -- }, + -- { + -- icon="", + -- icon_hl = "@variable", + -- desc = "Apps", + -- group = "DiagnosticHint", + -- key = "a", + -- action = "Telescope app", + -- }, + -- { + -- desc = " dotfiles", + -- group = "Number", + -- key = "d", + -- action = "Telescope dotfiles", + -- }, + }, + }, + hide = { + statusline = true, -- hide statusline default is true + tabline = false, -- hide the tabline + winbar = true, -- hide winbar + }, + }, + } +} diff --git a/lua/plugins/format.lua b/lua/plugins/format.lua new file mode 100644 index 0000000..563d2d7 --- /dev/null +++ b/lua/plugins/format.lua @@ -0,0 +1,12 @@ +return { + 'stevearc/conform.nvim', + opts = { + formatters_by_ft = { + cpp = { "clang-format", lsp_format = "fallback"} + }, + format_on_save = { + timeout_ms = 500, + lsp_format = "fallback", + }, + }, +} diff --git a/lua/plugins/heirline.lua b/lua/plugins/heirline.lua new file mode 100644 index 0000000..f2807fb --- /dev/null +++ b/lua/plugins/heirline.lua @@ -0,0 +1,82 @@ +return { + "rebelot/heirline.nvim", + dependencies = { "Zeioth/heirline-components.nvim" }, + opts = function() + local lib = require "heirline-components.all" + return { + opts = { + disable_winbar_cb = function(args) -- We do this to avoid showing it on the greeter. + local is_disabled = not require("heirline-components.buffer").is_valid(args.buf) or + lib.condition.buffer_matches({ + buftype = { "terminal", "prompt", "nofile", "help", "quickfix" }, + filetype = { "NvimTree", "neo%-tree", "dashboard", "Outline", "aerial" }, + }, args.buf) + return is_disabled + end, + }, + tabline = { -- UI upper bar + -- lib.component.tabline_conditional_padding(), + -- lib.component.tabline_buffers(), + -- lib.component.fill { hl = { bg = "tabline_bg" } }, + -- lib.component.tabline_tabpages() + }, + winbar = { -- UI breadcrumbs bar + init = function(self) self.bufnr = vim.api.nvim_get_current_buf() end, + fallthrough = false, + -- Winbar for terminal, neotree, and aerial. + { + condition = function() return not lib.condition.is_active() end, + { + lib.component.neotree(), + lib.component.compiler_play(), + lib.component.fill(), + lib.component.compiler_build_type(), + lib.component.compiler_redo(), + lib.component.aerial(), + }, + }, + -- Regular winbar + { + lib.component.neotree(), + lib.component.compiler_play(), + lib.component.fill(), + lib.component.breadcrumbs(), + lib.component.fill(), + lib.component.compiler_redo(), + lib.component.aerial(), + } + }, + statuscolumn = { -- UI left column + init = function(self) self.bufnr = vim.api.nvim_get_current_buf() end, + lib.component.foldcolumn(), + lib.component.numbercolumn(), + lib.component.signcolumn(), + } or nil, + statusline = { -- UI statusbar + hl = { fg = "fg", bg = "bg" }, + lib.component.mode(), + lib.component.git_branch(), + lib.component.file_info(), + lib.component.git_diff(), + lib.component.diagnostics(), + lib.component.fill(), + lib.component.cmd_info(), + lib.component.fill(), + lib.component.lsp(), + lib.component.compiler_state(), + lib.component.virtual_env(), + lib.component.nav(), + lib.component.mode { surround = { separator = "right" } }, + }, + } + end, + config = function(_, opts) + local heirline = require "heirline" + local heirline_components = require "heirline-components.all" + + -- Setup + heirline_components.init.subscribe_to_events() + heirline.load_colors(heirline_components.hl.get_colors()) + heirline.setup(opts) + end, +} \ No newline at end of file diff --git a/lua/plugins/lsp-highlight.lua b/lua/plugins/lsp-highlight.lua new file mode 100644 index 0000000..c16d5d5 --- /dev/null +++ b/lua/plugins/lsp-highlight.lua @@ -0,0 +1,27 @@ +---@type LazySpec +return { + { + "akioweh/lsp-document-highlight.nvim", + lazy = false, + keys = { + { + "[[", + function() + require("lsp-document-highlight").jump(-vim.v.count1, true) + end, + desc = "Previous Reference", + }, + { + "]]", + function() + require("lsp-document-highlight").jump(vim.v.count1, true) + end, + desc = "Next Reference", + }, + }, + ---@type LDH.config + opts = { + throttle = 50, + }, + }, +} \ No newline at end of file diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..2ea4fe6 --- /dev/null +++ b/lua/plugins/lspconfig.lua @@ -0,0 +1,343 @@ +return { + 'neovim/nvim-lspconfig', + dependencies = { 'saghen/blink.cmp', 'ibhagwan/fzf-lua', { + "nvimdev/lspsaga.nvim", + event = "LspAttach", + opts = { + ui = { + border = "shadow", + }, + outline = { + layout = "float", + }, + }, + }, }, + + -- example using `opts` for defining servers + opts = { + servers = { + lua_ls = {}, + clangd = { + cmd = { + "/opt/clangd/bin/clangd", + --"clangd"), + "--compile-commands-dir=build", + "--all-scopes-completion", + "--background-index", + "--clang-tidy", + "--completion-style=bundled", + "--experimental-modules-support", + "--function-arg-placeholders=1", + "--header-insertion=iwyu", + "--header-insertion-decorators", + "--malloc-trim", + "--pch-storage=memory" + } + } + } + }, + config = function(_, opts) + local keymap = vim.keymap + local autocmd = vim.api.nvim_create_autocmd -- create autocmd +local utils = require("utils") +local map = utils.map +local augroup = utils.augroup + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf, silent = true } + local bufnr = ev.buf + local client = vim.lsp.get_client_by_id(ev.data.client_id) + if client.server_capabilities.inlayHintProvider then + vim.lsp.inlay_hint.enable(true) + end + if client.server_capabilities.hoverProvider then + map("n", "K", function() + vim.lsp.buf.hover() + end, opts, "get hover info") + end + if client.server_capabilities.semanticTokensProvider then + map("n", "us", function() + utils.toggle("enable_semantic_tokens", { global = true }, nil) + if vim.g["enable_semantic_tokens"] then + vim.lsp.semantic_tokens.start(bufnr, client.id) + else + vim.lsp.semantic_tokens.stop(bufnr, client.id) + end + end, opts, "toggle semantic token highlighting") + end + if client.server_capabilities.signatureHelpProvider then + map( + "n", + "k", + vim.lsp.buf.signature_help, + opts, + "get fn signature help" + ) + end + if client.server_capabilities.declarationProvider then + map( + "n", + "gD", + vim.lsp.buf.declaration, + opts, + "goto declaration" + ) + end + -- if client.server_capabilities.completionProvider then + -- vim.bo[bufnr].omnifunc = "v:lua.vim.lsp.omnifunc" + -- end + if client.server_capabilities.definitionProvider then + -- vim.bo[bufnr].tagfunc = "v:lua.vim.lsp.tagfunc" + map("n", "gd", function() + if utils.has("lspsaga.nvim") then + vim.cmd([[Lspsaga goto_definition]]) + else + vim.lsp.buf.definition() + end + end, opts, "goto definition") + + if utils.has("lspsaga.nvim") then + map("n", "pd", function() + vim.cmd([[Lspsaga peek_definition]]) + end, opts, "peek definition") + end + end + if client.server_capabilities.typeDefinitionProvider then + map("n", "gt", function() + if utils.has("lspsaga.nvim") then + vim.cmd([[Lspsaga goto_type_definition]]) + else + vim.lsp.buf.type_definition() + end + end, opts, "goto type definition") + + if utils.has("lspsaga.nvim") then + map("n", "pt", function() + vim.cmd([[Lspsaga peek_type_definition]]) + end, opts, "peek type definition") + end + end + if client.server_capabilities.implementationProvider then + map("n", "gi", function() + if utils.has("lspsaga.nvim") then + vim.cmd([[Lspsaga finder imp+def]]) + else + vim.lsp.buf.implementation() + end + end, opts, "goto type implementation") + end + if client.server_capabilities.referencesProvider then + map("n", "gr", function() + if utils.has("lspsaga.nvim") then + vim.cmd([[Lspsaga finder ref]]) + else + vim.lsp.buf.references({}) + end + end, opts, "goto type references") + end + if client.server_capabilities.documentHighlightProvider then + vim.api.nvim_set_hl(0, "LspReferenceRead", { + link = "DiffText", + }) + vim.api.nvim_set_hl(0, "LspReferenceText", { + link = "IncSearch", + }) + vim.api.nvim_set_hl(0, "LspRefDiffTexterenceWrite", { + link = "WildMenu", + }) + local doc_highlight = augroup("lsp_document_highlight") + local enable_highlight = function() + autocmd({ "CursorHold", "CursorHoldI" }, { + group = doc_highlight, + buffer = bufnr, + callback = vim.lsp.buf.document_highlight, + }) + autocmd("CursorMoved", { + group = doc_highlight, + buffer = bufnr, + callback = vim.lsp.buf.clear_references, + }) + end + local disable_highlight = function() + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds({ + buffer = bufnr, + group = doc_highlight, + }) + end + map("n", "uh", function() + utils.toggle( + "highlight", + {}, + { enable_highlight, disable_highlight } + ) + vim.b[vim.fn.bufnr()]["highlight"]() + end, opts, "toggle document highlight") + end + if client.server_capabilities.documentSymbolProvider then + map( + "n", + "ds", + vim.lsp.buf.document_symbol, + opts, + "document symbols" + ) + end + if client.server_capabilities.codeActionProvider then + map({ "n", "v" }, "ca", function() + if utils.has("lspsaga.nvim") then + vim.cmd([[Lspsaga code_action]]) + else + vim.lsp.buf.code_action() + end + end, opts, "code action") + end + if client.server_capabilities.documentFormattingProvider then + map("n", "uf", function() + utils.toggle("autoformat", { global = true }) + autocmd("BufWritePre", { + group = augroup("LspFormat"), + callback = function() + if vim.g["autoformat"] then + vim.lsp.buf.format({ async = true }) + end + end, + }) + end, opts, "toggle autoformat") + + map("n", "f", function() + vim.lsp.buf.format({ async = true }) + end, opts, "range format buffer") + end + if client.server_capabilities.documentRangeFormattingProvider then + map("v", "f", function() + vim.lsp.buf.format({ async = true }) + end, opts, "range format buffer") + end + if client.server_capabilities.renameProvider then + map("n", "rn", function() + vim.lsp.buf.rename() + end, opts, "rename symbol") + + if utils.has("lspsaga.nvim") then + map("n", "rnw", function() + vim.cmd([[Lspsaga project_replace]]) + end, opts, "rename across workspace") + end + end + if client.server_capabilities.callHierarchyProvider then + map("n", "ci", function() + if utils.has("lspsaga.nvim") then + vim.cmd([[Lspsaga incoming_calls]]) + else + vim.lsp.buf.incoming_calls() + end + end, opts, "incoming calls") + map("n", "co", function() + if utils.has("lspsaga.nvim") then + vim.cmd([[Lspsaga outgoing_calls]]) + else + vim.lsp.buf.outgoing_calls() + end + end, opts, "outgoing calls") + end + if client.server_capabilities.workspaceSymbolProvider then + map( + "n", + "ws", + vim.lsp.buf.workspace_symbol, + opts, + "list workspace symbols" + ) + end + + map("n", "[d", function() + if utils.has("lspsaga.nvim") then + vim.cmd([[Lspsaga diagnostic_jump_prev]]) + else + vim.diagnostic.jump({count = -1, float = true}) + end + end, opts, "goto previous diagnostics") + map("n", "]d", function() + if utils.has("lspsaga.nvim") then + vim.cmd([[Lspsaga diagnostic_jump_next]]) + else + vim.diagnostic.jump({count = 1, float = true}) + end + end, opts, "goto next diagnostics") + + if utils.has("lspsaga.nvim") then + map("n", "wd", function() + vim.cmd([[Lspsaga show_workspace_diagnostics]]) --can use ++normal to show in loclist + end, opts, "workspace diagnostics") + map("n", "bd", function() + vim.cmd([[Lspsaga show_buf_diagnostics]]) + end, opts, "workspace diagnostics") + map("n", "wo", function() + vim.cmd([[Lspsaga outline]]) + end, opts, "workspace outline") + end + map("n", "sl", vim.diagnostic.setloclist, opts, "set loclist") + map("n", "of", vim.diagnostic.open_float, opts, "open float") + + map("n", "wf", function() + vim.print(vim.lsp.buf.list_workspace_folders()) + end, opts, "list workspace folders") + map("n", "rd", function() + print( + "Language server " + .. (vim.lsp.buf.server_ready() and "is ready" or "is not ready") + ) + end, opts, "check if lsp is ready") + + -- K for hover is now a built-in default in Neovim 0.12 + + end, + }) + for server, config in pairs(opts.servers) do + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + } + -- passing config.capabilities to blink.cmp merges with the capabilities in your + -- `opts[server].capabilities, if you've defined it + config.capabilities = require('blink.cmp').get_lsp_capabilities(capabilities) + vim.lsp.config(server, config) + vim.lsp.enable(server) + end + vim.api.nvim_create_user_command("LspInfo", "checkhealth vim.lsp", { + desc = "Show LSP Info", +}) + +vim.api.nvim_create_user_command("LspLog", function(_) + local log_path = vim.lsp.log.get_filename() + + vim.cmd(string.format("edit %s", log_path)) +end, { + desc = "Show LSP log", +}) + +vim.api.nvim_create_user_command("LspRestart", "lsp restart", { + desc = "Restart LSP", +}) + +--- show LSP progress (works on Ghostty) +vim.api.nvim_create_autocmd("LspProgress", { + callback = function(ev) + local value = ev.data.params.value + vim.api.nvim_echo({ { value.message or "done" } }, false, { + id = "lsp." .. ev.data.client_id, + kind = "progress", + source = "vim.lsp", + title = value.title, + status = value.kind ~= "end" and "running" or "success", + percent = value.percentage, + }) + end, +}) + end +} \ No newline at end of file diff --git a/lua/plugins/lspsaga.lua b/lua/plugins/lspsaga.lua new file mode 100644 index 0000000..7073e3a --- /dev/null +++ b/lua/plugins/lspsaga.lua @@ -0,0 +1,11 @@ +return{} +-- 'nvimdev/lspsaga.nvim', +-- event = 'LspAttach', +-- config = function() +-- require('lspsaga').setup({}) +-- end, +-- dependencies = { +-- 'nvim-treesitter/nvim-treesitter', -- optional +-- 'nvim-tree/nvim-web-devicons', -- optional +-- } +--} \ No newline at end of file diff --git a/lua/plugins/pretty-hover.lua b/lua/plugins/pretty-hover.lua new file mode 100644 index 0000000..0e75e5c --- /dev/null +++ b/lua/plugins/pretty-hover.lua @@ -0,0 +1,5 @@ +return { + "Fildo7525/pretty_hover", + event = "LspAttach", + opts = {} +} \ No newline at end of file diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..1fedf88 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,8 @@ +return { + 'nvim-telescope/telescope.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + -- optional but recommended + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, + } +} \ No newline at end of file diff --git a/lua/plugins/theme.lua b/lua/plugins/theme.lua new file mode 100644 index 0000000..288fd4f --- /dev/null +++ b/lua/plugins/theme.lua @@ -0,0 +1,40 @@ +return { + { + "serhez/teide.nvim", + lazy = false, + priority = 1000, + opts = { + on_highlights = function(hl, c) + local prompt = "#2d3149" + hl.TelescopeNormal = { + bg = c.bg_dark, + fg = c.fg_dark, + } + hl.TelescopeBorder = { + bg = c.bg_dark, + fg = c.bg_dark, + } + hl.TelescopePromptNormal = { + bg = prompt, + } + hl.TelescopePromptBorder = { + bg = prompt, + fg = prompt, + } + hl.TelescopePromptTitle = { + bg = prompt, + fg = prompt, + } + hl.TelescopePreviewTitle = { + bg = c.bg_dark, + fg = c.bg_dark, + } + hl.TelescopeResultsTitle = { + bg = c.bg_dark, + fg = c.bg_dark, + } + end, + }, +} + -- "nyoom-engineering/oxocarbon.nvim" +} \ No newline at end of file diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..2c29e42 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,22 @@ +--[[ + File: treesitter.lua + Description: Configuration of tree-sitter + See: https://github.com/tree-sitter/tree-sitter +]] + +return { + "romus204/tree-sitter-manager.nvim", + dependencies = {}, -- tree-sitter CLI must be installed system-wide + config = function() + require("tree-sitter-manager").setup({ + -- Default Options + ensure_installed = {"cpp", "cmake"}, -- list of parsers to install at the start of a neovim session + -- border = nil, -- border style for the window (e.g. "rounded", "single"), if nil, use the default border style defined by 'vim.o.winborder'. See :h 'winborder' for more info. + auto_install = true, -- if enabled, install missing parsers when editing a new file + highlight = true, -- treesitter highlighting is enabled by default + -- languages = {}, -- override or add new parser sources + -- parser_dir = vim.fn.stdpath("data") .. "/site/parser", + -- query_dir = vim.fn.stdpath("data") .. "/site/queries", + }) + end +} \ No newline at end of file diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua new file mode 100644 index 0000000..85f37c0 --- /dev/null +++ b/lua/plugins/ui.lua @@ -0,0 +1,101 @@ +return { + -- indent guides for Neovim + { + "lukas-reineke/indent-blankline.nvim", + event = { "BufReadPre", "BufNewFile" }, + main = "ibl", + opts = { + indent = { + char = "â–�", + }, + }, + }, + + -- active indent guide and indent text objects + { + "echasnovski/mini.indentscope", + event = { "BufReadPre", "BufNewFile" }, + opts = { + -- symbol = "â–�", + symbol = "│", + options = { try_as_border = true }, + }, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, + }, + -- better vim.ui + { "MunifTanjim/nui.nvim", lazy = true }, + -- Better `vim.notify()` + { + "rcarriga/nvim-notify", + lazy = true, + keys = { + { + "un", + function() + require("notify").dismiss({ silent = true, pending = true }) + end, + desc = "Clear notifications", + }, + }, + opts = { timeout = 3000 }, + }, + { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + lsp = { + progress = { + enabled = false, + }, + override = { + -- override the default lsp markdown formatter with Noice + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + -- override the lsp markdown formatter with Noice + ["vim.lsp.util.stylize_markdown"] = true, + -- override cmp documentation with Noice (needs the other options to work) + ["cmp.entry.get_documentation"] = false, + }, + --NOTE: install parsers for markdown and markdown_inline to see markdown documentation + hover = { + enabled = false, + }, + signature = { + enabled = false, + }, + message = { + enabled = true, -- Messages shown by lsp servers + }, + }, + health = { + checker = false, -- Disable if you don't want health checks to run + }, + presets = { + -- you can enable a preset by setting it to true, or a table that will override the preset config + -- you can also add custom presets that you can enable/disable with enabled=true + bottom_search = false, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = false, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + }, + }, +} diff --git a/lua/plugins/virtual_lines.lua b/lua/plugins/virtual_lines.lua new file mode 100644 index 0000000..dc7aaf9 --- /dev/null +++ b/lua/plugins/virtual_lines.lua @@ -0,0 +1,7 @@ +return { + url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim", + config = function() + require("lsp_lines").setup() + vim.diagnostic.config({ virtual_lines = true }) + end, +} \ No newline at end of file diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..d4ddbad --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,9 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + config = true, + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, +} diff --git a/lua/settings.lua b/lua/settings.lua new file mode 100644 index 0000000..517fbc0 --- /dev/null +++ b/lua/settings.lua @@ -0,0 +1,200 @@ +--[[ + File: settings.lua + Description: Base settings for neovim + Info: Use and to open and close foldings +]] + +require "helpers/globals" +g.autochdir = true +-- Set associating between turned on plugins and filetype +cmd[[filetype plugin on]] + +-- Disable comments on pressing Enter +cmd[[autocmd FileType * setlocal formatoptions-=cro]] + +-- Tabs {{{ +opt.expandtab = true -- Use spaces by default +opt.shiftwidth = 4 -- Set amount of space characters, when we press "<" or ">" +opt.tabstop = 4 -- 1 tab equal 2 spaces +opt.smartindent = true -- Turn on smart indentation. See in the docs for more info +opt.softtabstop = -1 +-- }}} + +-- Clipboard {{{ +opt.clipboard = 'unnamedplus' -- Use system clipboard +opt.fixeol = false -- Turn off appending new line in the end of a file +-- }}} + +-- Folding {{{ +opt.foldmethod = "expr" + +opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" +-- }}} + +-- Search {{{ +opt.ignorecase = true -- Ignore case if all characters in lower case +opt.joinspaces = false -- Join multiple spaces in search +opt.smartcase = true -- When there is a one capital letter search for exact match +opt.showmatch = true -- Highlight search instances +-- }}} + +-- Window {{{ +opt.splitbelow = true -- Put new windows below current +opt.splitright = true -- Put new vertical splits to right +-- }}} + +-- Wild Menu {{{ +opt.wildmenu = true +opt.wildmode = "longest:full,full" +-- }}} + +opt.number = true +opt.relativenumber = true +opt.breakindent = true +opt.numberwidth = 2 +opt.cmdheight = 0 +opt.colorcolumn = '+0' -- Align text at 'textwidth' +opt.showtabline = 0 -- Always show the tabs line +opt.helpheight = 0 -- Disable help window resizing +opt.winwidth = 30 -- Minimum width for active window +opt.winheight = 1 -- Minimum height for active window +opt.winminheight = 1 -- Minimum height for inactive window +opt.showbreak = '⤷ ' -- ↪ ⤷ +opt.listchars = { + tab = ' ', + extends = '⟫', + precedes = '⟪', + conceal = 'ï‘ ', + nbsp = 'â�£', + trail = '·' +} +opt.fillchars = { + foldopen = '', --  ó°…€ + foldclose = 'ï‘ ', -- ï‘  ó°…‚ + fold = ' ', -- ⸱ + foldsep = ' ', + diff = '╱', + eob = ' ', + horiz = 'â”�', + horizup = 'â”»', + horizdown = '┳', + vert = '┃', + vertleft = '┫', + vertright = '┣', + verthoriz = 'â•‹', +} +opt.scrolloff = 3 +opt.history = 500 +opt.undofile = true +opt.signcolumn = "yes:1" +opt.colorcolumn = "150" +opt.foldlevel = 999 +opt.lazyredraw = false +g.elite_mode = true +g.autoformat = true +-- Default Plugins {{{ +local disabled_built_ins = { + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", + "gzip", + "zip", + "zipPlugin", + "tar", + "tarPlugin", + "getscript", + "getscriptPlugin", + "vimball", + "vimballPlugin", + "2html_plugin", + "logipat", + "rrhelper", + "spellfile_plugin", + "matchit" +} + +for _, plugin in pairs(disabled_built_ins) do + g["loaded_" .. plugin] = 1 +end +-- }}} +local diagnostic = vim.diagnostic +local api = vim.api +local defaults = require("defaults") +-- global config for diagnostic +diagnostic.config { + underline = true, + virtual_text = { + severity = { min = vim.diagnostic.severity.WARN, max = vim.diagnostic.severity.ERROR }, + source = "if_many", + spacing = 0, + prefix = "â—�", + }, + update_in_insert = true, + virtual_lines = true, + signs = { + text = { + [diagnostic.severity.ERROR] = "🆇", + [diagnostic.severity.WARN] = "âš ï¸�", + [diagnostic.severity.INFO] = "ℹï¸�", + [diagnostic.severity.HINT] = "ï�€", + }, + }, + severity_sort = true, + float = { + --nvim_open_win() options + relative = "cursor", + -- "single": A single line box. + -- "double": A double line box. + -- "rounded": Like "single", but with rounded corners "â•­" + -- "solid": Adds padding by a single whitespace cell. + -- "shadow": A drop shadow effect by blending with the + -- "none": No border (default). + border = "shadow", + -- vim.lsp.util.open_floating_preview() + max_width = math.floor(vim.o.columns * 0.84), + max_height = math.floor(vim.o.lines * 0.6), + close_events = { + "BufLeave", + "CursorMoved", + "InsertEnter", + "FocusLost", + }, + focusable = false, + zindex = 3, + focus = false, + -- vim.diagnostic.open_float() + source = "if_many", + severity_sort = true, + } +} +-- :h highlight-args and :h cterm-colors +vim.api.nvim_set_hl(0, "Search", { + ctermfg = 0, + ctermbg = 11, + cterm = { bold = true }, + bg = "Blue", + fg = "Magenta", + standout = true, + underdotted = true, +}) +local augroup = function(name) + return vim.api.nvim_create_augroup(name, { clear = true }) +end +local autocmd = vim.api.nvim_create_autocmd -- create autocmd +autocmd("TextYankPost", { + group = augroup("highlight_yank"), + callback = function() + vim.hl.on_yank() + end, +}) + +-- resize splits if window got resized +autocmd({ "VimResized" }, { + group = augroup("resize_splits"), + callback = function() + vim.cmd("wincmd =") + vim.cmd("tabdo wincmd =") + end, +}) +-- vim: tabstop=2 shiftwidth=2 expandtab syntax=lua foldmethod=marker foldlevelstart=1 \ No newline at end of file diff --git a/lua/utils.lua b/lua/utils.lua new file mode 100644 index 0000000..1d6f286 --- /dev/null +++ b/lua/utils.lua @@ -0,0 +1,230 @@ +local M = {} + +function _G.dump(...) + vim.print(...) +end + +function M.reload_all() + for name, _ in pairs(package.loaded) do + if name:match("^config") or name:match("^plugins") then + package.loaded[name] = nil + end + end + -- Reload after/ directory + local glob = vim.fn.stdpath("config") .. "/ftplugin/**/*.lua" + local ftplugin_lua_filepaths = vim.fn.glob(glob, true, true) + + for _, filepath in ipairs(ftplugin_lua_filepaths) do + dofile(filepath) + end + + dofile(vim.env.MYVIMRC) +end + +function M.reload_one(module) + for name, _ in pairs(package.loaded) do + if name:match("^" .. module) then + package.loaded[name] = nil + require(name) + return + end + end +end + +--{ "git", "rg", { "fd", "fdfind" }, "lazygit" } +M.check_if_cmd_exist = function(cmds) + local result = {} + for _, cmd in ipairs(cmds) do + local name = type(cmd) == "string" and cmd or vim.inspect(cmd) + local commands = type(cmd) == "string" and { cmd } or cmd + ---@cast commands string[] + local found = false + for _, c in ipairs(commands) do + if vim.fn.executable(c) == 1 then + name = c + found = true + end + result[name] = { found } + end + end + return result +end + +---@param editor_variable? {global: boolean} +---@param values? {[1]:any, [2]:any} +---@param option string +function M.toggle(option, editor_variable, values) + if values then + if not editor_variable then + if vim.deep_equal(vim.opt_local[option]:get(), values[1]) then + vim.opt_local[option] = values[2] + else + vim.opt_local[option] = values[1] + end + vim.notify( + "set editor option " + .. option + .. " to " + .. tostring(vim.opt_local[option]:get()), + vim.log.levels.INFO, + { title = "toggle editor option" } + ) + else + if not editor_variable.global then + local bufnr = vim.api.nvim_get_current_buf() + if vim.b[bufnr][option] == values[1] then + vim.b[bufnr][option] = values[2] + else + --if option is unset or nil + vim.b[bufnr][option] = values[1] + end + --:h debug.getinfo() or lua_getinfo() to get information about a function + vim.notify( + "set option " + .. option + .. " to " + .. tostring(vim.b[bufnr][option]), + vim.log.levels.INFO, + { + title = "toggle local option", + } + ) + else + if vim.g[option] == values[1] then + vim.g[option] = values[2] + else + --if option is unset or nil + vim.g[option] = values[1] + end + vim.notify( + "set global option " + .. option + .. " to " + .. tostring(vim.g[option]), + vim.log.levels.INFO, + { + title = "toggle global option", + } + ) + end + end + else + if not editor_variable then + vim.opt_local[option] = not vim.opt_local[option]:get() + vim.notify( + "set editor option " + .. option + .. " to " + .. tostring(vim.opt_local[option]:get()), + vim.log.levels.INFO, + { + title = "toggle editor option", + } + ) + else + if not editor_variable.global then + local bufnr = vim.api.nvim_get_current_buf() + vim.b[bufnr][option] = not vim.b[bufnr][option] and true + or false + vim.notify( + "set option " + .. option + .. " to " + .. tostring(vim.b[bufnr][option]), + vim.log.levels.INFO, + { + title = "toggle local option", + } + ) + else + vim.g[option] = not vim.g[option] + vim.notify( + "set global option " + .. option + .. " to " + .. tostring(vim.g[option]), + vim.log.levels.INFO, + { + title = "toggle global option", + } + ) + end + end + end +end + +---@param fn fun() +function M.on_very_lazy(fn) + vim.api.nvim_create_autocmd("User", { + group = vim.api.nvim_create_augroup("Lazy", { clear = true }), + pattern = "VeryLazy", + callback = function() + fn() + end, + }) +end + +---@param modules string[] +--modules like "autocmds" | "options" | "keymaps" +M.lazy_load = function(modules) + -- when no file is opened at startup + if vim.fn.argc(-1) == 0 then + -- autocmds and keymaps can wait to load + -- always load lazyvim, then user file + M.on_very_lazy(function() + for i = 1, #modules do + require(modules[i]) + end + end) + else + -- load them now so they affect the opened buffers + for i = 1, #modules do + require(modules[i]) + end + end +end + +---@param on_attach fun(client, bufnr) +function M.on_attach(on_attach) + vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local bufnr = args.buf + local client = vim.lsp.get_client_by_id(args.data.client_id) + on_attach(client, bufnr) + end, + }) +end + +---@param plugin string +function M.has(plugin) + if package.loaded["lazy"] then + return require("lazy.core.config").plugins[plugin] ~= nil + else + local plugin_name = + vim.split(plugin, ".", { plain = true, trimempty = true }) + return package.loaded[plugin_name[1]] ~= nil + end +end + +---@param description? string +---@param opt table +local function mdesc(opt, description) + return vim.tbl_extend("force", opt, { desc = description }) +end + +---@param mode string|table +---@param lhs string +---@param rhs string|function +---@param opts? table +---@param desc? string +M.map = function(mode, lhs, rhs, opts, desc) + opts = opts and opts or {} + opts = mdesc(opts, desc) + vim.keymap.set(mode, lhs, rhs, opts) +end + +M.augroup = function(name) + return vim.api.nvim_create_augroup(name, { clear = true }) +end + +return M diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json new file mode 100644 index 0000000..b08f971 --- /dev/null +++ b/nvim-pack-lock.json @@ -0,0 +1,133 @@ +{ + "plugins": { + "Comment.nvim": { + "rev": "e30b7f2008e52442154b66f7c519bfd2f1e32acb", + "src": "https://github.com/numToStr/Comment.nvim" + }, + "blink.cmp": { + "rev": "78336bc89ee5365633bcf754d93df01678b5c08f", + "src": "https://github.com/saghen/blink.cmp", + "version": "'v1.10.2'" + }, + "clangd_extensions.nvim": { + "rev": "78c2ecd659d54972be17aa6ba2deac3c53223b80", + "src": "https://git.sr.ht/~chinmay/clangd_extensions.nvim" + }, + "colorful-menu.nvim": { + "rev": "b51a659459df8d078201aefc995db8175ed55e84", + "src": "https://github.com/xzbdmw/colorful-menu.nvim" + }, + "conform.nvim": { + "rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395", + "src": "https://github.com/stevearc/conform.nvim" + }, + "dashboard-nvim": { + "rev": "62a10d9d55132b338dd742afc3c8a2683f3dd426", + "src": "https://github.com/nvimdev/dashboard-nvim" + }, + "friendly-snippets": { + "rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9", + "src": "https://github.com/rafamadriz/friendly-snippets" + }, + "fzf-lua": { + "rev": "5bf93b12f70c7cc89a2cc6ee026b82f111815be8", + "src": "https://github.com/ibhagwan/fzf-lua" + }, + "heirline-components.nvim": { + "rev": "5ea9a16286c01b7c36d58c91903d1f8ff0b7ddeb", + "src": "https://github.com/Zeioth/heirline-components.nvim" + }, + "heirline.nvim": { + "rev": "fae936abb5e0345b85c3a03ecf38525b0828b992", + "src": "https://github.com/rebelot/heirline.nvim" + }, + "indent-blankline.nvim": { + "rev": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03", + "src": "https://github.com/lukas-reineke/indent-blankline.nvim" + }, + "lsp-document-highlight.nvim": { + "rev": "8d49ad5b8b06ad496ff26e45879aaff37f2a210c", + "src": "https://github.com/akioweh/lsp-document-highlight.nvim" + }, + "lsp_lines.nvim": { + "rev": "a92c755f182b89ea91bd8a6a2227208026f27b4d", + "src": "https://git.sr.ht/~whynothugo/lsp_lines.nvim" + }, + "lspkind.nvim": { + "rev": "c7274c48137396526b59d86232eabcdc7fed8a32", + "src": "https://github.com/onsails/lspkind.nvim" + }, + "lspsaga.nvim": { + "rev": "562d9724e3869ffd1801c572dd149cc9f8d0cc36", + "src": "https://github.com/nvimdev/lspsaga.nvim" + }, + "mini.indentscope": { + "rev": "e0601f75aa5137a5a13bb92a988c9a300f5bd3de", + "src": "https://github.com/echasnovski/mini.indentscope" + }, + "noice.nvim": { + "rev": "7bfd942445fb63089b59f97ca487d605e715f155", + "src": "https://github.com/folke/noice.nvim" + }, + "nui.nvim": { + "rev": "de740991c12411b663994b2860f1a4fd0937c130", + "src": "https://github.com/MunifTanjim/nui.nvim" + }, + "nvim-autopairs": { + "rev": "59bce2eef357189c3305e25bc6dd2d138c1683f5", + "src": "https://github.com/windwp/nvim-autopairs" + }, + "nvim-lspconfig": { + "rev": "8a9378a822719346a0288fa004dab302ca3c0a8f", + "src": "https://github.com/neovim/nvim-lspconfig" + }, + "nvim-notify": { + "rev": "8701bece920b38ea289b457f902e2ad184131a5d", + "src": "https://github.com/rcarriga/nvim-notify" + }, + "nvim-web-devicons": { + "rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6", + "src": "https://github.com/nvim-tree/nvim-web-devicons" + }, + "oxocarbon.nvim": { + "rev": "a7ba74849a00546a311f8c146320b433900393e7", + "src": "https://github.com/nyoom-engineering/oxocarbon.nvim" + }, + "plenary.nvim": { + "rev": "74b06c6c75e4eeb3108ec01852001636d85a932b", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "pretty_hover": { + "rev": "a4212464431e534725e84357aae70a5311d7ea8c", + "src": "https://github.com/Fildo7525/pretty_hover" + }, + "teide.nvim": { + "rev": "95041d1d78e786bd88be64bca3e1771f7b6236df", + "src": "https://github.com/serhez/teide.nvim" + }, + "telescope-fzf-native.nvim": { + "rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c", + "src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim" + }, + "telescope.nvim": { + "rev": "f7c673b8e46e8f233ff581d3624a517d33a7e264", + "src": "https://github.com/nvim-telescope/telescope.nvim" + }, + "todo-comments.nvim": { + "rev": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668", + "src": "https://github.com/folke/todo-comments.nvim" + }, + "tree-sitter-manager.nvim": { + "rev": "fa63bc63ae08b661843d9976a43becfbd3daf76c", + "src": "https://github.com/romus204/tree-sitter-manager.nvim" + }, + "which-key.nvim": { + "rev": "3aab2147e74890957785941f0c1ad87d0a44c15a", + "src": "https://github.com/folke/which-key.nvim" + }, + "zpack.nvim": { + "rev": "d3cc74dcfa29a209665b9e2957a76b75f35e4f24", + "src": "https://github.com/zuqini/zpack.nvim" + } + } +}