From 14fd7d4326579569f27cf3ff415f626c0be3ad8b Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Tue, 25 Aug 2015 13:07:31 +0200 Subject: Added nvim as default editor if exists --- bash/.bashrc | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'bash') 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 alias jblive='vlc rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream' fi -if exists vim; then +if exists nvim; then + export EDITOR="nvim" +elif exists vim; then export EDITOR="vim" - vim() { - if [[ -z $@ ]]; then - $usr/bin/vim - elif [[ -d $@ ]]; then - dir=$(pwd) - cd $@ && $usr/bin/vim && cd $dir - else - $usr/bin/vim $@ - fi - } +elif exists vi; then + export EDITOR="vi" fi +vim() { + if [[ -z $@ ]]; then + $EDITOR + elif [[ -d $@ ]]; then + dir=$(pwd) + cd $@ && $EDITOR && cd $dir + else + $EDITOR $@ + fi +} + if exists go; then export GOPATH="$HOME/programming/go" export PATH="$PATH:$GOPATH/bin" -- cgit v1.2.3