chezmoi: zsh, starship

This commit is contained in:
js0ny 2025-09-27 12:11:09 +01:00
parent 0051a163c3
commit 2cbf244d7b
17 changed files with 0 additions and 1102 deletions

View file

@ -1,34 +0,0 @@
{
"ul-style": { // MD004
"style": "dash" // -
},
"ul-indent": { // MD007
"indent": 4
},
"no-hard-tabs": {
"ignore_code_languages": [
"go"
]
},
"line-length": false, // MD013
"no-missing-space-atx": false, // MD018, prevent from formatting `#tag` to `# tag`
"no-inline-html": { // MD033
"allowed_elements": [
"kbd", // keyboard key
"u", // underline
"sup", // superscript
"sub", // subscript
"center", // center text
"cursor", // Personal use
"font", // Font family
"iframe" // Embed Web content
]
},
// "fenced-code-language": { // MD040
// },
"first-line-h1": false, // MD041
"code-block-style": false // MD046: This will parse LaTeX indentation as indented code block
// "code-block-style": {
// "style": "fenced" // MD046
// }
}

View file

@ -1,489 +0,0 @@
[
{trigger: "mk", replacement: "$$0$", options: "tA"
},
{trigger: "dm", replacement: "$$\n$0\n$$", options: "tAw"
},
{trigger: "beg", replacement: "\\begin{$0}\n$1\n\\end{$0}", options: "mA"
},
// Dashes
// {trigger: "--", replacement: "", options: "tA"},
// {trigger: "-", replacement: "—", options: "tA"},
// {trigger: "—-", replacement: "---", options: "tA"},
// Greek letters
{trigger: "@a", replacement: "\\alpha", options: "mA"
},
{trigger: "@b", replacement: "\\beta", options: "mA"
},
{trigger: "@g", replacement: "\\gamma", options: "mA"
},
{trigger: "@G", replacement: "\\Gamma", options: "mA"
},
{trigger: "@d", replacement: "\\delta", options: "mA"
},
{trigger: "@D", replacement: "\\Delta", options: "mA"
},
{trigger: "@e", replacement: "\\epsilon", options: "mA"
},
{trigger: ":e", replacement: "\\varepsilon", options: "mA"
},
{trigger: "@z", replacement: "\\zeta", options: "mA"
},
{trigger: "@t", replacement: "\\theta", options: "mA"
},
{trigger: "@T", replacement: "\\Theta", options: "mA"
},
{trigger: ":t", replacement: "\\vartheta", options: "mA"
},
{trigger: "@i", replacement: "\\iota", options: "mA"
},
{trigger: "@k", replacement: "\\kappa", options: "mA"
},
{trigger: "@l", replacement: "\\lambda", options: "mA"
},
{trigger: "@L", replacement: "\\Lambda", options: "mA"
},
{trigger: "@s", replacement: "\\sigma", options: "mA"
},
{trigger: "@S", replacement: "\\Sigma", options: "mA"
},
{trigger: "@u", replacement: "\\upsilon", options: "mA"
},
{trigger: "@U", replacement: "\\Upsilon", options: "mA"
},
{trigger: "@o", replacement: "\\omega", options: "mA"
},
{trigger: "@O", replacement: "\\Omega", options: "mA"
},
{trigger: "ome", replacement: "\\omega", options: "mA"
},
{trigger: "Ome", replacement: "\\Omega", options: "mA"
},
// Text environment
{trigger: "text", replacement: "\\text{$0}$1", options: "mA"
},
{trigger: "\"", replacement: "\\text{$0}$1", options: "mA"
},
// Basic operations
{trigger: "sr", replacement: "^{2}", options: "mA"
},
{trigger: "cb", replacement: "^{3}", options: "mA"
},
{trigger: "pow", replacement: "^{$0}$1", options: "mA"
},
{trigger: "_", replacement: "_{$0}$1", options: "mA"
},
{trigger: "sb", replacement: "_{$0}$1", options: "mA"
},
{trigger: "sts", replacement: "_\\text{$0}", options: "mA"
},
{trigger: "sq", replacement: "\\sqrt{ $0 }$1", options: "mA"
},
{trigger: "//", replacement: "\\frac{$0}{$1}$2", options: "mA"
},
{trigger: "ee", replacement: "e^{ $0 }$1", options: "mA"
},
{trigger: "invs", replacement: "^{-1}", options: "mA"
},
{trigger: /([A-Za-z
])(\d)/, replacement: "[[0]]_{[[1]]}", options: "rmA", description: "Auto letter subscript", priority: -1
},
{trigger: /([^\\
])(exp|log|ln)/, replacement: "[[0]]\\[[1]]", options: "rmA"
},
{trigger: "conj", replacement: "^{*}", options: "mA"
},
{trigger: "Re", replacement: "\\mathrm{Re}", options: "mA"
},
{trigger: "Im", replacement: "\\mathrm{Im}", options: "mA"
},
{trigger: "bf", replacement: "\\mathbf{$0}", options: "mA"
},
{trigger: "rm", replacement: "\\mathrm{$0}$1", options: "mA"
},
// Linear algebra
{trigger: /([^\\
])(det)/, replacement: "[[0]]\\[[1]]", options: "rmA"
},
{trigger: "trace", replacement: "\\mathrm{Tr}", options: "mA"
},
// More operations
{trigger: "([a-zA-Z])hat", replacement: "\\hat{[[0]]}", options: "rmA"
},
{trigger: "([a-zA-Z])bar", replacement: "\\bar{[[0]]}", options: "rmA"
},
{trigger: "([a-zA-Z])dot", replacement: "\\dot{[[0]]}", options: "rmA", priority: -1
},
{trigger: "([a-zA-Z])ddot", replacement: "\\ddot{[[0]]}", options: "rmA", priority: 1
},
{trigger: "([a-zA-Z])tilde", replacement: "\\tilde{[[0]]}", options: "rmA"
},
{trigger: "([a-zA-Z])und", replacement: "\\underline{[[0]]}", options: "rmA"
},
{trigger: "([a-zA-Z])vec", replacement: "\\vec{[[0]]}", options: "rmA"
},
{trigger: "([a-zA-Z]),\\.", replacement: "\\mathbf{[[0]]}", options: "rmA"
},
{trigger: "([a-zA-Z])\\.,", replacement: "\\mathbf{[[0]]}", options: "rmA"
},
{trigger: "\\\\(${GREEK}),\\.", replacement: "\\boldsymbol{\\[[0]]}", options: "rmA"
},
{trigger: "\\\\(${GREEK})\\.,", replacement: "\\boldsymbol{\\[[0]]}", options: "rmA"
},
{trigger: "hat", replacement: "\\hat{$0}$1", options: "mA"
},
{trigger: "bar", replacement: "\\bar{$0}$1", options: "mA"
},
{trigger: "dot", replacement: "\\dot{$0}$1", options: "mA", priority: -1
},
{trigger: "ddot", replacement: "\\ddot{$0}$1", options: "mA"
},
{trigger: "cdot", replacement: "\\cdot", options: "mA"
},
{trigger: "tilde", replacement: "\\tilde{$0}$1", options: "mA"
},
{trigger: "und", replacement: "\\underline{$0}$1", options: "mA"
},
{trigger: "vec", replacement: "\\vec{$0}$1", options: "mA"
},
// More auto letter subscript
{trigger: /([A-Za-z
])_(\d\d)/, replacement: "[[0]]_{[[1]]}", options: "rmA"
},
{trigger: /\\hat{([A-Za-z
])
}(\d)/, replacement: "\\hat{[[0]]}_{[[1]]}", options: "rmA"
},
{trigger: /\\vec{([A-Za-z
])
}(\d)/, replacement: "\\vec{[[0]]}_{[[1]]}", options: "rmA"
},
{trigger: /\\mathbf{([A-Za-z
])
}(\d)/, replacement: "\\mathbf{[[0]]}_{[[1]]}", options: "rmA"
},
{trigger: "xnn", replacement: "x_{n}", options: "mA"
},
{trigger: "xii", replacement: "x_{i}", options: "mA"
},
{trigger: "xjj", replacement: "x_{j}", options: "mA"
},
{trigger: "xp1", replacement: "x_{n+1}", options: "mA"
},
{trigger: "ynn", replacement: "y_{n}", options: "mA"
},
{trigger: "yii", replacement: "y_{i}", options: "mA"
},
{trigger: "yjj", replacement: "y_{j}", options: "mA"
},
// Symbols
{trigger: "ooo", replacement: "\\infty", options: "mA"
},
{trigger: "sum", replacement: "\\sum", options: "mA"
},
{trigger: "prod", replacement: "\\prod", options: "mA"
},
{trigger: "\\sum", replacement: "\\sum_{${0:i}=${1:1}}^{${2:N}} $3", options: "m"
},
{trigger: "\\prod", replacement: "\\prod_{${0:i}=${1:1}}^{${2:N}} $3", options: "m"
},
{trigger: "lim", replacement: "\\lim_{ ${0:n} \\to ${1:\\infty} } $2", options: "mA"
},
{trigger: "+-", replacement: "\\pm", options: "mA"
},
{trigger: "-+", replacement: "\\mp", options: "mA"
},
{trigger: "...", replacement: "\\dots", options: "mA"
},
{trigger: "nabl", replacement: "\\nabla", options: "mA"
},
{trigger: "del", replacement: "\\nabla", options: "mA"
},
{trigger: "xx", replacement: "\\times", options: "mA"
},
{trigger: "**", replacement: "\\cdot", options: "mA"
},
{trigger: "para", replacement: "\\parallel", options: "mA"
},
{trigger: "===", replacement: "\\equiv", options: "mA"
},
{trigger: "!=", replacement: "\\neq", options: "mA"
},
{trigger: ">=", replacement: "\\geq", options: "mA"
},
{trigger: "<=", replacement: "\\leq", options: "mA"
},
{trigger: ">>", replacement: "\\gg", options: "mA"
},
{trigger: "<<", replacement: "\\ll", options: "mA"
},
{trigger: "simm", replacement: "\\sim", options: "mA"
},
{trigger: "sim=", replacement: "\\simeq", options: "mA"
},
{trigger: "prop", replacement: "\\propto", options: "mA"
},
{trigger: "<->", replacement: "\\leftrightarrow ", options: "mA"
},
{trigger: "->", replacement: "\\to", options: "mA"
},
{trigger: "!>", replacement: "\\mapsto", options: "mA"
},
{trigger: "=>", replacement: "\\implies", options: "mA"
},
{trigger: "=<", replacement: "\\impliedby", options: "mA"
},
{trigger: "and", replacement: "\\cap", options: "mA"
},
{trigger: "orr", replacement: "\\cup", options: "mA"
},
{trigger: "inn", replacement: "\\in", options: "mA"
},
{trigger: "notin", replacement: "\\not\\in", options: "mA"
},
{trigger: "\\\\\\", replacement: "\\setminus", options: "mA"
},
{trigger: "sub=", replacement: "\\subseteq", options: "mA"
},
{trigger: "sup=", replacement: "\\supseteq", options: "mA"
},
{trigger: "eset", replacement: "\\emptyset", options: "mA"
},
{trigger: "set", replacement: "\\{ $0 \\}$1", options: "mA"
},
{trigger: "e\\xi sts", replacement: "\\exists", options: "mA", priority: 1
},
{trigger: "LL", replacement: "\\mathcal{L}", options: "mA"
},
{trigger: "HH", replacement: "\\mathcal{H}", options: "mA"
},
{trigger: "CC", replacement: "\\mathbb{C}", options: "mA"
},
{trigger: "RR", replacement: "\\mathbb{R}", options: "mA"
},
{trigger: "ZZ", replacement: "\\mathbb{Z}", options: "mA"
},
{trigger: "NN", replacement: "\\mathbb{N}", options: "mA"
},
// Handle spaces and backslashes
// Snippet variables can be used as shortcuts when writing snippets.
// For example, ${GREEK} below is shorthand for "alpha|beta|gamma|Gamma|delta|..."
// You can edit snippet variables under the Advanced snippet settings section.
{trigger: "([^\\\\])(${GREEK})", replacement: "[[0]]\\[[1]]", options: "rmA", description: "Add backslash before Greek letters"
},
{trigger: "([^\\\\])(${SYMBOL})", replacement: "[[0]]\\[[1]]", options: "rmA", description: "Add backslash before symbols"
},
// Insert space after Greek letters and symbols
{trigger: "\\\\(${GREEK}|${SYMBOL}|${MORE_SYMBOLS})([A-Za-z])", replacement: "\\[[0]] [[1]]", options: "rmA"
},
{trigger: "\\\\(${GREEK}|${SYMBOL}) sr", replacement: "\\[[0]]^{2}", options: "rmA"
},
{trigger: "\\\\(${GREEK}|${SYMBOL}) cb", replacement: "\\[[0]]^{3}", options: "rmA"
},
{trigger: "\\\\(${GREEK}|${SYMBOL}) rd", replacement: "\\[[0]]^{$0}$1", options: "rmA"
},
{trigger: "\\\\(${GREEK}|${SYMBOL}) hat", replacement: "\\hat{\\[[0]]}", options: "rmA"
},
{trigger: "\\\\(${GREEK}|${SYMBOL}) dot", replacement: "\\dot{\\[[0]]}", options: "rmA"
},
{trigger: "\\\\(${GREEK}|${SYMBOL}) bar", replacement: "\\bar{\\[[0]]}", options: "rmA"
},
{trigger: "\\\\(${GREEK}|${SYMBOL}) vec", replacement: "\\vec{\\[[0]]}", options: "rmA"
},
{trigger: "\\\\(${GREEK}|${SYMBOL}) tilde", replacement: "\\tilde{\\[[0]]}", options: "rmA"
},
{trigger: "\\\\(${GREEK}|${SYMBOL}) und", replacement: "\\underline{\\[[0]]}", options: "rmA"
},
// Derivatives and integrals
{trigger: "par", replacement: "\\frac{ \\partial ${0:y} }{ \\partial ${1:x} } $2", options: "m"
},
{trigger: /pa([A-Za-z
])([A-Za-z
])/, replacement: "\\frac{ \\partial [[0]] }{ \\partial [[1]] } ", options: "rm"
},
{trigger: "ddt", replacement: "\\frac{d}{dt} ", options: "mA"
},
{trigger: /([^\\
])int/, replacement: "[[0]]\\int", options: "mA", priority: -1
},
{trigger: "\\int", replacement: "\\int $0 \\, d${1:x} $2", options: "m"
},
{trigger: "dint", replacement: "\\int_{${0:0}}^{${1:1}} $2 \\, d${3:x} $4", options: "mA"
},
{trigger: "oint", replacement: "\\oint", options: "mA"
},
{trigger: "iint", replacement: "\\iint", options: "mA"
},
{trigger: "iiint", replacement: "\\iiint", options: "mA"
},
{trigger: "oinf", replacement: "\\int_{0}^{\\infty} $0 \\, d${1:x} $2", options: "mA"
},
{trigger: "infi", replacement: "\\int_{-\\infty}^{\\infty} $0 \\, d${1:x} $2", options: "mA"
},
// Trigonometry
{trigger: /([^\\
])(arcsin|sin|arccos|cos|arctan|tan|csc|sec|cot)/, replacement: "[[0]]\\[[1]]", options: "rmA", description: "Add backslash before trig funcs"
},
{trigger: /\\(arcsin|sin|arccos|cos|arctan|tan|csc|sec|cot)([A-Za-gi-z
])/,
replacement: "\\[[0]] [[1]]", options: "rmA",
description: "Add space after trig funcs. Skips letter h to allow sinh, cosh, etc."
},
{trigger: /\\(sinh|cosh|tanh|coth)([A-Za-z
])/,
replacement: "\\[[0]] [[1]]", options: "rmA",
description: "Add space after hyperbolic trig funcs"
},
// Visual operations
{trigger: "U", replacement: "\\underbrace{ ${VISUAL} }_{ $0 }", options: "mA"
},
{trigger: "O", replacement: "\\overbrace{ ${VISUAL} }^{ $0 }", options: "mA"
},
{trigger: "B", replacement: "\\underset{ $0 }{ ${VISUAL} }", options: "mA"
},
{trigger: "C", replacement: "\\cancel{ ${VISUAL} }", options: "mA"
},
{trigger: "K", replacement: "\\cancelto{ $0 }{ ${VISUAL} }", options: "mA"
},
{trigger: "S", replacement: "\\sqrt{ ${VISUAL} }", options: "mA"
},
// Physics
{trigger: "kbt", replacement: "k_{B}T", options: "mA"
},
{trigger: "msun", replacement: "M_{\\odot}", options: "mA"
},
// Quantum mechanics
{trigger: "dag", replacement: "^{\\dagger}", options: "mA"
},
{trigger: "o+", replacement: "\\oplus ", options: "mA"
},
{trigger: "ox", replacement: "\\otimes ", options: "mA"
},
{trigger: "bra", replacement: "\\bra{$0} $1", options: "mA"
},
{trigger: "ket", replacement: "\\ket{$0} $1", options: "mA"
},
{trigger: "brk", replacement: "\\braket{ $0 | $1 } $2", options: "mA"
},
{trigger: "outer", replacement: "\\ket{${0:\\psi}} \\bra{${0:\\psi}} $1", options: "mA"
},
// Chemistry
{trigger: "pu", replacement: "\\pu{ $0 }", options: "mA"
},
{trigger: "cee", replacement: "\\ce{ $0 }", options: "mA"
},
{trigger: "he4", replacement: "{}^{4}_{2}He ", options: "mA"
},
{trigger: "he3", replacement: "{}^{3}_{2}He ", options: "mA"
},
{trigger: "iso", replacement: "{}^{${0:4}}_{${1:2}}${2:He}", options: "mA"
},
// Environments
{trigger: "pmat", replacement: "\\begin{pmatrix}\n$0\n\\end{pmatrix}", options: "MA"
},
{trigger: "bmat", replacement: "\\begin{bmatrix}\n$0\n\\end{bmatrix}", options: "MA"
},
{trigger: "Bmat", replacement: "\\begin{Bmatrix}\n$0\n\\end{Bmatrix}", options: "MA"
},
{trigger: "vmat", replacement: "\\begin{vmatrix}\n$0\n\\end{vmatrix}", options: "MA"
},
{trigger: "Vmat", replacement: "\\begin{Vmatrix}\n$0\n\\end{Vmatrix}", options: "MA"
},
{trigger: "matrix", replacement: "\\begin{matrix}\n$0\n\\end{matrix}", options: "MA"
},
{trigger: "pmat", replacement: "\\begin{pmatrix}$0\\end{pmatrix}", options: "nA"
},
{trigger: "bmat", replacement: "\\begin{bmatrix}$0\\end{bmatrix}", options: "nA"
},
{trigger: "Bmat", replacement: "\\begin{Bmatrix}$0\\end{Bmatrix}", options: "nA"
},
{trigger: "vmat", replacement: "\\begin{vmatrix}$0\\end{vmatrix}", options: "nA"
},
{trigger: "Vmat", replacement: "\\begin{Vmatrix}$0\\end{Vmatrix}", options: "nA"
},
{trigger: "matrix", replacement: "\\begin{matrix}$0\\end{matrix}", options: "nA"
},
{trigger: "cases", replacement: "\\begin{cases}\n$0\n\\end{cases}", options: "mA"
},
{trigger: "align", replacement: "\\begin{align}\n$0\n\\end{align}", options: "mA"
},
{trigger: "array", replacement: "\\begin{array}\n$0\n\\end{array}", options: "mA"
},
// Brackets
{trigger: "avg", replacement: "\\langle $0 \\rangle $1", options: "mA"
},
{trigger: "norm", replacement: "\\lvert $0 \\rvert $1", options: "mA", priority: 1
},
{trigger: "Norm", replacement: "\\lVert $0 \\rVert $1", options: "mA", priority: 1
},
{trigger: "ceil", replacement: "\\lceil $0 \\rceil $1", options: "mA"
},
{trigger: "floor", replacement: "\\lfloor $0 \\rfloor $1", options: "mA"
},
{trigger: "mod", replacement: "|$0|$1", options: "mA"
},
{trigger: "(", replacement: "(${VISUAL})", options: "mA"
},
{trigger: "[", replacement: "[${VISUAL}]", options: "mA"
},
{trigger: "{", replacement: "{${VISUAL}}", options: "mA"
},
{trigger: "(", replacement: "($0)$1", options: "mA"
},
{trigger: "{", replacement: "{$0}$1", options: "mA"
},
{trigger: "[", replacement: "[$0]$1", options: "mA"
},
{trigger: "lr(", replacement: "\\left( $0 \\right) $1", options: "mA"
},
{trigger: "lr{", replacement: "\\left\\{ $0 \\right\\} $1", options: "mA"
},
{trigger: "lr[", replacement: "\\left[ $0 \\right] $1", options: "mA"
},
{trigger: "lr|", replacement: "\\left| $0 \\right| $1", options: "mA"
},
{trigger: "lra", replacement: "\\left< $0 \\right> $1", options: "mA"
},
// User defined
{trigger: "b\\otimes ed", replacement: "\\boxed{$1}", options: "mA"
},
{trigger: "\\disp", replacement: "\\displaystyle $0", options: "mA"
},
// Misc
// Automatically convert standalone letters in text to math (except a, A, I).
// (Un-comment to enable)
// {trigger: /([^'])\b([B-HJ-Zb-z])\b([\n\s.,?!:'])/, replacement: "[[0]]$[[1]]$[[2]]", options: "tA"},
// Automatically convert Greek letters in text to math.
// {trigger: "(${GREEK})([\\n\\s.,?!:'])", replacement: "$\\[[0]]$[[1]]", options: "rtAw"},
// Automatically convert text of the form "x=2" and "x=n+1" to math.
// {trigger: /([A-Za-z]=\d+)([\n\s.,?!:'])/, replacement: "$[[0]]$[[1]]", options: "rtAw"},
// {trigger: /([A-Za-z]=[A-Za-z][+-]\d+)([\n\s.,?!:'])/, replacement: "$[[0]]$[[1]]", options: "tAw"},
// Snippet replacements can have placeholders.
{trigger: "tayl", replacement: "${0:f}(${1:x} + ${2:h}) = ${0:f}(${1:x}) + ${0:f}'(${1:x})${2:h} + ${0:f}''(${1:x}) \\frac{${2:h}^{2}}{2!} + \\dots$3", options: "mA", description: "Taylor expansion"
},
// Snippet replacements can also be JavaScript functions.
// See the documentation for more information.
{trigger: /iden(\d)/, replacement: (match) => {
const n = match[
1
];
let arr = [];
for (let j = 0; j < n; j++) {
arr[j
] = [];
for (let i = 0; i < n; i++) {
arr[j
][i
] = (i === j) ? 1 : 0;
}
}
let output = arr.map(el => el.join(" & ")).join(" \\\\\n");
output = `\\begin{pmatrix
}\n${output
}\n\\end{pmatrix
}`;
return output;
}, options: "mA", description: "N x N identity matrix"
},
]

View file

@ -1,111 +0,0 @@
" Put this in OBSIDIAN_VAULT/.obsidian.vimrc
set clipboard=unnamed " Sync with System Clipboard
" Colemak vim-like
noremap n j
noremap e k
noremap i l
" Similar position to i
noremap l i
noremap L I
" ne[k]st
noremap k n
noremap K N
" [j]ump
noremap j e
noremap J E
" Y to yank to end of line
noremap Y y$
""" Visual mode surrounding
exmap addbold obcommand editor:toogle-bold
exmap additalic obcommand editor:toogle-italic
exmap addhighlight obcommand editor:toogle-highlight
exmap addcode obcommand editor:toogle-code
exmap adddel obcommand editor:toogle-strikethrough
vnoremap ~ :adddel<CR> " Add delete to selection
vnoremap ` c`<C-r>"`<Esc> " editor:toogle-code is buggy
vnoremap * :addbold<CR> " Add bold to selection
vnoremap _ :additalic<CR> " Add italic to selection
vnoremap = :addhighlight " Add highlight to selection
""" Commands
exmap write editor:save-file
exmap w editor:save-file
exmap q workspace:close-tab-group
exmap prevtab obcommand workspace:previous-tab
exmap nexttab obcommand workspace:next-tab
nnoremap H :prevtab<CR>
nnoremap I :nexttab<CR>
exmap prevhist obcommand app:go-back
exmap nexthist obcommand app:go-forward
nnoremap gh :prevhist<CR>
nnoremap gi :nexthist<CR>
exmap reload :source .obsidian.vimrc<CR>
unmap <Space>
exmap vsplit obcommand workspace:split-vertical
exmap hsplit obcommand workspace:split-horizontal
map <Space>| :vsplit<CR>
map <Space>- :hsplit<CR>
" map <Space>bd
exmap chat obcommand obsidian-custom-frames:open-custom-frames-chatgpt
map <Space>ai :chat<CR>
""" g-commands
exmap tsource obcommand editor:toggle-source
exmap tpreview obcommand markdown:toggle-preview
nnoremap gs :tsource<CR>
nnoremap gp :tpreview<CR>
exmap wl obcommand editor:focus-left
exmap wr obcommand editor:focus-right
exmap wt obcommand editor:focus-top
exmap wb obcommand editor:focus-bottom
map <Space>h :wl<CR>
map <Space>i :wr<CR>
map <Space>n :wb<CR>
map <Space>e :wt<CR>
exmap FoldToggle obcommand editor:toggle-fold
exmap FoldLess obcommand editor:fold-less
exmap FoldMore obcommand editor:fold-more
exmap FoldAll obcommand editor:fold-all
exmap UnfoldAll obcommand editor:unfold-all
nnoremap za :FoldToggle<CR>
nnoremap zr :FoldLess<CR>
nnoremap zm :FoldMore<CR>
nnoremap zM :FoldAll<CR>
nnoremap zR :UnfoldAll<CR>
exmap switchany obcommand darlal-switcher-plus:switcher-plus:open
exmap switchcmd obcommand darlal-switcher-plus:switcher-plus:open-commands
exmap switchrecent obcommand darlal-switcher-plus:switcher-plus:open-related-items
map <Space><Space> :switchany<CR>
map <Space>: :switchcmd<CR>
map <Space>fr :switchrecent<CR>
" <leader>b : +buffer
exmap bd obcommand
exmap DeleteOthers obcommand workspace:close-others
map <Space>bd :bd<CR>
map <Space>bX :DeleteOthers<CR>
" <leader>m : +major/markdown
exmap addCallout obcommand editor:insert-callout
map <Space>mb :addbold<CR>
map <Space>mi :additalic<CR>
map <Space>mc :addcode<CR>
map <Space>md :adddel<CR>
map <Space>mh :addhighlight<CR>
map <Space>mp :tpreview<CR>
map <Space>mo :addCallout<CR>

View file

@ -1,23 +0,0 @@
# $DOTFILES/tools/zsh/global.zshenv
# Date: 2024-11-30
# Author: js0ny
# $DOTFILES/tools/zsh/global.zshenv
# system-wide zshenv file 系统级别的 zshenv 文件,用于设置全局环境变量
# Location:
# /etc/zshenv: (macOS and some distro)
# /etc/zsh/zshenv: (some distro)
# Linking:
# sudo cp $DOTFILES/tools/zsh/global.zshenv /etc/zshenv # or /etc/zsh/zshenv
# Set ZDOTDIR to $HOME/.config/zsh if it exists
# This allows us to keep our zsh configuration in $HOME/.config/zsh
# and zshenv will be located at $HOME/.config/zsh/.zshenv instead of
# $HOME/.zshenv
# 如果存在 $HOME/.config/zsh 目录,则将 ZDOTDIR 设置为 $HOME/.config/zsh
# 防止 .zshenv 文件自动生成在用户目录下
# Ensure SPACE between [ and -d and ]
if [ -d $HOME/.config/zsh ]; then
export ZDOTDIR=$HOME/.config/zsh
fi

View file

@ -1,115 +0,0 @@
# $DOTFILES/tools/zsh/mod/alias.zsh
# Date: 2024-11-30
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
# PowerShell Equivalent, for cross-platform compatibility
alias ni=touch
alias cls=clear
alias ii=open
# Editors #
alias v=nvim
alias c=code
# Use neovide as gVim
alias gvi="neovide"
alias svi="sudo vim -u ~/.dotfiles/common/vim.noxdg.vimrc" # Prevent conflicts with svelte-cli
alias sn="sudo nvim -u ~/.config/nvim/init.lua"
# Dev #
alias gpp='g++ -std=c++2b' # Set the default C++ standard to C++20
alias gcc='gcc -std=c99' # Set the default C standard to C99
alias cl='clang -std=c99'
alias clpp='clang++ -std=c++2b'
alias python=python3 # Set the default Python version to Python 3
alias py=python
alias ipy=ipython
alias g=lazygit
alias doomrc="emacsclient -t ~/.config/doom/"
# lsd - modern ls
if command -v lsd >/dev/null 2>&1; then
alias ls='lsd'
alias l='lsd -lah'
alias ll='lsd -l'
alias la='lsd -A'
alias l.='lsd -d .*'
alias tree='lsd --tree -A'
else
alias l='ls -lah'
alias ll='ls -l'
fi
# Functions #
mkcd() {
mkdir -p $1 && cd $1
}
cdls() {
cd $1 && ls
}
tc() {
touch $1 && code $1
}
tv() {
touch $1 && nvim $1
}
mt() {
mkdir -p $(dirname $1) && touch $1
}
mtv() {
mkdir -p $(dirname $1) && touch $1 && nvim $1
}
alias update="source $DOTFILES/scripts/update.zsh"
if command -v pacman >/dev/null 2>&1; then
alias pac="sudo pacman"
alias paci="sudo pacman -S"
alias pacr="sudo pacman -R"
alias pacu="sudo pacman -Syu"
alias pacl="pacman -Q"
if command -v paru >/dev/null 2>&1; then
alias pacs="paru -Ss"
elif command -v yay >/dev/null 2>&1; then
alias pacs="yay -Ss"
else
alias pacs="pacman -Ss"
fi
fi
if command -v apt >/dev/null 2>&1; then
alias apt="sudo apt"
alias apti="sudo apt install"
alias aptr="sudo apt remove"
alias aptu="sudo apt update && sudo apt upgrade"
alias apts="apt search"
alias aptl="apt list --installed"
fi
if command -v brew >/dev/null 2>&1; then
alias brewi="brew install"
alias brewr="brew uninstall"
alias brewu="brew update && brew upgrade"
alias brews="brew search"
alias brewl="brew list"
fi
# `-s` suffix alias
# % readme.md -> glow readme.md
alias -s {md,markdown}=glow
alias -s {htm,html,css,scss,js,jsx,ts,tsx,json,jsonc}=code
alias -s {py,rb,pl,php,java,c,cpp,h,hpp}=nvim
alias -s {cs,csx,fs,fsx,razor}=code
# TODO: Does not work
if [ "$TERM" = "xterm-ghostty" ] || [ "$TERM" = "xterm-kitty" ]; then
alias icat="kitten icat"
elif [ "$TERM_PROGRAM" = "WezTerm" ]; then
if [ -n "$WSL_DISTRO_NAME" ]; then
alias icat="wezterm.exe imgcat"
else
alias icat="wezterm imgcat"
fi
fi

View file

@ -1,43 +0,0 @@
# $DOTFILES/tools/zsh/mod/config.zsh
# Date: 2024-11-30
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
# ZSH Config, no need to `export` these variables
HISTFILE="$XDG_STATE_HOME"/zsh/history
HIST_STAMPS="yyyy-mm-dd"
HISTSIZE=10000
SAVEHIST=10000
export LANG=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
# Manually manage plugins 手动管理插件
# Load zsh-syntax-highlighting before zsh-history-substring-search
# Reference: https://github.com/zsh-users/zsh-history-substring-search?tab=readme-ov-file#usage
plugins=(
"zsh-autosuggestions"
"zsh-syntax-highlighting"
"zsh-history-substring-search"
"zsh-completions"
)
plugin_dir="$ZDOTDIR/plugins"
for plugin in "${plugins[@]}"; do
plugin_path="$plugin_dir/$plugin/$plugin.zsh"
plugin_path_alt="$plugin_dir/$plugin/$plugin.plugin.zsh"
if [[ -f $plugin_path ]]; then
source "$plugin_path"
elif [[ -f $plugin_path_alt ]]; then
source "$plugin_path_alt"
else
echo "Warning: Plugin not found: $plugin_path"
fi
done
# https://unix.stackexchange.com/questions/33994/
# Use `set -k` to mark leading `#` as a comment character
set -k
source <(fzf --zsh)

View file

@ -1,10 +0,0 @@
# $DOTFILES/tools/zsh/mod/env.zsh
# Date: 2024-11-30
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
# This file stores only environment variables that only called by
# interactive session.
# 这个文件只存储只在交互式会话中调用的环境变量。
export IPYTHONDIR="$XDG_CONFIG_HOME"/ipython

View file

@ -1,50 +0,0 @@
# $DOTFILES/tools/zsh/mod/keymap.zsh
# Date: 2024-11-30
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
# read key: `fish_key_reader`
# get current bindings: `bindkey`
bindkey -v # Vi Keybindings
# Colemak hnei
# ^
# n
# < h i >
# e
# v
# bindkey -M vicmd 'h' vi-backward-char # No change
# bindkey -M vicmd 'n' down-line-or-history
# bindkey -M vicmd 'e' up-line-or-history
# bindkey -M vicmd 'i' vi-forward-char
#
# # Similar position to [i] in QWERTY
# bindkey -M vicmd 'l' vi-insert
# bindkey -M vicmd 'L' vi-insert-bol
# # Ne{[k]s}t
# bindkey -M vicmd 'k' vi-repeat-search
# bindkey -M vicmd 'K' vi-rev-repeat-search
# # [J]ump
# bindkey -M vicmd 'j' vi-forward-word-end
# bindkey -M vicmd 'J' vi-forward-blank-word-end
# # Use N to Join
# bindkey -M vicmd 'N' vi-join
# Emacs Hybrid
bindkey '^A' beginning-of-line
bindkey '^E' end-of-line
bindkey '^F' forward-char
bindkey '^B' backward-char
bindkey '^P' up-line-or-history
bindkey '^N' down-line-or-history
bindkey '^R' history-incremental-search-backward
bindkey '^K' kill-line
# Zsh will parse <C-Backspace> to C-h
bindkey '^H' backward-kill-word
# LEADER CONVENTION
# ^X defines as a prefix key in shell
# ^A defines as a prefix key in tmux
# ^B defines as a prefix key in Terminal Emulators
# SPC defines as a prefix key in nvim

View file

@ -1,38 +0,0 @@
# $DOTFILES/tools/zsh/mod/navi.zsh
# Date: 2024-12-01
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
# Define __CD_CMD as "cd" by default
__CD_CMD="cd"
# If zoxide is available, use it
if command -v zoxide >/dev/null; then
__CD_CMD="z"
eval "$(zoxide init zsh)"
fi
# Define aliases for quick navigation
alias ..="$__CD_CMD .."
alias ...="$__CD_CMD ../.."
alias ....="$__CD_CMD ../../.."
alias .....="$__CD_CMD ../../../.."
alias ......="$__CD_CMD ../../../../.."
# Abbreviation for "cd -"
alias - "$__CD_CMD -"
# Define zls function for cd + ls
zls() {
"$__CD_CMD" "$1" && ls
}
alias cdls=zls
# Quick Jump Directories
[[ -d "$DOTFILES" ]] && alias dot="$__CD_CMD $DOTFILES"
[[ -d "$HOME/Downloads" ]] && alias down="$__CD_CMD $HOME/Downloads"
[[ -d "$HOME/.config" ]] && alias conf="$__CD_CMD $HOME/.config"
[[ -d "$HOME/Obsidian" ]] && alias ob="$__CD_CMD $HOME/Obsidian"
[[ -d "$HOME/Source" ]] && alias src="$__CD_CMD $HOME/Source"
[[ -d "$HOME/Source/Scripts" ]] && alias scr="$__CD_CMD $HOME/Source/Scripts"
[[ -d "$HOME/OrgFiles" ]] && alias org="$__CD_CMD $HOME/OrgFiles"

View file

@ -1,6 +0,0 @@
# $DOTFILES/tools/zsh/mod/prompt.zsh
# Date: 2024-11-30
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
eval "$(starship init zsh)"

View file

View file

@ -1,173 +0,0 @@
# $DOTFILES/tools/zsh/zshenv
# Date: 2024-11-30
# Author: js0ny
# User-specific environment variables for zsh 用户级别的 zsh 环境变量
# Location:
# $ZDOTDIR/.zshenv (specified by ZDOTDIR)
# ~/.zshenv (default location)
# Linking:
# ln -sf $DOTFILES/tools/zsh/zshenv $ZDOTDIR/.zshenv
# This file is sourced by all zsh sessions upon startup.
# For me (this user), define XDG Base Directory Specification variables
# and some configs that does not obey XDG Base Directory Specification
# but can be configured(by setting the variables) to (just like) obey it.
# 在此定义 XDG 基础目录规范变量和一些不遵循 XDG 基础目录规范的配置,
# 使得他们可以通过设置变量来遵循 XDG 基础目录规范。
# XDG Base Directory Specification
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
# Disable shell sessions on macOS when using default terminal
SHELL_SESSIONS_DISABLE=1
# Zsh # Redefine to make sure it's in $XDG_CONFIG_HOME
export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
# Tools Related Environment Variables
export PAGER="less -R"
export EDITOR="nvim"
export VISUAL="nvim"
export GHCUP_USE_XDG_DIRS=1
export RUSTUP_HOME="$XDG_DATA_HOME"/rustup
# Minimal PATH for early commands
export PATH="$HOME/.local/bin:/opt/share/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
if [ -d "/opt/homebrew/bin" ]; then # macOS
export PATH="/opt/homebrew/bin:$PATH"
elif [ -d "/home/linuxbrew/.linuxbrew/bin" ]; then # Linux
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
fi
# macOS Specific
# This syntax is POSIX standard, for portability
if [ "$(uname)" = "Darwin" ]; then
fi
# Linux Specific
if [ "$(uname)" = "Linux" ]; then
# CUDA
export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv
fi
# Azure CLI
if command -v az >/dev/null; then
export AZURE_CONFIG_DIR="$XDG_DATA_HOME"/azure
fi
# Bun JS
# mv ~/.bun $XDG_DATA_HOME/bun
# ln -sf $XDG_DATA_HOME/bun/bin/bun ~/.local/bin/bun
if command -v bun >/dev/null; then
export BUN_INSTALL="$XDG_DATA_HOME"/bun
export PATH="$BUN_INSTALL/bin:$PATH"
[ -s "$BUN_INSTALL/_bun" ] && source "$BUN_INSTALL/_bun"
fi
# Cargo
if command -v cargo >/dev/null; then
export CARGO_HOME="$XDG_DATA_HOME"/cargo
export PATH="$CARGO_HOME/bin:$PATH"
fi
# CGDB
if command -v cgdb >/dev/null; then
export CGDB_DIR="$XDG_CONFIG_HOME"/cgdb
fi
# .NET
if command -v dotnet >/dev/null; then
export DOTNET_CLI_HOME="$XDG_DATA_HOME"/dotnet
export PATH="$DOTNET_CLI_HOME/.dotnet/tools:$PATH"
fi
# Docker
if command -v docker >/dev/null; then
export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
fi
# GnuPG
if command -v gpg >/dev/null; then
export GNUPGHOME="$XDG_DATA_HOME"/gnupg
fi
# Go
if command -v go >/dev/null; then
export GOPATH="$XDG_DATA_HOME"/go
export PATH="$GOPATH/bin:$PATH"
fi
# Julia
if command -v julia >/dev/null; then
export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH"
fi
# Node.js
if command -v node >/dev/null; then
export NODE_REPL_HISTORY="$XDG_STATE_HOME"/node/repl_history
export TS_NODE_REPL_HISTORY="$XDG_STATE_HOME"/node/ts_node_repl_history
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
export NPM_CONFIG_INIT_MODULE="$XDG_CONFIG_HOME"/npm/config/npm-init.js
export NPM_CONFIG_CACHE="$XDG_CACHE_HOME"/npm
export NPM_CONFIG_TMP="$XDG_RUNTIME_DIR"/npm
fi
# Parallel
if command -v parallel >/dev/null; then
export PARALLEL_HOME="$XDG_CONFIG_HOME"/parallel
fi
# Python
# Works only with Python 3.13.0a3 and later
if command -v python3 >/dev/null; then
export PYTHON_HISTORY="$XDG_DATA_HOME"/python/history
fi
# GNU Screen
if command -v screen >/dev/null; then
export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc
export SCREENDIR="${XDG_RUNTIME_DIR}/screen"
fi
# Ruby Gem
# Ruby Gem
if command -v gem >/dev/null; then
setopt nullglob
for dir in "$HOME/.local/share/gem/ruby/"*/bin; do
if [ -d "$dir" ]; then
export PATH="$dir:$PATH"
fi
done
unsetopt nullglob
fi
# Spacemacs
if command -v emacs >/dev/null; then
export SPACEMACSDIR="$XDG_CONFIG_HOME"/spacemacs
fi
# Fzf
# This will make shell integration buggy
# if command -v fzf > /dev/null; then
# export FZF_DEFAULT_OPTS_FILE="$HOME/.dotfiles/common/fzfrc"
# fi
# tldr
# Works only with C client (did not verify)
if command -v tldr >/dev/null; then
export TLDR_CACHE_DIR="$XDG_CACHE_HOME"/tldr
fi
# W3M
if command -v w3m >/dev/null; then
export W3M_DIR="$XDG_DATA_HOME"/w3m
fi
# Wakatime
if command -v wakatime >/dev/null; then
export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime"
fi
# Wget
if command -v wget >/dev/null; then
alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'
fi
# z
if command -v z >/dev/null; then
export _Z_DATA="$XDG_DATA_HOME/z"
fi
# zsh .zcompdump
# compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
# Vcpkg
if command -v vcpkg >/dev/null; then
export VCPKG_ROOT="$XDG_DATA_HOME"/vcpkg
fi

View file

@ -1,37 +0,0 @@
# $DOTFILES/tools/zsh/common.zshrc
# Date: 2024-11-30
# Author: js0ny
# This is the entry point for all zsh configuration files
# 这是所有zsh配置文件的入口点
# Location: $ZDOTDIR/.zshrc (default: $HOME/.zshrc)
# Linking:
# ln -sf $DOTFILES/tools/zsh/common.zshrc $ZDOTDIR/.zshrc
export DOTFILES=$HOME/.dotfiles
case "$(uname)" in
Linux)
if grep -q Microsoft /proc/version || [[ -n "$WSL_DISTRO_NAME" ]]; then
# WSL-specific configuration
source "$DOTFILES/platforms/wsl/zshrc"
else
# Native Linux configuration
source "$DOTFILES/platforms/linux/zshrc"
fi
;;
Darwin)
# macOS-specific configuration
source "$DOTFILES/platforms/mac/zshrc"
;;
# CYGWIN*|MINGW*|MSYS*)
# source "$DOTFILES/platform/wsl.zsh"
# ;;
esac
for file in $DOTFILES/tools/zsh/mod/*.zsh; do
source $file
done
[ -f "/home/js0ny/.local/share/ghcup/env" ] && . "/home/js0ny/.local/share/ghcup/env" # ghcup-env
. "/home/js0ny/.deno/env"