Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
js0ny 2024-12-19 20:10:24 +00:00
commit ea9d6d0c5f
67 changed files with 5519 additions and 1591 deletions

View file

@ -1,7 +1,9 @@
// Paste this into surfingkeys advanced settings
// or use:
// Load settings from: https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/browser/surfingkeys.js
// Load settings from: https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/tools/browser/surfingkeys.js
// TODO: Visual Mode
// #region Example
/** Examples
// an example to create a new mapping `ctrl-y`
@ -17,81 +19,110 @@ api.map('gt', 'T');
api.unmap('<ctrl-i>');
*/
// #endregion
// Settings
settings.language = "zh-CN" ;
settings.language = "zh-CN";
settings.showModeStatus = false;
// Keymap, reference https://github.com/texiwustion/colemak_config_for_surfingkeys/tree/main
// #region Helper
const forward = {
add: function (key) { // 转发即将被 unmap 的键
return api.map(`for${key}`, key)
},
cancel: function (key) { // 删除转发生成的键
api.unmap(`for${key}`)
api.unmap(key)
},
use: function (key) {
return `for${key}`
}
add: function (key) { // 转发即将被 unmap 的键
return api.map(`for${key}`, key)
},
cancel: function (key) { // 删除转发生成的键
api.unmap(`for${key}`)
api.unmap(key)
},
use: function (key) {
return `for${key}`
}
}
const colemak = {
forward: function (key) { // 转发即将被 unmap 的键
api.map(key, `col${key}`)
api.unmap(`col${key}`)
},
use: function (key) {
return `col${key}`
},
map: function (a, b) {
api.map(colemak.use(a), forward.use(b))
}
forward: function (key) { // 转发即将被 unmap 的键
api.map(key, `col${key}`)
api.unmap(`col${key}`)
},
use: function (key) {
return `col${key}`
},
map: function (a, b) {
api.map(colemak.use(a), forward.use(b))
}
}
const forwardFactory = {
push: function (mapLists) { // forward original keys
for (let key in mapLists) {
forward.add(mapLists[key])
}
},
map: function (mapLists) {
for (let key in mapLists) {
colemak.map(key, mapLists[key])
push: function (mapLists) { // forward original keys
for (let key in mapLists) {
forward.add(mapLists[key])
}
},
pull: function (mapLists) {
for (let key in mapLists) {
forward.cancel(mapLists[key])
}
for (let key in mapLists) {
colemak.forward(key)
}
},
map: function (mapLists) {
for (let key in mapLists) {
colemak.map(key, mapLists[key])
}
},
pull: function (mapLists) {
for (let key in mapLists) {
forward.cancel(mapLists[key])
}
for (let key in mapLists) {
colemak.forward(key)
}
}
}
// #endregion
// #region Keymap
const mapLists = {
/// scroll page
// Arrow
'n': 'j',
'e': 'k',
'i': 'l',
// l <-> i
'l': 'i',
'L': 'I',
// k <-> n
'k': 'n',
'K': 'N',
// j <-> e
'j': 'e',
// PrevTab < H - I > NextTab
'H': 'E',
'I': 'R',
// E,N -> Up/Down HalfPage
'N': 'd',
'E': 'e',
// F -> Open Link in New Tab
'F': 'af',
// oH -> Tab History
'oH': 'H',
// gh/gi -> Prev/Next History
'gh': 'S',
'gi': 'D',
// t -> Open Link in New Tab
't': 'gf',
// 缩放
'zu': 'zi',
'zo': 'ze',
'zz': 'zr',
}
const mapLists = {
/// scroll page
// Arrow
'n': 'j',
'e': 'k',
'i': 'l',
// l <-> i
'l': 'i',
'L': 'I',
// k <-> n
'k': 'n',
'K': 'N',
// j <-> e
'j': 'e',
'J': 'E',
// 缩放
'zu': 'zi',
'zo': 'ze',
'zz': 'zr',
const vmapLists = {
'n': 'j',
'N': 'J',
'e': 'k',
'E': 'K',
'i': 'l',
'I': 'L',
'j': 'e',
'J': 'E',
'k': 'n',
'K': 'N',
}
forwardFactory.push(mapLists)
api.unmap('t')
forwardFactory.map(mapLists)
// 鼠标点击
api.unmap('gi')
@ -101,260 +132,297 @@ api.unmap(';m')
api.unmap(';fs')
api.unmap('O')
api.unmap('C')
api.map('g/', 'gU') // Goto Root Domain
forwardFactory.pull(mapLists)
// #endregion
// Search Alias
api.addSearchAlias('f', 'Felo', 'https://felo.ai/search?q=', 's', 'https://duckduckgo.com/ac/?q=', function(response) {
var res = JSON.parse(response.text);
return res.map(function(r){
return r.phrase;
});
// #region Search Alias
api.addSearchAlias('f', 'Felo', 'https://felo.ai/search?q=', 's', 'https://duckduckgo.com/ac/?q=', function (response) {
var res = JSON.parse(response.text);
return res.map(function (r) {
return r.phrase;
});
});
api.addSearchAlias('p', 'Perplexity', 'https://www.perplexity.ai/?q=', 's', 'https://duckduckgo.com/ac/?q=', function(response) {
var res = JSON.parse(response.text);
return res.map(function(r){
return r.phrase;
});
api.addSearchAlias('p', 'Perplexity', 'https://www.perplexity.ai/?q=', 's', 'https://duckduckgo.com/ac/?q=', function (response) {
var res = JSON.parse(response.text);
return res.map(function (r) {
return r.phrase;
});
});
api.addSearchAlias('r', 'Raindrop', 'https://app.raindrop.io/my/0/', 's', 'https://duckduckgo.com/ac/?q=', function(response) {
var res = JSON.parse(response.text);
return res.map(function(r){
return r.phrase;
});
api.addSearchAlias('r', 'Raindrop', 'https://app.raindrop.io/my/0/', 's', 'https://duckduckgo.com/ac/?q=', function (response) {
var res = JSON.parse(response.text);
return res.map(function (r) {
return r.phrase;
});
});
api.addSearchAlias('c', 'ChatGPT', 'https://chatgpt.com/?q=', 's', 'https://duckduckgo.com/ac/?q=', function (response) {
var res = JSON.parse(response.text);
return res.map(function (r) {
return r.phrase;
});
});
// #endregion
// #region Site-specific
// Theme, reference to https://github.com/Foldex/surfingkeys-config
api.Hints.style('border: solid 2px #4C566A; color:#A3BE8C; background: initial; background-color: #3B4252;');
api.Hints.style("border: solid 2px #4C566A !important; padding: 1px !important; color: #E5E9F0 !important; background: #3B4252 !important;", "text");
api.Visual.style('marks', 'background-color: #A3BE8C99;');
api.Visual.style('cursor', 'background-color: #88C0D0;');
settings.theme = `
fg: #E5E9F0;
bg: #3B4252;
bg-dark: #2E3440;
border: #4C566A;
main-fg: #88C0D0;
accent-fg: #A3BE8C;
info-fg: #5E81AC;
select: #4C566A;
/* ---------- Generic ---------- */
.sk_theme {
background: var(--bg);
color: var(--fg);
background-color: var(--bg);
border-color: var(--border);
font-family: var(--font);
font-size: var(--font-size);
font-weight: var(--font-weight);
}
// chatgpt.com
api.unmap('t', /chatgpt.com/);
api.mapkey('tn', 'New Chat', function () {
var btn = document.querySelector('div.no-draggable:nth-child(3) > span:nth-child(1) > button:nth-child(1)')
btn.click();
}, { domain: /chatgpt.com/ });
api.mapkey('ts', 'Start/Stop Generating', function () {
var btn = document.querySelector('button.h-8:nth-child(2)');
btn.click();
}, { domain: /chatgpt.com/ });
api.mapkey('ts', 'Start/Stop Generating', function () {
var btn = document.querySelector('button.h-8:nth-child(2)');
btn.click();
}, { domain: /chatgpt.com/ });
api.mapkey('S', 'Start/Stop Generating', function () {
var btn = document.querySelector('button.h-8:nth-child(2)');
btn.click();
}, { domain: /chatgpt.com/ });
//api.mapkey('tm', 'Toggle Model', function () {
// var btn = document.querySelector('#radix -\: r2i\:');
// btn.click();
//}, { domain: /chatgpt.com/ });
input {
font-family: var(--font);
font-weight: var(--font-weight);
}
// #endregion
.sk_theme tbody {
color: var(--fg);
}
// #region Theme
// reference to https://github.com/Foldex/surfingkeys-config
// api.Hints.style('border: solid 2px #4C566A; color:#A3BE8C; background: initial; background-color: #3B4252;');
// api.Hints.style("border: solid 2px #4C566A !important; padding: 1px !important; color: #E5E9F0 !important; background: #3B4252 !important;", "text");
// api.Visual.style('marks', 'background-color: #A3BE8C99;');
// api.Visual.style('cursor', 'background-color: #88C0D0;');
// settings.theme = `
// fg: #E5E9F0;
// bg: #3B4252;
// bg-dark: #2E3440;
// border: #4C566A;
// main-fg: #88C0D0;
// accent-fg: #A3BE8C;
// info-fg: #5E81AC;
// select: #4C566A;
// /* ---------- Generic ---------- */
// .sk_theme {
// background: var(--bg);
// color: var(--fg);
// background-color: var(--bg);
// border-color: var(--border);
// font-family: var(--font);
// font-size: var(--font-size);
// font-weight: var(--font-weight);
// }
.sk_theme input {
color: var(--fg);
}
// input {
// font-family: var(--font);
// font-weight: var(--font-weight);
// }
/* Hints */
#sk_hints .begin {
color: var(--accent-fg) !important;
}
// .sk_theme tbody {
// color: var(--fg);
// }
#sk_tabs .sk_tab {
background: var(--bg-dark);
border: 1px solid var(--border);
}
// .sk_theme input {
// color: var(--fg);
// }
#sk_tabs .sk_tab_title {
color: var(--fg);
}
// /* Hints */
// #sk_hints .begin {
// color: var(--accent-fg) !important;
// }
#sk_tabs .sk_tab_url {
color: var(--main-fg);
}
// #sk_tabs .sk_tab {
// background: var(--bg-dark);
// border: 1px solid var(--border);
// }
#sk_tabs .sk_tab_hint {
background: var(--bg);
border: 1px solid var(--border);
color: var(--accent-fg);
}
// #sk_tabs .sk_tab_title {
// color: var(--fg);
// }
.sk_theme #sk_frame {
background: var(--bg);
opacity: 0.2;
color: var(--accent-fg);
}
// #sk_tabs .sk_tab_url {
// color: var(--main-fg);
// }
/* ---------- Omnibar ---------- */
/* Uncomment this and use settings.omnibarPosition = 'bottom' for Pentadactyl/Tridactyl style bottom bar */
/* .sk_theme#sk_omnibar {
width: 100%;
left: 0;
} */
// #sk_tabs .sk_tab_hint {
// background: var(--bg);
// border: 1px solid var(--border);
// color: var(--accent-fg);
// }
.sk_theme .title {
color: var(--accent-fg);
}
// .sk_theme #sk_frame {
// background: var(--bg);
// opacity: 0.2;
// color: var(--accent-fg);
// }
.sk_theme .url {
color: var(--main-fg);
}
// /* ---------- Omnibar ---------- */
// /* Uncomment this and use settings.omnibarPosition = 'bottom' for Pentadactyl/Tridactyl style bottom bar */
// /* .sk_theme#sk_omnibar {
// width: 100%;
// left: 0;
// } */
.sk_theme .annotation {
color: var(--accent-fg);
}
// .sk_theme .title {
// color: var(--accent-fg);
// }
.sk_theme .omnibar_highlight {
color: var(--accent-fg);
}
// .sk_theme .url {
// color: var(--main-fg);
// }
.sk_theme .omnibar_timestamp {
color: var(--info-fg);
}
// .sk_theme .annotation {
// color: var(--accent-fg);
// }
.sk_theme .omnibar_visitcount {
color: var(--accent-fg);
}
// .sk_theme .omnibar_highlight {
// color: var(--accent-fg);
// }
.sk_theme #sk_omnibarSearchResult ul li:nth-child(odd) {
background: var(--bg-dark);
}
// .sk_theme .omnibar_timestamp {
// color: var(--info-fg);
// }
.sk_theme #sk_omnibarSearchResult ul li.focused {
background: var(--border);
}
// .sk_theme .omnibar_visitcount {
// color: var(--accent-fg);
// }
.sk_theme #sk_omnibarSearchArea {
border-top-color: var(--border);
border-bottom-color: var(--border);
}
// .sk_theme #sk_omnibarSearchResult ul li:nth-child(odd) {
// background: var(--bg-dark);
// }
.sk_theme #sk_omnibarSearchArea input,
.sk_theme #sk_omnibarSearchArea span {
font-size: var(--font-size);
}
// .sk_theme #sk_omnibarSearchResult ul li.focused {
// background: var(--border);
// }
.sk_theme .separator {
color: var(--accent-fg);
}
// .sk_theme #sk_omnibarSearchArea {
// border-top-color: var(--border);
// border-bottom-color: var(--border);
// }
/* ---------- Popup Notification Banner ---------- */
#sk_banner {
font-family: var(--font);
font-size: var(--font-size);
font-weight: var(--font-weight);
background: var(--bg);
border-color: var(--border);
color: var(--fg);
opacity: 0.9;
}
// .sk_theme #sk_omnibarSearchArea input,
// .sk_theme #sk_omnibarSearchArea span {
// font-size: var(--font-size);
// }
/* ---------- Popup Keys ---------- */
#sk_keystroke {
background-color: var(--bg);
}
// .sk_theme .separator {
// color: var(--accent-fg);
// }
.sk_theme kbd .candidates {
color: var(--info-fg);
}
// /* ---------- Popup Notification Banner ---------- */
// #sk_banner {
// font-family: var(--font);
// font-size: var(--font-size);
// font-weight: var(--font-weight);
// background: var(--bg);
// border-color: var(--border);
// color: var(--fg);
// opacity: 0.9;
// }
.sk_theme span.annotation {
color: var(--accent-fg);
}
// /* ---------- Popup Keys ---------- */
// #sk_keystroke {
// background-color: var(--bg);
// }
/* ---------- Popup Translation Bubble ---------- */
#sk_bubble {
background-color: var(--bg) !important;
color: var(--fg) !important;
border-color: var(--border) !important;
}
// .sk_theme kbd .candidates {
// color: var(--info-fg);
// }
#sk_bubble * {
color: var(--fg) !important;
}
// .sk_theme span.annotation {
// color: var(--accent-fg);
// }
#sk_bubble div.sk_arrow div:nth-of-type(1) {
border-top-color: var(--border) !important;
border-bottom-color: var(--border) !important;
}
// /* ---------- Popup Translation Bubble ---------- */
// #sk_bubble {
// background-color: var(--bg) !important;
// color: var(--fg) !important;
// border-color: var(--border) !important;
// }
#sk_bubble div.sk_arrow div:nth-of-type(2) {
border-top-color: var(--bg) !important;
border-bottom-color: var(--bg) !important;
}
// #sk_bubble * {
// color: var(--fg) !important;
// }
/* ---------- Search ---------- */
#sk_status,
#sk_find {
font-size: var(--font-size);
border-color: var(--border);
}
// #sk_bubble div.sk_arrow div:nth-of-type(1) {
// border-top-color: var(--border) !important;
// border-bottom-color: var(--border) !important;
// }
.sk_theme kbd {
background: var(--bg-dark);
border-color: var(--border);
box-shadow: none;
color: var(--fg);
}
// #sk_bubble div.sk_arrow div:nth-of-type(2) {
// border-top-color: var(--bg) !important;
// border-bottom-color: var(--bg) !important;
// }
.sk_theme .feature_name span {
color: var(--main-fg);
}
// /* ---------- Search ---------- */
// #sk_status,
// #sk_find {
// font-size: var(--font-size);
// border-color: var(--border);
// }
/* ---------- ACE Editor ---------- */
#sk_editor {
background: var(--bg-dark) !important;
height: 50% !important;
/* Remove this to restore the default editor size */
}
// .sk_theme kbd {
// background: var(--bg-dark);
// border-color: var(--border);
// box-shadow: none;
// color: var(--fg);
// }
.ace_dialog-bottom {
border-top: 1px solid var(--bg) !important;
}
// .sk_theme .feature_name span {
// color: var(--main-fg);
// }
.ace-chrome .ace_print-margin,
.ace_gutter,
.ace_gutter-cell,
.ace_dialog {
background: var(--bg) !important;
}
// /* ---------- ACE Editor ---------- */
// #sk_editor {
// background: var(--bg-dark) !important;
// height: 50% !important;
// /* Remove this to restore the default editor size */
// }
.ace-chrome {
color: var(--fg) !important;
}
// .ace_dialog-bottom {
// border-top: 1px solid var(--bg) !important;
// }
.ace_gutter,
.ace_dialog {
color: var(--fg) !important;
}
// .ace-chrome .ace_print-margin,
// .ace_gutter,
// .ace_gutter-cell,
// .ace_dialog {
// background: var(--bg) !important;
// }
.ace_cursor {
color: var(--fg) !important;
}
// .ace-chrome {
// color: var(--fg) !important;
// }
.normal-mode .ace_cursor {
background-color: var(--fg) !important;
border: var(--fg) !important;
opacity: 0.7 !important;
}
// .ace_gutter,
// .ace_dialog {
// color: var(--fg) !important;
// }
.ace_marker-layer .ace_selection {
background: var(--select) !important;
}
// .ace_cursor {
// color: var(--fg) !important;
// }
.ace_editor,
.ace_dialog span,
.ace_dialog input {
font-family: var(--font);
font-size: var(--font-size);
font-weight: var(--font-weight);
}`;
// click `Save` button to make above settings to take effect.</ctrl-i></ctrl-y>
// .normal-mode .ace_cursor {
// background-color: var(--fg) !important;
// border: var(--fg) !important;
// opacity: 0.7 !important;
// }
// .ace_marker-layer .ace_selection {
// background: var(--select) !important;
// }
// .ace_editor,
// .ace_dialog span,
// .ace_dialog input {
// font-family: var(--font);
// font-size: var(--font-size);
// font-weight: var(--font-weight);
// }`;
// click `Save` button to make above settings to take effect.</ctrl-i></ctrl-y>
// #endregion

2
tools/fish/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
fish_variables
completions

View file

@ -0,0 +1,137 @@
# $DOTFILES/tools/fish/conf.d/0init.fish
# Date: 2024-12-19
# Author: js0ny
# By dictionary order, this file is sourced first in fish shell
# Define user-specific environment variables for fish
# Location:
# ~/.config/fish/conf.d/0init.fish (default location)
# Linking: Link the whole directory for submodules
# ln -sf $DOTFILES/tools/fish ~/.config/fish
set -gx DOTFILES $HOME/.dotfiles
# XDG Base Directory Specification
set -gx XDG_CONFIG_HOME (set -q XDG_CONFIG_HOME; and echo $XDG_CONFIG_HOME; or echo $HOME/.config)
set -gx XDG_DATA_HOME (set -q XDG_DATA_HOME; and echo $XDG_DATA_HOME; or echo $HOME/.local/share)
set -gx XDG_STATE_HOME (set -q XDG_STATE_HOME; and echo $XDG_STATE_HOME; or echo $HOME/.local/state)
set -gx XDG_CACHE_HOME (set -q XDG_CACHE_HOME; and echo $XDG_CACHE_HOME; or echo $HOME/.cache)
set -gx XDG_RUNTIME_DIR /run/user/(id -u)
set -gx PAGER "less -R"
set -gx EDITOR nvim
set -gx VISUAL nvim
# Minimal PATH for early commands
set -gx PATH /usr/local/bin /usr/bin /bin /usr/sbin /sbin ~/.local/bin $PATH
if test -d /opt/homebrew/bin # macOS
set -gx PATH /opt/homebrew/bin $PATH
else if test -d /home/linuxbrew/.linuxbrew/bin # Linux
set -gx PATH /home/linuxbrew/.linuxbrew/bin $PATH
end
# Azure CLI
if command -v az > /dev/null
set -gx AZURE_CONFIG_DIR $XDG_DATA_HOME/azure
end
# Bun JS
if command -v bun > /dev/null
set -gx BUN_INSTALL "$XDG_DATA_HOME/bun"
set -gx PATH $BUN_INSTALL/bin $PATH
end
# Rust Cargo
if command -v cargo > /dev/null
set -gx CARGO_HOME $XDG_DATA_HOME/cargo
set -gx PATH $CARGO_HOME/bin $PATH
end
# CGDB
if command -v cgdb > /dev/null
set -gx CGDB_DIR $XDG_CONFIG_HOME/cgdb
end
# .NET
if command -v dotnet > /dev/null
set -gx DOTNET_CLI_HOME $XDG_DATA_HOME/dotnet
set -gx PATH $DOTNET_CLI_HOME/.dotnet/tools $PATH
end
# Docker
if command -v docker > /dev/null
set -gx DOCKER_CONFIG $XDG_CONFIG_HOME/docker
end
# GnuPG
if command -v gpg > /dev/null
set -gx GNUPGHOME $XDG_DATA_HOME/gnupg
end
# Go
if command -v go > /dev/null
set -gx GOPATH $XDG_DATA_HOME/go
set PATH $GOPATH/bin $PATH
end
# Julia
if command -v julia > /dev/null
set -gx JULIA_DEPOT_PATH $XDG_DATA_HOME/julia
end
# Node.js
if command -v node > /dev/null
set -gx NODE_REPL_HISTORY $XDG_STATE_HOME/node/repl_history
set -gx TS_NODE_REPL_HISTORY $XDG_STATE_HOME/node/ts_repl_history
set -gx NPM_CONFIG_USERCONFIG $XDG_CONFIG_HOME/npm/npmrc
set -gx NPM_CONFIG_INIT_MODULE $XDG_CONFIG_HOME/npm/config/npm-init.js
set -gx NPM_CONFIG_CACHE $XDG_CACHE_HOME/npm
set -gx NPM_CONFIG_TMP $XDG_RUNTIME_DIR/npm
end
# Parallel
if command -v parallel > /dev/null
set -gx PARALLEL_CONFIG $XDG_CONFIG_HOME/parallel
end
# Python
# Works only with Python 3.13.0a3 and later
if command -v python3 > /dev/null
set -gx PYTHON_HISTORY $XDG_DATA_HOME/python/history
end
# GNU Screen
if command -v screen > /dev/null
set -gx SCREENRC $XDG_CONFIG_HOME/screen/screenrc
set -gx SCREENDIR $XDG_RUNTIME_DIR/screen
end
# Ruby Gem
if command -v gem > /dev/null
for dir in $HOME/.local/share/gem/ruby/*/bin
if test -d $dir
set -gx PATH $dir $PATH
end
end
end
# Spacemacs
if command -v emacs > /dev/null
set -gx SPACEMACSDIR $XDG_CONFIG_HOME/spacemacs
end
# tldr
if command -v tldr > /dev/null
set -gx TLDR_CACHE_DIR $XDG_CACHE_HOME/tldr
end
# W3M
if command -v w3m > /dev/null
set -gx W3M_DIR $XDG_DATA_HOME/w3m
end
# Wakatime
if command -v wakatime > /dev/null
set -gx WAKATIME_HOME $XDG_CONFIG_HOME/wakatime
end
# Wget
if command -v wget > /dev/null
alias wget="wget --hsts-file=$XDG_CACHE_HOME/wget-hsts"
end
# z
if command -v z > /dev/null
set -gx _Z_DATA $XDG_DATA_HOME/z
end
if command -v tldr > /dev/null
set -gx TLDR_CACHE_DIR $XDG_CACHE_HOME/tldr
end
if status is-interactive
if command -v ipython > /dev/null
set IPYTHONDIR $XDG_CONFIG_HOME/ipython
end
end

View file

@ -0,0 +1,55 @@
# Powershell equivalent
abbr --add ni touch
abbr --add cls clear
abbr --add ii open
# Editors #
abbr --add v nvim
abbr --add c code
alias sv="sudo vim -u ~/.config/vim/vimrc"
alias sn="sudo nvim -u ~/.config/nvim/init.lua"
# Dev #
abbr --add py python3
abbr --add ipy ipython
abbr --add reload "source $__fish_config_dir/config.fish"
abbr --add pulldots "cd $DOTFILES && git pull"
# lsd - modern ls
if command -v lsd > /dev/null
alias ls='lsd -A -I .DS_Store -I .git -I .gitkeep'
abbr --add l 'lsd -lah'
abbr --add ll 'lsd -l'
abbr --add tree 'ls --tree'
else
abbr --add l 'ls -lah'
abbr --add ll 'ls -l'
end
# Functions #
function mkcd
mkdir -p $argv[1] && cd $argv[1]
end
function cdls
cd $argv[1] && ls
end
function tc
touch $argv[1] && code $argv[1]
end
function tv
touch $argv[1] && nvim $argv[1]
end
# Use neovide as gVim
if command -v neovide > /dev/null
abbr --add gvi "neovide"
end
if command -v brew > /dev/null
abbr --add brewi "brew install"
abbr --add brewu "brew upgrade && brew update"
abbr --add brewr "brew remove"
abbr --add brewc "brew cleanup"
end

View file

@ -0,0 +1,16 @@
fish_vi_key_bindings
# Colemak hnei
# ^
# n
# < h i >
# e
# v
# bind -M default 'h' backward-char
bind -M default 'n' down-or-search
bind -M default 'e' up-or-search
bind -M default 'i' forward-char
# Similar position to [i] in QWERTY
bind -M default -m insert l repaint-mode
bind -M default -m insert L beginning-of-line repaint-mode

View file

@ -0,0 +1,13 @@
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
abbr --add \- 'cd -'
if command -v zoxide > /dev/null
zoxide init fish | source
end

View file

@ -0,0 +1,5 @@
if command -v starship > /dev/null
set -gx STARSHIP_CONFIG $DOTFILES/tools/starship/starship_fish.toml
starship init fish | source
end

23
tools/fish/config.fish Normal file
View file

@ -0,0 +1,23 @@
# $DOTFILES/tools/fish/config.fish
# Date: 2024-12-15
# Author: js0ny
# Define interactive shell configurations for fish
# Location:
# ~/.config/fish/config.fish (default location)
# Linking: Link the whole directory for submodules
# ln -sf $DOTFILES/tools/fish ~/.config/fish
if status is-interactive
# Commands to run in interactive sessions can go here
switch (uname)
case "Darwin"
# macOS Specific
abbr --add clip pbcopy
abbr --add paste pbpaste
case "Linux"
# Linux Specific
case '*'
# Default / Fallback case
end
end

29
tools/fish/readme.md Normal file
View file

@ -0,0 +1,29 @@
## `type -q` vs `command -v`
```shell
󰈺 > time for i in (seq 1 10000)
type -q vim
end
time for i in (seq 1 10000)
command -v vim >/dev/null
end
________________________________________________________
Executed in 545.79 millis fish external
usr time 177.62 millis 174.28 millis 3.34 millis
sys time 367.72 millis 366.16 millis 1.56 millis
________________________________________________________
Executed in 292.97 millis fish external
usr time 71.23 millis 69.31 millis 1.93 millis
sys time 215.22 millis 214.78 millis 0.44 millis
```
`command -v` is faster

2705
tools/kitty/kitty.conf Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,489 @@
[
{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

@ -0,0 +1,111 @@
" 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,6 +1,6 @@
# $DOTFILES/tools\powershell\Aliases.ps1
# Date: 2024-12-01
# Author: contact@js0ny.net
# Author: js0ny
# Aliases for PowerShell
### VARIABLES ###
$EDITOR = "code"
@ -29,3 +29,7 @@ function cdls { param( [string] $dirname) Set-Location $dirname && Get-ChildItem
# Python & Conda #
Set-Alias "py" "python"
Set-Alias "ipy" "ipython"
if ($isWindows) {
function kex { wsl -d kali-linux kex --sl -s }
}

View file

@ -1,6 +1,6 @@
# $DOTFILES/tools\powershell\Environment.ps1
# Date: 2024-12-01
# Author: contact@js0ny.net
# Author: js0ny
# Sourced by Microsoft.PowerShell_profile.ps1

View file

@ -1,6 +1,6 @@
# $DOTFILES/tools\powershell\Prompt.ps1
# Date: 2024-12-01
# Author: contact@js0ny.net
# Author: js0ny
# Use starship to set prompt
$ENV:STARSHIP_CONFIG = Join-Path $DOTFILES "tools" "starship" "starship_pwsh.toml"

View file

@ -0,0 +1,208 @@
# starship.toml
# ~/.config/starship.toml
format = '''$os$time $username @ $hostname $directory $all$character'''
continuation_prompt = "[r % ](bold cyan) " # Doesn't work in fish
add_newline = true
[time]
disabled = false
format = '[\[$time\]](purple)'
time_format = '%H:%M'
[username]
format = '[$user](bold)'
show_always = true
[hostname]
ssh_only = false
ssh_symbol = '󰞉 '
[character]
success_symbol = "[󰈺 >](bold green)"
error_symbol = "[󰈺 >](bold red)"
vimcmd_symbol = "[ <](bold green)"
[directory]
truncation_length = 2
truncate_to_repo = true
read_only = " 󰌾"
style = "bold cyan"
truncation_symbol = ".../"
[directory.substitutions]
"~/Documents" = "󰈙 "
"~/Downloads" = " "
"~/Music" = " "
"~/Pictures" = " "
"Source" = " "
"src" = " "
[aws]
symbol = " "
[buf]
symbol = " "
[c]
symbol = " "
[conda]
symbol = " "
[crystal]
symbol = " "
[dart]
symbol = " "
[docker_context]
symbol = " "
[elixir]
symbol = " "
[elm]
symbol = " "
[fennel]
symbol = " "
[fossil_branch]
symbol = " "
[git_branch]
symbol = " "
[git_commit]
tag_symbol = '  '
[golang]
symbol = " "
[guix_shell]
symbol = " "
[haskell]
symbol = " "
[haxe]
symbol = " "
[hg_branch]
symbol = " "
[java]
symbol = " "
[julia]
symbol = " "
[kotlin]
symbol = " "
[lua]
symbol = " "
[memory_usage]
symbol = "󰍛 "
[meson]
symbol = "󰔷 "
[nim]
symbol = "󰆥 "
[nix_shell]
symbol = " "
[nodejs]
symbol = " "
[ocaml]
symbol = " "
[os]
disabled = false
[os.symbols]
Alpaquita = " "
Alpine = " "
AlmaLinux = " "
Amazon = " "
Android = " "
Arch = " "
Artix = " "
CentOS = " "
Debian = " "
DragonFly = " "
Emscripten = " "
EndeavourOS = " "
Fedora = " "
FreeBSD = " "
Garuda = "󰛓 "
Gentoo = " "
HardenedBSD = "󰞌 "
Illumos = "󰈸 "
Kali = " "
Linux = " "
Mabox = " "
Macos = " "
Manjaro = " "
Mariner = " "
MidnightBSD = " "
Mint = " "
NetBSD = " "
NixOS = " "
OpenBSD = "󰈺 "
openSUSE = " "
OracleLinux = "󰌷 "
Pop = " "
Raspbian = " "
Redhat = " "
RedHatEnterprise = " "
RockyLinux = " "
Redox = "󰀘 "
Solus = "󰠳 "
SUSE = " "
Ubuntu = " "
Unknown = " "
Void = " "
Windows = "󰍲 "
[package]
symbol = "󰏗 "
[perl]
symbol = " "
[php]
symbol = " "
[pijul_channel]
symbol = " "
[python]
symbol = " "
[rlang]
symbol = "󰟔 "
[ruby]
symbol = " "
[rust]
symbol = "󱘗 "
[scala]
symbol = " "
[swift]
symbol = " "
[zig]
symbol = " "
[gradle]
symbol = " "

View file

@ -28,7 +28,8 @@ truncation_length = 2
truncate_to_repo = true
read_only = " 󰌾"
style ="bold cyan"
truncation_symbol = ".../"
truncation_symbol = ":"
fish_style_pwd_dir_length = 1
[directory.substitutions]
"~/Documents" = "󰈙 "

View file

@ -1,485 +1,487 @@
// Place your key bindings in this file to override the defaultsauto[]
[
// #region quickOpen (Telescope)
{ // <leader> <space> Telescope emulator
"key": "space space",
"command": "workbench.action.quickOpen",
"when": "!editorFocus && !inputFocus"
},
{
"key": "ctrl+p",
"command": "workbench.action.quickOpen"
},
{
"key": "ctrl+e",
"command": "workbench.action.quickOpenNavigatePrevious",
"when": "inQuickOpen"
},
{
"key": "ctrl+n",
"command": "workbench.action.quickOpenNavigateNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+[",
"command": "workbench.action.closeQuickOpen",
"when": "inQuickOpen"
},
// #endregion
// #region plugin: code runner
{
"key": "ctrl+alt+n",
"command": "-code-runner.run"
},
// #endregion
{
"key": "ctrl+oem_1", // ctrl+;
"command": "extension.insertSemicolon",
"when": "editorTextFocus"
},
{ // change to toggle comment
"key": "ctrl+oem_2", // ctrl+/;
"command": "-extension.insertSemicolon",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+oem_1",
"command": "extension.insertSemicolonWithNewLine",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+oem_2",
"command": "-extension.insertSemicolonWithNewLine",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+oem_2",
"command": "github.copilot.acceptCursorPanelSolution",
"when": "github.copilot.activated && github.copilot.panelVisible"
},
{
"key": "ctrl+oem_2",
"command": "-github.copilot.acceptCursorPanelSolution",
"when": "github.copilot.activated && github.copilot.panelVisible"
},
{
"key": "f9",
"command": "csdevkit.debug.noDebugFileLaunch"
},
{
"key": "ctrl+h",
"command": "-editor.action.startFindReplaceAction",
"when": "editorFocus || editorIsOpen"
},
{
"key": "ctrl+h",
"command": "-extension.vim_ctrl+h",
"when": "editorTextFocus && vim.active && vim.use<C-h> && !inDebugRepl"
},
{
"key": "ctrl+r",
"command": "-workbench.action.reloadWindow",
"when": "isDevelopment"
},
{
"key": "ctrl+alt+r",
"command": "-workbench.action.terminal.runRecentCommand",
"when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled"
},
{
"key": "ctrl+r",
"command": "-workbench.action.terminal.runRecentCommand",
"when": "accessibilityModeEnabled && terminalFocus && terminalHasBeenCreated || accessibilityModeEnabled && terminalFocus && terminalProcessSupported || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'"
},
{
"key": "ctrl+shift+r",
"command": "-rerunSearchEditorSearch",
"when": "inSearchEditor"
},
{
"key": "ctrl+shift+r",
"command": "-editor.action.refactor",
"when": "editorHasCodeActionsProvider && textInputFocus && !editorReadonly"
},
{
"key": "ctrl+shift+r",
"command": "-workbench.action.quickOpenNavigatePreviousInRecentFilesPicker",
"when": "inQuickOpen && inRecentFilesPicker"
},
{
"key": "ctrl+e",
"command": "cursorEnd",
"when": "textInputFocus"
},
// #region Nvim-Tree like File Explorer
// n, e : move cursor up/down
// h : move cursor to parent folder
// l : open file or folder
{ // z: Close all folders
"key": "z",
"command": "workbench.files.action.collapseExplorerFolders",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // <leader>e: Close left sidebar if is in file explorer
"key": "space e",
"command": "workbench.action.toggleSidebarVisibility",
"when": "sideBarFocus && !inputFocus && !searchViewletVisible && filesExplorerFocus"
},
{ // <leader>e: Focus on file explorer if is on sidebar and not in file explorer
"key": "space e",
"command": "workbench.files.action.focusFilesExplorer",
"when": "sideBarFocus && !inputFocus && !searchViewletVisible && !filesExplorerFocus"
},
{ // <leader>g: Focus on file explorer if is on sidebar and not in file explorer
"key": "space g",
"command": "workbench.scm.focus",
"when": "sideBarFocus && !inputFocus && !searchViewletVisible && !scmViewletVisible"
},
{ // a: add
"key": "a",
"command": "explorer.newFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // p: paste
"key": "p",
"command": "filesExplorer.paste",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // x: cut
"key": "x",
"command": "filesExplorer.cut",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // d: delete
"key": "d",
"command": "deleteFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // r: rename
"key": "r",
"command": "renameFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // s: open in vertical split / to side
"key": "s",
"command": "explorer.openToSide",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // A: add folder
"key": "shift+a",
"command": "explorer.newFolder",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // C: Copy path
"key": "shift+c",
"command": "copyFilePath",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // E: Open in File Explorer
"key": "shift+e",
"command": "revealFileInOS",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // E: Open in File Explorer (WSL)
"key": "shift+e",
"command": "remote-wsl.revealInExplorer",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus && remoteName == 'wsl'"
},
{ // O: Open with System App
"key": "shift+o",
"command": "openInExternalApp.open",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // Y: Copy Relative Path
"key": "shift+y",
"command": "copyRelativeFilePath",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // R: Copy Relative Path
"key": "shift+r",
"command": "workbench.files.action.refreshFilesExplorer",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // T: Open in terminal
"key": "shift+t",
"command": "openInIntegratedTerminal",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
// #endregion
{
"key": "ctrl+p",
"command": "workbench.action.files.openFileFolder",
"when": "isMacNative && openFolderWorkspaceSupport"
},
{
"key": "ctrl+o",
"command": "-workbench.action.files.openFileFolder",
"when": "isMacNative && openFolderWorkspaceSupport"
},
{
"key": "ctrl+p",
"command": "-extension.vim_ctrl+p",
"when": "editorTextFocus && vim.active && vim.use<C-p> && !inDebugRepl || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'SearchInProgressMode'"
},
{
"key": "ctrl+o",
"command": "-workbench.action.files.openFolderViaWorkspace",
"when": "!openFolderWorkspaceSupport && workbenchState == 'workspace'"
},
// #region Vim-like Hover Browsing
{
"key": "h",
"command": "editor.action.scrollLeftHover",
"when": "editorHoverFocused"
},
{
"key": "n",
"command": "editor.action.scrollDownHover",
"when": "editorHoverFocused"
},
{
"key": "e",
"command": "editor.action.scrollUpHover",
"when": "editorHoverFocused"
},
{
"key": "i",
"command": "editor.action.scrollRightHover",
"when": "editorHoverFocused"
},
// #endregion
// #region Vim-like Jupyter Navigation
{
"key": "n",
"command": "notebook.focusNextEditor",
"when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'none' && notebookEditorCursorAtBoundary != 'top'"
},
{
"key": "j",
"command": "-notebook.focusNextEditor",
"when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'none' && notebookEditorCursorAtBoundary != 'top'"
},
{
"key": "e",
"command": "notebook.focusPreviousEditor",
"when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'bottom' && notebookEditorCursorAtBoundary != 'none'"
},
{
"key": "k",
"command": "-notebook.focusPreviousEditor",
"when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'bottom' && notebookEditorCursorAtBoundary != 'none'"
},
// #endregion
{
"key": "e",
"command": "list.focusUp",
"when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused"
},
{
"key": "k",
"command": "-list.focusUp",
"when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused"
},
{
"key": "e",
"command": "list.focusUp",
"when": "listFocus && !inputFocus"
},
{
"key": "k",
"command": "-list.focusUp",
"when": "listFocus && !inputFocus"
},
{
"key": "f",
"command": "filesExplorer.findInWorkspace",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "n",
"command": "list.focusDown",
"when": "listFocus && !inputFocus"
},
{
"key": "j",
"command": "-list.focusDown",
"when": "listFocus && !inputFocus"
},
{
"key": "i",
"command": "list.select",
"when": "listFocus && !inputFocus"
},
{
"key": "l",
"command": "-list.select",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+shift+g c",
"command": "-gitlens.showQuickCommitFileDetails",
"when": "editorTextFocus && !gitlens:disabled && config.gitlens.keymap == 'chorded'"
},
{
"key": "ctrl+shift+g s",
"command": "git.stageAll"
},
{
"key": "ctrl+shift+g g",
"command": "workbench.view.scm",
"when": "workbench.scm.active"
},
{
"key": "ctrl+shift+g",
"command": "-workbench.view.scm",
"when": "workbench.scm.active"
},
{
"key": "ctrl+k ctrl+shift+b",
"command": "editor.action.goToSelectionAnchor"
},
{
"key": "ctrl+k ctrl+shift+i",
"command": "workbench.action.selectProductIconTheme"
},
{
"key": "ctrl+l p",
"command": "-extension.openPrGitProvider"
},
{
"key": "ctrl+l g",
"command": "-extension.openInGitHub"
},
{
"key": "ctrl+l c",
"command": "-extension.copyGitHubLinkToClipboard"
},
// #region Use ^n ^e to navigate completions
{
"key": "ctrl+n",
"command": "workbench.action.files.newUntitledFile",
"when": "!suggestWidgetVisible && !inQuickOpen"
},
{
"key": "ctrl+n",
"command": "-workbench.action.files.newUntitledFile"
},
{
"key": "ctrl+n",
"command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion"
},
{
"key": "ctrl+e",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion"
},
// #endregion
// #region Terminal Control, use ^a as prefix / leader key
// tmux-like terminal control
{ // prefix + x : kill terminal
"key": "ctrl+a x",
"command": "workbench.action.terminal.kill",
"when": "terminalFocus"
},
{ // prefix + c : create new terminal
"key": "ctrl+a c",
"command": "workbench.action.terminal.new",
"when": "terminalFocus"
},
{ // prefix + | : split terminal vertically
"key": "ctrl+a shift+\\",
"command": "workbench.action.terminal.split",
"when": "terminalFocus"
},
{ // prefix + \ : split terminal vertically
"key": "ctrl+a \\",
"command": "workbench.action.terminal.split",
"when": "terminalFocus"
},
{ // prefix + / : search
"key": "ctrl+a /",
"command": "workbench.action.terminal.focusFind",
"when": "terminalFocus"
},
{ // prefix + t : toggle terminal
"key": "ctrl+a t",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminalFocus"
},
{ // prefix + ^a: show information
"key": "ctrl+a ctrl+a",
"command": "workbench.action.terminal.focusHover",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{
"key": "ctrl+k ctrl+i",
"command": "-workbench.action.terminal.focusHover",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{ // prefix + 1 : focus terminal 1
"key": "ctrl+a 1",
"command": "workbench.action.terminal.focusAtIndex1",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{ // prefix + 2 : focus terminal 2
"key": "ctrl+a 2",
"command": "workbench.action.terminal.focusAtIndex2",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{ // prefix + 3 : focus terminal 3
"key": "ctrl+a 3",
"command": "workbench.action.terminal.focusAtIndex3",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{ // prefix + g : Go to recent directory
"key": "ctrl+a g",
"command": "workbench.action.terminal.goToRecentDirectory",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+g",
"command": "-workbench.action.terminal.goToRecentDirectory",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{ // prefix + d : detach terminal
"key": "ctrl+a d",
"command": "workbench.action.terminal.detachSession",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{ // prefix + a : attach to session
"key": "ctrl+a a",
"command": "workbench.action.terminal.attachToSession",
"when": "terminalFocus"
},
{
"key": "ctrl+a h",
"command": "workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+a i",
"command": "workbench.action.terminal.focusNextPane",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+a shift+H",
"command": "workbench.action.terminal.resizePaneLeft",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+a shift+N",
"command": "workbench.action.terminal.resizePaneDown",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+a shift+E",
"command": "workbench.action.terminal.resizePaneUp",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+a shift+I",
"command": "workbench.action.terminal.resizePaneRight",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
}
// #region quickOpen (Telescope)
{ // <leader> <space> Telescope emulator
"key": "space space",
"command": "workbench.action.quickOpen",
"when": "!editorFocus && !inputFocus"
},
{
"key": "ctrl+p",
"command": "workbench.action.quickOpen"
},
{
"key": "ctrl+e",
"command": "workbench.action.quickOpenNavigatePrevious",
"when": "inQuickOpen"
},
{
"key": "ctrl+n",
"command": "workbench.action.quickOpenNavigateNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+[",
"command": "workbench.action.closeQuickOpen",
"when": "inQuickOpen"
},
// #endregion
// #region plugin: code runner
{
"key": "ctrl+alt+n",
"command": "-code-runner.run"
},
// #endregion
// #region Comment and semicolons
{
"key": "ctrl+oem_1", // ctrl+;
"command": "extension.insertSemicolon",
"when": "editorTextFocus"
},
{ // change to toggle comment
"key": "ctrl+oem_2", // ctrl+/;
"command": "-extension.insertSemicolon",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+oem_1",
"command": "extension.insertSemicolonWithNewLine",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+oem_2",
"command": "-extension.insertSemicolonWithNewLine",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+oem_2",
"command": "github.copilot.acceptCursorPanelSolution",
"when": "github.copilot.activated && github.copilot.panelVisible"
},
{
"key": "ctrl+oem_2",
"command": "-github.copilot.acceptCursorPanelSolution",
"when": "github.copilot.activated && github.copilot.panelVisible"
},
// #endregion
{
"key": "f9",
"command": "csdevkit.debug.noDebugFileLaunch"
},
{
"key": "ctrl+h",
"command": "-editor.action.startFindReplaceAction",
"when": "editorFocus || editorIsOpen"
},
{
"key": "ctrl+h",
"command": "-extension.vim_ctrl+h",
"when": "editorTextFocus && vim.active && vim.use<C-h> && !inDebugRepl"
},
{
"key": "ctrl+r",
"command": "-workbench.action.reloadWindow",
"when": "isDevelopment"
},
{
"key": "ctrl+alt+r",
"command": "-workbench.action.terminal.runRecentCommand",
"when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled"
},
{
"key": "ctrl+r",
"command": "-workbench.action.terminal.runRecentCommand",
"when": "accessibilityModeEnabled && terminalFocus && terminalHasBeenCreated || accessibilityModeEnabled && terminalFocus && terminalProcessSupported || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'"
},
{
"key": "ctrl+shift+r",
"command": "-rerunSearchEditorSearch",
"when": "inSearchEditor"
},
{
"key": "ctrl+shift+r",
"command": "-editor.action.refactor",
"when": "editorHasCodeActionsProvider && textInputFocus && !editorReadonly"
},
{
"key": "ctrl+shift+r",
"command": "-workbench.action.quickOpenNavigatePreviousInRecentFilesPicker",
"when": "inQuickOpen && inRecentFilesPicker"
},
{
"key": "ctrl+e",
"command": "cursorEnd",
"when": "textInputFocus"
},
// #region Nvim-Tree like File Explorer
// n, e : move cursor up/down
// h : move cursor to parent folder
// i : open file or folder
{
"key": "e",
"command": "list.focusUp",
"when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused"
},
{
"key": "k",
"command": "-list.focusUp",
"when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused"
},
{
"key": "e",
"command": "list.focusUp",
"when": "listFocus && !inputFocus"
},
{
"key": "k",
"command": "-list.focusUp",
"when": "listFocus && !inputFocus"
},
{
"key": "f",
"command": "filesExplorer.findInWorkspace",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "n",
"command": "list.focusDown",
"when": "listFocus && !inputFocus"
},
{
"key": "j",
"command": "-list.focusDown",
"when": "listFocus && !inputFocus"
},
{
"key": "i",
"command": "list.select",
"when": "listFocus && !inputFocus"
},
{
"key": "l",
"command": "-list.select",
"when": "listFocus && !inputFocus"
},
{ // z: Close all folders
"key": "z",
"command": "workbench.files.action.collapseExplorerFolders",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // <leader>e: Close left sidebar if is in file explorer
"key": "space e",
"command": "workbench.action.toggleSidebarVisibility",
"when": "sideBarFocus && !inputFocus && !searchViewletVisible && filesExplorerFocus"
},
{ // <leader>e: Focus on file explorer if is on sidebar and not in file explorer
"key": "space e",
"command": "workbench.files.action.focusFilesExplorer",
"when": "sideBarFocus && !inputFocus && !searchViewletVisible && !filesExplorerFocus"
},
{ // <leader>g: Focus on file explorer if is on sidebar and not in file explorer
"key": "space g",
"command": "workbench.scm.focus",
"when": "sideBarFocus && !inputFocus && !searchViewletVisible && !scmViewletVisible"
},
{ // a: add
"key": "a",
"command": "explorer.newFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // p: paste
"key": "p",
"command": "filesExplorer.paste",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // x: cut
"key": "x",
"command": "filesExplorer.cut",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // d: delete
"key": "d",
"command": "deleteFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // r: rename
"key": "r",
"command": "renameFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // s: open in vertical split / to side
"key": "s",
"command": "explorer.openToSide",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // A: add folder
"key": "shift+a",
"command": "explorer.newFolder",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // C: Copy path
"key": "shift+c",
"command": "copyFilePath",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // E: Open in File Explorer
"key": "shift+e",
"command": "revealFileInOS",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // E: Open in File Explorer (WSL)
"key": "shift+e",
"command": "remote-wsl.revealInExplorer",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus && remoteName == 'wsl'"
},
{ // O: Open with System App
"key": "shift+o",
"command": "openInExternalApp.open",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // Y: Copy Relative Path
"key": "shift+y",
"command": "copyRelativeFilePath",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // R: Copy Relative Path
"key": "shift+r",
"command": "workbench.files.action.refreshFilesExplorer",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // T: Open in terminal
"key": "shift+t",
"command": "openInIntegratedTerminal",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
// #endregion
{
"key": "ctrl+p",
"command": "workbench.action.files.openFileFolder",
"when": "isMacNative && openFolderWorkspaceSupport"
},
{
"key": "ctrl+o",
"command": "-workbench.action.files.openFileFolder",
"when": "isMacNative && openFolderWorkspaceSupport"
},
{
"key": "ctrl+p",
"command": "-extension.vim_ctrl+p",
"when": "editorTextFocus && vim.active && vim.use<C-p> && !inDebugRepl || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'SearchInProgressMode'"
},
{
"key": "ctrl+o",
"command": "-workbench.action.files.openFolderViaWorkspace",
"when": "!openFolderWorkspaceSupport && workbenchState == 'workspace'"
},
// #region Vim-like Hover Browsing
{
"key": "h",
"command": "editor.action.scrollLeftHover",
"when": "editorHoverFocused"
},
{
"key": "n",
"command": "editor.action.scrollDownHover",
"when": "editorHoverFocused"
},
{
"key": "e",
"command": "editor.action.scrollUpHover",
"when": "editorHoverFocused"
},
{
"key": "i",
"command": "editor.action.scrollRightHover",
"when": "editorHoverFocused"
},
// #endregion
// #region Vim-like Jupyter Navigation
{
"key": "n",
"command": "notebook.focusNextEditor",
"when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'none' && notebookEditorCursorAtBoundary != 'top'"
},
{
"key": "j",
"command": "-notebook.focusNextEditor",
"when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'none' && notebookEditorCursorAtBoundary != 'top'"
},
{
"key": "e",
"command": "notebook.focusPreviousEditor",
"when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'bottom' && notebookEditorCursorAtBoundary != 'none'"
},
{
"key": "k",
"command": "-notebook.focusPreviousEditor",
"when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'bottom' && notebookEditorCursorAtBoundary != 'none'"
},
// #endregion
{
"key": "ctrl+shift+g c",
"command": "-gitlens.showQuickCommitFileDetails",
"when": "editorTextFocus && !gitlens:disabled && config.gitlens.keymap == 'chorded'"
},
{
"key": "ctrl+shift+g s",
"command": "git.stageAll"
},
{
"key": "ctrl+shift+g g",
"command": "workbench.view.scm",
"when": "workbench.scm.active"
},
{
"key": "ctrl+shift+g",
"command": "-workbench.view.scm",
"when": "workbench.scm.active"
},
{
"key": "ctrl+k ctrl+shift+b",
"command": "editor.action.goToSelectionAnchor"
},
{
"key": "ctrl+k ctrl+shift+i",
"command": "workbench.action.selectProductIconTheme"
},
{
"key": "ctrl+l p",
"command": "-extension.openPrGitProvider"
},
{
"key": "ctrl+l g",
"command": "-extension.openInGitHub"
},
{
"key": "ctrl+l c",
"command": "-extension.copyGitHubLinkToClipboard"
},
// #region Use ^n ^e to navigate completions
{
"key": "ctrl+n",
"command": "workbench.action.files.newUntitledFile",
"when": "!suggestWidgetVisible && !inQuickOpen"
},
{
"key": "ctrl+n",
"command": "-workbench.action.files.newUntitledFile"
},
{
"key": "ctrl+n",
"command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion"
},
{
"key": "ctrl+e",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion"
},
// #endregion
// #region Terminal Control, use ^a as prefix / leader key
// tmux-like terminal control
{ // prefix + x : kill terminal
"key": "ctrl+a x",
"command": "workbench.action.terminal.kill",
"when": "terminalFocus"
},
{ // prefix + c : create new terminal
"key": "ctrl+a c",
"command": "workbench.action.terminal.new",
"when": "terminalFocus"
},
{ // prefix + | : split terminal vertically
"key": "ctrl+a shift+\\",
"command": "workbench.action.terminal.split",
"when": "terminalFocus"
},
{ // prefix + \ : split terminal vertically
"key": "ctrl+a \\",
"command": "workbench.action.terminal.split",
"when": "terminalFocus"
},
{ // prefix + / : search
"key": "ctrl+a /",
"command": "workbench.action.terminal.focusFind",
"when": "terminalFocus"
},
{ // prefix + t : toggle terminal
"key": "ctrl+a t",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminalFocus"
},
{ // prefix + ^a: show information
"key": "ctrl+a ctrl+a",
"command": "workbench.action.terminal.focusHover",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{
"key": "ctrl+k ctrl+i",
"command": "-workbench.action.terminal.focusHover",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{ // prefix + 1 : focus terminal 1
"key": "ctrl+a 1",
"command": "workbench.action.terminal.focusAtIndex1",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{ // prefix + 2 : focus terminal 2
"key": "ctrl+a 2",
"command": "workbench.action.terminal.focusAtIndex2",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{ // prefix + 3 : focus terminal 3
"key": "ctrl+a 3",
"command": "workbench.action.terminal.focusAtIndex3",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{ // prefix + g : Go to recent directory
"key": "ctrl+a g",
"command": "workbench.action.terminal.goToRecentDirectory",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+g",
"command": "-workbench.action.terminal.goToRecentDirectory",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{ // prefix + d : detach terminal
"key": "ctrl+a d",
"command": "workbench.action.terminal.detachSession",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{ // prefix + a : attach to session
"key": "ctrl+a a",
"command": "workbench.action.terminal.attachToSession",
"when": "terminalFocus"
},
{
"key": "ctrl+a h",
"command": "workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+a i",
"command": "workbench.action.terminal.focusNextPane",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+a shift+H",
"command": "workbench.action.terminal.resizePaneLeft",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+a shift+N",
"command": "workbench.action.terminal.resizePaneDown",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+a shift+E",
"command": "workbench.action.terminal.resizePaneUp",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+a shift+I",
"command": "workbench.action.terminal.resizePaneRight",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
}
]

View file

@ -30,9 +30,11 @@ noremap J E
noremap Y y$
" 分词版本的w和b支持中文需要插件
" 为了保证递归解析,而不是打断,使用 `nmap` 而不是 `nnoremap`
" 由于 VSCode Vim 的限制递归解析存在缺陷目前这种情况2w 符合预期,但 dw 不符合预期
" Comment if you don't use cjk or the plugin
noremap w cjkWordHandler.cursorWordEndRight
noremap b cjkWordHandler.cursorWordStartLeft
nmap w cjkWordHandler.cursorWordEndRight
nmap b cjkWordHandler.cursorWordStartLeft
" keep selection after indent (define in settings.json)
" voremap < <gv
@ -49,10 +51,13 @@ noremap gh editor.action.showDefinitionPreviewHover
noremap <leader><leader> workbench.action.quickOpen
noremap <leader>: workbench.action.showCommands
noremap <leader>E workbench.view.explorer
" <leader>q : +quit
noremap <leader>qq :quit<CR>
noremap <leader>qQ :qall<CR>
noremap <leader>Q :quit<CR>
" <leader>w : +write/window
noremap <leader>ww :write<CR>
noremap <leader>wa :wall<CR>
@ -66,6 +71,7 @@ noremap <leader>we workbench.action.focusAboveGroup
noremap <leader>wE workbench.action.splitEditorUp
noremap <leader>wi workbench.action.focusRightGroup
noremap <leader>wI workbench.action.splitEditorRight
" <leader>f : +find/file
noremap <leader>ff workbench.action.quickOpen
noremap <leader>fF workbench.view.search
@ -77,6 +83,7 @@ noremap <leader>fR workbench.action.openRecent
noremap <leader>fs workbench.action.search.toggleQueryDetails
noremap <leader>ft workbench.action.terminal.toggleTerminal
noremap <leader>fx workbench.view.extensions
" <leader>p : +project (requires Project Manager extension)
noremap <leader>pp projectManager.listProjects
noremap <leader>pP projectManager.listAnyProjects#sideBarAny
@ -87,12 +94,16 @@ noremap <leader>pF projectManager.filterProjectsByTag
noremap <leader>pg projectManager.listGitProjects#sideBarGit
noremap <leader>pr workbench.action.openRecent
noremap <leader>ps projectManager.saveProject
" <leader>g : +git
noremap <leader>gg workbench.view.scm
noremap <leader>gS git.stageAll
" <leader>j : +jump
noremap <leader>jj workbench.action.gotoLine
" <leader>l : +language (define in settings.json)
" <leader>u : +ui
noremap <leader>ui workbench.action.selectTheme
noremap <leader>uw editor.action.toggleWordWrap
@ -117,14 +128,18 @@ noremap <leader>tC testing.debugCurrentTest
noremap <leader>tx testing.cancelTestRun
" <leader>d : +debug
" <leader>h : +help
" <leader>c : +code
noremap <leader>cr coderunner.run
noremap <leader>cr code-runner.run
noremap <leader>cf editor.action.formatDocument
noremap <leader>c<leader> editor.action.trimTrailingWhitespace
noremap <leader>cs workbench.action.gotoSymbol
noremap <leader>cS workbench.action.showAllSymbols
" <leader>b : +buffer
noremap <leader>bb workbench.action.showAllEditors
noremap <leader>bd :bdelete<CR>
noremap <leader>bh :bprevious<CR>
noremap <leader>bi :bnext<CR>
" 中文分词测试用例

View file

@ -1,6 +1,6 @@
# $DOTFILES/tools/zsh/common.zshrc
# Date: 2024-11-30
# Author: contact@js0ny.net
# Author: js0ny
# This is the entry point for all zsh configuration files
# 这是所有zsh配置文件的入口点

View file

@ -1,6 +1,6 @@
# $DOTFILES/tools/zsh/global.zshenv
# Date: 2024-11-30
# Author: contact@js0ny.net
# Author: js0ny
# $DOTFILES/tools/zsh/global.zshenv
# system-wide zshenv file 系统级别的 zshenv 文件,用于设置全局环境变量

View file

@ -1,6 +1,6 @@
# $DOTFILES/tools/zsh/mod/alias.zsh
# Date: 2024-11-30
# Author: contact@js0ny.net
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
# PowerShell Equivalent, for cross-platform compatibility
@ -34,7 +34,7 @@ if command -v lsd > /dev/null; then
alias ls='lsd -A -I .DS_Store -I .git'
alias l='lsd -lah'
alias ll='lsd -l'
alias tree='lsd --tree -I .DS_Store -I .git'
alias tree='lsd --tree -I .DS_Store -I .git -A'
fi
# fzf - Fuzzy Finder
@ -92,3 +92,8 @@ if command -v brew > /dev/null; then
alias brewc="brew cleanup"
alias brewr="brew uninstall"
fi
alias -s {htm,html,css,scss,js,jsx,ts,tsx,json,jsonc}=code
alias -s {md,markdown}=code
alias -s {py,sh,rb,pl,php,java,c,cpp,h,hpp}=nvim
alias -s {cs,csx,fs,fsx,razor}=code

View file

@ -1,6 +1,6 @@
# $DOTFILES/tools/zsh/mod/config.zsh
# Date: 2024-11-30
# Author: contact@js0ny.net
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
# ZSH Config, no need to `export` these variables
@ -38,8 +38,8 @@ done
# Use `set -k` to mark leading `#` as a comment character
set -k
# TODO: Below should be reorganized
export PATH=$HOME/.local/bin:$PATH
# # TODO: Below should be reorganized
# export PATH=$HOME/.local/bin:$PATH
export NVM_DIR="$HOME/.config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# export NVM_DIR="$HOME/.config/nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

View file

@ -1,6 +1,6 @@
# $DOTFILES/tools/zsh/mod/env.zsh
# Date: 2024-11-30
# Author: contact@js0ny.net
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
# This file stores only environment variables that only called by

View file

@ -1,6 +1,6 @@
# $DOTFILES/tools/zsh/mod/keymap.zsh
# Date: 2024-11-30
# Author: contact@js0ny.net
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用

View file

@ -1,6 +1,6 @@
# $DOTFILES/tools/zsh/mod/navi.zsh
# Date: 2024-12-01
# Author: contact@js0ny.net
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
# Relative navigation #

View file

@ -1,6 +1,6 @@
# $DOTFILES/tools/zsh/mod/prompt.zsh
# Date: 2024-11-30
# Author: contact@js0ny.net
# Author: js0ny
# Sourced by user's zshrc 在用户的 zshrc 中被引用
export STARSHIP_CONFIG=$DOTFILES/tools/starship/starship_zsh.toml

View file

@ -1,13 +1,13 @@
# $DOTFILES/tools/zsh/zshenv
# Date: 2024-11-30
# Author: contact@js0ny.net
# 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
# 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