diff options
| author | 2015-08-25 13:07:31 +0200 | |
|---|---|---|
| committer | 2015-08-25 13:07:31 +0200 | |
| commit | 14fd7d4326579569f27cf3ff415f626c0be3ad8b (patch) | |
| tree | 808783d8cc6052c15d7516ccba3cf444406b7aa3 /bash | |
| parent | fed8c201dc4ba27627bfb66c9bc1c3d7e05b96ee (diff) | |
| download | dotfiles-14fd7d4326579569f27cf3ff415f626c0be3ad8b.tar.gz dotfiles-14fd7d4326579569f27cf3ff415f626c0be3ad8b.tar.bz2 dotfiles-14fd7d4326579569f27cf3ff415f626c0be3ad8b.zip | |
Added nvim as default editor if exists
Diffstat (limited to 'bash')
| -rwxr-xr-x | bash/.bashrc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/bash/.bashrc b/bash/.bashrc index e8a61fc..7e460bb 100755 --- a/bash/.bashrc +++ b/bash/.bashrc | |||
| @@ -98,20 +98,25 @@ elif exists vlc; then | |||
| 98 | alias jblive='vlc rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream' | 98 | alias jblive='vlc rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream' |
| 99 | fi | 99 | fi |
| 100 | 100 | ||
| 101 | if exists vim; then | 101 | if exists nvim; then |
| 102 | export EDITOR="nvim" | ||
| 103 | elif exists vim; then | ||
| 102 | export EDITOR="vim" | 104 | export EDITOR="vim" |
| 103 | vim() { | 105 | elif exists vi; then |
| 104 | if [[ -z $@ ]]; then | 106 | export EDITOR="vi" |
| 105 | $usr/bin/vim | ||
| 106 | elif [[ -d $@ ]]; then | ||
| 107 | dir=$(pwd) | ||
| 108 | cd $@ && $usr/bin/vim && cd $dir | ||
| 109 | else | ||
| 110 | $usr/bin/vim $@ | ||
| 111 | fi | ||
| 112 | } | ||
| 113 | fi | 107 | fi |
| 114 | 108 | ||
| 109 | vim() { | ||
| 110 | if [[ -z $@ ]]; then | ||
| 111 | $EDITOR | ||
| 112 | elif [[ -d $@ ]]; then | ||
| 113 | dir=$(pwd) | ||
| 114 | cd $@ && $EDITOR && cd $dir | ||
| 115 | else | ||
| 116 | $EDITOR $@ | ||
| 117 | fi | ||
| 118 | } | ||
| 119 | |||
| 115 | if exists go; then | 120 | if exists go; then |
| 116 | export GOPATH="$HOME/programming/go" | 121 | export GOPATH="$HOME/programming/go" |
| 117 | export PATH="$PATH:$GOPATH/bin" | 122 | export PATH="$PATH:$GOPATH/bin" |
