” Turn off the vi compatibility mode
set nocompatible
” set runtime path
set runtimepath^=~/.vim/plugged
“==========================================
” Plugin Settings
“==========================================
call plug#begin(‘~/.vim/plugged’)
” File fuzzy query
Plug ‘kien/ctrlp.vim’
Plug ‘scrooloose/syntastic’
Plug ‘majutsushi/tagbar’
” Automatic completion of the html/xml label
Plug ‘docunext/closetag.vim’, { ‘for’: [‘html’, ‘xml’] }
” status bar
“Plug ‘powerline/powerline’
” molokai-theme
Plug ‘tomasr/molokai’
” dracula-theme
Plug ‘dracula/vim’
” Directory tree
Plug ‘scrooloose/nerdtree’
” Automatic completion
Plug ‘Shougo/neocomplete.vim’
” quickly comment
Plug ‘scrooloose/nerdcommenter’
” airline
Plug ‘vim-airline/vim-airline’
Plug ‘vim-airline/vim-airline-themes’
call plug#end()
“==========================================
” General Settings
“==========================================
” set backspace work style
set backspace=indent,eol,start
” set leader key
let mapleader = “\”
” Grammar highlighting
syntax on
” Detect file types
filetype on
” Change the indentation mode according to the file type
filetype indent on
” Allow plugins
filetype plugin on
filetype plugin indent on
” save file
set fileformats=dos,unix,mac
” Highlight the current column
set cursorcolumn
” Highlight the current line
set cursorline
” Disable the mouse
set mouse-=a
” Enable the mouse
“set mouse=a
” reomove toolbar
set guioptions-=T
” remove menubar
set guioptions-=m
” Cancel the backup
set nobackup
” display status bar
set laststatus=2
” set font style
if has(‘gui_win32′)
set guifont=Consolas:h12
else
set guifont=Source_Code_Pro:h12
endif
autocmd InsertEnter * se cul
“==========================================
” Display Settings
“==========================================
” The status bar shows the line number column number
set ruler
” The status bar displays the input command
set showcmd
” shows vim mode
set showmode
” Highlight match search
set hlsearch
set incsearch
” Ignore case when searching
set ignorecase
” One or more capital letters are capitalized sensitive
set smartcase
” Show brackets match
set showmatch
” code folding
set foldenable
” floding style
” manual
” indent
” expr
” syntax
” diff
” marker
set foldmethod=indent
set foldlevel=99
” Customize shortcuts zz
let g:FoldMethod = 0
map zz :call ToggleFold()
fun! ToggleFold()
if g:FoldMethod == 0
exe “normal! zM”
let g:FoldMethod = 1
else
exe “normal! zR”
let g:FoldMethod = 0
endif
endfun
” indent config
” Smart indent
set smartindent
” Turn on auto indent
set autoindent
set cindent
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
” Use spaces instead of tab indentation
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
” Show line number
set number
“==========================================
” FileEncode Settings
“==========================================
” Set the encoding to utf-8
set encoding=utf-8
” utomatically determine the coding sequence
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set helplang=cn
“set langmenu=zh_CN.UTF-8
“set enc=2byte-gb18030
set termencoding=utf-8
“Use Unix as the standard file type
set ffs=unix,dos,mac
set formatoptions+=m
set formatoptions+=B
” Sync clipboard
” set clipboard+=unnamed
“==========================================
” HotKey Settings
“==========================================
” Close the arrow keys
map
map
map
map
” Smart way to move between windows
nnoremap wj j
nnoremap wk k
nnoremap wh h
nnoremap wl l
” close window
nnoremap wc :close
” save file
nnoremap fs :w
” instead of esc
inoremap jj
” closetag ({[
imap () ()
imap {} {}
imap [] []
imap “” “”
imap ” ”
imap <> <>
” Vim allows the use of the window copy and paste shortcut keys
map “+y
map “+p
” Disable F1 to bring up system help
” I can type :help on my own, thanks. Protect your fat fingers from the evils of
noremap ”
“==========================================
” commenter Settings
“==========================================
” Instructions for use
” cc Comment the current row or select the line
” cu Uncomment the current row or select the line
let g:NERDSpaceDelims=1
let g:NERDAltDelims_python = 1
“==========================================
” Closetag Settings Html tag completion
“==========================================
let g:closetag_html_style=1
“==========================================
” Airline Settings
“==========================================
let g:airline_powerline_fonts = 1
if !exists(‘g:airline_symbols’)
let g:airline_symbols = {}
endif
if has(‘gui_win32’)
let g:airline_left_sep = ”
let g:airline_left_alt_sep = ”
let g:airline_right_sep = ”
let g:airline_right_alt_sep = ”
let g:airline_symbols.branch = ”
let g:airline_symbols.readonly = ”
let g:airline_symbols.linenr = ”
else
let g:airline_left_sep = ‘’
let g:airline_left_alt_sep = ‘’
let g:airline_right_sep = ‘’
let g:airline_right_alt_sep = ‘’
let g:airline_symbols.branch = ‘’
let g:airline_symbols.readonly = ‘’
let g:airline_symbols.linenr = ‘’
endif
” ignore whitespace
let g:airline#extensions#whitespace#enabled=0
” tabline
“let g:airline#extensions#tabline#enabled = 1
“nnoremap bn :bn
“nnoremap bp :bp
” Theme Settings
“==========================================
color dracula
“set t_Co=256
“set background=dark
“color molokai
“==========================================
” Ctrlp Settings
“==========================================
let g:ctrlp_map=’fl’
let g:ctrlp_cmd=’CtrlP’
let g:ctrlp_working_path_mode=0
let g:ctrlp_match_window_bottom=1
let g:ctrlp_max_height=15
let g:ctrlp_match_window_reversed=0
let g:ctrlp_mruf_max=500
let g:ctrlp_follow_symlinks=1
set wildignore+=*/tmp/*,*.so,*.swp,*.zip ” Linux/MacOSX
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe ” Windows
“==========================================
” NerdTree Settings
“==========================================
let NERDChristmasTree=0
let NERDTreeWinSize=25
let NERDTreeChDirMode=2
let NERDTreeShowHidden=1
let NERDTreeShowLineNumbers=0
let NERDTreeIgnore=[‘\~$’, ‘\.pyc$’, ‘\.swp$’]
let NERDTreeShowBookmarks=1
let NERDTreeWinPos=”left”
“open a NERDTree automatically when vim starts up if no files were specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists(“s:std_in”) | NERDTree | endif
” open NERDTree automatically when vim starts up on opening a directory
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists(“s:std_in”) | exe ‘NERDTree’ argv()[0] | wincmd p | ene | endif
” Close vim if the only window left open is a NERDTree
autocmd bufenter * if (winnr(“$”) == 1 && exists(“b:NERDTree”) && b:NERDTree.isTabTree()) | q | endif
nnoremap n :NERDTreeToggle
“==========================================
” Neocomplete Settings
“==========================================
“Note: This option must be set in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)!
” Disable AutoComplPop.
let g:acp_enableAtStartup = 0
” Use neocomplete.
let g:neocomplete#enable_at_startup = 1
” Use smartcase.
let g:neocomplete#enable_smart_case = 1
” Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3
” Define keyword.
if !exists(‘g:neocomplete#keyword_patterns’)
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns[‘default’] = ‘\h\w*’
” Enable heavy omni completion.
if !exists(‘g:neocomplete#sources#omni#input_patterns’)
let g:neocomplete#sources#omni#input_patterns = {}
endif
“let g:neocomplete#sources#omni#input_patterns.php = ‘[^. \t]->\h\w*\|\h\w*::’
“let g:neocomplete#sources#omni#input_patterns.c = ‘[^.[:digit:] *\t]\%(\.\|->\)’
“let g:neocomplete#sources#omni#input_patterns.cpp = ‘[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::’
” For perlomni.vim setting.
” https://github.com/c9s/perlomni.vim
let g:neocomplete#sources#omni#input_patterns.perl = ‘\h\w*->\h\w*\|\h\w*::’
“==========================================
” Other Settings
“==========================================
” The vimrc file is automatically loaded after modification, windows
“autocmd! bufwritepost _vimrc source %
” The vimrc file is automatically loaded after modification, linux
“autocmd! bufwritepost .vimrc source %
ctrl + w + h 光标 focus 左侧树形目录
ctrl + w + l 光标 focus 右侧文件显示窗口
ctrl + w + w 光标自动在左右侧窗口切换
ctrl + w + r 移动当前窗口的布局位置
o 在已有窗口中打开文件、目录或书签,并跳到该窗口
go 在已有窗口 中打开文件、目录或书签,但不跳到该窗口
t 在新 Tab 中打开选中文件/书签,并跳到新 Tab
T 在新 Tab 中打开选中文件/书签,但不跳到新 Tab
i split 一个新窗口打开选中文件,并跳到该窗口
gi split 一个新窗口打开选中文件,但不跳到该窗口
s vsplit 一个新窗口打开选中文件,并跳到该窗口
gs vsplit 一个新 窗口打开选中文件,但不跳到该窗口
ctrl+w x 窗口位置对调
! 执行当前文件
O 递归打开选中 结点下的所有目录
x 合拢选中结点的父目录
X 递归 合拢选中结点下的所有目录
e Edit the current dif
双击 相当于 NERDTree-o
中键 对文件相当于 NERDTree-i,对目录相当于 NERDTree-e
D 删除当前书签
P 跳到根结点
p 跳到父结点
K 跳到当前目录下同级的第一个结点
J 跳到当前目录下同级的最后一个结点
k 跳到当前目录下同级的前一个结点
j 跳到当前目录下同级的后一个结点
C 将选中目录或选中文件的父目录设为根结点
u 将当前根结点的父目录设为根目录,并变成合拢原根结点
U 将当前根结点的父目录设为根目录,但保持展开原根结点
r 递归刷新选中目录
R 递归刷新根结点
m 显示文件系统菜单
cd 将 CWD 设为选中目录
I 切换是否显示隐藏文件
f 切换是否使用文件过滤器
F 切换是否显示文件
B 切换是否显示书签
q 关闭 NerdTree 窗口
? 切换是否显示 Quick Help
./configure --prefix=/usr/local/freetype
make
sudo make install
#编译freetype过程中以下harfbuss没有则安装
# external zlib: yes (pkg-config)
# bzip2: yes (autoconf test)
# libpng: yes (pkg-config)
# harfbuzz: no (pkg-config)
brew install harfbuzz
进入到php/ext/gd/
make clean
#重新编译GD之前一定要make clean就是因为忘记了这个找个半天错误。
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-freetype-dir=/usr/local/freetype
make
sudo make install
./configure --prefix=/usr/local/jpeg
make
sudo make install
进入到php/ext/gd/
make clean
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype
make
sudo make install