add: zsh
This commit is contained in:
		
							parent
							
								
									918a0708a6
								
							
						
					
					
						commit
						296c26752c
					
				
					 8 changed files with 1928 additions and 59 deletions
				
			
		|  | @ -1,32 +0,0 @@ | |||
| alias aliases='vim ~/.bash_aliases && bashrc-reload' | ||||
| alias bashrc-reload='source ~/.bashrc' | ||||
| 
 | ||||
| alias config-bashrc='vim ~/.bashrc && bashrc-reload' | ||||
| alias config-dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' | ||||
| alias config-i3='vim ~/.config/i3/config' | ||||
| alias config-i3status='vim ~/.config/i3status/config' | ||||
| alias config-vim='vim ~/.vimrc' | ||||
| 
 | ||||
| alias df='df -h' | ||||
| alias du='du -hL' | ||||
| 
 | ||||
| alias git-update-submodules=' | ||||
|     git submodule update --init --recursive; | ||||
|     git submodule foreach --recursive git fetch; | ||||
|     git submodule foreach --recursive git merge origin master | ||||
| ' | ||||
| alias gpg2-decrypt='function _gpg2-decrypt(){ gpg2 --output ${1%".gpg"} --decrypt $1; }; _gpg2-decrypt' | ||||
| alias gpg2-encrypt='function _gpg2-encrypt(){ gpg2 --output $1.gpg --encrypt $1; }; _gpg2-encrypt' | ||||
| 
 | ||||
| alias ls='ls -Flh --color=never' | ||||
| 
 | ||||
| alias lsblk='lsblk -o +PARTLABEL -o +FSTYPE' | ||||
| 
 | ||||
| alias md5='ms5' | ||||
| alias md5sum-dir='function _md5sum-dir(){ find $1 -type f -exec md5sum {} \; | md5sum; }; _md5sum-dir' | ||||
| 
 | ||||
| alias pacman-autoremove='sudo pacman -Rns $(pacman -Qtdq)' | ||||
| 
 | ||||
| alias ssh-sftp='$(read -t 2 -r tool; if [[ -z "$tool" ]]; then tool="ssh"; fi; echo $tool)' | ||||
| 
 | ||||
| alias rm='rm -I' | ||||
							
								
								
									
										8
									
								
								.bashrc
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								.bashrc
									
										
									
									
									
								
							|  | @ -30,13 +30,7 @@ else | |||
|     function __git_ps1() { echo ""; }; | ||||
| fi | ||||
| 
 | ||||
| if [ -f ~/.bash_aliases ]; then | ||||
|     source ~/.bash_aliases | ||||
| fi | ||||
| 
 | ||||
| if [ -f ~/.bash_aliases.local ]; then | ||||
|     source ~/.bash_aliases.local | ||||
| fi | ||||
| [ -f "$HOME/.config/aliasrc" ] && source $HOME/.config/aliasrc | ||||
| 
 | ||||
| if [ -f ~/.bashrc.local ]; then | ||||
|     source ~/.bashrc.local | ||||
|  |  | |||
|  | @ -135,34 +135,84 @@ font: | |||
| # If `true`, bold text is drawn using the bright color variants. | ||||
| draw_bold_text_with_bright_colors: true | ||||
| 
 | ||||
| # Colors (Dracula) | ||||
| # Colors (Tomorrow Night Bright) | ||||
| colors: | ||||
|   # Default colors | ||||
|   primary: | ||||
|     background: '0x14151b' # half as darc as default Dracula | ||||
|     foreground: '0xf8f8f2' | ||||
|     background: '0x000000' | ||||
|     foreground: '0xeaeaea' | ||||
| 
 | ||||
|     # Bright and dim foreground colors | ||||
|     # | ||||
|     # The dimmed foreground color is calculated automatically if it is not present. | ||||
|     # If the bright foreground color is not set, or `draw_bold_text_with_bright_colors` | ||||
|     # is `false`, the normal foreground color will be used. | ||||
|     #dim_foreground: '0x9a9a9a' | ||||
|     #bright_foreground: '0xffffff' | ||||
| 
 | ||||
