X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=bash%2F.bash_aliases;h=041788cd6d7d63e99157654c1f1f7ebde201f11b;hb=e26f095473bbbc450820f7fabd0e82f94562426e;hp=879f20c0842763407e4f728a9b1888ad1dac4b62;hpb=17b5704f4ad364c4f4ca206413925e3e62cb844e;p=max%2Fdotfiles.git diff --git a/bash/.bash_aliases b/bash/.bash_aliases index 879f20c..041788c 100644 --- a/bash/.bash_aliases +++ b/bash/.bash_aliases @@ -1,3 +1,5 @@ +#!/bin/bash + if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' @@ -10,6 +12,13 @@ if [ -x /usr/bin/dircolors ]; then fi function la { - \ls -lah --color=always "$@" | less -r + ls_out=$(\ls -lah --color=always "$@") + let "allowed_lines = $(tput lines) - 3" + if [ $(echo "$ls_out" | wc -l) -le $allowed_lines ]; then + echo "$ls_out" + else + echo "$ls_out" | less -r + fi } alias tmux='TERM=xterm-256color tmux' +alias vim='gvim -v'