mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
Modularize zsh dotfiles, add colemak bindkey
This commit is contained in:
parent
4e6519772d
commit
dc7611825a
16 changed files with 206 additions and 526 deletions
7
zsh/.zshenv
Normal file
7
zsh/.zshenv
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# ~/.zshenv
|
||||
# ln -s ~/.dotfiles/zsh/.zshenv ~/.zshenv
|
||||
# This file is sourced by all zsh sessions upon startup.
|
||||
|
||||
# Use XDG Base Directory Specification
|
||||
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
|
||||
45
zsh/alias.zsh
Normal file
45
zsh/alias.zsh
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# PowerShell Equivalent #
|
||||
alias ni=touch
|
||||
alias cls=clear
|
||||
|
||||
# Dev #
|
||||
alias g++='g++ -std=c++2b' # Set the default C++ standard to C++20
|
||||
alias gcc='gcc -std=c99' # Set the default C standard to C99
|
||||
alias cl='clang -std=c99'
|
||||
alias clpp='clang++ -std=c++2b'
|
||||
alias python=python3 # Set the default Python version to Python 3
|
||||
alias py=python # Alias for Python
|
||||
alias bashcfg="nvim ~/.bashrc"
|
||||
alias zshcfg="nvim ~/.zshrc"
|
||||
alias shcfg=zshcfg
|
||||
alias reload="source ~/.zshrc"
|
||||
alias nvimrc="nvim ~/.config/nvim/"
|
||||
alias ohmyzsh="code ~/.oh-my-zsh"
|
||||
alias pulldots="cd $DOTFILES && git pull"
|
||||
|
||||
# Conda #
|
||||
alias pyact="conda activate"
|
||||
alias pydact="conda deactivate"
|
||||
alias pylsenv="conda env list"
|
||||
alias pymkenv="conda create --name"
|
||||
|
||||
# Editors #
|
||||
alias v=nvim
|
||||
alias c=code
|
||||
|
||||
# Misc #
|
||||
alias cf=cfiles
|
||||
|
||||
# Functions #
|
||||
mcd() {
|
||||
mkdir -p -- "$0" && cd -P -- "$1"
|
||||
}
|
||||
cdls(){
|
||||
cd $1 && ls
|
||||
}
|
||||
tc(){
|
||||
touch $1 && code $1
|
||||
}
|
||||
tv(){
|
||||
touch $1 && nvim $1
|
||||
}
|
||||
24
zsh/config.zsh
Normal file
24
zsh/config.zsh
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
### ZSH Config ###
|
||||
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
|
||||
export ZSH="$HOME/.oh-my-zsh"
|
||||
ZSH_THEME="avit"
|
||||
# DISABLE_MAGIC_FUNCTIONS="true"
|
||||
# DISABLE_LS_COLORS="true"
|
||||
# DISABLE_AUTO_TITLE="true"
|
||||
# ENABLE_CORRECTION="true"
|
||||
# Uncomment the following line to display red dots whilst waiting for completion.
|
||||
# You can also set it to another string to have that shown instead of the default red dots.
|
||||
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
|
||||
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
|
||||
# COMPLETION_WAITING_DOTS="true"
|
||||
# Uncomment the following line if you want to disable marking untracked files
|
||||
# under VCS as dirty. This makes repository status check for large repositories
|
||||
# much, much faster.
|
||||
# DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||
HIST_STAMPS="yyyy-mm-dd"
|
||||
plugins=(git web-search jsontools z vi-mode zsh-syntax-highlighting zsh-autosuggestions)
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
source .private.env.sh
|
||||
|
||||
# export MANPATH="/usr/local/man:$MANPATH"
|
||||
# export LANG= "en_US.UTF-8"
|
||||
20
zsh/keymap.zsh
Normal file
20
zsh/keymap.zsh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# ~/.dotfiles/keymap.zsh
|
||||
bindkey -v # Vi Keybindings
|
||||
|
||||
# Colemak hnei
|
||||
# bindkey -M vicmd 'h' vi-backward-char # No change
|
||||
bindkey -M vicmd 'n' down-line-or-history
|
||||
bindkey -M vicmd 'e' up-line-or-history
|
||||
bindkey -M vicmd 'i' vi-forward-char
|
||||
|
||||
# Similar position to [i] in QWERTY
|
||||
bindkey -M vicmd 'l' vi-insert
|
||||
bindkey -M vicmd 'L' vi-insert-bol
|
||||
# Ne{[k]s}t
|
||||
bindkey -M vicmd 'k' vi-repeat-search
|
||||
bindkey -M vicmd 'K' vi-rev-repeat-search
|
||||
# [J]ump
|
||||
bindkey -M vicmd 'j' vi-forward-word-end
|
||||
bindkey -M vicmd 'J' vi-forward-blank-word-end
|
||||
# Use N to Join
|
||||
bindkey -M vicmd 'N' vi-join
|
||||
7
zsh/navi.zsh
Normal file
7
zsh/navi.zsh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
# Relative navigation
|
||||
alias ..="cd .."
|
||||
alias ...="cd ../.."
|
||||
alias ....="cd ../../.."
|
||||
alias .....="cd ../../../.."
|
||||
alias ......="cd ../../../../.."
|
||||
Loading…
Add table
Add a link
Reference in a new issue