diff --git a/.profile b/.profile index 6157bbc..a8b90d9 100644 --- a/.profile +++ b/.profile @@ -7,14 +7,33 @@ # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. #umask 022 +VISUAL=vim +EDITOR=vim -eval "$(ssh-agent)" +SSH_ENV="$HOME/.ssh/environment" +function start_agent { + echo "Initialising new SSH agent..." + /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" + echo "succeeded" + chmod 600 "${SSH_ENV}" + . "${SSH_ENV}" > /dev/null +} + +# source SSH settings, if applicable +if [ -f "${SSH_ENV}" ]; then + . "${SSH_ENV}" > /dev/null + ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { + start_agent; + } +else + start_agent; +fi # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then - . "$HOME/.bashrc" + . "$HOME/.bashrc" fi fi diff --git a/vim/.vimrc b/vim/.vimrc index c8f8738..30072de 100755 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -21,7 +21,7 @@ au BufWinLeave *.py mkview au BufWinEnter *.py silent loadview " file specific formatting -autocmd Filetype python setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix +autocmd Filetype python,bash,sh setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix autocmd Filetype css,html,htmldjango,javascript setlocal tabstop=2 softtabstop=2 shiftwidth=2 " fold methods based on indents