commit d8b279d688ee9513b8972324126f020297132061 Author: minco Date: Tue Aug 19 23:57:25 2025 +0900 feat: zako diff --git a/colors/eldar.vim b/colors/eldar.vim new file mode 100644 index 0000000..e99186e --- /dev/null +++ b/colors/eldar.vim @@ -0,0 +1,297 @@ +" --------------------------------------------------------- +" ______ _ _ +" | ____| | | | +" | |__ | | __| | __ _ _ __ +" | __| | |/ _` |/ _` | '__| +" | |____| | (_| | (_| | | +" |______|_|\__,_|\__,_|_| +" +" --------------------------------------------------------- +" +" Maintainer: Alexander Gude +" Email: alex.public.account@gmail.com +" File: eldar.vim +" URL: github.com/agude/vim-eldar +" License: MIT +" +" --------------------------------------------------------- +" +" Copyright (c) 2016--2024 Alexander Gude +" +" Permission is hereby granted, free of charge, to any per‐ +" son obtaining a copy of this software and associated doc‐ +" umentation files (the “Software”), to deal in the Soft‐ +" ware without restriction, including without limitation +" the rights to use, copy, modify, merge, publish, distrib‐ +" ute, sublicense, and/or sell copies of the Software, and +" to permit persons to whom the Software is furnished to do +" so, subject to the following conditions: +" +" The above copyright notice and this permission notice +" shall be included in all copies or substantial portions +" of the Software. +" +" THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY +" KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +" THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICU‐ +" LAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON‐ +" TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐ +" NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +" THE SOFTWARE. +" +" --------------------------------------------------------- + +" Eldar is designed for dark backgrounds +set background=dark + +highlight clear +if exists('syntax_on') + syntax reset +endif + +let g:colors_name = 'eldar' + +" Define colors (Tango is the default) +" GUI colors +let s:red = get(g:, 'eldar_red', '#EF2929') +let s:yellow = get(g:, 'eldar_yellow', '#FCE94F') +let s:green = get(g:, 'eldar_green', '#8AE234') +let s:cyan = get(g:, 'eldar_cyan', '#34E2E2') +let s:blue = get(g:, 'eldar_blue', '#729FCF') +let s:magenta = get(g:, 'eldar_magenta', '#AD7FA8') +let s:gui_text = get(g:, 'eldar_text', 'White') +let s:gui_bg = get(g:, 'eldar_background', 'Black') + +" Terminal colors +let s:term_text = get(g:, 'eldar_term_text', 'NONE') +let s:term_bg = get(g:, 'eldar_term_background', 'NONE') + +" The ColourAssignment map and function to unpack it are from the bandit +" colorscheme by Al Bunden, available here: +" http://www.cgtk.co.uk/vim-scripts/bandit + +let s:ColourAssignment = {} + +" Unspecified colours default to NONE, EXCEPT cterm(.*) which default to matching gui(.*) +" +" In most cases, only GUIFG is therefore important unless support for Black and White +" terminals is essential + +" Editor settings +" --------------- +if has("gui_running") + let s:ColourAssignment['Normal'] = {'GUIFG': s:gui_text, 'GUIBG': s:gui_bg} +else + let s:ColourAssignment['Normal'] = {'CTERMFG': s:term_text, 'CTERMBG': s:term_bg} +endif +let s:ColourAssignment['Cursor'] = {'GUI': 'Reverse'} +let s:ColourAssignment['CursorLine'] = {'GUI': 'NONE', 'GUIBG': 'NONE'} +let s:ColourAssignment['LineNr'] = {'GUIFG': 'DarkGray'} +let s:ColourAssignment['CursorLineNr'] = {'GUIFG': 'White'} + + +" Number column +" ------------- +let s:ColourAssignment['CursorColumn'] = {'GUIBG': 'DarkGrey'} +let s:ColourAssignment['Folded'] = {'GUIFG': 'DarkGrey', 'GUIBG': 'Black'} +let s:ColourAssignment['FoldColumn'] = {'GUIBG': 'DarkGrey'} +highlight! link SignColumn FoldColumn + + +" Window/Tab delimiters +" --------------------- +let s:ColourAssignment['VertSplit'] = {'GUIFG': 'White', 'GUIBG': 'NONE'} +let s:ColourAssignment['ColorColumn'] = {'GUIBG': 'DarkGray'} +let s:ColourAssignment['TabLine'] = {'GUIFG': 'White', 'GUIBG': 'DarkGray'} +let s:ColourAssignment['TabLineFill'] = {'GUIBG': 'DarkGray'} +let s:ColourAssignment['TabLineSel'] = {'GUIFG': 'Black', 'GUIBG': 'Gray'} + + +" File Navigation / Searching +" --------------------------- +let s:ColourAssignment['Directory'] = {'GUIFG': s:blue, 'CTERMFG': 'Blue', 'GUI': 'Bold'} +let s:ColourAssignment['Search'] = {'GUIFG': 'Black', 'GUIBG': s:yellow, 'CTERMFG': 'yellow', 'CTERMBG': 'black', 'GUI': 'Bold', 'CTERM': 'Reverse,Bold'} +let s:ColourAssignment['IncSearch'] = {'GUI': 'Reverse'} + + +" Prompt/Status +" ------------- +let s:ColourAssignment['StatusLine'] = {'GUIFG': 'White', 'GUIBG': s:gui_bg, 'GUI': 'Bold,Reverse', 'CTERMFG': 'White', 'CTERMBG': s:term_bg} +let s:ColourAssignment['StatusLineNC'] = {'GUIFG': 'White', 'GUIBG': s:gui_bg, 'GUI': 'Reverse', 'CTERMFG': 'White', 'CTERMBG': s:term_bg} +let s:ColourAssignment['WildMenu'] = {'GUIFG': 'White', 'GUIBG': 'DarkGrey', 'GUI': 'Bold'} +let s:ColourAssignment['Question'] = {'GUIFG': s:blue, 'CTERMFG': 'Blue'} +let s:ColourAssignment['Title'] = {'GUI': 'Bold'} +let s:ColourAssignment['ModeMsg'] = {'GUI': 'Bold'} +let s:ColourAssignment['MoreMsg'] = {'GUIFG': s:green, 'CTERMFG': 'Green'} + + +" Visual aid +" ---------- +let s:ColourAssignment['MatchParen'] = {'GUIBG': s:cyan, 'CTERMBG': 'cyan'} +let s:ColourAssignment['Visual'] = {'GUIBG': 'DarkGrey'} +highlight! link VisualNOS Visual +let s:ColourAssignment['NonText'] = {'GUIFG': s:blue, 'CTERMFG': 'blue'} + +let s:ColourAssignment['Todo'] = {'GUIFG': 'Black', 'GUIBG': s:yellow, 'CTERMBG': 'yellow'} +let s:ColourAssignment['Underlined'] = {'GUIFG': s:cyan, 'CTERMFG': 'cyan', 'GUI': 'Underline'} +let s:ColourAssignment['EndOfBuffer'] = {'GUIFG': s:blue, 'CTERMFG': 'Blue'} +let s:ColourAssignment['Error'] = {'GUIFG': s:red, 'GUIBG': 'Black', 'CTERMFG': 'red', 'GUI': 'Reverse,Bold'} +let s:ColourAssignment['ErrorMsg'] = {'GUIFG': s:red, 'GUIBG': 'White', 'CTERMFG': 'red', 'GUI': 'Reverse,Bold'} +let s:ColourAssignment['WarningMsg'] = {'GUIFG': s:red, 'CTERMFG': 'red'} +let s:ColourAssignment['Ignore'] = {'GUIFG': 'bg', 'CTERMFG': 'Black'} +let s:ColourAssignment['SpecialKey'] = {'GUIFG': s:cyan, 'CTERMFG': 'Cyan'} + + +" Variable types +" -------------- +let s:ColourAssignment['Constant'] = {'GUIFG': s:magenta, 'CTERMFG': 'magenta'} +let s:ColourAssignment['Number'] = {'GUIFG': s:red, 'CTERMFG': 'red'} +highlight! link String Constant +highlight! link Boolean Constant +highlight! link Float Number + +let s:ColourAssignment['Identifier'] = {'GUIFG': s:green, 'CTERMFG': 'green', 'GUI': 'Bold'} +highlight! link Function Identifier + + +" Comments +" -------- +let s:ColourAssignment['Comment'] = {'GUIFG': s:cyan, 'CTERMFG': 'cyan'} +highlight! link SpecialComment Special + + +" Language constructs +" ------------------- +let s:ColourAssignment['Statement'] = {'GUIFG': s:yellow, 'CTERMFG': 'yellow', 'GUI': 'Bold'} +highlight! link Conditional Statement +highlight! link Repeat Statement +highlight! link Label Statement +highlight! link Operator Statement +highlight! link Keyword Statement +highlight! link Exception Statement + +let s:ColourAssignment['Special'] = {'GUIFG': s:red, 'CTERMFG': 'red'} +highlight! link SpecialChar Special +highlight! link Tag Special +highlight! link Delimiter Special +highlight! link Debug Special + + +" C like +" ------ +let s:ColourAssignment['PreProc'] = {'GUIFG': s:blue, 'CTERMFG': 'blue', 'GUI': 'Bold'} +highlight! link Include PreProc +highlight! link Define PreProc +highlight! link Macro PreProc +highlight! link PreCondit PreProc + +let s:ColourAssignment['Type'] = {'GUIFG': s:green, 'CTERMFG': 'green', 'GUI': 'Bold'} +let s:ColourAssignment['Structure'] = {'GUIFG': s:magenta, 'CTERMFG': 'magenta'} +highlight! link StorageClass Type +highlight! link Typedef Type + + +" Diff +" ---- +let s:ColourAssignment['DiffAdd'] = {'GUIFG': s:green, 'GUIBG': 'Black', 'CTERMFG': 'Green', 'GUI': 'Reverse,Bold'} +let s:ColourAssignment['DiffChange'] = {'GUIFG': 'NONE'} +let s:ColourAssignment['DiffDelete'] = {'GUIFG': s:red, 'GUIBG': 'Black', 'CTERMFG': 'Red', 'GUI': 'Reverse,Bold'} +let s:ColourAssignment['DiffText'] = {'GUIFG': s:blue, 'GUIBG': 'Black', 'CTERMFG': 'Blue', 'GUI': 'Reverse,Bold'} + + +" Completion menu +" --------------- +let s:ColourAssignment['Pmenu'] = {'GUIFG': 'Black', 'GUIBG': 'Grey'} +let s:ColourAssignment['PmenuSel'] = {'GUIFG': s:yellow, 'GUIBG': 'DarkGrey', 'GUI': 'Bold', 'CTERMFG': 'yellow'} +let s:ColourAssignment['PmenuThumb'] = {'GUIBG': 'DarkGrey'} +highlight! link PmenuSbar Pmenu + + +" Spelling +" -------- +let s:ColourAssignment['SpellBad'] = {'GUIFG': s:red, 'GUISP': s:red, 'CTERMFG': 'red', 'GUI': 'undercurl'} +let s:ColourAssignment['SpellCap'] = {'GUIFG': s:blue, 'GUISP': s:blue, 'CTERMFG': 'blue', 'GUI': 'undercurl'} +let s:ColourAssignment['SpellLocal'] = {'GUIFG': s:yellow, 'GUISP': s:yellow, 'CTERMFG': 'yellow', 'GUI': 'undercurl'} +let s:ColourAssignment['SpellRare'] = {'GUIFG': s:green, 'GUISP': s:green, 'CTERMFG': 'green', 'GUI': 'undercurl'} + + +" Text Formatting +" --------------- +let s:ColourAssignment['Italic'] = {'GUIFG': 'White', 'GUI': 'Italic'} +let s:ColourAssignment['Bold'] = {'GUIFG': 'White', 'GUI': 'Bold'} +let s:ColourAssignment['BoldItalic'] = {'GUIFG': 'White', 'GUI': 'Italic,Bold'} +highlight! link htmlItalic Italic +highlight! link htmlBold Bold +highlight! link htmlBoldItalic BoldItalic + + +" Function to translate the ColourAssignments to highlight lines +let s:colours = {} +let s:valid_cterm_colours = + \ [ + \ 'Black', 'DarkBlue', 'DarkGreen', 'DarkCyan', + \ 'DarkRed', 'DarkMagenta', 'Brown', 'DarkYellow', + \ 'LightGray', 'LightGrey', 'Gray', 'Grey', + \ 'DarkGray', 'DarkGrey', 'Blue', 'LightBlue', + \ 'Green', 'LightGreen', 'Cyan', 'LightCyan', + \ 'Red', 'LightRed', 'Magenta', 'LightMagenta', + \ 'Yellow', 'LightYellow', 'White', + \ ] + +for s:key in keys(s:ColourAssignment) + let s:colours = s:ColourAssignment[s:key] + if has_key(s:colours, 'TERM') + let s:term = s:colours['TERM'] + else + let s:term = 'NONE' + endif + if has_key(s:colours, 'GUI') + let s:gui = s:colours['GUI'] + else + let s:gui = 'NONE' + endif + if has_key(s:colours, 'GUIFG') + let s:guifg = s:colours['GUIFG'] + else + let s:guifg = 'NONE' + endif + if has_key(s:colours, 'GUIBG') + let s:guibg = s:colours['GUIBG'] + else + let s:guibg = 'NONE' + endif + if has_key(s:colours, 'CTERM') + let s:cterm = s:colours['CTERM'] + else + let s:cterm = s:gui + endif + if has_key(s:colours, 'CTERMFG') + let s:ctermfg = s:colours['CTERMFG'] + else + if index(s:valid_cterm_colours, s:guifg) != -1 + let s:ctermfg = s:guifg + else + let s:ctermfg = 'NONE' + endif + endif + if has_key(s:colours, 'CTERMBG') + let s:ctermbg = s:colours['CTERMBG'] + else + if index(s:valid_cterm_colours, s:guibg) != -1 + let s:ctermbg = s:guibg + else + let s:ctermbg = 'NONE' + endif + endif + if has_key(s:colours, 'GUISP') + let s:guisp = s:colours['GUISP'] + else + let s:guisp = 'NONE' + endif + + if s:key =~# '^\k*$' + execute 'highlight '.s:key.' term='.s:term.' cterm='.s:cterm.' gui='.s:gui.' ctermfg='.s:ctermfg.' guifg='.s:guifg.' ctermbg='.s:ctermbg.' guibg='.s:guibg.' guisp='.s:guisp + endif +endfor diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..5607184 --- /dev/null +++ b/init.lua @@ -0,0 +1,63 @@ +vim.opt.termguicolors = true + +vim.cmd("colorscheme eldar") +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true +vim.cmd("set relativenumber") +vim.cmd("set number") +vim.cmd("set mouse=a") +vim.cmd("set clipboard+=unnamedplus") +vim.api.nvim_set_hl(0, "Normal", { bg = "#040404" }) + +vim.diagnostic.config({ + underline = true, -- enable underline + virtual_text = true, + signs = true, -- keep gutter signs + update_in_insert = false, + severity_sort = true, +}) + +vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, { + callback = function() + pcall(vim.lsp.codelens.refresh) + end, +}) + +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client and client.server_capabilities.inlayHintProvider then + vim.lsp.inlay_hint.enable(true, { bufnr = args.buf }) + end + end, +}) + +vim.api.nvim_create_autocmd("BufWritePre", { + callback = function(args) + vim.lsp.buf.format({ bufnr = args.buf }) + end, +}) + +-- Format immediately after pasting in normal/visual mode +local function format_after_paste(keys) + return function() + vim.api.nvim_feedkeys(keys, "n", false) -- perform the paste + vim.lsp.buf.format({ async = true }) -- format buffer asynchronously + end +end + +vim.keymap.set({ "n", "x" }, "p", format_after_paste("p"), { noremap = true, silent = true }) +vim.keymap.set({ "n", "x" }, "P", format_after_paste("P"), { noremap = true, silent = true }) + +vim.api.nvim_create_autocmd("TextYankPost", { + callback = function() + vim.highlight.on_yank({ + higroup = "Visual", -- highlight style + timeout = 150, -- duration in milliseconds + }) + end, +}) + +require("config.keymaps") +require("config.lazy") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..5e72a1a --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,25 @@ +{ + "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, + "blink.download": { "branch": "main", "commit": "86361b98f3c8317904a08e3bd12cf3cdcbe3e925" }, + "blink.nvim": { "branch": "main", "commit": "16a597e89cf2ee6215a392c5bc5a945477015534" }, + "blink.pairs": { "branch": "main", "commit": "d8bf802cca951f0a3b72ddeed21bc5a1d5353f65" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "fzf-lua": { "branch": "main", "commit": "d6e899e8dfdaf47bf849c0875ca3ca0e5a0e0d12" }, + "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lsp-lens.nvim": { "branch": "main", "commit": "48bb1a7e271424c15f3d588d54adc9b7c319d977" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1ec4da522fa49dcecee8d190efda273464dd2192" }, + "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, + "neoconf.nvim": { "branch": "main", "commit": "5aeca07ecb2f506d32e81eb82b0ed384ac2a53c5" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, + "nvim-highlight-colors": { "branch": "main", "commit": "b42a5ccec7457b44e89f7ed3b3afb1b375bb2093" }, + "nvim-lspconfig": { "branch": "master", "commit": "61fdd3a8609071ce44519e405f3424d84ec94d9d" }, + "nvim-treesitter": { "branch": "main", "commit": "32cb9f9b9db71b0dc2454817727cd9a5d840658c" }, + "nvim-web-devicons": { "branch": "master", "commit": "c2599a81ecabaae07c49ff9b45dcd032a8d90f1a" }, + "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" } +} diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua new file mode 100644 index 0000000..41e2216 --- /dev/null +++ b/lua/config/keymaps.lua @@ -0,0 +1,26 @@ +-- LSP keymaps +local opts = { noremap = true, silent = true } + +-- Go to definition +vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + +-- Go to declaration +vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) + +-- Find references +vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) + +-- Go to implementation +vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) + +-- Hover documentation +vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + +-- Signature help +vim.keymap.set("n", "", vim.lsp.buf.signature_help, opts) + +-- Rename symbol +vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) + +-- Code actions +vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..a079dd4 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,35 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true, notify = false }, +}) diff --git a/lua/plugins/blink-cmp.lua b/lua/plugins/blink-cmp.lua new file mode 100644 index 0000000..d4202de --- /dev/null +++ b/lua/plugins/blink-cmp.lua @@ -0,0 +1,60 @@ +return { + 'saghen/blink.cmp', + -- optional: provides snippets for the snippet source + dependencies = { 'rafamadriz/friendly-snippets' }, + + -- use a release tag to download pre-built binaries + version = '1.*', + -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust 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 + keymap = { preset = 'enter' }, + + 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 = { + documentation = { auto_show = true, auto_show_delay_ms = 500, }, + menu = { auto_show = true }, + ghost_text = { show_with_menu = false }, + list = { + selection = { preselect = 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" } + }, + opts_extend = { "sources.default" } +} diff --git a/lua/plugins/blink-pairs.lua b/lua/plugins/blink-pairs.lua new file mode 100644 index 0000000..b606796 --- /dev/null +++ b/lua/plugins/blink-pairs.lua @@ -0,0 +1,46 @@ +return { + 'saghen/blink.pairs', + version = '*', -- (recommended) only required with prebuilt binaries + + -- download prebuilt binaries from github releases + dependencies = 'saghen/blink.download', + -- OR build from source, requires nightly: + -- https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust with: + -- build = 'nix run .#build-plugin', + + --- @module 'blink.pairs' + --- @type blink.pairs.Config + opts = { + mappings = { + -- you can call require("blink.pairs.mappings").enable() + -- and require("blink.pairs.mappings").disable() + -- to enable/disable mappings at runtime + enabled = true, + -- or disable with `vim.g.pairs = false` (global) and `vim.b.pairs = false` (per-buffer) + -- and/or with `vim.g.blink_pairs = false` and `vim.b.blink_pairs = false` + disabled_filetypes = {}, + -- see the defaults: + -- https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/config/mappings.lua#L14 + pairs = {}, + }, + highlights = { + enabled = true, + -- requires require('vim._extui').enable({}), otherwise has no effect + groups = { + 'BlinkPairsOrange', + 'BlinkPairsPurple', + 'BlinkPairsBlue', + }, + + -- highlights matching pairs under the cursor + matchparen = { + enabled = true, + -- known issue where typing won't update matchparen highlight, disabled by default + group = 'BlinkPairsMatchParen', + }, + }, + debug = false, + } +} diff --git a/lua/plugins/blink.lua b/lua/plugins/blink.lua new file mode 100644 index 0000000..97ae887 --- /dev/null +++ b/lua/plugins/blink.lua @@ -0,0 +1,36 @@ +return { + 'saghen/blink.nvim', + build = 'cargo build --release', -- for delimiters + keys = { + -- chartoggle + { + '', + function() + require('blink.chartoggle').toggle_char_eol(';') + end, + mode = { 'n', 'v' }, + desc = 'Toggle ; at eol', + }, + { + ',', + function() + require('blink.chartoggle').toggle_char_eol(',') + end, + mode = { 'n', 'v' }, + desc = 'Toggle , at eol', + }, + + -- tree + { '', 'BlinkTree reveal', desc = 'Reveal current file in tree' }, + { 'E', 'BlinkTree toggle', desc = 'Reveal current file in tree' }, + { 'e', 'BlinkTree toggle-focus', desc = 'Toggle file tree focus' }, + }, + -- all modules handle lazy loading internally + lazy = false, + opts = { + chartoggle = { enabled = true }, + tree = { enabled = true }, + cmp = { enabled = true }, + pairs = { enabled = true }, + } +} diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua new file mode 100644 index 0000000..78a59f1 --- /dev/null +++ b/lua/plugins/bufferline.lua @@ -0,0 +1,27 @@ +return { + "akinsho/bufferline.nvim", + lazy = false, + keys = { + { "bp", "BufferLineTogglePin", desc = "Toggle Pin" }, + { "bP", "BufferLineGroupClose ungrouped", desc = "Delete Non-Pinned Buffers" }, + { "br", "BufferLineCloseRight", desc = "Delete Buffers to the Right" }, + { "bl", "BufferLineCloseLeft", desc = "Delete Buffers to the Left" }, + { "", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "", "BufferLineCycleNext", desc = "Next Buffer" }, + { "[b", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "]b", "BufferLineCycleNext", desc = "Next Buffer" }, + { "[B", "BufferLineMovePrev", desc = "Move buffer prev" }, + { "]B", "BufferLineMoveNext", desc = "Move buffer next" }, + }, + config = function() + require("bufferline").setup{} + -- Fix bufferline when restoring a session + vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, { + callback = function() + vim.schedule(function() + pcall(nvim_bufferline) + end) + end, + }) + end, +} diff --git a/lua/plugins/fzf-lua.lua b/lua/plugins/fzf-lua.lua new file mode 100644 index 0000000..2df22f1 --- /dev/null +++ b/lua/plugins/fzf-lua.lua @@ -0,0 +1,8 @@ +return { + "ibhagwan/fzf-lua", + -- optional for icon support + dependencies = { "nvim-tree/nvim-web-devicons" }, + -- or if using mini.icons/mini.nvim + -- dependencies = { "echasnovski/mini.icons" }, + opts = {} +} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..809f39e --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,53 @@ +return { + "lewis6991/gitsigns.nvim", + lazy = false, + opts = { + signs = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged_enable = true, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true + }, + auto_attach = true, + attach_to_untracked = false, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + virt_text_priority = 100, + use_focus = true, + }, + current_line_blame_formatter = ', - ', + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, + } +} diff --git a/lua/plugins/highlight-colors.lua b/lua/plugins/highlight-colors.lua new file mode 100644 index 0000000..aca3ea6 --- /dev/null +++ b/lua/plugins/highlight-colors.lua @@ -0,0 +1,7 @@ +return { + 'brenoprata10/nvim-highlight-colors', + lazy = false, + config = function() + require('nvim-highlight-colors').setup{} + end +} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..8a37de2 --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,5 @@ +return { + "folke/neodev.nvim", + "folke/which-key.nvim", + { "folke/neoconf.nvim", cmd = "Neoconf" }, +} diff --git a/lua/plugins/lsp-lens.lua b/lua/plugins/lsp-lens.lua new file mode 100644 index 0000000..9c1b178 --- /dev/null +++ b/lua/plugins/lsp-lens.lua @@ -0,0 +1,22 @@ +local SymbolKind = vim.lsp.protocol.SymbolKind + +return { + 'VidocqH/lsp-lens.nvim', + opts = { + enable = true, + include_declaration = false, -- Reference include declaration + sections = { -- Enable / Disable specific request, formatter example looks 'Format Requests' + definition = false, + references = true, + implements = true, + git_authors = true, + }, + ignore_filetype = { + "prisma", + }, + -- Target Symbol Kinds to show lens information + target_symbol_kinds = { SymbolKind.Function, SymbolKind.Method, SymbolKind.Interface }, + -- Symbol Kinds that may have target symbol kinds as children + wrapper_symbol_kinds = { SymbolKind.Class, SymbolKind.Struct }, + } +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..5278393 --- /dev/null +++ b/lua/plugins/lspconfig.lua @@ -0,0 +1,32 @@ +return { + 'neovim/nvim-lspconfig', + dependencies = { 'saghen/blink.cmp' }, + + lazy = false, + + -- example using `opts` for defining servers + opts = { + inlay_hints = { enabled = true }, + servers = { + lua_ls = {} + } + }, + config = function(_, opts) + local lspconfig = require('lspconfig') + for server, config in pairs(opts.servers) do + -- 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(config.capabilities) + lspconfig[server].setup(config) + end + + end, + + -- example calling setup directly for each LSP + config = function() + local capabilities = require('blink.cmp').get_lsp_capabilities() + local lspconfig = require('lspconfig') + + lspconfig['lua_ls'].setup({ capabilities = capabilities }) + end +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..6ee1e81 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,7 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + opts = { + options = { theme = "16color" } + }, +} diff --git a/lua/plugins/mason-lspconfig.lua b/lua/plugins/mason-lspconfig.lua new file mode 100644 index 0000000..d63f064 --- /dev/null +++ b/lua/plugins/mason-lspconfig.lua @@ -0,0 +1,11 @@ +return { + "mason-org/mason-lspconfig.nvim", + opts = { + ensure_installed = { "lua_ls", "rust_analyzer", "ts_ls" }, + }, + lazy = false, + dependencies = { + { "mason-org/mason.nvim", opts = {} }, + "neovim/nvim-lspconfig", + }, +} diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua new file mode 100644 index 0000000..8a6eefb --- /dev/null +++ b/lua/plugins/mason.lua @@ -0,0 +1,5 @@ +return { + "mason-org/mason.nvim", + lazy = false, + opts = {} +} diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua new file mode 100644 index 0000000..bf8ab68 --- /dev/null +++ b/lua/plugins/snacks.lua @@ -0,0 +1,23 @@ +return { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + bigfile = { enabled = true }, + dashboard = { enabled = true }, + explorer = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + picker = { enabled = true }, + notifier = { enabled = true }, + quickfile = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = true }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + }, +} diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..4050553 --- /dev/null +++ b/lua/plugins/toggleterm.lua @@ -0,0 +1,11 @@ +return +{ + 'akinsho/toggleterm.nvim', + version = "*", + config = true, + lazy = false, + keys = { + { "th", "ToggleTerm", desc = "ToggleTerm Horizontal" }, + { "tv", "ToggleTerm", desc = "ToggleTerm Vertical" } + } +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..1cb80cc --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,6 @@ +return { + 'nvim-treesitter/nvim-treesitter', + lazy = false, + branch = 'main', + build = ':TSUpdate' +} diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua new file mode 100644 index 0000000..3741f30 --- /dev/null +++ b/lua/plugins/trouble.lua @@ -0,0 +1,37 @@ +return { + "folke/trouble.nvim", + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, +}