-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
83 lines (71 loc) · 1.87 KB
/
Copy path.zshrc
File metadata and controls
83 lines (71 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# |
# _ / __| __ \
# / \__ \ | | |
# ___| ____/ _| |_|
# Maximaleffekt's zsh configuration file
# Functions
# uses fzf to quickly find a (sub)folder from anywhere
function fcd() {
a=$(pwd)
cd
b="$(fzf | rev | cut -f2- -d "/" | rev)"
if [ -n "$b" ]; then
cd $b
else
cd $a
fi
}
# enters a directory and lists its contents
function cl(){
cd $1
lsd
}
# opens cht.sh entry for keyword
function cht(){
curl -s "cht.sh/$1" | less -R
}
# Only counts empty lines
# For reference: https://kevcaz.insileco.io/notes/linux/countlines/
function wcn(){
cat $1 | sed '/^\s*#/d;/^\s*$/d' | wc -l
}
chtfzf() {
curl -ks cht\.sh/$(curl -ks cht\.sh/:list | IFS=+ fzf --preview 'curl -ks http://cht.sh{}' -q "$*") | less -R
}
export EDITOR="nvim"
export PATH=$PATH:~/scripts
export PATH=$PATH:/Users/max/Library/Python/3.10/bin
# Sets history settings
# https://koenwoortman.com/zsh-command-history/
HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000
SAVEHIST=10000
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_FIND_NO_DUPS
setopt SHARE_HISTORY
# Aliases
alias resource="source ~/.zshrc"
alias zshc="$EDITOR ~/.zshrc"
alias n="nvim"
alias nvimc="nvim ~/.config/nvim/init.vim"
alias v="nvim"
alias "rm"="rm -i"
alias ls="lsd"
alias lsa="lsd -A"
alias lsl="lsd -l"
alias tree="lsd --tree"
alias cp="cp -v"
alias mv="mv -v"
alias du="du -h"
alias df="df -h"
alias up2="brew update && brew upgrade"
alias py="python3"
# Plug-ins
source /Users/max/.config/zsh-plugins/fzf/completion.zsh
source /Users/max/.config/zsh-plugins/fzf/keybinds.zsh
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_AUTOSUGGEST_STRATEGY=(history completion )
autoload compinit && compinit # https://github.com/zsh-users/zsh-autosuggestions/issues/515
# Initialize starship prompt
eval "$(starship init zsh)"