Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 25 additions & 24 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ Plug 'nsf/gocode', { 'rtp': 'vim' }

Plug 'https://github.com/luofei614/vim-plug', { 'dir':'~/.vim/my'}

Plug 'AutoComplPop'
Plug 'vim-scripts/AutoComplPop'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'Tagbar'
Plug 'vim-scripts/Tagbar'
"Bundle 'minibufexpl.vim'

"zencoding 改名为了 Emmet
Plug 'https://github.com/luofei614/Emmet.vim'

Plug 'L9'
Plug 'vim-scripts/L9'

"Plug 'FuzzyFinder'
"Plug 'vim-scripts/FuzzyFinder'
"快速浏览文件,FuzzyFinder 也能快速浏览文件, 但是如果项目文件多会很慢
"如果系统升级可以需要运行 gem update --system, do中的命令可能需要手动运行
"Plug 'Command-T',{'do': 'cd ./ruby/command-t/; ruby extconf.rb ; make'}
Expand All @@ -26,17 +26,19 @@ Plug 'L9'
" Plugin outside ~/.vim/plugged with post-update hook
" 下面这个插件可取代Command-T 但是现在暂时不支持目录忽略,所以先暂时不用
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' }
Plug 'WebAPI.vim'
Plug 'vim-scripts/WebAPI.vim'

Plug 'Gist.vim'
Plug 'vim-scripts/Gist.vim'

Plug 'molokai'
Plug 'https://github.com/tomasr/molokai'

Plug 'Solarized'
Plug 'https://github.com/altercation/solarized'

Plug 'PDV--phpDocumentor-for-Vim'
Plug 'https://github.com/altercation/vim-colors-solarized'

"Plug 'https://github.com/luofei614/html5css3.git'
Plug 'vim-scripts/PDV--phpDocumentor-for-Vim'

" Plug 'https://github.com/luofei614/html5css3.git'

"bookmark mm 添加书签, mn 移动书签 mp 移动到前一个书签 ma 删除所有书签
Plug 'MattesGroeger/vim-bookmarks'
Expand All @@ -49,29 +51,26 @@ Plug 'pangloss/vim-javascript'
Plug 'https://github.com/othree/javascript-libraries-syntax.vim.git'


Plug 'Mark'
Plug 'vim-scripts/Mark'
"css私有前缀
Plug 'prefixer.vim'
Plug 'vim-scripts/prefixer.vim'
"能缩减HTML代码
Plug 'xml.vim'
Plug 'vim-scripts/xml.vim'
"安装此插件解决macvim下没有加号寄存器的问题。
Plug 'https://github.com/kana/vim-fakeclip.git'

Plug 'https://github.com/terryma/vim-multiple-cursors.git'

"html5插件
Plug 'othree/html5.vim'

"snippets
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'garbas/vim-snipmate'
Plug 'https://github.com/bonsaiben/bootstrap-snippets.git'

Plug 'phpunit'
Plug 'vim-scripts/phpunit'

"快速跳转到字符
Plug 'EasyMotion'
Plug 'vim-scripts/EasyMotion'

Plug 'https://github.com/bling/vim-airline.git'

Expand Down Expand Up @@ -120,9 +119,9 @@ set t_Co=256

let g:solarized_termcolors=16
"两种流行风格的主题
colorscheme molokai
"colorscheme molokai
set background=dark
"colorscheme solarized
colorscheme solarized
"set background=light

"emmet 设置
Expand Down Expand Up @@ -355,11 +354,13 @@ set backspace=eol,start,indent

"基本设置

set encoding=utf-8

set fileencoding=utf-8
"set encoding=utf-8
"set fileencoding=utf-8
"set fileencodings=ucs-bom,utf-8,chinese

set fileencodings=ucs-bom,utf-8,chinese
set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
set enc=utf8
set fencs=utf8,gbk,gb2312,gb18030

set ambiwidth=double

Expand Down
Binary file removed Fn2.png
Binary file not shown.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@

运行三个命令配置一个强大的VIM编辑器。

# mkdir -p ~/.vim/autoload
# curl -fLo ~/.vim/autoload/plug.vim \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# curl -fLo ~/.vimrc \
https://raw.githubusercontent.com/luofei614/vim-plug/master/.vimrc
https://raw.githubusercontent.com/jsyzchen/vim-plug/master/.vimrc

然后打开vim 运行 :PlugInstall 就能安装上所有插件(共43个插件)

这些VIM配置我已经用了四年了,用着非常爽。 所以特意整理出来分享给大家,大家只需要简单的执行上面三条命令就能获得我的配置。

安装好后效果如下:
![enter image description here](https://github.com/luofei614/vim-plug/raw/master/screenshot.png)
![enter image description here](https://github.com/jsyzchen/vim-plug/raw/master/screenshot.png)

内置两种流行主题,默认是sublime风格的主题。

设置了很多方便的快捷键

* F11 : 在编辑器左侧打开文件浏览器, 再按一次F11则会关闭文件浏览器
* F7 : 在编辑器左侧打开文件浏览器, 再按一次F7则会关闭文件浏览器

* F12: 在编辑器右侧打开当前文件的函数列表, 再安一次F12关闭函数列表。函数列表是基于ctags的先需要在项目目录下运行 `ctags -R` 在VIM中按快捷键 F3 可以自动执行ctags命令。
* F8: 在编辑器右侧打开当前文件的函数列表, 再安一次F8关闭函数列表。函数列表是基于ctags的先需要在项目目录下运行 `ctags -R` 在VIM中按快捷键 F3 可以自动执行ctags命令。

* 注意,在mac下, F11,F12 是系统默认的快捷键,需要修改系统设置。

![enter image description here](https://github.com/luofei614/vim-plug/raw/master/Fn1.png)
![enter image description here](https://github.com/jsyzchen/vim-plug/raw/master/Fn1.png)

在"设置"->"键盘"中勾选"将F1,F2等快捷键作为标准功能键"

然后选择"快捷键"这个tab页,去掉"显示桌面"和"显示Dashboard"的快捷键
![enter image description here](https://github.com/luofei614/vim-plug/raw/master/Fn2.png)

* F2: 可以快速查函数手册, 如果当前VIM的光标在php的file_put_contents函数上,按一下F2 会自动打开PHP手册的网页。

Expand All @@ -44,5 +40,3 @@
* shift+q: 快速退出VIM。 如果vim同时打开多个文件是,不用挨着一个一个关闭。

建议大家在看看.vimrc 配置文件 了解更多用法。