1
0
Fork 0
This commit is contained in:
Luca Bilke 2024-01-29 15:17:53 +01:00
commit bcee7e3b07
38 changed files with 2330 additions and 1772 deletions

View file

@ -1,64 +1,64 @@
local autocmds = { local autocmds = {
{ -- Handles the automatic line numeration changes { -- Handles the automatic line numeration changes
{ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, { "BufEnter", "FocusGained", "InsertLeave", "WinEnter" },
{ {
pattern = "*", pattern = "*",
command = "if &nu && mode() != \"i\" | set rnu | endif" command = 'if &nu && mode() != "i" | set rnu | endif',
} },
}, },
{ -- Handles the automatic line numeration changes { -- Handles the automatic line numeration changes
{ "BufLeave", "FocusLost", "InsertEnter", "WinLeave" }, { "BufLeave", "FocusLost", "InsertEnter", "WinLeave" },
{ {
pattern = "*", pattern = "*",
command = "if &nu | set nornu | endif" command = "if &nu | set nornu | endif",
} },
}, },
{ -- Use 'q' to quit from common plugins { -- Use 'q' to quit from common plugins
'FileType', "FileType",
{ {
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" }, pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" },
callback = function() callback = function()
vim.cmd [[ vim.cmd([[
nnoremap <silent> <buffer> q :close<CR> nnoremap <silent> <buffer> q :close<CR>
set nobuflisted set nobuflisted
]] ]])
end end,
} },
}, },
{ {
'Filetype', "Filetype",
{ {
pattern = { "gitcommit", "markdown" }, pattern = { "gitcommit", "markdown" },
callback = function() callback = function()
vim.opt_local.spell = true vim.opt_local.spell = true
end, end,
} },
}, },
{ -- Fix auto comment { -- Fix auto comment
'BufWinEnter', "BufWinEnter",
{ {
command = "set formatoptions-=cro" command = "set formatoptions-=cro",
} },
}, },
{ -- Highlight yanked text { -- Highlight yanked text
'TextYankPost', "TextYankPost",
{ {
callback = function() callback = function()
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 }) vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
end end,
} },
} },
} }
vim.api.nvim_create_augroup('user_config', { clear = true }) vim.api.nvim_create_augroup("user_config", { clear = true })
for _, entry in ipairs(autocmds) do for _, entry in ipairs(autocmds) do
local event = entry[1] local event = entry[1]
local opts = entry[2] local opts = entry[2]
if type(opts.group) == "string" and opts.group ~= "" then if type(opts.group) == "string" and opts.group ~= "" then
local exists, _ = pcall(vim.api.nvim_get_autocmds, { group = opts.group }) local exists, _ = pcall(vim.api.nvim_get_autocmds, { group = opts.group })
if not exists then if not exists then
vim.api.nvim_create_augroup(opts.group, {}) vim.api.nvim_create_augroup(opts.group, {})
end end
end end
vim.api.nvim_create_autocmd(event, opts) vim.api.nvim_create_autocmd(event, opts)
end end

View file

@ -1,24 +1,24 @@
local ansible_test = function(path, bufnr) local ansible_test = function(path, bufnr)
local find = { 'tasks', 'roles', 'handlers', 'group_vars', 'host_vars', 'ansible.cfg', '.ansible-lint' } local find = { "tasks", "roles", "handlers", "group_vars", "host_vars", "ansible.cfg", ".ansible-lint" }
local opts = { stop = os.getenv("HOME"), upward = true, limit = 1, path = path } local opts = { stop = os.getenv("HOME"), upward = true, limit = 1, path = path }
if (next(vim.fs.find(find, opts)) ~= nil) then if next(vim.fs.find(find, opts)) ~= nil then
return 'yaml.ansible' return "yaml.ansible"
else else
return 'yaml' return "yaml"
end end
end end
local filetypes = { local filetypes = {
extension = { extension = {
yml = ansible_test, yml = ansible_test,
yaml = ansible_test, yaml = ansible_test,
}, },
filename = { filename = {
["Xresources"] = "xdefaults", ["Xresources"] = "xdefaults",
["Xdefaults"] = "xdefaults", ["Xdefaults"] = "xdefaults",
["xresources"] = "xdefaults", ["xresources"] = "xdefaults",
["xdefaults"] = "xdefaults", ["xdefaults"] = "xdefaults",
}, },
} }
vim.filetype.add(filetypes) vim.filetype.add(filetypes)

View file

@ -1,81 +1,81 @@
return { return {
Diagnostic = "󰭷", Diagnostic = "󰭷",
Error = "󰅗", Error = "󰅗",
Hint = "󰌵", Hint = "󰌵",
Info = "󰋼", Info = "󰋼",
Warn = "󰀦", Warn = "󰀦",
Bug = "󰠭", Bug = "󰠭",
True = "󰸞", True = "󰸞",
Pending = "󰁪", Pending = "󰁪",
False = "󱎘", False = "󱎘",
Close = "󱎘", Close = "󱎘",
Selected = "󰅂", Selected = "󰅂",
Console = "󰆍", Console = "󰆍",
Gear = "󰒓", Gear = "󰒓",
Event = "󱐋", Event = "󱐋",
File = "󰈔", File = "󰈔",
NewFile = "󰝒", NewFile = "󰝒",
FileTree = "󰙅", FileTree = "󰙅",
Import = "󰈠", Import = "󰈠",
Keyboard = "󰌌", Keyboard = "󰌌",
Sleep = "󰒲", Sleep = "󰒲",
Package = "󰏗", Package = "󰏗",
Runtime = "", Runtime = "",
Source = "󰈮", Source = "󰈮",
Code = "", Code = "",
Start = "", Start = "",
Task = "󰱒", Task = "󰱒",
Buffer = "󰧭", Buffer = "󰧭",
Search = "", Search = "",
Speed = "󰾆", Speed = "󰾆",
Test = "", Test = "",
Flame = "", Flame = "",
Leave = "", Leave = "",
Git = "󰊢", Git = "󰊢",
Loaded = "󰜄", Loaded = "󰜄",
Unloaded = "󰛲", Unloaded = "󰛲",
Added = "󰜄", Added = "󰜄",
Modified = "󱗝", Modified = "󱗝",
Removed = "󰛲", Removed = "󰛲",
Untracked = "", Untracked = "",
ChangeDelete = "󰅘", ChangeDelete = "󰅘",
Truncate = "", Truncate = "",
Note = "", Note = "",
lspkind = { lspkind = {
Array = "󰅪", Array = "󰅪",
Boolean = "", Boolean = "",
Class = "󰌗", Class = "󰌗",
Color = "", Color = "",
Constant = "", Constant = "",
Constructor = "", Constructor = "",
Enum = "", Enum = "",
EnumMember = "", EnumMember = "",
Event = "", Event = "",
Field = "", Field = "",
File = "󰈔", File = "󰈔",
Folder = "󰉋", Folder = "󰉋",
Function = "", Function = "",
Interface = "", Interface = "",
Key = "󰌆", Key = "󰌆",
Keyword = "", Keyword = "",
Method = "", Method = "",
Module = "", Module = "",
Namespace = "󰅪", Namespace = "󰅪",
Null = "󰟢", Null = "󰟢",
Number = "", Number = "",
Object = "󰀚", Object = "󰀚",
Operator = "", Operator = "",
Package = "󰏗", Package = "󰏗",
Property = "", Property = "",
Reference = "", Reference = "",
Snippet = "󰆐", Snippet = "󰆐",
String = "󰀬", String = "󰀬",
Struct = "", Struct = "",
Text = "", Text = "",
TypeParameter = "󰊄", TypeParameter = "󰊄",
Unit = "", Unit = "",
Value = "", Value = "",
Variable = "", Variable = "",
}, },
-- progress = { "", "", "", "", "", "", "", "", "", "", "", "", "" }, -- progress = { "", "", "", "", "", "", "", "", "", "", "", "", "" },
} }

View file

