]> git.friedersdorff.com Git - max/dotfiles.git/blobdiff - bash/.bash_aliases
Remove PAGER for environment variables
[max/dotfiles.git] / bash / .bash_aliases
index 9c3be03e70c93ca21cd532027bd7aaa033bb2b12..de525676956ecfc4d5228ad5efc22f06add7a1de 100644 (file)
@@ -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'
@@ -9,4 +11,16 @@ if [ -x /usr/bin/dircolors ]; then
     alias egrep='egrep --color=auto'
 fi
 
-alias la='ls -lah'
+function la {
+    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'
+if [ -x /usr/bin/gvim ]; then 
+  alias vim='gvim -v'
+fi