dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 596bed37c7d0b35917c7c216bec87343667beb74
parent 20cd7760817b710637706c93e63b34e69bb9c433
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Thu,  4 Jan 2018 20:26:17 -0500

Another major revision

bashrc: unset dotglob
lessfilter: handle tar files
my-perms: handle executable bit on regular files
profile: improved quoting and handling of non-Bash shells
shrc: improved quoting, move emacs option from profile
mailcap: use zathura for PDF if DISPLAY is available, same for my-open

Diffstat:
M.bashrc | 2+-
M.lessfilter | 3+++
M.local/bin/my-perms | 11++++++++---
M.mailcap | 3++-
M.profile | 13+++++--------
M.shrc | 11++++++-----
M.vim/vimrc | 4++--
7 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/.bashrc b/.bashrc @@ -4,7 +4,7 @@ [ -r "$HOME/.shrc" ] && source "$HOME/.shrc" [ -r "$HOME/.bashrc.local" ] && source "$HOME/.bashrc.local" -shopt -s dotglob globstar +shopt -s globstar export HISTCONTOL=erasedups diff --git a/.lessfilter b/.lessfilter @@ -13,6 +13,9 @@ then *shrc*|*profile*) pygmentize -O style=friendly -f 256 -l sh "$1" ;; + *tar*) + tar -tf "$1" + ;; *) grep "#\!/bin/bash" "$1" > /dev/null if [ "$?" -eq "0" ]; then diff --git a/.local/bin/my-perms b/.local/bin/my-perms @@ -14,12 +14,17 @@ for rec in `ls -A` do case $rec in .*) - if [ -f "$rec" ] + if [ -f $rec ] then - chmod 600 $rec + if [ -x $rec ] + then + chmod 700 $rec + else + chmod 600 $rec + fi fi - if [ -d "$rec" ] + if [ -d $rec ] then chmod 700 $rec fi diff --git a/.mailcap b/.mailcap @@ -1,3 +1,4 @@ text/html; w3m -I %{charset} -T text/html; copiousoutput; +application/pdf; zathura '%s'; test=test -n "$DISPLAY"; application/pdf; pdftotext '%s' -; copiousoutput; -*/*; my-open '%s'; +*/*; my-open '%s'; test=test -n "$DISPLAY"; diff --git a/.profile b/.profile @@ -3,11 +3,9 @@ # [ -r "$HOME/.profile.local" ] && . "$HOME/.profile.local" -set -o emacs - -if [ -z "$BASH" ] +if [ "$0" == "sh" ] then - ENV=$HOME/.shrc; export ENV + ENV="$HOME/.shrc"; export ENV fi if which vim > /dev/null 2>&1 @@ -29,17 +27,16 @@ fi if which lesspipe > /dev/null 2>&1 then - LESSOPEN="|`which lesspipe` %s" + eval `lesspipe` else LESSOPEN="|$HOME/.lessfilter %s" + export LESSOPEN fi -export LESSOPEN -unset LESSCLOSE # Keep the go folder hidden if which go > /dev/null 2>&1 then - GOPATH=$HOME/.go + GOPATH="$HOME/.go" export GOPATH fi diff --git a/.shrc b/.shrc @@ -2,9 +2,11 @@ # ~/.shrc # # vim: ft=sh -[ -r $HOME/.shrc.local ] && . $HOME/.shrc.local +[ -r "$HOME/.shrc.local" ] && . "$HOME/.shrc.local" -if [ -z "$BASH" ] +set -o emacs + +if [ -n "$BASH" ] then user=`printf '\033[34m%s\033[m' "$LOGNAME"` host=`printf '\033[32m\\h\033[m'` @@ -19,8 +21,7 @@ if which dircolors > /dev/null 2>&1 then if [ -n "$SOURCE_DIRCOLORS" ] then - eval `dircolors $HOME/.dir_colors` - alias ls='ls --color=auto' + eval `dircolors "$HOME/.dir_colors"` unset SOURCE_DIRCOLORS fi else @@ -30,7 +31,7 @@ else fi # Colorize others if they exist -COLORIZE_CMDS="pacman grep egrep fgrep" +COLORIZE_CMDS="ls pacman grep egrep fgrep" for cmd in $COLORIZE_CMDS do if which $cmd > /dev/null 2>&1 diff --git a/.vim/vimrc b/.vim/vimrc @@ -33,8 +33,8 @@ if has('vim_starting') if isdirectory(expand('~/Documents/src/vim_plugins')) set packpath+=~/Documents/src/vim_plugins endif - elseif filereadable('pack/bundle/vim-pathogen/autoload/pathogen.vim') - runtime 'pack/bundle/vim-pathogen/autoload/pathogen.vim' + elseif filereadable(expand('~/.vim/pack/bundle/start/vim-pathogen/autoload/pathogen.vim')) + runtime pack/bundle/start/vim-pathogen/autoload/pathogen.vim if isdirectory(expand('~/Documents/src/vim_plugins')) execute pathogen#infect('pack/bundle/start/{}', '~Documents/src/vim_plugins/pack/bundle/start{}') else