@ -5,17 +5,17 @@ local icons = require("config.icons")
local maps = f.empty_map_table() local maps = f.empty_map_table()
M.sections = { M.sections = {
p = { desc = icons.Package .. " Packages" }, p = { desc = icons.Package .. " Packages" },
b = { desc = icons.Buffer .. " Buffers" }, b = { desc = icons.Buffer .. " Buffers" },
bs = { desc = "Sort Buffers" }, bs = { desc = "Sort Buffers" },
d = { desc = icons.Bug .. " Debugger" }, d = { desc = icons.Bug .. " Debugger" },
g = { desc = icons.Git .. " Git" }, g = { desc = icons.Git .. " Git" },
f = { desc = icons.Search .. " Find" }, f = { desc = icons.Search .. " Find" },
l = { desc = icons.Code .. " LSP" }, l = { desc = icons.Code .. " LSP" },
t = { desc = icons.Console .. " Terminal" }, t = { desc = icons.Console .. " Terminal" },
u = { desc = icons.Gear .. " Utility" }, u = { desc = icons.Gear .. " Utility" },
n = { desc = icons.Note .. " Notes" }, n = { desc = icons.Note .. " Notes" },
e = { desc = icons.FileTree .. " File Manager" }, e = { desc = icons.FileTree .. " File Manager" },
} }
-- Standard -- -- Standard --
@ -39,34 +39,40 @@ maps.i["<C-h>"] = { "<C-W>" }
-- Utility -- -- Utility --
if f.is_available("nvim-colorizer.lua") then if f.is_available("nvim-colorizer.lua") then
maps.n["<Leader>u"] = M.sections.u maps.n["<Leader>u"] = M.sections.u
maps.n["<Leader>uc"] = { "<Cmd>ColorizerToggle<CR>", desc = "Toggle colorizer" } maps.n["<Leader>uc"] = { "<Cmd>ColorizerToggle<CR>", desc = "Toggle colorizer" }
end end
-- Notes -- -- Notes --
if f.is_available("zk-nvim") then if f.is_available("zk-nvim") then
maps.n["<Leader>n"] = M.sections.n maps.n["<Leader>n"] = M.sections.n
maps.v["<Leader>n"] = maps.n["<Leader>n"] maps.v["<Leader>n"] = maps.n["<Leader>n"]
maps.n["<Leader>nn"] = { maps.n["<Leader>nn"] = {
function() require("zk").new({ notebook_path = vim.g.wikidir, title = vim.fn.input('Title: ') }) end, function()
desc = "New Note" require("zk").new({ notebook_path = vim.g.wikidir, title = vim.fn.input("Title: ") })
} end,
maps.v["<Leader>nnt"] = { desc = "New Note",
":ZkNewFromTitleSelection { notebook_path = vim.g.wikidir }<CR>", }
desc = "New Note (Selection as title)" maps.v["<Leader>nnt"] = {
} ":ZkNewFromTitleSelection { notebook_path = vim.g.wikidir }<CR>",
maps.v["<Leader>nnc"] = { desc = "New Note (Selection as title)",
":ZkNewFromContentSelection { notebook_path = vim.g.wikidir, title = vim.fn.input('Title: ') }<CR>", }
desc = "New Note (Selection as content)" maps.v["<Leader>nnc"] = {
} ":ZkNewFromContentSelection { notebook_path = vim.g.wikidir, title = vim.fn.input('Title: ') }<CR>",
maps.n["<Leader>no"] = { desc = "New Note (Selection as content)",
function() require("zk").edit({ notebook_path = vim.g.wikidir }) end, }
desc = "Open Note" maps.n["<Leader>no"] = {
} function()
maps.n["<Leader>ni"] = { require("zk").edit({ notebook_path = vim.g.wikidir })
function() require("zk").index({ notebook_path = vim.g.wikidir }) end, end,
desc = "Index Notes" desc = "Open Note",
} }
maps.n["<Leader>ni"] = {
function()
require("zk").index({ notebook_path = vim.g.wikidir })
end,
desc = "Index Notes",
}
end end
-- Window Navigation -- -- Window Navigation --
@ -85,238 +91,656 @@ maps.t["<C-l>"] = { "<Cmd>wincmd l<cr>", desc = "Terminal right window navigatio
-- Plugin Manager -- -- Plugin Manager --
maps.n["<Leader>p"] = M.sections.p maps.n["<Leader>p"] = M.sections.p
maps.n["<Leader>ph"] = { function() require("lazy").home() end, desc = "Home" } maps.n["<Leader>ph"] = {
maps.n["<Leader>pi"] = { function() require("lazy").install() end, desc = "Install" } function()
maps.n["<Leader>pu"] = { function() require("lazy").update() end, desc = "Update" } require("lazy").home()
maps.n["<Leader>ps"] = { function() require("lazy").sync() end, desc = "Sync" } end,
maps.n["<Leader>px"] = { function() require("lazy").clean() end, desc = "Clean" } desc = "Home",
maps.n["<Leader>pc"] = { function() require("lazy").check() end, desc = "Check" } }
maps.n["<Leader>pl"] = { function() require("lazy").log() end, desc = "Log" } maps.n["<Leader>pi"] = {
maps.n["<Leader>pr"] = { function() require("lazy").restore() end, desc = "Restore" } function()
maps.n["<Leader>pp"] = { function() require("lazy").profile() end, desc = "Profile" } require("lazy").install()
maps.n["<Leader>pd"] = { function() require("lazy").debug() end, desc = "Debug" } end,
maps.n["<Leader>p?"] = { function() require("lazy").help() end, desc = "Help" } desc = "Install",
}
maps.n["<Leader>pu"] = {
function()
require("lazy").update()
end,
desc = "Update",
}
maps.n["<Leader>ps"] = {
function()
require("lazy").sync()
end,
desc = "Sync",
}
maps.n["<Leader>px"] = {
function()
require("lazy").clean()
end,
desc = "Clean",
}
maps.n["<Leader>pc"] = {
function()
require("lazy").check()
end,
desc = "Check",
}
maps.n["<Leader>pl"] = {
function()
require("lazy").log()
end,
desc = "Log",
}
maps.n["<Leader>pr"] = {
function()
require("lazy").restore()
end,
desc = "Restore",
}
maps.n["<Leader>pp"] = {
function()
require("lazy").profile()
end,
desc = "Profile",
}
maps.n["<Leader>pd"] = {
function()
require("lazy").debug()
end,
desc = "Debug",
}
maps.n["<Leader>p?"] = {
function()
require("lazy").help()
end,
desc = "Help",
}
if f.is_available("bufferline.nvim") then if f.is_available("bufferline.nvim") then
maps.n["<S-l>"] = { function() require("bufferline").cycle(1) end, desc = "Switch to next buffer" } maps.n["<S-l>"] = {
maps.n["<S-h>"] = { function() require("bufferline").cycle(-1) end, desc = "Switch to previous buffer" } function()
maps.n["<A-l>"] = { function() require("bufferline").move(1) end, desc = "Move buffer to next" } require("bufferline").cycle(1)
maps.n["<A-h>"] = { function() require("bufferline").move(-1) end, desc = "Move buffer to previous" } end,
maps.n["<Leader>b"] = M.sections.b desc = "Switch to next buffer",
maps.n["<Leader>bc"] = { function() require("bufferline").close_others() end, desc = "Close other buffers" } }
maps.n["<Leader>bl"] = { maps.n["<S-h>"] = {
function() require("bufferline").close_in_direction("left") end, function()
desc = "Close lefthand buffers" require("bufferline").cycle(-1)
} end,
maps.n["<Leader>br"] = { desc = "Switch to previous buffer",
function() require("bufferline").close_in_direction("right") end, }
desc = "Close righthand buffers" maps.n["<A-l>"] = {
} function()
maps.n["<Leader>bs"] = M.sections.bs require("bufferline").move(1)
maps.n["<Leader>bse"] = { function() require("bufferline").sort_by("extension") end, desc = "By extension" } end,
maps.n["<Leader>bsd"] = { function() require("bufferline").sort_by("directory") end, desc = "By directory" } desc = "Move buffer to next",
maps.n["<Leader>bsr"] = { }
function() require("bufferline").sort_by("relative_directory") end, maps.n["<A-h>"] = {
desc = "By relative directory" function()
} require("bufferline").move(-1)
maps.n["<Leader>bst"] = { function() require("bufferline").sort_by("tabs") end, desc = "By tabs" } end,
desc = "Move buffer to previous",
}
maps.n["<Leader>b"] = M.sections.b
maps.n["<Leader>bc"] = {
function()
require("bufferline").close_others()
end,
desc = "Close other buffers",
}
maps.n["<Leader>bl"] = {
function()
require("bufferline").close_in_direction("left")
end,
desc = "Close lefthand buffers",
}
maps.n["<Leader>br"] = {
function()
require("bufferline").close_in_direction("right")
end,
desc = "Close righthand buffers",
}
maps.n["<Leader>bs"] = M.sections.bs
maps.n["<Leader>bse"] = {
function()
require("bufferline").sort_by("extension")
end,
desc = "By extension",
}
maps.n["<Leader>bsd"] = {
function()
require("bufferline").sort_by("directory")
end,
desc = "By directory",
}
maps.n["<Leader>bsr"] = {
function()
require("bufferline").sort_by("relative_directory")
end,
desc = "By relative directory",
}
maps.n["<Leader>bst"] = {
function()
require("bufferline").sort_by("tabs")
end,
desc = "By tabs",
}
end end
if f.is_available("Comment.nvim") then if f.is_available("Comment.nvim") then
maps.n["<Leader>/"] = { maps.n["<Leader>/"] = {
function() require("Comment.api").toggle.linewise.count(vim.v.count > 0 and vim.v.count or 1) end, function()
desc = "Toggle comment line", require("Comment.api").toggle.linewise.count(vim.v.count > 0 and vim.v.count or 1)
} end,
maps.v["<Leader>/"] = { desc = "Toggle comment line",
"<esc><Cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", }
desc = "Toggle comment for selection", maps.v["<Leader>/"] = {
} "<esc><Cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
desc = "Toggle comment for selection",
}
end end
if f.is_available("gitsigns.nvim") then if f.is_available("gitsigns.nvim") then
maps.n["<Leader>g"] = M.sections.g maps.n["<Leader>g"] = M.sections.g
maps.n["]g"] = { function() require("gitsigns").next_hunk() end, desc = "Next Git hunk" } maps.n["]g"] = {
maps.n["[g"] = { function() require("gitsigns").prev_hunk() end, desc = "Previous Git hunk" } function()
maps.n["<Leader>gl"] = { function() require("gitsigns").blame_line() end, desc = "View Git blame" } require("gitsigns").next_hunk()
maps.n["<Leader>gL"] = { function() require("gitsigns").blame_line { full = true } end, desc = "View full Git blame" } end,
maps.n["<Leader>gp"] = { function() require("gitsigns").preview_hunk() end, desc = "Preview Git hunk" } desc = "Next Git hunk",
maps.n["<Leader>gh"] = { function() require("gitsigns").reset_hunk() end, desc = "Reset Git hunk" } }
maps.n["<Leader>gr"] = { function() require("gitsigns").reset_buffer() end, desc = "Reset Git buffer" } maps.n["[g"] = {
maps.n["<Leader>gs"] = { function() require("gitsigns").stage_hunk() end, desc = "Stage Git hunk" } function()
maps.n["<Leader>gS"] = { function() require("gitsigns").stage_buffer() end, desc = "Stage Git buffer" } require("gitsigns").prev_hunk()
maps.n["<Leader>gu"] = { function() require("gitsigns").undo_stage_hunk() end, desc = "Unstage Git hunk" } end,
maps.n["<Leader>gd"] = { function() require("gitsigns").diffthis() end, desc = "View Git diff" } desc = "Previous Git hunk",
}
maps.n["<Leader>gl"] = {
function()
require("gitsigns").blame_line()
end,
desc = "View Git blame",
}
maps.n["<Leader>gL"] = {
function()
require("gitsigns").blame_line({ full = true })
end,
desc = "View full Git blame",
}
maps.n["<Leader>gp"] = {
function()
require("gitsigns").preview_hunk()
end,
desc = "Preview Git hunk",
}
maps.n["<Leader>gh"] = {
function()
require("gitsigns").reset_hunk()
end,
desc = "Reset Git hunk",
}
maps.n["<Leader>gr"] = {
function()
require("gitsigns").reset_buffer()
end,
desc = "Reset Git buffer",
}
maps.n["<Leader>gs"] = {
function()
require("gitsigns").stage_hunk()
end,
desc = "Stage Git hunk",
}
maps.n["<Leader>gS"] = {
function()
require("gitsigns").stage_buffer()
end,
desc = "Stage Git buffer",
}
maps.n["<Leader>gu"] = {
function()
require("gitsigns").undo_stage_hunk()
end,
desc = "Unstage Git hunk",
}
maps.n["<Leader>gd"] = {
function()
require("gitsigns").diffthis()
end,
desc = "View Git diff",
}
end end
if f.is_available("taolf") then if f.is_available("taolf") then
maps.n["<Leader>e"] = M.sections.e maps.n["<Leader>e"] = M.sections.e
maps.n["E"] = { function() require("taolf").start({ dir = "fd" }) end, desc = "File manager" } maps.n["E"] = {
maps.n["gE"] = { "<Noop>" } function()
maps.n["<Leader>ee"] = { function() require("taolf").start() end, desc = "File manager" } require("taolf").start({ dir = "fd" })
maps.n["<Leader>eg"] = { function() require("taolf").start({ dir = "gwd" }) end, desc = "File manager in git working directory" } end,
maps.n["<Leader>ef"] = { function() require("taolf").start({ dir = "fd" }) end, desc = "File manager in open file's working directory" } desc = "File manager",
}
maps.n["gE"] = { "<Noop>" }
maps.n["<Leader>ee"] = {
function()
require("taolf").start()
end,
desc = "File manager",
}
maps.n["<Leader>eg"] = {
function()
require("taolf").start({ dir = "gwd" })
end,
desc = "File manager in git working directory",
}
maps.n["<Leader>ef"] = {
function()
require("taolf").start({ dir = "fd" })
end,
desc = "File manager in open file's working directory",
}
end end
if f.is_available("mason.nvim") then if f.is_available("mason.nvim") then
maps.n["<Leader>pm"] = { "<Cmd>Mason<cr>", desc = "Mason" } maps.n["<Leader>pm"] = { "<Cmd>Mason<cr>", desc = "Mason" }
end end
if f.is_available "aerial.nvim" then if f.is_available("aerial.nvim") then
maps.n["<leader>l"] = M.sections.l maps.n["<leader>l"] = M.sections.l
maps.n["<leader>lS"] = { function() require("aerial").toggle() end, desc = "Symbols outline" } maps.n["<leader>lS"] = {
function()
require("aerial").toggle()
end,
desc = "Symbols outline",
}
end end
if f.is_available("telescope.nvim") then if f.is_available("telescope.nvim") then
maps.n["<Leader>f"] = M.sections.f maps.n["<Leader>f"] = M.sections.f
maps.n["<Leader>g"] = M.sections.g maps.n["<Leader>g"] = M.sections.g
maps.n["<Leader>gb"] = { maps.n["<Leader>gb"] = {
function() require("telescope.builtin").git_branches { use_file_path = true } end, function()
desc = "Git branches" require("telescope.builtin").git_branches({ use_file_path = true })
} end,
maps.n["<Leader>gc"] = { desc = "Git branches",
function() require("telescope.builtin").git_commits { use_file_path = true } end, }
desc = "Git commits (repository)", maps.n["<Leader>gc"] = {
} function()
maps.n["<Leader>gC"] = { require("telescope.builtin").git_commits({ use_file_path = true })
function() require("telescope.builtin").git_bcommits { use_file_path = true } end, end,
desc = "Git commits (current file)", desc = "Git commits (repository)",
} }
maps.n["<Leader>gt"] = { maps.n["<Leader>gC"] = {
function() require("telescope.builtin").git_status { use_file_path = true } end, function()
desc = "Git status" require("telescope.builtin").git_bcommits({ use_file_path = true })
} end,
maps.n["<Leader>f<CR>"] = { function() require("telescope.builtin").resume() end, desc = "Resume previous search" } desc = "Git commits (current file)",
maps.n["<Leader>f'"] = { function() require("telescope.builtin").marks() end, desc = "Find marks" } }
maps.n["<Leader>f/"] = { maps.n["<Leader>gt"] = {
function() require("telescope.builtin").current_buffer_fuzzy_find() end, function()
desc = "Find words in current buffer" require("telescope.builtin").git_status({ use_file_path = true })
} end,
maps.n["<Leader>fc"] = { function() require("telescope.builtin").grep_string() end, desc = "Find word under cursor" } desc = "Git status",
maps.n["<Leader>fC"] = { function() require("telescope.builtin").commands() end, desc = "Find commands" } }
maps.n["<Leader>ff"] = { function() require("telescope.builtin").find_files() end, desc = "Find files" } maps.n["<Leader>f<CR>"] = {
maps.n["<Leader>fF"] = { function()
function() require("telescope.builtin").find_files({ hidden = true, no_ignore = true }) end, require("telescope.builtin").resume()
desc = "Find all files", end,
} desc = "Resume previous search",
maps.n["<Leader>fh"] = { function() require("telescope.builtin").help_tags() end, desc = "Find help" } }
maps.n["<Leader>fk"] = { function() require("telescope.builtin").keymaps() end, desc = "Find keymaps" } maps.n["<Leader>f'"] = {
maps.n["<Leader>fm"] = { function() require("telescope.builtin").man_pages() end, desc = "Find man" } function()
maps.n["<Leader>fo"] = { function() require("telescope.builtin").oldfiles() end, desc = "Find history" } require("telescope.builtin").marks()
maps.n["<Leader>fr"] = { function() require("telescope.builtin").registers() end, desc = "Find registers" } end,
maps.n["<Leader>fw"] = { function() require("telescope.builtin").live_grep() end, desc = "Find words" } desc = "Find marks",
-- maps.n["<Leader>fb"] = { function() require("telescope.builtin").buffers() end, desc = "Find buffers" } }
maps.n["<Leader>ft"] = { maps.n["<Leader>f/"] = {
function() require("telescope").extensions["todo-comments"].todo() end, function()
desc = require("telescope.builtin").current_buffer_fuzzy_find()
"Find buffers" end,
} desc = "Find words in current buffer",
maps.n["<Leader>fW"] = { }
function() maps.n["<Leader>fc"] = {
require("telescope.builtin").live_grep({ function()
additional_args = function(args) return vim.list_extend(args, { "--hidden", "--no-ignore" }) end, require("telescope.builtin").grep_string()
}) end,
end, desc = "Find word under cursor",
desc = "Find words in all files", }
} maps.n["<Leader>fC"] = {
maps.n["<Leader>l"] = M.sections.l function()
maps.n["<Leader>ls"] = { require("telescope.builtin").commands()
function() end,
local aerial_avail, _ = pcall(require, "aerial") desc = "Find commands",
if aerial_avail then }
require("telescope").extensions.aerial.aerial() maps.n["<Leader>ff"] = {
else function()
require("telescope.builtin").lsp_document_symbols() require("telescope.builtin").find_files()
end end,
end, desc = "Find files",
desc = "Search symbols", }
} maps.n["<Leader>fF"] = {
function()
require("telescope.builtin").find_files({ hidden = true, no_ignore = true })
end,
desc = "Find all files",
}
maps.n["<Leader>fh"] = {
function()
require("telescope.builtin").help_tags()
end,
desc = "Find help",
}
maps.n["<Leader>fk"] = {
function()
require("telescope.builtin").keymaps()
end,
desc = "Find keymaps",
}
maps.n["<Leader>fm"] = {
function()
require("telescope.builtin").man_pages()
end,
desc = "Find man",
}
maps.n["<Leader>fo"] = {
function()
require("telescope.builtin").oldfiles()
end,
desc = "Find history",
}
maps.n["<Leader>fr"] = {
function()
require("telescope.builtin").registers()
end,
desc = "Find registers",
}
maps.n["<Leader>fw"] = {
function()
require("telescope.builtin").live_grep()
end,
desc = "Find words",
}
-- maps.n["<Leader>fb"] = { function() require("telescope.builtin").buffers() end, desc = "Find buffers" }
maps.n["<Leader>ft"] = {
function()
require("telescope").extensions["todo-comments"].todo()
end,
desc = "Find buffers",
}
maps.n["<Leader>fW"] = {
function()
require("telescope.builtin").live_grep({
additional_args = function(args)
return vim.list_extend(args, { "--hidden", "--no-ignore" })
end,
})
end,
desc = "Find words in all files",
}
maps.n["<Leader>l"] = M.sections.l
maps.n["<Leader>ls"] = {
function()
local aerial_avail, _ = pcall(require, "aerial")
if aerial_avail then
require("telescope").extensions.aerial.aerial()
else
require("telescope.builtin").lsp_document_symbols()
end
end,
desc = "Search symbols",
}
end end
if f.is_available("toggleterm.nvim") then if f.is_available("toggleterm.nvim") then
maps.n["<leader>t"] = M.sections.t maps.n["<leader>t"] = M.sections.t
if vim.fn.executable "lazygit" == 1 then if vim.fn.executable("lazygit") == 1 then
maps.n["<leader>g"] = M.sections.g maps.n["<leader>g"] = M.sections.g
maps.n["<leader>gg"] = { maps.n["<leader>gg"] = {
function() function()
local worktree = f.file_worktree() local worktree = f.file_worktree()
local flags = worktree local flags = worktree and (" --work-tree=%s --git-dir=%s"):format(worktree.toplevel, worktree.gitdir)
and (" --work-tree=%s --git-dir=%s"):format(worktree.toplevel, worktree.gitdir) or ""
or "" f.toggle_term_cmd("lazygit " .. flags)
f.toggle_term_cmd("lazygit " .. flags) end,
end, desc = "ToggleTerm lazygit",
desc = "ToggleTerm lazygit", }
} maps.n["<leader>tl"] = maps.n["<leader>gg"]
maps.n["<leader>tl"] = maps.n["<leader>gg"] end
end if vim.fn.executable("node") == 1 then
if vim.fn.executable "node" == 1 then maps.n["<leader>tn"] = {
maps.n["<leader>tn"] = { function() f.toggle_term_cmd "node" end, desc = "ToggleTerm node" } function()
end f.toggle_term_cmd("node")
if vim.fn.executable("gdu") == 1 then end,
maps.n["<leader>tu"] = { function() f.toggle_term_cmd("gdu") end, desc = "ToggleTerm gdu" } desc = "ToggleTerm node",
end }
if vim.fn.executable "btm" == 1 then end
maps.n["<leader>tt"] = { function() f.toggle_term_cmd "btm" end, desc = "ToggleTerm btm" } if vim.fn.executable("gdu") == 1 then
end maps.n["<leader>tu"] = {
local python = vim.fn.executable "python" == 1 and "python" or vim.fn.executable "python3" == 1 and "python3" function()
if python then maps.n["<leader>tp"] = { function() f.toggle_term_cmd(python) end, desc = "ToggleTerm python" } end f.toggle_term_cmd("gdu")
maps.n["<leader>tf"] = { "<Cmd>ToggleTerm direction=float<cr>", desc = "ToggleTerm float" } end,
maps.n["<leader>th"] = { "<Cmd>ToggleTerm direction=horizontal<cr>", desc = "ToggleTerm horizontal split" } desc = "ToggleTerm gdu",
maps.n["<C-z>"] = { "<Cmd>ToggleTerm<cr>", desc = "Toggle terminal" } }
maps.t["<C-z>"] = maps.n["<F7>"] end
if vim.fn.executable("btm") == 1 then
maps.n["<leader>tt"] = {
function()
f.toggle_term_cmd("btm")
end,
desc = "ToggleTerm btm",
}
end
local python = vim.fn.executable("python") == 1 and "python" or vim.fn.executable("python3") == 1 and "python3"
if python then
maps.n["<leader>tp"] = {
function()
f.toggle_term_cmd(python)
end,
desc = "ToggleTerm python",
}
end
maps.n["<leader>tf"] = { "<Cmd>ToggleTerm direction=float<cr>", desc = "ToggleTerm float" }
maps.n["<leader>th"] = { "<Cmd>ToggleTerm direction=horizontal<cr>", desc = "ToggleTerm horizontal split" }
maps.n["<C-z>"] = { "<Cmd>ToggleTerm<cr>", desc = "Toggle terminal" }
maps.t["<C-z>"] = maps.n["<F7>"]
end end
if f.is_available "nvim-dap" then if f.is_available("nvim-dap") then
local conditional_breakpoint = function() local conditional_breakpoint = function()
vim.ui.input({ prompt = "Condition: " }, function(condition) vim.ui.input({ prompt = "Condition: " }, function(condition)
if condition then require("dap").set_breakpoint(condition) end if condition then
end) require("dap").set_breakpoint(condition)
end end
maps.n["<leader>d"] = M.sections.d end)
maps.v["<leader>d"] = M.sections.d end
maps.n["<F5>"] = { function() require("dap").continue() end, desc = "Debugger: Start" } maps.n["<leader>d"] = M.sections.d
maps.n["<S-F5>"] = { function() require("dap").terminate() end, desc = "Debugger: Stop" } maps.v["<leader>d"] = M.sections.d
maps.n["<S-F9>"] = { conditional_breakpoint, desc = "Debugger: Conditional Breakpoint" } maps.n["<F5>"] = {
maps.n["<C-F5>"] = { function() require("dap").restart_frame() end, desc = "Debugger: Restart" } function()
maps.n["<F6>"] = { function() require("dap").pause() end, desc = "Debugger: Pause" } require("dap").continue()
maps.n["<F9>"] = { function() require("dap").toggle_breakpoint() end, desc = "Debugger: Toggle Breakpoint" } end,
maps.n["<F10>"] = { function() require("dap").step_over() end, desc = "Debugger: Step Over" } desc = "Debugger: Start",
maps.n["<F11>"] = { function() require("dap").step_into() end, desc = "Debugger: Step Into" } }
maps.n["<S-F11>"] = { function() require("dap").step_out() end, desc = "Debugger: Step Out" } maps.n["<S-F5>"] = {
maps.n["<leader>db"] = { function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint (F9)" } function()
maps.n["<leader>dB"] = { function() require("dap").clear_breakpoints() end, desc = "Clear Breakpoints" } require("dap").terminate()
maps.n["<leader>dc"] = { function() require("dap").continue() end, desc = "Start/Continue (F5)" } end,
maps.n["<leader>dC"] = { conditional_breakpoint, desc = "Conditional Breakpoint (S-F9)" } desc = "Debugger: Stop",
maps.n["<leader>di"] = { function() require("dap").step_into() end, desc = "Step Into (F11)" } }
maps.n["<leader>do"] = { function() require("dap").step_over() end, desc = "Step Over (F10)" } maps.n["<S-F9>"] = { conditional_breakpoint, desc = "Debugger: Conditional Breakpoint" }
maps.n["<leader>dO"] = { function() require("dap").step_out() end, desc = "Step Out (S-F11)" } maps.n["<C-F5>"] = {
maps.n["<leader>dq"] = { function() require("dap").close() end, desc = "Close Session" } function()
maps.n["<leader>dQ"] = { function() require("dap").terminate() end, desc = "Terminate Session (S-F5)" } require("dap").restart_frame()
maps.n["<leader>dp"] = { function() require("dap").pause() end, desc = "Pause (F6)" } end,
maps.n["<leader>dr"] = { function() require("dap").restart_frame() end, desc = "Restart (C-F5)" } desc = "Debugger: Restart",
maps.n["<leader>dR"] = { function() require("dap").repl.toggle() end, desc = "Toggle REPL" } }
maps.n["<leader>ds"] = { function() require("dap").run_to_cursor() end, desc = "Run To Cursor" } maps.n["<F6>"] = {
function()
require("dap").pause()
end,
desc = "Debugger: Pause",
}
maps.n["<F9>"] = {
function()
require("dap").toggle_breakpoint()
end,
desc = "Debugger: Toggle Breakpoint",
}
maps.n["<F10>"] = {
function()
require("dap").step_over()
end,
desc = "Debugger: Step Over",
}
maps.n["<F11>"] = {
function()
require("dap").step_into()
end,
desc = "Debugger: Step Into",
}
maps.n["<S-F11>"] = {
function()
require("dap").step_out()
end,
desc = "Debugger: Step Out",
}
maps.n["<leader>db"] = {
function()
require("dap").toggle_breakpoint()
end,
desc = "Toggle Breakpoint (F9)",
}
maps.n["<leader>dB"] = {
function()
require("dap").clear_breakpoints()
end,
desc = "Clear Breakpoints",
}
maps.n["<leader>dc"] = {
function()
require("dap").continue()
end,
desc = "Start/Continue (F5)",
}
maps.n["<leader>dC"] = { conditional_breakpoint, desc = "Conditional Breakpoint (S-F9)" }
maps.n["<leader>di"] = {
function()
require("dap").step_into()
end,
desc = "Step Into (F11)",
}
maps.n["<leader>do"] = {
function()
require("dap").step_over()
end,
desc = "Step Over (F10)",
}
maps.n["<leader>dO"] = {
function()
require("dap").step_out()
end,
desc = "Step Out (S-F11)",
}
maps.n["<leader>dq"] = {
function()
require("dap").close()
end,
desc = "Close Session",
}
maps.n["<leader>dQ"] = {
function()
require("dap").terminate()
end,
desc = "Terminate Session (S-F5)",
}
maps.n["<leader>dp"] = {
function()
require("dap").pause()
end,
desc = "Pause (F6)",
}
maps.n["<leader>dr"] = {
function()
require("dap").restart_frame()
end,
desc = "Restart (C-F5)",
}
maps.n["<leader>dR"] = {
function()
require("dap").repl.toggle()
end,
desc = "Toggle REPL",
}
maps.n["<leader>ds"] = {
function()
require("dap").run_to_cursor()
end,
desc = "Run To Cursor",
}
if f.is_available "nvim-dap-ui" then if f.is_available("nvim-dap-ui") then
maps.n["<leader>dE"] = { maps.n["<leader>dE"] = {
function() function()
vim.ui.input({ prompt = "Expression: " }, function(expr) vim.ui.input({ prompt = "Expression: " }, function(expr)
if expr then require("dapui").eval(expr, { enter = true }) end if expr then
end) require("dapui").eval(expr, { enter = true })
end, end
desc = "Evaluate Input", end)
} end,
maps.v["<leader>dE"] = { function() require("dapui").eval() end, desc = "Evaluate Input" } desc = "Evaluate Input",
maps.n["<leader>du"] = { function() require("dapui").toggle() end, desc = "Toggle Debugger UI" } }
maps.n["<leader>dh"] = { function() require("dap.ui.widgets").hover() end, desc = "Debugger Hover" } maps.v["<leader>dE"] = {
end function()
require("dapui").eval()
end,
desc = "Evaluate Input",
}
maps.n["<leader>du"] = {
function()
require("dapui").toggle()
end,
desc = "Toggle Debugger UI",
}
maps.n["<leader>dh"] = {
function()
require("dap.ui.widgets").hover()
end,
desc = "Debugger Hover",
}
end
end end
if f.is_available "nvim-ufo" then if f.is_available("nvim-ufo") then
maps.n["zR"] = { function() require("ufo").openAllFolds() end, desc = "Open all folds" } maps.n["zR"] = {
maps.n["zM"] = { function() require("ufo").closeAllFolds() end, desc = "Close all folds" } function()
maps.n["zr"] = { function() require("ufo").openFoldsExceptKinds() end, desc = "Fold less" } require("ufo").openAllFolds()
maps.n["zm"] = { function() require("ufo").closeFoldsWith() end, desc = "Fold more" } end,
maps.n["zp"] = { function() require("ufo").peekFoldedLinesUnderCursor() end, desc = "Peek fold" } desc = "Open all folds",
}
maps.n["zM"] = {
function()
require("ufo").closeAllFolds()
end,
desc = "Close all folds",
}
maps.n["zr"] = {
function()
require("ufo").openFoldsExceptKinds()
end,
desc = "Fold less",
}
maps.n["zm"] = {
function()
require("ufo").closeFoldsWith()
end,
desc = "Fold more",
}
maps.n["zp"] = {
function()
require("ufo").peekFoldedLinesUnderCursor()
end,
desc = "Peek fold",
}
end end
M.maps = maps M.maps = maps

View file

@ -1,22 +1,22 @@
local conf = { handlers = {}, required = {} } local conf = { handlers = {}, required = {} }
conf.handlers["intelephense"] = { conf.handlers["intelephense"] = {
init_options = { init_options = {
storagePath = os.getenv('XDG_CACHE_HOME') .. '/intelephense', storagePath = os.getenv("XDG_CACHE_HOME") .. "/intelephense",
globalStoragePath = os.getenv('XDG_CONFIG_HOME') .. '/intelephense', globalStoragePath = os.getenv("XDG_CONFIG_HOME") .. "/intelephense",
licenceKey = os.getenv('XDG_CONFIG_HOME') .. '/intelephense/license.txt', licenceKey = os.getenv("XDG_CONFIG_HOME") .. "/intelephense/license.txt",
} },
} }
conf.handlers["bashls"] = { conf.handlers["bashls"] = {
settings = { settings = {
bashIde = { bashIde = {
shellcheckPath = vim.fn.stdpath "data" .. "mason/bin/shellcheck" shellcheckPath = vim.fn.stdpath("data") .. "mason/bin/shellcheck",
} },
} },
} }
conf.required = { "lua_ls", "zk" } conf.required = { "lua_ls", "zk", "bashls" }
conf.ignore = { "rust_analyzer" } -- This will be setup by rustacean.nvim conf.ignore = { "rust_analyzer" } -- This will be setup by rustacean.nvim
return conf return conf

View file

@ -1,53 +1,53 @@
local g = vim.g local g = vim.g
local o = vim.opt local o = vim.opt
local d = vim.diagnostic.config local d = vim.diagnostic.config
g.wikidir = os.getenv("XDG_DOCUMENTS_DIR") .. "/wiki" g.wikidir = os.getenv("XDG_DOCUMENTS_DIR") .. "/wiki"
g.mapleader = " " g.mapleader = " "
g.maplocalleader = " " g.maplocalleader = " "
g.vim_json_conceal = 0 g.vim_json_conceal = 0
g.git_worktrees = { g.git_worktrees = {
{ toplevel = vim.env.HOME, gitdir = vim.env.XDG_DATA_HOME .. "/dots" }, { toplevel = vim.env.HOME, gitdir = vim.env.XDG_DATA_HOME .. "/dots" },
} }
g.max_lines = 1000 g.max_lines = 1000
g.max_size = 1024 * 100 g.max_size = 1024 * 100
o.undodir = vim.fn.stdpath "cache" .. "/undo" o.undodir = vim.fn.stdpath("cache") .. "/undo"
o.clipboard = "unnamedplus" o.clipboard = "unnamedplus"
o.conceallevel = 0 o.conceallevel = 0
o.numberwidth = 3 o.numberwidth = 3
o.hlsearch = true o.hlsearch = true
o.ignorecase = true o.ignorecase = true
o.showmode = false o.showmode = false
o.smartindent = true o.smartindent = true
o.splitbelow = true o.splitbelow = true
o.splitbelow = true o.splitbelow = true
o.splitbelow = true o.splitbelow = true
o.updatetime = 250 o.updatetime = 250
o.writebackup = false o.writebackup = false
o.expandtab = true o.expandtab = true
o.shiftwidth = 4 o.shiftwidth = 4
o.tabstop = 4 o.tabstop = 4
o.cursorline = true o.cursorline = true
o.signcolumn = "yes" o.signcolumn = "yes"
o.wrap = false o.wrap = false
o.scrolloff = 8 o.scrolloff = 8
o.sidescrolloff = 8 o.sidescrolloff = 8
o.undofile = true o.undofile = true
o.title = true o.title = true
o.mouse = "" o.mouse = ""
o.backspace = "indent,eol,start" o.backspace = "indent,eol,start"
o.termguicolors = true o.termguicolors = true
o.timeoutlen = 500 o.timeoutlen = 500
o.foldenable = true o.foldenable = true
o.foldmethod = "expr" o.foldmethod = "expr"
o.foldlevelstart = 99 o.foldlevelstart = 99
o.foldexpr = "nvim_treesitter#foldexpr()" o.foldexpr = "nvim_treesitter#foldexpr()"
o.number = true o.number = true
o.relativenumber = true o.relativenumber = true
o.laststatus = 3 o.laststatus = 3
o.modeline = true o.modeline = true
o.modelines = 3 o.modelines = 3
o.listchars = "eol:$,tab:>-,trail:~,extends:>,precedes:<" o.listchars = "eol:$,tab:>-,trail:~,extends:>,precedes:<"
d({ virtual_text = false }) d({ virtual_text = false })

View file

@ -2,461 +2,569 @@ local M = {}
local icons = require("config.icons") local icons = require("config.icons")
function M.set_title() function M.set_title()
local title = " %t" local title = " %t"
local f = io.popen([[zsh -c ' local f = io.popen([[zsh -c '
source $XDG_CONFIG_HOME/zsh/configs/autogenerated/hashes source $XDG_CONFIG_HOME/zsh/configs/autogenerated/hashes
print -Pn "$USER@$HOST [%3~] " print -Pn "$USER@$HOST [%3~] "
']]) ']])
if f ~= nil then if f ~= nil then
title = f:read("*a") or "" title = f:read("*a") or ""
title = title .. " %t" title = title .. " %t"
f:close() f:close()
end end
vim.opt.titlestring = title vim.opt.titlestring = title
end end
function M.buf_close(bufnr, force) function M.buf_close(bufnr, force)
local kill_command = "bd" local kill_command = "bd"
local bo = vim.bo local bo = vim.bo
local api = vim.api local api = vim.api
local fnamemodify = vim.fn.fnamemodify local fnamemodify = vim.fn.fnamemodify
if bufnr == 0 or bufnr == nil then if bufnr == 0 or bufnr == nil then
bufnr = api.nvim_get_current_buf() bufnr = api.nvim_get_current_buf()
end end
local bufname = api.nvim_buf_get_name(bufnr) local bufname = api.nvim_buf_get_name(bufnr)
if not force then if not force then
local warning local warning
if bo[bufnr].modified then if bo[bufnr].modified then
warning = string.format([[No write since last change for (%s)]], fnamemodify(bufname, ":t")) warning = string.format([[No write since last change for (%s)]], fnamemodify(bufname, ":t"))
elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then
warning = string.format([[Terminal %s will be killed]], bufname) warning = string.format([[Terminal %s will be killed]], bufname)
end end
if warning then if warning then
vim.ui.input({ vim.ui.input({
prompt = string.format([[%s. Close it anyway? [y]es or [n]o (default: no): ]], warning), prompt = string.format([[%s. Close it anyway? [y]es or [n]o (default: no): ]], warning),
}, function(choice) }, function(choice)
if choice:match "ye?s?" then force = true end if choice:match("ye?s?") then
end) force = true
if not force then return end end
end end)
end if not force then
return
end
end
end
-- Get list of window IDs with the buffer to close -- Get list of window IDs with the buffer to close
local windows = vim.tbl_filter(function(win) local windows = vim.tbl_filter(function(win)
return api.nvim_win_get_buf(win) == bufnr return api.nvim_win_get_buf(win) == bufnr
end, api.nvim_list_wins()) end, api.nvim_list_wins())
if #windows == 0 then return end if #windows == 0 then
return
end
if force then if force then
kill_command = kill_command .. "!" kill_command = kill_command .. "!"
end end
-- Get list of active buffers -- Get list of active buffers
local buffers = vim.tbl_filter(function(buf) local buffers = vim.tbl_filter(function(buf)
return api.nvim_buf_is_valid(buf) and bo[buf].buflisted return api.nvim_buf_is_valid(buf) and bo[buf].buflisted
end, api.nvim_list_bufs()) end, api.nvim_list_bufs())
-- If there is only one buffer (which has to be the current one), vim will -- If there is only one buffer (which has to be the current one), vim will
-- create a new buffer on :bd. -- create a new buffer on :bd.
-- For more than one buffer, pick the previous buffer (wrapping around if necessary) -- For more than one buffer, pick the previous buffer (wrapping around if necessary)
if #buffers > 1 then if #buffers > 1 then
for i, v in ipairs(buffers) do for i, v in ipairs(buffers) do
if v == bufnr then if v == bufnr then
local prev_buf_idx = i == 1 and (#buffers - 1) or (i - 1) local prev_buf_idx = i == 1 and (#buffers - 1) or (i - 1)
local prev_buffer = buffers[prev_buf_idx] local prev_buffer = buffers[prev_buf_idx]
for _, win in ipairs(windows) do for _, win in ipairs(windows) do
api.nvim_win_set_buf(win, prev_buffer) api.nvim_win_set_buf(win, prev_buffer)
end end
end end
end end
else else
vim.cmd('q!') vim.cmd("q!")
end end
-- Check if buffer still exists, to ensure the target buffer wasn't killed -- Check if buffer still exists, to ensure the target buffer wasn't killed
-- due to options like bufhidden=wipe. -- due to options like bufhidden=wipe.
if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then
vim.cmd(string.format("%s %d", kill_command, bufnr)) vim.cmd(string.format("%s %d", kill_command, bufnr))
end end
end end
function M.is_available(plugin) function M.is_available(plugin)
local lazy_config_avail, lazy_config = pcall(require, "lazy.core.config") local lazy_config_avail, lazy_config = pcall(require, "lazy.core.config")
return lazy_config_avail and lazy_config.spec.plugins[plugin] ~= nil return lazy_config_avail and lazy_config.spec.plugins[plugin] ~= nil
end end
function M.empty_map_table() function M.empty_map_table()
local maps = {} local maps = {}
for _, mode in ipairs { "", "n", "v", "x", "s", "o", "!", "i", "l", "c", "t" } do for _, mode in ipairs({ "", "n", "v", "x", "s", "o", "!", "i", "l", "c", "t" }) do
maps[mode] = {} maps[mode] = {}
end end
-- TODO: Check this on 0.10.0 release -- TODO: Check this on 0.10.0 release
if vim.fn.has "nvim-0.10.0" == 1 then if vim.fn.has("nvim-0.10.0") == 1 then
for _, abbr_mode in ipairs { "ia", "ca", "!a" } do for _, abbr_mode in ipairs({ "ia", "ca", "!a" }) do
maps[abbr_mode] = {} maps[abbr_mode] = {}
end end
end end
return maps return maps
end end
function M.toggle_term_cmd(opts) function M.toggle_term_cmd(opts)
if not vim.g.user_terminals then if not vim.g.user_terminals then
vim.g.user_terminals = {} vim.g.user_terminals = {}
end end
local terms = vim.g.user_terminals local terms = vim.g.user_terminals
if type(opts) == "string" then opts = { cmd = opts, hidden = true } end if type(opts) == "string" then
local num = vim.v.count > 0 and vim.v.count or 1 opts = { cmd = opts, hidden = true }
if not terms[opts.cmd] then terms[opts.cmd] = {} end end
if not terms[opts.cmd][num] then local num = vim.v.count > 0 and vim.v.count or 1
if not opts.count then opts.count = vim.tbl_count(terms) * 100 + num end if not terms[opts.cmd] then
if not opts.on_exit then opts.on_exit = function() terms[opts.cmd][num] = nil end end terms[opts.cmd] = {}
terms[opts.cmd][num] = require("toggleterm.terminal").Terminal:new(opts) end
end if not terms[opts.cmd][num] then
terms[opts.cmd][num]:toggle() if not opts.count then
opts.count = vim.tbl_count(terms) * 100 + num
end
if not opts.on_exit then
opts.on_exit = function()
terms[opts.cmd][num] = nil
end
end
terms[opts.cmd][num] = require("toggleterm.terminal").Terminal:new(opts)
end
terms[opts.cmd][num]:toggle()
end end
function M.cmd(cmd, show_error) function M.cmd(cmd, show_error)
if type(cmd) == "string" then cmd = { cmd } end if type(cmd) == "string" then
local result = vim.fn.system(cmd) cmd = { cmd }
local success = vim.api.nvim_get_vvar "shell_error" == 0 end
if not success and (show_error == nil or show_error) then local result = vim.fn.system(cmd)
vim.api.nvim_err_writeln(("Error running command %s\nError message:\n%s"):format(table.concat(cmd, " "), result)) local success = vim.api.nvim_get_vvar("shell_error") == 0
end if not success and (show_error == nil or show_error) then
return success and result:gsub("[\27\155][][()#;?%d]*[A-PRZcf-ntqry=><~]", "") or nil vim.api.nvim_err_writeln(
("Error running command %s\nError message:\n%s"):format(table.concat(cmd, " "), result)
)
end
return success and result:gsub("[\27\155][][()#;?%d]*[A-PRZcf-ntqry=><~]", "") or nil
end end
function M.file_worktree(file, worktrees) function M.file_worktree(file, worktrees)
worktrees = worktrees or vim.g.git_worktrees worktrees = worktrees or vim.g.git_worktrees
file = file or vim.fn.expand "%" file = file or vim.fn.expand("%")
for _, worktree in ipairs(worktrees) do for _, worktree in ipairs(worktrees) do
if if
M.cmd({ M.cmd({
"git", "git",
"--work-tree", "--work-tree",
worktree.toplevel, worktree.toplevel,
"--git-dir", "--git-dir",
worktree.gitdir, worktree.gitdir,
"ls-files", "ls-files",
"--error-unmatch", "--error-unmatch",
file, file,
}, false) }, false)
then then
return worktree return worktree
end end
end end
end end
function M.which_key_register() function M.which_key_register()
if M.which_key_queue then if M.which_key_queue then
local wk_avail, wk = pcall(require, "which-key") local wk_avail, wk = pcall(require, "which-key")
if wk_avail then if wk_avail then
for mode, registration in pairs(M.which_key_queue) do for mode, registration in pairs(M.which_key_queue) do
wk.register(registration, { mode = mode }) wk.register(registration, { mode = mode })
end end
M.which_key_queue = nil M.which_key_queue = nil
end end
end end
end end
function M.set_maps(map_table, base) function M.set_maps(map_table, base)
base = base or {} base = base or {}
for mode, maps in pairs(map_table) do for mode, maps in pairs(map_table) do
for keymap, options in pairs(maps) do for keymap, options in pairs(maps) do
if options then if options then
local cmd = options local cmd = options
local keymap_opts = base local keymap_opts = base
if type(options) == "table" then if type(options) == "table" then
cmd = options[1] cmd = options[1]
keymap_opts = vim.tbl_deep_extend("force", keymap_opts, options) keymap_opts = vim.tbl_deep_extend("force", keymap_opts, options)
keymap_opts[1] = nil keymap_opts[1] = nil
end end
if not cmd or keymap_opts.name then -- which-key mapping if not cmd or keymap_opts.name then -- which-key mapping
if not keymap_opts.name then keymap_opts.name = keymap_opts.desc end if not keymap_opts.name then
if not M.which_key_queue then M.which_key_queue = {} end keymap_opts.name = keymap_opts.desc
if not M.which_key_queue[mode] then M.which_key_queue[mode] = {} end end
M.which_key_queue[mode][keymap] = keymap_opts if not M.which_key_queue then
else -- not which-key mapping M.which_key_queue = {}
vim.keymap.set(mode, keymap, cmd, keymap_opts) end
end if not M.which_key_queue[mode] then
end M.which_key_queue[mode] = {}
end end
end M.which_key_queue[mode][keymap] = keymap_opts
if package.loaded["which-key"] then M.which_key_register() end else -- not which-key mapping
vim.keymap.set(mode, keymap, cmd, keymap_opts)
end
end
end
end
if package.loaded["which-key"] then
M.which_key_register()
end
end end
local function del_buffer_autocmd(augroup, bufnr) local function del_buffer_autocmd(augroup, bufnr)
local cmds_found, cmds = pcall(vim.api.nvim_get_autocmds, { group = augroup, buffer = bufnr }) local cmds_found, cmds = pcall(vim.api.nvim_get_autocmds, { group = augroup, buffer = bufnr })
if cmds_found then vim.tbl_map(function(cmd) vim.api.nvim_del_autocmd(cmd.id) end, cmds) end if cmds_found then
vim.tbl_map(function(cmd)
vim.api.nvim_del_autocmd(cmd.id)
end, cmds)
end
end end
local function add_buffer_autocmd(augroup, bufnr, autocmds) local function add_buffer_autocmd(augroup, bufnr, autocmds)
if not vim.tbl_islist(autocmds) then autocmds = { autocmds } end if not vim.tbl_islist(autocmds) then
local cmds_found, cmds = pcall(vim.api.nvim_get_autocmds, { group = augroup, buffer = bufnr }) autocmds = { autocmds }
if not cmds_found or vim.tbl_isempty(cmds) then end
vim.api.nvim_create_augroup(augroup, { clear = false }) local cmds_found, cmds = pcall(vim.api.nvim_get_autocmds, { group = augroup, buffer = bufnr })
for _, autocmd in ipairs(autocmds) do if not cmds_found or vim.tbl_isempty(cmds) then
local events = autocmd.events vim.api.nvim_create_augroup(augroup, { clear = false })
autocmd.events = nil for _, autocmd in ipairs(autocmds) do
autocmd.group = augroup local events = autocmd.events
autocmd.buffer = bufnr autocmd.events = nil
vim.api.nvim_create_autocmd(events, autocmd) autocmd.group = augroup
end autocmd.buffer = bufnr
end vim.api.nvim_create_autocmd(events, autocmd)
end
end
end end
local function has_capability(capability, filter) local function has_capability(capability, filter)
for _, client in ipairs(vim.lsp.get_active_clients(filter)) do for _, client in ipairs(vim.lsp.get_active_clients(filter)) do
if client.supports_method(capability) then return true end if client.supports_method(capability) then
end return true
return false end
end
return false
end end
-- NOTE: LSP Keymaps here -- NOTE: LSP Keymaps here
function M.lsp_on_attach(client, bufnr) function M.lsp_on_attach(client, bufnr)
local lsp_mappings = M.empty_map_table() local lsp_mappings = M.empty_map_table()
lsp_mappings.n["<Leader>ld"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" } lsp_mappings.n["<Leader>ld"] = {
lsp_mappings.n["[d"] = { function() vim.diagnostic.goto_prev() end, desc = "Previous diagnostic" } function()
lsp_mappings.n["]d"] = { function() vim.diagnostic.goto_next() end, desc = "Next diagnostic" } vim.diagnostic.open_float()
lsp_mappings.n["gl"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" } end,
desc = "Hover diagnostics",
}
lsp_mappings.n["[d"] = {
function()
vim.diagnostic.goto_prev()
end,
desc = "Previous diagnostic",
}
lsp_mappings.n["]d"] = {
function()
vim.diagnostic.goto_next()
end,
desc = "Next diagnostic",
}
lsp_mappings.n["gl"] = {
function()
vim.diagnostic.open_float()
end,
desc = "Hover diagnostics",
}
if M.is_available("telescope.nvim") then if M.is_available("telescope.nvim") then
lsp_mappings.n["<Leader>lD"] = { lsp_mappings.n["<Leader>lD"] = {
function() require("telescope.builtin").diagnostics() end, function()
desc = "Search diagnostics", require("telescope.builtin").diagnostics()
} end,
end desc = "Search diagnostics",
}
end
if M.is_available("mason-lspconfig.nvim") then if M.is_available("mason-lspconfig.nvim") then
lsp_mappings.n["<Leader>li"] = { "<cmd>LspInfo<cr>", desc = "LSP information" } lsp_mappings.n["<Leader>li"] = { "<cmd>LspInfo<cr>", desc = "LSP information" }
end end
if M.is_available("none-ls.nvim") then if M.is_available("none-ls.nvim") then
lsp_mappings.n["<Leader>lI"] = { "<cmd>NullLsInfo<cr>", desc = "Null-ls information" } lsp_mappings.n["<Leader>lI"] = { "<cmd>NullLsInfo<cr>", desc = "Null-ls information" }
end end
if client.supports_method("textDocument/codeAction") then if client.supports_method("textDocument/codeAction") then
lsp_mappings.n["<Leader>la"] = { lsp_mappings.n["<Leader>la"] = {
function() vim.lsp.buf.code_action() end, function()
desc = "Code action", vim.lsp.buf.code_action()
} end,
lsp_mappings.v["<Leader>la"] = lsp_mappings.n["<Leader>la"] desc = "Code action",
end }
lsp_mappings.v["<Leader>la"] = lsp_mappings.n["<Leader>la"]
end
if client.supports_method("textDocument/codeLens") then if client.supports_method("textDocument/codeLens") then
vim.lsp.codelens.refresh() vim.lsp.codelens.refresh()
lsp_mappings.n["<Leader>ll"] = { lsp_mappings.n["<Leader>ll"] = {
function() vim.lsp.codelens.refresh() end, function()
desc = "Refresh CodeLens", vim.lsp.codelens.refresh()
} end,
lsp_mappings.n["<Leader>lL"] = { desc = "Refresh CodeLens",
function() vim.lsp.codelens.run() end, }
desc = "Run CodeLens", lsp_mappings.n["<Leader>lL"] = {
} function()
lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" } vim.lsp.codelens.run()
lsp_mappings.n["<Leader>uL"] = { end,
function() vim.lsp.codelens.clear() end, desc = "Run CodeLens",
desc = "Toggle CodeLens" }
} lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" }
end lsp_mappings.n["<Leader>uL"] = {
function()
vim.lsp.codelens.clear()
end,
desc = "Toggle CodeLens",
}
end
if client.supports_method("textDocument/definition") then if client.supports_method("textDocument/definition") then
lsp_mappings.n["gd"] = { lsp_mappings.n["gd"] = {
function() vim.lsp.buf.definition() end, function()
desc = "Go to definition", vim.lsp.buf.definition()
} end,
end desc = "Go to definition",
}
end
if client.supports_method "textDocument/typeDefinition" then if client.supports_method("textDocument/typeDefinition") then
lsp_mappings.n["gy"] = { lsp_mappings.n["gy"] = {
function() vim.lsp.buf.type_definition() end, function()
desc = "Go to type definition", vim.lsp.buf.type_definition()
} end,
end desc = "Go to type definition",
}
end
if client.supports_method("textDocument/declaration") then if client.supports_method("textDocument/declaration") then
lsp_mappings.n["gD"] = { lsp_mappings.n["gD"] = {
function() vim.lsp.buf.declaration() end, function()
desc = "Go to declaration", vim.lsp.buf.declaration()
} end,
end desc = "Go to declaration",
}
end
if client.supports_method("textDocument/implementation") then if client.supports_method("textDocument/implementation") then
lsp_mappings.n["gI"] = { lsp_mappings.n["gI"] = {
function() vim.lsp.buf.implementation() end, function()
desc = "List implementations", vim.lsp.buf.implementation()
} end,
end desc = "List implementations",
}
end
if client.supports_method("textDocument/references") then if client.supports_method("textDocument/references") then
lsp_mappings.n["gr"] = { lsp_mappings.n["gr"] = {
function() vim.lsp.buf.references() end, function()
desc = "List references", vim.lsp.buf.references()
} end,
end desc = "List references",
}
end
if client.supports_method "workspace/symbol" then if client.supports_method("workspace/symbol") then
lsp_mappings.n["<Leader>lG"] = { lsp_mappings.n["<Leader>lG"] = {
function() vim.lsp.buf.workspace_symbol() end, function()
desc = "List symbols" vim.lsp.buf.workspace_symbol()
} end,
end desc = "List symbols",
}
end
if client.supports_method "textDocument/rename" then if client.supports_method("textDocument/rename") then
lsp_mappings.n["<Leader>lr"] = { lsp_mappings.n["<Leader>lr"] = {
function() vim.lsp.buf.rename() end, function()
desc = "Rename symbol", vim.lsp.buf.rename()
} end,
end desc = "Rename symbol",
}
end
-- TODO: Check this on 0.10.0 release -- TODO: Check this on 0.10.0 release
if client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens then if client.supports_method("textDocument/semanticTokens/full") and vim.lsp.semantic_tokens then
vim.b[bufnr].semantic_tokens_enabled = true vim.b[bufnr].semantic_tokens_enabled = true
lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" } lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" }
lsp_mappings.n["<Leader>uY"] = { lsp_mappings.n["<Leader>uY"] = {
function() function()
vim.b[bufnr].semantic_tokens_enabled = not vim.b[bufnr].semantic_tokens_enabled vim.b[bufnr].semantic_tokens_enabled = not vim.b[bufnr].semantic_tokens_enabled
for _, active_client in ipairs(vim.lsp.get_active_clients { bufnr = bufnr }) do for _, active_client in ipairs(vim.lsp.get_active_clients({ bufnr = bufnr })) do
if active_client.server_capabilities.semanticTokensProvider then if active_client.server_capabilities.semanticTokensProvider then
vim.lsp.semantic_tokens[vim.b[bufnr].semantic_tokens_enabled and "start" or "stop"](bufnr, vim.lsp.semantic_tokens[vim.b[bufnr].semantic_tokens_enabled and "start" or "stop"](
active_client.id) bufnr,
end active_client.id
end )
end, end
desc = "Toggle LSP semantic highlight (buffer)", end
} end,
end desc = "Toggle LSP semantic highlight (buffer)",
}
end
if client.supports_method("textDocument/formatting") then if client.supports_method("textDocument/formatting") then
lsp_mappings.n["<Leader>lf"] = { lsp_mappings.n["<Leader>lf"] = {
function() function()
vim.lsp.buf.format({ vim.lsp.buf.format({
filter = function(c) filter = function(c)
local filetype = vim.bo.filetype local filetype = vim.bo.filetype
local n = require "null-ls" local n = require("null-ls")
local s = require "null-ls.sources" local s = require("null-ls.sources")
local method = n.methods.FORMATTING local method = n.methods.FORMATTING
local available_formatters = s.get_available(filetype, method) local available_formatters = s.get_available(filetype, method)
if #available_formatters > 0 then if #available_formatters > 0 then
return c.name == "null-ls" return c.name == "null-ls"
end end
return true return true
end end,
}) })
end, end,
desc = "Format buffer", desc = "Format buffer",
} }
lsp_mappings.v["<Leader>lf"] = lsp_mappings.n["<Leader>lf"] lsp_mappings.v["<Leader>lf"] = lsp_mappings.n["<Leader>lf"]
end end
if client.supports_method("textDocument/documentHighlight") then if client.supports_method("textDocument/documentHighlight") then
add_buffer_autocmd("lsp_document_highlight", bufnr, { add_buffer_autocmd("lsp_document_highlight", bufnr, {
{ {
events = { "CursorHold", "CursorHoldI" }, events = { "CursorHold", "CursorHoldI" },
desc = "highlight references when cursor holds", desc = "highlight references when cursor holds",
callback = function() callback = function()
if not has_capability("textDocument/documentHighlight", { bufnr = bufnr }) then if not has_capability("textDocument/documentHighlight", { bufnr = bufnr }) then
del_buffer_autocmd("lsp_document_highlight", bufnr) del_buffer_autocmd("lsp_document_highlight", bufnr)
return return
end end
vim.lsp.buf.document_highlight() vim.lsp.buf.document_highlight()
end, end,
}, },
{ {
events = { "CursorMoved", "CursorMovedI", "BufLeave" }, events = { "CursorMoved", "CursorMovedI", "BufLeave" },
desc = "clear references when cursor moves", desc = "clear references when cursor moves",
callback = function() vim.lsp.buf.clear_references() end, callback = function()
}, vim.lsp.buf.clear_references()
}) end,
end },
})
end
if client.supports_method("textDocument/hover") then if client.supports_method("textDocument/hover") then
-- TODO: Check this on 0.10.0 release -- TODO: Check this on 0.10.0 release
if vim.fn.has "nvim-0.10" == 0 then if vim.fn.has("nvim-0.10") == 0 then
lsp_mappings.n["K"] = { lsp_mappings.n["K"] = {
function() vim.lsp.buf.hover() end, function()
desc = "Hover symbol", vim.lsp.buf.hover()
} end,
end desc = "Hover symbol",
end }
end
end
if client.supports_method("textDocument/inlayHint") then if client.supports_method("textDocument/inlayHint") then
if vim.b.inlay_hints_enabled == nil then vim.b.inlay_hints_enabled = true end if vim.b.inlay_hints_enabled == nil then
-- TODO: Check this on 0.10.0 release vim.b.inlay_hints_enabled = true
if vim.lsp.inlay_hint then end
if vim.b.inlay_hints_enabled then vim.lsp.inlay_hint.enable(bufnr, true) end -- TODO: Check this on 0.10.0 release
lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" } if vim.lsp.inlay_hint then
lsp_mappings.n["<Leader>uH"] = { if vim.b.inlay_hints_enabled then
function() vim.lsp.inlay_hint.enable(bufnr, true)
vim.b[bufnr].inlay_hints_enabled = not vim.b[bufnr].inlay_hints_enabled end
if vim.lsp.inlay_hint then lsp_mappings.n["<Leader>u"] = { desc = icons.Gear .. " Utility" }
vim.lsp.inlay_hint.enable(bufnr, vim.b[bufnr].inlay_hints_enabled) lsp_mappings.n["<Leader>uH"] = {
end function()
end, vim.b[bufnr].inlay_hints_enabled = not vim.b[bufnr].inlay_hints_enabled
desc = "Toggle inlay hints", if vim.lsp.inlay_hint then
} vim.lsp.inlay_hint.enable(bufnr, vim.b[bufnr].inlay_hints_enabled)
end end
end end,
desc = "Toggle inlay hints",
}
end
end
if client.supports_method "textDocument/signatureHelp" then if client.supports_method("textDocument/signatureHelp") then
lsp_mappings.n["<Leader>lh"] = { lsp_mappings.n["<Leader>lh"] = {
function() vim.lsp.buf.signature_help() end, function()
desc = "Signature help", vim.lsp.buf.signature_help()
} end,
end desc = "Signature help",
}
end
if M.is_available "telescope.nvim" then if M.is_available("telescope.nvim") then
if lsp_mappings.n.gd then if lsp_mappings.n.gd then
lsp_mappings.n.gd[1] = function() require("telescope.builtin").lsp_definitions() end lsp_mappings.n.gd[1] = function()
end require("telescope.builtin").lsp_definitions()
if lsp_mappings.n.gI then end
lsp_mappings.n.gI[1] = function() require("telescope.builtin").lsp_implementations() end end
end if lsp_mappings.n.gI then
if lsp_mappings.n.gr then lsp_mappings.n.gI[1] = function()
lsp_mappings.n.gr[1] = function() require("telescope.builtin").lsp_references() end require("telescope.builtin").lsp_implementations()
end end
if lsp_mappings.n["<Leader>lR"] then end
lsp_mappings.n["<Leader>lR"][1] = function() require("telescope.builtin").lsp_references() end if lsp_mappings.n.gr then
end lsp_mappings.n.gr[1] = function()
if lsp_mappings.n.gy then require("telescope.builtin").lsp_references()
lsp_mappings.n.gy[1] = function() require("telescope.builtin").lsp_type_definitions() end end
end end
if lsp_mappings.n["<Leader>lG"] then if lsp_mappings.n["<Leader>lR"] then
lsp_mappings.n["<Leader>lG"][1] = function() lsp_mappings.n["<Leader>lR"][1] = function()
vim.ui.input({ prompt = "Symbol Query: (leave empty for word under cursor)" }, function(query) require("telescope.builtin").lsp_references()
if query then end
-- word under cursor if given query is empty end
if query == "" then query = vim.fn.expand "<cword>" end if lsp_mappings.n.gy then
require("telescope.builtin").lsp_workspace_symbols { lsp_mappings.n.gy[1] = function()
query = query, require("telescope.builtin").lsp_type_definitions()
prompt_title = ("Find word (%s)"):format(query), end
} end
end if lsp_mappings.n["<Leader>lG"] then
end) lsp_mappings.n["<Leader>lG"][1] = function()
end vim.ui.input({ prompt = "Symbol Query: (leave empty for word under cursor)" }, function(query)
end if query then
end -- word under cursor if given query is empty
if query == "" then
query = vim.fn.expand("<cword>")
end
require("telescope.builtin").lsp_workspace_symbols({
query = query,
prompt_title = ("Find word (%s)"):format(query),
})
end
end)
end
end
end
if not vim.tbl_isempty(lsp_mappings.v) then if not vim.tbl_isempty(lsp_mappings.v) then
if lsp_mappings.v["<Leader>l"] then lsp_mappings.v["<Leader>l"] = { desc = icons.Code .. " LSP" } end if lsp_mappings.v["<Leader>l"] then
if lsp_mappings.v["<Leader>u"] then lsp_mappings.v["<Leader>u"] = { desc = icons.Code .. " LSP" } end lsp_mappings.v["<Leader>l"] = { desc = icons.Code .. " LSP" }
end end
if lsp_mappings.v["<Leader>u"] then
lsp_mappings.v["<Leader>u"] = { desc = icons.Code .. " LSP" }
end
end
M.set_maps(lsp_mappings, { buffer = bufnr }) M.set_maps(lsp_mappings, { buffer = bufnr })
end end
function M.has_value(table, value) function M.has_value(table, value)
for _, v in ipairs(table) do for _, v in ipairs(table) do
if v == value then if v == value then
return true return true
end end
end end
return false return false
end end
return M return M

View file

@ -1,13 +1,13 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
"git", "git",
"clone", "clone",
"--filter=blob:none", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git", "https://github.com/folke/lazy.nvim.git",
"--branch=stable", "--branch=stable",
lazypath, lazypath,
}) })
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", require("plugins.lazy").opts) require("lazy").setup("plugins", require("plugins.lazy").opts)

