nbalonso.com

The Shell Where I Work

| Comments

Recently I renewed my personal laptop and one of the first things I do on a new computer is to customise the look and feel of the shell. On a working day I spend a lot of time on a terminal.

Disclaimer: the objective of this post is to have notes to myself more than anything else, so you might find it boring or irrelevant

  • Install iTerm2, no question about this.
  • Solarized theme
  • brew for installing grc and nmap.
  • Here’s my ~/.bash_profile with all the bells and whistles
# Tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx

# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'

# Adding grc aliases
alias colourify="grc -es --colour=auto"
alias configure='colourify ./configure'
alias diff='grc -es --colour=auto diff'
alias make='grc -es --colour=auto make'
alias gcc='grc -es --colour=auto gcc'
alias g++='grc -es --colour=auto g++'
alias as='grc -es --colour=auto as'
alias gas='grc -es --colour=auto gas'
alias ld='grc -es --colour=auto ld'
alias netstat='grc -es --colour=auto netstat'
alias ping='grc -es --colour=auto ping'
alias traceroute='grc -es --colour=auto traceroute'
alias cat="grc -es --colour=auto cat"
alias head="grc -es --colour=auto head"
alias tail="grc -es --colour=auto tail"
#original grc line below
#source "`brew --prefix grc`/etc/grc.bashrc"

# Prompt
BGREEN='\[\033[1;32m\]'
GREEN='\[\033[0;32m\]'
BRED='\[\033[1;31m\]'
RED='\[\033[0;31m\]'
BBLUE='\[\033[1;34m\]'
BLUE='\[\033[0;34m\]'
NORMAL='\[\033[00m\]'
PS1="${BLUE}(${RED}\w${BLUE}) ${NORMAL}\h ${RED}\$ ${NORMAL}"
  • And because Vim is my main editor here my ~/.vimrc , again with colours and whistles
set nocompatible   " use Vim settings rather than Vi settings
syntax on
filetype on     " enable file type detection
filetype indent on  " indent files by language
filetype plugin on  " enable plugins
" let pathogen take care of the plugins
execute pathogen#infect()
" currently installed plugins: cd ~/.vim/bundle && git clone --depth 1
" git://github.com/altercation/vim-colors-solarized.git
" git://github.com/scrooloose/nerdtree.git

set background=dark
colorscheme solarized

set hlsearch        " enable highligthing in search
set incsearch       " do incremental searching
set ignorecase      " by default do case insensitive search
set smartcase       " if one letter is capital we want case sensitivity
set autoindent      " let Vim autoident
set visualbell      " show graphical warnings instead of sound
set noswapfile      " disable all the swapping when using Vim
set showmatch       " highlight mathing brakets, quotes...
set cursorline      " display a line on the cursor line
set backspace=indent,eol,start  " allow backspacing over everything in insert mode
set fileencoding=utf-8  " set the file encoding to utf8 for reading
set encoding=utf-8  " set the file encoding to utf8 for saving
set number      " show line numbers
set history=50      " keep 50 lines of command line history
set mouse=a     " enable mouse selection for visual mode
set ruler       " show the cursor position all the time
set showcmd     " display incomplete commands

" Command to see the difference between the current buffer and original file
 if !exists(":DiffOrig")
      command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
                  \ | wincmd p | diffthis
endif

So those are my settings. What about yours? do you work much in the command line? care to share?

If you are wondering how does it look like here is a screenshot

EDIT: a friend of mine complained that with this setup when he pastes indented code into Vim it gets all over the place. Well the solution is very simple, just execute :set paste in Vim and you are all set to paste indented code :)

Comments