This is the config I use to work with web applications. Designed to make my terminal as productive as possible. This is tested and designed for iTerm2 terminal.
-
clone this repository with all plugins included
git clone --recursive -j8 https://github.com/wilgoszpl/shell-config.git ~/bin
-
install iterm2
All tmux specific config is stored in ~/tmux
directory.
- install tmux
brew install tmux
- in your create
~/.tmux.conf
file and add this line there:source ~/bin/tmux/.tmux.conf`
- clone all plugins run tmux and install plugins:
tmux Ctrl+q, I (shift i)
We strongly recommend to use ZSH shell with this config. To change your default shell into ZSH, just type chsh -s /usr/zsh
in your terminal.
-
Copy .zshrc from ~/bin/dotfiles/.zshrc
-
Install .oh-my-zsh
export ZSH=$HOME/bin/.zshrc; sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
-
Add those lines in your newly created
~.zshrc
file. Please, ensure, that you have zsh plugins beforeoh-my-zsh
file loaded, and.zshrc
after that.source $HOME/bin/.zsh_plugins source $ZSH/oh-my-zsh.sh source $HOME/bin/.zshrc
-
You may need to set gem paths to get rid of warning when starting terminal.
export GEM_HOME="$HOME/.gem" export GEM_PATH="$HOME/.gem"
-
Add this line to your
~/.bash_profile
filesource ~/bin/.bashrc
- Git branch color
- Git command autocomplete
- Git aliases
- Git rewrite author
- Project specific script structurization
- Shell color schemes
- TMUX runtime script
If there is a git repository in current folder, it shows the current branch name, and color it to green/red depending of uncommitted changes
Based on http://gitweb.hawaga.org.uk/ . This script autocompletes git commands after pressing key.
I use several shortcuts for git to improve my speed of repository management. For now I didn't updated git autocomplete script
to work with
aliases, so I use shell aliases only for commands without need to autocomplete branches.
alias ga='git add -p'
alias gaa='git add -A'
alias gc='git commit -m' #this allows me to use 'gc "Commit message"'
alias gca='git commit --amend'
alias gl='git pull -r' #always pull and rebase actuall branch
alias gm='git merge'
alias go='git checkout'
alias gp='git push' #always push actual branch.
alias gs='git status'
alias gr='git rebase master' #I often rebase with master and almost never with other branches.
alias gri='git rebase -i'
This script is extracted from This repository just to keep things simple
If you want to add commands for project specific environment setup, just add project-specific/private.sh
and list sources of private files there.
I name private project_files started from _
- those files are also ingnored in this repository.
Example:
FILE: project-specific/private.sh
source $HOME/bin/project-specific/_wpl.sh
FILE project-specific/_wpl.sh
#HERE you can provide scripts to setup your project environment
#
wpl(){
cd $HOME/Projects/wilgoszpl/source
rvm use 2.3.0@wpl
}
wpls(){
wpl
RAILS_ENV=development rails s
}
This configuration allows me to simply use wpls
to immediately start rails server inside of my project with proper gemset set. I use separeate file
for each project and keep them private.
This script immediately opens terminal with two windows with 3 panels ond first one, runs vim, server, console, and prepare project-specific environment.
To use it, just setup those environment variables. I place them inside of my project-specific files in twpl
command. After configuring environment
in this way, typing twpl
in your terminal will do everything you need - just start coding.
FILE project-specific/_wpl.sh
#HERE you can provide scripts to setup your project environment
#
#prepare project specific environment
wpl(){
cd $HOME/Projects/wilgoszpl/source
rvm use 2.3.0@wpl
}
#run server with project specific environment
wpls(){
wpl
RAILS_ENV=development rails s
}
#run tmux environment auto setup
twpl(){
export prcmd=wpl
export scmd=wpls
export session=wilgoszpl
export window1=${session}:shell
export window2=${session}:vim
~/bin/.tmux/rails-dev.sh
}
##Contribution
- Fork it
- Create Pull request.