View file

@ -1,104 +1,110 @@
local M = { "hrsh7th/nvim-cmp" } local M = { "hrsh7th/nvim-cmp" }
M.dependencies = { M.dependencies = {
"saadparwaiz1/cmp_luasnip", "saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
} }
M.event = "InsertEnter" M.event = "InsertEnter"
M.opts = function() M.opts = function()
local cmp = require "cmp" local cmp = require("cmp")
local snip_status_ok, luasnip = pcall(require, "luasnip") local snip_status_ok, luasnip = pcall(require, "luasnip")
local lspkind_status_ok, lspkind = pcall(require, "lspkind") local lspkind_status_ok, lspkind = pcall(require, "lspkind")
if not snip_status_ok then return end if not snip_status_ok then
return
end
local border_opts = { local border_opts = {
border = "rounded", border = "rounded",
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None", winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
} }
local function has_words_before() local function has_words_before()
local line, col = (unpack or table.unpack)(vim.api.nvim_win_get_cursor(0)) local line, col = (unpack or table.unpack)(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end end
return { return {
enabled = function() enabled = function()
local dap_prompt = require("funcs").is_available("cmp-dap") local dap_prompt = require("funcs").is_available("cmp-dap")
and vim.tbl_contains({ "dap-repl", "dapui_watches", "dapui_hover" }, and vim.tbl_contains(
vim.api.nvim_get_option_value("filetype", { buf = 0 })) { "dap-repl", "dapui_watches", "dapui_hover" },
if vim.api.nvim_get_option_value("buftype", { buf = 0 }) == "prompt" and not dap_prompt then vim.api.nvim_get_option_value("filetype", { buf = 0 })
return false )
end if vim.api.nvim_get_option_value("buftype", { buf = 0 }) == "prompt" and not dap_prompt then
return true return false
end, end
preselect = cmp.PreselectMode.None, return true
formatting = { end,
fields = { "kind", "abbr", "menu" }, preselect = cmp.PreselectMode.None,
format = lspkind_status_ok and lspkind.cmp_format(require("plugins.misc.lspkind").opts) or nil, formatting = {
}, fields = { "kind", "abbr", "menu" },
snippet = { format = lspkind_status_ok and lspkind.cmp_format(require("plugins.misc.lspkind").opts) or nil,
expand = function(args) luasnip.lsp_expand(args.body) end, },
}, snippet = {
duplicates = { expand = function(args)
nvim_lsp = 1, luasnip.lsp_expand(args.body)
luasnip = 1, end,
cmp_tabnine = 1, },
buffer = 1, duplicates = {
path = 1, nvim_lsp = 1,
}, luasnip = 1,
confirm_opts = { cmp_tabnine = 1,
behavior = cmp.ConfirmBehavior.Replace, buffer = 1,
select = false, path = 1,
}, },
window = { confirm_opts = {
completion = cmp.config.window.bordered(border_opts), behavior = cmp.ConfirmBehavior.Replace,
documentation = cmp.config.window.bordered(border_opts), select = false,
}, },
mapping = { window = {
["<Up>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select }, completion = cmp.config.window.bordered(border_opts),
["<Down>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select }, documentation = cmp.config.window.bordered(border_opts),
["<C-p>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }, },
["<C-n>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }, mapping = {
["<C-k>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }, ["<Up>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
["<C-j>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }, ["<Down>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
["<C-u>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), ["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), ["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), ["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-y>"] = cmp.config.disable, ["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-e>"] = cmp.mapping { i = cmp.mapping.abort(), c = cmp.mapping.close() }, ["<C-u>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
["<CR>"] = cmp.mapping.confirm { select = false }, ["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
["<Tab>"] = cmp.mapping(function(fallback) ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
if cmp.visible() then ["<C-y>"] = cmp.config.disable,
cmp.select_next_item() ["<C-e>"] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }),
elseif luasnip.expand_or_locally_jumpable() then ["<CR>"] = cmp.mapping.confirm({ select = false }),
luasnip.expand_or_jump() ["<Tab>"] = cmp.mapping(function(fallback)
elseif has_words_before() then if cmp.visible() then
cmp.complete() cmp.select_next_item()
else elseif luasnip.expand_or_locally_jumpable() then
fallback() luasnip.expand_or_jump()
end elseif has_words_before() then
end, { "i", "s" }), cmp.complete()
["<S-Tab>"] = cmp.mapping(function(fallback) else
if cmp.visible() then fallback()
cmp.select_prev_item() end
elseif luasnip.jumpable(-1) then end, { "i", "s" }),
luasnip.jump(-1) ["<S-Tab>"] = cmp.mapping(function(fallback)
else if cmp.visible() then
fallback() cmp.select_prev_item()
end elseif luasnip.jumpable(-1) then
end, { "i", "s" }), luasnip.jump(-1)
}, else
sources = cmp.config.sources { fallback()
{ name = "nvim_lsp", priority = 1000 }, end
{ name = "luasnip", priority = 750 }, end, { "i", "s" }),
{ name = "buffer", priority = 500 }, },
{ name = "path", priority = 250 }, sources = cmp.config.sources({
}, { name = "nvim_lsp", priority = 1000 },
} { name = "luasnip", priority = 750 },
{ name = "buffer", priority = 500 },
{ name = "path", priority = 250 },
}),
}
end end
return M return M

View file

@ -2,11 +2,11 @@ local M = { "rcarriga/cmp-dap" }
M.dependencies = { "nvim-dap" } M.dependencies = { "nvim-dap" }
M.config = function() M.config = function()
require("cmp").setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, { require("cmp").setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, {
sources = { sources = {
{ name = "dap" }, { name = "dap" },
}, },
}) })
end end
return M return M

View file

@ -1,5 +1,5 @@
return { return {
require('plugins.cmp.cmp'), require("plugins.cmp.cmp"),
require('plugins.cmp.dap'), require("plugins.cmp.dap"),
require('plugins.cmp.luasnip'), require("plugins.cmp.luasnip"),
} }

View file

@ -7,14 +7,16 @@ M.build = "make install_jsregexp"
M.dependencies = { "rafamadriz/friendly-snippets" } M.dependencies = { "rafamadriz/friendly-snippets" }
M.opts = { M.opts = {
history = true, history = true,
delete_check_events = "TextChanged", delete_check_events = "TextChanged",
region_check_events = "CursorMoved", region_check_events = "CursorMoved",
} }
M.config = function(_, opts) M.config = function(_, opts)
require("luasnip").config.setup(opts) require("luasnip").config.setup(opts)
vim.tbl_map(function(type) require("luasnip.loaders.from_" .. type).lazy_load() end, { "vscode", "snipmate", "lua" }) vim.tbl_map(function(type)
require("luasnip.loaders.from_" .. type).lazy_load()
end, { "vscode", "snipmate", "lua" })
end end
return M return M

View file

@ -3,15 +3,21 @@ local M = { "rcarriga/nvim-dap-ui" }
M.dependencies = { "nvim-dap" } M.dependencies = { "nvim-dap" }
M.opts = { M.opts = {
floating = { border = "rounded" }, floating = { border = "rounded" },
} }
M.config = function(_, opts) M.config = function(_, opts)
local dap, dapui = require "dap", require "dapui" local dap, dapui = require("dap"), require("dapui")
dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open() end dap.listeners.after.event_initialized["dapui_config"] = function()
dap.listeners.before.event_terminated["dapui_config"] = function() dapui.close() end dapui.open()
dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end end
dapui.setup(opts) dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
dapui.setup(opts)
end end
return M return M

View file

@ -1,5 +1,5 @@
return { return {
require('plugins.dap.dap'), require("plugins.dap.dap"),
require('plugins.dap.dap-ui'), require("plugins.dap.dap-ui"),
require('plugins.dap.mason-dap'), require("plugins.dap.mason-dap"),
} }

View file

@ -1,34 +1,34 @@
local M = { "folke/lazy.nvim" } local M = { "folke/lazy.nvim" }
local icons = require('config.icons') local icons = require("config.icons")
M.opts = { M.opts = {
dev = { dev = {
path = (os.getenv("XDG_DOCUMENTS_DIR") or "~/Documents") .. "/code/nvim-plugins", path = (os.getenv("XDG_DOCUMENTS_DIR") or "~/Documents") .. "/code/nvim-plugins",
}, },
install = { install = {
missing = true, missing = true,
colorscheme = { "tokyonight" }, colorscheme = { "tokyonight" },
}, },
ui = { ui = {
border = "single", border = "single",
icons = { icons = {
cmd = icons.Console .. " ", cmd = icons.Console .. " ",
config = icons.Gear, config = icons.Gear,
event = icons.Event, event = icons.Event,
ft = icons.File .. " ", ft = icons.File .. " ",
init = icons.Gear .. " ", init = icons.Gear .. " ",
import = icons.Import .. " ", import = icons.Import .. " ",
keys = icons.Keyboard .. " ", keys = icons.Keyboard .. " ",
lazy = icons.Sleep .. " ", lazy = icons.Sleep .. " ",
loaded = icons.Loaded, loaded = icons.Loaded,
not_loaded = icons.Unloaded, not_loaded = icons.Unloaded,
plugin = icons.Package, plugin = icons.Package,
runtime = icons.Runtime .. " ", runtime = icons.Runtime .. " ",
source = icons.Source .. " ", source = icons.Source .. " ",
start = icons.Start, start = icons.Start,
task = icons.Task, task = icons.Task,
}, },
}, },
} }
return M return M

View file

@ -3,29 +3,29 @@ local M = { "stevearc/aerial.nvim" }
M.event = { "BufReadPost", "BufNewFile" } M.event = { "BufReadPost", "BufNewFile" }
M.opts = { M.opts = {
attach_mode = "global", attach_mode = "global",
backends = { "lsp", "treesitter", "markdown", "man" }, backends = { "lsp", "treesitter", "markdown", "man" },
disable_max_lines = vim.g.max_lines, disable_max_lines = vim.g.max_lines,
disable_max_size = vim.g.max_size, disable_max_size = vim.g.max_size,
layout = { min_width = 28 }, layout = { min_width = 28 },
show_guides = true, show_guides = true,
filter_kind = false, filter_kind = false,
guides = { guides = {
mid_item = "", mid_item = "",
last_item = "", last_item = "",
nested_top = "", nested_top = "",
whitespace = " ", whitespace = " ",
}, },
keymaps = { keymaps = {
["[y"] = "actions.prev", ["[y"] = "actions.prev",
["]y"] = "actions.next", ["]y"] = "actions.next",
["[Y"] = "actions.prev_up", ["[Y"] = "actions.prev_up",
["]Y"] = "actions.next_up", ["]Y"] = "actions.next_up",
["{"] = false, ["{"] = false,
["}"] = false, ["}"] = false,
["[["] = false, ["[["] = false,
["]]"] = false, ["]]"] = false,
}, },
} }
return M return M

View file

@ -1,10 +1,10 @@
return { return {
{ "folke/neoconf.nvim", config = true }, { "folke/neoconf.nvim", config = true },
{ "folke/neodev.nvim", config = true }, { "folke/neodev.nvim", config = true },
require('plugins.lsp.lspconfig'), require("plugins.lsp.lspconfig"),
require('plugins.lsp.mason'), require("plugins.lsp.mason"),
require('plugins.lsp.mason-lspconfig'), require("plugins.lsp.mason-lspconfig"),
require('plugins.lsp.mason-null-ls'), require("plugins.lsp.mason-null-ls"),
require('plugins.lsp.null-ls'), require("plugins.lsp.null-ls"),
require('plugins.lsp.aerial'), require("plugins.lsp.aerial"),
} }

View file

@ -12,80 +12,77 @@ capabilities.textDocument.completion.completionItem.deprecatedSupport = true
capabilities.textDocument.completion.completionItem.commitCharactersSupport = true capabilities.textDocument.completion.completionItem.commitCharactersSupport = true
capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } } capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } }
capabilities.textDocument.completion.completionItem.resolveSupport = { capabilities.textDocument.completion.completionItem.resolveSupport = {
properties = { "documentation", "detail", "additionalTextEdits" } properties = { "documentation", "detail", "additionalTextEdits" },
} }
capabilities.textDocument.foldingRange = { dynamicRegistration = false, lineFoldingOnly = true } capabilities.textDocument.foldingRange = { dynamicRegistration = false, lineFoldingOnly = true }
local function merge(table, overwrite) local function merge(table, overwrite)
overwrite = overwrite or {} overwrite = overwrite or {}
return table and vim.tbl_deep_extend("force", table, overwrite) or overwrite return table and vim.tbl_deep_extend("force", table, overwrite) or overwrite
end end
M.dependencies = { "mason.nvim", "neoconf.nvim", "neodev.nvim" } M.dependencies = { "mason.nvim", "neoconf.nvim", "neodev.nvim" }
M.cmd = { "LspInstall", "LspUninstall" } M.cmd = { "LspInstall", "LspUninstall" }
M.config = function() M.config = function()
local icons = require("config.icons") local icons = require("config.icons")
local signs = { local signs = {
{ name = "DiagnosticSignError", text = icons.Error, texthl = "DiagnosticSignError" }, { name = "DiagnosticSignError", text = icons.Error, texthl = "DiagnosticSignError" },
{ name = "DiagnosticSignWarn", text = icons.Warn, texthl = "DiagnosticSignWarn" }, { name = "DiagnosticSignWarn", text = icons.Warn, texthl = "DiagnosticSignWarn" },
{ name = "DiagnosticSignHint", text = icons.Hint, texthl = "DiagnosticSignHint" }, { name = "DiagnosticSignHint", text = icons.Hint, texthl = "DiagnosticSignHint" },
{ name = "DiagnosticSignInfo", text = icons.Info, texthl = "DiagnosticSignInfo" }, { name = "DiagnosticSignInfo", text = icons.Info, texthl = "DiagnosticSignInfo" },
{ name = "DapStopped", text = icons.DapStopped, texthl = "DiagnosticWarn" }, { name = "DapStopped", text = icons.DapStopped, texthl = "DiagnosticWarn" },
{ name = "DapBreakpoint", text = icons.DapBreakpoint, texthl = "DiagnosticInfo" }, { name = "DapBreakpoint", text = icons.DapBreakpoint, texthl = "DiagnosticInfo" },
{ name = "DapBreakpointRejected", text = icons.DapBreakpointRejected, texthl = "DiagnosticError" }, { name = "DapBreakpointRejected", text = icons.DapBreakpointRejected, texthl = "DiagnosticError" },
{ name = "DapBreakpointCondition", text = icons.DapBreakpointCondition, texthl = "DiagnosticInfo" }, { name = "DapBreakpointCondition", text = icons.DapBreakpointCondition, texthl = "DiagnosticInfo" },
{ name = "DapLogPoint", text = icons.DapLogPoint, texthl = "DiagnosticInfo" }, { name = "DapLogPoint", text = icons.DapLogPoint, texthl = "DiagnosticInfo" },
} }
for _, sign in ipairs(signs) do for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, sign) vim.fn.sign_define(sign.name, sign)
end end
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = true, virtual_text = true,
signs = { signs = {
text = { text = {
[vim.diagnostic.severity.ERROR] = icons.Error, [vim.diagnostic.severity.ERROR] = icons.Error,
[vim.diagnostic.severity.HINT] = icons.Hint, [vim.diagnostic.severity.HINT] = icons.Hint,
[vim.diagnostic.severity.WARN] = icons.Warn, [vim.diagnostic.severity.WARN] = icons.Warn,
[vim.diagnostic.severity.INFO] = icons.Info, [vim.diagnostic.severity.INFO] = icons.Info,
}, },
active = signs, active = signs,
}, },
update_in_insert = true, update_in_insert = true,
underline = true, underline = true,
severity_sort = true, severity_sort = true,
float = { float = {
focused = false, focused = false,
style = "minimal", style = "minimal",
border = "rounded", border = "rounded",
source = "always", source = "always",
header = "", header = "",
prefix = "", prefix = "",
}, },
}) })
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded", silent = true }) vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded", silent = true })
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( vim.lsp.handlers["textDocument/signatureHelp"] =
vim.lsp.handlers.signature_help, vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded", silent = true })
{ border = "rounded", silent = true }
)
local mlsp = require('mason-lspconfig') local mlsp = require("mason-lspconfig")
mlsp.setup({ ensure_installed = serverconf.required }) mlsp.setup({ ensure_installed = serverconf.required })
mlsp.setup_handlers({ mlsp.setup_handlers({
function(server) function(server)
if not f.has_value(serverconf.ignore, server) then if not f.has_value(serverconf.ignore, server) then
local ls = require("lspconfig")[server] local ls = require("lspconfig")[server]
local ls_opts = merge(ls, { capabilities = capabilities, on_attach = require("funcs").lsp_on_attach }) local ls_opts = merge(ls, { capabilities = capabilities, on_attach = require("funcs").lsp_on_attach })
local opts = merge(ls_opts, serverconf.handlers[server]) local opts = merge(ls_opts, serverconf.handlers[server])
require("lspconfig")[server].setup(opts) require("lspconfig")[server].setup(opts)
end end
end end,
}) })
end end
return M return M