|   # Cursor colors | ||||
|   # | ||||
|   # Colors which should be used to draw the terminal cursor. If these are unset, | ||||
|   # the cursor color will be the inverse of the cell color. | ||||
|   cursor: | ||||
|     text: '0x000000' | ||||
|     cursor: '0xffffff' | ||||
| 
 | ||||
|   # Selection colors | ||||
|   # | ||||
|   # Colors which should be used to draw the selection area. If selection | ||||
|   # background is unset, selection color will be the inverse of the cell colors. | ||||
|   # If only text is unset the cell text color will remain the same. | ||||
|   selection: | ||||
|     text: '0xeaeaea' | ||||
|     background: '0x404040' | ||||
| 
 | ||||
|   # Normal colors | ||||
|   normal: | ||||
|     black:   '0x000000' | ||||
|     red:     '0xff5555' | ||||
|     green:   '0x50fa7b' | ||||
|     yellow:  '0xf1fa8c' | ||||
|     blue:    '0xcaa9fa' | ||||
|     magenta: '0xff79c6' | ||||
|     cyan:    '0x8be9fd' | ||||
|     white:   '0xbfbfbf' | ||||
|     red:     '0xd54e53' | ||||
|     green:   '0xb9ca4a' | ||||
|     yellow:  '0xe6c547' | ||||
|     blue:    '0x7aa6da' | ||||
|     magenta: '0xc397d8' | ||||
|     cyan:    '0x70c0ba' | ||||
|     white:   '0xeaeaea' | ||||
| 
 | ||||
|   # Bright colors | ||||
|   bright: | ||||
|     black:   '0x575b70' | ||||
|     red:     '0xff6e67' | ||||
|     green:   '0x5af78e' | ||||
|     yellow:  '0xf4f99d' | ||||
|     blue:    '0xcaa9fa' | ||||
|     magenta: '0xff92d0' | ||||
|     cyan:    '0x9aedfe' | ||||
|     white:   '0xe6e6e6' | ||||
|     black:   '0x666666' | ||||
|     red:     '0xff3334' | ||||
|     green:   '0x9ec400' | ||||
|     yellow:  '0xe7c547' | ||||
|     blue:    '0x7aa6da' | ||||
|     magenta: '0xb77ee0' | ||||
|     cyan:    '0x54ced6' | ||||
|     white:   '0xffffff' | ||||
| 
 | ||||
|   # Dim colors | ||||
|   # | ||||
|   # If the dim colors are not set, they will be calculated automatically based | ||||
|   # on the `normal` colors. | ||||
|   #dim: | ||||
|   #  black:   '0x000000' | ||||
|   #  red:     '0x8c3336' | ||||
|   #  green:   '0x7a8530' | ||||
|   #  yellow:  '0x97822e' | ||||
|   #  blue:    '0x506d8f' | ||||
|   #  magenta: '0x80638e' | ||||
|   #  cyan:    '0x497e7a' | ||||
|   #  white:   '0x9a9a9a' | ||||
| 
 | ||||
|   # Indexed Colors | ||||
|   # | ||||
|   # The indexed colors include all colors from 16 to 256. | ||||
|   # When these are not set, they're filled with sensible defaults. | ||||
|   # | ||||
|   # Example: | ||||
|   #   `- { index: 16, color: '0xff00ff' }` | ||||
|   # | ||||
|   #indexed_colors: [] | ||||
| 
 | ||||
| 
 | ||||
