vimrc bashrc

来源:互联网 发布:mac 图片尺寸修改 编辑:程序博客网 时间:2024/05/04 18:34


vimrc 


set nocompatible" Use Vim defaults (much better!)set bs=indent,eol,start" allow backspacing over everything in insert modeset viminfo='20,\"50" read/write a .viminfo file, don't store more" than 50 lines of registersset history=200" keep 50 lines of command line historyset ruler" show the cursor position all the timeif has("cscope") && filereadable("/usr/bin/cscope")   set csprg=/usr/bin/cscope   set csto=0   set cst   set nocsverb   " add any database in current directory   if filereadable("cscope.out")      cs add cscope.out   " else add database pointed to by environment   elseif $CSCOPE_DB != ""      cs add $CSCOPE_DB   endif   set csverbendif" 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 hlsearchendiffiletype plugin onif &term=="xterm"     set t_Co=8     set t_Sb=m     set t_Sf=mendif" Don't wake up system with blinking cursor:let &guicursor = &guicursor . ",a:blinkon0""" ===================================================" automatically indent lines (default)set autoindentset cindentset smartindentset shiftwidth=4set softtabstop=4set tabstop=4set expandtabset nobackupset noswapfile" set smartcaseset ignorecaseset hlsearchset numberset isset noincsearchset nolist"" set cmdheight=2"" In console mode, set mouse=v and set nonumber, then right-click it to copy ."" In gvim, set mouse=a, apply command y to copy.set mouse=v" set mouse=a"" autocmd GUIEnter * simalt ~x"" set guioptions-=Tset guioptions=" show the laststatus line alwaysset laststatus=2" number of undosset undolevels=200" do i have a fast terminal?set nottyfast" fuck the beepsset noerrorbells" for hidden buffersset hidden" continue searching at top when hitting bottomset wrapscan"always show the commandset showcmd" Continue searching at top when hitting bottomset smarttab" show all changesset report=0" Highlight matching parensset matchpairs=(:),[:],{:},<:>" no the terminal is not always fast" fancy menuset wildmenuset uc=75let mapleader=","let g:mapleader=","" Use brighter colors if your xterm has a dark background.if &term =~ "xterm"  set background=dark  " set background=lightendif" comment typesset comments=b:#,:%,fb:-,n:),n:> fo=cqrt" CTRL-X and SHIFT-Del are Cutvnoremap <S-Del> "+x" CTRL-C and CTRL-Insert are Copyvnoremap <C-C> "+yvnoremap <C-Insert> "+y" CTRL-V and SHIFT-Insert are Paste" map <C-V>       "+gPmap <S-Insert>      "+gPimap <S-Insert>   "+gPvmap <S-Insert>   "+gP" au GUIEnter * simalt ~xset fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936set clipboard=unnamedcommand ABD 'a,'bdcommand ABY 'a,'bymap <C-a>   :'a,'by<cr>map <C-e>   :'a,'bd<cr>set vb t_vb=set pasteset novisualbellcolorscheme ronmap <C-p>   :b#<cr>" MiniBufExpl Colorshi MBENormal               guifg=#808080 guibg=fghi MBEChanged              guifg=#CD5907 guibg=fghi MBEVisibleNormal        guifg=#5DC2D6 guibg=fghi MBEVisibleChanged       guifg=#F1266F guibg=fghi MBEVisibleActiveNormal  guifg=#A6DB29 guibg=fghi MBEVisibleActiveChanged guifg=#F1266F guibg=fgset splitbelow set splitright " if &diff"     " diff mode"     set diffopt+=iwhite" endiffunction Linesearch()    let line = getline(".")    let repl = substitute(line, "\\", "\\\\\\\\", "g")    let repl = substitute(repl, "[", "\\\\[", "g")    let repl = substitute(repl, "]", "\\\\]", "g")    let repl = substitute(repl, "\\.", "\\\\.", "g")    let repl = substitute(repl, "/", "\\\\/", "g")    let repl = substitute(repl, "*", "\\\\*", "g")    let @/ = replendfunctionnnoremap <leader>l :call Linesearch()<cr>" nnoremap <leader>l :call Linesearch()<cr>nnnoremap <leader>/ :echo @/<cr>function Linesearchnoheader()    let line = getline(".")    let repl = substitute(line, "^.\\s*", "", "")    let repl = substitute(repl, "\\", "\\\\\\\\", "g")    let repl = substitute(repl, "[", "\\\\[", "g")    let repl = substitute(repl, "]", "\\\\]", "g")    let repl = substitute(repl, "\\.", "\\\\.", "g")    let repl = substitute(repl, "/", "\\\\/", "g")    let repl = substitute(repl, "*", "\\\\*", "g")    let @/ = replendfunctionnnoremap <leader>h :call Linesearchnoheader()<cr>" nnoremap <leader>h :call Linesearchnoheader()<cr>nnnoremap <leader>cd :cd %:p:h<CR>:pwd<CR>nnoremap <leader>ce :cd %:p:h<CR>:e .<CR>nnoremap <F8> :vertical wincmd f<CR>

function! Appendwordtoregister()    let var_s = getreg('/', 1)    let var_smode = getregtype('/')    let curword = expand('<cword>')    if var_s != ""        if curword != ""            let var_s = substitute(var_s, "^\\\\(", "", "")             let var_s = substitute(var_s, "\\\\)$", "", "")             let var_s = '\(' . var_s . '\|' . curword . '\)'        endif    else        let var_s = curword    endif    call setreg('/', var_s, var_smode)endfunctionnnoremap <leader>a :call Appendwordtoregister()<cr>




bashrc

# ==========================================================================export GREP_OPTIONS='--color=auto'export GREP_COLOR='1;4;32'# export PS1="\[\e[1;33m\]$(ppwd \l)\u:\[\e[1;31m\]\w> \[\e[0m\]"# export PS1="\[\e[1;33m\]\u:\[\e[1;31m\]\w\n> \[\e[0m\]"export PS1="\[\e[1;36m\]\u:\[\e[1;31m\]\w\n> \[\e[0m\]"# colorful man pageexport PAGER="`which less` -s"export BROWSER="$PAGER"export LESS_TERMCAP_mb=$'\E[01;36m'export LESS_TERMCAP_md=$'\E[01;31m'export LESS_TERMCAP_me=$'\E[0m'export LESS_TERMCAP_se=$'\E[0m'export LESS_TERMCAP_so=$'\E[01;44;33m'export LESS_TERMCAP_ue=$'\E[0m'export LESS_TERMCAP_us=$'\E[01;35m'# Less Colors for Man Pages# export LESS_TERMCAP_mb=$'\E[01;31m'       # begin blinking# export LESS_TERMCAP_md=$'\E[01;38;5;74m'  # begin bold# export LESS_TERMCAP_me=$'\E[0m'           # end mode# export LESS_TERMCAP_se=$'\E[0m'           # end standout-mode# export LESS_TERMCAP_so=$'\E[38;5;246m'    # begin standout-mode - info box# export LESS_TERMCAP_ue=$'\E[0m'           # end underline# export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underlineexport LANG=en_US.UTF-8# export LANG=Csedprint(){    if [ "$3"x == x ]    then        sed -n "${1}p" $2    else        sed -n "${1}, ${2}p" $3    fi}findname(){    if [ "$1"x == x ]    then        echo "input the name"    else        find  . -name "$1"    fi}function fordo(){    if ! [ $# -eq 2 ]    then        echo "Usage: fordo <filename> <command> "        return    fi    filename=$1    halfcmd=$2    for f in $(cat ${filename})    do        command=${halfcmd}" "$f         eval ${command}     done}LS_COLORS='rs=0:di=01;36:ln=01;30:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;ls31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:';export LS_COLORS