Chinaunix首页 | 论坛 | 博客
  • 博客访问: 536291
  • 博文数量: 84
  • 博客积分: 6010
  • 博客等级: 准将
  • 技术积分: 2109
  • 用 户 组: 普通用户
  • 注册时间: 2006-09-25 14:02
文章分类

全部博文(84)

文章存档

2011年(10)

2010年(22)

2009年(16)

2008年(36)

我的朋友

分类: LINUX

2008-10-06 21:01:00

gvims:
#!/bin/sh
if [ -r ~/.vim/session/$1.session ]; then
gvim  "+source ~/.vim/session/$1.session" "+rviminfo ~/.vim/session/$1.session.viminfo" "+let g:cmd = \"gvims\" " "+command Noprj let g:cmd = \"\" "
else
read -p "Create a new proj ? (Y/n) " ans
if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
ans="y"
else
ans="n"
fi
if [ "$ans" = "y" ]; then
gvim "+let g:myfilename = \"$1\" " "+let g:cmd = \"gvims\" " "+command Noprj let g:cmd = \"\" "
fi
fi

vims:
#!/bin/sh
if [ -r ~/.vim/session.vim/$1.session ]; then
/usr/bin/vim  "+source ~/.vim/session.vim/$1.session" "+rviminfo ~/.vim/session.vim/$1.session.viminfo" "+let g:cmd = \"vims\" " "+command Noprj let g:cmd = \"\" " -u /etc/vim/vimrc
else
ls ~/.vim/session.vim/*.session | cut -f3 -d. | cut -f2 -d\/
read -p "Create a new proj ? (Y/n) " ans
    if [ "$ans" = "" ] ; then
    ans="y"
    fi
    if [ "$ans" = "y" ] ; then
    /usr/bin/vim "+let g:myfilename = \"$1\" " "+let g:cmd = \"vims\" " "+command Noprj let g:cmd = \"\" " -u /etc/vim/vimrc
    fi
fi

/etc/vim/vimrc.local:
set showcmd        " Show (partial) command in status line.
set showmatch        " Show matching brackets.
set ignorecase        " Do case insensitive matching
set smartcase        " Do smart case matching
set incsearch        " Incremental search
set autowrite        " Automatically save before commands like :next and :make
"set hidden             " Hide buffers when they are abandoned
set mouse=a        " Enable mouse usage (all modes) in terminals
syntax on
set hls
set sw=4
set si
set expandtab
set tabstop=4
set cindent
set autoindent
au VimLeave * exe 'if exists("g:cmd") && g:cmd == "gvims" | if strlen(v:this_session) | exe "wviminfo! " . v:this_session .  ".viminfo" | else | exe "wviminfo! " . "~/.vim/session/" .  g:myfilename . ".viminfo" | endif | endif '
au VimLeave * exe 'if exists("g:cmd") && g:cmd == "gvims" | if strlen(v:this_session) | exe "mksession! " . v:this_session | else | exe "mksession! " . "~/.vim/session/" .  g:myfilename . ".session" | endif | endif '
au VimLeave * exe 'if exists("g:cmd") && g:cmd == "vims" | if strlen(v:this_session) | exe "wviminfo! " . v:this_session . ".viminfo" | else | exe "wviminfo! " . "~/.vim/session.vim/" . g:myfilename .  ".viminfo" | endif | endif '
au VimLeave * exe 'if exists("g:cmd") && g:cmd == "vims" | if strlen(v:this_session) | exe "mksession! " . v:this_session | else | exe "mksession! " . "~/.vim/session.vim/" . g:myfilename .  ".session" | endif | endif '

/etc/vim/gvimrc.local:
set guioptions-=T

muttrc:
ignore *
unignore Date From Subject
set editor="vim"
set sendmail="/usr/sbin/sendmail -om -oi"
set use_from=yes
set use_envelope_from=yes
set edit_headers=no
set rfc2047_parameters=yes
set from="5643332@gmail.com"
set fast_reply=yes
set record="/var/mail/sent"
set folder="/var/mail"
set wait_key=yes
mailboxes "j"
bind pager h display-toggle-weed    #使用h键切换邮件头信息显示
charset-hook ^iso-8859-1$ gb2312
charset-hook !utf-8 gb2312
set charset="utf-8"
# send_charset
set send_charset="gb2312:utf-8:us-ascii:iso-8859-1"
send-hook '~t .*@.*cqupt.edu.cn.*' 'my_hdr from:dongtao@cqupt.edu.cn;my_hdr reply-to:dongtao@cqupt.edu.cn'
send-hook '~f .*@.*cqupt.edu.cn.*' 'my_hdr from:dongtao@cqupt.edu.cn;my_hdr reply-to:dongtao@cqupt.edu.cn'
set pager_index_lines=5
set pop_host="pop://doao:12334@mail.cqupt.edu.cn"
#set pop_host="pops://12345:5677@gmail.com"
set move=no
color header red black "^Subject:"
color header brightwhite blue "^From:"
color header brightwhite black "^Date:"
color tree yellow blue
color status black cyan
color body  brightwhite    blue  "[-a-z_0-9.]+@[-a-z_0-9.]+"
mono  body  bold          "[-a-z_0-9.]+@[-a-z_0-9.]+"
color  body      brightyellow  black  "^Good signature"
mono  body      bold          "^Good signature"
color  body      brightwhite   red   "^Bad signature from.*"
mono  body      bold          "^Bad signature from.*"
color  normal     white    blue
color  message    green  black
color  attachment  brightgreen  blue

# emacs-like bindings
bind editor    "\e"    kill-word
bind editor    "\e" kill-word

# map delete-char to a sane value
bind editor       delete-char

# some people actually like these settings
#set pager_stop
bind pager previous-line
bind pager next-line
bind pager i previous-line
bind pager u next-line

# Specifies how to sort messages in the index menu.
set sort=threads
set ascii_chars=yes

# Uncomment if your MTA does not strip Bcc: headers.
# (exim4 and postfix strip them, exim(3) does not.)
#unset write_bcc
# Postfix and qmail use Delivered-To for detecting loops
unset bounce_delivered

set mixmaster="mixmaster-filter"

# System-wide CA file managed by the ca-certificates package
set ssl_ca_certificates_file="/etc/ssl/certs/ca-certificates.crt"

# imitate the old search-body function
macro index \eb "~b " "search in message bodies"

# simulate the old url menu
macro index,pager,attach,compose \cb "\
set my_pipe_decode=\$pipe_decode pipe_decode\
urlview\
set pipe_decode=\$my_pipe_decode; unset my_pipe_decode" \
"call urlview to extract URLs out of a message"

# Show documentation when pressing F1
macro generic,pager " zcat /usr/share/doc/mutt/manual.txt.gz | sensible-pager" "show Mutt documentation"

# show the incoming mailboxes list (just like "mutt -y") and back when pressing "y"
macro index,pager y "?" "show incoming mailboxes list"
bind browser y exit

# If Mutt is unable to determine your site's domain name correctly, you can
# set the default here. (better: fix /etc/mailname)
#
# set hostname=cs.hmc.edu

# If your sendmail supports the -B8BITMIME flag, enable the following
#
# set use_8bitmime

##
## *** DEFAULT SETTINGS FOR THE ATTACHMENTS PATCH ***
##

##
## Please see the manual (section "attachments")  for detailed
## documentation of the "attachments" command.
##
## Removing a pattern from a list removes that pattern literally. It
## does not remove any type matching the pattern.
##
##  attachments   +A */.*
##  attachments   +A image/jpeg
##  unattachments +A */.*
##
## This leaves "attached" image/jpeg files on the allowed attachments
## list. It does not remove all items, as you might expect, because the
## second */.* is not a matching expression at this time.
##
## Remember: "unattachments" only undoes what "attachments" has done!
## It does not trigger any matching on actual messages.

