aboutsummaryrefslogtreecommitdiff
path: root/.zshrc
blob: 23c3df3c5686d0b1ff0c7d963ee6b659bd5dfa8e (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/usr/bin/zsh

#export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="pure"
# ZSH_THEME="robbyrussell"
HYPHEN_INSENSITIVE="true"
DISABLE_MAGIC_FUNCTIONS=true
HIST_STAMPS="dd/mm/yyyy"

#school stuff
#ZSH_DISABLE_COMPFIX=true

export FPATH="$FPATH:$HOME/.zsh/pure"

#plugins=() #colorize git zsh-syntax-highlighting)
#source $ZSH/oh-my-zsh.sh

autoload -U promptinit; promptinit
prompt pure

bindkey -v
export KEYTIMEOUT=1

setopt auto_cd
setopt pushd_ignore_dups
setopt list_rows_first
setopt extendedglob

# alias expansion
#bindkey "^ " _expand_alias # ctrl+space to expand
#bindkey " " magic-space # space to avoid expansion
#bindkey -M isearch " " magic-space

#alias -g G='| grep'
#alias -g L='| less'
#alias -g LO='192.168.0.'
#alias -g HUB="https://github.com/HappyTramp/"
alias grep="grep --color=auto"
alias rr='rm -r'
alias ls="ls --color"
alias ll="ls -lFh"
alias la="ls -a"
alias lA="ls -al"
alias lss="ls -Ssh"
alias l1="ls -1"
alias less="less -N"
alias mkdir="mkdir -p"
alias tree="tree -C"
alias treeI="tree -I '__pycache__' -I '*.o' -I vendor"
alias v="vim"

alias :q="exit"
alias :sp="tmux split-window"
alias :vsp="tmux split-window -h"
alias nmaplan="sudo nmap -sP '192.168.0.*'"
alias gdb="gdb -q"
alias node="nodejs"
alias python="python3.7"
alias info="info --vi-keys"
alias moula="gcc -Wall -Wextra -Werror"
alias norm="norminette"
alias normch="norm *.c *.h"
alias list-c-includes-paths="echo | gcc -E -Wp,-v -"
alias yoump3='youtube-dl --extract-audio --audio-format mp3'
alias adg="sudo apt update && sudo apt upgrade"

alias ga="git add"
alias gaa="git add --all"
alias gc="git commit"
alias gc!="git commit --amend"
alias gcmsg="git commit --message"
alias gd="git diff"
alias gds="git diff --staged"
alias gl="git pull"
alias glg="git log --stat"
alias glgg="git log --graph"
alias gp="git push"
alias gcl="git clone --recurse-submodules"
alias gst="git status"
alias gco="git checkout"

function chpwd() {
    file_count=$(ls | wc -w)
    if [ $file_count -lt 30 ]; then
		tree -L 1
    else
        echo "$(pwd) contains $file_count files"
    fi
}

# behavior on enter
# function precmd() {
# 	echo $0;
# 	if ["${0}" -eq ""]; then
# 		ls
# 	else
# 		$1
# 	fi;
# }

export DOTFILES=$HOME/dotfiles
alias zshrc="vim $DOTFILES/.zshrc && source $DOTFILES/.zshrc"
alias vimrc="vim $DOTFILES/.vimrc"
alias vimplugrc="vim $DOTFILES/.vimrc -c 'vsp $DOTFILES/.pluggins.vim'"
alias tmuxrc="vim $DOTFILES/.tmux.conf && tmux source-file $DOTFILES/.tmux.conf"

# vim keys in tab completion menu (https://www.youtube.com/watch?v=eLEo4OQ-cuQ)
#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

# add command-not-found package suggestion
#source /etc/zsh_command_not_found

# add /sbin to $PATH
# export PATH="$PATH:/sbin:/usr/local/sbin:/usr/sbin"
# add my bin
# export PATH="$HOME/bin:$PATH"
# add go bins
# export PATH="$PATH:/usr/local/go/bin"
#export PATH="$PATH:$(go env GOPATH)/bin"

# man with color
export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m'

# XDG stuff
export XDG_CONFIG_HOME="/home/charles/.config/"
export XDG_DATA_HOME="/home/charles/.data/"

export EDITOR="vim"

# set tab to 4 spaces
# tabs 4

dual () {
    xrandr --output LVDS1 --primary --left-of VGA1 --output VGA1 --auto
}

single () {
    xrandr --output VGA1 --off
}