Skip to content

Commit

Permalink
regular update
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchenyun committed Jun 18, 2018
1 parent d6dbe30 commit 1fdfa23
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -4,3 +4,6 @@
[submodule "plugins/nvm-wrapper"]
path = plugins/nvm-wrapper
url = git@github.com:passcod/nvm-fish-wrapper.git
[submodule "plugins/plugin-foreign-env"]
path = plugins/plugin-foreign-env
url = git@github.com:oh-my-fish/plugin-foreign-env.git
11 changes: 11 additions & 0 deletions config.fish
Expand Up @@ -9,4 +9,15 @@ set -g VIRTUALFISH_COMPAT_ALIASES
. "$HOME/.config/fish/plugins/virtualfish/auto_activation.fish"
. "$HOME/.config/fish/plugins/virtualfish/global_requirements.fish"

# fenv
set fish_function_path $fish_function_path "$HOME/.config/fish/plugins/plugin-foreign-env/functions"

# Nix
if test -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fenv source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
end

# Shell Integration
test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish

posix-source "$HOME/.fetchenv"
23 changes: 12 additions & 11 deletions functions/export.fish
Expand Up @@ -18,8 +18,6 @@ set -x RUBY_GC_HEAP_GROWTH_FACTOR 1.25
set -x RUBY_GC_HEAP_GROWTH_MAX_SLOTS 300000

# nodejs
set -x NODE_PATH "$HOME/.npm-packages/lib/node_modules" $NODE_PATH
set -x PATH "$HOME/.npm-packages/bin" $PATH
set -x PATH "./node_modules/.bin" $PATH

# python
Expand All @@ -29,13 +27,16 @@ set -x PIP_REQUIRE_VIRTUALENV 1
set -x VIRTUAL_ENV_DISABLE_PROMPT 1

# go
set -x GOPATH "$HOME/.go-lib"
set -x GOPATH "$HOME/go"
set -x PATH "$GOPATH/bin" $PATH
set -x PATH "/usr/local/opt/go/libexec/bin" $PATH

# haskell
set -x PATH "$HOME/.cabal/bin" $PATH

# flutter
set -x PATH "$HOME/project/flutter/bin" $PATH

# respect local bins
set -x PATH "./bin" $PATH

Expand All @@ -52,13 +53,13 @@ set -x LESS "-RSM~gIsw"

# Colorful man pages
# from http://pastie.org/pastes/206041/text
setenv -x LESS_TERMCAP_mb (set_color -o red)
setenv -x LESS_TERMCAP_md (set_color -o red)
setenv -x LESS_TERMCAP_me (set_color normal)
setenv -x LESS_TERMCAP_se (set_color normal)
setenv -x LESS_TERMCAP_so (set_color -b blue -o yellow)
setenv -x LESS_TERMCAP_ue (set_color normal)
setenv -x LESS_TERMCAP_us (set_color -o green)
set -gx LESS_TERMCAP_mb (set_color -o red)
set -gx LESS_TERMCAP_md (set_color -o red)
set -gx LESS_TERMCAP_me (set_color normal)
set -gx LESS_TERMCAP_se (set_color normal)
set -gx LESS_TERMCAP_so (set_color -b blue -o yellow)
set -gx LESS_TERMCAP_ue (set_color normal)
set -gx LESS_TERMCAP_us (set_color -o green)

# grep colors
setenv -x GREP_OPTIONS "--color=auto"
set -gx GREP_OPTIONS "--color=auto"
15 changes: 13 additions & 2 deletions functions/utils.fish
Expand Up @@ -53,10 +53,10 @@ end

function cd --description "auto ls for each cd"
if [ -n $argv[1] ]
builtin cd $argv[1]
builtin cd $argv[1]
and ls -AF
else
builtin cd ~
builtin cd ~
and ls -AF
end
end
Expand All @@ -73,6 +73,10 @@ function pgrep --description "pgrep a process interactively"
ps aux | peco | awk '{ print $2 }'
end

function rename --description "Rename a symbol recursively in a folder"
rg -l "$argv[1]" | xargs -I\{\} perl -i -pe "s/$argv[1]/$argv[2]/g" \{\}
end

################################
### For Python
################################
Expand Down Expand Up @@ -105,3 +109,10 @@ alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true and
alias spotoff="sudo mdutil -a -i off"
# Enable Spotlight
alias spoton="sudo mdutil -a -i on"

function posix-source
for i in (cat $argv)
set arr (echo $i |tr = \n)
set -gx $arr[1] $arr[2]
end
end
1 change: 1 addition & 0 deletions plugins/plugin-foreign-env
Submodule plugin-foreign-env added at baefbd

0 comments on commit 1fdfa23

Please sign in to comment.