-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
114 lines (80 loc) · 2.87 KB
/
zshrc
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
#/usr/bin/zsh
# =============================================================================
# Includes
# Prezto
PREZTO_INIT="${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
[[ -s $PREZTO_INIT ]] && source $PREZTO_INIT
# Base16 Shell
BASE16_SHELL="$HOME/.config/base16-shell/base16-tomorrow.dark.sh"
[[ -s $BASE16_SHELL ]] && source $BASE16_SHELL
# dotfiles_private
ZSHRC_PRIVATE="$HOME/dotfiles_private/zshrc_private"
[[ -s $ZSHRC_PRIVATE ]] && source $ZSHRC_PRIVATE
# =============================================================================
# Tools
export EDITOR="nvim"
export DIFF="meld"
export BROWSER="firefox"
# =============================================================================
# Settings
#export NVIM_TUI_ENABLE_TRUE_COLOR=1
# =============================================================================
# Shadows
alias vim='nvim'
alias :e='nvim' # I mean, it happens... :)
# =============================================================================
# Aliases
alias xclipc='xclip -selection c'
# find
findheader () {
find -type f -regextype posix-egrep -regex ".+\.(h|hh|hpp|hxx)" "$@"
}
findsrc () {
find -type f -regextype posix-egrep -regex ".+\.(c|cc|cpp|cxx)" "$@"
}
findxx () {
find -type f -regextype posix-egrep -regex ".+\.(c|cc|cpp|cxx|h|hh|hpp|hxx|ipp|ixx)" "$@"
}
findrs () {
find -type f -regextype posix-egrep -regex ".+\.(rs|toml)" "$@"
}
# grep
grepheader () { findheader -exec grep "$@" {} \+ }
grepsrc () { findsrc -exec grep "$@" {} \+ }
grepxx () { findxx -exec grep "$@" {} \+ }
greprs () { findrs -exec grep "$@" {} \+ }
# rg
rgheader () { rg -g "*.h" -g "*.hh" -g "*.hpp" -g "*.hxx" "$@" }
rgsrc () { rg -g "*.c" -g "*.cc" -g "*.cpp" -g "*.cxx" "$@" }
rgxx () { rg -g "*.c" -g "*.cc" -g "*.cpp" -g "*.cxx" -g "*.h" -g "*.hh" -g "*.hpp" -g "*.hxx" -g "*.ipp" -g "*.ixx" "$@" }
rgrs () { rg -g "*.rs" -g "*.toml" "$@" }
# git log formats
jog () {
git log --format="%h %ae %s" "$@"
}
# =============================================================================
# Rust
export RUST_SRC_PATH="$HOME/devel/rust"
# =============================================================================
# Settings
# vi mode
bindkey -v
# cd-less cd
# setopt AUTO_CD
# vi style incremental search
bindkey '^R' history-incremental-search-backward
bindkey '^S' history-incremental-search-forward
bindkey '^P' history-search-backward
bindkey '^N' history-search-forward
# Scripts and bin
export PATH="$HOME/bin:$HOME/scripts:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
# =============================================================================
# Vulkan SDK...
export VULKAN_SDK="$HOME/sdk/VulkanSDK/1.0.21.1/x86_64"
export PATH="$PATH:$VULKAN_SDK/bin"
export LD_LIBRARY_PATH="$VULKAN_SDK/lib"
export VK_LAYER_PATH="$VULKAN_SDK/etc/explicit_layer.d"
# =============================================================================
# Too convenient...
export DISPLAY=:0