add kitty, zsh aliases, gitconfig

This commit is contained in:
Dan Šuster 2024-07-25 15:47:38 +02:00
parent 8cfdb642c4
commit 75778d4eef
6 changed files with 133 additions and 10 deletions

View File

@ -1,8 +1,41 @@
[user] [user]
name = Dan Suster name = Dan Suster
email = dan@thegolem.cz email = dan@thegolem.cz
signingkey = dan@thegolem.cz
[commit] [commit]
gpgsign = true gpgsign = true
[core] [core]
autocrlf = input autocrlf = input
[core]
editor = nvim
excludesfile = ~/.gitignore
autocrlf = input
[color]
branch = auto
diff = auto
interactive = auto
status = auto
[init]
defaultBranch = master
[web]
browser = firefox
[credential]
helper = osxkeychain
[push]
default = simple
[merge]
tool = kdiff3
[difftool]
prompt = false
[alias]
c = commit
ca = commit -a
cm = commit -m
cam = commit -am
d = diff
dc = diff --cached
l = log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit
gpg = config user.signingkey
name = config user.name
email = config user.email
[pull]
rebase = true

View File

@ -23,10 +23,13 @@
path: p10k.zsh path: p10k.zsh
~/.osx: ~/.osx:
force: true force: true
path: .osx path: osx
~/.config/kitty/kitty.conf: ~/.config/kitty/kitty.conf:
force: true force: true
path: kitty.conf path: kitty.conf
~/.config/kitty/nord.conf:
force: true
path: kitty_nord.conf
- shell: - shell:
@ -34,3 +37,5 @@
- [sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)", Installing OhMyZSH] - [sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)", Installing OhMyZSH]
- git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom/themes/powerlevel10k} - git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom/themes/powerlevel10k}
- git clone https://github.com/sunlei/zsh-ssh ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-ssh - git clone https://github.com/sunlei/zsh-ssh ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-ssh
- git clone --depth 1 https://github.com/AstroNvim/template ~/.config/nvim
- rm -rf ~/.config/nvim/.git

View File

@ -6,7 +6,7 @@
#: individual font faces and even specify special fonts for particular #: individual font faces and even specify special fonts for particular
#: characters. #: characters.
font_family monospace font_family JetBrainsMono Nerd Font Mono
bold_font auto bold_font auto
italic_font auto italic_font auto
bold_italic_font auto bold_italic_font auto
@ -23,7 +23,7 @@ bold_italic_font auto
#: italic_font Operator Mono Book Italic #: italic_font Operator Mono Book Italic
#: bold_italic_font Operator Mono Medium Italic #: bold_italic_font Operator Mono Medium Italic
font_size 11.0 font_size 12.0
#: Font size (in pts) #: Font size (in pts)
@ -58,6 +58,7 @@ font_size 11.0
#: artifacts). #: artifacts).
# symbol_map U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols # symbol_map U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols
symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0C8,U+E0CA,U+E0CC-U+E0D2,U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E634,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF Symbols Nerd Font Mono
#: Map the specified unicode codepoints to a particular font. Useful #: Map the specified unicode codepoints to a particular font. Useful
#: if you need special rendering for some symbols, such as for #: if you need special rendering for some symbols, such as for

43
kitty_nord.conf Normal file
View File

@ -0,0 +1,43 @@
# Nord Colorscheme for Kitty
# Based on:
# - https://gist.github.com/marcusramberg/64010234c95a93d953e8c79fdaf94192
# - https://github.com/arcticicestudio/nord-hyper
foreground #D8DEE9
background #2E3440
selection_foreground #000000
selection_background #FFFACD
url_color #0087BD
cursor #81A1C1
# black
color0 #3B4252
color8 #4C566A
# red
color1 #BF616A
color9 #BF616A
# green
color2 #A3BE8C
color10 #A3BE8C
# yellow
color3 #EBCB8B
color11 #EBCB8B
# blue
color4 #81A1C1
color12 #81A1C1
# magenta
color5 #B48EAD
color13 #B48EAD
# cyan
color6 #88C0D0
color14 #8FBCBB
# white
color7 #E5E9F0
color15 #ECEFF4

View File

@ -26,7 +26,7 @@ if [[ $EUID -ne 0 ]]; then
printf "Certain commands will not be run without sudo privileges. To run as root, run the same command prepended with 'sudo', for example: $ sudo $0\n\n" | fold -s -w 80 printf "Certain commands will not be run without sudo privileges. To run as root, run the same command prepended with 'sudo', for example: $ sudo $0\n\n" | fold -s -w 80
else else
RUN_AS_ROOT=true RUN_AS_ROOT=true
# Update existing `sudo` timestamp until `.osx` has finished # Update existing `sudo` timestamp until `osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
fi fi

47
zshrc
View File

@ -77,7 +77,8 @@ ZSH_THEME="powerlevel10k/powerlevel10k"
# Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse) # Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup. # Add wisely, as too many plugins slow down shell startup.
plugins=(git plugins=(
git
colorize colorize
archlinux archlinux
docker docker
@ -87,17 +88,41 @@ themes
zsh-ssh zsh-ssh
history-substring-search history-substring-search
dirhistory dirhistory
kubectl
) )
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh
# User configuration # User configuration
# Tell homebrew to not autoupdate every single time I run it (just once a week).
export HOMEBREW_AUTO_UPDATE_SECS=604800
# Set architecture-specific brew share path.
arch_name="$(uname -m)"
if [ "${arch_name}" = "x86_64" ]; then
share_path="/usr/local/share"
elif [ "${arch_name}" = "arm64" ]; then
share_path="/opt/homebrew/share"
else
echo "Unknown architecture: ${arch_name}"
fi
# export MANPATH="/usr/local/man:$MANPATH" # export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment # You may need to manually set your language environment
# export LANG=en_US.UTF-8 # export LANG=en_US.UTF-8
# Delete a given line number in the known_hosts file.
knownrm() {
re='^[0-9]+$'
if ! [[ $1 =~ $re ]] ; then
echo "error: line number missing" >&2;
else
sed -i '' "$1d" ~/.ssh/known_hosts
fi
}
# Preferred editor for local and remote sessions # Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='nvim' export EDITOR='nvim'
@ -117,9 +142,25 @@ fi
# alias zshconfig="mate ~/.zshrc" # alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh" # alias ohmyzsh="mate ~/.oh-my-zsh"
alias gs='git status'
alias gc='git commit'
alias gp='git pull --rebase'
alias gcam='git commit -am'
alias gl='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit'
alias vi='nvim'
alias vim='nvim'
alias 'gpg list'='gpg --list-secret-keys --keyid-format=long'
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # TODO
source ${share_path}/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Allow history search via up/down keys.
# TODO
source ${share_path}/zsh-history-substring-search/zsh-history-substring-search.zsh
bindkey "^[[A" history-substring-search-up
bindkey "^[[B" history-substring-search-down