View file

@ -1,29 +1,29 @@
local M = { "williamboman/mason.nvim" } local M = { "williamboman/mason.nvim" }
local icons = require('config.icons') local icons = require("config.icons")
M.cmd = { M.cmd = {
"Mason", "Mason",
"MasonInstall", "MasonInstall",
"MasonUninstall", "MasonUninstall",
"MasonUninstallAll", "MasonUninstallAll",
"MasonLog", "MasonLog",
"MasonUpdate", "MasonUpdate",
} }
M.build = ":MasonUpdate" M.build = ":MasonUpdate"
M.opts = { M.opts = {
ui = { ui = {
border = "none", border = "none",
icons = { icons = {
package_installed = icons.True, package_installed = icons.True,
package_pending = icons.Pending, package_pending = icons.Pending,
package_uninstalled = icons.False, package_uninstalled = icons.False,
}, },
}, },
log_level = vim.log.levels.INFO, log_level = vim.log.levels.INFO,
max_concurrent_installers = 4, max_concurrent_installers = 4,
} }
return M return M

View file

@ -5,7 +5,7 @@ M.event = { "BufReadPost", "BufNewFile" }
M.dependencies = { "mason-null-ls.nvim" } M.dependencies = { "mason-null-ls.nvim" }
M.opts = { M.opts = {
on_attach = require("funcs").lsp_on_attach, on_attach = require("funcs").lsp_on_attach,
} }
return M return M

View file

@ -3,156 +3,163 @@ local M = { "goolord/alpha-nvim" }
M.depends = { "telescope.nvim", "todo-comments.nvim" } M.depends = { "telescope.nvim", "todo-comments.nvim" }
M.opts = function() M.opts = function()
local icons = require("config.icons") local icons = require("config.icons")
local dashboard = require("alpha.themes.dashboard") local dashboard = require("alpha.themes.dashboard")
dashboard.section.header.opts.hl = "DashboardHeader" dashboard.section.header.opts.hl = "DashboardHeader"
dashboard.section.footer.opts.hl = "DashboardFooter" dashboard.section.footer.opts.hl = "DashboardFooter"
local banners = { local banners = {
[1] = { [1] = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀",
"⠀⣀⣴⣶⣶⣶⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀", "⠀⣀⣴⣶⣶⣶⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀",
"⣰⣿⣿⠿⠛⠿⢿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀", "⣰⣿⣿⠿⠛⠿⢿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀",
"⣿⣿⡇⠀⠀⠀⠀⠈⠛⢿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀", "⣿⣿⡇⠀⠀⠀⠀⠈⠛⢿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀",
"⠹⣿⣧⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⡿⠛⠉⠀⢀⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀", "⠹⣿⣧⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⡿⠛⠉⠀⢀⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀",
"⠀⠙⢿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣶⣶⣶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣶⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀", "⠀⠙⢿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣶⣶⣶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣶⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠉⠻⠷⡄⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠀⢀⣠⣤⣤⣄⡀⠀⠀", "⠀⠀⠀⠉⠻⠷⡄⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠀⢀⣠⣤⣤⣄⡀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋⠁⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣷⡀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋⠁⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣷⡀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⡀⠀⠀⠀⠀⣿⠟⠉⠉⠙⢿⣿⣿⣷", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⡀⠀⠀⠀⠀⣿⠟⠉⠉⠙⢿⣿⣿⣷",
"⠀⠀⠀⣀⣠⣤⣤⣤⣶⣶⣶⣤⣤⠀⣴⣿⣿⣿⡿⠟⠛⠛⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠉⠀⠀⠀⢀⣼⣿⣿⡿", "⠀⠀⠀⣀⣠⣤⣤⣤⣶⣶⣶⣤⣤⠀⣴⣿⣿⣿⡿⠟⠛⠛⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠉⠀⠀⠀⢀⣼⣿⣿⡿",
"⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠛⠻⠏⣼⣿⣿⡿⣋⣀⣤⣤⣴⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⣀⣠⣴⣾⣿⣿⡿⠁", "⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠛⠻⠏⣼⣿⣿⡿⣋⣀⣤⣤⣴⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⣀⣠⣴⣾⣿⣿⡿⠁",
"⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡿⠋⠘⠿⠟⠛⠛⢻⣿⣿⣿⠋⠁⠈⠉⢿⣿⣿⣧⠀⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀", "⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡿⠋⠘⠿⠟⠛⠛⢻⣿⣿⣿⠋⠁⠈⠉⢿⣿⣿⣧⠀⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀",
"⠙⣷⣤⣀⠀⠀⠀⢀⣀⣤⣶⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡟⠀⠀⠀⢠⣿⣿⣿⡟⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀", "⠙⣷⣤⣀⠀⠀⠀⢀⣀⣤⣶⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡟⠀⠀⠀⢠⣿⣿⣿⡟⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀",
"⠀⠈⠛⠿⢿⣿⣿⣿⠿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⡀⠀⢠⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠈⠛⠿⢿⣿⣿⣿⠿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⡀⠀⢠⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣷⣶⣶⣶⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣷⣶⣶⣶⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢶⣦⣤⣶⣾⣿⣿⡶⠈⠉⠛⠿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢶⣦⣤⣶⣾⣿⣿⡶⠈⠉⠛⠿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣤⣶⡿⠿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣤⣶⡿⠿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
}, },
[2] = { [2] = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢒⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢒⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢘⡈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢘⡈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢣⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢣⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡌⡦⢠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡌⡦⢠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡐⣸⠂⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡐⣸⠂⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠸⡢⡀⠀⠀⠀⠀⠀⠔⣰⠏⡌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠸⡢⡀⠀⠀⠀⠀⠀⠔⣰⠏⡌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⢖⡠⣨⠊⠒⠠⣀⢀⠊⣠⠃⡰⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠠⠀⠀⠠⠠⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⢖⡠⣨⠊⠒⠠⣀⢀⠊⣠⠃⡰⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠠⠀⠀⠠⠠⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⢰⠑⠚⠀⠀⠀⡉⠀⢇⡰⠀⠀⠀⠀⠀⢀⠠⠐⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠐⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⢰⠑⠚⠀⠀⠀⡉⠀⢇⡰⠀⠀⠀⠀⠀⢀⠠⠐⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠐⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠈⡄⠀⠀⠀⠀⠘⠠⠐⡇⠀⠀⠀⠠⠐⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠈⡄⠀⠀⠀⠀⠘⠠⠐⡇⠀⠀⠀⠠⠐⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢃⠀⠀⠀⠀⠀⠀⢀⠁⠀⢀⠌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠀⠀⠼⢄⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⢃⠀⠀⠀⠀⠀⠀⢀⠁⠀⢀⠌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠀⠀⠼⢄⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⢸⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⠀⠀⠈⠢⠄⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⢸⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⠀⠀⠈⠢⠄⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠸⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠎⠀⠀⠀⠀⠀⠀⡠⠀⠈⢆⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠸⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠎⠀⠀⠀⠀⠀⠀⡠⠀⠈⢆⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠨⠀⠀⠀⠀⠀⠀⠀⢆⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠀⡌⠀⠀⢎⠨⡄⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠨⠀⠀⠀⠀⠀⠀⠀⢆⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠀⡌⠀⠀⢎⠨⡄⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⡂⠀⠀⠀⠀⠀⠀⠈⢎⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠇⠀⠀⠀⠀⠀⠸⠀⠀⢸⠸⢀⠇⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⡂⠀⠀⠀⠀⠀⠀⠈⢎⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠇⠀⠀⠀⠀⠀⠸⠀⠀⢸⠸⢀⠇⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠡⢕⠠⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠀⠀⢐⠀⠀⠈⠢⠥⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠡⢕⠠⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠀⠀⢐⠀⠀⠈⠢⠥⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⡉⠒⠠⣀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠰⡀⠀⠀⡰⠁⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⡉⠒⠠⣀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠰⡀⠀⠀⡰⠁⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠠⢄⠈⠑⠒⠤⡀⠀⢐⠅⠀⠀⠀⠀⠀⠀⠀⡁⡂⠉⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠠⢄⠈⠑⠒⠤⡀⠀⢐⠅⠀⠀⠀⠀⠀⠀⠀⡁⡂⠉⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠤⢀⠓⠈⠢⢀⢀⠠⠤⠐⠀⡉⠌⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠤⢀⠓⠈⠢⢀⢀⠠⠤⠐⠀⡉⠌⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠰⠐⠪⠤⢀⢀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠰⠐⠪⠤⢀⢀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠢⠄⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠒⡠⠄", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠢⠄⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠒⡠⠄",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠀⠂⠐⠐⠐⠂⠂⠠⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠄⠐⠂⠂⠀⠉⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠀⠂⠐⠐⠐⠂⠂⠠⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠄⠐⠂⠂⠀⠉⠀⠀⠀",
}, },
[3] = { [3] = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣴⣶⣶⣾⣿⣿⣿⣿⣿⣷⣶⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣴⣶⣶⣾⣿⣿⣿⣿⣿⣷⣶⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⠿⠟⠛⠉⠉⠉⠉⠉⢉⣭⡉⠉⠛⠻⠿⣿⣿⣿⣿⣿⣿⣶⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⠿⠟⠛⠉⠉⠉⠉⠉⢉⣭⡉⠉⠛⠻⠿⣿⣿⣿⣿⣿⣿⣶⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣦⡀⠀⠀⠀⠉⠛⢿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣦⡀⠀⠀⠀⠉⠛⢿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠈⠻⢿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠈⠻⢿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀",
"⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣿⣿⣿⣿⣦⡀⠀⠀⠀", "⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣿⣿⣿⣿⣦⡀⠀⠀⠀",
"⠀⠀⢀⣾⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣦⡀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣷⡀⠀⠀", "⠀⠀⢀⣾⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣦⡀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣷⡀⠀⠀",
"⠀⠀⣾⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡦⠀⠀⠀⠀⠀⢻⣿⣿⣿⣷⠀⠀", "⠀⠀⣾⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡦⠀⠀⠀⠀⠀⢻⣿⣿⣿⣷⠀⠀",
"⠀⣼⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠛⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣿⣧⠀", "⠀⣼⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠛⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣿⣧⠀",
"⢠⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣿⣿⣿⡄", "⢠⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣿⣿⣿⡄",
"⢸⣿⣿⣿⡇⠀⡀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣦⡀⢸⣿⣿⣿⡇", "⢸⣿⣿⣿⡇⠀⡀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣦⡀⢸⣿⣿⣿⡇",
"⣿⣿⣿⣿⡇⠀⣿⣦⣤⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⢸⣿⣿⣿⣿", "⣿⣿⣿⣿⡇⠀⣿⣦⣤⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⢸⣿⣿⣿⣿",
"⣿⣿⣿⣿⠀⠀⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⣿⣿⣿⣿", "⣿⣿⣿⣿⠀⠀⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⣿⣿⣿⣿",
"⣿⣿⣿⣿⡇⠀⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⢸⣿⣿⣿⣿", "⣿⣿⣿⣿⡇⠀⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⢸⣿⣿⣿⣿",
"⢸⣿⣿⣿⡇⠀⠉⠉⠉⠉⠉⠉⠉⢠⡀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⢸⣿⣿⣿⡇", "⢸⣿⣿⣿⡇⠀⠉⠉⠉⠉⠉⠉⠉⢠⡀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⢸⣿⣿⣿⡇",
"⠘⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣦⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⠃", "⠘⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣦⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⠃",
"⠀⢻⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣤⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡟⠀", "⠀⢻⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣤⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡟⠀",
"⠀⠀⢿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡿⠀⠀", "⠀⠀⢿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡿⠀⠀",
"⠀⠀⠈⢿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣦⡀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⡿⠁⠀⠀", "⠀⠀⠈⢿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣦⡀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⡿⠁⠀⠀",
"⠀⠀⠀⠈⠻⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀", "⠀⠀⠀⠈⠻⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀",
"⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣷⣤⣀⠀⠀⠀⠀⠀⠿⠿⠿⠿⠿⠿⠦⠀⠀⠀⠀⠀⣀⣤⣾⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣷⣤⣀⠀⠀⠀⠀⠀⠿⠿⠿⠿⠿⠿⠦⠀⠀⠀⠀⠀⣀⣤⣾⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⣿⣶⣦⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣤⣴⣶⣿⣿⣿⣿⣿⣿⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⣿⣶⣦⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣤⣴⣶⣿⣿⣿⣿⣿⣿⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠻⠿⠿⢿⣿⣿⣿⣿⣿⡿⠿⠿⠟⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠻⠿⠿⢿⣿⣿⣿⣿⣿⡿⠿⠿⠟⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
}, },
[4] = { [4] = {
"", "",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡠⠤⠤⠤⠤⠤⠤⠤⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡠⠤⠤⠤⠤⠤⠤⠤⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠒⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠒⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢦⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢦⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢇⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢇⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⡾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡆⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⡾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡆⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⢸⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡀⠀⠀⠀⠀⠀", "⠀⠀⠀⢸⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡀⠀⠀⠀⠀⠀",
"⠀⠀⠀⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀", "⠀⠀⠀⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀",
"⠀⠀⢠⣯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⠀⠀⠀⠀⠀", "⠀⠀⢠⣯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⠀⠀⠀⠀⠀",
"⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⠿⠟⠁⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⠀⠀⠀⠀⠀", "⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⠿⠟⠁⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⠀⠀⠀⠀⠀",
"⠀⠀⣸⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⡀⠀⠀⢉⣿⣿⠀⠀⠀⠀⠀", "⠀⠀⣸⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⡀⠀⠀⢉⣿⣿⠀⠀⠀⠀⠀",
"⠀⠀⣿⣿⣿⣿⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⠿⠿⠿⠟⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀", "⠀⠀⣿⣿⣿⣿⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⠿⠿⠿⠟⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀",
"⠀⠀⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣤⣤⣀⡀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀", "⠀⠀⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣤⣤⣀⡀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀",
"⠀⠀⠀⠘⣿⣿⣿⣯⡉⠙⠛⠻⠿⢿⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣶⣦⣄⣀⡀⠀⠀⠀⣀⣀⣠⣤⣾⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀", "⠀⠀⠀⠘⣿⣿⣿⣯⡉⠙⠛⠻⠿⢿⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣶⣦⣄⣀⡀⠀⠀⠀⣀⣀⣠⣤⣾⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠸⣿⣿⣿⣷⣤⠀⠀⠀⠀⠀⠉⠙⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠸⣿⣿⣿⣷⣤⠀⠀⠀⠀⠀⠉⠙⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣶⣀⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣶⣀⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣶⣶⣤⣄⠀⢀⠀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠀⠈⠙⠛⠻⠿⠿⠿⠀⢀⣠⣴⣶⣦⡀⠀⠀", "⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣶⣶⣤⣄⠀⢀⠀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠀⠈⠙⠛⠻⠿⠿⠿⠀⢀⣠⣴⣶⣦⡀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⣿⣿⣿⣷⡀⢀⠀⠀⠀⠀⠀⠀⡀⢠⣿⠟⠉⠀⠀⠁⣀⡀", "⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⣿⣿⣿⣷⡀⢀⠀⠀⠀⠀⠀⠀⡀⢠⣿⠟⠉⠀⠀⠁⣀⡀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣷⣤⣦⣀⣤⣿⣿⣿⡀⠀⢀⣠⣾⣿⣿", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣷⣤⣦⣀⣤⣿⣿⣿⡀⠀⢀⣠⣾⣿⣿",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠃", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠃",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠻⠿⠿⠿⣿⡿⠿⠿⠿⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠻⠿⠿⠿⣿⡿⠿⠿⠿⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀",
}, },
} }
dashboard.section.header.val = banners[2] dashboard.section.header.val = banners[2]
dashboard.section.buttons.val = { dashboard.section.buttons.val = {
dashboard.button("n", icons.File .. " New file", "<Cmd>ene<CR>"), dashboard.button("n", icons.File .. " New file", "<Cmd>ene<CR>"),
dashboard.button("f", icons.Search .. " Find file", "<Cmd>lua require('telescope.builtin').find_files()<CR>"), dashboard.button("f", icons.Search .. " Find file", "<Cmd>lua require('telescope.builtin').find_files()<CR>"),
dashboard.button("e", icons.FileTree .. " Browse files", "<Cmd>lua require('taolf').start({ dir = 'gwd' })<CR>"), dashboard.button(
dashboard.button("t", icons.Task .. " Find todo", "e",
"<Cmd>:lua require('telescope').extensions['todo-comments'].todo()<CR>"), icons.FileTree .. " Browse files",
dashboard.button("q", icons.Leave .. " Quit", "<Cmd>qa<CR>"), "<Cmd>lua require('taolf').start({ dir = 'gwd' })<CR>"
} ),
dashboard.button(
"t",
icons.Task .. " Find todo",
"<Cmd>:lua require('telescope').extensions['todo-comments'].todo()<CR>"
),
dashboard.button("q", icons.Leave .. " Quit", "<Cmd>qa<CR>"),
}
dashboard.section.footer.val = "Behold: a Snail's Vim" dashboard.section.footer.val = "Behold: a Snail's Vim"
dashboard.config.layout = { dashboard.config.layout = {
{ type = "padding", val = vim.fn.max { 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) } }, { type = "padding", val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) }) },
dashboard.section.header, dashboard.section.header,
{ type = "padding", val = 5 }, { type = "padding", val = 5 },
dashboard.section.buttons, dashboard.section.buttons,
{ type = "padding", val = 3 }, { type = "padding", val = 3 },
dashboard.section.footer, dashboard.section.footer,
} }
dashboard.config.opts.noautocmd = true dashboard.config.opts.noautocmd = true
return dashboard return dashboard
end end
M.config = function(_, opts) M.config = function(_, opts)
require("alpha").setup(opts.config) require("alpha").setup(opts.config)
vim.api.nvim_create_autocmd("User", { vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted", pattern = "LazyVimStarted",
desc = "Add Alpha dashboard footer", desc = "Add Alpha dashboard footer",
once = true, once = true,
callback = function() callback = function()
local stats = require("lazy").stats() local stats = require("lazy").stats()
local ms = math.floor(stats.startuptime * 100 + 0.5) / 100 local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
opts.section.footer.val = { "Behold: a Snail's Vim | " .. stats.count .. "" .. ms .. "ms" } opts.section.footer.val = { "Behold: a Snail's Vim | " .. stats.count .. "" .. ms .. "ms" }
pcall(vim.cmd.AlphaRedraw) pcall(vim.cmd.AlphaRedraw)
end, end,
}) })
end end
return M return M

View file

@ -3,13 +3,13 @@ local M = { "windwp/nvim-autopairs" }
M.event = { "BufReadPost", "BufNewFile" } M.event = { "BufReadPost", "BufNewFile" }
M.opts = { M.opts = {
check_ts = true, check_ts = true,
disable_filetype = { "TelescopePrompt", "vim" }, disable_filetype = { "TelescopePrompt", "vim" },
ts_config = { ts_config = {
lua = { "string", "source" }, lua = { "string", "source" },
javascript = { "string", "template_string" }, javascript = { "string", "template_string" },
java = false, java = false,
}, },
} }
return M return M

View file

@ -3,56 +3,56 @@ local M = { "akinsho/bufferline.nvim" }
M.event = { "BufReadPost", "BufNewFile" } M.event = { "BufReadPost", "BufNewFile" }
M.opts = function() M.opts = function()
local icons = require('config.icons') local icons = require("config.icons")
local function diagnostics_indicator(_, _, diagnostics, _) local function diagnostics_indicator(_, _, diagnostics, _)
local result = {} local result = {}
local symbols = { local symbols = {
error = icons.Error, error = icons.Error,
warning = icons.Warn, warning = icons.Warn,
info = icons.Info, info = icons.Info,
} }
for name, count in pairs(diagnostics) do for name, count in pairs(diagnostics) do
if symbols[name] and count > 0 then if symbols[name] and count > 0 then
table.insert(result, symbols[name] .. " " .. count) table.insert(result, symbols[name] .. " " .. count)
end end
end end
local result_str = table.concat(result, " ") local result_str = table.concat(result, " ")
return #result_str > 0 and result_str or "" return #result_str > 0 and result_str or ""
end end
local config = { local config = {
highlights = { highlights = {
background = { background = {
italic = true, italic = true,
bold = false, bold = false,
}, },
buffer_selected = { buffer_selected = {
italic = false, italic = false,
bold = true, bold = true,
}, },
}, },
options = { options = {
indicator = { indicator = {
style = "none", style = "none",
}, },
buffer_close_icon = icons.Close, buffer_close_icon = icons.Close,
modified_icon = icons.Modified, modified_icon = icons.Modified,
close_icon = icons.Close, close_icon = icons.Close,
left_trunc_marker = icons.Truncate, left_trunc_marker = icons.Truncate,
right_trunc_marker = icons.Truncate, right_trunc_marker = icons.Truncate,
diagnostics = "nvim_lsp", diagnostics = "nvim_lsp",
diagnostics_indicator = diagnostics_indicator, diagnostics_indicator = diagnostics_indicator,
offsets = {}, offsets = {},
show_buffer_close_icons = false, show_buffer_close_icons = false,
show_close_icon = false, show_close_icon = false,
separator_style = { '', '' }, separator_style = { "", "" },
move_wraps_at_ends = true, move_wraps_at_ends = true,
always_show_bufferline = false, always_show_bufferline = false,
sort_by = "id", sort_by = "id",
}, },
} }
return config return config
end end
return M return M

