mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-21 05:02:16 +00:00
vi mode
This commit is contained in:
parent
7f1f56dc35
commit
59d9d2bf14
1 changed files with 36 additions and 0 deletions
36
home/zsh.nix
36
home/zsh.nix
|
|
@ -88,6 +88,7 @@
|
||||||
|
|
||||||
export BUN_INSTALL="$HOME/.bun"
|
export BUN_INSTALL="$HOME/.bun"
|
||||||
export PNPM_HOME="$HOME/Library/pnpm"
|
export PNPM_HOME="$HOME/Library/pnpm"
|
||||||
|
bindkey -v
|
||||||
typeset -U path PATH
|
typeset -U path PATH
|
||||||
path=(
|
path=(
|
||||||
"$HOME/.amp/bin"
|
"$HOME/.amp/bin"
|
||||||
|
|
@ -130,6 +131,41 @@
|
||||||
return $exit_code
|
return $exit_code
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _codex_set_cursor {
|
||||||
|
if [[ "$1" == block ]]; then
|
||||||
|
printf '\e[2 q'
|
||||||
|
else
|
||||||
|
printf '\e[6 q'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function zle-keymap-select {
|
||||||
|
if [[ "$KEYMAP" == vicmd ]]; then
|
||||||
|
_codex_set_cursor block
|
||||||
|
else
|
||||||
|
_codex_set_cursor beam
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
zle -N zle-keymap-select
|
||||||
|
|
||||||
|
function zle-line-init {
|
||||||
|
_codex_set_cursor beam
|
||||||
|
}
|
||||||
|
zle -N zle-line-init
|
||||||
|
|
||||||
|
function zle-line-finish {
|
||||||
|
_codex_set_cursor beam
|
||||||
|
}
|
||||||
|
zle -N zle-line-finish
|
||||||
|
|
||||||
|
precmd() {
|
||||||
|
_codex_set_cursor beam
|
||||||
|
}
|
||||||
|
|
||||||
|
preexec() {
|
||||||
|
_codex_set_cursor beam
|
||||||
|
}
|
||||||
|
|
||||||
iosrun() {
|
iosrun() {
|
||||||
local project=$(find . -maxdepth 1 -name "*.xcodeproj" | head -1)
|
local project=$(find . -maxdepth 1 -name "*.xcodeproj" | head -1)
|
||||||
local scheme=$(basename "$project" .xcodeproj)
|
local scheme=$(basename "$project" .xcodeproj)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue