summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2015-07-10 19:18:51 +0100
committerUrbain Vaes <urbain@vaes.uk>2015-07-10 19:18:51 +0100
commit8de6af284c4d4ed227c066d17fdc3954f20f2e51 (patch)
treebc5223560df8a8956e80e5ee301099e5859a67f0
parentde2bdde724d7118a51f5931dff84d9b38471b715 (diff)
Add features to zsh
-rw-r--r--zshrc46
1 files changed, 28 insertions, 18 deletions
diff --git a/zshrc b/zshrc
index d3f8e40..bfc6a26 100644
--- a/zshrc
+++ b/zshrc
@@ -23,9 +23,12 @@ if ! zgen saved; then
zgen load djui/alias-tips
zgen load tarruda/zsh-autosuggestions
zgen load Tarrasch/zsh-autoenv
- zgen load uvaes/fzf-marks plugin develop
+ zgen load uvaes/fzf-marks
+ zgen load joel-porquet/zsh-dircolors-solarized
- # Theme
+ # Appearance
+ # zgen load mafredri/zsh-async
+ # zgen load sindresorhus/pure
zgen oh-my-zsh themes/eastwood
# Save all to init script
@@ -152,23 +155,30 @@ fi
# Colors
export TERM=xterm-256color
-export COLORSCHEME=light
+export COLORSCHEME=dark
-default() {
- $HOME/.bin/recolor.sh < ~/.Xresources.default
- xrdb ~/.Xresources.default
- export COLORSCHEME=default
- sed -i "s/export COLORSCHEME=.*/export COLORSHEME=default/g" ~/.zshrc
-}
+function cc {
-light() {
- $HOME/.bin/recolor.sh < ~/.Xresources.light
- xrdb ~/.Xresources.light
- export COLORSCHEME=light
-}
+ # Change colors for current session
+ $HOME/.bin/recolor.sh < ~/.Xresources.$1
+
+ # Load Xresources file for future sessions
+ xrdb ~/.Xresources.$1
+
+ # Change environment variable
+ export COLORSCHEME=$1
-dark() {
- $HOME/.bin/recolor.sh < ~/.Xresources.dark
- xrdb ~/.Xresources.dark
- export COLORSCHEME=dark
+ # Change default environment variable for future sessions
+ sed -i "s/^export COLORSCHEME=.*$/export COLORSCHEME=$1/g" ~/dotfiles/.zshrc
}
+
+# Fix tmux colors
+if [[ -n ${TMUX} && -n ${commands[tmux]} ]];then
+ case $(tmux showenv TERM 2>/dev/null) in
+ *256color) ;&
+ TERM=fbterm)
+ TERM=screen-256color ;;
+ *)
+ TERM=screen
+ esac
+fi