View file

@ -3,10 +3,10 @@ local M = { "numToStr/Comment.nvim" }
M.event = { "BufReadPost", "BufNewFile" } M.event = { "BufReadPost", "BufNewFile" }
M.opts = { M.opts = {
mappings = { mappings = {
basic = false, basic = false,
extra = false extra = false,
} },
} }
return M return M

View file

@ -2,17 +2,17 @@ local M = { "lewis6991/gitsigns.nvim" }
M.event = { "BufReadPost", "BufNewFile" } M.event = { "BufReadPost", "BufNewFile" }
local icons = require('config.icons') local icons = require("config.icons")
M.opts = { M.opts = {
signs = { signs = {
add = { text = icons.Added }, add = { text = icons.Added },
change = { text = icons.Modified }, change = { text = icons.Modified },
delete = { text = icons.Removed }, delete = { text = icons.Removed },
topdelete = { text = icons.Removed }, topdelete = { text = icons.Removed },
changedelete = { text = icons.ChangeDelete }, changedelete = { text = icons.ChangeDelete },
untracked = { text = icons.Untracked }, untracked = { text = icons.Untracked },
}, },
} }
return M return M

View file

@ -5,31 +5,31 @@ M.main = "ibl"
M.event = { "BufReadPost", "BufNewFile" } M.event = { "BufReadPost", "BufNewFile" }
M.dependencies = { M.dependencies = {
"nvim-treesitter", "nvim-treesitter",
} }
M.opts = { M.opts = {
indent = { indent = {
char = "", char = "",
tab_char = "", tab_char = "",
}, },
scope = { scope = {
char = "", char = "",
enabled = true, enabled = true,
show_start = false, show_start = false,
show_end = false, show_end = false,
}, },
exclude = { exclude = {
filetypes = { filetypes = {
"help", "help",
"packer", "packer",
"NvimTree", "NvimTree",
}, },
buftypes = { buftypes = {
"terminal", "terminal",
"nofile", "nofile",
}, },
}, },
} }
return M return M

View file

@ -1,28 +1,28 @@
return { return {
{ "nvim-lua/plenary.nvim", lazy = true }, { "nvim-lua/plenary.nvim", lazy = true },
{ "kyazdani42/nvim-web-devicons", lazy = true }, { "kyazdani42/nvim-web-devicons", lazy = true },
{ "zk-org/zk-nvim", opts = { picker = "telescope" }, main = "zk" }, { "zk-org/zk-nvim", opts = { picker = "telescope" }, main = "zk" },
{ "NMAC427/guess-indent.nvim" }, { "NMAC427/guess-indent.nvim" },
{ "JoosepAlviste/nvim-ts-context-commentstring" }, { "JoosepAlviste/nvim-ts-context-commentstring" },
require('plugins.misc.alpha'), require("plugins.misc.alpha"),
require('plugins.misc.autopairs'), require("plugins.misc.autopairs"),
require('plugins.misc.bufferline'), require("plugins.misc.bufferline"),
require('plugins.misc.colorizer'), require("plugins.misc.colorizer"),
require('plugins.misc.comment'), require("plugins.misc.comment"),
require('plugins.misc.gitsigns'), require("plugins.misc.gitsigns"),
require('plugins.misc.indent-blankline'), require("plugins.misc.indent-blankline"),
require('plugins.misc.taolf'), require("plugins.misc.taolf"),
require('plugins.misc.lspkind'), require("plugins.misc.lspkind"),
require('plugins.misc.lualine'), require("plugins.misc.lualine"),
require('plugins.misc.rustacean'), require("plugins.misc.rustacean"),
require('plugins.misc.surround'), require("plugins.misc.surround"),
require('plugins.misc.telescope'), require("plugins.misc.telescope"),
require('plugins.misc.telescope-fzf-native'), require("plugins.misc.telescope-fzf-native"),
require('plugins.misc.todo-comments'), require("plugins.misc.todo-comments"),
require('plugins.misc.toggleterm'), require("plugins.misc.toggleterm"),
require('plugins.misc.tokyonight'), require("plugins.misc.tokyonight"),
require('plugins.misc.treesitter'), require("plugins.misc.treesitter"),
require('plugins.misc.ufo'), require("plugins.misc.ufo"),
require('plugins.misc.vimtex'), require("plugins.misc.vimtex"),
require('plugins.misc.which-key'), require("plugins.misc.which-key"),
} }

View file

@ -3,13 +3,13 @@ local M = { "onsails/lspkind.nvim" }
M.lazy = true M.lazy = true
M.opts = { M.opts = {
mode = "symbol", mode = "symbol",
symbol_map = require("config.icons").lspkind, symbol_map = require("config.icons").lspkind,
menu = {}, menu = {},
} }
M.config = function(_, opts) M.config = function(_, opts)
require("lspkind").init(opts) require("lspkind").init(opts)
end end
return M return M

View file

