chore: reformat codebase

This commit is contained in:
Gabriel Arazas 2023-09-06 06:55:12 +08:00
parent 2655970a0a
commit 8b4084a972
9 changed files with 564 additions and 515 deletions

View File

@ -4,9 +4,9 @@
require("plugins")
require("lsp-user-config").setup()
vim.g['mapleader'] = " "
vim.g['maplocalleader'] = ","
vim.g['syntax'] = true
vim.g["mapleader"] = " "
vim.g["maplocalleader"] = ","
vim.g["syntax"] = true
-- Editor configuration
vim.opt.completeopt = "menuone,noselect"
@ -25,14 +25,14 @@ vim.opt_local.spell = true
vim.opt.smartindent = true
-- I have yet to solve how to do the following in Lua, lmao
vim.cmd "highlight clear SpellBad"
vim.cmd "highlight clear SpellLocal"
vim.cmd "highlight clear SpellCap"
vim.cmd "highlight clear SpellRare"
vim.cmd "highlight Visual term=reverse cterm=reverse"
vim.cmd "colorscheme fds-theme"
vim.cmd("highlight clear SpellBad")
vim.cmd("highlight clear SpellLocal")
vim.cmd("highlight clear SpellCap")
vim.cmd("highlight clear SpellRare")
vim.cmd("highlight Visual term=reverse cterm=reverse")
vim.cmd("colorscheme fds-theme")
-- Keybindings
vim.keymap.set('n', '<leader>bd', ':bd<cr>', {})
vim.keymap.set('i', 'jk', '<Esc>', {})
vim.keymap.set('n', '<leader>hr', '<cmd>source $MYVIMRC<cr>', {})
vim.keymap.set("n", "<leader>bd", ":bd<cr>", {})
vim.keymap.set("i", "jk", "<Esc>", {})
vim.keymap.set("n", "<leader>hr", "<cmd>source $MYVIMRC<cr>", {})

View File

@ -5,14 +5,18 @@ function setup()
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
local function keymap_set(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
local function keymap_set(...)
vim.api.nvim_buf_set_keymap(bufnr, ...)
end
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
-- Enable completion triggered by <c-x><c-o>
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
-- Mappings.
local opts = { noremap=true, silent=true }
local opts = { noremap = true, silent = true }
-- See `:help vim.lsp.*` for documentation on any of the below functions
keymap_set("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
@ -39,12 +43,12 @@ function setup()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
-- Enable the following language servers
local servers = { "clangd", "rust_analyzer", "pyright", "tsserver", "rnix", "sumneko_lua" }
local servers = { "clangd", "rust_analyzer", "pyright", "tsserver", "rnix", "lua_ls" }
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
nvim_lsp[lsp].setup({
on_attach = on_attach,
capabilities = capabilities,
}
})
end
end

View File

@ -1,5 +1,5 @@
-- CREDITS: pwntester/nautilus.nvim
local lush = require('lush')
local lush = require("lush")
local hsl = lush.hsluv
--[[
@ -19,24 +19,25 @@ local hsl = lush.hsluv
base0D - Functions, Methods, Attribute IDs, Headings
base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
]]--
]]
--
local base00 = hsl('#2b221f')
local base01 = hsl('#412c26')
local base02 = hsl('#5c362c')
local base03 = hsl('#a45b43')
local base04 = hsl('#e1bcb2')
local base05 = hsl('#f5ecea')
local base06 = hsl('#fefefe')
local base07 = hsl('#eb8a65')
local base08 = hsl('#d03e68')
local base09 = hsl('#df937a')
local base0A = hsl('#afa644')
local base0B = hsl('#85b26e')
local base0C = hsl('#eb914a')
local base0D = hsl('#c67f62')
local base0E = hsl('#8b7ab9')
local base0F = hsl('#7f3F83')
local base00 = hsl("#2b221f")
local base01 = hsl("#412c26")
local base02 = hsl("#5c362c")
local base03 = hsl("#a45b43")
local base04 = hsl("#e1bcb2")
local base05 = hsl("#f5ecea")
local base06 = hsl("#fefefe")
local base07 = hsl("#eb8a65")
local base08 = hsl("#d03e68")
local base09 = hsl("#df937a")
local base0A = hsl("#afa644")
local base0B = hsl("#85b26e")
local base0C = hsl("#eb914a")
local base0D = hsl("#c67f62")
local base0E = hsl("#8b7ab9")
local base0F = hsl("#7f3F83")
--[[
@ -66,332 +67,331 @@ vim.g.terminal_color_foreground = base0E.hex
return lush(function()
return {
Normal { fg = base05, bg = base00 },
NormalFloat { fg = Normal.fg.saturate(15).lighten(5), bg = Normal.bg.saturate(15).lighten(5) },
Bold { gui = 'bold' },
Debug { fg = base08 },
Directory { fg = base0D },
Error { fg = base01, bg = base08 },
ErrorMsg { fg = base08 },
Exception { fg = base08 },
FoldColumn { fg = base03 },
Folded { fg = base03, bg = base01 },
Italic { gui = 'italic' },
Macro { fg = base08 },
ModeMsg { fg = base0B },
MoreMsg { fg = base0B },
Question { fg = base0D },
Search { fg = base00, bg = base04 },
IncSearch { fg = base00, bg = base09 },
Substitute { fg = base01, bg = base0A },
SpecialKey { fg = base03 },
TooLong { fg = base08 },
Underlined { fg = base08 },
WarningMsg { fg = base08 },
WildMenu { fg = base08, bg = base0A },
Title { fg = base0D },
Conceal { fg = base0D },
Cursor { fg = base00, bg = base05 },
NonText { fg = base03 },
LineNr { fg = base02.lighten(25), bg = base00 },
LineNrNC { fg = base02.lighten(25), bg = base01 },
SignColumn { fg = base01.lighten(40) },
StatusLine { fg = base02, bg = base01.darken(60) },
StatusLineNC { fg = base02, bg = base01.darken(30) },
VertSplit { fg = base02, bg = base00 },
ColorColumn { fg = base01.lighten(25), bg = base01.darken(25) },
CursorLine { bg = base01.saturate(-5).darken(15) },
CursorColumn { CursorLine },
CursorLineNr { fg = base0A, CursorColumn },
Visual { CursorColumn, fg = base03.lighten(15) },
VisualNOS { fg = base08 },
QuickFixLine { bg = base00 },
QFFileName { fg = base0A },
QFLineNr { fg = base04 },
PMenu { fg = base05, bg = base01 },
PMenuSel { fg = base01, bg = base05 },
TabLineSel { fg = base00, bg = base0A },
TabLine { fg = base03, bg = base00.darken(15) },
TabLineFill { fg = base03, bg = base00.darken(25) },
EndOfBuffer { fg = base01.lighten(20), bg = base01.darken(20) },
Normal({ fg = base05, bg = base00 }),
NormalFloat({ fg = Normal.fg.saturate(15).lighten(5), bg = Normal.bg.saturate(15).lighten(5) }),
Bold({ gui = "bold" }),
Debug({ fg = base08 }),
Directory({ fg = base0D }),
Error({ fg = base01, bg = base08 }),
ErrorMsg({ fg = base08 }),
Exception({ fg = base08 }),
FoldColumn({ fg = base03 }),
Folded({ fg = base03, bg = base01 }),
Italic({ gui = "italic" }),
Macro({ fg = base08 }),
ModeMsg({ fg = base0B }),
MoreMsg({ fg = base0B }),
Question({ fg = base0D }),
Search({ fg = base00, bg = base04 }),
IncSearch({ fg = base00, bg = base09 }),
Substitute({ fg = base01, bg = base0A }),
SpecialKey({ fg = base03 }),
TooLong({ fg = base08 }),
Underlined({ fg = base08 }),
WarningMsg({ fg = base08 }),
WildMenu({ fg = base08, bg = base0A }),
Title({ fg = base0D }),
Conceal({ fg = base0D }),
Cursor({ fg = base00, bg = base05 }),
NonText({ fg = base03 }),
LineNr({ fg = base02.lighten(25), bg = base00 }),
LineNrNC({ fg = base02.lighten(25), bg = base01 }),
SignColumn({ fg = base01.lighten(40) }),
StatusLine({ fg = base02, bg = base01.darken(60) }),
StatusLineNC({ fg = base02, bg = base01.darken(30) }),
VertSplit({ fg = base02, bg = base00 }),
ColorColumn({ fg = base01.lighten(25), bg = base01.darken(25) }),
CursorLine({ bg = base01.saturate(-5).darken(15) }),
CursorColumn({ CursorLine }),
CursorLineNr({ fg = base0A, CursorColumn }),
Visual({ CursorColumn, fg = base03.lighten(15) }),
VisualNOS({ fg = base08 }),
QuickFixLine({ bg = base00 }),
QFFileName({ fg = base0A }),
QFLineNr({ fg = base04 }),
PMenu({ fg = base05, bg = base01 }),
PMenuSel({ fg = base01, bg = base05 }),
TabLineSel({ fg = base00, bg = base0A }),
TabLine({ fg = base03, bg = base00.darken(15) }),
TabLineFill({ fg = base03, bg = base00.darken(25) }),
EndOfBuffer({ fg = base01.lighten(20), bg = base01.darken(20) }),
-- Standard syntax highlighting
Boolean { fg = base09 },
Character { fg = base08 },
Comment { fg = base03, gui = "italic" },
Conditional { fg = base0E },
Constant { fg = base09 },
Define { fg = base0E },
Delimiter { fg = base0F.lighten(10) },
Float { fg = base09 },
Function { fg = base0D },
Identifier { fg = base0A },
Include { fg = base0D },
Keyword { fg = base0E },
Label { fg = base0A },
Number { fg = base03 },
Operator { fg = base03 },
PreProc { fg = base0A },
Repeat { fg = base0A },
Special { fg = base0C },
SpecialChar { fg = base0F.lighten(15).saturate(10) },
Statement { fg = base08 },
StorageClass { fg = base0A },
String { fg = base0B },
Structure { fg = base0E },
Tag { fg = base0A },
Todo { fg = base0A, bg = base01 },
Type { fg = base0A },
Typedef { fg = base0A },
Boolean({ fg = base09 }),
Character({ fg = base08 }),
Comment({ fg = base03, gui = "italic" }),
Conditional({ fg = base0E }),
Constant({ fg = base09 }),
Define({ fg = base0E }),
Delimiter({ fg = base0F.lighten(10) }),
Float({ fg = base09 }),
Function({ fg = base0D }),
Identifier({ fg = base0A }),
Include({ fg = base0D }),
Keyword({ fg = base0E }),
Label({ fg = base0A }),
Number({ fg = base03 }),
Operator({ fg = base03 }),
PreProc({ fg = base0A }),
Repeat({ fg = base0A }),
Special({ fg = base0C }),
SpecialChar({ fg = base0F.lighten(15).saturate(10) }),
Statement({ fg = base08 }),
StorageClass({ fg = base0A }),
String({ fg = base0B }),
Structure({ fg = base0E }),
Tag({ fg = base0A }),
Todo({ fg = base0A, bg = base01 }),
Type({ fg = base0A }),
Typedef({ fg = base0A }),
---
-- Extra definitions
---
-- Help
HelpDoc { fg = base05, bg = base0D, gui = 'bold,italic' },
HelpIgnore { fg = base0B, gui = 'bold,italic' },
HelpDoc({ fg = base05, bg = base0D, gui = "bold,italic" }),
HelpIgnore({ fg = base0B, gui = "bold,italic" }),
-- C highlighting
cOperator { fg = base0C },
cPreCondit { fg = base0E },
cOperator({ fg = base0C }),
cPreCondit({ fg = base0E }),
-- C# highlighting
csClass { fg = base0A },
csAttribute { fg = base0A },
csModifier { fg = base0E },
csType { fg = base08 },
csUnspecifiedStatement { fg = base0D },
csContextualStatement { fg = base0E },
csNewDecleration { fg = base08 },
csClass({ fg = base0A }),
csAttribute({ fg = base0A }),
csModifier({ fg = base0E }),
csType({ fg = base08 }),
csUnspecifiedStatement({ fg = base0D }),
csContextualStatement({ fg = base0E }),
csNewDecleration({ fg = base08 }),
-- CSS highlighting
cssBraces { fg = base05 },
cssClassName { fg = base0E },
cssColor { fg = base0C },
cssBraces({ fg = base05 }),
cssClassName({ fg = base0E }),
cssColor({ fg = base0C }),
-- Diff highlighting
DiffAdd { fg = base0B, bg = base0B.darken(80) },
DiffAdded { fg = base0B, bg = base0B.darken(80) },
DiffNewFile { fg = base0B, bg = base0B.darken(80) },
DiffAdd({ fg = base0B, bg = base0B.darken(80) }),
DiffAdded({ fg = base0B, bg = base0B.darken(80) }),
DiffNewFile({ fg = base0B, bg = base0B.darken(80) }),
DiffDelete { fg = base08, bg = base08.darken(80) },
DiffRemoved { fg = base08, bg = base08.darken(80) },
DiffDelete({ fg = base08, bg = base08.darken(80) }),
DiffRemoved({ fg = base08, bg = base08.darken(80) }),
DiffChange { fg = base03, bg = base03.darken(60) },
DiffFile { fg = base03, bg = base03.darken(60) },
DiffLine { fg = base03, bg = base03.darken(60) },
DiffText { fg = base03, bg = base03.darken(60) },
DiffChange({ fg = base03, bg = base03.darken(60) }),
DiffFile({ fg = base03, bg = base03.darken(60) }),
DiffLine({ fg = base03, bg = base03.darken(60) }),
DiffText({ fg = base03, bg = base03.darken(60) }),
-- Git highlighting
gitcommitOverflow { fg = base08 },
gitcommitSummary { fg = base0B },
gitcommitComment { fg = base03 },
gitcommitUntracked { fg = base03 },
gitcommitDiscarded { fg = base03 },
gitcommitSelected { fg = base03 },
gitcommitHeader { fg = base0E },
gitcommitSelectedType { fg = base0D },
gitcommitUnmergedType { fg = base0D },
gitcommitDiscardedType { fg = base0D },
gitcommitBranch { fg = base09, gui = 'bold' },
gitcommitUntrackedFile { fg = base0A },
gitcommitUnmergedFile { fg = base08, gui = 'bold' },
gitcommitDiscardedFile { fg = base08, gui = 'bold' },
gitcommitSelectedFile { fg = base0B, gui = 'bold' },
gitcommitOverflow({ fg = base08 }),
gitcommitSummary({ fg = base0B }),
gitcommitComment({ fg = base03 }),
gitcommitUntracked({ fg = base03 }),
gitcommitDiscarded({ fg = base03 }),
gitcommitSelected({ fg = base03 }),
gitcommitHeader({ fg = base0E }),
gitcommitSelectedType({ fg = base0D }),
gitcommitUnmergedType({ fg = base0D }),
gitcommitDiscardedType({ fg = base0D }),
gitcommitBranch({ fg = base09, gui = "bold" }),
gitcommitUntrackedFile({ fg = base0A }),
gitcommitUnmergedFile({ fg = base08, gui = "bold" }),
gitcommitDiscardedFile({ fg = base08, gui = "bold" }),
gitcommitSelectedFile({ fg = base0B, gui = "bold" }),
-- GitGutter highlighting
GitGutterAdd { fg = base0B, bg = base01 },
GitGutterChange { fg = base0D, bg = base01 },
GitGutterDelete { fg = base08, bg = base01 },
GitGutterChangeDelete { fg = base0E, bg = base01 },
GitGutterAdd({ fg = base0B, bg = base01 }),
GitGutterChange({ fg = base0D, bg = base01 }),
GitGutterDelete({ fg = base08, bg = base01 }),
GitGutterChangeDelete({ fg = base0E, bg = base01 }),
-- HTML highlighting
htmlBold { fg = base0A },
htmlItalic { fg = base0E },
htmlEndTag { fg = base05 },
htmlTag { fg = base05 },
htmlBold({ fg = base0A }),
htmlItalic({ fg = base0E }),
htmlEndTag({ fg = base05 }),
htmlTag({ fg = base05 }),
-- JavaScript highlighting
javaScript { fg = base05 },
javaScriptBraces { fg = base05 },
javaScriptNumber { fg = base09 },
javaScript({ fg = base05 }),
javaScriptBraces({ fg = base05 }),
javaScriptNumber({ fg = base09 }),
-- pangloss/vim-javascript highlighting
jsOperator { fg = base0D },
jsStatement { fg = base0E },
jsReturn { fg = base0E },
jsThis { fg = base08 },
jsClassDefinition { fg = base0A },
jsFunction { fg = base0E },
jsFuncName { fg = base0D },
jsFuncCall { fg = base0D },
jsClassFuncName { fg = base0D },
jsClassMethodType { fg = base0E },
jsRegexpString { fg = base0C },
jsGlobalObjects { fg = base0A },
jsGlobalNodeObjects { fg = base0A },
jsExceptions { fg = base0A },
jsBuiltins { fg = base0A },
jsOperator({ fg = base0D }),
jsStatement({ fg = base0E }),
jsReturn({ fg = base0E }),
jsThis({ fg = base08 }),
jsClassDefinition({ fg = base0A }),
jsFunction({ fg = base0E }),
jsFuncName({ fg = base0D }),
jsFuncCall({ fg = base0D }),
jsClassFuncName({ fg = base0D }),
jsClassMethodType({ fg = base0E }),
jsRegexpString({ fg = base0C }),
jsGlobalObjects({ fg = base0A }),
jsGlobalNodeObjects({ fg = base0A }),
jsExceptions({ fg = base0A }),
jsBuiltins({ fg = base0A }),
-- Mail highlighting
mailQuoted1 { fg = base0A },
mailQuoted2 { fg = base0B },
mailQuoted3 { fg = base0E },
mailQuoted4 { fg = base0C },
mailQuoted5 { fg = base0D },
mailQuoted6 { fg = base0A },
mailURL { fg = base0D },
mailEmail { fg = base0D },
mailQuoted1({ fg = base0A }),
mailQuoted2({ fg = base0B }),
mailQuoted3({ fg = base0E }),
mailQuoted4({ fg = base0C }),
mailQuoted5({ fg = base0D }),
mailQuoted6({ fg = base0A }),
mailURL({ fg = base0D }),
mailEmail({ fg = base0D }),
-- Markdown highlighting
markdownh1 { fg = base0D, gui = 'bold' },
markdownh2 { fg = base0D, gui = 'bold' },
markdownh3 { fg = base0D, gui = 'bold' },
markdownh4 { fg = base0D, gui = 'bold' },
markdownh5 { fg = base0D, gui = 'bold' },
markdownh6 { fg = base0A, gui = 'bold' },
markdownRule { fg = markdownh2.bg, gui = 'bold' },
markdownItalic { fg = base05, gui = 'italic' },
markdownBold { fg = base05, gui = 'bold' },
markdownBoldItalic { fg = base05, gui = 'bold,italic' },
markdownCodeDelimiter { fg = base0B, gui = 'bold' },
markdownCode { fg = base07, bg = base00 },
markdownCodeBlock { fg = base0B },
markdownFootnoteDefinition { fg = base05, gui = 'italic' },
markdownListMarker { fg = base05, gui = 'bold' },
markdownLineBreak { fg = base08, gui = 'underline' },
markdownError { fg = base05, bg = base00 },
markdownHeadingDelimiter { fg = base0D },
markdownUrl { fg = base09 },
markdownFootnote { fg = base0E, gui = 'italic' },
markdownBlockquote { fg = base0C, gui = 'bold' },
markdownLinkText { fg = base08, gui = 'italic' },
markdownh1({ fg = base0D, gui = "bold" }),
markdownh2({ fg = base0D, gui = "bold" }),
markdownh3({ fg = base0D, gui = "bold" }),
markdownh4({ fg = base0D, gui = "bold" }),
markdownh5({ fg = base0D, gui = "bold" }),
markdownh6({ fg = base0A, gui = "bold" }),
markdownRule({ fg = markdownh2.bg, gui = "bold" }),
markdownItalic({ fg = base05, gui = "italic" }),
markdownBold({ fg = base05, gui = "bold" }),
markdownBoldItalic({ fg = base05, gui = "bold,italic" }),
markdownCodeDelimiter({ fg = base0B, gui = "bold" }),
markdownCode({ fg = base07, bg = base00 }),
markdownCodeBlock({ fg = base0B }),
markdownFootnoteDefinition({ fg = base05, gui = "italic" }),
markdownListMarker({ fg = base05, gui = "bold" }),
markdownLineBreak({ fg = base08, gui = "underline" }),
markdownError({ fg = base05, bg = base00 }),
markdownHeadingDelimiter({ fg = base0D }),
markdownUrl({ fg = base09 }),
markdownFootnote({ fg = base0E, gui = "italic" }),
markdownBlockquote({ fg = base0C, gui = "bold" }),
markdownLinkText({ fg = base08, gui = "italic" }),
-- NERDTree highlighting
NERDTreeDirSlash { fg = base0D },
NERDTreeExecFile { fg = base05 },
NERDTreeDirSlash({ fg = base0D }),
NERDTreeExecFile({ fg = base05 }),
-- PHP highlighting
phpMemberSelector { fg = base05 },
phpComparison { fg = base05 },
phpParent { fg = base05 },
phpMethodsVar { fg = base0C },
phpMemberSelector({ fg = base05 }),
phpComparison({ fg = base05 }),
phpParent({ fg = base05 }),
phpMethodsVar({ fg = base0C }),
-- Python highlighting
pythonOperator { fg = base0E },
pythonRepeat { fg = base0E },
pythonInclude { fg = base0E },
pythonStatement { fg = base0E },
pythonOperator({ fg = base0E }),
pythonRepeat({ fg = base0E }),
pythonInclude({ fg = base0E }),
pythonStatement({ fg = base0E }),
-- Ruby highlighting
rubyAttribute { fg = base0D },
rubyConstant { fg = base0A },
rubyInterpolationDelimiter { fg = base0F },
rubyRegexp { fg = base0C },
rubySymbol { fg = base0B },
rubyStringDelimiter { fg = base0B },
rubyAttribute({ fg = base0D }),
rubyConstant({ fg = base0A }),
rubyInterpolationDelimiter({ fg = base0F }),
rubyRegexp({ fg = base0C }),
rubySymbol({ fg = base0B }),
rubyStringDelimiter({ fg = base0B }),
-- SASS highlighting
sassidChar { fg = base08 },
sassClassChar { fg = base09 },
sassInclude { fg = base0E },
sassMixing { fg = base0E },
sassMixinName { fg = base0D },
sassidChar({ fg = base08 }),
sassClassChar({ fg = base09 }),
sassInclude({ fg = base0E }),
sassMixing({ fg = base0E }),
sassMixinName({ fg = base0D }),
-- Spelling highlighting
SpellBad { gui = 'undercurl' }, --, base08)
SpellLocal { gui = 'undercurl' }, --, base0C)
SpellCap { gui = 'undercurl' }, --, base0D)
SpellRare { gui = 'undercurl' }, --, base0E)
SpellBad({ gui = "undercurl" }), --, base08)
SpellLocal({ gui = "undercurl" }), --, base0C)
SpellCap({ gui = "undercurl" }), --, base0D)
SpellRare({ gui = "undercurl" }), --, base0E)
-- Startify highlighting
StartifyBracket { fg = base03 },
StartifyFile { fg = base07 },
StartifyFooter { fg = base03 },
StartifyHeader { fg = base0B },
StartifyNumber { fg = base09 },
StartifyPath { fg = base03 },
StartifySection { fg = base0E },
StartifySelect { fg = base0C },
StartifySlash { fg = base03 },
StartifySpecial { fg = base03 },
StartifyBracket({ fg = base03 }),
StartifyFile({ fg = base07 }),
StartifyFooter({ fg = base03 }),
StartifyHeader({ fg = base0B }),
StartifyNumber({ fg = base09 }),
StartifyPath({ fg = base03 }),
StartifySection({ fg = base0E }),
StartifySelect({ fg = base0C }),
StartifySlash({ fg = base03 }),
StartifySpecial({ fg = base03 }),
-- Java highlighting
javaOperator { fg = base0D },
javaOperator({ fg = base0D }),
-- Telescope highlighting
TelescopeNormal { fg = base05, bg = base01 },
TelescopeBorder { fg = base00, bg = base01 },
TelescopePromptPrefix { fg = base0A, bg = base01 },
TelescopeMatching { fg = base0D, bg = base01 },
TelescopeSelection { fg = base0A, bg = base01 },
TelescopeSelectionCaret { fg = base0A, bg = base01 },
TelescopeNormal({ fg = base05, bg = base01 }),
TelescopeBorder({ fg = base00, bg = base01 }),
TelescopePromptPrefix({ fg = base0A, bg = base01 }),
TelescopeMatching({ fg = base0D, bg = base01 }),
TelescopeSelection({ fg = base0A, bg = base01 }),
TelescopeSelectionCaret({ fg = base0A, bg = base01 }),
--LSP highlighting
LspDiagnosticsDefaultError { fg = base08 },
LspDiagnosticsDefaultWarning { fg = base09 },
LspDiagnosticsDefaultHint { fg = base0A },
LspDiagnosticsDefaultInformation { fg = base0B },
LspDiagnosticsDefaultError({ fg = base08 }),
LspDiagnosticsDefaultWarning({ fg = base09 }),
LspDiagnosticsDefaultHint({ fg = base0A }),
LspDiagnosticsDefaultInformation({ fg = base0B }),
-- XML highlighting
xmlTagName { fg = base0D },
xmlCdatastart { fg = base0A },
xmlEndTag { fg = xmlTagName.bg },
xmlCdataCdata { fg = xmlCdatastart.bg },
xmlTagName({ fg = base0D }),
xmlCdatastart({ fg = base0A }),
xmlEndTag({ fg = xmlTagName.bg }),
xmlCdataCdata({ fg = xmlCdatastart.bg }),
-- MatchParen
MatchParen { fg = base07, bg = base08 },
MatchParen({ fg = base07, bg = base08 }),
-- CodeQL
CodeqlAstFocus { fg = base00, bg = base03 },
CodeqlAstFocus({ fg = base00, bg = base03 }),
-- TreeSitter
TSError { fg = Error.bg, gui = 'bold' },
TSPunctDelimiter { fg = base05 },
TSPunctBracket { fg = base05 },
TSConstant { fg = Constant.fg },
TSConstBuiltin { fg = Constant.fg },
TSConstMacro { fg = Constant.fg },
TSString { fg = String.fg },
TSStringRegex { fg = base03 },
TSStringEscape { fg = base03 },
TSCharacter { fg = Character.fg },
TSNumber { fg = Number.fg },
TSBoolean { fg = Boolean.fg },
TSFloat { fg = Number.fg },
TSFunction { fg = Function.fg },
TSFuncBuiltin { fg = Function.fg },
TSFuncMacro { fg = Function.fg },
TSParameter { fg = base0D },
TSConstructor { fg = base0E },
TSKeywordFunction { fg = base0E },
TSLiteral { fg = base04, gui = 'bold' },
TSVariable { fg = base03.lighten(25) },
TSVariableBuiltin { fg = base0E },
TSParameterReference { fg = TSParameter.fg },
TSMethod { fg = Function.fg },
TSConditional { fg = Conditional.fg },
TSRepeat { fg = Repeat.fg },
TSLabel { fg = Label.fg },
TSOperator { fg = Operator.fg },
TSKeyword { fg = Keyword.fg },
TSException { fg = Exception.fg },
TSType { fg = Type.fg },
TSTypeBuiltin { fg = Type.fg },
TSStructure { fg = Structure.fg },
TSInclude { fg = Include.fg },
TSAnnotation { fg = base03 },
TSStrong { fg = base05, bg = base00, gui = 'bold' },
TSTitle { fg = base0D },
TSError({ fg = Error.bg, gui = "bold" }),
TSPunctDelimiter({ fg = base05 }),
TSPunctBracket({ fg = base05 }),
TSConstant({ fg = Constant.fg }),
TSConstBuiltin({ fg = Constant.fg }),
TSConstMacro({ fg = Constant.fg }),
TSString({ fg = String.fg }),
TSStringRegex({ fg = base03 }),
TSStringEscape({ fg = base03 }),
TSCharacter({ fg = Character.fg }),
TSNumber({ fg = Number.fg }),
TSBoolean({ fg = Boolean.fg }),
TSFloat({ fg = Number.fg }),
TSFunction({ fg = Function.fg }),
TSFuncBuiltin({ fg = Function.fg }),
TSFuncMacro({ fg = Function.fg }),
TSParameter({ fg = base0D }),
TSConstructor({ fg = base0E }),
TSKeywordFunction({ fg = base0E }),
TSLiteral({ fg = base04, gui = "bold" }),
TSVariable({ fg = base03.lighten(25) }),
TSVariableBuiltin({ fg = base0E }),
TSParameterReference({ fg = TSParameter.fg }),
TSMethod({ fg = Function.fg }),
TSConditional({ fg = Conditional.fg }),
TSRepeat({ fg = Repeat.fg }),
TSLabel({ fg = Label.fg }),
TSOperator({ fg = Operator.fg }),
TSKeyword({ fg = Keyword.fg }),
TSException({ fg = Exception.fg }),
TSType({ fg = Type.fg }),
TSTypeBuiltin({ fg = Type.fg }),
TSStructure({ fg = Structure.fg }),
TSInclude({ fg = Include.fg }),
TSAnnotation({ fg = base03 }),
TSStrong({ fg = base05, bg = base00, gui = "bold" }),
TSTitle({ fg = base0D }),
-- Diff highlighting
GitSignsAdd { fg = base0B, },
GitSignsDelete { fg = base08 },
GitSignsChange { fg = base03 },
GitSignsAdd({ fg = base0B }),
GitSignsDelete({ fg = base08 }),
GitSignsChange({ fg = base03 }),
-- Indent-Blank-Lines
IndentGuide { fg = base01, bg = base05 },
IndentGuide({ fg = base01, bg = base05 }),
}
end)

View File

@ -5,7 +5,7 @@
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
packer_bootstrap = vim.fn.system({"git", "clone", "https://github.com/wbthomason/packer.nvim", install_path})
packer_bootstrap = vim.fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path })
end
local packer = require("packer")
@ -14,46 +14,46 @@ local util = require("packer.util")
return packer.startup({
function(use)
-- Let the package manager manage itself.
use { "wbthomason/packer.nvim" }
use({ "wbthomason/packer.nvim" })
-- Custom color themes!
use { "rktjmp/lush.nvim" }
use({ "rktjmp/lush.nvim" })
-- EditorConfig plugin
use { "editorconfig/editorconfig-vim" }
use({ "editorconfig/editorconfig-vim" })
-- Colorize common color strings
use {
use({
"norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup()
end
}
require("colorizer").setup()
end,
})
-- Snippets engine.
-- A must have for me.
use {
use({
"L3MON4D3/LuaSnip",
requires = {
"rafamadriz/friendly-snippets",
},
config = function ()
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_lua").lazy_load()
local ls = require("luasnip")
local types = require("luasnip.util.types")
ls.config.set_config {
ls.config.set_config({
history = true,
update_events = "TextChanged,TextChangedI",
ext_opts = {
[types.choiceNode] = {
active = {
virt_text = { {"<- Current choice", "Comment"} },
virt_text = { { "<- Current choice", "Comment" } },
},
},
},
}
})
vim.keymap.set({ "i", "s" }, "<c-j>", function()
if ls.jumpable(1) then
@ -63,13 +63,13 @@ return packer.startup({
vim.keymap.set({ "i", "s" }, "<c-k>", function()
if ls.jumpable(-1) then
ls.jump(-1)
ls.jump(-1)
end
end)
vim.keymap.set({ "i", "s" }, "<c-l>", function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
ls.expand_or_jump()
end
end)
@ -77,52 +77,72 @@ return packer.startup({
require("luasnip.extras.select_choice")()
end)
end,
}
})
-- Fuzzy finder of lists
use {
use({
"nvim-telescope/telescope.nvim",
requires = {
{"nvim-lua/popup.nvim"},
{"nvim-lua/plenary.nvim"},
{"nvim-telescope/telescope-project.nvim"}
{ "nvim-lua/popup.nvim" },
{ "nvim-lua/plenary.nvim" },
{ "nvim-telescope/telescope-project.nvim" },
},
config = function()
-- Telescope setup
require("telescope").setup {
require("telescope").setup({
extensions = {
project = {
base_dirs = {
{"~/library/projects/software", max_depth = 2},
{"~/library/projects/packages"},
{"~/library/writings"},
{ "~/library/projects/software", max_depth = 2 },
{ "~/library/projects/packages" },
{ "~/library/writings" },
},
},
},
}
})
require("telescope").load_extension("project")
vim.keymap.set('n', '<leader>ff', '<cmd>lua require("telescope.builtin").find_files({ hidden = true })<cr>', { noremap = true })
vim.keymap.set('n', '<leader>fF', '<cmd>lua require("telescope.builtin").find_files({ cwd = require("telescope.utils").buffer_dir(), hidden = true })<cr>', { noremap = true })
vim.keymap.set('n', '<leader>fg', '<cmd>lua require("telescope.builtin").grep_string()<cr>', { noremap = true })
vim.keymap.set('n', '<leader>fG', '<cmd>lua require("telescope.builtin").live_grep()<cr>', { noremap = true })
vim.keymap.set('n', '<leader>fb', '<cmd>lua require("telescope.builtin").buffers()<cr>', { noremap = true })
vim.keymap.set('n', '<leader>fh', '<cmd>lua require("telescope.builtin").help_tags()<cr>', { noremap = true })
vim.keymap.set('n', '<leader>ft', '<cmd>lua require("telescope.builtin").treesitter()<cr>', { noremap = true })
vim.keymap.set('n', '<leader>fb', '<cmd>lua require("telescope.builtin").buffers()<cr>', { noremap = true })
vim.keymap.set('n', '<leader>fr', '<cmd>lua require("telescope.builtin").oldfiles()<cr>', { noremap = true })
vim.keymap.set('n', '<leader>fR', '<cmd>lua require("telescope.builtin").oldfiles({ only_cwd = true })<cr>', { noremap = true })
vim.keymap.set('n', '<leader>fA', '<cmd>lua require("telescope.builtin").resume()<cr>', { noremap = true })
vim.keymap.set(
"n",
"<leader>ff",
'<cmd>lua require("telescope.builtin").find_files({ hidden = true })<cr>',
{ noremap = true }
)
vim.keymap.set(
"n",
"<leader>fF",
'<cmd>lua require("telescope.builtin").find_files({ cwd = require("telescope.utils").buffer_dir(), hidden = true })<cr>',
{ noremap = true }
)
vim.keymap.set("n", "<leader>fg", '<cmd>lua require("telescope.builtin").grep_string()<cr>', { noremap = true })
vim.keymap.set("n", "<leader>fG", '<cmd>lua require("telescope.builtin").live_grep()<cr>', { noremap = true })
vim.keymap.set("n", "<leader>fb", '<cmd>lua require("telescope.builtin").buffers()<cr>', { noremap = true })
vim.keymap.set("n", "<leader>fh", '<cmd>lua require("telescope.builtin").help_tags()<cr>', { noremap = true })
vim.keymap.set("n", "<leader>ft", '<cmd>lua require("telescope.builtin").treesitter()<cr>', { noremap = true })
vim.keymap.set("n", "<leader>fb", '<cmd>lua require("telescope.builtin").buffers()<cr>', { noremap = true })
vim.keymap.set("n", "<leader>fr", '<cmd>lua require("telescope.builtin").oldfiles()<cr>', { noremap = true })
vim.keymap.set(
"n",
"<leader>fR",
'<cmd>lua require("telescope.builtin").oldfiles({ only_cwd = true })<cr>',
{ noremap = true }
)
vim.keymap.set("n", "<leader>fA", '<cmd>lua require("telescope.builtin").resume()<cr>', { noremap = true })
-- Ekeymap.set
vim.keymap.set('n', '<leader>fp', '<cmd>lua require("telescope").extensions.project.project({})<cr>', { noremap = true })
vim.keymap.set(
"n",
"<leader>fp",
'<cmd>lua require("telescope").extensions.project.project({})<cr>',
{ noremap = true }
)
end,
}
})
-- Marks in ~~steroids~~ coconut oil
use {
use({
"ThePrimeagen/harpoon",
config = function()
vim.keymap.set("n", "<leader>fm", "<cmd>lua require('harpoon.mark').add_file()<cr>", {})
@ -133,12 +153,12 @@ return packer.startup({
require("telescope").load_extension("harpoon")
end
end,
requires = { {"nvim-lua/plenary.nvim"} }
}
requires = { { "nvim-lua/plenary.nvim" } },
})
-- A completion engine.
-- nvim-cmp is mostly explicit by making the configuration process manual unlike bigger plugins like CoC
use {
use({
"hrsh7th/nvim-cmp",
requires = {
"hrsh7th/cmp-buffer",
@ -152,7 +172,7 @@ return packer.startup({
cmp.setup({
snippet = {
expand = function (args)
expand = function(args)
ls.lsp_expand(args.body)
end,
},
@ -178,25 +198,25 @@ return packer.startup({
}),
},
})
end
}
end,
})
-- A linting engine, a DAP client, and an LSP client entered into a bar.
use {
use({
"dense-analysis/ale",
config = function()
vim.g.ale_disable_lsp = 1
end,
}
use { "neovim/nvim-lspconfig" }
use { "mfussenegger/nvim-dap" }
use { "puremourning/vimspector" }
})
use({ "neovim/nvim-lspconfig" })
use({ "mfussenegger/nvim-dap" })
use({ "puremourning/vimspector" })
-- tree-sitter
use {
use({
"nvim-treesitter/nvim-treesitter",
requires = {
"nvim-treesitter/nvim-treesitter-textobjects"
"nvim-treesitter/nvim-treesitter-textobjects",
},
run = ":TSUpdate",
config = function()
@ -241,38 +261,41 @@ return packer.startup({
},
},
})
end
}
end,
})
-- One of the most popular plugins.
-- Allows to create more substantial status bars.
use { "vim-airline/vim-airline" }
use({ "vim-airline/vim-airline" })
-- Fuzzy finder for finding files freely and fastly.
use {
"junegunn/fzf",
requires = "junegunn/fzf.vim"
}
use({
"junegunn/fzf",
requires = "junegunn/fzf.vim",
})
-- Enable visuals for addition/deletion of lines in the gutter (side) similar to Visual Studio Code.
use { "airblade/vim-gitgutter" }
use({ "airblade/vim-gitgutter" })
-- Language plugins.
use { "LnL7/vim-nix" } -- Nix
use { "vmchale/dhall-vim" } -- Dhall
use { "ziglang/zig.vim" } -- Zig
use({ "LnL7/vim-nix" }) -- Nix
use({ "vmchale/dhall-vim" }) -- Dhall
use({ "ziglang/zig.vim" }) -- Zig
use({ "RRethy/nvim-base16" })
-- Use Neovim even inside of browsers.
use {
use({
"glacambre/firenvim",
run = function()
vim.fn["firenvim#install"](0)
end
}
end,
})
use { "https://gitlab.com/HiPhish/guile.vim.git" }
use { "Olical/conjure", }
use({ "https://gitlab.com/HiPhish/guile.vim.git" })
use({ "Olical/conjure" })
end,
config = {
compile_path = util.join_paths(vim.fn.stdpath('data'), 'site', 'after', 'plugin', 'packer_compiled.lua'),
}})
compile_path = util.join_paths(vim.fn.stdpath("data"), "site", "after", "plugin", "packer_compiled.lua"),
},
})

View File

@ -1,34 +1,31 @@
return {
s(
"today",
f(function ()
return os.date "%F"
end)
),
s(
"today",
f(function()
return os.date("%F")
end)
),
s(
"retrieve",
f(function ()
return string.format("(retrieved %s)", os.date("%F"))
end)
),
s(
"retrieve",
f(function()
return string.format("(retrieved %s)", os.date("%F"))
end)
),
s(
{ trig = "reldate (-?%d+) \"(.+)\"", regTrig = true },
f(function(_, snip)
-- The point is in number of days.
local point = 60 * 60 * 24 * snip.captures[1]
s(
{ trig = 'reldate (-?%d+) "(.+)"', regTrig = true },
f(function(_, snip)
-- The point is in number of days.
local point = 60 * 60 * 24 * snip.captures[1]
local now = os.time()
return os.date(snip.captures[2], now + point)
end)
),
local now = os.time()
return os.date(snip.captures[2], now + point)
end)
),
s(
"#!",
fmt("#!{}", i(1, "/usr/bin/env bash"))
),
s("#!", fmt("#!{}", i(1, "/usr/bin/env bash"))),
parse("ie", "(i.e., $1)"),
parse("eg", "(e.g., $1)"),
parse("ie", "(i.e., $1)"),
parse("eg", "(e.g., $1)"),
}

View File

@ -3,143 +3,168 @@ function max_asciidoc_header(level)
end
return {
parse("bf", "**$1**"),
parse("it", "__$1__"),
parse("sp", "^$1^"),
parse("sb", "~$1~"),
s("tt",
fmt(
"{}{}{}",
{
c(1, { t "`", t "`+" }),
i(2, "TEXT"),
rep(1),
})),
parse("bf", "**$1**"),
parse("it", "__$1__"),
parse("sp", "^$1^"),
parse("sb", "~$1~"),
s(
"tt",
fmt("{}{}{}", {
c(1, { t("`"), t("`+") }),
i(2, "TEXT"),
rep(1),
})
),
parse("foot", "footnote:[$1]"),
parse("foot", "footnote:[$1]"),
s("link",
fmt(
"link:{}[{}]",
{
i(1, "LINK"),
rep(1),
})),
s(
"link",
fmt("link:{}[{}]", {
i(1, "LINK"),
rep(1),
})
),
parse("var", ":$1: $2"),
parse("var", ":$1: $2"),
parse("audio", "audio::$1[$2]"),
parse("video", "video::$1[$2]"),
parse("audio", "audio::$1[$2]"),
parse("video", "video::$1[$2]"),
s("img",
fmt([[
s(
"img",
fmt(
[[
.{}
image::{}[{}, {}]
{}
]], {
]],
{
i(1, "CAPTION"),
i(2, "IMAGE_PATH"),
i(3, "ALT_TEXT"),
i(4, "width=100%,height=100%"),
i(0),
})),
}
)
),
s("fmt",
fmt("{}{}{}", {
c(1, {
t "**",
t "__",
t "`",
}),
i(2),
rep(1),
})),
s(
"fmt",
fmt("{}{}{}", {
c(1, {
t("**"),
t("__"),
t("`"),
}),
i(2),
rep(1),
})
),
s("dt",
fmt([[
s(
"dt",
fmt(
[[
{}::
{}
]], {
]],
{
i(1, "TERM"),
i(2, "DEFINITION"),
})),
}
)
),
s("src",
fmt([[
s(
"src",
fmt(
[[
[source, {}]
----
{}
----
{}
]], {
]],
{
i(1, "LANGUAGE"),
i(2, "CODE"),
i(0),
})),
}
)
),
s(
{ trig = "h(%d)", regTrig = true },
fmt([[
s(
{ trig = "h(%d)", regTrig = true },
fmt(
[[
{} {}
{}
{}
]], {
f(function(_, snip)
local level = max_asciidoc_header(snip.captures[1])
return string.rep("=", level)
end),
i(1, "CHAPTER"),
d(2, function(_, snip)
local nodes = {}
table.insert(nodes, t "")
]],
{
f(function(_, snip)
local level = max_asciidoc_header(snip.captures[1])
return string.rep("=", level)
end),
i(1, "CHAPTER"),
d(2, function(_, snip)
local nodes = {}
table.insert(nodes, t(""))
local level = max_asciidoc_header(snip.captures[1])
local level = max_asciidoc_header(snip.captures[1])
if level == 1 then
table.insert(nodes, t ":toc:")
end
if level == 1 then
table.insert(nodes, t(":toc:"))
end
local parent = c(1, nodes)
if level > 1 then
parent = t ""
end
local parent = c(1, nodes)
if level > 1 then
parent = t("")
end
return sn(nil, parent)
end, {}),
i(0),
})
),
s(
"admon",
fmt("{}: {}", {
c(1, {
t "NOTE",
t "TIP",
t "IMPORTANT",
t "CAUTION",
t "WARNING",
}),
return sn(nil, parent)
end, {}),
i(0),
})),
}
)
),
s(
"admonB",
fmt([[
s(
"admon",
fmt("{}: {}", {
c(1, {
t("NOTE"),
t("TIP"),
t("IMPORTANT"),
t("CAUTION"),
t("WARNING"),
}),
i(0),
})
),
s(
"admonB",
fmt(
[[
[{}]
====
{}
====
{}
]], {
]],
{
c(1, {
t "NOTE",
t "TIP",
t "IMPORTANT",
t "CAUTION",
t "WARNING",
t("NOTE"),
t("TIP"),
t("IMPORTANT"),
t("CAUTION"),
t("WARNING"),
}),
i(2, "BODY"),
i(0),
})),
}
)
),
}

View File

@ -32,10 +32,10 @@ function module.apply_to_config(config)
config.font_size = 19
-- Thankfully, wezterm can detect fontconfig aliases.
config.font = wezterm.font_with_fallback {
config.font = wezterm.font_with_fallback({
"monospace",
"Noto Color Emoji",
}
})
-- Desaturate any inactive panes.
config.inactive_pane_hsb = {

View File

@ -29,11 +29,11 @@ wezterm.on("view-last-output-in-new-pane", function(_, pane)
f:close()
end
pane:split {
pane:split({
args = { os.getenv("PAGER") or "less", tmpname },
direction = "Bottom",
domain = { DomainName = "local" },
}
})
-- Without this, it would quickly close all of the process immediately.
wezterm.sleep_ms(1000)

View File

@ -26,7 +26,7 @@ function module.apply_to_config(config)
{
event = { Down = { streak = 1, button = "Left" } },
action = act.ExtendSelectionToMouseCursor "Word",
action = act.ExtendSelectionToMouseCursor("Word"),
mods = keymod,
},
}
@ -34,8 +34,8 @@ function module.apply_to_config(config)
-- It also makes use of key tables which is defined after.
config.keys = {
-- Clipboard
{ key = "c", mods = keymod, action = act.CopyTo "Clipboard" },
{ key = "v", mods = keymod, action = act.PasteFrom "Clipboard" },
{ key = "c", mods = keymod, action = act.CopyTo("Clipboard") },
{ key = "v", mods = keymod, action = act.PasteFrom("Clipboard") },
-- Font resize.
{ key = "+", mods = keymod, action = act.IncreaseFontSize },
@ -54,22 +54,22 @@ function module.apply_to_config(config)
{
key = "p",
mods = "LEADER",
action = act.ActivateKeyTable {
action = act.ActivateKeyTable({
name = "pane_navigation",
timeout_milliseconds = 1000,
replace_current = true,
one_shot = true,
},
}),
},
{
key = "r",
mods = "LEADER",
action = act.ActivateKeyTable {
action = act.ActivateKeyTable({
name = "resize_pane",
replace_current = true,
one_shot = false,
},
}),
},
{ key = "h", mods = keymod, action = act.ActivatePaneDirection("Left") },
@ -98,10 +98,10 @@ function module.apply_to_config(config)
one_shot = true,
}),
},
{ mods = alt_keymod, key = "h", action = act.ActivateTabRelative(-1), },
{ mods = alt_keymod, key = "j", action = act.ActivateTab(-1), },
{ mods = alt_keymod, key = "k", action = act.ActivateTab(0), },
{ mods = alt_keymod, key = "l", action = act.ActivateTabRelative(1), },
{ mods = alt_keymod, key = "h", action = act.ActivateTabRelative(-1) },
{ mods = alt_keymod, key = "j", action = act.ActivateTab(-1) },
{ mods = alt_keymod, key = "k", action = act.ActivateTab(0) },
{ mods = alt_keymod, key = "l", action = act.ActivateTabRelative(1) },
{ key = "t", mods = keymod, action = act.ShowTabNavigator },
{ key = "d", mods = alt_keymod, action = act.CloseCurrentTab({ confirm = false }) },
@ -113,63 +113,63 @@ function module.apply_to_config(config)
name = "hints",
timeout_milliseconds = 1000,
replace_current = true,
one_shot = true
one_shot = true,
}),
},
{ key = "r", mods = keymod, action = act.ReloadConfiguration },
{ key = "o", mods = keymod, action = act.ShowDebugOverlay },
{ key = "p", mods = keymod, action = act.ActivateCommandPalette },
{ key = "e", mods = keymod, action = act.EmitEvent "view-last-output-in-new-pane" },
{ key = "e", mods = keymod, action = act.EmitEvent("view-last-output-in-new-pane") },
-- Selection
{ key = "Space", mods = "LEADER", action = act.QuickSelect },
{ key = "a", mods = keymod, action = act.QuickSelect },
{ key = "s", mods = keymod, action = act.Search { CaseSensitiveString = "" } },
{ key = "s", mods = keymod, action = act.Search({ CaseSensitiveString = "" }) },
}
config.key_tables = {
hints = {
{ key = "g", action = act.Search { Regex = "[0-9a-f]{6,}" } },
{ key = "g", action = act.Search({ Regex = "[0-9a-f]{6,}" }) },
{
key = "h",
action = act.QuickSelectArgs {
action = act.QuickSelectArgs({
patterns = {
"[0-9a-f]{7,40}", -- SHA1 hashes, usually used for Git.
"[0-9a-f]{7,64}", -- SHA256 hashes, used often for getting hashes for Guix packaging.
"sha256-[[:alpha:][:digit:]-=+/?]{44}", -- SHA256 hashes in Base64, used often in getting hashes for Nix packaging.
"[[:alpha:][:digit:]-=+/?]{44,64}",
},
},
}),
},
-- Basically the equivalent of `kitty hints word`.
{
key = "w",
action = act.QuickSelectArgs {
action = act.QuickSelectArgs({
patterns = {
"\\S+",
},
},
}),
},
-- The equivalent to `kitty hints line`.
{
key = "l",
action = act.QuickSelectArgs {
action = act.QuickSelectArgs({
patterns = {
".+",
},
},
}),
},
{ key = "Space", action = act.QuickSelect },
{ key = "s", action = act.QuickSelect },
{ key = "f", action = act.Search { CaseSensitiveString = "" } },
{ key = "f", action = act.Search({ CaseSensitiveString = "" }) },
},
pane_navigation = {
{ key = "d", action = act.CloseCurrentPane { confirm = false } },
{ key = "d", action = act.CloseCurrentPane({ confirm = false }) },
{ key = "h", action = act.ActivatePaneDirection("Left") },
{ key = "j", action = act.ActivatePaneDirection("Down") },
{ key = "k", action = act.ActivatePaneDirection("Up") },