Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

把键盘映射、配置、AutoCommand 放到不同的文件里

  • Loading branch information...
commit 33d9237f5d9f1847de7510b29d1d8fcb14e550ae 1 parent 6213556
@yesmeck authored
View
8 plugin/NERD_tree.vim
@@ -1,8 +0,0 @@
-"------ NERDTree Options ------
-let NERDTreeIgnore=['CVS']
-let NERDTreeChDirMode=2 "setting root dir in NT also sets VIM's cd
-let NERDTreeShowHidden=1
-
-if has("gui_running")
- autocmd vimenter * if !argc() | NERDTree | endif
-endif
View
1  plugin/ctrlp.vim
@@ -1 +0,0 @@
-let g:ctrlp_map = '<Leader>p'
View
3  plugin/hammer.vim
@@ -1,3 +0,0 @@
-" Hammer
-" xdg_open does not work
-:let g:HammerBrowser = 'firefox'
View
2  plugin/localvimrc.vim
@@ -1,2 +0,0 @@
-" localvimrc
-let g:localvimrc_ask=0
View
5 plugin/php-doc.vim
@@ -1,5 +0,0 @@
-" php-doc plugin
-
-:let g:pdv_cfg_Author="Meck <yesmeck@gmail.com>"
-:let g:pdv_cfg_Copyright="2011 Meck"
-:let g:pdv_cfg_License=""
View
4 plugin/session.vim
@@ -1,4 +0,0 @@
-"------ Session ------
-"http://www.vim.org/scripts/script.php?script_id=3150
-
-:let g:session_autosave = 'no'
View
16 settings/autocmds.vim
@@ -0,0 +1,16 @@
+" Auto Commands
+autocmd FileType php set omnifunc=phpcomplete#CompletePHP
+
+" Deletes trailing space in file upon write
+autocmd BufWritePre * :%s/\s\+$//e
+
+" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
+autocmd BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
+
+" md, markdown, and mk are markdown and define buffer-local preview
+autocmd BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn} set ft=markdown
+
+" add json syntax highlighting
+autocmd BufNewFile,BufRead *.json set ft=javascript
+
+
View
0  plugin/keymap.vim → settings/keymap.vim
File renamed without changes
View
74 settings/settings.vim
@@ -0,0 +1,74 @@
+colorscheme darkblue "Default VIM colorscheme which works in terminals
+
+syntax on "Enables syntax highlighting
+
+let mapleader="," "Changes Leader key into a comma instead of a backslash
+
+set nocompatible "Prefents VIM from being nerfed into acting like VI
+set viminfo='1000,f1,:1000,/1000
+set history=500
+" Share clipboard with system
+set clipboard=unnamedplus
+set guioptions-=T "remove toolbar
+"
+"------ Visual Options ------
+set nu "Enable Line Numbers
+set nowrap "Disable word wrap
+set vb "Visual bell instead of beeps
+set ruler "Displays cursor position on bottom right of screen
+set statusline=%<%f\ %h%m%r%=%{fugitive#statusline()}\ \ %-14.(%l,%c%V%)\ %P
+
+"------ Behavior ------
+set tabstop=4 "tab = 4 spaces
+set shiftwidth=4 "Indent to four spaces
+set softtabstop=4
+set hidden "Switch between unsaved buffers w/o needing to save, preserves history
+filetype indent on "Syntax Highlight
+filetype plugin on "Needed for snipMate
+set autoindent "Autoindent
+set expandtab "Use spaces instead of tabs
+
+"------ Searching ------
+set incsearch "Search while typing
+" set ignorecase "Case Insensitive Searching
+set smartcase "Lowercase = case insensitive, any uppercase = case sensitive
+set hlsearch "Highlight all search results
+
+"Indent guide
+let g:indent_guides_enable_on_vim_startup=1
+let g:indent_guides_guide_size=1
+
+"Ignore these files when completing names
+set wildignore=.svn,CVS,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif
+
+" F2 = Paste Toggle (in insert mode, pasting indented text behavior changes)
+set pastetoggle=<F2>
+
+"------ Plugins ------
+
+" CtrtlP
+let g:ctrlp_map = '<Leader>p'
+
+" Hammer
+" xdg_open does not work
+let g:HammerBrowser = 'chromium'
+
+" localvimrc
+let g:localvimrc_ask=0
+
+" NERDTree
+let NERDTreeIgnore=['CVS']
+let NERDTreeChDirMode=2 "setting root dir in NT also sets VIM's cd
+let NERDTreeShowHidden=1
+
+if has("gui_running")
+ autocmd vimenter * if !argc() | NERDTree | endif
+endif
+
+" php-doc
+let g:pdv_cfg_Author="Meck <yesmeck@gmail.com>"
+let g:pdv_cfg_Copyright="2011 Meck"
+let g:pdv_cfg_License=""
+
+" Session
+let g:session_autosave = 'no'
View
55 vimrc
@@ -1,60 +1,11 @@
runtime bundle/pathogen/autoload/pathogen.vim "Set runtime
call pathogen#infect() "Executes the pathogen plugin, which loads other plugins
-let mapleader="," "Changes Leader key into a comma instead of a backslash
-set nocompatible "Prefents VIM from being nerfed into acting like VI
-set viminfo='1000,f1,:1000,/1000
-set history=500
-" Share clipboard with system
-set clipboard=unnamedplus
-au FileType php set omnifunc=phpcomplete#CompletePHP
+source $HOME/.vim/settings/settings.vim
-"------ Visual Options ------
-set guioptions-=T "remove toolbar
-syntax on "Enables syntax highlighting
-set nu "Enable Line Numbers
-set nowrap "Disable word wrap
-set vb "Visual bell instead of beeps
-set ruler "Displays cursor position on bottom right of screen
-set statusline=%<%f\ %h%m%r%=%{fugitive#statusline()}\ \ %-14.(%l,%c%V%)\ %P
+source $HOME/.vim/settings/autocmds.vim
-"------ Behavior ------
-set tabstop=4 "tab = 4 spaces
-set shiftwidth=4 "Indent to four spaces
-set softtabstop=4
-set hidden "Switch between unsaved buffers w/o needing to save, preserves history
-filetype indent on "Syntax Highlight
-filetype plugin on "Needed for snipMate
-set autoindent "Autoindent
-set expandtab "Use spaces instead of tabs
-"Indent guide
-let g:indent_guides_enable_on_vim_startup=1
-let g:indent_guides_guide_size=1
-"Ignore these files when completing names
-set wildignore=.svn,CVS,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif
-
-"------ Searching ------
-set incsearch "Search while typing
-" set ignorecase "Case Insensitive Searching
-set smartcase "Lowercase = case insensitive, any uppercase = case sensitive
-set hlsearch "Highlight all search results
-
-" F2 = Paste Toggle (in insert mode, pasting indented text behavior changes)
-set pastetoggle=<F2>
-
-" Deletes trailing space in file upon write
-autocmd BufWritePre * :%s/\s\+$//e
-
-" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
-au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
-
-" md, markdown, and mk are markdown and define buffer-local preview
-au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn} set ft=markdown
-
-" add json syntax highlighting
-au BufNewFile,BufRead *.json set ft=javascript
-
-colorscheme darkblue "Default VIM colorscheme which works in terminals
+source $HOME/.vim/settings/keymap.vim
if filereadable($HOME.'/.vimrc_local')
source $HOME/.vimrc_local
Please sign in to comment.
Something went wrong with that request. Please try again.