From 6ab5c7e5b4645efc02020bf072f79509dbdb8d4d Mon Sep 17 00:00:00 2001 From: Niclas Rosengren Date: Wed, 21 Oct 2015 10:41:42 +0200 Subject: [PATCH 1/5] removed gb alias --- plugins/git/git.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 178f1deb2..e9609b740 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -44,7 +44,7 @@ alias ga='git add' alias gaa='git add --all' alias gapa='git add --patch' -alias gb='git branch' +#alias gb='git branch' alias gba='git branch -a' alias gbd='git branch -d' alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d' From 030f34bee9b595a08fbfd6ce352a5b832f54c8d5 Mon Sep 17 00:00:00 2001 From: Niclas Rosengren Date: Fri, 21 Oct 2016 19:34:21 +0200 Subject: [PATCH 2/5] Added my theme --- themes/niro.zsh-theme | 100 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 themes/niro.zsh-theme diff --git a/themes/niro.zsh-theme b/themes/niro.zsh-theme new file mode 100644 index 000000000..dfc0bde98 --- /dev/null +++ b/themes/niro.zsh-theme @@ -0,0 +1,100 @@ +# prompt style and colors based on Steve Losh's Prose theme: +# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme +# +# vcs_info modifications from Bart Trojanowski's zsh prompt: +# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt +# +# git untracked files modification from Brian Carper: +# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt + +export VIRTUAL_ENV_DISABLE_PROMPT=1 + +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('%F{blue}`basename $VIRTUAL_ENV`%f') ' +} +PR_GIT_UPDATE=1 + +setopt prompt_subst + +autoload -U add-zsh-hook +autoload -Uz vcs_info + +#use extended color pallete if available +if [[ $terminfo[colors] -ge 256 ]]; then + turquoise="%F{81}" + orange="%F{166}" + purple="%F{135}" + hotpink="%F{161}" + limegreen="%F{118}" +else + turquoise="%F{cyan}" + orange="%F{yellow}" + purple="%F{magenta}" + hotpink="%F{red}" + limegreen="%F{green}" +fi + +# enable VCS systems you use +zstyle ':vcs_info:*' enable git svn + +# check-for-changes can be really slow. +# you should disable it, if you work with large repositories +zstyle ':vcs_info:*:prompt:*' check-for-changes true + +# set formats +# %b - branchname +# %u - unstagedstr (see below) +# %c - stagedstr (see below) +# %a - action (e.g. rebase-i) +# %R - repository path +# %S - path in the repository +PR_RST="%f" +FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" +FMT_ACTION="(%{$limegreen%}%a${PR_RST})" +FMT_UNSTAGED="%{$orange%}●" +FMT_STAGED="%{$limegreen%}●" + +zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" +zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" +zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}" +zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" +zstyle ':vcs_info:*:prompt:*' nvcsformats "" + + +function steeef_preexec { + case "$(history $HISTCMD)" in + *git*) + PR_GIT_UPDATE=1 + ;; + *svn*) + PR_GIT_UPDATE=1 + ;; + esac +} +add-zsh-hook preexec steeef_preexec + +function steeef_chpwd { + PR_GIT_UPDATE=1 +} +add-zsh-hook chpwd steeef_chpwd + +function steeef_precmd { + if [[ -n "$PR_GIT_UPDATE" ]] ; then + # check for untracked files or updated submodules, since vcs_info doesn't + if git ls-files --other --exclude-standard 2> /dev/null | grep -q "."; then + PR_GIT_UPDATE=1 + FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" + else + FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" + fi + zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH} " + + vcs_info 'prompt' + PR_GIT_UPDATE= + fi +} +add-zsh-hook precmd steeef_precmd + +PROMPT=$' +%{$purple%}[${PR_RST} %{$limegreen%}%~${PR_RST} %{$purple%}]${PR_RST} $vcs_info_msg_0_$(virtualenv_info) +$ ' From cc92cc1c23712bc6df571654722623fdb63f0b1a Mon Sep 17 00:00:00 2001 From: Niclas Rosengren Date: Fri, 21 Oct 2016 19:39:08 +0200 Subject: [PATCH 3/5] added env variables --- oh-my-zsh.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index a7de646f2..f5304d815 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -111,3 +111,21 @@ else fi fi fi + + + +alias cnult="ssh pi@82.182.129.23 -p 15231" +alias cnhandskak="ssh niro@handskak.com" +alias cnhome="ssh niro@192.168.1.9" +alias cnpi2="ssh niro@192.168.1.65" +export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib" +export GOPATH="$HOME/go" +export CARGO_HOME=$HOME/.cargo +export PATH="$HOME/.cargo/bin:$PATH" +export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src" + +alias npm4gb='node --max-old-space-size=4096 /usr/local/bin/npm' + + + + From f32ed3b172ccc455a308cabee0839f3159de757f Mon Sep 17 00:00:00 2001 From: Niclas Rosengren Date: Tue, 1 Nov 2016 19:52:44 +0100 Subject: [PATCH 4/5] Removed linefeed from prompt --- themes/niro.zsh-theme | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/themes/niro.zsh-theme b/themes/niro.zsh-theme index dfc0bde98..c224d99ea 100644 --- a/themes/niro.zsh-theme +++ b/themes/niro.zsh-theme @@ -95,6 +95,5 @@ function steeef_precmd { } add-zsh-hook precmd steeef_precmd -PROMPT=$' -%{$purple%}[${PR_RST} %{$limegreen%}%~${PR_RST} %{$purple%}]${PR_RST} $vcs_info_msg_0_$(virtualenv_info) +PROMPT=$'%{$purple%}[${PR_RST} %{$limegreen%}%~${PR_RST} %{$purple%}]${PR_RST} $vcs_info_msg_0_$(virtualenv_info) $ ' From 3834ce7a4f511eacd3854fc88dc76bb16805676d Mon Sep 17 00:00:00 2001 From: Niclas Rosengren Date: Fri, 4 Nov 2016 21:03:38 +0100 Subject: [PATCH 5/5] Added rust and go variables --- oh-my-zsh.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index f5304d815..60558705a 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -119,11 +119,15 @@ alias cnhandskak="ssh niro@handskak.com" alias cnhome="ssh niro@192.168.1.9" alias cnpi2="ssh niro@192.168.1.65" export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib" -export GOPATH="$HOME/go" -export CARGO_HOME=$HOME/.cargo -export PATH="$HOME/.cargo/bin:$PATH" -export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src" +export GOROOT="/usr/local/go" +export GOPATH="$HOME/go" + +export CARGO_HOME=$HOME/.cargo + +export PATH="$PATH:$CARGO_HOME/bin:$GOROOT/bin:$GOPATH/bin" + +export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src" alias npm4gb='node --max-old-space-size=4096 /usr/local/bin/npm'