diff --git a/bash/bashrc.synopsys b/bash/bashrc.synopsys index 0564b1d..ee9bf7e 100755 --- a/bash/bashrc.synopsys +++ b/bash/bashrc.synopsys @@ -5,17 +5,47 @@ # if [ -f /etc/bashrc ]; then . /etc/bashrc -elif [ -f $HOME/.bashrc.etc ]; then - . $HOME/.bashrc.etc +else + # System wide functions and aliases + # Environment stuff goes in /etc/profile + + # by default, we want this to get set. + # Even for non-interactive, non-login shells. + if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then + umask 002 + else + umask 022 + fi + + # are we an interactive shell? + if [ "$PS1" ]; then + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' + # Turn on checkwinsize + shopt -s checkwinsize + [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " + fi + + if ! shopt -q login_shell ; then # We're not a login shell + for i in /etc/profile.d/*.sh; do + if [ -r "$i" ]; then + if [ "$PS1" ]; then + . $i + else + . $i &>/dev/null + fi + fi + done + unset i + fi fi # # Don't source the rest twice. # -if [ "$BASHRC_VAHAGNK_DONT_SOURCE_THIS_FILE_TWICE" == "true" ]; then - return -fi -export BASHRC_VAHAGNK_DONT_SOURCE_THIS_FILE_TWICE=true +#if [ "$BASHRC_VAHAGNK_DONT_SOURCE_THIS_FILE_TWICE" == "true" ]; then +# return +#fi +#export BASHRC_VAHAGNK_DONT_SOURCE_THIS_FILE_TWICE=true # # Useful functions. diff --git a/vim/vimrc b/vim/vimrc index cf191dc..f7adb73 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -17,7 +17,7 @@ set ruler " show the cursor position all the time set tabstop=4 " make tabes to be equal to 4 space chars. set shiftwidth=4 " for shifting by 4 when pressing tab. set fileformat=unix " line ending is unix -"set textwidth=90 " 80 char text +set textwidth=80 " 80 char text let g:netrw_preview = 1 " netrw open window to the right let g:netrw_browse_split = 3 " open in a tab @@ -36,8 +36,8 @@ endif " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if &t_Co > 2 || has("gui_running") - syntax on - set hlsearch + syntax on + set hlsearch endif " One such option is the 'hidden' option, which allows you to re-use the same @@ -68,6 +68,16 @@ if exists('&number') set number endif +" Turn on spell check. +if exists("+spell") + set spell +endif + +" Show 80th column. +if exists("+colorcolumn") + set colorcolumn=+1 " color textwidth+1-th line +endif + " Modelined are used to configure files. if exists('&modeline') set modeline @@ -108,7 +118,7 @@ if has("autocmd") au! " For all text files set 'textwidth' to 78 characters. - autocmd FileType text setlocal textwidth=78 + autocmd FileType text setlocal textwidth=79 " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler @@ -189,14 +199,8 @@ if has("gui_running") "set guifont=FreeMono:h12 set lines=50 set columns=85 - if exists("+spell") - set spell - endif set encoding=utf-8 "set fileencodings=utf-8 - if exists("+colorcolumn") - set colorcolumn=+1 " color textwidth+1-th line - endif if has("win32") || has("win64") set guifont=Courier\ AM:h12 endif @@ -218,5 +222,7 @@ if has("gui_running") " Open file in a new tab. map :browse tabnew %:p:h +else + colors evening endif