Navigation Menu

Skip to content
This repository has been archived by the owner on Aug 6, 2018. It is now read-only.

Commit

Permalink
Update xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
humiaozuzu committed Feb 5, 2013
1 parent b9771d7 commit b923f4f
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 48 deletions.
54 changes: 37 additions & 17 deletions README.md
@@ -1,18 +1,17 @@
Maple's Vim config Maple's Vim config
================== ==================


I use `vundle` to manage my plugins, which makes my `.vim` directory clean I use `vundle` to manage my plugins, which makes my `.vim` directory clean and tidy. If you are new to vim, the following two posts
and tidy. If you are new to vim, the following two posts


* [Vim Introduction and Tutorial](http://blog.interlinked.org/tutorials/vim_tutorial.html) * [Vim Introduction and Tutorial](http://blog.interlinked.org/tutorials/vim_tutorial.html)
* [Vim plugins I use](http://mirnazim.org/writings/vim-plugins-i-use/) * [Vim plugins I use](http://mirnazim.org/writings/vim-plugins-i-use/)


will be good for you. will be good for you.


#### Most of the time we are writing code so we need: #### Most of the time we are writing code so we need:
## Code Completions ## Code Completions


Such as completions for variable names and function names(neocomplcache), expanding snippets(snipMate), auto closing brackets/brace/quote(vim-smartinput) and fast expand expressions to HTML(ZenCoding). Such as completions for variable names and function names(neocomplcache), expanding snippets(snipMate), auto closing brackets/brace/quote(delimitMate) and fast expand expressions to HTML(ZenCoding).


* [neocomplcache](http://github.com/Shougo/neocomplcache) - Ultimate auto completion system for Vim. * [neocomplcache](http://github.com/Shougo/neocomplcache) - Ultimate auto completion system for Vim.
* [snipMate](https://github.com/garbas/vim-snipmate) - Plugin for using TextMate-style snippets in Vim. * [snipMate](https://github.com/garbas/vim-snipmate) - Plugin for using TextMate-style snippets in Vim.
Expand All @@ -22,7 +21,7 @@ Such as completions for variable names and function names(neocomplcache), expand


### Shortcuts ### Shortcuts


* `Tab` -> Rotate across the completion list * `Tab` -> Rotate across the completion list
* `Tab` -> Expand snippets or jump to the next placeholder of snippet * `Tab` -> Expand snippets or jump to the next placeholder of snippet
* `Ctrl` + `j` -> Call zen-coding expansion on html tags * `Ctrl` + `j` -> Call zen-coding expansion on html tags


Expand Down Expand Up @@ -62,6 +61,7 @@ sudo apt-get install vim-gtk # Ubuntu
``` ```


### Shortcuts ### Shortcuts

* `%` -> Jump between brackets and html/xml tags * `%` -> Jump between brackets and html/xml tags
* `<leader>` + `w` -> Beginning of the word. * `<leader>` + `w` -> Beginning of the word.
* `<leader>` + `f` + `{char}` -> Find {char} to the right. * `<leader>` + `f` + `{char}` -> Find {char} to the right.
Expand All @@ -88,7 +88,7 @@ sudo apt-get install vim-gtk # Ubuntu
* `%` -> Jump between brackets and html/xml tags * `%` -> Jump between brackets and html/xml tags
* `<leader>` + `c` + `<space>` -> Toggle comment * `<leader>` + `c` + `<space>` -> Toggle comment
* `F3` -> Toggle Gundo viewer * `F3` -> Toggle Gundo viewer
* `F4` -> Toggle Indent Guides * `F4` -> Toggle Indent Guides


## IDE features ## IDE features


Expand Down Expand Up @@ -123,15 +123,15 @@ Haml | haml | built-in
Haskell | ghc-mod | `cabal install ghc-mod` Haskell | ghc-mod | `cabal install ghc-mod`
HTML | tidy | built-in HTML | tidy | built-in
Java | javac | built-in Java | javac | built-in
Javascript | jslint/jshint | `npm install -g jslint/jshint` Javascript | jshint | `npm install -g jshint`
Json | jsonlint | `npm install -g jsonlint` Json | jsonlint | `npm install -g jsonlint`
Less | lessc | built-in Less | lessc | built-in
Lisp | clisp | built-in Lisp | clisp | built-in
Lua | luac | built-in Lua | luac | built-in
Perl | perl | built-in Perl | perl | built-in
PHP | php | built-in PHP | php | built-in
Puppet | puppet | built-in Puppet | puppet | built-in
Python | pylint/pyflakes/flake8 | `sudo pip install pylint/pyflakes/flake8` Python | pyflakes | `sudo pip install pyflakes`
Ruby | ruby | built-in Ruby | ruby | built-in
Scala | scala | built-in Scala | scala | built-in
Sass | sass | built-in Sass | sass | built-in
Expand Down Expand Up @@ -163,12 +163,28 @@ YAML | js-yaml | `npm install -g js-yaml`


## Better syntax/indent for language enhancement ## Better syntax/indent for language enhancement


* [markdown](http://github.com/tpope/vim-markdown) - Syntax highlight for Markdown text files. - Server
* [jquery](http://github.com/nono/jquery.vim) - Syntax file for jQuery in ViM. - php
* [javascript](http://github.com/pangloss/vim-javascript) - Vastly improved vim's javascript indentation. - rails
* [coffee-script](https://github.com/kchmck/vim-coffee-script) - CoffeeScript support for vim. - jinja
* [html5](https://github.com/othree/html5.vim) - HTML5 omnicomplete and syntax. - jade
* [haml](https://github.com/tpope/vim-haml) - Vim runtime files for Haml, Sass, and SCSS. - Web
- html5
- haml
- javascript
- jquery
- coffeescript
- less
- stylus
- handlebar
- Markuo language
- markdown
- textile
- FPs
- racket
- clojure
- scale



## Themes ## Themes


Expand All @@ -177,15 +193,19 @@ YAML | js-yaml | `npm install -g js-yaml`
* [solarized](https://github.com/altercation/vim-colors-solarized) - precision colorscheme for the vim text editor * [solarized](https://github.com/altercation/vim-colors-solarized) - precision colorscheme for the vim text editor
* [vividchalk](https://github.com/tpope/vim-vividchalk) - colorscheme based on the Vibrant Ink theme for TextMate * [vividchalk](https://github.com/tpope/vim-vividchalk) - colorscheme based on the Vibrant Ink theme for TextMate
* [distinguished](https://github.com/Lokaltog/vim-distinguished) - A dark vim color scheme for 256-color terminals. * [distinguished](https://github.com/Lokaltog/vim-distinguished) - A dark vim color scheme for 256-color terminals.
* [tomorrow](https://github.com/chriskempson/vim-tomorrow-theme) - Tomorrow Theme for Vim
* [fisa](https://github.com/fisadev/fisa-vim-colorscheme) - soft color scheme for terminals with 256 colors
Clone in Mac


## Additional functions ## Additional functions


1. File encoding auto detection 1. File encoding auto detection
* Hightlight current line and column * Hightlight current line and column
* Automatically jump to the last edited location * Automatically jump to the last edited location
* `:w`/`:wq` error correction * `:w`/`:wq` error correction
* Remove trailing white space * Remove trailing white space(run `:FixWhitespace` in vim)
* Code folding is disabled, enable it as you wish * Code folding is disabled, enable it as you wish
* `w!!` to write if you forget add sudo
* Indent style: * Indent style:
* JavaScript - Use soft-tabs with a two space indent(According to this [Post](http://atroche.org/post/30994290348/javascript-indentation)). * JavaScript - Use soft-tabs with a two space indent(According to this [Post](http://atroche.org/post/30994290348/javascript-indentation)).
* HTML/CSS - Use soft-tabs with a two space indent(According to Google and Github's HTML/CSS style guide, just Google it). * HTML/CSS - Use soft-tabs with a two space indent(According to Google and Github's HTML/CSS style guide, just Google it).
Expand All @@ -203,13 +223,13 @@ YAML | js-yaml | `npm install -g js-yaml`


git clone git://github.com/humiaozuzu/dot-vimrc.git ~/.vim git clone git://github.com/humiaozuzu/dot-vimrc.git ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc ln -s ~/.vim/vimrc ~/.vimrc

3. Setup `Vundle`: 3. Setup `Vundle`:


git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle


4. Install bundles. Launch vim(ignore the errors and they will disappear after installing needed plugins)and run: 4. Install bundles. Launch vim(ignore the errors and they will disappear after installing needed plugins)and run:

:BundleInstall :BundleInstall


Thst's it! Thst's it!
Expand Down
2 changes: 1 addition & 1 deletion bundles.vim
Expand Up @@ -16,6 +16,7 @@ Bundle 'garbas/vim-snipmate'
Bundle 'ervandew/supertab' Bundle 'ervandew/supertab'
Bundle 'honza/snipmate-snippets' Bundle 'honza/snipmate-snippets'
Bundle 'mattn/zencoding-vim' Bundle 'mattn/zencoding-vim'
Bundle 'Raimondi/delimitMate'
"------ snipmate dependencies ------- "------ snipmate dependencies -------
Bundle 'MarcWeber/vim-addon-mw-utils' Bundle 'MarcWeber/vim-addon-mw-utils'
Bundle 'tomtom/tlib_vim' Bundle 'tomtom/tlib_vim'
Expand All @@ -32,7 +33,6 @@ Bundle 'Lokaltog/vim-easymotion'
Bundle 'tpope/vim-surround' Bundle 'tpope/vim-surround'
Bundle 'scrooloose/nerdcommenter' Bundle 'scrooloose/nerdcommenter'
Bundle 'sjl/gundo.vim' Bundle 'sjl/gundo.vim'
Bundle 'Raimondi/delimitMate'
Bundle 'godlygeek/tabular' Bundle 'godlygeek/tabular'
Bundle 'nathanaelkane/vim-indent-guides' Bundle 'nathanaelkane/vim-indent-guides'


Expand Down
83 changes: 53 additions & 30 deletions vimrc
Expand Up @@ -6,70 +6,64 @@ set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
" enable filetype dectection and ft specific plugin/indent " enable filetype dectection and ft specific plugin/indent
filetype plugin indent on filetype plugin indent on


" enable syntax hightlight and completion " enable syntax hightlight and completion
syntax enable
syntax on syntax on


" color theme "--------
" Vim UI
"--------
" color scheme
set background=dark
color vividchalk color vividchalk


" highlight current line " highlight current line
au WinLeave * set nocursorline nocursorcolumn au WinLeave * set nocursorline nocursorcolumn
au WinEnter * set cursorline cursorcolumn au WinEnter * set cursorline cursorcolumn
set cursorline cursorcolumn set cursorline cursorcolumn


" search operations " search
set incsearch set incsearch
"set highlight " conflict with highlight current line "set highlight " conflict with highlight current line
set ignorecase set ignorecase
set smartcase set smartcase


" editor settings " editor settings
" When editing a file, always jump to the last cursor position set history=1000
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif
set nocompatible set nocompatible
set nofoldenable " disable folding" set nofoldenable " disable folding"
set confirm " prompt when existing from an unsaved file set confirm " prompt when existing from an unsaved file
set history=1000
set backspace=indent,eol,start " More powerful backspacing set backspace=indent,eol,start " More powerful backspacing

" display settings
set t_Co=256 " Explicitly tell vim that the terminal has 256 colors " set t_Co=256 " Explicitly tell vim that the terminal has 256 colors "
set mouse=a " use mouse in all modes set mouse=a " use mouse in all modes
set report=0 " always report number of lines changed " set report=0 " always report number of lines changed "
set nowrap " dont wrap lines set nowrap " dont wrap lines
set scrolloff=2 " 2 lines above/below cursor when scrolling set scrolloff=5 " 5 lines above/below cursor when scrolling
set number " show line numbers set number " show line numbers
set showmatch " show matching bracket (briefly jump) set showmatch " show matching bracket (briefly jump)
set showcmd " show typed command in status bar set showcmd " show typed command in status bar
set title " show file in titlebar set title " show file in titlebar
set laststatus=2 " use 2 lines for the status bar set laststatus=2 " use 2 lines for the status bar
set matchtime=2 " show matching bracket for 0.2 seconds set matchtime=2 " show matching bracket for 0.2 seconds
set matchpairs+=<:> " specially for html set matchpairs+=<:> " specially for html
"set relativenumber " set relativenumber
"set ruler " show cursor position in status bar
"set showmode " show mode in status bar (insert/replace/...)


" Default Indentation " Default Indentation
set autoindent set autoindent
set smartindent " indent when set smartindent " indent when
set tabstop=4 " tab width set tabstop=4 " tab width
set softtabstop=4 " backspace & set softtabstop=4 " backspace
set shiftwidth=4 " indent width set shiftwidth=4 " indent width
"set textwidth=79 " set textwidth=79
" set smarttab
set expandtab " expand tab to space set expandtab " expand tab to space

autocmd FileType php setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120 autocmd FileType php setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120
autocmd FileType ruby setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=79 autocmd FileType ruby setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120
autocmd FileType php setlocal tabstop=4 shiftwidth=4 softtabstop=4 textwidth=79 autocmd FileType php setlocal tabstop=4 shiftwidth=4 softtabstop=4 textwidth=120
autocmd FileType coffee,javascript setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=79 autocmd FileType coffee,javascript setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120
autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 textwidth=79 autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 textwidth=120
autocmd FileType html,htmldjango,xhtml,haml setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=0 autocmd FileType html,htmldjango,xhtml,haml setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=0
autocmd FileType sass,scss,css setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=79 autocmd FileType sass,scss,css setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120


" syntax support " syntax support
autocmd Syntax javascript set syntax=jquery " JQuery syntax support autocmd Syntax javascript set syntax=jquery " JQuery syntax support
Expand All @@ -78,6 +72,9 @@ let g:html_indent_inctags = "html,body,head,tbody"
let g:html_indent_script1 = "inc" let g:html_indent_script1 = "inc"
let g:html_indent_style1 = "inc" let g:html_indent_style1 = "inc"


"-----------------
" Plugin settings
"-----------------
" Rainbow parentheses for Lisp and variants " Rainbow parentheses for Lisp and variants
let g:rbpt_colorpairs = [ let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'], \ ['brown', 'RoyalBlue3'],
Expand All @@ -103,6 +100,7 @@ autocmd Syntax lisp,scheme,clojure,racket RainbowParenthesesToggle
" tabbar " tabbar
let g:Tb_MaxSize = 2 let g:Tb_MaxSize = 2
let g:Tb_TabWrap = 1 let g:Tb_TabWrap = 1

hi Tb_Normal guifg=white ctermfg=white hi Tb_Normal guifg=white ctermfg=white
hi Tb_Changed guifg=green ctermfg=green hi Tb_Changed guifg=green ctermfg=green
hi Tb_VisibleNormal ctermbg=252 ctermfg=235 hi Tb_VisibleNormal ctermbg=252 ctermfg=235
Expand All @@ -115,7 +113,7 @@ let g:EasyMotion_leader_key = '<Leader>'
let g:tagbar_left=1 let g:tagbar_left=1
let g:tagbar_width=30 let g:tagbar_width=30
let g:tagbar_autofocus = 1 let g:tagbar_autofocus = 1
let g:tagbar_sort = 0 let g:tagbar_sort = 0
let g:tagbar_compact = 1 let g:tagbar_compact = 1
" tag for coffee " tag for coffee
if executable('coffeetags') if executable('coffeetags')
Expand All @@ -142,15 +140,20 @@ if executable('coffeetags')
\ } \ }
endif endif


" Nerd Tree " Nerd Tree
let NERDChristmasTree=0 let NERDChristmasTree=0
let NERDTreeWinSize=30 let NERDTreeWinSize=30
let NERDTreeChDirMode=2 let NERDTreeChDirMode=2
let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$', '\.swp$'] let NERDTreeIgnore=['\~$', '\.pyc$', '\.swp$']
let NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\~$'] " let NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\~$']
let NERDTreeShowBookmarks=1 let NERDTreeShowBookmarks=1
let NERDTreeWinPos = "right" let NERDTreeWinPos = "right"


" nerdcommenter
let NERDSpaceDelims=1
" nmap <D-/> :NERDComToggleComment<cr>
let NERDCompactSexyComs=1

" ZenCoding " ZenCoding
let g:user_zen_expandabbr_key='<C-j>' let g:user_zen_expandabbr_key='<C-j>'


Expand Down Expand Up @@ -185,24 +188,44 @@ let g:SuperTabDefaultCompletionType = '<C-X><C-U>'
let g:SuperTabRetainCompletionType=2 let g:SuperTabRetainCompletionType=2


" ctrlp " ctrlp
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,.DS_Store " MacOSX/Linux set wildignore+=*/tmp/*,*.so,*.o,*.a,*.obj,*.swp,*.zip,*.pyc,*.pyo,*.class,.DS_Store " MacOSX/Linux
let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$' let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'


" Keybindings for plugin toggle " Keybindings for plugin toggle
nmap <F5> :TagbarToggle<cr> nmap <F5> :TagbarToggle<cr>
nmap <F6> :NERDTreeToggle<cr> nmap <F6> :NERDTreeToggle<cr>
nmap <F3> :GundoToggle<cr> nmap <F3> :GundoToggle<cr>
nmap <F4> :IndentGuidesToggle<cr> nmap <F4> :IndentGuidesToggle<cr>
nmap <D-/> :
nnoremap <leader>a :Ack nnoremap <leader>a :Ack
nnoremap <leader>v V`] nnoremap <leader>v V`]
"------------------
" Useful Functions
"------------------
" easier navigation between split windows " easier navigation between split windows
nnoremap <c-j> <c-w>j nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l nnoremap <c-l> <c-w>l
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif

" w!! to sudo & write a file
cmap w!! w !sudo tee >/dev/null %
" Quickly edit/reload the vimrc file
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
" eggcache vim " eggcache vim
nnoremap ; :
:command W w :command W w
:command WQ wq :command WQ wq
:command Wq wq :command Wq wq
Expand Down

0 comments on commit b923f4f

Please sign in to comment.