代码: 全选
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
代码: 全选
execute pathogen#infect()
代码: 全选
cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdtree
代码: 全选
cd ~/.vim/bundle
git clone https://github.com/mattn/emmet-vim
以下是我完整的vimrc,我还装了syntastic等插件
代码: 全选
" All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just
" /usr/share/vim/vimfiles/archlinux.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vimrc), since archlinux.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing archlinux.vim since it alters the value of the
" 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages.
runtime! archlinux.vim
" If you prefer the old-style vim functionalty, add 'runtime! vimrc_example.vim'
" Or better yet, read /usr/share/vim/vim74/vimrc_example.vim or the vim manual
" and configure vim to your own liking!
"##### auto fcitx ###########
let g:input_toggle = 1
function! Fcitx2en()
let s:input_status = system("fcitx-remote")
if s:input_status == 2
let g:input_toggle = 1
let l:a = system("fcitx-remote -c")
endif
endfunction
function! Fcitx2zh()
let s:input_status = system("fcitx-remote")
if s:input_status != 2 && g:input_toggle == 1
let l:a = system("fcitx-remote -o")
let g:input_toggle = 0
endif
endfunction
set ttimeoutlen=150
"退出插入模式
autocmd InsertLeave * call Fcitx2en()
"进入插入模式
autocmd InsertEnter * call Fcitx2zh()
"##### auto fcitx end ######
" general setting
"php
autocmd FileType php setlocal makeprg=zca\ %<.php
autocmd FileType php setlocal errorformat=%f(line\ %l):\ %m
" .vimrc
" See: http://vimdoc.sourceforge.net/htmldoc/options.html for details
" For vim display multi-byte character support (CJK support, for example):
set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,gb18030,latin1
"set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,gb18030,latin1
" For output (web browser, for example)
set encoding=utf-8
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"vim7.1在windows下的编码设置。
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has("win32")
set fileencoding=chinese
else
set fileencoding=utf-8
endif
"解决菜单乱码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
"解决consle输出乱码
"language messages zh_CN.utf-8
" Independent folder for backup
if has("win32")
let $VIMFILES = $VIM.'/vimfiles'
else
let $VIMFILES = $HOME.'/.vim'
endif
" to use Backspace
set backspace=2
" runtime path manipulation
"set nocp
execute pathogen#infect()
" to cross
set whichwrap+=<,>,h,l
" to use clipboard from win to vim by shift+insert
" and from vim to win by "+y
map <c-c> "+y
map <c-v> "+p
" Visual{
" set font (Uses Monaco on Windows and Inconsolata everywhere else)
if has("gui_running")
if has("gui_gtk2")
set guifont=Inconsolata\ 18
elseif has("gui_macvim")
set guifont=Menlo\ Regular:h14
elseif has("gui_win32")
set guifont=Consolas:h14:cANSI
elseif has("gui_win64")
set guifont=Consolas:h14:cANSI
endif
endif
set 囗囗囗=YouYuan\ 18
" show line number
set number
" highlight syntax
syntax on
" tab weight
set tabstop=4
" auto indent
set autoindent
" Number of spaces to use for each step of (auto)indent
set shiftwidth=4
" Use the appropriate number of spaces to insert a <Tab>.
set expandtab
" jump to the matching one
set showmatch
" highlight all its matches
set hlsearch
" show immediately where the so far typed pattern matches
set incsearch
" ignore case
set ignorecase
" override the 'ignorecase' option if the search pattern contains upper case characters
set smartcase
" to use colors that look good on a dark background
set background=dark
" color theme
colorscheme darkblue
" full screen only for windows os
"au GUIEnter * simalt ~x
" nerdcommender
filetype plugin on
" syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_quiet_messages = { "level": "warnings" }
" html5
let g:syntastic_html_checkers = ['tidy']
" }