Permalink
Browse files

Init commit

  • Loading branch information...
0 parents commit ed4cd5e87544e34f6519149edc64b580c1b0f4ed @humiaozuzu committed Oct 9, 2012
22 .gitignore
@@ -0,0 +1,22 @@
+### /Users/maple/.gitignore-boilerplates/Global/OSX.gitignore
+
+.DS_Store
+Icon
+
+# Thumbnails
+._*
+
+# Files that might appear on external disk
+.Spotlight-V100
+.Trashes
+
+
+### /Users/maple/.gitignore-boilerplates/Global/vim.gitignore
+
+.*.sw[a-z]
+*.un~
+Session.vim
+.netrwhist
+
+# bundles installed should be ignored
+bundle
226 README.md
@@ -0,0 +1,226 @@
+Maple's Vim config
+==================
+
+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
+
+* [Vim Introduction and Tutorial](http://blog.interlinked.org/tutorials/vim_tutorial.html)
+* [Vim plugins I use](http://mirnazim.org/writings/vim-plugins-i-use/)
+
+will be good for you.
+
+#### Most of the time we are writing code so we need:
+## 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).
+
+* [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.
+* [supertab](http://github.com/ervandew/supertab) - Perform all your vim insert mode completions with Tab.
+* [ZenCoding](http://github.com/mattn/zencoding-vim) - High speed HTML and CSS coding.
+* [delimitMate](http://github.com/Raimondi/delimitMate) - Provides auto-balancing and some expansions for parens, quotes, etc.
+
+### Shortcuts
+
+* `Tab` -> Rotate across the completion list
+* `Tab` -> Expand snippets or jump to the next placeholder of snippet
+* `Ctrl` + `j` -> Call zen-coding expansion on html tags
+
+### Dependencies
+
+Compile Vim with `--enable-pythoninterp` and `--enable-rubyinterp` to enable powerful syntax completion supplied by neocomplcache.
+
+``` bash
+brew install macvim --override-system-vim # OS X
+yaourt -S gvim # ArchLinux
+sudo apt-get install vim-gtk # Ubuntu
+```
+
+### Tutorial
+
+``` vim
+:help zencoding
+```
+
+[Movie teaching zencoding.vim](http://mattn.github.com/zencoding-vim/)
+
+### Screenshots
+
+![Completions](https://raw.github.com/humiaozuzu/dot-vimrc/master/screenshots/completions.gif)
+![Snippets](https://raw.github.com/humiaozuzu/dot-vimrc/master/screenshots/snippets.gif)
+
+#### Sometimes we need to jump to previous positions to copy/paste or do some fixes:
+## Fast navigation
+
+* [matchit](http://github.com/tsaleh/vim-matchit) - Extended % matching for HTML, LaTeX, and many other languages.
+* [EasyMotion](https://github.com/Lokaltog/vim-easymotion) - Vim motions on speed!
+
+### Tutorial
+
+``` vim
+:help easymotion
+```
+
+### Shortcuts
+* `%` -> Jump between brackets and html/xml tags
+* `<leader>` + `w` -> Beginning of the word.
+* `<leader>` + `f` + `{char}` -> Find {char} to the right.
+
+#### Doing fixes should be as fast as possible!
+## Fast editing
+
+* [surround](http://github.com/tpope/vim-surround) - Easily delete, change and add such surroundings in pairs.
+* [nerdcommenter](http://github.com/scrooloose/nerdcommenter) - Easy commenting of code for many filetypes.
+* [Gundo](https://github.com/sjl/gundo.vim/) - visualize your Vim undo tree.
+* [tabular](https://github.com/godlygeek/tabular) - Vim script for text filtering and alignment.
+* [IndentGuides](https://github.com/nathanaelkane/vim-indent-guides) - A Vim plugin for visually displaying indent levels in code.
+
+### Tutorial
+
+``` vim
+:help text-objexts
+:help surround
+:help tabular
+```
+
+### Shortcuts
+
+* `%` -> Jump between brackets and html/xml tags
+* `<leader>` + `c` + `<space>` -> Toggle comment
+* `F3` -> Toggle Gundo viewer
+* `F4` -> Toggle Indent Guides
+
+## IDE features
+
+* [nerdtree](http://github.com/scrooloose/nerdtree) - A tree explorer plugin for navigating the filesystem.
+* [tabbar](http://github.com/humiaozuzu/TabBar) - Add tab bar and quickt tab switch with alt+1~9.
+* [tagbar](http://github.com/majutsushi/tagbar) - Displays the tags of the current file in a sidebar.
+* [ack-vim](http://github.com/mileszs/ack.vim) - Front for the Perl module App::Ack.
+* [ctrlp](https://github.com/kien/ctrlp.vim) - Fuzzy file, buffer, mru and tag finder.
+* [powerline](https://github.com/Lokaltog/vim-powerline) - The ultimate vim statusline utility.
+* [fugitive](https://github.com/tpope/vim-fugitive/) - a Git wrapper so awesome, it should be illegal.
+* [syntastic](https://github.com/scrooloose/syntastic) - Syntax checking hacks for vim.
+
+### Dependencie
+
+```bash
+yaourt -S ack ctags # ArchLinux
+sudo apt-get install ack-grep ctags # Ubuntu
+brew install ack ctags # OS X
+```
+
+For syntax check tools:
+
+Languages | Lint Tools | Install guide
+------------ | ------------- | ------------
+C | gcc | built-in
+CPP | g++ | built-in
+CoffeeScript | coffee | `npm install -g coffeelint`
+CSS | csslint | `npm install -g csslint`
+Erlang | escript | built-in
+Go | go | built-in
+Haml | haml | built-in
+Haskell | ghc-mod | `cabal install ghc-mod`
+HTML | tidy | built-in
+Java | javac | built-in
+Javascript | jslint/jshint | `npm install -g jslint/jshint`
+Json | jsonlint | `npm install -g jsonlint`
+Less | lessc | built-in
+Lisp | clisp | built-in
+Lua | luac | built-in
+Perl | perl | built-in
+PHP | php | built-in
+Puppet | puppet | built-in
+Python | pylint/pyflakes/flake8 | `sudo pip install pylint/pyflakes/flake8`
+Ruby | ruby | built-in
+Scala | scala | built-in
+Sass | sass | built-in
+Scss | scss/compass | `gem install compass`
+XML | xmllint | built-in
+YAML | js-yaml | `npm install -g js-yaml`
+
+### Shortcuts
+* `F5` -> Toggle Nerd-Tree file viewer
+* `F6` -> Toggle tagbar
+* `Ctrl` + `p` -> Toggle ctrlp
+* `Alt` + `1~9` -> Switch between multiple buffers
+* `Ctrl` + `h/j/k/l` -> Moving between spilt windows
+* `:Ack` or `<leader>` + `a` -> Toggle Ack searching
+
+### Screenshots
+
+![Vim IDE 1](https://raw.github.com/humiaozuzu/dot-vimrc/master/screenshots/vim.jpg)
+![Vim IDE 2](https://raw.github.com/humiaozuzu/dot-vimrc/master/screenshots/vim2.jpg)
+
+## Other Utils
+
+* [fcitx-status](https://github.com/humiaozuzu/fcitx-status) - automatic change status of fcitx in vim.
+* [togglemouse](https://github.com/nvie/vim-togglemouse/) - Toggles the mouse focus between Vim and your terminal emulator, allowing terminal emulator mouse commands, like copy/paste.
+
+### Shortcuts
+
+* `F12` -> Toggle Mouse
+
+## Better syntax/indent for language enhancement
+
+* [markdown](http://github.com/tpope/vim-markdown) - Syntax highlight for Markdown text files.
+* [jquery](http://github.com/nono/jquery.vim) - Syntax file for jQuery in ViM.
+* [javascript](http://github.com/pangloss/vim-javascript) - Vastly improved vim's javascript indentation.
+* [coffee-script](https://github.com/kchmck/vim-coffee-script) - CoffeeScript support for vim.
+* [html5](https://github.com/othree/html5.vim) - HTML5 omnicomplete and syntax.
+* [haml](https://github.com/tpope/vim-haml) - Vim runtime files for Haml, Sass, and SCSS.
+
+## Themes
+
+* [blackboard](https://github.com/rickharris/vim-blackboard) - Textmate's Blackboard theme for vim (with iTerm2 theme)
+* [molokai](https://github.com/rickharris/vim-monokai) - A port of the monokai scheme for TextMate
+* [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
+* [distinguished](https://github.com/Lokaltog/vim-distinguished) - A dark vim color scheme for 256-color terminals.
+
+## Additional functions
+
+1. File encoding auto detection
+* Hightlight current line and column
+* Automatically jump to the last edited location
+* `:w`/`:wq` error correction
+* Remove trailing white space
+* Code folding is disabled, enable it as you wish
+* Indent style:
+ * 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).
+ * PHP - Use soft-tabs with a two space indent(According to [Apache PHP Style Guide](http://svn.apache.org/repos/asf/shindig/trunk/php/docs/style-guide.html)).
+ * Python - Use soft-tabs with a four space indent([PEP8](http://www.python.org/dev/peps/pep-0008/)).
+
+## Installation
+
+1. Backup your old vim configuration files:
+
+ mv ~/.vim ~/.vim.orig
+ mv ~/.vimrc ~/.vimrc.orig
+
+2. Clone and install this repo:
+
+ git clone git://github.com/humiaozuzu/dot-vimrc.git ~/.vim
+ ln -s ~/.vim/vimrc ~/.vimrc
+
+3. Setup `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:
+
+ :BundleInstall
+
+Thst's it!
+
+## How to manage this vimrc?
+
+All plugins are listed in file `bundles.vim` with detailed comments, just add plugins as you like.
+
+Other configurations are also well organized in vimrc.
+
+## Known issues
+
+* Compeletions are not well supported for statically typed languages(c/c++)
+* Snippets are not shown in completions popups
96 bundles.vim
@@ -0,0 +1,96 @@
+set nocompatible " be iMproved
+filetype off " required!
+
+set rtp+=~/.vim/bundle/vundle/
+call vundle#rc()
+
+" let Vundle manage Vundle
+" required!
+Bundle 'gmarik/vundle'
+
+"------------------
+" Code Completions
+"------------------
+Bundle 'Shougo/neocomplcache'
+Bundle 'garbas/vim-snipmate'
+Bundle 'ervandew/supertab'
+Bundle 'honza/snipmate-snippets'
+Bundle 'mattn/zencoding-vim'
+" snipmate dependencies
+Bundle 'MarcWeber/vim-addon-mw-utils'
+Bundle 'tomtom/tlib_vim'
+
+"-----------------
+" Fast navigation
+"-----------------
+Bundle 'tsaleh/vim-matchit'
+Bundle 'Lokaltog/vim-easymotion'
+
+"--------------
+" Fast editing
+"--------------
+Bundle 'tpope/vim-surround'
+Bundle 'scrooloose/nerdcommenter'
+Bundle 'sjl/gundo.vim'
+"Bundle 'Raimondi/delimitMate'
+Bundle 'kana/vim-smartinput'
+Bundle 'godlygeek/tabular'
+Bundle 'nathanaelkane/vim-indent-guides'
+
+"--------------
+" IDE features
+"--------------
+Bundle 'scrooloose/nerdtree'
+Bundle 'majutsushi/tagbar'
+Bundle 'humiaozuzu/TabBar'
+Bundle 'mileszs/ack.vim'
+Bundle 'kien/ctrlp.vim'
+Bundle 'tpope/vim-fugitive'
+Bundle 'Lokaltog/vim-powerline'
+Bundle 'scrooloose/syntastic'
+
+"-------------
+" Other Utils
+" ------------
+Bundle 'humiaozuzu/fcitx-status'
+Bundle 'nvie/vim-togglemouse'
+
+"----------------------------------------
+" Syntax/Indent for language enhancement
+"----------------------------------------
+" web backend
+Bundle '2072/PHP-Indenting-for-VIm'
+"Bundle 'tpope/vim-rails'
+Bundle 'beyondwords/vim-jinja2'
+Bundle 'digitaltoad/vim-jade'
+
+" web front end
+Bundle 'othree/html5.vim'
+Bundle 'tpope/vim-haml'
+Bundle 'nono/jquery.vim'
+Bundle 'pangloss/vim-javascript'
+Bundle 'kchmck/vim-coffee-script'
+"Bundle 'groenewege/vim-less'
+"Bundle 'wavded/vim-stylus'
+
+" markup language
+Bundle 'tpope/vim-markdown'
+
+" Ruby
+"Bundle 'tpope/vim-endwise'
+
+" Scheme
+Bundle 'kien/rainbow_parentheses.vim'
+Bundle 'wlangstroth/vim-racket'
+
+"--------------
+" Color Scheme
+"--------------
+Bundle 'rickharris/vim-blackboard'
+Bundle 'altercation/vim-colors-solarized'
+Bundle 'rickharris/vim-monokai'
+Bundle 'tpope/vim-vividchalk'
+Bundle 'Lokaltog/vim-distinguished'
+Bundle 'chriskempson/vim-tomorrow-theme'
+
+filetype plugin indent on " required!
BIN screenshots/completions.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN screenshots/snippets.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN screenshots/vim.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN screenshots/vim2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
233 vimrc
@@ -0,0 +1,233 @@
+source ~/.vim/bundles.vim
+
+" encoding dectection
+set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
+
+" enable filetype dectection and ft specific plugin/indent
+filetype plugin indent on
+
+" enable syntax hightlight and completion
+syntax enable
+syntax on
+
+" color theme
+color vividchalk
+
+" highlight current line
+au WinLeave * set nocursorline nocursorcolumn
+au WinEnter * set cursorline cursorcolumn
+set cursorline cursorcolumn
+
+" search operations
+set incsearch
+"set highlight " conflict with highlight current line
+set ignorecase
+set smartcase
+
+" editor settings
+" 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
+set nocompatible
+set nofoldenable " disable folding"
+set confirm " prompt when existing from an unsaved file
+set history=1000
+set backspace=indent,eol,start " More powerful backspacing
+
+" display settings
+set t_Co=256 " Explicitly tell vim that the terminal has 256 colors "
+set mouse=a " use mouse in all modes
+set report=0 " always report number of lines changed "
+set nowrap " dont wrap lines
+set scrolloff=2 " 2 lines above/below cursor when scrolling
+set number " show line numbers
+set showmatch " show matching bracket (briefly jump)
+set showcmd " show typed command in status bar
+set title " show file in titlebar
+set laststatus=2 " use 2 lines for the status bar
+set matchtime=2 " show matching bracket for 0.2 seconds
+set matchpairs+=<:> " specially for html
+"set relativenumber
+"set ruler " show cursor position in status bar
+"set showmode " show mode in status bar (insert/replace/...)
+
+" Default Indentation
+set autoindent
+set smartindent " indent when
+set tabstop=4 " tab width
+set softtabstop=4 " backspace &
+set shiftwidth=4 " indent width
+"set textwidth=79
+set expandtab " expand tab to space
+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 php setlocal tabstop=4 shiftwidth=4 softtabstop=4 textwidth=79
+autocmd FileType coffee,javascript setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=79
+autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 textwidth=79
+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
+
+" syntax support
+autocmd Syntax javascript set syntax=jquery " JQuery syntax support
+" js
+let g:html_indent_inctags = "html,body,head,tbody"
+let g:html_indent_script1 = "inc"
+let g:html_indent_style1 = "inc"
+
+" Rainbow parentheses for Lisp and variants
+let g:rbpt_colorpairs = [
+ \ ['brown', 'RoyalBlue3'],
+ \ ['Darkblue', 'SeaGreen3'],
+ \ ['darkgray', 'DarkOrchid3'],
+ \ ['darkgreen', 'firebrick3'],
+ \ ['darkcyan', 'RoyalBlue3'],
+ \ ['darkred', 'SeaGreen3'],
+ \ ['darkmagenta', 'DarkOrchid3'],
+ \ ['brown', 'firebrick3'],
+ \ ['gray', 'RoyalBlue3'],
+ \ ['black', 'SeaGreen3'],
+ \ ['darkmagenta', 'DarkOrchid3'],
+ \ ['Darkblue', 'firebrick3'],
+ \ ['darkgreen', 'RoyalBlue3'],
+ \ ['darkcyan', 'SeaGreen3'],
+ \ ['darkred', 'DarkOrchid3'],
+ \ ['red', 'firebrick3'],
+ \ ]
+let g:rbpt_max = 16
+autocmd Syntax lisp,scheme,clojure,racket RainbowParenthesesToggle
+
+" tabbar
+let g:Tb_MaxSize = 2
+let g:Tb_TabWrap = 1
+hi Tb_Normal guifg=white ctermfg=white
+hi Tb_Changed guifg=green ctermfg=green
+hi Tb_VisibleNormal ctermbg=252 ctermfg=235
+hi Tb_VisibleChanged guifg=green ctermbg=252 ctermfg=white
+
+" easy-motion
+let g:EasyMotion_leader_key = '<Leader>'
+
+" Tagbar
+let g:tagbar_left=1
+let g:tagbar_width=30
+let g:tagbar_autofocus = 1
+let g:tagbar_sort = 0
+let g:tagbar_compact = 1
+" tag for coffee
+if executable('coffeetags')
+ let g:tagbar_type_coffee = {
+ \ 'ctagsbin' : 'coffeetags',
+ \ 'ctagsargs' : '',
+ \ 'kinds' : [
+ \ 'f:functions',
+ \ 'o:object',
+ \ ],
+ \ 'sro' : ".",
+ \ 'kind2scope' : {
+ \ 'f' : 'object',
+ \ 'o' : 'object',
+ \ }
+ \ }
+
+ let g:tagbar_type_markdown = {
+ \ 'ctagstype' : 'markdown',
+ \ 'sort' : 0,
+ \ 'kinds' : [
+ \ 'h:sections'
+ \ ]
+ \ }
+endif
+
+" Nerd Tree
+let NERDChristmasTree=0
+let NERDTreeWinSize=30
+let NERDTreeChDirMode=2
+let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$', '\.swp$']
+let NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\~$']
+let NERDTreeShowBookmarks=1
+let NERDTreeWinPos = "right"
+
+" ZenCoding
+let g:user_zen_expandabbr_key='<C-j>'
+
+" powerline
+"let g:Powerline_symbols = 'fancy'
+
+" NeoComplCache
+let g:neocomplcache_enable_at_startup=1
+let g:neoComplcache_disableautocomplete=1
+"let g:neocomplcache_enable_underbar_completion = 1
+"let g:neocomplcache_enable_camel_case_completion = 1
+let g:neocomplcache_enable_smart_case=1
+let g:neocomplcache_min_syntax_length = 3
+let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
+set completeopt-=preview
+
+imap <C-k> <Plug>(neocomplcache_snippets_force_expand)
+smap <C-k> <Plug>(neocomplcache_snippets_force_expand)
+imap <C-l> <Plug>(neocomplcache_snippets_force_jump)
+smap <C-l> <Plug>(neocomplcache_snippets_force_jump)
+
+" Enable omni completion.
+autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
+autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
+autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
+autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
+autocmd FileType c setlocal omnifunc=ccomplete#Complete
+
+" SuperTab
+"let g:SuperTabDefultCompletionType='context'
+let g:SuperTabDefaultCompletionType = '<C-X><C-U>'
+let g:SuperTabRetainCompletionType=2
+
+" ctrlp
+set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,.DS_Store " MacOSX/Linux
+let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
+
+" Keybindings for plugin toggle
+nmap <F5> :TagbarToggle<cr>
+nmap <F6> :NERDTreeToggle<cr>
+nmap <F3> :GundoToggle<cr>
+nmap <F4> :IndentGuidesToggle<cr>
+nnoremap <leader>a :Ack
+nnoremap <leader>v V`]
+
+" easier navigation between split windows
+nnoremap <c-j> <c-w>j
+nnoremap <c-k> <c-w>k
+nnoremap <c-h> <c-w>h
+nnoremap <c-l> <c-w>l
+
+" eggcache vim
+:command W w
+:command WQ wq
+:command Wq wq
+:command Q q
+:command Qa qa
+:command QA qa
+
+" for macvim
+if has("gui_macvim")
+ set go=aAce " remove toolbar
+ set transparency=30
+ set guifont=Monaco:h13
+ set showtabline=2
+ set columns=140
+ set lines=40
+ noremap <D-M-Left> :tabprevious<cr>
+ noremap <D-M-Right> :tabnext<cr>
+ map <D-1> 1gt
+ map <D-2> 2gt
+ map <D-3> 3gt
+ map <D-4> 4gt
+ map <D-5> 5gt
+ map <D-6> 6gt
+ map <D-7> 7gt
+ map <D-8> 8gt
+ map <D-9> 9gt
+ map <D-0> :tablast<CR>
+endif

0 comments on commit ed4cd5e

Please sign in to comment.