" set default encoding
set fenc=utf-8
set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936
"set color
colorscheme desert
" set gui font
set guifont=Bitstream\ Vera\ Sans\ Mono\ 10
" use vim to key inset nocompatible
" set the rows of history
set history=100
" pop window to confirm if the change
set confirm
" set clipboard shared with window sys
set clipboard+=unnamed
" listen filetype
filetype on
" loading file plugin
filetype plugin on
"set indent for special file
filetype indent on
" save global var
set viminfo+=!
" not be spilt row when having keyword as follow
setiskeyword+=_,$,@,%,#,-" set programmer highlight
syntax on
" show highlight for keywords
syntax keyword gtkType gint gshort guint gushort gulong gdouble gfloat gchar guchar gboolean gpointer
highlight link gtkType Type
" highlight for char which over 100limited
highlight OverLength ctermbg=red ctermfg=white guibg=red guifg=white
match OverLength '\%101v.*'
" the color of the status line
highlight StatusLine guifg=SlateBlue guibg=Yellow
highlight StatusLineNC guifg=Gray guibg=White
" file settings
"set backup fileset nobackup
" not create swap file
setlocal noswapfile
set bufhidden=hide
set linespace=0
" auto completed opr in enhanced commandset wildmenu
" show the row and col at the position which mouse focused on
set ruler
set rulerformat=%20(%2*%<%f%=\ %m%r\ %3l\ %c\ %p%%%)
" the row high in cmd
setcmdheight=2" use backspace keyboard to deal with those which ard indent, eol, start,etc.
set backspace=2
" allow backspace cross wide
setwhichwrap+=<,>,h,l
" could use mouse at buffer in any where
set mouse=a
set selection=exclusive
set selectmode=mouse,key
" not show help whern started
setshortmess=atI
" tell us which row has been modified
set report=0
"set not bell sound by using vim keyboard
set noerrorbells
" show blank when splited window
set fillchars=vert:\ ,stl:\ ,stlnc:\
" show highlight for the matched word
set showmatch
" the time of the highlight which have been matched
set matchtime=5
" ignore caseset ignorecase
" not show the row which the search keyword in
set nohlsearch
" highlight for search keyword when finding keyword
set incsearch
" input :set list cmd to be seen what should be shown
set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$
" keep 3 row between the buffer of the top and the bottom
setscrolloff=3" not bell
set novisualbell
" the content of the status lines
setstatusline=%F%m%r%h%w\[FORMAT=%{&ff}]\[TYPE=%Y]\[POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}" show status line
set laststatus=2
" auto formatsetformatoptions=tcrqn
" extend prev row indent,special for multi row comments
set autoindent
"if c program then auto indent
set smartindent
" use c indent
set cindent
" tab for4 chars
settabstop=4" indent for 4 blank
set softtabstop=4
set shiftwidth=4
" not use tab to replace blank
set noexpandtab
" not change row
set nowrap
" sorted by name
let Tlist_Sort_Type ="name"let Tlist_Use_Right_Window =1let Tlist_Compart_Format =1let Tlist_Exist_OnlyWindow =1let Tlist_File_Fold_Auto_Close =0let Tlist_Enable_Fold_Column =0" Autocommands
if has("autocmd")
autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number
autocmd FileType xml,html vmap <C-o> <ESC>'<i<!--<ESC>o<ESC>'>o-->
autocmd FileType java,c,cpp,cs vmap <C-o> <ESC>'<o/*<ESC>'>o*/
autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100
autocmd Filetype html,xml,xsl source $VIMRUNTIME/plugin/closetag.vim
\ if line("'\"") > 0 && line("'\"") <= line("{1}quot;) |
\ exe "normal g`\"" |
\ endif
endif " has("autocmd")
" use F5 to compile and run c program
" use F6 to compile and run c++ program
" if use in window then should be remove './'
" used for c
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
exec "!gcc % -o %<"
exec "! ./%<"
endfunc
" used for c++
map <F6> :call CompileRunGpp()<CR>
func! CompileRunGpp()
exec "w"
exec "!g++ % -o %<"
exec "! ./%<"
endfunc
" show more clearly in .NFO file
set encoding=utf-8
function! SetFileEncodings(encodings)
let b:myfileencodingsbak=&fileencodings
let &fileencodings=a:encodings
endfunction
function! RestoreFileEncodings()
let &fileencodings=b:myfileencodingsbak
unlet b:myfileencodingsbak
endfunction
au BufReadPre *.nfo call SetFileEncodings('cp437')|set ambiwidth=single
au BufReadPost *.nfo call RestoreFileEncodings()
" show highlight for txt or vim file
au BufRead,BufNewFile * setfiletype txt
" use black keyboard to expand
set foldenable
"set foldmethod=manual
set foldmethod=syntax
set foldlevel=100
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
" set minibufexpl plugin
" let g:miniBufExplMapWindowNavVim = 1
" let g:miniBufExplMapWindowNavArrows = 1
" let g:miniBufExplMapCTabSwitchBufs = 1
" let g:miniBufExplModSelTarget = 1
" set mapleader
let mapleader = ","
" use 'ss' to load .vimrc
map <silent> <leader>ss :source ~/.vimrc<cr>
" use 'ee' to open .vimrc file quickly
map <silent> <leader>ee :e ~/.vimrc<cr>
" use 'w' save file
map <silent> <leader>w :w<cr>
" use 'wq' to save and quit file quickly
map <silent><leader>wq :wq<cr>
" auto source .vimrc and make it effect
autocmd! bufwritepost .vimrc source ~/.vimrc
自定义zsh配置
# If you come from bash you might have to change your $PATH.# export PATH=$HOME/bin:/usr/local/bin:$PATHif[ -x /usr/bin/dircolors ];theneval"`dircolors -b`"aliasls='ls --color=auto'aliasdir='dir --color=auto'aliasvdir='vdir --color=auto'aliasgrep='grep --color=auto'aliasfgrep='fgrep --color=auto'aliasegrep='egrep --color=auto'fiexportLESS=eFRX
exportGREP_OPTIONS='--exclude-dir=.svn --exclude-dir=.git --color=auto -nrI'exportGOPATH=$HOME/go
exportGO111MODULE=on
if[ -f /usr/local/bin/virtualenvwrapper.sh ];thenexportWORKON_HOME=/Users/keithl/.virtualenv
exportVIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
exportVIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
exportVIRTUALENV_DISTRIBUTE=true
source /usr/local/bin/virtualenvwrapper.sh
fisource ~/.bash_profile
# Path to your oh-my-zsh installation.exportZSH="/Users/keithl/.oh-my-zsh"# Set name of the theme to load --- if set to "random", it will# load a random theme each time oh-my-zsh is loaded, in which case,# to know which specific one was loaded, run: echo $RANDOM_THEME# See https://github.com/ohmyzsh/ohmyzsh/wiki/ThemesZSH_THEME="robbyrussell"# Set list of themes to pick from when loading at random# Setting this variable when ZSH_THEME=random will cause zsh to load# a theme from this variable instead of looking in $ZSH/themes/# If set to an empty array, this variable will have no effect.# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )# Uncomment the following line to use case-sensitive completion.# CASE_SENSITIVE="true"# Uncomment the following line to use hyphen-insensitive completion.# Case-sensitive completion must be off. _ and - will be interchangeable.# HYPHEN_INSENSITIVE="true"# Uncomment the following line to disable bi-weekly auto-update checks.# DISABLE_AUTO_UPDATE="true"# Uncomment the following line to automatically update without prompting.# DISABLE_UPDATE_PROMPT="true"# Uncomment the following line to change how often to auto-update (in days).# export UPDATE_ZSH_DAYS=13# Uncomment the following line if pasting URLs and other text is messed up.# DISABLE_MAGIC_FUNCTIONS="true"# Uncomment the following line to disable colors in ls.# DISABLE_LS_COLORS="true"# Uncomment the following line to disable auto-setting terminal title.# DISABLE_AUTO_TITLE="true"# Uncomment the following line to enable command auto-correction.# ENABLE_CORRECTION="true"# Uncomment the following line to display red dots whilst waiting for completion.# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work)# See https://github.com/ohmyzsh/ohmyzsh/issues/5765# COMPLETION_WAITING_DOTS="true"# Uncomment the following line if you want to disable marking untracked files# under VCS as dirty. This makes repository status check for large repositories# much, much faster.# DISABLE_UNTRACKED_FILES_DIRTY="true"# Uncomment the following line if you want to change the command execution time# stamp shown in the history command output.# You can set one of the optional three formats:# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"# or set a custom format using the strftime function format specifications,# see 'man strftime' for details.# HIST_STAMPS="mm/dd/yyyy"# Would you like to use another custom folder than $ZSH/custom?# ZSH_CUSTOM=/path/to/new-custom-folder# Which plugins would you like to load?# Standard plugins can be found in $ZSH/plugins/# Custom plugins may be added to $ZSH_CUSTOM/plugins/# Example format: plugins=(rails git textmate ruby lighthouse)# Add wisely, as too many plugins slow down shell startup.# plugins=(git)plugins=(git colorize github jira vagrant virtualenv pip python brew macos zsh-syntax-highlighting zsh-autosuggestions zsh-completions)source$ZSH/oh-my-zsh.sh
# User configuration# export MANPATH="/usr/local/man:$MANPATH"# You may need to manually set your language environment# export LANG=en_US.UTF-8# Preferred editor for local and remote sessions# if [[ -n $SSH_CONNECTION ]]; then# export EDITOR='vim'# else# export EDITOR='mvim'# fi# Compilation flags# export ARCHFLAGS="-arch x86_64"# Set personal aliases, overriding those provided by oh-my-zsh libs,# plugins, and themes. Aliases can be placed here, though oh-my-zsh# users are encouraged to define aliases within the ZSH_CUSTOM folder.# For a full list of active aliases, run `alias`.## Example aliases# alias zshconfig="mate ~/.zshrc"# alias ohmyzsh="mate ~/.oh-my-zsh"aliascls="clear"aliastailf="tail -f"aliasll="ls -al"aliasgreadlink="readlink"exportLC_ALL="zh_CN.UTF-8"PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p%{$fg[cyan]%}%d %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}>'exportPATH="/usr/local/opt/qt/bin:$PATH"aliasssh2work01="ssh ubuntu@work01"aliasssh2work02="ssh ubuntu@work02"aliasssh2master="ssh root@master"aliasgitlog="git log --graph --pretty=oneline --abbrev-commit"