diff --git a/.config/karabiner/karabiner.json b/.config/karabiner/karabiner.json new file mode 100644 index 0000000..1a5c82a --- /dev/null +++ b/.config/karabiner/karabiner.json @@ -0,0 +1,197 @@ +{ + "global": { + "ask_for_confirmation_before_quitting": true, + "check_for_updates_on_startup": true, + "show_in_menu_bar": true, + "show_profile_name_in_menu_bar": false, + "unsafe_ui": false + }, + "profiles": [ + { + "complex_modifications": { + "parameters": { + "basic.simultaneous_threshold_milliseconds": 50, + "basic.to_delayed_action_delay_milliseconds": 500, + "basic.to_if_alone_timeout_milliseconds": 1000, + "basic.to_if_held_down_threshold_milliseconds": 500, + "mouse_motion_to_scroll.speed": 100 + }, + "rules": [] + }, + "devices": [ + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": [ + { + "key_code": "escape" + } + ] + } + ], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + } + ], + "fn_function_keys": [ + { + "from": { + "key_code": "f1" + }, + "to": [ + { + "consumer_key_code": "display_brightness_decrement" + } + ] + }, + { + "from": { + "key_code": "f2" + }, + "to": [ + { + "consumer_key_code": "display_brightness_increment" + } + ] + }, + { + "from": { + "key_code": "f3" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "mission_control" + } + ] + }, + { + "from": { + "key_code": "f4" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "spotlight" + } + ] + }, + { + "from": { + "key_code": "f5" + }, + "to": [ + { + "consumer_key_code": "dictation" + } + ] + }, + { + "from": { + "key_code": "f6" + }, + "to": [ + { + "key_code": "f6" + } + ] + }, + { + "from": { + "key_code": "f7" + }, + "to": [ + { + "consumer_key_code": "rewind" + } + ] + }, + { + "from": { + "key_code": "f8" + }, + "to": [ + { + "consumer_key_code": "play_or_pause" + } + ] + }, + { + "from": { + "key_code": "f9" + }, + "to": [ + { + "consumer_key_code": "fast_forward" + } + ] + }, + { + "from": { + "key_code": "f10" + }, + "to": [ + { + "consumer_key_code": "mute" + } + ] + }, + { + "from": { + "key_code": "f11" + }, + "to": [ + { + "consumer_key_code": "volume_decrement" + } + ] + }, + { + "from": { + "key_code": "f12" + }, + "to": [ + { + "consumer_key_code": "volume_increment" + } + ] + } + ], + "name": "Default profile", + "parameters": { + "delay_milliseconds_before_open_device": 1000 + }, + "selected": true, + "simple_modifications": [], + "virtual_hid_keyboard": { + "country_code": 0, + "indicate_sticky_modifier_keys_state": true, + "mouse_key_xy_scale": 100 + } + } + ] +} \ No newline at end of file diff --git a/.config/zsh/keybinds.zsh b/.config/zsh/keybinds.zsh new file mode 100644 index 0000000..70b727f --- /dev/null +++ b/.config/zsh/keybinds.zsh @@ -0,0 +1,35 @@ +bindkey -v +# If NumLock is off, translate keys to make them appear the same as with NumLock on. +bindkey -s '^[OM' '^M' # enter +bindkey -s '^[Ok' '+' +bindkey -s '^[Om' '-' +bindkey -s '^[Oj' '*' +bindkey -s '^[Oo' '/' +bindkey -s '^[OX' '=' + +# If someone switches the terminal to application mode (smkx), translate keys to make +# them appear the same as in raw mode (rmkx). +bindkey -s '^[OH' '^[[H' # home +bindkey -s '^[OF' '^[[F' # end +bindkey -s '^[OA' '^[[A' # up +bindkey -s '^[OB' '^[[B' # down +bindkey -s '^[OD' '^[[D' # left +bindkey -s '^[OC' '^[[C' # right + +# TTY sends different key codes. Translate them to regular. +bindkey -s '^[[1~' '^[[H' # home +bindkey -s '^[[4~' '^[[F' # end + +bindkey '^?' backward-delete-char # bs delete one char backward +bindkey '^[[3~' delete-char # delete delete one char forward +bindkey '^[[H' beginning-of-line # home go to the beginning of line +bindkey '^[[F' end-of-line # end go to the end of line +bindkey '^[[1;5C' forward-word # ctrl+right go forward one word +bindkey '^[[1;5D' backward-word # ctrl+left go backward one word +bindkey '^H' backward-kill-word # ctrl+bs delete previous word +bindkey '^[[3;5~' kill-word # ctrl+del delete next word +bindkey '^J' backward-kill-line # ctrl+j delete everything before cursor +bindkey '^[[D' backward-char # left move cursor one char backward +bindkey '^[[C' forward-char # right move cursor one char forward +bindkey '^[[A' up-line-or-beginning-search # up prev command in history +bindkey '^[[B' down-line-or-beginning-search # down next command in history diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..acfe93d --- /dev/null +++ b/.zshrc @@ -0,0 +1,135 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. +export ZSH="$HOME/.oh-my-zsh" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="agnoster" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# 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" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +ZSH_CUSTOM=~/.config/zsh + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=( + git + history-substring-search + colored-man-pages + zsh-autosuggestions + zsh-syntax-highlighting +) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='vim' +else + export EDITOR='nvim' +fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" +# +alias python="python3.12" + +# SSH agent +if [ ! -S ~/.ssh/sh_auth_sock ] +then + eval "$(ssh-agent -s)" + ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock +fi +export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock +ssh-add -l > /dev/null || ssh-add --apple-use-keychain > /dev/null + +HISTFILE=~/.histfile +HISTSIZE=10000 +SAVEHIST=10000 +setopt appendhistory autocd extendedglob +unsetopt beep + +zstyle :compinstall filename '/home/anon/.zshrc' +autoload -Uz compinit +compinit +prompt_context(){} + +autoload -Uz up-line-or-beginning-search +autoload -Uz down-line-or-beginning-search +zle -N up-line-or-beginning-search +zle -N down-line-or-beginning-search +