diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..44610e5 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake; diff --git a/flake.lock b/flake.lock index b57b285..8fa4f26 100644 --- a/flake.lock +++ b/flake.lock @@ -557,6 +557,7 @@ "neovim-nightly-overlay": "neovim-nightly-overlay", "nixpkgs": "nixpkgs_3", "rio-term": "rio-term", + "systems": "systems_6", "waybar": "waybar" } }, @@ -674,6 +675,21 @@ "type": "github" } }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "waybar": { "inputs": { "flake-compat": "flake-compat_2", diff --git a/flake.nix b/flake.nix index c354c58..c495d03 100644 --- a/flake.nix +++ b/flake.nix @@ -48,11 +48,14 @@ rio-term = { url = "github:zackartz/rio"; }; + + systems.url = "github:nix-systems/default"; }; outputs = { self, nixpkgs, + systems, ... } @ inputs: let system = "x86_64-linux"; @@ -60,6 +63,11 @@ overlays = [ inputs.neovim-nightly-overlay.overlay ]; + eachSystem = f: + nixpkgs.lib.genAttrs (import systems) ( + system: + f nixpkgs.legacyPackages.${system} + ); in { nixosConfigurations.earth = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; @@ -68,5 +76,15 @@ inputs.home-manager.nixosModules.default ]; }; + + devShells = eachSystem (pkgs: { + default = pkgs.mkShell { + buildInputs = [ + pkgs.nil + pkgs.stylua + pkgs.nodePackages.coc-sumneko-lua + ]; + }; + }); }; } diff --git a/modules/home-manager/nvconfig.lua b/modules/home-manager/nvconfig.lua index 46b3429..7a4cfbf 100644 --- a/modules/home-manager/nvconfig.lua +++ b/modules/home-manager/nvconfig.lua @@ -1,106 +1,106 @@ local M = {} M.ui = { - ------------------------------- base46 ------------------------------------- - -- hl = highlights - hl_add = {}, - hl_override = {}, - changed_themes = {}, - theme_toggle = { "rosepine", "one_light" }, - theme = "rosepine", -- default theme - transparency = true, + ------------------------------- base46 ------------------------------------- + -- hl = highlights + hl_add = {}, + hl_override = {}, + changed_themes = {}, + theme_toggle = { "rosepine", "one_light" }, + theme = "rosepine", -- default theme + transparency = true, - cmp = { - icons = true, - lspkind_text = true, - style = "default", -- default/flat_light/flat_dark/atom/atom_colored - }, + cmp = { + icons = true, + lspkind_text = true, + style = "default", -- default/flat_light/flat_dark/atom/atom_colored + }, - telescope = { style = "borderless" }, -- borderless / bordered + telescope = { style = "borderless" }, -- borderless / bordered - ------------------------------- nvchad_ui modules ----------------------------- - statusline = { - theme = "default", -- default/vscode/vscode_colored/minimal - -- default/round/block/arrow separators work only for default statusline theme - -- round and block will work for minimal theme only - separator_style = "default", - order = nil, - modules = nil, - }, + ------------------------------- nvchad_ui modules ----------------------------- + statusline = { + theme = "default", -- default/vscode/vscode_colored/minimal + -- default/round/block/arrow separators work only for default statusline theme + -- round and block will work for minimal theme only + separator_style = "default", + order = nil, + modules = nil, + }, - -- lazyload it when there are 1+ buffers - tabufline = { - enabled = true, - lazyload = true, - order = { "treeOffset", "buffers", "tabs", "btns" }, - modules = nil, - }, + -- lazyload it when there are 1+ buffers + tabufline = { + enabled = true, + lazyload = true, + order = { "treeOffset", "buffers", "tabs", "btns" }, + modules = nil, + }, - nvdash = { - load_on_startup = false, + nvdash = { + load_on_startup = false, - header = { - " ▄ ▄ ", - " ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ ", - " █ ▄ █▄█ ▄▄▄ █ █▄█ █ █ ", - " ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █ ", - " ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ", - " █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄", - "▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █", - "█▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █", - " █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█ ", - }, + header = { + " ▄ ▄ ", + " ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ ", + " █ ▄ █▄█ ▄▄▄ █ █▄█ █ █ ", + " ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █ ", + " ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ", + " █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄", + "▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █", + "█▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █", + " █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█ ", + }, - buttons = { - { " Find File", "Spc f f", "Telescope find_files" }, - { "󰈚 Recent Files", "Spc f o", "Telescope oldfiles" }, - { "󰈭 Find Word", "Spc f w", "Telescope live_grep" }, - { " Bookmarks", "Spc m a", "Telescope marks" }, - { " Themes", "Spc t h", "Telescope themes" }, - { " Mappings", "Spc c h", "NvCheatsheet" }, - }, - }, + buttons = { + { " Find File", "Spc f f", "Telescope find_files" }, + { "󰈚 Recent Files", "Spc f o", "Telescope oldfiles" }, + { "󰈭 Find Word", "Spc f w", "Telescope live_grep" }, + { " Bookmarks", "Spc m a", "Telescope marks" }, + { " Themes", "Spc t h", "Telescope themes" }, + { " Mappings", "Spc c h", "NvCheatsheet" }, + }, + }, - cheatsheet = { theme = "grid" }, -- simple/grid + cheatsheet = { theme = "grid" }, -- simple/grid - lsp = { - signature = true, - semantic_tokens = false, - }, + lsp = { + signature = true, + semantic_tokens = false, + }, - term = { - -- hl = "Normal:term,WinSeparator:WinSeparator", - sizes = { sp = 0.3, vsp = 0.2 }, - float = { - relative = "editor", - row = 0.3, - col = 0.25, - width = 0.5, - height = 0.4, - border = "single", - }, - }, + term = { + -- hl = "Normal:term,WinSeparator:WinSeparator", + sizes = { sp = 0.3, vsp = 0.2 }, + float = { + relative = "editor", + row = 0.3, + col = 0.25, + width = 0.5, + height = 0.4, + border = "single", + }, + }, } M.base46 = { - integrations = { - "blankline", - "cmp", - "defaults", - "devicons", - "git", - "lsp", - "mason", - "nvcheatsheet", - "nvdash", - "nvimtree", - "statusline", - "syntax", - "treesitter", - "tbline", - "telescope", - "whichkey", - }, + integrations = { + "blankline", + "cmp", + "defaults", + "devicons", + "git", + "lsp", + "mason", + "nvcheatsheet", + "nvdash", + "nvimtree", + "statusline", + "syntax", + "treesitter", + "tbline", + "telescope", + "whichkey", + }, } return M diff --git a/modules/home-manager/vim/config/lua/core/autocmd.lua b/modules/home-manager/vim/config/lua/core/autocmd.lua index f377607..7699d9d 100644 --- a/modules/home-manager/vim/config/lua/core/autocmd.lua +++ b/modules/home-manager/vim/config/lua/core/autocmd.lua @@ -1,21 +1,21 @@ return { - { - event = "LspAttach", - opts = { - callback = function(args) - local bufnr = args.buf - local client = vim.lsp.get_client_by_id(args.data.client_id) - local lsp = require("lsp.config") - lsp.set_keymaps(client, bufnr) - lsp.set_autocmd(client, bufnr) - end, - }, - }, - { - event = { "FileType" }, - opts = { - pattern = { "help" }, - callback = require("utils.win").open_help_float, - }, - }, + { + event = "LspAttach", + opts = { + callback = function(args) + local bufnr = args.buf + local client = vim.lsp.get_client_by_id(args.data.client_id) + local lsp = require("lsp.config") + lsp.set_keymaps(client, bufnr) + lsp.set_autocmd(client, bufnr) + end, + }, + }, + { + event = { "FileType" }, + opts = { + pattern = { "help" }, + callback = require("utils.win").open_help_float, + }, + }, } diff --git a/modules/home-manager/vim/config/lua/core/filetypes.lua b/modules/home-manager/vim/config/lua/core/filetypes.lua index dcfc726..f50c35d 100644 --- a/modules/home-manager/vim/config/lua/core/filetypes.lua +++ b/modules/home-manager/vim/config/lua/core/filetypes.lua @@ -1,10 +1,10 @@ return { - extension = { - ic = "icelang", - rasi = "rasi", - ebnf = "ebnf", - }, - pattern = { - [".*/hypr/.*%.conf"] = "hyprlang", - }, + extension = { + ic = "icelang", + rasi = "rasi", + ebnf = "ebnf", + }, + pattern = { + [".*/hypr/.*%.conf"] = "hyprlang", + }, } diff --git a/modules/home-manager/vim/config/lua/core/keymaps.lua b/modules/home-manager/vim/config/lua/core/keymaps.lua index 0000a3a..ac432d6 100644 --- a/modules/home-manager/vim/config/lua/core/keymaps.lua +++ b/modules/home-manager/vim/config/lua/core/keymaps.lua @@ -4,266 +4,265 @@ local fmt = require("utils.icons").fmt local l, cmd, rcmd, lua = map.leader, map.cmd, map.rcmd, map.lua return { - i = { - ["jj"] = { "", "Exit insert mode" }, - }, - n = { - -- utils - ["vv"] = { "V", "Linewise visual" }, - [l("w")] = { cmd("w"), fmt("Save", "Save file") }, - [l("W")] = { cmd("w!"), fmt("Save", "Save file!") }, - [l("q")] = { cmd("q"), fmt("Exit", "Exit window") }, - [l("Q")] = { cmd("q!"), fmt("Exit", "Exit window!") }, - [l("p")] = { '"+p', fmt("Clipboard", "Paste from clipboard") }, - [l("P")] = { '"+P', fmt("Clipboard", "Paste from clipboard") }, - [l(":")] = { ":lua ", fmt("Lua", "Lua prompt") }, - [l("%")] = { cmd("luafile %"), fmt("Lua", "Luafile") }, - [l(";")] = { f.comment_line, fmt("Comment", "Comment line") }, - [l(" ")] = { cmd("wincmd w"), fmt("Window", "Switch window") }, + i = { + ["jj"] = { "", "Exit insert mode" }, + }, + n = { + -- utils + ["vv"] = { "V", "Linewise visual" }, + [l("w")] = { cmd("w"), fmt("Save", "Save file") }, + [l("W")] = { cmd("w!"), fmt("Save", "Save file!") }, + [l("q")] = { cmd("q"), fmt("Exit", "Exit window") }, + [l("Q")] = { cmd("q!"), fmt("Exit", "Exit window!") }, + [l("p")] = { '"+p', fmt("Clipboard", "Paste from clipboard") }, + [l("P")] = { '"+P', fmt("Clipboard", "Paste from clipboard") }, + [l(":")] = { ":lua ", fmt("Lua", "Lua prompt") }, + [l("%")] = { cmd("luafile %"), fmt("Lua", "Luafile") }, + [l(";")] = { f.comment_line, fmt("Comment", "Comment line") }, + [l(" ")] = { cmd("wincmd w"), fmt("Window", "Switch window") }, - -- UI utils - [l("uw")] = { f.toggle_wrap, fmt("LineWrap", "Toggle wrap") }, - [l("ug")] = { cmd("GuessIndent"), fmt("Indent", "Guess indent") }, - [l("uf")] = { f.set_filetype, fmt("DefaultFile", "Set filetype") }, - [l("ui")] = { f.set_indent, fmt("Indent", "Set indentation") }, - [l("uI")] = { f.set_indent_type, fmt("Indent", "Set indentation type") }, - [l("us")] = { cmd("nohlsearch"), fmt("Clear", "Clear search highlights") }, + -- UI utils + [l("uw")] = { f.toggle_wrap, fmt("LineWrap", "Toggle wrap") }, + [l("ug")] = { cmd("GuessIndent"), fmt("Indent", "Guess indent") }, + [l("uf")] = { f.set_filetype, fmt("DefaultFile", "Set filetype") }, + [l("ui")] = { f.set_indent, fmt("Indent", "Set indentation") }, + [l("uI")] = { f.set_indent_type, fmt("Indent", "Set indentation type") }, + [l("us")] = { cmd("nohlsearch"), fmt("Clear", "Clear search highlights") }, + [""] = { cmd("OverseerRun"), "Overseer Run" }, + [""] = { cmd("OverseerToggle"), "Overseer Toggle" }, + -- Neotree + [l("e")] = { cmd("Neotree toggle"), fmt("FileTree", "Toggle Neotree") }, - [""] = { cmd("OverseerRun"), "Overseer Run" }, - [""] = { cmd("OverseerToggle"), "Overseer Toggle" }, - -- Neotree - [l("e")] = { cmd("Neotree toggle"), fmt("FileTree", "Toggle Neotree") }, + -- move.nvim + [""] = { cmd("MoveLine(1)"), "Move line down" }, + [""] = { cmd("MoveLine(-1)"), "Move line up" }, + [""] = { cmd("MoveHChar(-1)"), "Move character left" }, + [""] = { cmd("MoveHChar(1)"), "Move character right" }, - -- move.nvim - [""] = { cmd("MoveLine(1)"), "Move line down" }, - [""] = { cmd("MoveLine(-1)"), "Move line up" }, - [""] = { cmd("MoveHChar(-1)"), "Move character left" }, - [""] = { cmd("MoveHChar(1)"), "Move character right" }, + -- ccc + [l("cp")] = { cmd("CccPick"), fmt("ColorPicker", "Pick color") }, + [l("cc")] = { cmd("CccConvert"), fmt("Swap", "Convert color") }, + [l("ce")] = { cmd("CccHighlighterEnable"), fmt("ColorOn", "Enable highlights") }, + [l("cd")] = { cmd("CccHighlighterDisable"), fmt("ColorOff", "Disable highlights") }, - -- ccc - [l("cp")] = { cmd("CccPick"), fmt("ColorPicker", "Pick color") }, - [l("cc")] = { cmd("CccConvert"), fmt("Swap", "Convert color") }, - [l("ce")] = { cmd("CccHighlighterEnable"), fmt("ColorOn", "Enable highlights") }, - [l("cd")] = { cmd("CccHighlighterDisable"), fmt("ColorOff", "Disable highlights") }, + -- buffer utils + [l("bq")] = { cmd("BufDel"), fmt("Close", "Close current buffer") }, + [l("bQ")] = { cmd("BufDel!"), fmt("Close", "close current buffer!") }, + [l("bb")] = { cmd("BufferLinePick"), fmt("Open", "Pick to open buffer") }, + [l("bd")] = { cmd("BufferLinePickClose"), fmt("Close", "Pick to close buffer") }, + [l("bl")] = { cmd("BufferLineCloseLeft"), fmt("CloseMultiple", "Close buffers to the left") }, + [l("br")] = { cmd("BufferLineCloseRight"), fmt("CloseMultiple", "Close buffers to the right") }, + [l("bn")] = { cmd("BufferLineCycleNext"), fmt("NextBuffer", "Move to next buffer") }, + [l("bp")] = { cmd("BufferLineCyclePrev"), fmt("PrevBuffer", "Move to previous buffer") }, + [l("bi")] = { cmd("BufferLineTogglePin"), fmt("Pin", "Pin buffer") }, + [l("bg")] = { f.first_buffer, fmt("PrevBuffer", "Move to first buffer") }, + [l("bG")] = { f.last_buffer, fmt("NextBuffer", "Move to last buffer") }, + [l("bv")] = { f.buf_vsplit, fmt("Vertical", "Vertical split") }, + [l("bh")] = { f.buf_hsplit, fmt("Horizontal", "Horizontal split") }, - -- buffer utils - [l("bq")] = { cmd("BufDel"), fmt("Close", "Close current buffer") }, - [l("bQ")] = { cmd("BufDel!"), fmt("Close", "close current buffer!") }, - [l("bb")] = { cmd("BufferLinePick"), fmt("Open", "Pick to open buffer") }, - [l("bd")] = { cmd("BufferLinePickClose"), fmt("Close", "Pick to close buffer") }, - [l("bl")] = { cmd("BufferLineCloseLeft"), fmt("CloseMultiple", "Close buffers to the left") }, - [l("br")] = { cmd("BufferLineCloseRight"), fmt("CloseMultiple", "Close buffers to the right") }, - [l("bn")] = { cmd("BufferLineCycleNext"), fmt("NextBuffer", "Move to next buffer") }, - [l("bp")] = { cmd("BufferLineCyclePrev"), fmt("PrevBuffer", "Move to previous buffer") }, - [l("bi")] = { cmd("BufferLineTogglePin"), fmt("Pin", "Pin buffer") }, - [l("bg")] = { f.first_buffer, fmt("PrevBuffer", "Move to first buffer") }, - [l("bG")] = { f.last_buffer, fmt("NextBuffer", "Move to last buffer") }, - [l("bv")] = { f.buf_vsplit, fmt("Vertical", "Vertical split") }, - [l("bh")] = { f.buf_hsplit, fmt("Horizontal", "Horizontal split") }, + -- gitsigns + [l("gb")] = { cmd("Gitsigns toggle_current_line_blame"), fmt("GitDiff", "Line blame") }, + [l("gd")] = { cmd("Gitsigns diffthis"), fmt("GitDiff", "Show diff") }, + [l("gD")] = { cmd("Gitsigns toggle_deleted"), fmt("DiffRemoved", "Toggle deleted") }, + [l("gp")] = { cmd("Gitsigns preview_hunk"), fmt("Popup", "Preview hunk") }, + [l("gP")] = { cmd("Gitsigns preview_hunk_inline"), fmt("Popup", "Preview hunk inline") }, + [l("gn")] = { cmd("Gitsigns next_hunk"), fmt("Down", "Next hunk") }, + [l("gN")] = { cmd("Gitsigns prev_hunk"), fmt("Up", "Previous hunk") }, + [l("gr")] = { cmd("Gitsigns reset_hunk"), fmt("Restore", "Revert hunk") }, + [l("gs")] = { cmd("Gitsigns stage_hunk"), fmt("Save", "Stage hunk") }, + [l("gv")] = { cmd("Gitsigns select_hunk"), fmt("Visual", "Select hunk") }, + [l("gw")] = { cmd("Gitsigns toggle_word_diff"), fmt("GitDiff", "Toggle word diff") }, + [l("gg")] = { cmd("Telescope git_status"), fmt("Git", "Git status") }, - -- gitsigns - [l("gb")] = { cmd("Gitsigns toggle_current_line_blame"), fmt("GitDiff", "Line blame") }, - [l("gd")] = { cmd("Gitsigns diffthis"), fmt("GitDiff", "Show diff") }, - [l("gD")] = { cmd("Gitsigns toggle_deleted"), fmt("DiffRemoved", "Toggle deleted") }, - [l("gp")] = { cmd("Gitsigns preview_hunk"), fmt("Popup", "Preview hunk") }, - [l("gP")] = { cmd("Gitsigns preview_hunk_inline"), fmt("Popup", "Preview hunk inline") }, - [l("gn")] = { cmd("Gitsigns next_hunk"), fmt("Down", "Next hunk") }, - [l("gN")] = { cmd("Gitsigns prev_hunk"), fmt("Up", "Previous hunk") }, - [l("gr")] = { cmd("Gitsigns reset_hunk"), fmt("Restore", "Revert hunk") }, - [l("gs")] = { cmd("Gitsigns stage_hunk"), fmt("Save", "Stage hunk") }, - [l("gv")] = { cmd("Gitsigns select_hunk"), fmt("Visual", "Select hunk") }, - [l("gw")] = { cmd("Gitsigns toggle_word_diff"), fmt("GitDiff", "Toggle word diff") }, - [l("gg")] = { cmd("Telescope git_status"), fmt("Git", "Git status") }, + -- toggleterm + [l("th")] = { cmd("ToggleTerm direction=horizontal"), fmt("Horizontal", "Horizontal terminal") }, + [l("tv")] = { + cmd("ToggleTerm direction=vertical size=60"), + fmt("Vertical", "Vertical terminal"), + }, + [l("tf")] = { cmd("ToggleTerm direction=float"), fmt("Window", "Floating terminal") }, + [l("tl")] = { f.open_lazygit, fmt("GitBranch", "Lazygit terminal") }, + [l("tg")] = { f.open_glow, fmt("Markdown", "Glow terminal") }, - -- toggleterm - [l("th")] = { cmd("ToggleTerm direction=horizontal"), fmt("Horizontal", "Horizontal terminal") }, - [l("tv")] = { - cmd("ToggleTerm direction=vertical size=60"), - fmt("Vertical", "Vertical terminal"), - }, - [l("tf")] = { cmd("ToggleTerm direction=float"), fmt("Window", "Floating terminal") }, - [l("tl")] = { f.open_lazygit, fmt("GitBranch", "Lazygit terminal") }, - [l("tg")] = { f.open_glow, fmt("Markdown", "Glow terminal") }, + -- wincmd + [""] = { cmd("wincmd h"), "Move right" }, + [""] = { cmd("wincmd j"), "Move down" }, + [""] = { cmd("wincmd k"), "Move up" }, + [""] = { cmd("wincmd l"), "Move left" }, - -- wincmd - [""] = { cmd("wincmd h"), "Move right" }, - [""] = { cmd("wincmd j"), "Move down" }, - [""] = { cmd("wincmd k"), "Move up" }, - [""] = { cmd("wincmd l"), "Move left" }, + -- telescope + [l("ff")] = { cmd("Telescope find_files"), fmt("FileSearch", "Find files") }, + [l("fF")] = { cmd("Telescope find_files hidden=true"), fmt("FileSearch", "Find all files") }, + [l("fg")] = { cmd("Telescope live_grep"), fmt("TextSearch", "Live grep") }, + [l("fb")] = { cmd("Telescope buffers"), fmt("TabSearch", "Find buffer") }, + [l("fh")] = { cmd("Telescope help_tags"), fmt("Help", "Find help") }, + [l("fd")] = { cmd("Telescope diagnostics"), fmt("Warn", "Find diagnostic") }, + [l("fs")] = { cmd("Telescope lsp_document_symbols"), fmt("Braces", "Document symbol") }, + [l("fr")] = { cmd("Telescope resume"), fmt("Run", "Resume search") }, + [l("fn")] = { cmd("Telescope notify"), fmt("Notification", "Show notifications") }, + [l("fo")] = { cmd("Telescope vim_options"), fmt("Config", "Vim options") }, + [l("f:")] = { cmd("Telescope command_history"), fmt("History", "Command history") }, + [l("fm")] = { cmd("Telescope man_pages"), fmt("Info", "Search man") }, + [l("fR")] = { cmd("Telescope reloader"), fmt("Restore", "Reload module") }, + [l("fH")] = { cmd("Telescope highlights"), fmt("Color", "Highlight group") }, + [l("ft")] = { cmd("Telescope treesitter"), fmt("Symbol", "Treesitter") }, + [l("fz")] = { cmd("Telescope current_buffer_fuzzy_find"), fmt("Search", "Buffer fuzzy find") }, + [l("fp")] = { cmd("Telescope registers"), fmt("Clipboard", "Registers") }, + [l("fq")] = { cmd("Telescope quickfix"), fmt("Fix", "Quickfix") }, + [l("gc")] = { cmd("Telescope git_bcommits"), fmt("GitCommit", "Find branch commit") }, + [l("gC")] = { cmd("Telescope git_commits"), fmt("GitCommit", "Find commit") }, + [l("gB")] = { cmd("Telescope git_branches"), fmt("GitBranch", "Find git branch") }, - -- telescope - [l("ff")] = { cmd("Telescope find_files"), fmt("FileSearch", "Find files") }, - [l("fF")] = { cmd("Telescope find_files hidden=true"), fmt("FileSearch", "Find all files") }, - [l("fg")] = { cmd("Telescope live_grep"), fmt("TextSearch", "Live grep") }, - [l("fb")] = { cmd("Telescope buffers"), fmt("TabSearch", "Find buffer") }, - [l("fh")] = { cmd("Telescope help_tags"), fmt("Help", "Find help") }, - [l("fd")] = { cmd("Telescope diagnostics"), fmt("Warn", "Find diagnostic") }, - [l("fs")] = { cmd("Telescope lsp_document_symbols"), fmt("Braces", "Document symbol") }, - [l("fr")] = { cmd("Telescope resume"), fmt("Run", "Resume search") }, - [l("fn")] = { cmd("Telescope notify"), fmt("Notification", "Show notifications") }, - [l("fo")] = { cmd("Telescope vim_options"), fmt("Config", "Vim options") }, - [l("f:")] = { cmd("Telescope command_history"), fmt("History", "Command history") }, - [l("fm")] = { cmd("Telescope man_pages"), fmt("Info", "Search man") }, - [l("fR")] = { cmd("Telescope reloader"), fmt("Restore", "Reload module") }, - [l("fH")] = { cmd("Telescope highlights"), fmt("Color", "Highlight group") }, - [l("ft")] = { cmd("Telescope treesitter"), fmt("Symbol", "Treesitter") }, - [l("fz")] = { cmd("Telescope current_buffer_fuzzy_find"), fmt("Search", "Buffer fuzzy find") }, - [l("fp")] = { cmd("Telescope registers"), fmt("Clipboard", "Registers") }, - [l("fq")] = { cmd("Telescope quickfix"), fmt("Fix", "Quickfix") }, - [l("gc")] = { cmd("Telescope git_bcommits"), fmt("GitCommit", "Find branch commit") }, - [l("gC")] = { cmd("Telescope git_commits"), fmt("GitCommit", "Find commit") }, - [l("gB")] = { cmd("Telescope git_branches"), fmt("GitBranch", "Find git branch") }, + -- Lazy + [l("L")] = { cmd("Lazy"), fmt("Package", "Plugin manager") }, - -- Lazy - [l("L")] = { cmd("Lazy"), fmt("Package", "Plugin manager") }, + -- Mason + [l("M")] = { cmd("Mason"), fmt("Package", "Mason") }, - -- Mason - [l("M")] = { cmd("Mason"), fmt("Package", "Mason") }, + -- DAP + [l("do")] = { f.open_dapui, fmt("Open", "Open debugger UI") }, + [l("dq")] = { f.close_dapui, fmt("Close", "Close debugger UI") }, + [l("dt")] = { f.toggle_dapui, fmt("Toggle", "Toggle debugger") }, + [l("dc")] = { cmd("DapTerminate"), fmt("Stop", "Terminate session") }, + [l("dr")] = { cmd("DapRestartFrame"), fmt("Restart", "Restart frame") }, + [l("db")] = { cmd("DapToggleBreakpoint"), fmt("Toggle", "Toggle breakpoint") }, + [l("dl")] = { cmd("DapShowLog"), fmt("DefaultFile", "Show logs") }, + [""] = { cmd("DapContinue"), "Continue session" }, + [""] = { cmd("DapToggleBreakpoint"), "Toggle breakpoint" }, + [""] = { cmd("DapStepInto"), "Step into" }, + [""] = { cmd("DapStepOut"), "Step out" }, + [""] = { cmd("DapStepOver"), "Step over" }, - -- DAP - [l("do")] = { f.open_dapui, fmt("Open", "Open debugger UI") }, - [l("dq")] = { f.close_dapui, fmt("Close", "Close debugger UI") }, - [l("dt")] = { f.toggle_dapui, fmt("Toggle", "Toggle debugger") }, - [l("dc")] = { cmd("DapTerminate"), fmt("Stop", "Terminate session") }, - [l("dr")] = { cmd("DapRestartFrame"), fmt("Restart", "Restart frame") }, - [l("db")] = { cmd("DapToggleBreakpoint"), fmt("Toggle", "Toggle breakpoint") }, - [l("dl")] = { cmd("DapShowLog"), fmt("DefaultFile", "Show logs") }, - [""] = { cmd("DapContinue"), "Continue session" }, - [""] = { cmd("DapToggleBreakpoint"), "Toggle breakpoint" }, - [""] = { cmd("DapStepInto"), "Step into" }, - [""] = { cmd("DapStepOut"), "Step out" }, - [""] = { cmd("DapStepOver"), "Step over" }, + -- telescope DAP + [l("dB")] = { + lua("require('telescope').extensions.dap.list_breakpoints()"), + fmt("Breakpoint", "List breakpoints"), + }, + [l("dv")] = { + lua("require('telescope').extensions.dap.variables()"), + fmt("Variable", "List variables"), + }, + [l("df")] = { + lua("require('telescope').extensions.dap.frames()"), + fmt("Stack", "List frames"), + }, + [l("dF")] = { + lua("require('telescope').extensions.dap.configurations()"), + fmt("Config", "List configurations"), + }, + [l("dC")] = { + lua("require('telescope').extensions.dap.commands()"), + fmt("Command", "List commands"), + }, - -- telescope DAP - [l("dB")] = { - lua("require('telescope').extensions.dap.list_breakpoints()"), - fmt("Breakpoint", "List breakpoints"), - }, - [l("dv")] = { - lua("require('telescope').extensions.dap.variables()"), - fmt("Variable", "List variables"), - }, - [l("df")] = { - lua("require('telescope').extensions.dap.frames()"), - fmt("Stack", "List frames"), - }, - [l("dF")] = { - lua("require('telescope').extensions.dap.configurations()"), - fmt("Config", "List configurations"), - }, - [l("dC")] = { - lua("require('telescope').extensions.dap.commands()"), - fmt("Command", "List commands"), - }, + -- session-manager + [l("Ss")] = { cmd("SessionManager save_current_session"), fmt("Save", "Save session") }, + [l("Sl")] = { cmd("SessionManager load_session"), fmt("Restore", "Load session") }, + [l("SL")] = { cmd("SessionManager load_last_session"), fmt("Restore", "Load last session") }, + [l("Sd")] = { cmd("SessionManager delete_session"), fmt("Trash", "Delete session") }, + [l("SD")] = { + cmd("SessionManager load_current_dir_session"), + fmt("FolderClock", "Load current directory session"), + }, - -- session-manager - [l("Ss")] = { cmd("SessionManager save_current_session"), fmt("Save", "Save session") }, - [l("Sl")] = { cmd("SessionManager load_session"), fmt("Restore", "Load session") }, - [l("SL")] = { cmd("SessionManager load_last_session"), fmt("Restore", "Load last session") }, - [l("Sd")] = { cmd("SessionManager delete_session"), fmt("Trash", "Delete session") }, - [l("SD")] = { - cmd("SessionManager load_current_dir_session"), - fmt("FolderClock", "Load current directory session"), - }, + -- notify + [l("nn")] = { + lua("require('notify').dismiss()"), + fmt("NotificationDismiss", "Dismiss notifications"), + }, - -- notify - [l("nn")] = { - lua("require('notify').dismiss()"), - fmt("NotificationDismiss", "Dismiss notifications"), - }, + -- lspconfig + [l("li")] = { cmd("LspInfo"), fmt("Info", "Server info") }, + [l("lI")] = { cmd("LspLog"), fmt("DefaultFile", "Server logs") }, + [l("lS")] = { ":LspStart ", fmt("Run", "Start server") }, + [l("lq")] = { ":LspStop ", fmt("Stop", "Stop server") }, + [l("lR")] = { cmd("LspRestart"), fmt("Restart", "Restart server") }, - -- lspconfig - [l("li")] = { cmd("LspInfo"), fmt("Info", "Server info") }, - [l("lI")] = { cmd("LspLog"), fmt("DefaultFile", "Server logs") }, - [l("lS")] = { ":LspStart ", fmt("Run", "Start server") }, - [l("lq")] = { ":LspStop ", fmt("Stop", "Stop server") }, - [l("lR")] = { cmd("LspRestart"), fmt("Restart", "Restart server") }, + -- dropbar + [l("ok")] = { lua("require('dropbar.api').goto_context_start()"), fmt("Up", "Context start") }, + [l("oo")] = { lua("require('dropbar.api').pick()"), fmt("Check", "Pick node") }, - -- dropbar - [l("ok")] = { lua("require('dropbar.api').goto_context_start()"), fmt("Up", "Context start") }, - [l("oo")] = { lua("require('dropbar.api').pick()"), fmt("Check", "Pick node") }, + -- DbUI + [l("Dd")] = { cmd("DBUIToggle"), fmt("Toggle", "Toggle DbUI") }, + [l("Da")] = { cmd("DBUIAddConnection"), fmt("Add", "Add connection") }, - -- DbUI - [l("Dd")] = { cmd("DBUIToggle"), fmt("Toggle", "Toggle DbUI") }, - [l("Da")] = { cmd("DBUIAddConnection"), fmt("Add", "Add connection") }, + -- nvim-devdocs + [l("v ")] = { cmd("DevdocsToggle"), fmt("Window", "Toggle floating window") }, + [l("vc")] = { cmd("DevdocsOpenCurrentFloat"), fmt("BookmarkSearch", "Open current file docs") }, + [l("vv")] = { cmd("DevdocsOpenFloat"), fmt("BookmarkSearch", "Open in floating window") }, + [l("vV")] = { cmd("DevdocsOpen"), fmt("BookmarkSearch", "Open in a normal buffer") }, + [l("vf")] = { ":DevdocsOpenFloat ", fmt("BookmarkSearch", "Open documentation") }, + [l("vi")] = { ":DevdocsInstall ", fmt("Install", "Install documentation") }, + [l("vu")] = { ":DevdocsUninstall ", fmt("Trash", "Install documentation") }, - -- nvim-devdocs - [l("v ")] = { cmd("DevdocsToggle"), fmt("Window", "Toggle floating window") }, - [l("vc")] = { cmd("DevdocsOpenCurrentFloat"), fmt("BookmarkSearch", "Open current file docs") }, - [l("vv")] = { cmd("DevdocsOpenFloat"), fmt("BookmarkSearch", "Open in floating window") }, - [l("vV")] = { cmd("DevdocsOpen"), fmt("BookmarkSearch", "Open in a normal buffer") }, - [l("vf")] = { ":DevdocsOpenFloat ", fmt("BookmarkSearch", "Open documentation") }, - [l("vi")] = { ":DevdocsInstall ", fmt("Install", "Install documentation") }, - [l("vu")] = { ":DevdocsUninstall ", fmt("Trash", "Install documentation") }, + -- crates + [l("Cv")] = { + lua("require('crates').show_versions_popup()"), + fmt("Info", "Show versions popup"), + }, + [l("Cf")] = { + lua("require('crates').show_features_popup()"), + fmt("Stack", "Show features popup"), + }, + [l("Cd")] = { + lua("require('crates').show_dependencies_popup()"), + fmt("Dependencies", "Show dependencies popup"), + }, + [l("Cu")] = { + lua("require('crates').update_crate()"), + fmt("Update", "Update crate"), + }, + [l("CU")] = { + lua("require('crates').update_all_crates()"), + fmt("Update", "Update all crates"), + }, + [l("CD")] = { + lua("require('crates').open_documentation()"), + fmt("DefaultFile", "Open documentation"), + }, + [l("Ch")] = { + lua("require('crates').open_homepage()"), + fmt("Web", "Open homepage"), + }, + [l("Cc")] = { + lua("require('crates').open_crates_io()"), + fmt("Package", "Open crates.io"), + }, + [l("Cr")] = { + lua("require('crates').open_repository()"), + fmt("Github", "Open repository"), + }, + }, + v = { + -- move.nvim + [""] = { rcmd("MoveBlock(-1)"), "Move line up" }, + [""] = { rcmd("MoveBlock(1)"), "Move line down" }, + [""] = { rcmd("MoveHBlock(-1)"), "Move character left" }, + [""] = { rcmd("MoveHBlock(1)"), "Move character right" }, - -- crates - [l("Cv")] = { - lua("require('crates').show_versions_popup()"), - fmt("Info", "Show versions popup"), - }, - [l("Cf")] = { - lua("require('crates').show_features_popup()"), - fmt("Stack", "Show features popup"), - }, - [l("Cd")] = { - lua("require('crates').show_dependencies_popup()"), - fmt("Dependencies", "Show dependencies popup"), - }, - [l("Cu")] = { - lua("require('crates').update_crate()"), - fmt("Update", "Update crate"), - }, - [l("CU")] = { - lua("require('crates').update_all_crates()"), - fmt("Update", "Update all crates"), - }, - [l("CD")] = { - lua("require('crates').open_documentation()"), - fmt("DefaultFile", "Open documentation"), - }, - [l("Ch")] = { - lua("require('crates').open_homepage()"), - fmt("Web", "Open homepage"), - }, - [l("Cc")] = { - lua("require('crates').open_crates_io()"), - fmt("Package", "Open crates.io"), - }, - [l("Cr")] = { - lua("require('crates').open_repository()"), - fmt("Github", "Open repository"), - }, - }, - v = { - -- move.nvim - [""] = { rcmd("MoveBlock(-1)"), "Move line up" }, - [""] = { rcmd("MoveBlock(1)"), "Move line down" }, - [""] = { rcmd("MoveHBlock(-1)"), "Move character left" }, - [""] = { rcmd("MoveHBlock(1)"), "Move character right" }, + -- utils + ["q"] = { "" }, + [l("y")] = { '"+y', fmt("Clipboard", "yank to clipboard") }, + [l("p")] = { '"+p', fmt("Clipboard", "Paste from clipboard") }, + [l("P")] = { '"+P', fmt("Clipboard", "Paste from clipboard") }, + [l(";")] = { f.comment_selection, fmt("Comment", "Comment selection") }, - -- utils - ["q"] = { "" }, - [l("y")] = { '"+y', fmt("Clipboard", "yank to clipboard") }, - [l("p")] = { '"+p', fmt("Clipboard", "Paste from clipboard") }, - [l("P")] = { '"+P', fmt("Clipboard", "Paste from clipboard") }, - [l(";")] = { f.comment_selection, fmt("Comment", "Comment selection") }, + -- gitsigns + [l("gr")] = { cmd("Gitsigns reset_hunk"), fmt("Restore", "Revert hunk") }, - -- gitsigns - [l("gr")] = { cmd("Gitsigns reset_hunk"), fmt("Restore", "Revert hunk") }, + -- crates + [l("Cu")] = { lua("require('crates').update_crates()"), fmt("Update", "Update crates") }, + }, - -- crates - [l("Cu")] = { lua("require('crates').update_crates()"), fmt("Update", "Update crates") }, - }, + t = { + -- toggleterm + [""] = { [[]] }, - t = { - -- toggleterm - [""] = { [[]] }, - - -- wincmd - [""] = { cmd("wincmd h"), "Move right" }, - [""] = { cmd("wincmd j"), "Move down" }, - [""] = { cmd("wincmd k"), "Move up" }, - [""] = { cmd("wincmd l"), "Move left" }, - }, + -- wincmd + [""] = { cmd("wincmd h"), "Move right" }, + [""] = { cmd("wincmd j"), "Move down" }, + [""] = { cmd("wincmd k"), "Move up" }, + [""] = { cmd("wincmd l"), "Move left" }, + }, } diff --git a/modules/home-manager/vim/config/lua/core/signs.lua b/modules/home-manager/vim/config/lua/core/signs.lua index b7751c8..2e5d4ed 100644 --- a/modules/home-manager/vim/config/lua/core/signs.lua +++ b/modules/home-manager/vim/config/lua/core/signs.lua @@ -1,9 +1,9 @@ local icons = require("utils.icons").icons return { - { name = "DiagnosticSignError", text = icons.Error, texthl = "DiagnosticError" }, - { name = "DiagnosticSignHint", text = icons.Hint, texthl = "DiagnosticHint" }, - { name = "DiagnosticSignWarn", text = icons.Warn, texthl = "DiagnosticWarn" }, - { name = "DiagnosticSignInfo", text = icons.Info, texthl = "DiagnosticInfo" }, - { name = "DapBreakpoint", text = icons.Breakpoint, texthl = "Breakpoint" }, + { name = "DiagnosticSignError", text = icons.Error, texthl = "DiagnosticError" }, + { name = "DiagnosticSignHint", text = icons.Hint, texthl = "DiagnosticHint" }, + { name = "DiagnosticSignWarn", text = icons.Warn, texthl = "DiagnosticWarn" }, + { name = "DiagnosticSignInfo", text = icons.Info, texthl = "DiagnosticInfo" }, + { name = "DapBreakpoint", text = icons.Breakpoint, texthl = "Breakpoint" }, } diff --git a/modules/home-manager/vim/config/lua/lsp/autocmd.lua b/modules/home-manager/vim/config/lua/lsp/autocmd.lua index f357873..9ebcdfe 100644 --- a/modules/home-manager/vim/config/lua/lsp/autocmd.lua +++ b/modules/home-manager/vim/config/lua/lsp/autocmd.lua @@ -1,18 +1,18 @@ local lsp = require("lsp.functions") return { - ["textDocument/codeLens"] = { - event = { "BufEnter", "InsertLeave" }, - opts = { - group = vim.api.nvim_create_augroup("LspCodelens", {}), - callback = lsp.refresh_codelens, - }, - }, - ["textDocument/formatting"] = { - event = "BufWritePost", - opts = { - group = vim.api.nvim_create_augroup("LspFormatting", {}), - callback = lsp.format, - }, - }, + ["textDocument/codeLens"] = { + event = { "BufEnter", "InsertLeave" }, + opts = { + group = vim.api.nvim_create_augroup("LspCodelens", {}), + callback = lsp.refresh_codelens, + }, + }, + ["textDocument/formatting"] = { + event = "BufWritePost", + opts = { + group = vim.api.nvim_create_augroup("LspFormatting", {}), + callback = lsp.format, + }, + }, } diff --git a/modules/home-manager/vim/config/lua/lsp/functions.lua b/modules/home-manager/vim/config/lua/lsp/functions.lua index 11c4c59..0e33bff 100644 --- a/modules/home-manager/vim/config/lua/lsp/functions.lua +++ b/modules/home-manager/vim/config/lua/lsp/functions.lua @@ -1,42 +1,72 @@ local M = {} -M.definitions = function() vim.cmd("Telescope lsp_definitions") end -M.type_definition = function() vim.lsp.buf.type_definition() end -M.declarations = function() vim.lsp.buf.declaration() end -M.implementations = function() vim.cmd("Telescope lsp_implementations") end -M.references = function() vim.cmd("Telescope lsp_references") end -M.hover = function() vim.lsp.buf.hover() end -M.rename = function() vim.lsp.buf.rename() end -M.signature_help = function() vim.lsp.buf.signature_help() end -M.symbols = function() vim.cmd("Telescope lsp_workspace_symbols") end -M.refresh_codelens = function() vim.lsp.codelens.refresh() end -M.run_codelens = function() vim.lsp.codelens.run() end -M.toggle_inlay_hint = function() vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled(0)) end +M.definitions = function() + vim.cmd("Telescope lsp_definitions") +end +M.type_definition = function() + vim.lsp.buf.type_definition() +end +M.declarations = function() + vim.lsp.buf.declaration() +end +M.implementations = function() + vim.cmd("Telescope lsp_implementations") +end +M.references = function() + vim.cmd("Telescope lsp_references") +end +M.hover = function() + vim.lsp.buf.hover() +end +M.rename = function() + vim.lsp.buf.rename() +end +M.signature_help = function() + vim.lsp.buf.signature_help() +end +M.symbols = function() + vim.cmd("Telescope lsp_workspace_symbols") +end +M.refresh_codelens = function() + vim.lsp.codelens.refresh() +end +M.run_codelens = function() + vim.lsp.codelens.run() +end +M.toggle_inlay_hint = function() + vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled(0)) +end M.diagnostics = function() - local _, win = vim.diagnostic.open_float() - if win then - vim.api.nvim_win_set_config(win, { border = "rounded" }) - vim.wo[win].signcolumn = "yes:1" - end + local _, win = vim.diagnostic.open_float() + if win then + vim.api.nvim_win_set_config(win, { border = "rounded" }) + vim.wo[win].signcolumn = "yes:1" + end +end +M.next_diagnostic = function() + vim.diagnostic.goto_next() +end +M.prev_diagnostic = function() + vim.diagnostic.goto_prev() end -M.next_diagnostic = function() vim.diagnostic.goto_next() end -M.prev_diagnostic = function() vim.diagnostic.goto_prev() end M.format = function() - vim.api.nvim_create_autocmd("TextChanged", { - group = vim.api.nvim_create_augroup("ApplyFormattingEdit", {}), - buffer = vim.api.nvim_get_current_buf(), - callback = function() - vim.cmd("silent noautocmd update") - vim.diagnostic.show() - vim.api.nvim_del_augroup_by_name("ApplyFormattingEdit") - end, - }) - vim.lsp.buf.format({ - async = true, - filter = function(client) return client.name == "null-ls" end, - }) + vim.api.nvim_create_autocmd("TextChanged", { + group = vim.api.nvim_create_augroup("ApplyFormattingEdit", {}), + buffer = vim.api.nvim_get_current_buf(), + callback = function() + vim.cmd("silent noautocmd update") + vim.diagnostic.show() + vim.api.nvim_del_augroup_by_name("ApplyFormattingEdit") + end, + }) + vim.lsp.buf.format({ + async = true, + filter = function(client) + return client.name == "null-ls" + end, + }) end return M diff --git a/modules/home-manager/vim/config/lua/lsp/handlers.lua b/modules/home-manager/vim/config/lua/lsp/handlers.lua index acd7aec..477dc2a 100644 --- a/modules/home-manager/vim/config/lua/lsp/handlers.lua +++ b/modules/home-manager/vim/config/lua/lsp/handlers.lua @@ -1,59 +1,63 @@ local M = {} local make_config = function(name, config) - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities.textDocument.completion.completionItem.snippetSupport = true - capabilities.textDocument.colorProvider = { dynamicRegistration = true } - local extended_config = vim.tbl_extend("error", { capabilities = capabilities }, config) + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.completion.completionItem.snippetSupport = true + capabilities.textDocument.colorProvider = { dynamicRegistration = true } + local extended_config = vim.tbl_extend("error", { capabilities = capabilities }, config) - return function() require("lspconfig")[name].setup(extended_config) end + return function() + require("lspconfig")[name].setup(extended_config) + end end -- Default handler -M[1] = function(server_name) make_config(server_name, {})() end +M[1] = function(server_name) + make_config(server_name, {})() +end M.lua_ls = make_config("lua_ls", { - settings = { - Lua = { - hint = { - enable = true, - }, - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - "/usr/local/share/nvim/runtime/lua", - "~/.local/share/nvim/lazy/neodev.nvim/types/stable", - }, - }, - }, - }, + settings = { + Lua = { + hint = { + enable = true, + }, + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = { + "/usr/local/share/nvim/runtime/lua", + "~/.local/share/nvim/lazy/neodev.nvim/types/stable", + }, + }, + }, + }, }) M.cssls = make_config("cssls", { - settings = { - css = { - validate = true, - lint = { - unknownAtRules = "ignore", - }, - }, - }, + settings = { + css = { + validate = true, + lint = { + unknownAtRules = "ignore", + }, + }, + }, }) M.tailwindcss = make_config("tailwindcss", { - on_attach = function() - local bufnr = vim.api.nvim_get_current_buf() - require("document-color").buf_attach(bufnr) - end, + on_attach = function() + local bufnr = vim.api.nvim_get_current_buf() + require("document-color").buf_attach(bufnr) + end, }) M.clangd = make_config("clangd", { - cmd = { - "clangd", - "--offset-encoding=utf-16", - }, + cmd = { + "clangd", + "--offset-encoding=utf-16", + }, }) return M diff --git a/modules/home-manager/vim/config/lua/lsp/keymaps.lua b/modules/home-manager/vim/config/lua/lsp/keymaps.lua index 3b50d4d..470a7ee 100644 --- a/modules/home-manager/vim/config/lua/lsp/keymaps.lua +++ b/modules/home-manager/vim/config/lua/lsp/keymaps.lua @@ -4,49 +4,49 @@ local l, cmd = map.leader, map.cmd local fmt = require("utils.icons").fmt return { - ["textDocument/formatting"] = { - [l("lf")] = { lsp.format, fmt("Format", "Format buffer") }, - }, - ["textDocument/publishDiagnostics"] = { - [l("ld")] = { lsp.diagnostics, fmt("Warn", "Hover diagnostic") }, - [""] = { lsp.next_diagnostic, "Next diagnostic" }, - [""] = { lsp.prev_diagnostic, "Previous diagnostic" }, - }, - ["textDocument/codeAction"] = { - [l("a ")] = { cmd("CodeActionToggleLabel"), fmt("Toggle", "Toggle label") }, - }, - ["textDocument/definition"] = { - ["gd"] = { lsp.definitions, "Go to definition" }, - }, - ["textDocument/declaration"] = { - ["gD"] = { lsp.declarations, "Go to declaration" }, - }, - ["textDocument/hover"] = { - ["K"] = { lsp.hover, "Hover info" }, - }, - ["textDocument/implementation"] = { - ["gI"] = { lsp.implementations, "Symbol implementation" }, - }, - ["textDocument/references"] = { - ["gr"] = { lsp.references, "Go to reference" }, - }, - ["textDocument/rename"] = { - ["lr"] = { lsp.rename, fmt("Edit", "Rename symbol") }, - }, - ["textDocument/signatureHelp"] = { - ["lH"] = { lsp.signature_help, fmt("Help", "Signature help") }, - }, - ["textDocument/typeDefinition"] = { - ["gT"] = { lsp.type_definition, "Go to type definition" }, - }, - ["textDocument/codeLens"] = { - ["ll"] = { lsp.run_codelens, fmt("Run", "Run codelens") }, - ["lL"] = { lsp.refresh_codelens, fmt("Restart", "Refresh codelens") }, - }, - ["workspace/symbol"] = { - ["ls"] = { lsp.symbols, fmt("Symbol", "Workspace symbols") }, - }, - ["workspace/inlayHint"] = { - ["lh"] = { lsp.toggle_inlay_hint, fmt("Toggle", "Toggle inlay hint") }, - }, + ["textDocument/formatting"] = { + [l("lf")] = { lsp.format, fmt("Format", "Format buffer") }, + }, + ["textDocument/publishDiagnostics"] = { + [l("ld")] = { lsp.diagnostics, fmt("Warn", "Hover diagnostic") }, + [""] = { lsp.next_diagnostic, "Next diagnostic" }, + [""] = { lsp.prev_diagnostic, "Previous diagnostic" }, + }, + ["textDocument/codeAction"] = { + [l("a ")] = { cmd("CodeActionToggleLabel"), fmt("Toggle", "Toggle label") }, + }, + ["textDocument/definition"] = { + ["gd"] = { lsp.definitions, "Go to definition" }, + }, + ["textDocument/declaration"] = { + ["gD"] = { lsp.declarations, "Go to declaration" }, + }, + ["textDocument/hover"] = { + ["K"] = { lsp.hover, "Hover info" }, + }, + ["textDocument/implementation"] = { + ["gI"] = { lsp.implementations, "Symbol implementation" }, + }, + ["textDocument/references"] = { + ["gr"] = { lsp.references, "Go to reference" }, + }, + ["textDocument/rename"] = { + ["lr"] = { lsp.rename, fmt("Edit", "Rename symbol") }, + }, + ["textDocument/signatureHelp"] = { + ["lH"] = { lsp.signature_help, fmt("Help", "Signature help") }, + }, + ["textDocument/typeDefinition"] = { + ["gT"] = { lsp.type_definition, "Go to type definition" }, + }, + ["textDocument/codeLens"] = { + ["ll"] = { lsp.run_codelens, fmt("Run", "Run codelens") }, + ["lL"] = { lsp.refresh_codelens, fmt("Restart", "Refresh codelens") }, + }, + ["workspace/symbol"] = { + ["ls"] = { lsp.symbols, fmt("Symbol", "Workspace symbols") }, + }, + ["workspace/inlayHint"] = { + ["lh"] = { lsp.toggle_inlay_hint, fmt("Toggle", "Toggle inlay hint") }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/editor/core.lua b/modules/home-manager/vim/config/lua/plugins/editor/core.lua index 517718b..72c2ad6 100644 --- a/modules/home-manager/vim/config/lua/plugins/editor/core.lua +++ b/modules/home-manager/vim/config/lua/plugins/editor/core.lua @@ -1,102 +1,106 @@ local format = require("utils.icons").fmt return { - { - "psliwka/vim-smoothie", - keys = { "", "", "zz" }, - }, + { + "psliwka/vim-smoothie", + keys = { "", "", "zz" }, + }, - { - "numToStr/Comment.nvim", - dependencies = { "JoosepAlviste/nvim-ts-context-commentstring" }, - keys = { - { "gcc", mode = { "n" }, desc = "Comment line" }, - { "gc", mode = { "v" }, desc = "Comment selection" }, - }, - config = function() - local ft = require("Comment.ft") + { + "numToStr/Comment.nvim", + dependencies = { "JoosepAlviste/nvim-ts-context-commentstring" }, + keys = { + { "gcc", mode = { "n" }, desc = "Comment line" }, + { "gc", mode = { "v" }, desc = "Comment selection" }, + }, + config = function() + local ft = require("Comment.ft") - ft.hypr = { "# %s" } + ft.hypr = { "# %s" } - require("Comment").setup({ - pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), - }) - end, - }, + require("Comment").setup({ + pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), + }) + end, + }, - { - "NMAC427/guess-indent.nvim", - event = { "BufReadPost", "BufNewFile" }, - opts = { - autocmd = true, - }, - }, + { + "NMAC427/guess-indent.nvim", + event = { "BufReadPost", "BufNewFile" }, + opts = { + autocmd = true, + }, + }, - { - "ojroques/nvim-bufdel", - cmd = { "BufDel", "BufDelAll", "BufDelOthers" }, - opts = { quit = false }, - }, + { + "ojroques/nvim-bufdel", + cmd = { "BufDel", "BufDelAll", "BufDelOthers" }, + opts = { quit = false }, + }, - { - "fedepujol/move.nvim", - cmd = { - "MoveLine", - "MoveHChar", - "MoveBlock", - "MoveHBlock", - }, - }, + { + "fedepujol/move.nvim", + cmd = { + "MoveLine", + "MoveHChar", + "MoveBlock", + "MoveHBlock", + }, + }, - { - "windwp/nvim-autopairs", - event = "InsertEnter", - opts = {}, - }, + { + "windwp/nvim-autopairs", + event = "InsertEnter", + opts = {}, + }, - { - "kylechui/nvim-surround", - keys = { - { "cs", mode = { "n" }, desc = "Change surrounding pair" }, - { "ds", mode = { "n" }, desc = "Delete surrounding pair" }, - { "ys", mode = { "n" }, desc = "Add surrounding pair" }, - { "S", mode = { "v" }, desc = "Add surrounding pair" }, - }, - config = function() require("nvim-surround").setup() end, - }, + { + "kylechui/nvim-surround", + keys = { + { "cs", mode = { "n" }, desc = "Change surrounding pair" }, + { "ds", mode = { "n" }, desc = "Delete surrounding pair" }, + { "ys", mode = { "n" }, desc = "Add surrounding pair" }, + { "S", mode = { "v" }, desc = "Add surrounding pair" }, + }, + config = function() + require("nvim-surround").setup() + end, + }, - { - "kevinhwang91/nvim-ufo", - event = { "BufReadPost", "BufNewFile" }, - dependencies = { "kevinhwang91/promise-async" }, - opts = { - provider_selector = function() return { "treesitter", "indent" } end, - }, - }, + { + "kevinhwang91/nvim-ufo", + event = { "BufReadPost", "BufNewFile" }, + dependencies = { "kevinhwang91/promise-async" }, + opts = { + provider_selector = function() + return { "treesitter", "indent" } + end, + }, + }, - { - "RRethy/vim-illuminate", - event = { "BufReadPost", "BufNewFile" }, - config = function() - require("illuminate").configure({ - filetypes_denylist = { - "neo-tree", - "dropbar_menu", - "CodeAction", - }, - }) - end, - }, + { + "RRethy/vim-illuminate", + event = { "BufReadPost", "BufNewFile" }, + config = function() + require("illuminate").configure({ + filetypes_denylist = { + "neo-tree", + "dropbar_menu", + "CodeAction", + }, + }) + end, + }, - { - "Wansmer/treesj", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - keys = { - { "j", mode = { "n" }, ":TSJSplit", desc = format("Down", "Split node") }, - { "J", mode = { "n" }, ":TSJJoin", desc = format("Up", "Join node") }, - }, - opts = { - use_default_keymaps = false, - }, - }, + { + "Wansmer/treesj", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + keys = { + { "j", mode = { "n" }, ":TSJSplit", desc = format("Down", "Split node") }, + { "J", mode = { "n" }, ":TSJJoin", desc = format("Up", "Join node") }, + }, + opts = { + use_default_keymaps = false, + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/editor/gitsigns.lua b/modules/home-manager/vim/config/lua/plugins/editor/gitsigns.lua index 170cde7..400dedc 100644 --- a/modules/home-manager/vim/config/lua/plugins/editor/gitsigns.lua +++ b/modules/home-manager/vim/config/lua/plugins/editor/gitsigns.lua @@ -1,17 +1,17 @@ return { - "lewis6991/gitsigns.nvim", - event = { "BufReadPre", "BufNewFile" }, - opts = { - signs = { - add = { hl = "GitSignsAdd", text = "▎" }, - change = { hl = "GitSignsChange", text = "▎" }, - untracked = { hl = "GitSignsAdd", text = "▎" }, - delete = { hl = "GitSignsDelete", text = "▎" }, - topdelete = { hl = "GitSignsDelete", text = "▎" }, - changedelete = { hl = "GitSignsChange", text = "▎" }, - }, - preview_config = { - border = "none", - }, - }, + "lewis6991/gitsigns.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = { + signs = { + add = { hl = "GitSignsAdd", text = "▎" }, + change = { hl = "GitSignsChange", text = "▎" }, + untracked = { hl = "GitSignsAdd", text = "▎" }, + delete = { hl = "GitSignsDelete", text = "▎" }, + topdelete = { hl = "GitSignsDelete", text = "▎" }, + changedelete = { hl = "GitSignsChange", text = "▎" }, + }, + preview_config = { + border = "none", + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/editor/nvim-cmp.lua b/modules/home-manager/vim/config/lua/plugins/editor/nvim-cmp.lua index 40ae9a3..11fe5f2 100644 --- a/modules/home-manager/vim/config/lua/plugins/editor/nvim-cmp.lua +++ b/modules/home-manager/vim/config/lua/plugins/editor/nvim-cmp.lua @@ -1,126 +1,131 @@ return { - { - "L3MON4D3/LuaSnip", - dependencies = { "rafamadriz/friendly-snippets" }, - event = "InsertEnter", - build = "make install_jsregexp", - config = function() require("luasnip.loaders.from_vscode").lazy_load() end, - }, + { + "L3MON4D3/LuaSnip", + dependencies = { "rafamadriz/friendly-snippets" }, + event = "InsertEnter", + build = "make install_jsregexp", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, - { - "hrsh7th/nvim-cmp", - event = { "InsertEnter", "CmdlineEnter" }, - dependencies = { - "neovim/nvim-lspconfig", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - "onsails/lspkind-nvim", - "windwp/nvim-autopairs", - }, - opts = function() - local cmp = require("cmp") - local cmp_autopairs = require("nvim-autopairs.completion.cmp") + { + "hrsh7th/nvim-cmp", + event = { "InsertEnter", "CmdlineEnter" }, + dependencies = { + "neovim/nvim-lspconfig", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "onsails/lspkind-nvim", + "windwp/nvim-autopairs", + }, + opts = function() + local cmp = require("cmp") + local cmp_autopairs = require("nvim-autopairs.completion.cmp") - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), - }) + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + }) - local lspkind_status_ok, lspkind = pcall(require, "lspkind") - local snip_status_ok, luasnip = pcall(require, "luasnip") + local lspkind_status_ok, lspkind = pcall(require, "lspkind") + local snip_status_ok, luasnip = pcall(require, "luasnip") - if not snip_status_ok then return end + if not snip_status_ok then + return + end - local win_conf = cmp.config.window.bordered({ - winhighlight = "FloatBorder:FloatBorder", - scrollbar = false, - }) + local win_conf = cmp.config.window.bordered({ + winhighlight = "FloatBorder:FloatBorder", + scrollbar = false, + }) - return { - snippet = { - expand = function(args) luasnip.lsp_expand(args.body) end, - }, - window = { - completion = win_conf, - documentation = win_conf, - }, - sources = cmp.config.sources({ - { name = "nvim_lsp", priority = 1000 }, - { name = "crates", priority = 1000 }, - { name = "vim-dadbod-completion", priority = 1000 }, - { name = "luasnip", priority = 750 }, - { name = "buffer", priority = 500 }, - { name = "path", priority = 250 }, - }), - mapping = { - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, - [""] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }), - [""] = cmp.mapping.confirm({ select = false }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }, - formatting = { - format = lspkind_status_ok - and lspkind.cmp_format({ - mode = "symbol", - maxwidth = 25, - ellipsis_char = "...", - before = function(entry, vim_item) - if vim_item.kind == "Color" and entry.completion_item.documentation then - local _, _, r, g, b = - string.find(entry.completion_item.documentation, "^rgb%((%d+), (%d+), (%d+)") - if r then - local color = string.format("%02x", r) - .. string.format("%02x", g) - .. string.format("%02x", b) - local group = "Tw_" .. color - if vim.fn.hlID(group) < 1 then - vim.api.nvim_set_hl(0, group, { fg = "#" .. color }) - end - vim_item.kind_hl_group = group - return vim_item - end - end - return vim_item - end, - }), - }, - } - end, - }, + return { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + window = { + completion = win_conf, + documentation = win_conf, + }, + sources = cmp.config.sources({ + { name = "nvim_lsp", priority = 1000 }, + { name = "crates", priority = 1000 }, + { name = "vim-dadbod-completion", priority = 1000 }, + { name = "luasnip", priority = 750 }, + { name = "buffer", priority = 500 }, + { name = "path", priority = 250 }, + }), + mapping = { + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), + [""] = cmp.config.disable, + [""] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }), + [""] = cmp.mapping.confirm({ select = false }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }, + formatting = { + format = lspkind_status_ok and lspkind.cmp_format({ + mode = "symbol", + maxwidth = 25, + ellipsis_char = "...", + before = function(entry, vim_item) + if vim_item.kind == "Color" and entry.completion_item.documentation then + local _, _, r, g, b = + string.find(entry.completion_item.documentation, "^rgb%((%d+), (%d+), (%d+)") + if r then + local color = string.format("%02x", r) + .. string.format("%02x", g) + .. string.format("%02x", b) + local group = "Tw_" .. color + if vim.fn.hlID(group) < 1 then + vim.api.nvim_set_hl(0, group, { fg = "#" .. color }) + end + vim_item.kind_hl_group = group + return vim_item + end + end + return vim_item + end, + }), + }, + } + end, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/editor/nvim-dap.lua b/modules/home-manager/vim/config/lua/plugins/editor/nvim-dap.lua index 0e375ae..a224f2b 100644 --- a/modules/home-manager/vim/config/lua/plugins/editor/nvim-dap.lua +++ b/modules/home-manager/vim/config/lua/plugins/editor/nvim-dap.lua @@ -1,17 +1,17 @@ return { - "mfussenegger/nvim-dap", - keys = { - { "d", mode = { "n" } }, - }, - cmd = { "DapContinue", "DapToggleBreakpoint" }, - dependencies = { - { "rcarriga/nvim-dap-ui", opts = {} }, -{ "nvim-neotest/nvim-nio" }, - { - "theHamsta/nvim-dap-virtual-text", - opts = { - virt_text_pos = "eol", - }, - }, - }, + "mfussenegger/nvim-dap", + keys = { + { "d", mode = { "n" } }, + }, + cmd = { "DapContinue", "DapToggleBreakpoint" }, + dependencies = { + { "rcarriga/nvim-dap-ui", opts = {} }, + { "nvim-neotest/nvim-nio" }, + { + "theHamsta/nvim-dap-virtual-text", + opts = { + virt_text_pos = "eol", + }, + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/editor/nvim-treesitter.lua b/modules/home-manager/vim/config/lua/plugins/editor/nvim-treesitter.lua index e8ed721..98ea503 100644 --- a/modules/home-manager/vim/config/lua/plugins/editor/nvim-treesitter.lua +++ b/modules/home-manager/vim/config/lua/plugins/editor/nvim-treesitter.lua @@ -1,65 +1,69 @@ return { - { - "nvim-treesitter/nvim-treesitter", - dependencies = { "windwp/nvim-ts-autotag" }, - event = { "BufReadPost", "BufNewFile" }, - cmd = { - "TSBufDisable", - "TSBufEnable", - "TSBufToggle", - "TSDisable", - "TSEnable", - "TSToggle", - "TSInstall", - "TSInstallInfo", - "TSInstallSync", - "TSModuleInfo", - "TSUninstall", - "TSUpdate", - "TSUpdateSync", - }, - build = ":TSUpdate", - opts = { - highlight = { - enable = true, - disable = function(_, bufnr) return vim.api.nvim_buf_line_count(bufnr) > 10000 end, - }, - incremental_selection = { enable = true }, - indent = { enable = true }, - autotag = { enable = true }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - ensure_installed = { - "bash", - "c", - "html", - "css", - "javascript", - "json", - "toml", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "python", - "rust", - "tsx", - "typescript", - "vim", - "vimdoc", - "yaml", - "sql", - "query", - "java", - "http", - "rasi", - "haskell", - "ebnf", - }, - }, - config = function(_, opts) require("nvim-treesitter.configs").setup(opts) end, - }, + { + "nvim-treesitter/nvim-treesitter", + dependencies = { "windwp/nvim-ts-autotag" }, + event = { "BufReadPost", "BufNewFile" }, + cmd = { + "TSBufDisable", + "TSBufEnable", + "TSBufToggle", + "TSDisable", + "TSEnable", + "TSToggle", + "TSInstall", + "TSInstallInfo", + "TSInstallSync", + "TSModuleInfo", + "TSUninstall", + "TSUpdate", + "TSUpdateSync", + }, + build = ":TSUpdate", + opts = { + highlight = { + enable = true, + disable = function(_, bufnr) + return vim.api.nvim_buf_line_count(bufnr) > 10000 + end, + }, + incremental_selection = { enable = true }, + indent = { enable = true }, + autotag = { enable = true }, + context_commentstring = { + enable = true, + enable_autocmd = false, + }, + ensure_installed = { + "bash", + "c", + "html", + "css", + "javascript", + "json", + "toml", + "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "python", + "rust", + "tsx", + "typescript", + "vim", + "vimdoc", + "yaml", + "sql", + "query", + "java", + "http", + "rasi", + "haskell", + "ebnf", + }, + }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/editor/overseer.lua b/modules/home-manager/vim/config/lua/plugins/editor/overseer.lua index 57c7fe8..f15503a 100644 --- a/modules/home-manager/vim/config/lua/plugins/editor/overseer.lua +++ b/modules/home-manager/vim/config/lua/plugins/editor/overseer.lua @@ -1,14 +1,14 @@ return { - 'stevearc/overseer.nvim', - opts = { -task_list = { - direction = "bottom", -}, - }, - dependencies = { - { - 'stevearc/dressing.nvim', - opts = {}, -} - }, + "stevearc/overseer.nvim", + opts = { + task_list = { + direction = "bottom", + }, + }, + dependencies = { + { + "stevearc/dressing.nvim", + opts = {}, + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/editor/session-manager.lua b/modules/home-manager/vim/config/lua/plugins/editor/session-manager.lua index 3f25891..df5ff21 100644 --- a/modules/home-manager/vim/config/lua/plugins/editor/session-manager.lua +++ b/modules/home-manager/vim/config/lua/plugins/editor/session-manager.lua @@ -1,10 +1,10 @@ return { - "Shatur/neovim-session-manager", - cmd = { "SessionManager" }, - config = function() - local config = require("session_manager.config") - require("session_manager").setup({ - autoload_mode = config.AutoloadMode.Disabled, - }) - end, + "Shatur/neovim-session-manager", + cmd = { "SessionManager" }, + config = function() + local config = require("session_manager.config") + require("session_manager").setup({ + autoload_mode = config.AutoloadMode.Disabled, + }) + end, } diff --git a/modules/home-manager/vim/config/lua/plugins/editor/telescope.lua b/modules/home-manager/vim/config/lua/plugins/editor/telescope.lua index 2d9d395..5e7726f 100644 --- a/modules/home-manager/vim/config/lua/plugins/editor/telescope.lua +++ b/modules/home-manager/vim/config/lua/plugins/editor/telescope.lua @@ -1,25 +1,25 @@ local format = require("utils.icons").fmt return { - { - "nvim-telescope/telescope.nvim", - cmd = { "Telescope" }, - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope-fzf-native.nvim", - "nvim-telescope/telescope-dap.nvim", - }, - opts = { - defaults = { - border = true, - prompt_prefix = " ", - selection_caret = format("Right", ""), - }, - extensions = { - fzf = {}, - aerial = {}, - dap = {}, - }, - }, - }, + { + "nvim-telescope/telescope.nvim", + cmd = { "Telescope" }, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-fzf-native.nvim", + "nvim-telescope/telescope-dap.nvim", + }, + opts = { + defaults = { + border = true, + prompt_prefix = " ", + selection_caret = format("Right", ""), + }, + extensions = { + fzf = {}, + aerial = {}, + dap = {}, + }, + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/editor/toggleterm.lua b/modules/home-manager/vim/config/lua/plugins/editor/toggleterm.lua index 55752d0..2206466 100644 --- a/modules/home-manager/vim/config/lua/plugins/editor/toggleterm.lua +++ b/modules/home-manager/vim/config/lua/plugins/editor/toggleterm.lua @@ -1,17 +1,17 @@ return { - "akinsho/toggleterm.nvim", - cmd = { "ToggleTerm" }, - opts = { - shade_terminals = false, - direction = "float", - float_opts = { - border = "rounded", - width = 80, - }, - highlights = { - FloatBorder = { - link = "FloatBorder", - }, - }, - }, + "akinsho/toggleterm.nvim", + cmd = { "ToggleTerm" }, + opts = { + shade_terminals = false, + direction = "float", + float_opts = { + border = "rounded", + width = 80, + }, + highlights = { + FloatBorder = { + link = "FloatBorder", + }, + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/init.lua b/modules/home-manager/vim/config/lua/plugins/init.lua index cbf5d10..129d8dd 100644 --- a/modules/home-manager/vim/config/lua/plugins/init.lua +++ b/modules/home-manager/vim/config/lua/plugins/init.lua @@ -1,6 +1,6 @@ return { - { import = "plugins.ui" }, - { import = "plugins.editor" }, - { import = "plugins.lsp" }, - { import = "plugins.tools" }, + { import = "plugins.ui" }, + { import = "plugins.editor" }, + { import = "plugins.lsp" }, + { import = "plugins.tools" }, } diff --git a/modules/home-manager/vim/config/lua/plugins/tools/ccc.lua b/modules/home-manager/vim/config/lua/plugins/tools/ccc.lua index 88064fe..20f4ab2 100644 --- a/modules/home-manager/vim/config/lua/plugins/tools/ccc.lua +++ b/modules/home-manager/vim/config/lua/plugins/tools/ccc.lua @@ -1,13 +1,13 @@ return { - "uga-rosa/ccc.nvim", - cmd = { - "CccPick", - "CccConvert", - "CccHighlighterEnable", - "CccHighlighterDisable", - "CccHighlighterToggle", - }, - opts = { - alpha_show = "show" - }, + "uga-rosa/ccc.nvim", + cmd = { + "CccPick", + "CccConvert", + "CccHighlighterEnable", + "CccHighlighterDisable", + "CccHighlighterToggle", + }, + opts = { + alpha_show = "show", + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/tools/clear-action.lua b/modules/home-manager/vim/config/lua/plugins/tools/clear-action.lua index 6a63979..a6f51c7 100644 --- a/modules/home-manager/vim/config/lua/plugins/tools/clear-action.lua +++ b/modules/home-manager/vim/config/lua/plugins/tools/clear-action.lua @@ -1,44 +1,44 @@ local format = require("utils.icons").fmt return { - "luckasRanarison/clear-action.nvim", - event = "LspAttach", - opts = { - signs = { - show_count = false, - show_label = true, - combine = true, - }, - popup = { - hide_cursor = true, - }, - mappings = { - code_action = { "la", format("Fix", "Code action") }, - apply_first = { "aa", format("Fix", "Apply") }, - quickfix = { "aq", format("Fix", "Quickfix") }, - quickfix_next = { "an", format("Fix", "Quickfix next") }, - quickfix_prev = { "ap", format("Fix", "Quickfix prev") }, - refactor = { "ar", format("Fix", "Refactor") }, - refactor_inline = { "aR", format("Fix", "Refactor inline") }, - actions = { - ["rust_analyzer"] = { - ["Import"] = { "ai", format("Fix", "Import") }, - ["Replace if"] = { "am", format("Fix", "Replace if with match") }, - ["Fill match"] = { "af", format("Fix", "Fill match arms") }, - ["Wrap"] = { "aw", format("Fix", "Wrap") }, - ["Insert `mod"] = { "aM", format("Fix", "Insert mod") }, - ["Insert `pub"] = { "aP", format("Fix", "Insert pub mod") }, - ["Add braces"] = { "ab", format("Fix", "Add braces") }, - }, - }, - }, - quickfix_filters = { - ["rust_analyzer"] = { - ["E0412"] = "Import", - ["E0425"] = "Import", - ["E0433"] = "Import", - ["unused_imports"] = "remove", - }, - }, - }, + "luckasRanarison/clear-action.nvim", + event = "LspAttach", + opts = { + signs = { + show_count = false, + show_label = true, + combine = true, + }, + popup = { + hide_cursor = true, + }, + mappings = { + code_action = { "la", format("Fix", "Code action") }, + apply_first = { "aa", format("Fix", "Apply") }, + quickfix = { "aq", format("Fix", "Quickfix") }, + quickfix_next = { "an", format("Fix", "Quickfix next") }, + quickfix_prev = { "ap", format("Fix", "Quickfix prev") }, + refactor = { "ar", format("Fix", "Refactor") }, + refactor_inline = { "aR", format("Fix", "Refactor inline") }, + actions = { + ["rust_analyzer"] = { + ["Import"] = { "ai", format("Fix", "Import") }, + ["Replace if"] = { "am", format("Fix", "Replace if with match") }, + ["Fill match"] = { "af", format("Fix", "Fill match arms") }, + ["Wrap"] = { "aw", format("Fix", "Wrap") }, + ["Insert `mod"] = { "aM", format("Fix", "Insert mod") }, + ["Insert `pub"] = { "aP", format("Fix", "Insert pub mod") }, + ["Add braces"] = { "ab", format("Fix", "Add braces") }, + }, + }, + }, + quickfix_filters = { + ["rust_analyzer"] = { + ["E0412"] = "Import", + ["E0425"] = "Import", + ["E0433"] = "Import", + ["unused_imports"] = "remove", + }, + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/tools/crates.lua b/modules/home-manager/vim/config/lua/plugins/tools/crates.lua index 464ee0c..3a1d8d1 100644 --- a/modules/home-manager/vim/config/lua/plugins/tools/crates.lua +++ b/modules/home-manager/vim/config/lua/plugins/tools/crates.lua @@ -1,14 +1,14 @@ return { - "saecki/crates.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "jose-elias-alvarez/null-ls.nvim", - }, - event = { "BufRead Cargo.toml" }, - opts = { - null_ls = { - enabled = true, - name = "Crates", - }, - }, + "saecki/crates.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "jose-elias-alvarez/null-ls.nvim", + }, + event = { "BufRead Cargo.toml" }, + opts = { + null_ls = { + enabled = true, + name = "Crates", + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/tools/document-color.lua b/modules/home-manager/vim/config/lua/plugins/tools/document-color.lua index 3ea1b41..b616084 100644 --- a/modules/home-manager/vim/config/lua/plugins/tools/document-color.lua +++ b/modules/home-manager/vim/config/lua/plugins/tools/document-color.lua @@ -1,5 +1,5 @@ return { - "mrshmllow/document-color.nvim", - lazy = true, - opts = {}, + "mrshmllow/document-color.nvim", + lazy = true, + opts = {}, } diff --git a/modules/home-manager/vim/config/lua/plugins/tools/flash.lua b/modules/home-manager/vim/config/lua/plugins/tools/flash.lua index cf852d9..d465fa1 100644 --- a/modules/home-manager/vim/config/lua/plugins/tools/flash.lua +++ b/modules/home-manager/vim/config/lua/plugins/tools/flash.lua @@ -1,18 +1,18 @@ local lua = require("utils.mappings").lua return { - "folke/flash.nvim", - keys = { - { "f", mode = { "n", "v" } }, - { "F", mode = { "n", "v" } }, - { "t", mode = { "n", "v" } }, - { "T", mode = { "n", "v" } }, + "folke/flash.nvim", + keys = { + { "f", mode = { "n", "v" } }, + { "F", mode = { "n", "v" } }, + { "t", mode = { "n", "v" } }, + { "T", mode = { "n", "v" } }, - { "s", mode = { "n", "v" }, lua('require("flash").jump()') }, - { "ß", mode = "n", lua("require('flash').jump({ pattern = vim.fn.expand('') })") }, - { "S", mode = "n", lua("require('flash').treesitter()") }, - { "o", mode = "o", lua("require('flash').jump()"), desc = "Search jump" }, - { "O", mode = "o", lua("require('flash').treesitter()"), desc = "Tresitter jump" }, - }, - opts = {}, + { "s", mode = { "n", "v" }, lua('require("flash").jump()') }, + { "ß", mode = "n", lua("require('flash').jump({ pattern = vim.fn.expand('') })") }, + { "S", mode = "n", lua("require('flash').treesitter()") }, + { "o", mode = "o", lua("require('flash').jump()"), desc = "Search jump" }, + { "O", mode = "o", lua("require('flash').treesitter()"), desc = "Tresitter jump" }, + }, + opts = {}, } diff --git a/modules/home-manager/vim/config/lua/plugins/tools/nvim-devdocs.lua b/modules/home-manager/vim/config/lua/plugins/tools/nvim-devdocs.lua index 91b5b57..f997972 100644 --- a/modules/home-manager/vim/config/lua/plugins/tools/nvim-devdocs.lua +++ b/modules/home-manager/vim/config/lua/plugins/tools/nvim-devdocs.lua @@ -1,52 +1,52 @@ return { - -- "luckasRanarison/nvim-devdocs", - dir = "~/Projects/nvim-devdocs", - branch = "master", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim", - "nvim-treesitter/nvim-treesitter", - }, - cmd = { - "DevdocsFetch", - "DevdocsInstall", - "DevdocsUninstall", - "DevdocsOpen", - "DevdocsOpenFloat", - "DevdocsOpenCurrent", - "DevdocsOpenCurrentFloat", - "DevdocsUpdate", - "DevdocsUpdateAll", - "DevdocsBuild", - }, - opts = { - format = "markdown", - filetypes = { - javascript = { "html", "javascript" }, - }, - -- use_node = false, - ensure_installed = { - -- "git", - -- "bash", - -- "rust", - -- "lua-5.4", - -- "html", - -- "css", - -- "javascript", - -- "typescript", - -- "react", - -- "web_extensions", - }, - wrap = true, - previewer_cmd = "glow", - cmd_args = { "-s", "auto", "-w", "97" }, - cmd_ignore = {}, - picker_cmd = true, - picker_cmd_args = { "-s", "auto", "-w", "45" }, - mappings = { - open_in_browser = "vb", - toggle_rendering = "vr", - }, - log_level = "debug", - }, + -- "luckasRanarison/nvim-devdocs", + dir = "~/Projects/nvim-devdocs", + branch = "master", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + "nvim-treesitter/nvim-treesitter", + }, + cmd = { + "DevdocsFetch", + "DevdocsInstall", + "DevdocsUninstall", + "DevdocsOpen", + "DevdocsOpenFloat", + "DevdocsOpenCurrent", + "DevdocsOpenCurrentFloat", + "DevdocsUpdate", + "DevdocsUpdateAll", + "DevdocsBuild", + }, + opts = { + format = "markdown", + filetypes = { + javascript = { "html", "javascript" }, + }, + -- use_node = false, + ensure_installed = { + -- "git", + -- "bash", + -- "rust", + -- "lua-5.4", + -- "html", + -- "css", + -- "javascript", + -- "typescript", + -- "react", + -- "web_extensions", + }, + wrap = true, + previewer_cmd = "glow", + cmd_args = { "-s", "auto", "-w", "97" }, + cmd_ignore = {}, + picker_cmd = true, + picker_cmd_args = { "-s", "auto", "-w", "45" }, + mappings = { + open_in_browser = "vb", + toggle_rendering = "vr", + }, + log_level = "debug", + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/tools/vim-dadbod.lua b/modules/home-manager/vim/config/lua/plugins/tools/vim-dadbod.lua index d4230a3..79d8528 100644 --- a/modules/home-manager/vim/config/lua/plugins/tools/vim-dadbod.lua +++ b/modules/home-manager/vim/config/lua/plugins/tools/vim-dadbod.lua @@ -1,20 +1,20 @@ return { - "kristijanhusak/vim-dadbod-ui", - dependencies = { - "tpope/vim-dadbod", - "kristijanhusak/vim-dadbod-completion", - }, - cmd = { - "DBUI", - "DBUIAddConnection", - "DBUIClose", - "DBUIToggle", - "DBUIFindBuffer", - "DBUIRenameBuffer", - "DBUILastQueryInfo", - }, - config = function() - vim.g.db_ui_notification_width = 1 - vim.g.db_ui_debug = 1 - end, + "kristijanhusak/vim-dadbod-ui", + dependencies = { + "tpope/vim-dadbod", + "kristijanhusak/vim-dadbod-completion", + }, + cmd = { + "DBUI", + "DBUIAddConnection", + "DBUIClose", + "DBUIToggle", + "DBUIFindBuffer", + "DBUIRenameBuffer", + "DBUILastQueryInfo", + }, + config = function() + vim.g.db_ui_notification_width = 1 + vim.g.db_ui_debug = 1 + end, } diff --git a/modules/home-manager/vim/config/lua/plugins/ui/alpha.lua b/modules/home-manager/vim/config/lua/plugins/ui/alpha.lua index 5d1b8c9..8dfb471 100644 --- a/modules/home-manager/vim/config/lua/plugins/ui/alpha.lua +++ b/modules/home-manager/vim/config/lua/plugins/ui/alpha.lua @@ -1,35 +1,31 @@ local format = require("utils.icons").fmt return { - "goolord/alpha-nvim", - config = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") - dashboard.section.header.val = { - [[ ]], - [[  ]], - [[ ████ ██████ █████ ██ ]], - [[ ███████████ █████  ]], - [[ █████████ ███████████████████ ███ ███████████ ]], - [[ █████████ ███ █████████████ █████ ██████████████ ]], - [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], - [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], - [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], - [[ ]], - } - dashboard.section.buttons.val = { - dashboard.button("n", format("NewFile", "New file", 2), ":ene startinsert "), - dashboard.button("f", format("Search", "Find file", 2), ":Telescope find_files"), - dashboard.button("l", format("History", "Recents", 2), ":SessionManager load_session"), - dashboard.button( - "L", - format("FolderOpened", "Last session", 2), - ":SessionManager load_last_session" - ), - dashboard.button("q", format("Exit", "Quit", 2), ":qa"), - } - dashboard.config.layout[1].val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) }) - dashboard.config.layout[3].val = 2 - alpha.setup(dashboard.config) - end, + "goolord/alpha-nvim", + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") + dashboard.section.header.val = { + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + } + dashboard.section.buttons.val = { + dashboard.button("n", format("NewFile", "New file", 2), ":ene startinsert "), + dashboard.button("f", format("Search", "Find file", 2), ":Telescope find_files"), + dashboard.button("l", format("History", "Recents", 2), ":SessionManager load_session"), + dashboard.button("L", format("FolderOpened", "Last session", 2), ":SessionManager load_last_session"), + dashboard.button("q", format("Exit", "Quit", 2), ":qa"), + } + dashboard.config.layout[1].val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) }) + dashboard.config.layout[3].val = 2 + alpha.setup(dashboard.config) + end, } diff --git a/modules/home-manager/vim/config/lua/plugins/ui/bufferline.lua b/modules/home-manager/vim/config/lua/plugins/ui/bufferline.lua index 0e4e022..497ac64 100644 --- a/modules/home-manager/vim/config/lua/plugins/ui/bufferline.lua +++ b/modules/home-manager/vim/config/lua/plugins/ui/bufferline.lua @@ -1,49 +1,49 @@ local format = require("utils.icons").fmt return { - "akinsho/bufferline.nvim", - event = { "BufReadPost", "BufNewFile" }, - dependencies = "nvim-tree/nvim-web-devicons", - opts = { - options = { - diagnostics = "nvim_lsp", - diagnostics_update_in_insert = true, - diagnostics_indicator = nil, - indicator = "none", - offsets = { - { - filetype = "neo-tree", - text = format("Folder", "NeoTree"), - text_align = "left", - separator = "│", - }, - { - filetype = "dapui_watches", - text = format("Debugger", "DapUI"), - text_align = "left", - separator = "│", - }, - { - filetype = "dbui", - text = format("Database", "DbUI"), - text_align = "left", - separator = "│", - }, - }, - }, - }, - config = function(_, opts) - local colors = require("tokyonight.colors") + "akinsho/bufferline.nvim", + event = { "BufReadPost", "BufNewFile" }, + dependencies = "nvim-tree/nvim-web-devicons", + opts = { + options = { + diagnostics = "nvim_lsp", + diagnostics_update_in_insert = true, + diagnostics_indicator = nil, + indicator = "none", + offsets = { + { + filetype = "neo-tree", + text = format("Folder", "NeoTree"), + text_align = "left", + separator = "│", + }, + { + filetype = "dapui_watches", + text = format("Debugger", "DapUI"), + text_align = "left", + separator = "│", + }, + { + filetype = "dbui", + text = format("Database", "DbUI"), + text_align = "left", + separator = "│", + }, + }, + }, + }, + config = function(_, opts) + local colors = require("tokyonight.colors") - vim.opt.showtabline = 2 - opts.highlights = { - background = { bg = colors.night.bg }, - close_button = { bg = colors.night.bg }, - separator = { fg = colors.night.bg, bg = colors.night.bg }, - offset_separator = { bg = colors.night.bg }, - pick = { bg = colors.night.bg }, - } + vim.opt.showtabline = 2 + opts.highlights = { + background = { bg = colors.night.bg }, + close_button = { bg = colors.night.bg }, + separator = { fg = colors.night.bg, bg = colors.night.bg }, + offset_separator = { bg = colors.night.bg }, + pick = { bg = colors.night.bg }, + } - require("bufferline").setup(opts) - end, + require("bufferline").setup(opts) + end, } diff --git a/modules/home-manager/vim/config/lua/plugins/ui/dressing.lua b/modules/home-manager/vim/config/lua/plugins/ui/dressing.lua index e0e0e3f..9b9eee4 100644 --- a/modules/home-manager/vim/config/lua/plugins/ui/dressing.lua +++ b/modules/home-manager/vim/config/lua/plugins/ui/dressing.lua @@ -1,22 +1,22 @@ return { - "stevearc/dressing.nvim", - event = "VeryLazy", - config = function() - local theme = require("telescope.themes").get_dropdown() + "stevearc/dressing.nvim", + event = "VeryLazy", + config = function() + local theme = require("telescope.themes").get_dropdown() - theme.layout_config = { - width = 60, - height = 17, - } + theme.layout_config = { + width = 60, + height = 17, + } - require("dressing").setup({ - input = { - enabled = false, - }, - select = { - backend = { "telescope" }, - telescope = theme, - }, - }) - end, + require("dressing").setup({ + input = { + enabled = false, + }, + select = { + backend = { "telescope" }, + telescope = theme, + }, + }) + end, } diff --git a/modules/home-manager/vim/config/lua/plugins/ui/indent-blankline.lua b/modules/home-manager/vim/config/lua/plugins/ui/indent-blankline.lua index 37e2820..242a0cd 100644 --- a/modules/home-manager/vim/config/lua/plugins/ui/indent-blankline.lua +++ b/modules/home-manager/vim/config/lua/plugins/ui/indent-blankline.lua @@ -1,41 +1,41 @@ return { - "lukas-reineke/indent-blankline.nvim", - event = { "BufReadPost", "BufNewFile" }, - main = "ibl", - opts = { - exclude = { - buftypes = { - "nofile", - "terminal", - }, - filetypes = { - "help", - "startify", - "aerial", - "alpha", - "dashboard", - "lazy", - "neogitstatus", - "neo-tree", - "Trouble", - "dbout", - "TelescopePrompt", - }, - }, - scope = { - show_start = false, - show_end = false, - highlight = { "@keyword" }, - char = "▏", - include = { - node_type = { - lua = { "table_constructor" }, - }, - }, - }, - whitespace = { - remove_blankline_trail = true, - }, - indent = { char = "▏" }, - }, + "lukas-reineke/indent-blankline.nvim", + event = { "BufReadPost", "BufNewFile" }, + main = "ibl", + opts = { + exclude = { + buftypes = { + "nofile", + "terminal", + }, + filetypes = { + "help", + "startify", + "aerial", + "alpha", + "dashboard", + "lazy", + "neogitstatus", + "neo-tree", + "Trouble", + "dbout", + "TelescopePrompt", + }, + }, + scope = { + show_start = false, + show_end = false, + highlight = { "@keyword" }, + char = "▏", + include = { + node_type = { + lua = { "table_constructor" }, + }, + }, + }, + whitespace = { + remove_blankline_trail = true, + }, + indent = { char = "▏" }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/ui/lualine.lua b/modules/home-manager/vim/config/lua/plugins/ui/lualine.lua index dbdb801..9894712 100644 --- a/modules/home-manager/vim/config/lua/plugins/ui/lualine.lua +++ b/modules/home-manager/vim/config/lua/plugins/ui/lualine.lua @@ -1,31 +1,31 @@ local sources = require("plugins.utils.lualine_sources") return { - "nvim-lualine/lualine.nvim", - event = { "BufReadPost", "BufNewFile" }, - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function(_, opts) - local colors = require("tokyonight.colors") - local tokyonight = require("lualine.themes.tokyonight") + "nvim-lualine/lualine.nvim", + event = { "BufReadPost", "BufNewFile" }, + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function(_, opts) + local colors = require("tokyonight.colors") + local tokyonight = require("lualine.themes.tokyonight") - vim.opt.laststatus = 3 - tokyonight.normal.c.bg = colors.night.bg - opts.options.theme = tokyonight + vim.opt.laststatus = 3 + tokyonight.normal.c.bg = colors.night.bg + opts.options.theme = tokyonight - require("lualine").setup(opts) - end, - opts = { - options = { - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - }, - sections = { - lualine_a = { sources.mode }, - lualine_b = { sources.branch, sources.diff }, - lualine_c = { sources.filetype, sources.macro }, - lualine_x = { sources.lsp, sources.diagnostics }, - lualine_y = { sources.indentation, sources.encoding, sources.fileformat }, - lualine_z = { sources.progress, sources.location }, - }, - }, + require("lualine").setup(opts) + end, + opts = { + options = { + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + }, + sections = { + lualine_a = { sources.mode }, + lualine_b = { sources.branch, sources.diff }, + lualine_c = { sources.filetype, sources.macro }, + lualine_x = { sources.lsp, sources.diagnostics }, + lualine_y = { sources.indentation, sources.encoding, sources.fileformat }, + lualine_z = { sources.progress, sources.location }, + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/ui/neo-tree.lua b/modules/home-manager/vim/config/lua/plugins/ui/neo-tree.lua index 70440d3..cf1a43e 100644 --- a/modules/home-manager/vim/config/lua/plugins/ui/neo-tree.lua +++ b/modules/home-manager/vim/config/lua/plugins/ui/neo-tree.lua @@ -1,84 +1,84 @@ local icons = require("utils.icons").icons return { - { - "nvim-neo-tree/neo-tree.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - "nvim-tree/nvim-web-devicons", - "luckasRanarison/neo-rename.nvim", - }, - cmd = "Neotree", - opts = { - enable_git_status = true, - close_if_last_window = true, - auto_clean_after_session_restore = true, - window = { - width = 30, - mappings = { - [""] = false, - ["s"] = false, - ["l"] = "open", - ["v"] = "open_vsplit", - ["gA"] = "git_add_all", - ["ga"] = "git_add_file", - ["gu"] = "git_unstage_file", - ["gr"] = "git_revert_file", - }, - }, - filesystem = { - follow_current_file = { enabled = true }, - hijack_netrw_behavior = "open_current", - use_libuv_file_watcher = true, - }, - default_component_configs = { - icon = { - folder_empty = icons.EmptyFolder, - default = icons.DefaultFile, - }, - indent = { - padding = 0, - indent_size = 1, - }, - modified = { - symbol = icons.SmallDot, - }, - name = { - use_git_status_colors = true, - }, - git_status = { - symbols = { - deleted = "D", - renamed = "R", - modified = "M", - added = "A", - untracked = "U", - ignored = "", - staged = "", - unstaged = "!", - conflict = "C", - }, - }, - diagnostics = { - symbols = { - hint = icons.Hint, - info = icons.Info, - warn = icons.Warn, - error = icons.Error, - }, - highlights = { - hint = "DiagnosticSignHint", - info = "DiagnosticSignInfo", - warn = "DiagnosticSignWarn", - error = "DiagnosticSignError", - }, - }, - }, - }, - config = function(_, opts) - require("neo-tree").setup(opts) - require("neo-rename").setup() - end, - }, + { + "nvim-neo-tree/neo-tree.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + "nvim-tree/nvim-web-devicons", + "luckasRanarison/neo-rename.nvim", + }, + cmd = "Neotree", + opts = { + enable_git_status = true, + close_if_last_window = true, + auto_clean_after_session_restore = true, + window = { + width = 30, + mappings = { + [""] = false, + ["s"] = false, + ["l"] = "open", + ["v"] = "open_vsplit", + ["gA"] = "git_add_all", + ["ga"] = "git_add_file", + ["gu"] = "git_unstage_file", + ["gr"] = "git_revert_file", + }, + }, + filesystem = { + follow_current_file = { enabled = true }, + hijack_netrw_behavior = "open_current", + use_libuv_file_watcher = true, + }, + default_component_configs = { + icon = { + folder_empty = icons.EmptyFolder, + default = icons.DefaultFile, + }, + indent = { + padding = 0, + indent_size = 1, + }, + modified = { + symbol = icons.SmallDot, + }, + name = { + use_git_status_colors = true, + }, + git_status = { + symbols = { + deleted = "D", + renamed = "R", + modified = "M", + added = "A", + untracked = "U", + ignored = "", + staged = "", + unstaged = "!", + conflict = "C", + }, + }, + diagnostics = { + symbols = { + hint = icons.Hint, + info = icons.Info, + warn = icons.Warn, + error = icons.Error, + }, + highlights = { + hint = "DiagnosticSignHint", + info = "DiagnosticSignInfo", + warn = "DiagnosticSignWarn", + error = "DiagnosticSignError", + }, + }, + }, + }, + config = function(_, opts) + require("neo-tree").setup(opts) + require("neo-rename").setup() + end, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/ui/noice.lua b/modules/home-manager/vim/config/lua/plugins/ui/noice.lua index b9e5eb8..f5a6f35 100644 --- a/modules/home-manager/vim/config/lua/plugins/ui/noice.lua +++ b/modules/home-manager/vim/config/lua/plugins/ui/noice.lua @@ -1,34 +1,34 @@ local icons = require("utils.icons").icons return { - "folke/noice.nvim", - event = "VeryLazy", - dependencies = { - "MunifTanjim/nui.nvim", - { "rcarriga/nvim-notify" }, - }, - opts = { - cmdline = { - format = { - cmdline = { pattern = "^:", icon = icons.Command, lang = "vim" }, - }, - }, - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - hover = { - silent = true, - }, - }, - presets = { - bottom_search = false, - command_palette = true, - long_message_to_split = true, - inc_rename = false, - lsp_doc_border = "rounded", - }, - }, + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + { "rcarriga/nvim-notify" }, + }, + opts = { + cmdline = { + format = { + cmdline = { pattern = "^:", icon = icons.Command, lang = "vim" }, + }, + }, + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + hover = { + silent = true, + }, + }, + presets = { + bottom_search = false, + command_palette = true, + long_message_to_split = true, + inc_rename = false, + lsp_doc_border = "rounded", + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/ui/tokyonight.lua b/modules/home-manager/vim/config/lua/plugins/ui/tokyonight.lua index 3947e9f..e4ba676 100644 --- a/modules/home-manager/vim/config/lua/plugins/ui/tokyonight.lua +++ b/modules/home-manager/vim/config/lua/plugins/ui/tokyonight.lua @@ -1,158 +1,160 @@ return { - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - init = function() vim.cmd.colorscheme("tokyonight-night") end, - opts = { - styles = { - keywords = { italic = false }, - }, - on_colors = function(colors) - colors.gitSigns.add = colors.green - colors.gitSigns.change = colors.blue - colors.gitSigns.delete = colors.red - colors.gitSigns.ignored = colors.bg - colors.status_line = colors.none - return colors - end, - on_highlights = function(hl, c) - local highlights = { - NormalSB = { bg = nil }, - NormalFloat = { bg = nil }, - FloatBorder = { fg = c.dark3 }, - FloatTitle = { fg = c.dark3 }, - CursorLineNr = { fg = c.blue }, - Breakpoint = { fg = c.orange }, - WinSeparator = { fg = c.terminal_black }, - WinBar = { bg = nil }, - WinBarNC = { bg = nil }, - LspInlayHint = { fg = c.comment }, + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + init = function() + vim.cmd.colorscheme("tokyonight-night") + end, + opts = { + styles = { + keywords = { italic = false }, + }, + on_colors = function(colors) + colors.gitSigns.add = colors.green + colors.gitSigns.change = colors.blue + colors.gitSigns.delete = colors.red + colors.gitSigns.ignored = colors.bg + colors.status_line = colors.none + return colors + end, + on_highlights = function(hl, c) + local highlights = { + NormalSB = { bg = nil }, + NormalFloat = { bg = nil }, + FloatBorder = { fg = c.dark3 }, + FloatTitle = { fg = c.dark3 }, + CursorLineNr = { fg = c.blue }, + Breakpoint = { fg = c.orange }, + WinSeparator = { fg = c.terminal_black }, + WinBar = { bg = nil }, + WinBarNC = { bg = nil }, + LspInlayHint = { fg = c.comment }, - DiagnosticSignError = { fg = c.red }, - DiagnosticSignWarn = { fg = c.yellow }, - DiagnosticSignHint = { fg = c.blue }, - DiagnosticSignInfo = { fg = c.blue }, - DiagnosticError = { fg = c.red }, - DiagnosticWarn = { fg = c.yellow }, - DiagnosticHint = { fg = c.blue }, - DiagnosticInfo = { fg = c.blue }, + DiagnosticSignError = { fg = c.red }, + DiagnosticSignWarn = { fg = c.yellow }, + DiagnosticSignHint = { fg = c.blue }, + DiagnosticSignInfo = { fg = c.blue }, + DiagnosticError = { fg = c.red }, + DiagnosticWarn = { fg = c.yellow }, + DiagnosticHint = { fg = c.blue }, + DiagnosticInfo = { fg = c.blue }, - BufferLineFill = { bg = c.bg }, - BufferLineCloseButtonSelected = { fg = c.red }, - BufferLineError = { fg = c.red, bg = c.bg, bold = true }, - BufferLineWarning = { fg = c.yellow, bg = c.bg, bold = true }, - BufferLineHint = { fg = c.blue, bg = c.bg, bold = true }, - BufferLineInfo = { fg = c.blue, bg = c.bg, bold = true }, - BufferLineModified = { fg = c.green, bg = c.bg }, - BufferLineDuplicate = { fg = c.comment, bg = c.bg, bold = true }, - BufferLineDuplicateSelected = { fg = c.fg, bg = c.bg, bold = true, italic = true }, - BufferLineTruncMarker = { bg = c.bg }, + BufferLineFill = { bg = c.bg }, + BufferLineCloseButtonSelected = { fg = c.red }, + BufferLineError = { fg = c.red, bg = c.bg, bold = true }, + BufferLineWarning = { fg = c.yellow, bg = c.bg, bold = true }, + BufferLineHint = { fg = c.blue, bg = c.bg, bold = true }, + BufferLineInfo = { fg = c.blue, bg = c.bg, bold = true }, + BufferLineModified = { fg = c.green, bg = c.bg }, + BufferLineDuplicate = { fg = c.comment, bg = c.bg, bold = true }, + BufferLineDuplicateSelected = { fg = c.fg, bg = c.bg, bold = true, italic = true }, + BufferLineTruncMarker = { bg = c.bg }, - NeoTreeDirectoryName = { fg = c.fg }, - NeoTreeNormalNC = { bg = c.bg }, - NeoTreeNormal = { bg = c.bg }, - NeoTreeGitUntracked = { fg = c.orange }, - NeoTreeGitUnstaged = { fg = c.cyan }, + NeoTreeDirectoryName = { fg = c.fg }, + NeoTreeNormalNC = { bg = c.bg }, + NeoTreeNormal = { bg = c.bg }, + NeoTreeGitUntracked = { fg = c.orange }, + NeoTreeGitUnstaged = { fg = c.cyan }, - WhichKeyFloat = { bg = c.bg }, - FlashLabel = { fg = c.red, bg = c.bg }, - FlashCurrent = { bg = c.fg }, + WhichKeyFloat = { bg = c.bg }, + FlashLabel = { fg = c.red, bg = c.bg }, + FlashCurrent = { bg = c.fg }, - TelescopeNormal = { bg = nil }, - TelescopePromptPrefix = { fg = c.dark3 }, - TelescopeBorder = { link = "FloatBorder" }, + TelescopeNormal = { bg = nil }, + TelescopePromptPrefix = { fg = c.dark3 }, + TelescopeBorder = { link = "FloatBorder" }, - NotifyINFOBorder = { fg = c.blue }, - NotifyINFOTitle = { fg = c.blue }, - NotifyINFOIcon = { fg = c.blue }, - NotifyERRORBorder = { fg = c.red }, - NotifyERRORTitle = { fg = c.red }, - NotifyERRORIcon = { fg = c.red }, - NotifyWARNBorder = { fg = c.yellow }, - NotifyWARNTitle = { fg = c.yellow }, - NotifyWARNIcon = { fg = c.yellow }, - ErrorMsg = { fg = c.red }, + NotifyINFOBorder = { fg = c.blue }, + NotifyINFOTitle = { fg = c.blue }, + NotifyINFOIcon = { fg = c.blue }, + NotifyERRORBorder = { fg = c.red }, + NotifyERRORTitle = { fg = c.red }, + NotifyERRORIcon = { fg = c.red }, + NotifyWARNBorder = { fg = c.yellow }, + NotifyWARNTitle = { fg = c.yellow }, + NotifyWARNIcon = { fg = c.yellow }, + ErrorMsg = { fg = c.red }, - diffAdded = { fg = c.green }, - diffRemoved = { fg = c.red }, - diffChanged = { fg = c.blue }, - diffNewFile = { fg = c.cyan }, - diffOldFile = { fg = c.comment }, - DiffAdd = { fg = c.green }, - DiffChange = { fg = c.blue }, - DiffDelete = { fg = c.red }, - DiffText = { fg = c.purple }, + diffAdded = { fg = c.green }, + diffRemoved = { fg = c.red }, + diffChanged = { fg = c.blue }, + diffNewFile = { fg = c.cyan }, + diffOldFile = { fg = c.comment }, + DiffAdd = { fg = c.green }, + DiffChange = { fg = c.blue }, + DiffDelete = { fg = c.red }, + DiffText = { fg = c.purple }, - DropBarSeparator = { fg = c.dark5 }, - DropBarPick = { fg = c.red, bold = true, italic = true }, - DropBarKind = { fg = c.fg }, - DropBarKindFolder = { fg = c.dark5 }, - DropBarIconUIPickPivot = { link = "DropBarPick" }, - DropBarIconUISeparator = { link = "DropBarSeparator" }, - } + DropBarSeparator = { fg = c.dark5 }, + DropBarPick = { fg = c.red, bold = true, italic = true }, + DropBarKind = { fg = c.fg }, + DropBarKindFolder = { fg = c.dark5 }, + DropBarIconUIPickPivot = { link = "DropBarPick" }, + DropBarIconUISeparator = { link = "DropBarSeparator" }, + } - for key, value in pairs(highlights) do - hl[key] = value - end + for key, value in pairs(highlights) do + hl[key] = value + end - local dropbar_hl = { - "Array", - "Boolean", - "Constant", - "Constructor", - "Enum", - "EnumMember", - "Field", - "Function", - "Identifier", - "List", - "Macro", - "Number", - "Object", - "Operator", - "Package", - "Property", - "Reference", - "String", - "Type", - "TypeParameter", - "Unit", - "Value", - "Variable", - "Null", - "Specifier", - "BreakStatement", - "CaseStatement", - "ContinueStatement", - "Declaration", - "Delete", - "DoStatement", - "ElseStatement", - "ForStatement", - "IfStatement", - "Repeat", - "Scope", - "Specifier", - "Statement", - "SwitchStatement", - "WhileStatement", - "Class", - "Event", - "Interface", - "Method", - "Module", - "Namespace", - "MarkdownH1", - "MarkdownH2", - "MarkdownH3", - "MarkdownH4", - "MarkdownH5", - "MarkdownH6", - } + local dropbar_hl = { + "Array", + "Boolean", + "Constant", + "Constructor", + "Enum", + "EnumMember", + "Field", + "Function", + "Identifier", + "List", + "Macro", + "Number", + "Object", + "Operator", + "Package", + "Property", + "Reference", + "String", + "Type", + "TypeParameter", + "Unit", + "Value", + "Variable", + "Null", + "Specifier", + "BreakStatement", + "CaseStatement", + "ContinueStatement", + "Declaration", + "Delete", + "DoStatement", + "ElseStatement", + "ForStatement", + "IfStatement", + "Repeat", + "Scope", + "Specifier", + "Statement", + "SwitchStatement", + "WhileStatement", + "Class", + "Event", + "Interface", + "Method", + "Module", + "Namespace", + "MarkdownH1", + "MarkdownH2", + "MarkdownH3", + "MarkdownH4", + "MarkdownH5", + "MarkdownH6", + } - for _, value in pairs(dropbar_hl) do - hl["DropBarKind" .. value] = { link = "DropBarKind" } - end - end, - }, + for _, value in pairs(dropbar_hl) do + hl["DropBarKind" .. value] = { link = "DropBarKind" } + end + end, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/ui/which-key.lua b/modules/home-manager/vim/config/lua/plugins/ui/which-key.lua index c80673c..f1498e1 100644 --- a/modules/home-manager/vim/config/lua/plugins/ui/which-key.lua +++ b/modules/home-manager/vim/config/lua/plugins/ui/which-key.lua @@ -1,37 +1,37 @@ local format = require("utils.icons").fmt return { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - require("which-key").register({ - a = { name = format("Fix", "Actions") }, - c = { name = format("Color", "Color") }, - b = { name = format("Windows", "Buffers") }, - u = { name = format("Window", "UI") }, - g = { name = format("Git", "Git") }, - t = { name = format("Terminal", "Terminal") }, - f = { name = format("Search", "Telescope") }, - l = { name = format("Braces", "LSP") }, - d = { name = format("Debugger", "Debugger") }, - n = { name = format("Notification", "Notification") }, - S = { name = format("FolderClock", "Session") }, - r = { name = format("Code", "SnipRun") }, - o = { name = format("DropDown", "Dropbar") }, - v = { name = format("Book", "DevDocs") }, - C = { name = format("Package", "Crates") }, - D = { name = format("Database", "DbUI") }, - }, { prefix = "" }) - end, - opts = { - key_labels = { - [""] = " ", - }, - icons = { - group = "", - }, - window = { - border = "rounded", - }, - }, + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + require("which-key").register({ + a = { name = format("Fix", "Actions") }, + c = { name = format("Color", "Color") }, + b = { name = format("Windows", "Buffers") }, + u = { name = format("Window", "UI") }, + g = { name = format("Git", "Git") }, + t = { name = format("Terminal", "Terminal") }, + f = { name = format("Search", "Telescope") }, + l = { name = format("Braces", "LSP") }, + d = { name = format("Debugger", "Debugger") }, + n = { name = format("Notification", "Notification") }, + S = { name = format("FolderClock", "Session") }, + r = { name = format("Code", "SnipRun") }, + o = { name = format("DropDown", "Dropbar") }, + v = { name = format("Book", "DevDocs") }, + C = { name = format("Package", "Crates") }, + D = { name = format("Database", "DbUI") }, + }, { prefix = "" }) + end, + opts = { + key_labels = { + [""] = " ", + }, + icons = { + group = "", + }, + window = { + border = "rounded", + }, + }, } diff --git a/modules/home-manager/vim/config/lua/plugins/utils/lualine_sources.lua b/modules/home-manager/vim/config/lua/plugins/utils/lualine_sources.lua index 1f718e4..5da9378 100644 --- a/modules/home-manager/vim/config/lua/plugins/utils/lualine_sources.lua +++ b/modules/home-manager/vim/config/lua/plugins/utils/lualine_sources.lua @@ -3,154 +3,166 @@ local fmt = require("utils.icons").fmt local M = {} M.mode = { - "mode", - fmt = function(name) - local map = { - NORMAL = icons.Normal, - INSERT = icons.Insert, - TERMINAL = icons.Terminal, - VISUAL = icons.Visual, - ["V-LINE"] = icons.Visual, - ["V-BLOCK"] = icons.Visual, - ["O-PENDING"] = icons.Ellipsis, - COMMAND = icons.Command, - REPLACE = icons.Edit, - SELECT = icons.Visual, - } - local icon = map[name] and map[name] or icons.Vim - return icon .. " " .. name - end, - color = function() - local colors = require("tokyonight.colors") - local mode = vim.fn.mode() - local map = { - n = colors.default.blue, - i = colors.default.green, - c = colors.default.yellow, - t = colors.default.cyan, - R = colors.default.red, - v = colors.default.magenta, - V = colors.default.magenta, - s = colors.default.magenta, - S = colors.default.magenta, - } - return { - fg = map[mode] or colors.default.magenta, - bg = colors.night.bg, - } - end, + "mode", + fmt = function(name) + local map = { + NORMAL = icons.Normal, + INSERT = icons.Insert, + TERMINAL = icons.Terminal, + VISUAL = icons.Visual, + ["V-LINE"] = icons.Visual, + ["V-BLOCK"] = icons.Visual, + ["O-PENDING"] = icons.Ellipsis, + COMMAND = icons.Command, + REPLACE = icons.Edit, + SELECT = icons.Visual, + } + local icon = map[name] and map[name] or icons.Vim + return icon .. " " .. name + end, + color = function() + local colors = require("tokyonight.colors") + local mode = vim.fn.mode() + local map = { + n = colors.default.blue, + i = colors.default.green, + c = colors.default.yellow, + t = colors.default.cyan, + R = colors.default.red, + v = colors.default.magenta, + V = colors.default.magenta, + s = colors.default.magenta, + S = colors.default.magenta, + } + return { + fg = map[mode] or colors.default.magenta, + bg = colors.night.bg, + } + end, } M.branch = { - "branch", - icon = icons.GitBranch, - color = function() - local colors = require("tokyonight.colors") - return { bg = colors.night.bg } - end, + "branch", + icon = icons.GitBranch, + color = function() + local colors = require("tokyonight.colors") + return { bg = colors.night.bg } + end, } M.diff = { - "diff", - symbols = { - added = fmt("Add", ""), - modified = fmt("Modified", ""), - removed = fmt("Removed", ""), - }, - color = function() - local colors = require("tokyonight.colors") - return { bg = colors.night.bg } - end, + "diff", + symbols = { + added = fmt("Add", ""), + modified = fmt("Modified", ""), + removed = fmt("Removed", ""), + }, + color = function() + local colors = require("tokyonight.colors") + return { bg = colors.night.bg } + end, } M.filetype = { "filetype" } M.diagnostics = { - "diagnostics", - color = function() - local colors = require("tokyonight.colors") - return { bg = colors.night.bg } - end, + "diagnostics", + color = function() + local colors = require("tokyonight.colors") + return { bg = colors.night.bg } + end, } M.encoding = { - "encoding", - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.blue, bg = colors.night.bg } - end, + "encoding", + color = function() + local colors = require("tokyonight.colors") + return { fg = colors.default.blue, bg = colors.night.bg } + end, } M.fileformat = { - "fileformat", - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.blue, bg = colors.night.bg } - end, + "fileformat", + color = function() + local colors = require("tokyonight.colors") + return { fg = colors.default.blue, bg = colors.night.bg } + end, } M.indentation = { - "indentation", - fmt = function() - local type = vim.bo[0].expandtab and "spaces" or "tabs" - local value = vim.bo[0].shiftwidth - return type .. ": " .. value - end, - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.blue, bg = colors.night.bg } - end, + "indentation", + fmt = function() + local type = vim.bo[0].expandtab and "spaces" or "tabs" + local value = vim.bo[0].shiftwidth + return type .. ": " .. value + end, + color = function() + local colors = require("tokyonight.colors") + return { fg = colors.default.blue, bg = colors.night.bg } + end, } M.progress = { - "progress", - fmt = function(location) return vim.trim(location) end, - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.purple, bg = colors.night.bg } - end, + "progress", + fmt = function(location) + return vim.trim(location) + end, + color = function() + local colors = require("tokyonight.colors") + return { fg = colors.default.purple, bg = colors.night.bg } + end, } M.location = { - "location", - fmt = function(location) return vim.trim(location) end, - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.purple, bg = colors.night.bg } - end, + "location", + fmt = function(location) + return vim.trim(location) + end, + color = function() + local colors = require("tokyonight.colors") + return { fg = colors.default.purple, bg = colors.night.bg } + end, } M.macro = { - function() return vim.fn.reg_recording() end, - icon = icons.Recording, - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.red } - end, + function() + return vim.fn.reg_recording() + end, + icon = icons.Recording, + color = function() + local colors = require("tokyonight.colors") + return { fg = colors.default.red } + end, } M.lsp = { - function() - local bufnr = vim.api.nvim_get_current_buf() - local clients = vim.lsp.get_clients({ bufnr = bufnr }) - if next(clients) == nil then return "" end - local attached_clients = vim.tbl_map(function(client) return client.name end, clients) - return table.concat(attached_clients, ", ") - end, - icon = icons.Braces, - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.comment, bg = colors.night.bg } - end, + function() + local bufnr = vim.api.nvim_get_current_buf() + local clients = vim.lsp.get_clients({ bufnr = bufnr }) + if next(clients) == nil then + return "" + end + local attached_clients = vim.tbl_map(function(client) + return client.name + end, clients) + return table.concat(attached_clients, ", ") + end, + icon = icons.Braces, + color = function() + local colors = require("tokyonight.colors") + return { fg = colors.default.comment, bg = colors.night.bg } + end, } M.gap = { - function() return " " end, - color = function() - local colors = require("tokyonight.colors") - return { bg = colors.night.bg } - end, - padding = 0, + function() + return " " + end, + color = function() + local colors = require("tokyonight.colors") + return { bg = colors.night.bg } + end, + padding = 0, } return M diff --git a/modules/home-manager/vim/config/lua/utils/configurer.lua b/modules/home-manager/vim/config/lua/utils/configurer.lua index 222ee1f..a892b5d 100644 --- a/modules/home-manager/vim/config/lua/utils/configurer.lua +++ b/modules/home-manager/vim/config/lua/utils/configurer.lua @@ -1,48 +1,48 @@ local M = {} local set_options = function(options) - for prop, variables in pairs(options) do - for key, value in pairs(variables) do - vim[prop][key] = value - end - end + for prop, variables in pairs(options) do + for key, value in pairs(variables) do + vim[prop][key] = value + end + end end local set_keymaps = function(keymaps) - for mode, maps in pairs(keymaps) do - for key, map in pairs(maps) do - vim.keymap.set(mode, key, map[1], { desc = map[2] }) - end - end + for mode, maps in pairs(keymaps) do + for key, map in pairs(maps) do + vim.keymap.set(mode, key, map[1], { desc = map[2] }) + end + end end local set_autocmd = function(autocmd) - for _, cmd in ipairs(autocmd) do - vim.api.nvim_create_autocmd(cmd.event, cmd.opts) - end + for _, cmd in ipairs(autocmd) do + vim.api.nvim_create_autocmd(cmd.event, cmd.opts) + end end local set_signs = function(signs) - for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, sign) - end + for _, sign in ipairs(signs) do + vim.fn.sign_define(sign.name, sign) + end end local init_lazy = function(spec) - local opts = { - ui = { border = "rounded" }, - spec = { import = spec }, - } + local opts = { + ui = { border = "rounded" }, + spec = { import = spec }, + } - require("lazy").setup(opts) + require("lazy").setup(opts) end M.setup = function(opts) - set_options(opts.options or {}) - set_keymaps(opts.keymaps or {}) - set_autocmd(opts.autocmd or {}) - set_signs(opts.signs or {}) - init_lazy(opts.spec) + set_options(opts.options or {}) + set_keymaps(opts.keymaps or {}) + set_autocmd(opts.autocmd or {}) + set_signs(opts.signs or {}) + init_lazy(opts.spec) end return M diff --git a/modules/home-manager/vim/config/lua/utils/functions.lua b/modules/home-manager/vim/config/lua/utils/functions.lua index 7a89058..ab4fc0b 100644 --- a/modules/home-manager/vim/config/lua/utils/functions.lua +++ b/modules/home-manager/vim/config/lua/utils/functions.lua @@ -1,128 +1,138 @@ local M = {} local input = function(prompt, callback) - local value = vim.fn.input(prompt) - if value:len() ~= 0 then callback(value) end + local value = vim.fn.input(prompt) + if value:len() ~= 0 then + callback(value) + end end local select = function(prompt, callback) - vim.ui.select({ "tabs", "spaces" }, { - prompt = prompt, - }, function(choice) - if choice then callback(choice) end - end) + vim.ui.select({ "tabs", "spaces" }, { + prompt = prompt, + }, function(choice) + if choice then + callback(choice) + end + end) end M.set_filetype = function() - input("Set filetype: ", function(value) - vim.bo[0].filetype = value - vim.notify("Filetype set to " .. value) - end) + input("Set filetype: ", function(value) + vim.bo[0].filetype = value + vim.notify("Filetype set to " .. value) + end) end M.set_indent = function() - input("Set indentation: ", function(value) - local type = vim.bo[0].expandtab and "spaces" or "tabs" - local parsed = tonumber(value) + input("Set indentation: ", function(value) + local type = vim.bo[0].expandtab and "spaces" or "tabs" + local parsed = tonumber(value) - if parsed then - vim.bo[0].shiftwidth = parsed - vim.notify("Indentation set to " .. value .. " " .. type) - else - vim.notify("Invalid value", vim.log.levels.ERROR) - end - end) + if parsed then + vim.bo[0].shiftwidth = parsed + vim.notify("Indentation set to " .. value .. " " .. type) + else + vim.notify("Invalid value", vim.log.levels.ERROR) + end + end) end M.set_indent_type = function() - select("Indent using: ", function(choice) - if choice == "spaces" then - vim.o.expandtab = true - else - vim.o.expandtab = false - end + select("Indent using: ", function(choice) + if choice == "spaces" then + vim.o.expandtab = true + else + vim.o.expandtab = false + end - vim.notify("Indentation using " .. choice) - end) + vim.notify("Indentation using " .. choice) + end) end M.toggle_wrap = function() - vim.wo.wrap = not vim.wo.wrap - vim.wo.linebreak = not vim.wo.linebreak + vim.wo.wrap = not vim.wo.wrap + vim.wo.linebreak = not vim.wo.linebreak end M.comment_line = function() - require("Comment.api").toggle.linewise.count(vim.v.count > 0 and vim.v.count or 1) + require("Comment.api").toggle.linewise.count(vim.v.count > 0 and vim.v.count or 1) end M.comment_selection = function() - vim.cmd("normal ") - require("Comment.api").toggle.linewise(vim.fn.visualmode()) + vim.cmd("normal ") + require("Comment.api").toggle.linewise(vim.fn.visualmode()) end -M.first_buffer = function() require("bufferline").go_to(1) end -M.last_buffer = function() require("bufferline").go_to(-1) end +M.first_buffer = function() + require("bufferline").go_to(1) +end +M.last_buffer = function() + require("bufferline").go_to(-1) +end M.buf_hsplit = function() - require("bufferline.pick").choose_then(function(id) - local name = vim.api.nvim_buf_get_name(id) - vim.cmd("sp" .. name) - vim.cmd("wincmd x") - vim.cmd("wincmd w") - end) + require("bufferline.pick").choose_then(function(id) + local name = vim.api.nvim_buf_get_name(id) + vim.cmd("sp" .. name) + vim.cmd("wincmd x") + vim.cmd("wincmd w") + end) end M.buf_vsplit = function() - require("bufferline.pick").choose_then(function(id) - local name = vim.api.nvim_buf_get_name(id) - vim.cmd("vsp" .. name) - vim.cmd("wincmd x") - vim.cmd("wincmd w") - end) + require("bufferline.pick").choose_then(function(id) + local name = vim.api.nvim_buf_get_name(id) + vim.cmd("vsp" .. name) + vim.cmd("wincmd x") + vim.cmd("wincmd w") + end) end M.open_lazygit = function() - require("toggleterm.terminal").Terminal - :new({ - cmd = "lazygit", - hidden = true, - float_opts = { - width = 100, - height = 25, - }, - on_close = function() - if package.loaded["neo-tree"] then require("neo-tree.events").fire_event("git_event") end - end, - }) - :open() + require("toggleterm.terminal").Terminal + :new({ + cmd = "lazygit", + hidden = true, + float_opts = { + width = 100, + height = 25, + }, + on_close = function() + if package.loaded["neo-tree"] then + require("neo-tree.events").fire_event("git_event") + end + end, + }) + :open() end M.open_glow = function() - require("toggleterm.terminal").Terminal - :new({ - cmd = "glow", - hidden = true, - float_opts = { - width = 100, - height = 25, - }, - }) - :open() + require("toggleterm.terminal").Terminal + :new({ + cmd = "glow", + hidden = true, + float_opts = { + width = 100, + height = 25, + }, + }) + :open() end M.open_dapui = function() - require("neo-tree").close_all() - require("dapui").open() + require("neo-tree").close_all() + require("dapui").open() end M.close_dapui = function() - require("neo-tree").show() - require("dapui").close() + require("neo-tree").show() + require("dapui").close() end M.toggle_dapui = function() - vim.cmd("NeoTreeShowToggle") - require("dapui").toggle() + vim.cmd("NeoTreeShowToggle") + require("dapui").toggle() end return M diff --git a/modules/home-manager/vim/config/lua/utils/icons.lua b/modules/home-manager/vim/config/lua/utils/icons.lua index caf53f3..78a19f2 100644 --- a/modules/home-manager/vim/config/lua/utils/icons.lua +++ b/modules/home-manager/vim/config/lua/utils/icons.lua @@ -1,111 +1,113 @@ local M = {} M.icons = { - Vim = "", - Config = "", - Normal = "󰡛", - Insert = "󰌌", - Terminal = "", - Visual = "󰉸", - Command = "", - Save = "󰳻", - NotSaved = "󱙃", - Restore = "", - Trash = "", - Fedora = "", - Lua = "", - Github = "", - Git = "󰊢", - GitDiff = "", - GitBranch = "", - GitCommit = "", - Add = "󰐕", - Modified = "󰜥", - Removed = "󰍴", - DiffRemoved = "", - Error = "󰅚", - Info = "󰋽", - Warn = "", - Hint = "", - Package = "󰏖", - FileTree = "󰙅", - Folder = "", - EmptyFolder = "", - FolderClock = "󰪻", - FolderOpened = "", - File = "", - NewFile = "", - DefaultFile = "󰈙", - Color = "", - ColorPicker = "󰴱", - ColorOn = "󰌁", - ColorOff = "󰹊", - Swap = "󰓡", - Minimap = "", - Window = "", - Windows = "", - Ellipsis = "…", - Search = "", - TextSearch = "󱩾", - TabSearch = "󱦞", - FileSearch = "󰱼", - Clear = "", - Braces = "󰅩", - Exit = "", - Debugger = "", - Breakpoint = "", - History = "", - Check = "󰄵", - SmallDot = "󰧞", - Dots = "󰇘", - Install = "", - Help = "󰋖", - Clipboard = "󰅌", - Indent = "", - LineWrap = "󰖶", - Comment = "󱋄", - Close = "󰅘", - Open = "󰏋", - Toggle = "󰔡", - Stop = "", - Restart = "", - CloseMultiple = "󰱞", - NextBuffer = "󰮱,", - PrevBuffer = "󰮳", - FoldClose = "", - FoldOpen = "", - Popup = "󰕛", - Vertical = "", - Horizontal = "", - Markdown = "󰽛", - Up = "", - Down = "", - Left = "", - Right = "", - Variable = "", - Symbol = "", - Stack = "", - Format = "󰉣", - Edit = "󰤌", - Fix = "", - Run = "󰐍", - Twilight = "󰖚", - Recording = "󰑋", - Notification = "󰍢", - NotificationDismiss = "󱙍", - NotificationLog = "󰍩", - Code = "", - DropDown = "󰁊", - Web = "󰖟", - Dependencies = "", - Update = "󰚰", - Database = "", - Pin = "", - Book = "󰂽", - BookmarkSearch = "󰺄", - Download = "󰇚", + Vim = "", + Config = "", + Normal = "󰡛", + Insert = "󰌌", + Terminal = "", + Visual = "󰉸", + Command = "", + Save = "󰳻", + NotSaved = "󱙃", + Restore = "", + Trash = "", + Fedora = "", + Lua = "", + Github = "", + Git = "󰊢", + GitDiff = "", + GitBranch = "", + GitCommit = "", + Add = "󰐕", + Modified = "󰜥", + Removed = "󰍴", + DiffRemoved = "", + Error = "󰅚", + Info = "󰋽", + Warn = "", + Hint = "", + Package = "󰏖", + FileTree = "󰙅", + Folder = "", + EmptyFolder = "", + FolderClock = "󰪻", + FolderOpened = "", + File = "", + NewFile = "", + DefaultFile = "󰈙", + Color = "", + ColorPicker = "󰴱", + ColorOn = "󰌁", + ColorOff = "󰹊", + Swap = "󰓡", + Minimap = "", + Window = "", + Windows = "", + Ellipsis = "…", + Search = "", + TextSearch = "󱩾", + TabSearch = "󱦞", + FileSearch = "󰱼", + Clear = "", + Braces = "󰅩", + Exit = "", + Debugger = "", + Breakpoint = "", + History = "", + Check = "󰄵", + SmallDot = "󰧞", + Dots = "󰇘", + Install = "", + Help = "󰋖", + Clipboard = "󰅌", + Indent = "", + LineWrap = "󰖶", + Comment = "󱋄", + Close = "󰅘", + Open = "󰏋", + Toggle = "󰔡", + Stop = "", + Restart = "", + CloseMultiple = "󰱞", + NextBuffer = "󰮱,", + PrevBuffer = "󰮳", + FoldClose = "", + FoldOpen = "", + Popup = "󰕛", + Vertical = "", + Horizontal = "", + Markdown = "󰽛", + Up = "", + Down = "", + Left = "", + Right = "", + Variable = "", + Symbol = "", + Stack = "", + Format = "󰉣", + Edit = "󰤌", + Fix = "", + Run = "󰐍", + Twilight = "󰖚", + Recording = "󰑋", + Notification = "󰍢", + NotificationDismiss = "󱙍", + NotificationLog = "󰍩", + Code = "", + DropDown = "󰁊", + Web = "󰖟", + Dependencies = "", + Update = "󰚰", + Database = "", + Pin = "", + Book = "󰂽", + BookmarkSearch = "󰺄", + Download = "󰇚", } -M.fmt = function(icon, text, space) return M.icons[icon] .. string.rep(" ", space or 1) .. text end +M.fmt = function(icon, text, space) + return M.icons[icon] .. string.rep(" ", space or 1) .. text +end return M diff --git a/modules/home-manager/vim/config/lua/utils/mappings.lua b/modules/home-manager/vim/config/lua/utils/mappings.lua index 3641b84..044f6a6 100644 --- a/modules/home-manager/vim/config/lua/utils/mappings.lua +++ b/modules/home-manager/vim/config/lua/utils/mappings.lua @@ -1,9 +1,19 @@ local M = {} -M.leader = function(key) return "" .. key end -M.cmd = function(cmd) return "" .. cmd .. "" end -M.rcmd = function(cmd) return ":" .. cmd .. "" end -M.lua = function(cmd) return "lua " .. cmd .. "" end -M.notify = function(cmd) return M.cmd("call VSCodeNotify('" .. cmd .. "')") end +M.leader = function(key) + return "" .. key +end +M.cmd = function(cmd) + return "" .. cmd .. "" +end +M.rcmd = function(cmd) + return ":" .. cmd .. "" +end +M.lua = function(cmd) + return "lua " .. cmd .. "" +end +M.notify = function(cmd) + return M.cmd("call VSCodeNotify('" .. cmd .. "')") +end return M diff --git a/modules/home-manager/vim/config/lua/utils/win.lua b/modules/home-manager/vim/config/lua/utils/win.lua index e252818..b3d2f20 100644 --- a/modules/home-manager/vim/config/lua/utils/win.lua +++ b/modules/home-manager/vim/config/lua/utils/win.lua @@ -1,59 +1,61 @@ local M = {} local make_float_config = function(minimal) - local ui = vim.api.nvim_list_uis()[1] - local width = 80 - local height = 25 - local row = (ui.height - height) * 0.4 - local col = (ui.width - width) * 0.5 + local ui = vim.api.nvim_list_uis()[1] + local width = 80 + local height = 25 + local row = (ui.height - height) * 0.4 + local col = (ui.width - width) * 0.5 - return { - col = col, - row = row, - width = width, - height = height, - border = "rounded", - relative = "editor", - style = minimal and "minimal" or nil, - zindex = 10, - } + return { + col = col, + row = row, + width = width, + height = height, + border = "rounded", + relative = "editor", + style = minimal and "minimal" or nil, + zindex = 10, + } end M.open_help_float = function() - local win = vim.api.nvim_get_current_win() - local buf = vim.api.nvim_win_get_buf(win) - local config = make_float_config(true) + local win = vim.api.nvim_get_current_win() + local buf = vim.api.nvim_win_get_buf(win) + local config = make_float_config(true) - vim.api.nvim_win_set_config(win, config) - vim.api.nvim_create_autocmd("WinClosed", { - pattern = tostring(win), - callback = function() vim.api.nvim_buf_delete(buf, {}) end, - }) + vim.api.nvim_win_set_config(win, config) + vim.api.nvim_create_autocmd("WinClosed", { + pattern = tostring(win), + callback = function() + vim.api.nvim_buf_delete(buf, {}) + end, + }) end M.open_lua_win = function() - local buf = vim.api.nvim_create_buf(true, false) - local config = make_float_config(false) - local temp = vim.fn.tempname() - local win = vim.api.nvim_open_win(buf, true, config) + local buf = vim.api.nvim_create_buf(true, false) + local config = make_float_config(false) + local temp = vim.fn.tempname() + local win = vim.api.nvim_open_win(buf, true, config) - vim.bo[buf].ft = "lua" - vim.api.nvim_buf_set_name(buf, temp) - vim.cmd("silent w") + vim.bo[buf].ft = "lua" + vim.api.nvim_buf_set_name(buf, temp) + vim.cmd("silent w") - vim.keymap.set("n", "w", function() - vim.cmd("w") - vim.cmd("luafile %") - vim.lsp.buf.format({ async = true }) - end, { buffer = buf, remap = true, silent = true }) + vim.keymap.set("n", "w", function() + vim.cmd("w") + vim.cmd("luafile %") + vim.lsp.buf.format({ async = true }) + end, { buffer = buf, remap = true, silent = true }) - vim.api.nvim_create_autocmd("WinClosed", { - pattern = tostring(win), - callback = function() - vim.fn.delete(temp) - vim.api.nvim_buf_delete(buf, { force = true }) - end, - }) + vim.api.nvim_create_autocmd("WinClosed", { + pattern = tostring(win), + callback = function() + vim.fn.delete(temp) + vim.api.nvim_buf_delete(buf, { force = true }) + end, + }) end return M diff --git a/modules/home-manager/vim/config/lua/vscode/keymaps.lua b/modules/home-manager/vim/config/lua/vscode/keymaps.lua index 4021913..461569c 100644 --- a/modules/home-manager/vim/config/lua/vscode/keymaps.lua +++ b/modules/home-manager/vim/config/lua/vscode/keymaps.lua @@ -2,49 +2,49 @@ local map = require("utils.mappings") local l, cmd, rcmd, notify = map.leader, map.cmd, map.rcmd, map.notify return { - n = { - -- utils - [l("p")] = { '"+p' }, - [l("P")] = { '"+P' }, - [l(":")] = { ":lua " }, + n = { + -- utils + [l("p")] = { '"+p' }, + [l("P")] = { '"+P' }, + [l(":")] = { ":lua " }, - [l("us")] = { cmd("nohlsearch") }, - [l(";")] = { cmd("VSCodeCommentary") }, + [l("us")] = { cmd("nohlsearch") }, + [l(";")] = { cmd("VSCodeCommentary") }, - -- vscode actions - [l("w")] = { notify("workbench.action.files.save") }, - [l("e")] = { notify("workbench.view.explorer") }, - [l("bq")] = { notify("workbench.action.closeActiveEditor") }, - [l("bn")] = { notify("workbench.action.nextEditorInGroup") }, - [l("bp")] = { notify("workbench.action.previousEditorInGroup") }, - [l("um")] = { notify("editor.action.toggleMinimap") }, - [l("ff")] = { notify("workbench.action.quickOpen") }, - [l("fs")] = { notify("workbench.action.gotoSymbol") }, - [l("nn")] = { notify("notifications.clearAll") }, - [l("nl")] = { notify("notifications.showList") }, + -- vscode actions + [l("w")] = { notify("workbench.action.files.save") }, + [l("e")] = { notify("workbench.view.explorer") }, + [l("bq")] = { notify("workbench.action.closeActiveEditor") }, + [l("bn")] = { notify("workbench.action.nextEditorInGroup") }, + [l("bp")] = { notify("workbench.action.previousEditorInGroup") }, + [l("um")] = { notify("editor.action.toggleMinimap") }, + [l("ff")] = { notify("workbench.action.quickOpen") }, + [l("fs")] = { notify("workbench.action.gotoSymbol") }, + [l("nn")] = { notify("notifications.clearAll") }, + [l("nl")] = { notify("notifications.showList") }, - ["gr"] = { notify("editor.action.goToReferences") }, - [l("lr")] = { notify("editor.action.rename") }, + ["gr"] = { notify("editor.action.goToReferences") }, + [l("lr")] = { notify("editor.action.rename") }, - -- move.nvim - [""] = { cmd("MoveLine(1)") }, - [""] = { cmd("MoveLine(-1)") }, - [""] = { cmd("MoveHChar(-1)") }, - [""] = { cmd("MoveHChar(1)") }, - }, - v = { - -- utils - ["q"] = { "" }, - [l("y")] = { '"+y' }, - [l("p")] = { '"+p' }, - [l("P")] = { '"+P' }, + -- move.nvim + [""] = { cmd("MoveLine(1)") }, + [""] = { cmd("MoveLine(-1)") }, + [""] = { cmd("MoveHChar(-1)") }, + [""] = { cmd("MoveHChar(1)") }, + }, + v = { + -- utils + ["q"] = { "" }, + [l("y")] = { '"+y' }, + [l("p")] = { '"+p' }, + [l("P")] = { '"+P' }, - [l(";")] = { cmd("VSCodeCommentary") }, + [l(";")] = { cmd("VSCodeCommentary") }, - -- move.nvim - [""] = { rcmd("MoveBlock(1)") }, - [""] = { rcmd("MoveBlock(-1)") }, - [""] = { rcmd("MoveHBlock(-1)") }, - [""] = { rcmd("MoveHBlock(1)") }, - }, + -- move.nvim + [""] = { rcmd("MoveBlock(1)") }, + [""] = { rcmd("MoveBlock(-1)") }, + [""] = { rcmd("MoveHBlock(-1)") }, + [""] = { rcmd("MoveHBlock(1)") }, + }, } diff --git a/modules/home-manager/vim/config/lua/vscode/options.lua b/modules/home-manager/vim/config/lua/vscode/options.lua index 9b488d7..1ce3a71 100644 --- a/modules/home-manager/vim/config/lua/vscode/options.lua +++ b/modules/home-manager/vim/config/lua/vscode/options.lua @@ -1,5 +1,5 @@ return { - g = { - mapleader = " ", - }, + g = { + mapleader = " ", + }, } diff --git a/modules/home-manager/vim/config/lua/vscode/plugins.lua b/modules/home-manager/vim/config/lua/vscode/plugins.lua index b659b8a..97bda15 100644 --- a/modules/home-manager/vim/config/lua/vscode/plugins.lua +++ b/modules/home-manager/vim/config/lua/vscode/plugins.lua @@ -1,38 +1,38 @@ local lua = require("utils.mappings").lua return { - { - "kylechui/nvim-surround", - keys = { - { "cs", mode = { "n" } }, - { "ds", mode = { "n" } }, - { "ys", mode = { "n" } }, - { "S", mode = { "v" } }, - }, - opts = {}, - }, - { - "fedepujol/move.nvim", - cmd = { - "MoveLine", - "MoveHChar", - "MoveBlock", - "MoveHBlock", - }, - }, - { - "folke/flash.nvim", - keys = { - { "f", mode = { "n", "v" } }, - { "F", mode = { "n", "v" } }, - { "t", mode = { "n", "v" } }, - { "T", mode = { "n", "v" } }, - { "s", mode = { "n", "v" }, lua('require("flash").jump()') }, - { "ß", mode = "n", lua("require('flash').jump({ pattern = vim.fn.expand('') })") }, - { "S", mode = "n", lua("require('flash').treesitter()") }, - { "o", mode = "o", lua("require('flash').jump()"), desc = "Search jump" }, - { "O", mode = "o", lua("require('flash').treesitter()"), desc = "Tresitter jump" }, - }, - opts = {}, - }, + { + "kylechui/nvim-surround", + keys = { + { "cs", mode = { "n" } }, + { "ds", mode = { "n" } }, + { "ys", mode = { "n" } }, + { "S", mode = { "v" } }, + }, + opts = {}, + }, + { + "fedepujol/move.nvim", + cmd = { + "MoveLine", + "MoveHChar", + "MoveBlock", + "MoveHBlock", + }, + }, + { + "folke/flash.nvim", + keys = { + { "f", mode = { "n", "v" } }, + { "F", mode = { "n", "v" } }, + { "t", mode = { "n", "v" } }, + { "T", mode = { "n", "v" } }, + { "s", mode = { "n", "v" }, lua('require("flash").jump()') }, + { "ß", mode = "n", lua("require('flash').jump({ pattern = vim.fn.expand('') })") }, + { "S", mode = "n", lua("require('flash').treesitter()") }, + { "o", mode = "o", lua("require('flash').jump()"), desc = "Search jump" }, + { "O", mode = "o", lua("require('flash').treesitter()"), desc = "Tresitter jump" }, + }, + opts = {}, + }, }