## Qualify any MIME part with an "attachment" disposition, EXCEPT for
## text/x-vcard and application/pgp parts. (PGP parts are already known
## to mutt, and can be searched for with ~g, ~G, and ~k.)
##
## I've added x-pkcs7 to this, since it functions (for S/MIME)
## analogously to PGP signature attachments. S/MIME isn't supported
## in a stock mutt build, but we can still treat it specially here.
##
attachments   +A */.*
attachments   -A text/x-vcard application/pgp.*
attachments   -A application/x-pkcs7-.*

## Discount all MIME parts with an "inline" disposition, unless they're
## text/plain. (Why inline a text/plain part unless it's external to the
## message flow?)
##
attachments   +I text/plain
 
## These two lines make Mutt qualify MIME containers.  (So, for example,
## a message/rfc822 forward will count as an attachment.)  The first
## line is unnecessary if you already have "attach-allow */.*", of
## course.  These are off by default!  The MIME elements contained
## within a message/* or multipart/* are still examined, even if the
## containers themseves don't qualify.
##
#attachments  +A message/.* multipart/.*
#attachments  +I message/.* multipart/.*

## You probably don't really care to know about deleted attachments.
attachments   -A message/external-body
attachments   -I message/external-body

# enable mime lookup by extension
mime_lookup application/octet-stream

##
# See /usr/share/doc/mutt/README.Debian for details.
#source /usr/lib/mutt/source-muttrc.d|


阅读(906) | 评论(3) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-10-21 14:20:49

set ssop=blank,resize,buffers,curdir,folds,help,options,globals,tabpages,winsize,winpos 使得gvims打开项目时能保持上次窗口的大小(resize).

chinaunix网友2008-10-10 13:43:15

map :let g:size = input("输入字体大小:")exe "set gfn=永中宋体\\ " . g:size

dongtao2008-10-09 15:47:34

用~/.muttrc,才能在mutt里面按y以显示当前用户邮箱列表(mailboxes)