@ -1,212 +1,212 @@
local M = { "nvim-lualine/lualine.nvim" } local M = { "nvim-lualine/lualine.nvim" }
M.opts = function() M.opts = function()
local colors = require('tokyonight.colors').setup({ transform = true }) local colors = require("tokyonight.colors").setup({ transform = true })
local icons = require('config.icons') local icons = require("config.icons")
local conditions = { local conditions = {
buffer_not_empty = function() buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
end, end,
hide_in_width = function() hide_in_width = function()
return vim.fn.winwidth(0) > 80 return vim.fn.winwidth(0) > 80
end, end,
check_git_workspace = function() check_git_workspace = function()
local filepath = vim.fn.expand('%:p:h') local filepath = vim.fn.expand("%:p:h")
local gitdir = vim.fn.finddir('.git', filepath .. ';') local gitdir = vim.fn.finddir(".git", filepath .. ";")
return gitdir and #gitdir > 0 and #gitdir < #filepath return gitdir and #gitdir > 0 and #gitdir < #filepath
end, end,
} }
local function search_result() local function search_result()
if vim.v.hlsearch == 0 then if vim.v.hlsearch == 0 then
return '' return ""
end end
local last_search = vim.fn.getreg('/') local last_search = vim.fn.getreg("/")
if not last_search or last_search == '' then if not last_search or last_search == "" then
return '' return ""
end end
local searchcount = vim.fn.searchcount { maxcount = 9999 } local searchcount = vim.fn.searchcount({ maxcount = 9999 })
return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')' return last_search .. "(" .. searchcount.current .. "/" .. searchcount.total .. ")"
end end
local config = { local config = {
options = { options = {
component_separators = '', component_separators = "",
section_separators = '', section_separators = "",
-- theme = { -- theme = {
-- normal = { c = { fg = colors.fg, bg = colors.bg } }, -- normal = { c = { fg = colors.fg, bg = colors.bg } },
-- inactive = { c = { fg = colors.fg, bg = colors.bg } }, -- inactive = { c = { fg = colors.fg, bg = colors.bg } },
-- }, -- },
disabled_filetypes = { disabled_filetypes = {
statusline = { 'alpha' } statusline = { "alpha" },
}, },
ignore_focus = { 'toggleterm', 'NvimTree' }, ignore_focus = { "toggleterm", "NvimTree" },
globalstatus = true, globalstatus = true,
}, },
sections = { sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_y = {}, lualine_y = {},
lualine_z = {}, lualine_z = {},
lualine_c = {}, lualine_c = {},
lualine_x = {}, lualine_x = {},
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_y = {}, lualine_y = {},
lualine_z = {}, lualine_z = {},
lualine_c = {}, lualine_c = {},
lualine_x = {}, lualine_x = {},
} },
} }
local function ins_left(component) local function ins_left(component)
table.insert(config.sections.lualine_c, component) table.insert(config.sections.lualine_c, component)
end end
local function ins_right(component) local function ins_right(component)
table.insert(config.sections.lualine_x, component) table.insert(config.sections.lualine_x, component)
end end
local function mode_color() local function mode_color()
local color = { local color = {
n = colors.red, n = colors.red,
i = colors.green, i = colors.green,
v = colors.magenta, v = colors.magenta,
[string.char(22)] = colors.magenta, [string.char(22)] = colors.magenta,
V = colors.magenta, V = colors.magenta,
c = colors.blue, c = colors.blue,
no = colors.red, no = colors.red,
s = colors.orange, s = colors.orange,
S = colors.orange, S = colors.orange,
[string.char(19)] = colors.orange, [string.char(19)] = colors.orange,
ic = colors.yellow, ic = colors.yellow,
R = colors.violet, R = colors.violet,
Rv = colors.violet, Rv = colors.violet,
cv = colors.red, cv = colors.red,
ce = colors.red, ce = colors.red,
r = colors.cyan, r = colors.cyan,
rm = colors.cyan, rm = colors.cyan,
['r?'] = colors.cyan, ["r?"] = colors.cyan,
['!'] = colors.red, ["!"] = colors.red,
t = colors.red, t = colors.red,
} }
return { fg = color[vim.fn.mode()] } return { fg = color[vim.fn.mode()] }
end end
ins_left { ins_left({
function() function()
return '' return ""
end, end,
color = function() color = function()
return mode_color() return mode_color()
end, end,
padding = { right = 1 }, padding = { right = 1 },
} })
ins_left { ins_left({
'filename', "filename",
cond = conditions.buffer_not_empty, cond = conditions.buffer_not_empty,
color = { fg = colors.magenta, gui = 'bold' }, color = { fg = colors.magenta, gui = "bold" },
} })
ins_left { ins_left({
'fileformat', "fileformat",
fmt = string.upper, fmt = string.upper,
icons_enabled = false, icons_enabled = false,
color = { fg = colors.green }, color = { fg = colors.green },
} })
ins_left { ins_left({
'o:encoding', "o:encoding",
fmt = string.upper, fmt = string.upper,
cond = conditions.hide_in_width, cond = conditions.hide_in_width,
color = { fg = colors.green }, color = { fg = colors.green },
} })
ins_left { ins_left({
'filesize', "filesize",
fmt = string.upper, fmt = string.upper,
icons_enabled = false, icons_enabled = false,
color = { fg = colors.green }, color = { fg = colors.green },
} })
ins_left { ins_left({
'%04l:%04c', "%04l:%04c",
} })
-- NOTE: My beloved :( -- NOTE: My beloved :(
-- ins_left { -- ins_left {
-- function() -- function()
-- local current_line = vim.fn.line "." -- local current_line = vim.fn.line "."
-- local total_lines = vim.fn.line "$" -- local total_lines = vim.fn.line "$"
-- local chars = icons.progress -- local chars = icons.progress
-- local line_ratio = current_line / total_lines -- local line_ratio = current_line / total_lines
-- local index = math.ceil(line_ratio * #chars) -- local index = math.ceil(line_ratio * #chars)
-- return chars[index] -- return chars[index]
-- end, -- end,
-- color = { fg = colors.yellow } -- color = { fg = colors.yellow }
-- } -- }
ins_right { ins_right({
search_result, search_result,
color = { fg = colors.white }, color = { fg = colors.white },
padding = { left = 1 }, padding = { left = 1 },
} })
ins_right { ins_right({
function() function()
local msg = '' local msg = ""
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
local clients = vim.lsp.get_active_clients() local clients = vim.lsp.get_active_clients()
if next(clients) == nil then if next(clients) == nil then
return 'No LSP' return "No LSP"
end end
for _, client in ipairs(clients) do for _, client in ipairs(clients) do
local filetypes = client.config.filetypes local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
msg = msg .. ", " .. client.name msg = msg .. ", " .. client.name
end end
end end
return msg:sub(3) return msg:sub(3)
end, end,
color = { fg = colors.blue, gui = 'bold' }, color = { fg = colors.blue, gui = "bold" },
} })
ins_right { ins_right({
'diagnostics', "diagnostics",
sources = { 'nvim_diagnostic' }, sources = { "nvim_diagnostic" },
symbols = { symbols = {
error = icons.Error .. ' ', error = icons.Error .. " ",
warn = icons.Warn .. ' ', warn = icons.Warn .. " ",
info = icons.Info .. ' ', info = icons.Info .. " ",
}, },
diagnostics_color = { diagnostics_color = {
color_error = { fg = colors.red }, color_error = { fg = colors.red },
color_warn = { fg = colors.yellow }, color_warn = { fg = colors.yellow },
color_info = { fg = colors.cyan }, color_info = { fg = colors.cyan },
}, },
} })
ins_right { ins_right({
'filetype', "filetype",
color = { fg = colors.green, gui = 'bold' }, color = { fg = colors.green, gui = "bold" },
padding = { left = 1 }, padding = { left = 1 },
} })
ins_right { ins_right({
function() function()
return '' return ""
end, end,
color = function() color = function()
return mode_color() return mode_color()
end, end,
padding = { left = 1 }, padding = { left = 1 },
} })
return config return config
end end
return M return M

View file

@ -5,20 +5,20 @@ M.build = ":MasonInstall codelldb"
M.ft = { "rust" } M.ft = { "rust" }
M.init = function() M.init = function()
local extension_path = os.getenv("XDG_DATA_HOME") .. "/nvim/mason/packages/codelldb/extension/" local extension_path = os.getenv("XDG_DATA_HOME") .. "/nvim/mason/packages/codelldb/extension/"
local codelldb_path = extension_path .. "apapter/codelldb" local codelldb_path = extension_path .. "apapter/codelldb"
local liblldb_path = extension_path .. "lldb/lib/liblldb.so" local liblldb_path = extension_path .. "lldb/lib/liblldb.so"
local adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb_path, liblldb_path) local adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb_path, liblldb_path)
vim.g.rustaceanvim = function() vim.g.rustaceanvim = function()
return { return {
dap = { dap = {
adapter = adapter adapter = adapter,
}, },
server = { server = {
on_attach = require("funcs").lsp_on_attach on_attach = require("funcs").lsp_on_attach,
}, },
} }
end end
end end
return M return M

View file

@ -6,42 +6,42 @@ M.dependencies = { "telescope-fzf-native.nvim" }
M.cmd = "Telescope" M.cmd = "Telescope"
local opts = function() local opts = function()
local actions = require("telescope.actions") local actions = require("telescope.actions")
return { return {
defaults = { defaults = {
git_worktrees = vim.g.git_worktrees, git_worktrees = vim.g.git_worktrees,
prompt_prefix = icons.Selected, prompt_prefix = icons.Selected,
path_display = { "truncate" }, path_display = { "truncate" },
sorting_startegy = "ascending", sorting_startegy = "ascending",
layout_config = { layout_config = {
horizontal = { prompt_position = "top", preview_width = 0.5 }, horizontal = { prompt_position = "top", preview_width = 0.5 },
vertical = { mirror = false }, vertical = { mirror = false },
width = 0.87, width = 0.87,
height = 0.80, height = 0.80,
preview_cutoff = 120, preview_cutoff = 120,
}, },
mappings = { mappings = {
i = { i = {
["<C-n>"] = actions.cycle_history_next, ["<C-n>"] = actions.cycle_history_next,
["<C-p>"] = actions.cycle_history_prev, ["<C-p>"] = actions.cycle_history_prev,
["<C-j>"] = actions.move_selection_next, ["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous, ["<C-k>"] = actions.move_selection_previous,
}, },
n = { q = actions.close }, n = { q = actions.close },
}, },
}, },
} }
end end
M.config = function() M.config = function()
local telescope = require("telescope") local telescope = require("telescope")
telescope.setup(opts()) telescope.setup(opts())
if pcall(require, "aerial") then if pcall(require, "aerial") then
telescope.load_extension("aerial") telescope.load_extension("aerial")
end end
if require("funcs").is_available("telescope-fzf-native.nvim") then if require("funcs").is_available("telescope-fzf-native.nvim") then
telescope.load_extension("fzf") telescope.load_extension("fzf")
end end
end end
return M return M

View file

@ -1,19 +1,19 @@
local M = { "folke/todo-comments.nvim" } local M = { "folke/todo-comments.nvim" }
local icons = require('config.icons') local icons = require("config.icons")
M.event = { "BufReadPost", "BufNewFile" } M.event = { "BufReadPost", "BufNewFile" }
M.config = { M.config = {
signs = false, signs = false,
keywords = { keywords = {
BUG = { icon = icons.Bug, color = "error", alt = { "FIXME", "FIX", "FIXIT", "ISSUE" } }, BUG = { icon = icons.Bug, color = "error", alt = { "FIXME", "FIX", "FIXIT", "ISSUE" } },
TODO = { icon = icons.Task, color = "info" }, TODO = { icon = icons.Task, color = "info" },
HACK = { icon = icons.Flame, color = "warning" }, HACK = { icon = icons.Flame, color = "warning" },
WARN = { icon = icons.Warn, color = "warning", alt = { "WARNING", "XXX" } }, WARN = { icon = icons.Warn, color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = icons.Speed, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, PERF = { icon = icons.Speed, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = icons.Buffer, color = "hint", alt = { "INFO" } }, NOTE = { icon = icons.Buffer, color = "hint", alt = { "INFO" } },
TEST = { icon = icons.Test, color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, TEST = { icon = icons.Test, color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
}, },
} }
return M return M

View file

@ -3,35 +3,39 @@ local M = { "akinsho/toggleterm.nvim" }
M.cmd = { "ToggleTerm", "TermExec" } M.cmd = { "ToggleTerm", "TermExec" }
M.opts = { M.opts = {
size = function(term) size = function(term)
if term.direction == "horizontal" then if term.direction == "horizontal" then
return vim.o.lines * 0.33 return vim.o.lines * 0.33
elseif term.direction == "vertical" then elseif term.direction == "vertical" then
return vim.o.colums * 0.33 return vim.o.colums * 0.33
end end
end, end,
open_mapping = "<C-z>", open_mapping = "<C-z>",
direction = "float", direction = "float",
highlights = { highlights = {
Normal = { link = "Normal" }, Normal = { link = "Normal" },
NormalNC = { link = "NormalNC" }, NormalNC = { link = "NormalNC" },
NormalFloat = { link = "NormalFloat" }, NormalFloat = { link = "NormalFloat" },
FloatBorder = { link = "FloatBorder" }, FloatBorder = { link = "FloatBorder" },
StatusLine = { link = "StatusLine" }, StatusLine = { link = "StatusLine" },
StatusLineNC = { link = "StatusLineNC" }, StatusLineNC = { link = "StatusLineNC" },
WinBar = { link = "WinBar" }, WinBar = { link = "WinBar" },
WinBarNC = { link = "WinBarNC" }, WinBarNC = { link = "WinBarNC" },
}, },
float_opts = { float_opts = {
border = "curved", border = "curved",
winblend = 5, winblend = 5,
width = function() return math.ceil(math.min(vim.o.columns, math.max(80, vim.o.columns - 20))) end, width = function()
height = function() return math.ceil(math.min(vim.o.lines, math.max(20, vim.o.lines - 10))) end, return math.ceil(math.min(vim.o.columns, math.max(80, vim.o.columns - 20)))
}, end,
on_create = function() height = function()
vim.opt.foldcolumn = "0" return math.ceil(math.min(vim.o.lines, math.max(20, vim.o.lines - 10)))
vim.opt.signcolumn = "no" end,
end, },
on_create = function()
vim.opt.foldcolumn = "0"
vim.opt.signcolumn = "no"
end,
} }
return M return M

View file

@ -3,16 +3,16 @@ local M = { "folke/tokyonight.nvim" }
M.priority = 1000 M.priority = 1000
local opts = { local opts = {
style = "night", style = "night",
transparent = true, transparent = true,
on_highlights = function(hl, _) on_highlights = function(hl, _)
hl.CurSearch = nil hl.CurSearch = nil
end end,
} }
M.config = function() M.config = function()
require('tokyonight').setup(opts) require("tokyonight").setup(opts)
vim.cmd("colorscheme tokyonight") vim.cmd("colorscheme tokyonight")
end end
return M return M

View file

@ -1,8 +1,8 @@
local M = { "nvim-treesitter/nvim-treesitter" } local M = { "nvim-treesitter/nvim-treesitter" }
M.dependencies = { M.dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/nvim-treesitter-textobjects",
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
} }
M.event = { "BufReadPost", "BufNewFile" } M.event = { "BufReadPost", "BufNewFile" }
@ -10,105 +10,105 @@ M.event = { "BufReadPost", "BufNewFile" }
M.build = ":TSUpdate" M.build = ":TSUpdate"
M.cmd = { M.cmd = {
"TSBufDisable", "TSBufDisable",
"TSBufEnable", "TSBufEnable",
"TSBufToggle", "TSBufToggle",
"TSDisable", "TSDisable",
"TSEnable", "TSEnable",
"TSToggle", "TSToggle",
"TSInstall", "TSInstall",
"TSInstallInfo", "TSInstallInfo",
"TSInstallSync", "TSInstallSync",
"TSModuleInfo", "TSModuleInfo",
"TSUninstall", "TSUninstall",
"TSUpdate", "TSUpdate",
"TSUpdateSync", "TSUpdateSync",
} }
M.init = function(plugin) M.init = function(plugin)
require("lazy.core.loader").add_to_rtp(plugin) require("lazy.core.loader").add_to_rtp(plugin)
require("nvim-treesitter.query_predicates") require("nvim-treesitter.query_predicates")
end end
M.opts = { M.opts = {
ensure_installed = { ensure_installed = {
"bash", "bash",
"c", "c",
"lua", "lua",
"markdown", "markdown",
"markdown_inline", "markdown_inline",
"python", "python",
"query", "query",
"vim", "vim",
"vimdoc", "vimdoc",
}, },
autotag = { enable = true }, autotag = { enable = true },
highlight = { highlight = {
enable = true, enable = true,
}, },
auto_install = true, auto_install = true,
autopairs = { autopairs = {
enable = false, enable = false,
}, },
incremental_selection = { enable = true }, incremental_selection = { enable = true },
indent = { enable = true }, indent = { enable = true },
textobjects = { textobjects = {
select = { select = {
enable = true, enable = true,
lookahead = true, lookahead = true,
keymaps = { keymaps = {
["ak"] = { query = "@block.outer", desc = "around block" }, ["ak"] = { query = "@block.outer", desc = "around block" },
["ik"] = { query = "@block.inner", desc = "inside block" }, ["ik"] = { query = "@block.inner", desc = "inside block" },
["ac"] = { query = "@class.outer", desc = "around class" }, ["ac"] = { query = "@class.outer", desc = "around class" },
["ic"] = { query = "@class.inner", desc = "inside class" }, ["ic"] = { query = "@class.inner", desc = "inside class" },
["a?"] = { query = "@conditional.outer", desc = "around conditional" }, ["a?"] = { query = "@conditional.outer", desc = "around conditional" },
["i?"] = { query = "@conditional.inner", desc = "inside conditional" }, ["i?"] = { query = "@conditional.inner", desc = "inside conditional" },
["af"] = { query = "@function.outer", desc = "around function " }, ["af"] = { query = "@function.outer", desc = "around function " },
["if"] = { query = "@function.inner", desc = "inside function " }, ["if"] = { query = "@function.inner", desc = "inside function " },
["al"] = { query = "@loop.outer", desc = "around loop" }, ["al"] = { query = "@loop.outer", desc = "around loop" },
["il"] = { query = "@loop.inner", desc = "inside loop" }, ["il"] = { query = "@loop.inner", desc = "inside loop" },
["aa"] = { query = "@parameter.outer", desc = "around argument" }, ["aa"] = { query = "@parameter.outer", desc = "around argument" },
["ia"] = { query = "@parameter.inner", desc = "inside argument" }, ["ia"] = { query = "@parameter.inner", desc = "inside argument" },
}, },
}, },
move = { move = {
enable = true, enable = true,
set_jumps = true, set_jumps = true,
goto_next_start = { goto_next_start = {
["]k"] = { query = "@block.outer", desc = "Next block start" }, ["]k"] = { query = "@block.outer", desc = "Next block start" },
["]f"] = { query = "@function.outer", desc = "Next function start" }, ["]f"] = { query = "@function.outer", desc = "Next function start" },
["]a"] = { query = "@parameter.inner", desc = "Next argument start" }, ["]a"] = { query = "@parameter.inner", desc = "Next argument start" },
}, },
goto_next_end = { goto_next_end = {
["]K"] = { query = "@block.outer", desc = "Next block end" }, ["]K"] = { query = "@block.outer", desc = "Next block end" },
["]F"] = { query = "@function.outer", desc = "Next function end" }, ["]F"] = { query = "@function.outer", desc = "Next function end" },
["]A"] = { query = "@parameter.inner", desc = "Next argument end" }, ["]A"] = { query = "@parameter.inner", desc = "Next argument end" },
}, },
goto_previous_start = { goto_previous_start = {
["[k"] = { query = "@block.outer", desc = "Previous block start" }, ["[k"] = { query = "@block.outer", desc = "Previous block start" },
["[f"] = { query = "@function.outer", desc = "Previous function start" }, ["[f"] = { query = "@function.outer", desc = "Previous function start" },
["[a"] = { query = "@parameter.inner", desc = "Previous argument start" }, ["[a"] = { query = "@parameter.inner", desc = "Previous argument start" },
}, },
goto_previous_end = { goto_previous_end = {
["[K"] = { query = "@block.outer", desc = "Previous block end" }, ["[K"] = { query = "@block.outer", desc = "Previous block end" },
["[F"] = { query = "@function.outer", desc = "Previous function end" }, ["[F"] = { query = "@function.outer", desc = "Previous function end" },
["[A"] = { query = "@parameter.inner", desc = "Previous argument end" }, ["[A"] = { query = "@parameter.inner", desc = "Previous argument end" },
}, },
}, },
swap = { swap = {
enable = true, enable = true,
swap_next = { swap_next = {
[">K"] = { query = "@block.outer", desc = "Swap next block" }, [">K"] = { query = "@block.outer", desc = "Swap next block" },
[">F"] = { query = "@function.outer", desc = "Swap next function" }, [">F"] = { query = "@function.outer", desc = "Swap next function" },
[">A"] = { query = "@parameter.inner", desc = "Swap next argument" }, [">A"] = { query = "@parameter.inner", desc = "Swap next argument" },
}, },
swap_previous = { swap_previous = {
["<K"] = { query = "@block.outer", desc = "Swap previous block" }, ["<K"] = { query = "@block.outer", desc = "Swap previous block" },
["<F"] = { query = "@function.outer", desc = "Swap previous function" }, ["<F"] = { query = "@function.outer", desc = "Swap previous function" },
["<A"] = { query = "@parameter.inner", desc = "Swap previous argument" }, ["<A"] = { query = "@parameter.inner", desc = "Swap previous argument" },
}, },
}, },
}, },
} }
return M return M

View file

@ -5,31 +5,35 @@ M.event = { "InsertEnter" }
M.dependencies = { "kevinhwang91/promise-async" } M.dependencies = { "kevinhwang91/promise-async" }
M.opts = { M.opts = {
preview = { preview = {
mappings = { mappings = {
scrollB = "<C-b>", scrollB = "<C-b>",
scrollF = "<C-f>", scrollF = "<C-f>",
scrollU = "<C-u>", scrollU = "<C-u>",
scrollD = "<C-d>", scrollD = "<C-d>",
}, },
}, },
provider_selector = function(_, filetype, buftype) provider_selector = function(_, filetype, buftype)
local function handleFallbackException(bufnr, err, providerName) local function handleFallbackException(bufnr, err, providerName)
if type(err) == "string" and err:match "UfoFallbackException" then if type(err) == "string" and err:match("UfoFallbackException") then
return require("ufo").getFolds(bufnr, providerName) return require("ufo").getFolds(bufnr, providerName)
else else
return require("promise").reject(err) return require("promise").reject(err)
end end
end end
return (filetype == "" or buftype == "nofile") and "indent" -- only use indent until a file is opened return (filetype == "" or buftype == "nofile") and "indent" -- only use indent until a file is opened
or function(bufnr) or function(bufnr)
return require("ufo") return require("ufo")
.getFolds(bufnr, "lsp") .getFolds(bufnr, "lsp")
:catch(function(err) return handleFallbackException(bufnr, err, "treesitter") end) :catch(function(err)
:catch(function(err) return handleFallbackException(bufnr, err, "indent") end) return handleFallbackException(bufnr, err, "treesitter")
end end)
end, :catch(function(err)
return handleFallbackException(bufnr, err, "indent")
end)
end
end,
} }
return M return M

View file

@ -1,11 +1,11 @@
local M = { "lervag/vimtex" } local M = { "lervag/vimtex" }
M.init = function() M.init = function()
vim.g.vimtex_view_method = "zathura" vim.g.vimtex_view_method = "zathura"
vim.g.tex_flavor = "latex" vim.g.tex_flavor = "latex"
vim.g.vimtex_quickfix_mode = 0 vim.g.vimtex_quickfix_mode = 0
vim.o.conceallevel = 1 vim.o.conceallevel = 1
vim.g.tex_conceal = 'abdmg' vim.g.tex_conceal = "abdmg"
end end
return M return M

View file

@ -1,37 +1,37 @@
local M = { "folke/which-key.nvim" } local M = { "folke/which-key.nvim" }
local icons = require('config.icons') local icons = require("config.icons")
M.event = "VeryLazy" M.event = "VeryLazy"
M.init = function() M.init = function()
vim.o.timeout = true vim.o.timeout = true
vim.o.timeoutlen = 300 vim.o.timeoutlen = 300
end end
M.opts = { M.opts = {
plugins = { plugins = {
presets = { presets = {
operators = false, operators = false,
motions = false, motions = false,
} },
}, },
icons = { icons = {
breadcrumb = icons.Selected, breadcrumb = icons.Selected,
separator = icons.Selected, separator = icons.Selected,
group = "", group = "",
}, },
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " },
triggers = "auto", triggers = "auto",
triggers_blacklist = { triggers_blacklist = {
i = { "j", "k", "v", "y" }, i = { "j", "k", "v", "y" },
v = { "j", "k", "y" }, v = { "j", "k", "y" },
}, },
} }
M.config = function(_, opts) M.config = function(_, opts)
require("which-key").setup(opts) require("which-key").setup(opts)
require("funcs").which_key_register() require("funcs").which_key_register()
end end
return M return M