-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
105 lines (81 loc) · 3.21 KB
/
.zshrc
File metadata and controls
105 lines (81 loc) · 3.21 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
if [ -z "$TMUX" ]; then
neofetch
fi
# 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/.oh-my-zsh"
source ~/.zprofile
ZSH_THEME="robbyrussell"
tmuxswitch() {
local session_name="$1"
local session_dir="$2"
if [ -z "$TMUX" ]; then
# If not inside tmux, create a new session with specific tabs and panes
if ! tmux has-session -t "$session_name" 2>/dev/null; then
# Create a new session
tmux new-session -d -s "$session_name" -c "$session_dir"
# Create a horizontal split pane in the first window
tmux split-window -h -c "$session_dir" -t "$session_name:1"
tmux new-window -c "$session_dir" -t "$session_name" -n "editor"
tmux send-keys -t "$session_name:2" 'nvim' C-m
tmux last-window
fi
# Attach to the session
tmux attach-session -t "$session_name"
else
# Inside tmux: Check if the session exists
if tmux has-session -t "$session_name" 2>/dev/null; then
# Switch to the existing session
tmux switch-client -t "$session_name"
else
# Create a new session from within tmux
tmux new-session -d -s "$session_name" -c "$session_dir"
# Create a horizontal split pane in the first window
tmux split-window -h -c "$session_dir" -t "$session_name:1"
# Create a new window (tab)
tmux new-window -c "$session_dir" -t "$session_name" -n "editor" 'nvim'
# Attach to the newly created session
tmux switch-client -t "$session_name"
# tmux send-keys -t "$session_name:2" 'nvim' C-m
tmux last-window
fi
fi
}
plugins=(zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
alias c="clear"
alias t='tmux'
alias tn='tmux new-session -s $(basename "$PWD")'
alias config="cd ~/.config/"
alias gitopen="git remote get-url origin"
alias spot="spotify_player"
alias nivm="nvim"
alias hot="npm run hot"
alias tablet="npm run tablet"
alias android="npm run android"
alias pos='tmuxswitch POS ~/Code/Dripos-POS-React-Native/'
alias oapp='tmuxswitch OAPP ~/Code/Dripos-React-Native/'
alias oweb='tmuxswitch OWEB ~/Code/Dripos-React-Order/'
alias hub='tmuxswitch HUB ~/Code/Dripos-Dashboard-React-Native/'
alias dash='tmuxswitch DASH ~/Code/Dripos-React-Partner/'
alias server='tmuxswitch SERVER ~/Code/Dripos/'
alias reader='tmuxswitch READER ~/Code/Dripos-React-Native-Reader/'
eval "$(starship init zsh)"
eval "$(zoxide init --cmd cd zsh)"
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
export PATH="/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.1.0/bin:$PATH"
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# bun completions
[ -s "/Users/abhishekmore/.bun/_bun" ] && source "/Users/abhishekmore/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# ruby
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
export PATH=$PATH:/Users/abhishekmore/.spicetify
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"