Anyway enjoy :)# Written by Ed Lim
# muttrc file
# Define the = shortcut, and the entry point for the folder browser (c?)
set folder="~/mail/"
set hostname=whateveryourhostnameis.com # Name of our local host.
set hidden_host # Hide host details.
set ssl_starttls=yes
# headers
set edit_headers
ignore *
unignore Subject: Date: From: Reply-To: To: CC: BCC: X-Mailer: User-Agent:
# In this order
unhdr_order *
hdr_order From: To: Reply-To: CC: BCC: Date: Subject: X-Mailer: User-Agent:
# writing email
set editor="vim +':set textwidth=77' +':set wrap' +\`awk '/^$/ {print i+2; exit} {i++}' %s\` %s"
set ispell="aspell -e -c" #spell checker
#----- Client behaviour --------
set copy # Save a copy of sent mail
set record="=sent-mail" # saves sent mail to sent folger
set postponed="=saved-messages"
set delete=ask-yes # Ask before doing a delete.
set include=yes # Include the message in replies.
set indent_str="> " # set quotemark to 1 byte
set forward_format="Fw: %s" # subject in forwarded messages
set sort_aux=date-received # Sort threads by date received.
set abort_nosubject=no # Abort, if message has no subject.
set abort_unmodified=yes # Abort, if message wasn't edited.
set mime_forward=ask-no # use MIME when forwarding mails.
set move=no # Move mail-spool to $mbox?
set postpone=ask-yes # ask for postponing when doing an Abort.
set print=ask-yes # ask whether you really want to print.
set quit=ask-yes # ask before quitting.
set recall=no # ask for using postponed message.
set reply_to=yes # Use or ignore Reply-To.
set pager_stop # Stop at the end of a message
set pager_index_lines=10
set timeout=60 # time in seconds, till Mutt looks for new mail
set mail_check=3 # time (in seconds) how often buffy checks for new mail
set nomark_old # dont mark old messages old
set alias_file="~/.mutt/aliases"
unset mark_old
source ~/.mutt/colors
source ~/.mutt/mailboxes # Define the list of folders that receive mail.
source ~/.mutt/autoview # Define auto views
source ~/.mutt/aliases # alias file
alternative_order text/plain text/enriched text/html
Saturday, February 17, 2007
muttrc
Monday, January 1, 2007
Unix Tip
less filenameIt will print out the content of the file on to the screen but if you hit 'v' it will bring you to your favorite editor so that you can edit your file
Saturday, November 11, 2006
vimrc
"----------------------------------------------------
" vimrc file for ed lim
" @author - Ed Lim
"----------------------------------------------------
"------------ editor behaviour block ------------------
set ruler " show curser position at all times
set sw=8 " Use 8 spaces when text is indented
set tabstop=8 " sets how many spaces a tab is
"set ai " auto indent
"set si " smart indent - attempts to guess where to indent
set et " tabs converted to spaces, uncomment when needed
set incsearch " incremental search
set nohlsearch " no highlight on searching
set nowrapscan " turn off search wrapping
set nowrap " no text wraps
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set term=ansi
"set background=dark " user brighter color if xterm has a dark background
set noerrorbells " do not beep on errors
set ttyfast " Smoother scrolling
set mouse=a " have mouse enabled at all time
set virtualedit=all " allows curser to roam freely
set backspace=2 " allows backspacing over everything
set showmode " show current mode you are in
set showcmd " display incomplete commands
set showmatch " show matching braces
set undolevels=500 " set the number of undo's
set novisualbell " no sound on error
set t_vb= " turn off error bells
set noerrorbells " No sound on error
set title " Shows title in console window
set ls=2 " always show status line
set foldmethod=marker " fold method using markers
"set foldmethod=indent " fold method using indent
"-------------- backup block ------------------
set backup
set backupdir=$HOME/.VimData/vimbak
set directory=$HOME/.VimData/vimtmp
set errorfile=$HOME/.VimData/vimtmp/errors.vim
"------------ Graphical block -----------------
syntax on " Turns on syntax highlighting
set nu " Line numbers
"------------- Color definitions ----------------
hi Comment terM=bold cterm=NONE ctermfg=DarkGreen ctermbg=NONE gui=NONE guifg=Blue guibg=NONE
hi Constant term=underline cterm=NONE ctermfg=DarkRed ctermbg=NONE gui=NONE guifg=Magenta guibg=NONE
hi Special term=bold cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=SlateBlue guibg=NONE
"hi Identifier term=bold cterm=NONE ctermfg=Black ctermbg=NONE gui=NONE guifg=DarkCyan guibg=NONE
hi Statement term=bold cterm=NONE ctermfg=DarkBlue ctermbg=NONE gui=bold guifg=Brown guibg=NONE
hi PreProc term=underline cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=Purple guibg=NONE
hi Type term=underline cterm=NONE ctermfg=DarkBlue ctermbg=NONE gui=bold guifg=SeaGreen guibg=NONE
hi Underlined term=underline cterm=underline ctermfg=DarkMagenta gui=underline guifg=SlateBlue
hi Ignore term=NONE cterm=NONE ctermfg=white ctermbg=NONE gui=NONE guifg=bg guibg=NONE
"hi LineNr term=underline ctermfg=Black guifg=Black
" --------- key mappings --------------
" F1 show buffers
map <f1> :buffer<cr>
" F2 select buffer
map <f2> :buffer
Vi
What is VI?
A screen based Unix text editor.
Why VI?
Because its basic and it always come with any unix based operating system. In other words its always there!
Warning: Vi can be extremely confusing to use for a beginner but it is very powerful once mastered.
Basic Vi commands
How to get Vi to work?
On the Unix command prompt type
vi filename
Where filename is the name of the file you want to open or create
There are basically 3 different types of mode in Vi
1) Insert mode --> to get into text mode just hit the i key
2) Command mode --> to get into command mode from text mode just hit the Esc key
3) Visual mode --> to get into this mode hit the v key, this keys allows you to highlight portions of your code
Vi commands
Undo Command
u - undo the last command.
Cursor Positioning Commands
j - Moves cursor down one line, same column.
k - Moves cursor up one line, same column.
h -Moves cursor back one character.
l - Moves cursor forward one character.
$ - Moves cursor to end of current line.
:n - Moves cursor to beginning of line n.
Text Insertion Commands
i - Inserts text before cursor. Terminated by the escape key.
I - Inserts text at the beginning of the line. Terminated by the escape key.
DEL - Overwrites last character during text insertion.
ESC - Stops text insertion.
Text Deletion Commands
x - Deletes current character.
dd - Deletes current line.
dw - Deletes the current word.
d) - Deletes the rest of the current sentence.
D, d$ - Deletes from cursor to end of line.
P - Puts back text from the previous delete.
Cut and Paste Commands
yy - Puts the current line in a buffer. Does not delete the line from its current position.
p - Places the line in the buffer after the current position of the cursor.
Exiting vi
ZZ - Exits vi and saves changes.
:wq - Writes changes to current file and quits edit session.
:q! - Quits edit session (no changes made).
- Highlight the block of code you want to fold first, once highlighted you can hit the following key combination:
zc - creates the fold
zo - opens fold
zd - deletes fold
Split screen
To split a screen type this command in vi :sp
For vertical split, type :vs this splits it vertically
To navigate through the splits first hit Ctrl-W and then the arrow key to the direction of the split
Unix Commands
ls ................. show directory, in alphabetical order
mkdir .............. make a directory
rmdir .............. remove directory (rm -r to delete folders with files)
rm ................. remove files
cd ................. change current directory
man (command) ...... shows help on a specific command
pico (filename) .... easy to use text editor to edit files
passwd ............. change your password
chfn ............... change your "Real Name" as seen on finger
chsh ............... change the shell you log into
grep ............... search for a string in a file
tail ............... show the last few lines of a file
who ................ shows who is logged into the local system
w .................. shows who is logged on and what they're doing
df ................. shows disk space available on the system
du ................. shows how much disk space is being used up by folders
chmod .............. changes permissions on a file
bc ................. a simple calculator