| # Visual Bell | ||||
| # | ||||
|  |  | |||
|  | @ -3,10 +3,21 @@ | |||
| 	name = Tobias Reisinger | ||||
| 	signingkey = 723B78C0BF8D8C721D2C4EEF41E544A54E2533B2 | ||||
| [core] | ||||
| 	excludesfile = ~/.config/git/ignore | ||||
| 	editor = vim | ||||
| 	pager = less | ||||
| 	excludesfile = /home/tr3isinger/.config/git/ignore | ||||
| 	autocrlf = input | ||||
| [help] | ||||
| 	autocorrect = 20 | ||||
| [diff] | ||||
| 	external = /home/tr3isinger/.config/git/ext_diff.sh | ||||
| 	tool = vimdiff | ||||
| [difftool] | ||||
| 	prompt = false | ||||
| [alias] | ||||
| 	dt = difftool | ||||
| 	d = diff | ||||
| [merge] | ||||
| 	tool = vimdiff | ||||
| 	conflictstyle = diff3 | ||||
| [mergetool] | ||||
| 	prompt = false | ||||
|  |  | |||
							
								
								
									
										1774
									
								
								.config/zsh/.zcompdump
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1774
									
								
								.config/zsh/.zcompdump
									
										
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										69
									
								
								.config/zsh/.zshrc
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								.config/zsh/.zshrc
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,69 @@ | |||
| # Enable colors and change prompt: | ||||
| autoload -U colors && colors | ||||
| PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " | ||||
| 
 | ||||
| # History in cache directory: | ||||
| HISTSIZE=10000 | ||||
| SAVEHIST=10000 | ||||
| HISTFILE=~/.cache/zsh/history | ||||
| 
 | ||||
| # Basic auto/tab complete: | ||||
| autoload -U compinit | ||||
| zstyle ':completion:*' menu select | ||||
| zmodload zsh/complist | ||||
| compinit | ||||
| _comp_options+=(globdots)		# Include hidden files. | ||||
| 
 | ||||
| # vi mode | ||||
| bindkey -v | ||||
| export KEYTIMEOUT=1 | ||||
| 
 | ||||
| # Use vim keys in tab complete menu: | ||||
| bindkey -M menuselect 'h' vi-backward-char | ||||
| bindkey -M menuselect 'k' vi-up-line-or-history | ||||
| bindkey -M menuselect 'l' vi-forward-char | ||||
| bindkey -M menuselect 'j' vi-down-line-or-history | ||||
| bindkey -v '^?' backward-delete-char | ||||
| 
 | ||||
| # Change cursor shape for different vi modes. | ||||
| function zle-keymap-select { | ||||
|   if [[ ${KEYMAP} == vicmd ]] || | ||||
|      [[ $1 = 'block' ]]; then | ||||
|     echo -ne '\e[1 q' | ||||
|   elif [[ ${KEYMAP} == main ]] || | ||||
|        [[ ${KEYMAP} == viins ]] || | ||||
|        [[ ${KEYMAP} = '' ]] || | ||||
|        [[ $1 = 'beam' ]]; then | ||||
|     echo -ne '\e[5 q' | ||||
|   fi | ||||
| } | ||||
| zle -N zle-keymap-select | ||||
| zle-line-init() { | ||||
|     zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) | ||||
|     echo -ne "\e[5 q" | ||||
| } | ||||
| zle -N zle-line-init | ||||
| echo -ne '\e[5 q' # Use beam shape cursor on startup. | ||||
| preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. | ||||
| 
 | ||||
| # Use lf to switch directories and bind it to ctrl-o | ||||
| lfcd () { | ||||
|     tmp="$(mktemp)" | ||||
|     lf -last-dir-path="$tmp" "$@" | ||||
|     if [ -f "$tmp" ]; then | ||||
|         dir="$(cat "$tmp")" | ||||
|         rm -f "$tmp" | ||||
|         [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" | ||||
|     fi | ||||
| } | ||||
| bindkey -s '^o' 'lfcd\n' | ||||
| 
 | ||||
| # Edit line in vim with ctrl-e: | ||||
| autoload edit-command-line; zle -N edit-command-line | ||||
| bindkey '^e' edit-command-line | ||||
| 
 | ||||
| # Load aliases | ||||
| [ -f "$HOME/.config/aliasrc" ] && source $HOME/.config/aliasrc | ||||
| 
 | ||||
| # Load zsh-syntax-highlighting; should be last. | ||||
| source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null | ||||
|  | @ -1 +1,3 @@ | |||
| xcompmgr -c -r0 & | ||||
| 
 | ||||
| export ZDOTDIR="$HOME/.config/zsh" | ||||
|  |  | |||
							
								
								
									
										1
									
								
								.zprofile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.zprofile
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| export ZDOTDIR="$HOME/.config/zsh" | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue