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

This commit is contained in:
whoami 2025-03-20 20:16:35 +00:00
commit ab1e2abb74
17 changed files with 378 additions and 88 deletions

View file

@ -13,29 +13,7 @@
fish_vi_key_bindings
# 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
source $DOTFILES/tools/fish/conf.d/keymap/+colemak.fish
# Emacs Hybrid
bind -M default ctrl-p up-or-search

View 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

View file

@ -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 = "i", cmd = "l", opts = { desc = "Right", silent = true } },
{ keys = "H", cmd = ":bprevious<CR>", opts = { desc = "Previous Buffer" } },
{ keys = "I", cmd = ":bnext<CR>", opts = { desc = "Next Buffer" } },
{ mode = {"n"}, keys = "H", cmd = "<cmd>bprevious<CR>", opts = { desc = "Previous 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 = "E", cmd = "5e", opts = { desc = "Down 5 Lines" } },
{ 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" } },
{ keys = "L", cmd = "I", opts = { desc = "Insert at Start of Line" } },
{ mode = mode_arrow, keys = "k", cmd = "n", opts = { desc = "Next Search" } },

View 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
// }
}

View file

@ -9,21 +9,6 @@ Set-PSReadLineOption -PredictionViewStyle InlineView
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
# Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > " # Use Starship instead
# 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 "Ctrl+a" -Function BeginningOfLine
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+Shift+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
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
. $(Join-Path $DOTFILES "tools" "powershell" "Keymap" "Colemak.ps1")

View 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

View file

@ -3,7 +3,81 @@
# Author: js0ny
# 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

View file

@ -17,8 +17,15 @@ noremap e k
noremap i l
" Switch between tabs
noremap H :bprevious<CR>
noremap I :bnext<CR>
nnoremap H :bprevious<CR>
nnoremap I :bnext<CR>
vnoremap H ^
xnoremap H ^
onoremap H ^
vnoremap I $
xnoremap I $
onoremap I $
noremap N 5j
noremap E 5k
@ -68,10 +75,11 @@ vnoremap > editor.action.indentLines
nmap w cjkWordHandler.cursorWordEndRight
nmap b cjkWordHandler.cursorWordStartLeft
noremap <C-w>n <C-w>j
noremap <C-w>e <C-w>k
noremap <C-w>i <C-w>l
noremap <C-w>x workbench.action.toggleEditorGroupLayout
" Use C-w C-w as original C-w
noremap <C-w><C-w> workbench.action.closeActiveEditor
noremap <C-w><A-n> workbench.action.togglePanel
" <C-w> will be parsed by VSCode itself.
" noremap <C-w>n <C-w>j
" noremap <C-w>e <C-w>k
" noremap <C-w>i <C-w>l
" noremap <C-w>x workbench.action.toggleEditorGroupLayout
" " Use C-w C-w as original C-w
" noremap <C-w><C-w> workbench.action.closeActiveEditor
" noremap <C-w><A-n> workbench.action.togglePanel