mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
Merge remote-tracking branch 'refs/remotes/origin/master'
This commit is contained in:
commit
ab1e2abb74
17 changed files with 378 additions and 88 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -39,3 +39,5 @@ lazy-lock.json
|
||||||
|
|
||||||
# Emacs
|
# Emacs
|
||||||
*.elc
|
*.elc
|
||||||
|
|
||||||
|
common/**/*current*
|
||||||
84
Justfile
84
Justfile
|
|
@ -1,26 +1,76 @@
|
||||||
set shell := ["fish", "-c"]
|
set shell := ["fish", "-c"]
|
||||||
set windows-shell := ["pwsh", "-c"]
|
set windows-shell := ["pwsh", "-c"]
|
||||||
|
|
||||||
check_info:
|
DOTFILES := join(home_directory(), ".dotfiles")
|
||||||
shellcheck -x -s sh **/*.sh platforms/mac/yabairc
|
XDG_CONFIG_HOME := \
|
||||||
shellcheck -x -s bash **/*.bash tools/bash/* scripts/*.{sh,zsh,bash} **/*.bashrc
|
if env_var("XDG_CONFIG_HOME") != "" {env_var("XDG_CONFIG_HOME")} \
|
||||||
check:
|
else {
|
||||||
shellcheck -x -s sh --severity=error **/*.sh platforms/mac/yabairc
|
if os_family() == "windows" {
|
||||||
shellcheck -x -s bash --severity=error **/*.bash tools/bash/* **/*.bashrc
|
env_var("APPDATA")
|
||||||
format:
|
} else {
|
||||||
shfmt -w -i 2 -ci -bn -p **/*.sh
|
join(home_directory(), ".config")
|
||||||
shfmt -w -i 2 -ci -bn -ln bash **/*.bash platforms/mac/sketchybar/sketchybarrc
|
}
|
||||||
# Ignore syntax errors in zsh files
|
}
|
||||||
shfmt -w -i 2 -ci -bn -ln bash **/*.zsh tools/zsh/**/* **/zshrc || true
|
|
||||||
pull:
|
|
||||||
git pull github master
|
|
||||||
git pull codeberg master
|
|
||||||
|
|
||||||
push:
|
XDG_DATA_HOME := \
|
||||||
git push github master
|
if env_var("XDG_DATA_HOME") != "" {env_var("XDG_DATA_HOME")} \
|
||||||
git push codeberg master
|
else {
|
||||||
|
if os_family() == "windows" {
|
||||||
|
env_var("LOCALAPPDATA")
|
||||||
|
} else {
|
||||||
|
join(home_directory(), ".local/share")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
test:
|
||||||
|
echo {{DOTFILES}}
|
||||||
|
echo {{XDG_CONFIG_HOME}}
|
||||||
|
echo {{XDG_DATA_HOME}}
|
||||||
|
|
||||||
init:
|
init:
|
||||||
git remote remove origin
|
git remote remove origin
|
||||||
git remote add github git@github.com:js0ny/dotfiles.git
|
git remote add github git@github.com:js0ny/dotfiles.git
|
||||||
git remote add codeberg git@codeberg.org:js0ny/dotfiles.git
|
git remote add codeberg git@codeberg.org:js0ny/dotfiles.git
|
||||||
|
|
||||||
|
check:
|
||||||
|
@just check_shell
|
||||||
|
format:
|
||||||
|
@just format_shell
|
||||||
|
|
||||||
|
|
||||||
|
push:
|
||||||
|
git push github master
|
||||||
|
git push codeberg master
|
||||||
|
|
||||||
|
setup:
|
||||||
|
@just ideavim
|
||||||
|
|
||||||
|
ideavim:
|
||||||
|
ln -sf {{DOTFILES}}/common/ideavimrc $XDG_CONFIG_HOME/ideavim/ideavimrc
|
||||||
|
git clone https://github.com/MarcoIeni/intellimacs {{join(home_directory(), ".local/share/intellimacs")}}
|
||||||
|
|
||||||
|
[private]
|
||||||
|
pull:
|
||||||
|
git pull github master
|
||||||
|
git pull codeberg master
|
||||||
|
|
||||||
|
|
||||||
|
[private]
|
||||||
|
[unix]
|
||||||
|
check_shell:
|
||||||
|
shellcheck -x -s sh --severity=error **/*.sh platforms/mac/yabairc
|
||||||
|
shellcheck -x -s bash --severity=error **/*.bash tools/bash/* **/*.bashrc
|
||||||
|
|
||||||
|
[private]
|
||||||
|
[unix]
|
||||||
|
format_shell:
|
||||||
|
shfmt -w -i 2 -ci -bn -p **/*.sh
|
||||||
|
shfmt -w -i 2 -ci -bn -ln bash **/*.bash platforms/mac/sketchybar/sketchybarrc
|
||||||
|
# Ignore syntax errors in zsh files
|
||||||
|
shfmt -w -i 2 -ci -bn -ln bash **/*.zsh tools/zsh/**/* **/zshrc || true
|
||||||
|
|
||||||
|
[private]
|
||||||
|
check_info:
|
||||||
|
shellcheck -x -s sh **/*.sh platforms/mac/yabairc
|
||||||
|
shellcheck -x -s bash **/*.bash tools/bash/* scripts/*.{sh,zsh,bash} **/*.bashrc
|
||||||
|
|
@ -7,7 +7,16 @@
|
||||||
" Linking:
|
" Linking:
|
||||||
" ln -sf $DOTFILES/common/ideavimrc $XDG_CONFIG_HOME/ideavim/ideavimrc
|
" ln -sf $DOTFILES/common/ideavimrc $XDG_CONFIG_HOME/ideavim/ideavimrc
|
||||||
|
|
||||||
""" Basic Configs """
|
source ~/.local/share/intellimacs/spacemacs.vim
|
||||||
|
|
||||||
|
source ~/.local/share/intellimacs/extra.vim
|
||||||
|
source ~/.local/share/intellimacs/major.vim
|
||||||
|
source ~/.local/share/intellimacs/hybrid.vim
|
||||||
|
|
||||||
|
source ~/.local/share/intellimacs/which-key.vim
|
||||||
|
|
||||||
|
|
||||||
|
" """ Basic Configs """
|
||||||
let mapleader = " " " set <leader> to <space>
|
let mapleader = " " " set <leader> to <space>
|
||||||
|
|
||||||
""" Colemak """
|
""" Colemak """
|
||||||
|
|
@ -25,6 +34,19 @@ noremap K N
|
||||||
noremap j e
|
noremap j e
|
||||||
noremap J E
|
noremap J E
|
||||||
|
|
||||||
|
nnoremap H :bp<CR>
|
||||||
|
nnoremap I :bn<CR>
|
||||||
|
noremap N 5j
|
||||||
|
noremap E 5k
|
||||||
|
vnoremap H ^
|
||||||
|
xnoremap H ^
|
||||||
|
onoremap H ^
|
||||||
|
vnoremap I $
|
||||||
|
xnoremap I $
|
||||||
|
onoremap I $
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" Y to yank to end of line
|
" Y to yank to end of line
|
||||||
noremap Y y$
|
noremap Y y$
|
||||||
|
|
||||||
|
|
@ -95,7 +117,7 @@ nnoremap gr :action ShowUsages<CR>
|
||||||
nnoremap gi :action GotoImplementation<CR>
|
nnoremap gi :action GotoImplementation<CR>
|
||||||
nnoremap gpi :action QuickImplementations<CR>
|
nnoremap gpi :action QuickImplementations<CR>
|
||||||
nnoremap gs :action GotoSuperMethod<CR>
|
nnoremap gs :action GotoSuperMethod<CR>
|
||||||
nnoremap ga :action
|
nnoremap ga :action ShowIntentionActions<CR>
|
||||||
nnoremap gq :action ShowIntentionActions<CR>
|
nnoremap gq :action ShowIntentionActions<CR>
|
||||||
nnoremap ge :action GotoNextError<CR>
|
nnoremap ge :action GotoNextError<CR>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
# $DOTFILES/common/starship.toml
|
# $DOTFILES/common/starship.toml
|
||||||
|
# vim:foldmethod=marker
|
||||||
# Date: 2025-01-26
|
# Date: 2025-01-26
|
||||||
# Description: Use one starship config for all shells
|
# Description: Use one starship config for all shells
|
||||||
|
|
||||||
|
|
@ -8,10 +9,11 @@
|
||||||
# Modified from the Powerline Preset
|
# Modified from the Powerline Preset
|
||||||
|
|
||||||
"$schema" = 'https://starship.rs/config-schema.json'
|
"$schema" = 'https://starship.rs/config-schema.json'
|
||||||
palette = "catppuccin_mocha"
|
|
||||||
|
|
||||||
# {{{ format
|
# {{{ format
|
||||||
format = """
|
format = """
|
||||||
|
$sudo\
|
||||||
$jobs\
|
$jobs\
|
||||||
$os\
|
$os\
|
||||||
$time\
|
$time\
|
||||||
|
|
@ -24,6 +26,7 @@ $git_branch\
|
||||||
$git_status\
|
$git_status\
|
||||||
[](fg:#FCA17D bg:#86BBD8)\
|
[](fg:#FCA17D bg:#86BBD8)\
|
||||||
$custom\
|
$custom\
|
||||||
|
$bun\
|
||||||
$c\
|
$c\
|
||||||
$cmake\
|
$cmake\
|
||||||
$cobol\
|
$cobol\
|
||||||
|
|
@ -76,7 +79,7 @@ $shell\
|
||||||
"""
|
"""
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# {{{ TODO
|
# {{{ TODO:
|
||||||
#
|
#
|
||||||
# $buf\
|
# $buf\
|
||||||
# $nix_shell\
|
# $nix_shell\
|
||||||
|
|
@ -92,7 +95,6 @@ $shell\
|
||||||
# $direnv\
|
# $direnv\
|
||||||
# $env_var\
|
# $env_var\
|
||||||
# $crystal\
|
# $crystal\
|
||||||
# $custom\
|
|
||||||
# $sudo\
|
# $sudo\
|
||||||
# $cmd_duration\
|
# $cmd_duration\
|
||||||
# $line_break\
|
# $line_break\
|
||||||
|
|
@ -231,6 +233,39 @@ format = '[$all_status$ahead_behind ]($style)'
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# {{{ Part 4
|
# {{{ Part 4
|
||||||
|
|
||||||
|
|
||||||
|
[custom.just]
|
||||||
|
detect_files = ["Justfile", "justfile", ".Justfile", ".justfile"]
|
||||||
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
|
format = "[ Just ]($style)"
|
||||||
|
|
||||||
|
[custom.dotenv]
|
||||||
|
detect_files = [
|
||||||
|
".env",
|
||||||
|
".env.local",
|
||||||
|
".env.development",
|
||||||
|
".env.test",
|
||||||
|
".env.production",
|
||||||
|
".env.staging",
|
||||||
|
]
|
||||||
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
|
format = "[ ]($style)"
|
||||||
|
[custom.tex]
|
||||||
|
detect_extensions = ["tex", "bib"]
|
||||||
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
|
format = "[ ]($style)"
|
||||||
|
[custom.readme]
|
||||||
|
detect_files = [
|
||||||
|
"README.md",
|
||||||
|
"readme.md",
|
||||||
|
"README",
|
||||||
|
"readme",
|
||||||
|
"README.org",
|
||||||
|
"readme.org",
|
||||||
|
]
|
||||||
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
|
format = "[ ]($style)"
|
||||||
[c]
|
[c]
|
||||||
symbol = " "
|
symbol = " "
|
||||||
style = "bg:#86BBD8 fg:#794427"
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
|
|
@ -335,6 +370,30 @@ symbol = " "
|
||||||
style = "bg:#86BBD8 fg:#794427"
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
format = '[ $symbol ($version) ]($style)'
|
format = '[ $symbol ($version) ]($style)'
|
||||||
|
|
||||||
|
[ruby]
|
||||||
|
symbol = " "
|
||||||
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
|
format = '[ $symbol ($version) ]($style)'
|
||||||
|
|
||||||
|
[bun]
|
||||||
|
symbol = " "
|
||||||
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
|
format = '[ $symbol ($version) ]($style)'
|
||||||
|
|
||||||
|
[typst]
|
||||||
|
symbol = " "
|
||||||
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
|
format = '[ $symbol ($version) ]($style)'
|
||||||
|
|
||||||
|
[zig]
|
||||||
|
symbol = "↯ "
|
||||||
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
|
format = '[ $symbol ($version) ]($style)'
|
||||||
|
|
||||||
|
[kotlin]
|
||||||
|
symbol = " "
|
||||||
|
style = "bg:#86BBD8 fg:#794427"
|
||||||
|
format = '[ $symbol ($version) ]($style)'
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
@ -394,8 +453,3 @@ mantle = "#181825"
|
||||||
crust = "#11111b"
|
crust = "#11111b"
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
[custom.just]
|
|
||||||
detect_files = ["Justfile", "justfile", ".Justfile", ".justfile"]
|
|
||||||
style = "bg:#86BBD8 fg:#794427"
|
|
||||||
format = "[Just]($style)"
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,14 @@ endif
|
||||||
noremap n j
|
noremap n j
|
||||||
noremap e k
|
noremap e k
|
||||||
noremap i l
|
noremap i l
|
||||||
noremap N J
|
nnoremap N 5j
|
||||||
noremap E K
|
nnoremap E 5k
|
||||||
|
vnoremap H ^
|
||||||
|
xnoremap H ^
|
||||||
|
onoremap H ^
|
||||||
|
vnoremap I $
|
||||||
|
xnoremap I $
|
||||||
|
onoremap I $
|
||||||
noremap I L
|
noremap I L
|
||||||
|
|
||||||
" Similar position to i
|
" Similar position to i
|
||||||
|
|
|
||||||
10
common/vimrc
10
common/vimrc
|
|
@ -8,8 +8,14 @@
|
||||||
noremap n j
|
noremap n j
|
||||||
noremap e k
|
noremap e k
|
||||||
noremap i l
|
noremap i l
|
||||||
noremap N J
|
nnoremap N 5j
|
||||||
noremap E K
|
nnoremap E 5k
|
||||||
|
vnoremap H ^
|
||||||
|
xnoremap H ^
|
||||||
|
onoremap H ^
|
||||||
|
vnoremap I $
|
||||||
|
xnoremap I $
|
||||||
|
onoremap I $
|
||||||
noremap I L
|
noremap I L
|
||||||
|
|
||||||
" Similar position to i
|
" Similar position to i
|
||||||
|
|
|
||||||
|
|
@ -84,4 +84,6 @@ function Show-WindowsNotification {
|
||||||
$notifyIcon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon((Get-Command pwsh).Source)
|
$notifyIcon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon((Get-Command pwsh).Source)
|
||||||
$notifyIcon.Visible = $true
|
$notifyIcon.Visible = $true
|
||||||
$notifyIcon.ShowBalloonTip(0,$Title,$Message,[System.Windows.Forms.ToolTipIcon]::Info)
|
$notifyIcon.ShowBalloonTip(0,$Title,$Message,[System.Windows.Forms.ToolTipIcon]::Info)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Import-Module "$($(Get-Item $(Get-Command scoop.ps1).Path).Directory.Parent.FullName)\modules\scoop-completion"
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,9 @@ window_rules:
|
||||||
window_title: { regex: ".*? - Peek" }
|
window_title: { regex: ".*? - Peek" }
|
||||||
- window_process: { equals: "Lively" }
|
- window_process: { equals: "Lively" }
|
||||||
window_class: { regex: "HwndWrapper" }
|
window_class: { regex: "HwndWrapper" }
|
||||||
|
# Ignore Quake-style consoles.
|
||||||
- window_process: { equals: "WindowsTerminal" }
|
- window_process: { equals: "WindowsTerminal" }
|
||||||
|
window_class: { equals: "CASCADIA_HOSTING_WINDOW_CLASS" }
|
||||||
- commands: ["set-floating"]
|
- commands: ["set-floating"]
|
||||||
match:
|
match:
|
||||||
# Razer Synapse
|
# Razer Synapse
|
||||||
|
|
@ -155,7 +157,25 @@ window_rules:
|
||||||
- window_process: { equals: "AutoHotkeyUX" }
|
- window_process: { equals: "AutoHotkeyUX" }
|
||||||
- window_process: { equals: "ApplicationFrameHost" }
|
- window_process: { equals: "ApplicationFrameHost" }
|
||||||
window_title: { regex: "Settings|设置" }
|
window_title: { regex: "Settings|设置" }
|
||||||
|
- window_process: { equals: "QQ" }
|
||||||
|
window_title: { equals: "图片查看器" }
|
||||||
|
# 微信图片视图
|
||||||
|
- window_process: { equals: "WeChat" }
|
||||||
|
window_class: { equals: "ImagePreviewWnd" }
|
||||||
|
# 微信朋友圈视图
|
||||||
|
- window_process: { equals: "WeChat" }
|
||||||
|
window_class: { equals: "SnsWnd" }
|
||||||
|
- window_process: { equals: "setup" }
|
||||||
|
window_title: { equals: "Visual Studio Installer" }
|
||||||
|
# JetBrains IDEs Floating Dialogs
|
||||||
|
- window_class: { equals: "SunAwtDialog" }
|
||||||
|
window_process:
|
||||||
|
{ regex: "rider64|idea64|goland64|rustrover64|clion64|pycharm64" }
|
||||||
|
## Browser
|
||||||
|
- window_process: { equals: "vivaldi" }
|
||||||
|
window_title: { regex: "^Vivaldi 设置.*$" }
|
||||||
|
- window_process: { equals: "vivaldi" }
|
||||||
|
window_title: { regex: "^Bitwarden - Vivaldi$" }
|
||||||
binding_modes:
|
binding_modes:
|
||||||
# When enabled, the focused window can be resized via arrow keys or HJKL.
|
# When enabled, the focused window can be resized via arrow keys or HJKL.
|
||||||
- name: "resize"
|
- name: "resize"
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,14 @@
|
||||||
noremap n j
|
noremap n j
|
||||||
noremap e k
|
noremap e k
|
||||||
noremap i l
|
noremap i l
|
||||||
noremap H 0
|
nnoremap N 5j
|
||||||
noremap N 5j
|
nnoremap E 5k
|
||||||
noremap E 5k
|
vnoremap H ^
|
||||||
noremap I $
|
xnoremap H ^
|
||||||
|
onoremap H ^
|
||||||
|
vnoremap I $
|
||||||
|
xnoremap I $
|
||||||
|
onoremap I $
|
||||||
|
|
||||||
" Similar position to i
|
" Similar position to i
|
||||||
noremap l i
|
noremap l i
|
||||||
|
|
|
||||||
|
|
@ -13,29 +13,7 @@
|
||||||
|
|
||||||
fish_vi_key_bindings
|
fish_vi_key_bindings
|
||||||
|
|
||||||
# Colemak hnei
|
source $DOTFILES/tools/fish/conf.d/keymap/+colemak.fish
|
||||||
# ^
|
|
||||||
# e
|
|
||||||
# < h i >
|
|
||||||
# n
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# Ne{[k]s}t -> fish doesnt have this feature
|
|
||||||
|
|
||||||
# [J]ump
|
|
||||||
bind -M default j forward-word
|
|
||||||
bind -M default J forward-bigword
|
|
||||||
|
|
||||||
# Use N to Join
|
|
||||||
bind -M default N end-of-line delete-char
|
|
||||||
|
|
||||||
# Emacs Hybrid
|
# Emacs Hybrid
|
||||||
bind -M default ctrl-p up-or-search
|
bind -M default ctrl-p up-or-search
|
||||||
|
|
|
||||||
23
tools/fish/conf.d/keymap/+colemak.fish
Normal file
23
tools/fish/conf.d/keymap/+colemak.fish
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# Colemak hnei
|
||||||
|
# ^
|
||||||
|
# e
|
||||||
|
# < h i >
|
||||||
|
# n
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Ne{[k]s}t -> fish doesnt have this feature
|
||||||
|
|
||||||
|
# [J]ump
|
||||||
|
bind -M default j forward-word
|
||||||
|
bind -M default J forward-bigword
|
||||||
|
|
||||||
|
# Use N to Join
|
||||||
|
bind -M default N end-of-line delete-char
|
||||||
|
|
@ -54,12 +54,15 @@ local keymaps_basic = { -- Modification of Original Keymap - Colemak
|
||||||
|
|
||||||
{ mode = mode_arrow, keys = "h", cmd = "h", opts = { desc = "Left", silent = true } },
|
{ mode = mode_arrow, keys = "h", cmd = "h", opts = { desc = "Left", silent = true } },
|
||||||
{ mode = mode_arrow, keys = "i", cmd = "l", opts = { desc = "Right", silent = true } },
|
{ mode = mode_arrow, keys = "i", cmd = "l", opts = { desc = "Right", silent = true } },
|
||||||
{ keys = "H", cmd = ":bprevious<CR>", opts = { desc = "Previous Buffer" } },
|
{ mode = {"n"}, keys = "H", cmd = "<cmd>bprevious<CR>", opts = { desc = "Previous Buffer" } },
|
||||||
{ keys = "I", cmd = ":bnext<CR>", opts = { desc = "Next Buffer" } },
|
{ mode = {"n"}, keys = "I", cmd = "<cmd>bnext<CR>", opts = { desc = "Next Buffer" } },
|
||||||
|
{ mode = {"v", "o", "x"}, keys = "H", cmd = "^", opts = { desc = "Start of Line" } },
|
||||||
|
{ mode = {"v", "o", "x"}, keys = "I", cmd = "$", opts = { desc = "End of Line" } },
|
||||||
{ mode = mode_arrow, keys = "N", cmd = "5j", opts = { desc = "Up 5 Lines" } },
|
{ mode = mode_arrow, keys = "N", cmd = "5j", opts = { desc = "Up 5 Lines" } },
|
||||||
{ mode = mode_arrow, keys = "E", cmd = "5e", opts = { desc = "Down 5 Lines" } },
|
{ mode = mode_arrow, keys = "E", cmd = "5e", opts = { desc = "Down 5 Lines" } },
|
||||||
{ keys = "Y", cmd = "y$", opts = { desc = "Yank to End of Line" } },
|
{ keys = "Y", cmd = "y$", opts = { desc = "Yank to End of Line" } },
|
||||||
{ keys = "E", cmd = "5k" },
|
{ mode = mode_arrow, keys = "N", cmd = "5j" },
|
||||||
|
{ mode = mode_arrow, keys = "E", cmd = "5k" },
|
||||||
{ mode = { "n", "o", "x" }, keys = "l", cmd = "i", opts = { desc = "Insert" } },
|
{ mode = { "n", "o", "x" }, keys = "l", cmd = "i", opts = { desc = "Insert" } },
|
||||||
{ keys = "L", cmd = "I", opts = { desc = "Insert at Start of Line" } },
|
{ keys = "L", cmd = "I", opts = { desc = "Insert at Start of Line" } },
|
||||||
{ mode = mode_arrow, keys = "k", cmd = "n", opts = { desc = "Next Search" } },
|
{ mode = mode_arrow, keys = "k", cmd = "n", opts = { desc = "Next Search" } },
|
||||||
|
|
|
||||||
34
tools/obsidian/.markdownlint.jsonc
Normal file
34
tools/obsidian/.markdownlint.jsonc
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"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
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
@ -9,21 +9,6 @@ Set-PSReadLineOption -PredictionViewStyle InlineView
|
||||||
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
|
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
|
||||||
# Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > " # Use Starship instead
|
# Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > " # Use Starship instead
|
||||||
# PSReadLineKeyHandlers
|
# PSReadLineKeyHandlers
|
||||||
## Colemak hnei
|
|
||||||
Set-PSReadLineKeyHandler -Chord "n" -Function NextHistory -ViMode Command
|
|
||||||
Set-PSReadLineKeyHandler -Chord "e" -Function PreviousHistory -ViMode Command
|
|
||||||
Set-PSReadLineKeyHandler -Chord "i" -Function ViForwardChar -ViMode Command
|
|
||||||
## Similar position to [i] in QWERTY
|
|
||||||
Set-PSReadLineKeyHandler -Chord "l" -Function ViInsertMode -ViMode Command
|
|
||||||
Set-PSReadlineKeyHandler -Chord "L" -Function ViInsertAtBegining -ViMode Command
|
|
||||||
## Ne{[k]s}t
|
|
||||||
Set-PSReadLineKeyHandler -Chord "k" -Function RepeatSearch -ViMode Command
|
|
||||||
Set-PSReadLineKeyHandler -Chord "K" -Function RepeatSearchBackward -ViMode Command
|
|
||||||
## [j]ump
|
|
||||||
Set-PSReadLineKeyHandler -Chord "j" -Function NextWordEnd -ViMode Command
|
|
||||||
Set-PSReadLineKeyHandler -Chord "J" -Function ViEndOfGlob -ViMode Command
|
|
||||||
## Use N to Join
|
|
||||||
Set-PSReadLineKeyHandler -Chord "N" -Function ViJoinLines -ViMode Command
|
|
||||||
Set-PSReadLineKeyHandler -Chord "Control+Oem4" -Function ViCommandMode -ViMode Insert # ^[ to Escape
|
Set-PSReadLineKeyHandler -Chord "Control+Oem4" -Function ViCommandMode -ViMode Insert # ^[ to Escape
|
||||||
Set-PSReadLineKeyHandler -Chord "Ctrl+a" -Function BeginningOfLine
|
Set-PSReadLineKeyHandler -Chord "Ctrl+a" -Function BeginningOfLine
|
||||||
Set-PSReadLineKeyHandler -Chord "Ctrl+e" -Function EndOfLine
|
Set-PSReadLineKeyHandler -Chord "Ctrl+e" -Function EndOfLine
|
||||||
|
|
@ -38,5 +23,9 @@ Set-PSReadLineKeyHandler -Chord "Alt+Backspace" -Function BackwardKillLine
|
||||||
Set-PSReadLineKeyHandler -Chord "Ctrl+Delete" -Function KillWord
|
Set-PSReadLineKeyHandler -Chord "Ctrl+Delete" -Function KillWord
|
||||||
Set-PSReadLineKeyHandler -Chord "Ctrl+Shift+Delete" -Function KillLine
|
Set-PSReadLineKeyHandler -Chord "Ctrl+Shift+Delete" -Function KillLine
|
||||||
Set-PSReadLineKeyHandler -Chord "Alt+Delete" -Function KillLine
|
Set-PSReadLineKeyHandler -Chord "Alt+Delete" -Function KillLine
|
||||||
|
Set-PSReadLineKeyHandler -Chord "Ctrl+c" -Function CopyOrCancelLine -ViMode Insert
|
||||||
|
Set-PSReadLineKeyHandler -Chord "Ctrl+c" -Function CopyOrCancelLine -ViMode Command
|
||||||
## Use <Tab> to Invoke MenuComplete
|
## Use <Tab> to Invoke MenuComplete
|
||||||
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
|
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
|
||||||
|
|
||||||
|
. $(Join-Path $DOTFILES "tools" "powershell" "Keymap" "Colemak.ps1")
|
||||||
15
tools/powershell/Keymap/Colemak.ps1
Normal file
15
tools/powershell/Keymap/Colemak.ps1
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
## Colemak hnei
|
||||||
|
Set-PSReadLineKeyHandler -Chord "n" -Function NextHistory -ViMode Command
|
||||||
|
Set-PSReadLineKeyHandler -Chord "e" -Function PreviousHistory -ViMode Command
|
||||||
|
Set-PSReadLineKeyHandler -Chord "i" -Function ViForwardChar -ViMode Command
|
||||||
|
## Similar position to [i] in QWERTY
|
||||||
|
Set-PSReadLineKeyHandler -Chord "l" -Function ViInsertMode -ViMode Command
|
||||||
|
Set-PSReadlineKeyHandler -Chord "L" -Function ViInsertAtBegining -ViMode Command
|
||||||
|
## Ne{[k]s}t
|
||||||
|
Set-PSReadLineKeyHandler -Chord "k" -Function RepeatSearch -ViMode Command
|
||||||
|
Set-PSReadLineKeyHandler -Chord "K" -Function RepeatSearchBackward -ViMode Command
|
||||||
|
## [j]ump
|
||||||
|
Set-PSReadLineKeyHandler -Chord "j" -Function NextWordEnd -ViMode Command
|
||||||
|
Set-PSReadLineKeyHandler -Chord "J" -Function ViEndOfGlob -ViMode Command
|
||||||
|
## Use N to Join
|
||||||
|
Set-PSReadLineKeyHandler -Chord "N" -Function ViJoinLines -ViMode Command
|
||||||
|
|
@ -3,7 +3,81 @@
|
||||||
# Author: js0ny
|
# Author: js0ny
|
||||||
# Use starship to set prompt
|
# Use starship to set prompt
|
||||||
|
|
||||||
Invoke-Expression (&starship init powershell)
|
# Invoke-Expression (&starship init powershell)
|
||||||
|
|
||||||
|
|
||||||
|
function formatFG {
|
||||||
|
param(
|
||||||
|
[string]$RGB
|
||||||
|
)
|
||||||
|
if ($RGB -eq "-1") {
|
||||||
|
return "`e[39m"
|
||||||
|
}
|
||||||
|
$R = $RGB.Substring(0, 2)
|
||||||
|
$G = $RGB.Substring(2, 2)
|
||||||
|
$B = $RGB.Substring(4, 2)
|
||||||
|
# Convert hex to RGB
|
||||||
|
$R = [int]::Parse($R, [System.Globalization.NumberStyles]::HexNumber)
|
||||||
|
$G = [int]::Parse($G, [System.Globalization.NumberStyles]::HexNumber)
|
||||||
|
$B = [int]::Parse($B, [System.Globalization.NumberStyles]::HexNumber)
|
||||||
|
return "`e[38;2;$R;$G;${B}m"
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatBG {
|
||||||
|
param(
|
||||||
|
[string]$RGB
|
||||||
|
)
|
||||||
|
if ($RGB -eq "-1") {
|
||||||
|
return "`e[49m"
|
||||||
|
}
|
||||||
|
$R = $RGB.Substring(0, 2)
|
||||||
|
$G = $RGB.Substring(2, 2)
|
||||||
|
$B = $RGB.Substring(4, 2)
|
||||||
|
# Convert hex to RGB
|
||||||
|
$R = [int]::Parse($R, [System.Globalization.NumberStyles]::HexNumber)
|
||||||
|
$G = [int]::Parse($G, [System.Globalization.NumberStyles]::HexNumber)
|
||||||
|
$B = [int]::Parse($B, [System.Globalization.NumberStyles]::HexNumber)
|
||||||
|
return "`e[48;2;$R;$G;${B}m"
|
||||||
|
}
|
||||||
|
function formatPowerlineText {
|
||||||
|
param(
|
||||||
|
[string]$FG,
|
||||||
|
[string]$BG,
|
||||||
|
[string]$PLBG,
|
||||||
|
[string]$Text
|
||||||
|
)
|
||||||
|
$ResumeSequece = "`e[0m"
|
||||||
|
$TextFG = formatFG -RGB $FG
|
||||||
|
$TextBG = formatBG -RGB $BG
|
||||||
|
$PLFG = formatFG -RGB $BG
|
||||||
|
$PLBG = formatBG -RGB $PLBG
|
||||||
|
return "$TextFG$TextBG $Text $PLFG$PLBG$ResumeSequece"
|
||||||
|
}
|
||||||
|
|
||||||
|
function prompt {
|
||||||
|
if ($pwd.Path -eq $HOME) {
|
||||||
|
$cwd = "~"
|
||||||
|
} else {
|
||||||
|
$cwd = $pwd.ProviderPath
|
||||||
|
}
|
||||||
|
$time = Get-Date -Format "HH:mm"
|
||||||
|
$ResumeSequece = "`e[0m"
|
||||||
|
$FG0 = "FFFFFF"
|
||||||
|
$BG0 = "9A348E"
|
||||||
|
$BG1 = "DA627D"
|
||||||
|
$BG2 = "FCA17D"
|
||||||
|
$FG1 = "035E82"
|
||||||
|
$time = formatPowerlineText $FG0 $BG0 $BG1 $time
|
||||||
|
$cwd = formatPowerlineText $FG0 $BG1 $BG2 $cwd
|
||||||
|
$ps = formatPowerlineText $FG1 $BG2 "-1" "PS"
|
||||||
|
|
||||||
|
"$time$cwd$ps$ResumeSequece "
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function Invoke-Starship {
|
||||||
|
Invoke-Expression (&starship init powershell)
|
||||||
|
}
|
||||||
|
|
||||||
Import-Module Catppuccin
|
Import-Module Catppuccin
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,15 @@ noremap e k
|
||||||
noremap i l
|
noremap i l
|
||||||
|
|
||||||
" Switch between tabs
|
" Switch between tabs
|
||||||
noremap H :bprevious<CR>
|
nnoremap H :bprevious<CR>
|
||||||
noremap I :bnext<CR>
|
nnoremap I :bnext<CR>
|
||||||
|
vnoremap H ^
|
||||||
|
xnoremap H ^
|
||||||
|
onoremap H ^
|
||||||
|
vnoremap I $
|
||||||
|
xnoremap I $
|
||||||
|
onoremap I $
|
||||||
|
|
||||||
|
|
||||||
noremap N 5j
|
noremap N 5j
|
||||||
noremap E 5k
|
noremap E 5k
|
||||||
|
|
@ -68,10 +75,11 @@ vnoremap > editor.action.indentLines
|
||||||
nmap w cjkWordHandler.cursorWordEndRight
|
nmap w cjkWordHandler.cursorWordEndRight
|
||||||
nmap b cjkWordHandler.cursorWordStartLeft
|
nmap b cjkWordHandler.cursorWordStartLeft
|
||||||
|
|
||||||
noremap <C-w>n <C-w>j
|
" <C-w> will be parsed by VSCode itself.
|
||||||
noremap <C-w>e <C-w>k
|
" noremap <C-w>n <C-w>j
|
||||||
noremap <C-w>i <C-w>l
|
" noremap <C-w>e <C-w>k
|
||||||
noremap <C-w>x workbench.action.toggleEditorGroupLayout
|
" noremap <C-w>i <C-w>l
|
||||||
" Use C-w C-w as original C-w
|
" noremap <C-w>x workbench.action.toggleEditorGroupLayout
|
||||||
noremap <C-w><C-w> workbench.action.closeActiveEditor
|
" " Use C-w C-w as original C-w
|
||||||
noremap <C-w><A-n> workbench.action.togglePanel
|
" noremap <C-w><C-w> workbench.action.closeActiveEditor
|
||||||
|
" noremap <C-w><A-n> workbench.action.togglePanel
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue