From 8b232cc2e67897b9af63bd64e449af5a0105b7a9 Mon Sep 17 00:00:00 2001 From: histalek Date: Fri, 2 Apr 2021 19:06:33 +0200 Subject: [PATCH] Initial commit --- .config/VSCodium/User/settings.json | 32 +++++++++++++ .config/kitty/colors.conf | 49 +++++++++++++++++++ .config/kitty/kitty.conf | 73 +++++++++++++++++++++++++++++ .config/oh-my-zsh/aliases.zsh | 50 ++++++++++++++++++++ .dotfiles/README.md | 29 ++++++++++++ .gitconfig | 51 ++++++++++++++++++++ .gitignore_global | 28 +++++++++++ .zshrc | 72 ++++++++++++++++++++++++++++ 8 files changed, 384 insertions(+) create mode 100644 .config/VSCodium/User/settings.json create mode 100644 .config/kitty/colors.conf create mode 100644 .config/kitty/kitty.conf create mode 100644 .config/oh-my-zsh/aliases.zsh create mode 100644 .dotfiles/README.md create mode 100644 .gitconfig create mode 100644 .gitignore_global create mode 100644 .zshrc diff --git a/.config/VSCodium/User/settings.json b/.config/VSCodium/User/settings.json new file mode 100644 index 0000000..feaa094 --- /dev/null +++ b/.config/VSCodium/User/settings.json @@ -0,0 +1,32 @@ +{ + "editor.acceptSuggestionOnEnter": "off", + "editor.accessibilitySupport": "off", + "editor.cursorBlinking": "smooth", + "editor.cursorSmoothCaretAnimation": true, + "editor.fontLigatures": false, + "explorer.confirmDelete": false, + "explorer.confirmDragAndDrop": false, + //Ref: https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers + "files.associations": { + "*.fcc": "yaml", + "*.ign": "json", + }, + "glualint.activeLanguages": [ + "glua", + "lua" + ], + "latex.server.autoDownload": true, + "latex-workshop.bind.enter.key": false, + "latex-workshop.chktex.enabled": true, + "latex-workshop.latex.clean.subfolder.enabled": true, + "latex-workshop.message.update.show": false, + "latex-workshop.view.pdf.viewer": "tab", + "markdownlint.config": { + "MD024": {"allow_different_nesting": true} + }, + "terminal.integrated.fontFamily": "'monospace', 'PowerlineSymbols'", + "window.title": "${activeEditorShort}${separator}${rootPath}", + "workbench.colorTheme": "Better Solarized Dark", + "workbench.iconTheme": "material-icon-theme", + "workbench.startupEditor": "newUntitledFile", +} diff --git a/.config/kitty/colors.conf b/.config/kitty/colors.conf new file mode 100644 index 0000000..fddcd3e --- /dev/null +++ b/.config/kitty/colors.conf @@ -0,0 +1,49 @@ +# The foreground color +foreground #839496 + +# The background color +background #002b36 + +# The 16 terminal colors. There are 8 basic colors, each color has a dull and +# bright version. + +# solarized dark +color0 #073642 +color8 #002b36 + +color1 #dc322f +color9 #cb4b16 + +color2 #859900 +color10 #586e75 + +color3 #b58900 +color11 #657b83 + +color4 #268bd2 +color12 #839496 + +color5 #d33682 +color13 #6c71c4 + +color6 #2aa198 +color14 #93a1a1 + +color7 #eee8d5 +color15 #fdf6e3 + +# The opacity of the background. A number between 0 and 1, where 1 is opaque and 0 is fully transparent. +background_opacity 1.0 + +# The foreground for selections +selection_foreground #002b36 + +# The background for selections +selection_background #586e75 + +# The color and style for URLs on mouse-over +url_color #0087BD +url_style curly + +# The cursor color +cursor #93a1a1 diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf new file mode 100644 index 0000000..ef5619e --- /dev/null +++ b/.config/kitty/kitty.conf @@ -0,0 +1,73 @@ +# include color config +include colors.conf + +# kitty list-fonts +font_family auto +italic_font auto +bold_font auto +bold_italic_font auto + +# Font size (in pts) +font_size 10.0 + +# If enabled, the window size will be remembered so that new instances of kitty will have the same +# size as the previous instance. If disabled, the window will initially have size configured +# by initial_window_width/height, in pixels. +remember_window_size no +initial_window_width 1080 +initial_window_height 600 + +# The modifier keys to press when clicking with the mouse on URLs to open the URL +open_url_modifiers ctrl + +# The program with which to open URLs that are clicked on. The special value "default" means to +# use the operating system's default URL handler. +open_url_with default + +# The value of the TERM environment variable to set +term xterm-kitty + +# Clipboard +map ctrl+shift+v paste_from_clipboard +map ctrl+shift+s no_op +map ctrl+shift+c copy_to_clipboard +map shift+insert no_op + +# You can also pass the contents of the current selection to any program using +# pass_selection_to_program. By default, the system's open program is used. +map ctrl+shift+o no_op # pass_selection_to_program firefox + +# Scrolling +map ctrl+shift+up no_op +map ctrl+shift+down no_op +map ctrl+shift+k no_op +map ctrl+shift+j no_op +map ctrl+shift+page_up no_op +map ctrl+shift+page_down no_op +map ctrl+shift+home no_op +map ctrl+shift+end no_op +map ctrl+shift+h no_op + +# Window management +map ctrl+shift+enter no_op +map ctrl+n new_os_window +map ctrl+w close_window +map ctrl+shift+] no_op +map ctrl+shift+[ no_op +map ctrl+shift+f no_op +map ctrl+shift+1 no_op +map ctrl+shift+2 no_op +map ctrl+shift+3 no_op +map ctrl+shift+4 no_op +map ctrl+shift+5 no_op +map ctrl+shift+6 no_op +map ctrl+shift+7 no_op +map ctrl+shift+8 no_op +map ctrl+shift+9 no_op +map ctrl+shift+0 no_op + +# Use the system default shell +shell . + +# Use vim as editor +editor vim diff --git a/.config/oh-my-zsh/aliases.zsh b/.config/oh-my-zsh/aliases.zsh new file mode 100644 index 0000000..a72351f --- /dev/null +++ b/.config/oh-my-zsh/aliases.zsh @@ -0,0 +1,50 @@ +# general aliases + +## Alias handling +alias editalias='vim ~/.config/oh-my-zsh/aliases.zsh' +alias updatealias='source ~/.zshrc' + +## https://www.atlassian.com/git/tutorials/dotfiles +alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' + +## ssh workaround for kitty terminal +alias ssh='sshKittyWorkaround' + +function sshKittyWorkaround { + if [[ "$TERM" == "xterm-kitty" ]]; then + kitty +kitten ssh $argv; + else + "ssh" $argv; + fi +} + +## navigation +alias ..='cd ..' +alias ...='cd ../..' + +## 'ls' to 'exa' +alias ls='exa -l --color=always --group-directories-first' +alias la='exa -al --color=always --group-directories-first' +alias ll='exa -l --color=always --group-directories-first' + +## 'grep' to 'rg' -> 'ripgrep' +alias grep='rg' + +## 'cat' to 'bat' +alias cat='bat' + +## TODO 'delta' instead of 'git diff' + +## confirm before overwriting files +alias cp="cp -i" +alias mv='mv -i' +alias rm='rm -i' + +## adding flags +alias df='df -h' +alias free='free -m' + +## color and condense ip output +alias ipa='ip -br -c addr show' +alias ipl='ip -br -c link show' + diff --git a/.dotfiles/README.md b/.dotfiles/README.md new file mode 100644 index 0000000..b8dd7a7 --- /dev/null +++ b/.dotfiles/README.md @@ -0,0 +1,29 @@ +# My Dotfiles using a bare git repository + +## Setup repository and worktree + +```bash +git init --bare $HOME/.dotfiles +alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' +# ideally place the alias into your shells alias file +dotfiles config --local status.showUntrackedFiles no +dotfile add [...] +dotfiles commit [...] +# Setup remote git repository +dotfiles push +``` + +## Install / restore dotfiles + +```bash +echo ".dotfiles" >> .gitignore +git clone --bare $HOME/.dotfiles +alias dotfiles='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' +dotfiles config --local status.showUntrackedFiles no +dotfiles checkout +``` + +### References + +[Atlassian dotfiles git Guide](https://www.atlassian.com/git/tutorials/dotfiles) +[The best way to store your dotfiles](https://www.ackama.com/blog/posts/the-best-way-to-store-your-dotfiles-a-bare-git-repository-explained) diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..10dbd6d --- /dev/null +++ b/.gitconfig @@ -0,0 +1,51 @@ +[user] + name = Histalek + email = 16392835+Histalek@users.noreply.github.com + signingkey = 19EC07547ED0CE82 + +[color] + diff = auto + status = auto + branch = auto + interactive = auto + ui = auto + +[color "status"] + added = green bold + changed = yellow bold + untracked = red + +[commit] + gpgsign = true + +[core] + editor = vim + excludesfile = ~/.gitignore_global + +[grep] + lineNumber = true + extendRegexp = true + +[push] + default = current + +[pull] + rebase = true + +[includeIf "gitdir:~/Documents/Uni/"] + path = ~/.gitconfigs/.gitconfig-uni + +[includeIf "gitdir:~/Repositories/uni/"] + path = ~/.gitconfigs/.gitconfig-uni + +[includeIf "gitdir:~/Repositories/gitlab_com/"] + path = ~/.gitconfigs/.gitconfig-gitlab_com + +[includeIf "gitdir:~/Repositories/saibotk_de/"] + path = ~/.gitconfigs/.gitconfig-saibotk_de + +[includeIf "gitdir:~/.dotfiles/"] + path = ~/.gitconfigs/.gitconfig-saibotk_de + +[init] + defaultBranch = main diff --git a/.gitignore_global b/.gitignore_global new file mode 100644 index 0000000..8ebaf12 --- /dev/null +++ b/.gitignore_global @@ -0,0 +1,28 @@ +.DS_Store +Thumbs.db +*~ +*.swp +.AppleDouble +.LSOverride +Icon + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# project-specific vim configurations +.vimrc.local +.vim/coc-settings.json + +# typescript command garbage +tscommand*.txt + +# nvm - the Node Version Manager +.nvmrc + +# npm things +npm-debug.log + diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..1a0e6a0 --- /dev/null +++ b/.zshrc @@ -0,0 +1,72 @@ +# 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/simon/.oh-my-zsh" + +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="agnoster" + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS=true + +# Uncomment the following line to display red dots whilst waiting for completion. +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="dd.mm.yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +ZSH_CUSTOM=/home/simon/.config/oh-my-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 + ansible + extract + history + pass + sudo + zsh-interactive-cd + ) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +export EDITOR=/usr/bin/vim +export HISTORY_IGNORE="(ls|cd|pwd|exit|history|cd -|cd ..)" +export MANPAGER="sh -c 'col -bx | bat -l man -p'" + +setopt completealiases + +prompt_context(){} + +## compdef kitty + +_kitty() { + local src + # Send all words up to the word the cursor is currently on + src=$(printf "%s +" "${(@)words[1,$CURRENT]}" | kitty +complete zsh) + if [[ $? == 0 ]]; then + eval ${src} + fi +} +compdef _kitty kitty + +autoload -Uz compinit +compinit +# Completion for kitty +kitty + complete setup zsh | source /dev/stdin