├── .gitignore ├── LICENSE ├── README.md ├── UltiSnips ├── all.snippets ├── base_django.snippets ├── markdown.snippets ├── pelican.snippets └── python.snippets ├── autoload └── helperfuncs.vim ├── font └── DroidSansMono │ ├── Droid Sans Mono for Powerline.otf │ ├── LICENSE.txt │ └── README.rst ├── packages ├── basic.vimrc ├── bookmarks.vimrc ├── code.vimrc ├── colorv.vimrc ├── files.vimrc ├── git.vimrc ├── golang.vimrc ├── grep.vimrc ├── markdown.vimrc ├── navigation.vimrc ├── neobundle.vimrc ├── python.vimrc ├── registers.vimrc ├── searching.vimrc ├── sessions.vimrc ├── spelling.vimrc ├── text.vimrc ├── tools.vimrc ├── vim.vimrc └── web.vimrc ├── templates └── vimrc-template ├── tools ├── check_for_upgrade.sh ├── install.sh ├── prepare_mac.sh ├── uninstall.sh └── upgrade.sh └── vimrc /.gitignore: -------------------------------------------------------------------------------- 1 | bundle/ 2 | vim-go/ 3 | *.swp 4 | tmp/ 5 | .DS_Store 6 | local.vimrc 7 | before.vimrc 8 | extra.vimrc 9 | after.vimrc 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Xianzhe Liang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Oh My Vim 2 | 3 | ``` 4 | Deprecated 5 | ``` 6 | 7 | This project is no longer maintained. I'm mostly using VSCode plus vim binding these days. As for vim, I'm using a much simpler setup. Here is my `.vimrc` in case you are curious. 8 | 9 | ```vim 10 | " Automatically install vim-plug 11 | if empty(glob('~/.config/nvim/autoload/plug.vim')) 12 | silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs 13 | \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 14 | autocmd VimEnter * PlugInstall | source $MYVIMRC 15 | endif 16 | 17 | " All plugs 18 | call plug#begin() 19 | 20 | " Reasonable defaults 21 | Plug 'tpope/vim-sensible' 22 | 23 | " Better looking 24 | Plug 'ghifarit53/tokyonight-vim' 25 | Plug 'itchyny/lightline.vim' 26 | 27 | " Language pack on demand 28 | Plug 'sheerun/vim-polyglot' 29 | 30 | " Comment out stuff 31 | Plug 'tpope/vim-commentary' 32 | 33 | " Edit surroundings 34 | Plug 'tpope/vim-surround' 35 | Plug 'tpope/vim-repeat' 36 | 37 | " Move cursor around 38 | Plug 'justinmk/vim-sneak' 39 | 40 | " File search 41 | Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } 42 | Plug 'junegunn/fzf.vim' 43 | 44 | call plug#end() 45 | 46 | " Automatically install missing plugins on startup 47 | autocmd VimEnter * 48 | \ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) 49 | \| PlugInstall --sync | q 50 | \| endif 51 | ``` 52 | 53 | --- 54 | ``` 55 | Original Readme 56 | ``` 57 | 58 | Out-of-box vim config for everyone. It is well organaized and easy to use. 59 | 60 | E.g. open Unite UI interface and find the grep feature, search a string in 61 | current folder, preview results, and open selected files. 62 | 63 | ![intro](https://github.com/liangxianzhe/oh-my-vim-image/blob/master/intro.gif?raw=true "intro") 64 | 65 | # How to install 66 | 67 | ## 1. Install some needed tools 68 | 69 | For Mac OS, you can just run the [script](/tools/prepare_mac.sh). It will 70 | install some necessory tools and the latest vim (7.4) *with lua support*. 71 | 72 | curl -L https://raw.github.com/liangxianzhe/oh-my-vim/master/tools/prepare_mac.sh | sh 73 | 74 | For Linux, there is no script yet. You need to figure out what the above script 75 | does, and install them according (apt-get etc). Please note a vim with lua 76 | support is required. 77 | 78 | ## 2. Install oh-my-vim: 79 | 80 | Run: [tools/install.sh](tools/install.sh) 81 | 82 | curl -L https://raw.github.com/liangxianzhe/oh-my-vim/master/tools/install.sh | sh 83 | 84 | It will be installed to ~/.oh-my-vim folder. 85 | 86 | ## 3. Set up font (optional): 87 | For a better looking [powerline](https://github.com/bling/vim-airline), you will 88 | need setting install a [patched font](https://github.com/bling/vim-airline#integrating-with-powerline-fonts). 89 | 90 | If you are using mac, the above script has installed a font [DroidSansMono](https://github.com/Lokaltog/powerline-fonts/tree/master/DroidSansMono) 91 | for you. Please set this font for your terminal. (For macvim or gvim, nothing 92 | need to be done. For iTerm2, go for Profile - Open Profile - Default - Edit Profile - Text - None-ASCII Font.) 93 | 94 | ## 4. Open vim: 95 | Open your vim, it will install a bunch of plugins at the first time. Close 96 | the vim and re-open it, then you are all set. 97 | 98 | # Configuration 99 | 100 | You can overwrite the default configuration and key bindings by creating one of 101 | following files: 102 | 103 | `~/.before.vimrc` will be loaded before everything else. 104 | 105 | `~/.local.vimrc` will be loaded after bundles are initialized and before 106 | the settings take place. The idea was so people could add Bundle lines 107 | without having to worry about conflicts in vimrc when pulling. 108 | 109 | `~/.after.vimrc` will be loaded after all configuration options are set. 110 | This is the best place to change default behaviour (keybindings) or 111 | color scheme. 112 | 113 | # Acknowledgments 114 | 115 | Obviously I steal a lot work from others. Here is my special thanks to: 116 | 117 | Joe Di Castro (joedicastro)'s 118 | [dotfiles](https://github.com/joedicastro/dotfiles/tree/master/vim). Most part 119 | of this config is copied from Joe, including large amount of this README. His 120 | idea of using Unite to create UI is brilliant. 121 | 122 | [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh). Copied it's name and 123 | some scripts. 124 | 125 | # Usage 126 | 127 | Most shortcuts start with either `,` or ``: 128 | > `` key is mapped to `,` 129 | 130 | > `` key is mapped to `` 131 | 132 | > `u` i.e. `u` will trigger the awesome Unite UI 133 | 134 | Oh-my-vim features are organized as packages, while each package is just a 135 | .vimrc file. Modulization is good because: 136 | 137 | - Each package is short and easy to follow. 138 | - You can easily add a new package (such as java or ruby) and send a pull-request. 139 | - You can ignore the package you don't need by setting a parameter 140 | `g:oh-my-vim_packages` in local.vimrc. 141 | 142 | The packages list: 143 | 144 | - [basic](#basic) - some basic vim config to make it easy to use 145 | - [code](#code) - general coding 146 | - [text](#text) - text edition 147 | - [grep](#grep) - search text in files 148 | - [searching](#searching) - search text in current buffer 149 | - [registers](#registers) - yanks, registers & history 150 | - [navigation](#navigation) - navigate by buffers, tabs & windows 151 | - [files](#files) - files & dirs 152 | - [git](#git) - git 153 | - [python](#python) - python 154 | - [web](#web) - web 155 | - [bookmarks](#bookmarks) - bookmarks 156 | - [vim](#vim) - vim 157 | - [neobundle](#neobundle) - plugins administration with neobundle 158 | - [spelling](#spelling) - spell checking & translation 159 | - [markdown](#markdown) - markdown 160 | - [tools](#tools) - some other tools 161 | 162 | All the packages are viewalbe in the Unite UI interface. 163 | 164 | 165 | ## Unite 166 | 167 | Unite is an interface that unifies various "query results" under a common 168 | aspect and that follows Vim's default behavior (modal). It's almost an API 169 | that we can use to build our own solutions. In fact, the author describes it as 170 | "unite and create interfaces". With Unite you can open a file, change the 171 | buffer, choose a colorscheme, make a regex search (grep, Ack, Ag, ...), etc. 172 | Even you can take a look at the Vim registers, messages, help, command, functions, 173 | ... In short, it is a Swiss army knife that, well used, allows us to replace 174 | several different plugins with only one (in this case: CtrlP, Ack, YankRing, 175 | TagmaTasks and Tagbar). 176 | 177 | The Unite menu will show what functionality we have and what's their 178 | key-mappings. You can always refer the menu for something you don't 179 | remember the shortcut. 180 | 181 | The main Unite munu: 182 | ![unite_menu](https://github.com/liangxianzhe/oh-my-vim-image/blob/master/unite_menu.png?raw=true "unite_menu") 183 | 184 | ### Navigation inside Unite 185 | 186 | In Unite, you can filter result in Insert mode, you can select candidates and 187 | apply operations to selected candidates in Normal mode. Below are some of the 188 | available mappings: 189 | 190 | > __Mappings__ 191 | 192 | > __Normal__ mode: 193 | 194 | > - `q` exit from Unite and submenus 195 | > - `Q` exit from Unite and all submenus 196 | > - `i` change to insert mode 197 | > - `v` change to visual mode 198 | > - `` choose an action 199 | > - `a` choose an action for the selected candidate or add text at the end of 200 | > the prompt 201 | > - `` reset the menu 202 | > - `` mark the current candidate 203 | > - `*` mark all candidates 204 | > - `M` removes the candidate number limit 205 | > - `gg`, `G`, `j`, `k` typical Vim moves to move around candidates 206 | > - `?` shows help (mappings) 207 | > - `N` add a new candidate (only where have sense) 208 | > - `.` show hidden files (dotfiles) 209 | 210 | > *With a candidate selected:* 211 | 212 | > - `` execute the default action 213 | > - `b` add it to bookmarks 214 | > - `d` delete it 215 | > - `e` expand the path 216 | > - `t` open the candidate in a new tab 217 | > - `yy` do a yank 218 | > - `p` preview it 219 | > - `x` launch the quick selection 220 | 221 | > __Insert__ mode: 222 | 223 | > - `` change to normal mode 224 | > - `` choose an action 225 | > - `` execute the default action 226 | > - `` exit Unite 227 | > - `` delete it 228 | > - `` expand the path 229 | > - `` open the candidate in a new tab 230 | > - `` do a yank 231 | > - ``, ``, `` y `` Vim motions to move around candidates 232 | 233 | > *With a candidate selected:* 234 | 235 | > - `` mark the current candidate 236 | 237 | > __Visual__ mode: 238 | 239 | > - `` mark the current candidate 240 | 241 | 242 | ## Basic 243 | 244 | Put most basic vim config here, like indent, quick saving, history, backup. 245 | There is no Unite menu for this package. 246 | 247 | 248 | ## Code 249 | 250 | ![unite code](https://github.com/liangxianzhe/oh-my-vim-image/blob/master/unite_menu_code.png?raw=true "unite code") 251 | 252 | __Unite__ 253 | 254 | - `c` or `:Unite menu:code`, shows the Code menu 255 | 256 | __Menu__ 257 | 258 | These are the menu entries in detail: 259 | 260 | - *count lines of code* count the lines of code of the current file by the 261 | external program `$ cloc` and shows the output in Unite 262 | 263 | - *toggle indent lines* show/hide the indent lines, that works as a visual guide 264 | for long nested blocks of code, putting vertical lines for each indentation 265 | level. Is disabled by default. 266 | ![indentLine](http://joedicastro.com/static/pictures/indentline_en.gif "indentLine") 267 | 268 | - *syntastic toggle*, *syntastic check & errors* are two options 269 | of Syntastic, a plugin for code quality (syntax revision) for various 270 | programming and markup languages (python, ruby, lua, haskell, css, html, js, 271 | json, ...) via external tools (these tools are required). Show the syntax 272 | errors in the signs column (gutter). Also shows the total of errors and the 273 | number line of the first in the status line 274 | 275 | __Other tools__ 276 | 277 | - __Ultisnips__ is a plugin to manage snippets, the most advanced and powerful 278 | for this task that I know for Vim. Snippets are portions of code or text in 279 | which certain parts are declared as variable and the rest is fixed. They are 280 | very helpful to insert the same code structures again and again without need 281 | to write all the text, saving us an important number of keystrokes. To use 282 | them we only have to type the snippet keyword and the mapping, the fixed part 283 | of text is inserted automatically. Then the cursor moves to the first variable 284 | field to enter the desired text interactively, and so on. In the image you can 285 | see how it really works. 286 | 287 | Ultisnips brings by default a bunch of snippets classified for languages and 288 | some globals. The best feature of Ultisnips is that allows us to define our 289 | custom snippets with a level of control and automation than any other one 290 | offers. To know all the details is essential to read carefully the plugin help. 291 | BTW certain features are remarkable, like: nested snippets, embed external 292 | commands (shell, vimscript and python) in the snippets, use the snippets over 293 | visual selections, and text transformations into the snippets. 294 | 295 | ![ulti](http://joedicastro.com/static/pictures/ulti_en.gif "ulti") 296 | 297 | > __Mappings__ 298 | 299 | > - `` preceded by the snippet keyword, trigger the snippet 300 | > - `` jump to the next field 301 | > - `` jump to the previous field 302 | > - `` cancel the text enter in an optional field 303 | 304 | 305 | ## Text 306 | 307 | ![unite text](https://github.com/liangxianzhe/oh-my-vim-image/blob/master/unite_menu_text.png?raw=true "unite text") 308 | 309 | This menu groups several options to edit text 310 | 311 | __Unite__ 312 | 313 | `e` or `:Unite menu:text` shows the text menu 314 | 315 | __Menu__ 316 | 317 | - *toggle search results highlight* toggle the search results highlight, 318 | obviously 319 | 320 | - *toggle line numbers* toggle between the four possible visualizations of the 321 | line numbers column: none, relative (two forms), and absolute 322 | 323 | - *toggle wrapping* toggle automatic wrapping and the vertical column color. The 324 | vertical column that indicates wrapping threshold turns green when the 325 | automatic wrapping is disabled 326 | 327 | - *show hidden chars* show the hidden chars, those that are not printable 328 | (tabs, carriage returns, spaces, ...) 329 | 330 | - the next three entries are to fold/unfold the folds in our doc, one by one or 331 | all at the same time 332 | 333 | - and the three after those allows us to copy/paste from system clipboard and 334 | for toggle the paste mode. 335 | 336 | - *remove trailing whitespaces* delete those empty and almost never significant 337 | spaces at the end of the line 338 | 339 | - *text statistics* show the number of columns, lines, words, chars and 340 | bytes in total and for the current position 341 | 342 | - *show word frequency* show the number of times that each word appears in the text 343 | 344 | - *show available digraphs* show a table with all the digraphs available and 345 | the pair of chars needed to generate each of them. 346 | 347 | - *insert lorem ipsum text* insert a text block containing the famous [Lorem 348 | Ipsum][lorem] text 349 | 350 | [lorem]: http://es.wikipedia.org/wiki/Lorem_ipsum 351 | 352 | - *show current char info* show extended info about the current character. 353 | The info includes the decimal Unicode value, hexadecimal, octal, Unicode name, 354 | HTML entity, Emoji code and any digraph available. 355 | 356 | __Other text edition tools__ 357 | 358 | Apart from the tools included in the menu, and apart from the Vanilla Vim ones 359 | too, we have another bunch of tools available to help us to edit the text more 360 | easily. 361 | 362 | - __text-objects__ these are customized text objects that allow us to extend the 363 | Vim motions defined by default (word, sentence, paragraph, block, 364 | delimiters, and markup tags) and be able to use more efficient text 365 | selections. In this config I added the following ones: 366 | 367 | > - __line__ select a line by `al` or `il` 368 | > - __underscore__ select the text surrounded by underscores via `a_` or 369 | > `i_` 370 | > - __all the buffer__ select the entire buffer. We can use `ae` and `ie` 371 | > - __indent__ select a indentation level. Options: `ai`, `ii`, 372 | > `aI`, `iI`. `i` select the current level and the nested ones, `I` only 373 | > selects the current indent level 374 | > - __last search__ select the last search term results. Options:: `a/`, 375 | > `i/`, `a?` and `i?` 376 | > - __python class__ in a Python code file, selects a class by `aC`, `iC` 377 | > and `C` 378 | > - __python method or function__ same as above for methods and functions 379 | > via `aM`, `iM` and `M` 380 | 381 | - __vim-commentary__ an extremely easy tool to toggle commentary in lines and 382 | visual selections. We only need to enter a mapping and a movement to do the 383 | action, as simple as that. 384 | 385 | ![commentary](http://joedicastro.com/static/pictures/commentary_en.gif "commentary") 386 | 387 | > __Mapping__ 388 | > 389 | > - `c` or `gc` toggle the commentary 390 | 391 | - __vim-surround__ surround a vim text object with a pair of symmetrical 392 | chars. We can also remove or change the ones already there 393 | 394 | ![surround](http://joedicastro.com/static/pictures/surround_en.gif "surround") 395 | 396 | > __Mappings__ 397 | 398 | > - `ys{motion or text-object}{char}` create surround (*'your surround'*) 399 | > - `cs{orig_char}{dest_char}` change surround 400 | > - `ds{char}` delete surround 401 | > - `S{char}` for create surrounds in visual mode 402 | 403 | > *If we choose the first member of a pair, e.g '(', then the surround is 404 | > created with a whitespace between the char and the selection. If the last 405 | > is choosen, e.g. ')', then the extra space is not added.* 406 | 407 | - __vim-speeddating__ provides a smart way to increase/decrease time values 408 | 409 | ![speeddating](http://joedicastro.com/static/pictures/speeddating_en.gif "speeddating") 410 | 411 | > __Mappings__ 412 | 413 | > - `` Increase the time value under the cursor 414 | > - `` Decrease the time value under the cursor 415 | > - `d` Change the time under the cursor to the current UTC time 416 | > - `d` Change the time under the cursor to the current Local time 417 | 418 | - __delimitMate__ provides smart auto-completion for delimiters like 419 | __(), {}, [], "", '', ``__ 420 | 421 | This is very easy to use. If we write the first pair of these chars, then 422 | the second one is automatically introduced and the cursor moves to the 423 | interior thereof. Then, we continue writing and to exit the inside you only 424 | have to write the second character or press ``. If you only want the 425 | first char, you only have to press the __Delete__ key 426 | 427 | ![smartinput](http://joedicastro.com/static/pictures/smartinput_en.gif "smartinput") 428 | 429 | - __neocomplete__ auto-completion of keywords, methods, functions, etc by only 430 | typing a few letters (normally the first). Well used, this speeds up a lot writing 431 | of code or text. It improves the Vanilla Vim auto-completion, with a live 432 | fuzzy-logic search. It's powerful and totally customizable. 433 | 434 | ![neocomp](http://joedicastro.com/static/pictures/neocomp_en.gif "neocomp") 435 | 436 | > __Mappings__ 437 | 438 | > - `` insert the selected word 439 | > - `` go to the next word (below) in the option list 440 | > - `` go to the previous word (above) in the option list 441 | 442 | - __easydigraph__ easily insert digraphs, especially when trying to insert 443 | several simultaneously 444 | 445 | ![easydigraph](http://joedicastro.com/static/pictures/easydigraph_en.gif "easydigraph") 446 | > 447 | > __Mapping__ 448 | > 449 | > - `dd {motion}` turns in digraph the motion selected text 450 | 451 | - __vim-transpose__ transpose rows & columns. For certain kind of files, like 452 | *CSV*, it can be really helpful to deal with them. It works in visual mode. 453 | 454 | ![transpose](http://joedicastro.com/static/pictures/transpose_en.gif "transpose") 455 | 456 | > __Commands__ 457 | 458 | > - `:Transpose` do the transposition by default 459 | > - `:TransposeCSV {separator} {delimiter}` do the transposition by `;` or by 460 | > the specified separator & delimiter 461 | > - `:TransposeTab` transpose by tabs 462 | > - `:TransposeWords` transpose by words (inserts a `?` where is no one) 463 | > - `:TransposeInteractive` for complex transpositions 464 | 465 | 466 | ## Grep 467 | 468 | ![unite grep](https://github.com/liangxianzhe/oh-my-vim-image/blob/master/unite_menu_grep.png?raw=true "unite grep") 469 | 470 | This menu allows us to search files by regular expression engines. I have it 471 | configured to use the `ag` program first, then `ack` if `ag` is not found, and 472 | else the `grep` program. We can also use other Unix tools like `locate` and 473 | `find` from this menu. 474 | 475 | __Unite__ 476 | 477 | - `a` or `:Unite menu:grep` shows the grep menu 478 | 479 | __Menu__ 480 | 481 | - *grep (ag → ack → grep)* search files by content. Using a regular 482 | expression pattern in a target directory, shows us the results in Unite. 483 | Between brackets are the list of programs to use sorted by priority. It uses 484 | the first available. 485 | 486 | - *grep current word* grep the word under cursor. 487 | 488 | - *find* use the known Unix tool `find` to search files by name 489 | 490 | - *locate* same as above using the `locate` tool instead 491 | 492 | - *vimgrep* as a last resort, in case you don't have any regex search tool 493 | installed, you can use the internal Vim grep one. But it is extremely low 494 | in comparison with another of the mentioned in the first entry. So, use it 495 | only if you are desperate. 496 | 497 | 498 | ## Searching inside the buffer 499 | 500 | ![unite searching](http://joedicastro.com/static/pictures/unite_menu_searching.png "unite searching") 501 | 502 | __Unite__ 503 | 504 | - `f` or `:Unite menu:searching` shows the searching menu 505 | 506 | __Menu__ 507 | 508 | - *line* find all the lines where the introduced string appears 509 | 510 | - *word under the cursor* find all the lines where the word under the cursor 511 | appears. It is a improved version of the `*` key behavior 512 | 513 | - *outlines & tags (ctags)* list all the document "outlines" and allow us to 514 | navigate between them. Very useful to move around the headers of a Markdown 515 | document like this. In code files it shows the source tags (ctags) to move 516 | easily to a given point of the code. 517 | 518 | - *marks* list all the marks 519 | 520 | - *folds* navigate among folders 521 | 522 | - *changes* list all the changes made to the file 523 | 524 | - *jumps* list all the last window jumps 525 | 526 | - *undos* show the file undo history 527 | 528 | - *tasks* show all the pending tasks for the current buffer. These tasks (and notes) 529 | are defined by the following keywords: __TODO__, __FIXME__, __NOTE__, __XXX__ 530 | , __COMBAK__, and __@todo__ 531 | 532 | __Other tools__ 533 | 534 | - __vim-signature__ a plugin that improves the default Vim marks. It shows the 535 | marks in the lateral signs column. 536 | 537 | ![signature](http://joedicastro.com/static/pictures/signature_en.gif "signature") 538 | 539 | > __Mappings__ 540 | 541 | > - Alphabetic marks 542 | 543 | > - `m[a-zA-Z]` toggle the mark and display it in the signs column (gutter) 544 | > - `m,` place the next available mark 545 | > - `m` delete all marks 546 | > - ]` jump the next mark 547 | > - [` jmmp the previous mark 548 | > - `]'` jump to start of next line containing a mark 549 | > - `['` jump to start of previous line containing a mark 550 | 551 | > - Symbol marks (markers) 552 | 553 | > - `m[0-9]` toggle the corresponding marker `!@#$%^&*()` 554 | > - `m` remove all markers of the same type 555 | > - `]-` jump to next line having same marker 556 | > - `[-` jump to prev line having same marker 557 | > - `m` remove all markers 558 | 559 | 560 | ## Registers 561 | 562 | ![unite registers](http://joedicastro.com/static/pictures/unite_menu_registers.png "unite registers") 563 | 564 | __Unite__ 565 | 566 | - `i` or `:Unite menu:registers` shows the registers menu 567 | 568 | __Menu__ 569 | 570 | - *yanks* list all the yanks arranged chronologically starting with the most 571 | recent 572 | 573 | - *commands* show the Ex command history 574 | 575 | - *searches* list the last searches 576 | 577 | - *registers* show the vim registers content 578 | 579 | - *messages* show the messages register (like the `:messages` command) 580 | 581 | - *undo* launch the Gundo plugin. Gundo makes the Vim undo tree friendlier. We 582 | can preview the changes and navigate easily around the tree. 583 | 584 | ![gundo](http://joedicastro.com/static/pictures/gundo_en.gif "gundo") 585 | 586 | 587 | ## Navigation 588 | 589 | ![unite navigation](http://joedicastro.com/static/pictures/unite_menu_navigation.png "unite navigation") 590 | 591 | > __Mappings__ 592 | 593 | > In addition to the options available on the menui, I have set a number of 594 | > mappings that make it much easier to manage windows 595 | 596 | > - `` move to the next window to the left 597 | > - `` move to the lower window 598 | > - `` move to the upper window 599 | > - `` move to the next window to the right 600 | 601 | __Unite__ 602 | 603 | `b` or `:Unite menu:navigation` shows the navigation menu 604 | 605 | __Menu__ 606 | 607 | - The first three menu entries let us to easily move to the chosen buffer, tab, 608 | or window from the candidates 609 | 610 | - *location list* and *quickfix* to access these windows content through 611 | Unite interface 612 | 613 | - *resize windows* use the winresizer plugin to easily resize the windows 614 | 615 | > __Mappings__ 616 | > 617 | > - `h`, `j`, `k`, `l` use vim motions to move the windows separator 618 | > - `` end the resizing 619 | > - `q` cancel the resizing 620 | 621 | - the next two entries are for creating new windows (horizontal and vertical) and 622 | the third one is to close any window (except the last) 623 | 624 | - *toggle quickfix window* toggle the quickfix window, also close the location 625 | list if is opened 626 | 627 | - *zoom* make zoom in a window 628 | 629 | - *delete buffer* delete a buffer 630 | 631 | 632 | ## Files and directories 633 | 634 | ![unite files](http://joedicastro.com/static/pictures/unite_menu_files.png "unite files") 635 | 636 | __Unite__ 637 | 638 | - `o` or `:Unite menu:files` show the file menu 639 | 640 | __Menu__ 641 | 642 | - *open file* show a list of files available in the current working directory 643 | 644 | - *open more recently used files* show the last opened files 645 | 646 | - *open file with recursive search* same as above but including the files under 647 | the subdirectories recursively 648 | 649 | - the next three entries are similar to the preceding ones but working with 650 | directories instead of files 651 | 652 | - *make new directory* make a new directory without opening a file browser 653 | 654 | - *change working directory* allow us to change the current working directory 655 | 656 | - *know current working directory* is like running the `:pwd` command 657 | 658 | - *junk files* to open a new (or a previous one) junk file to make annotations, 659 | tests, ... 660 | 661 | - *save as root* allow us to save a file that only have permissions for `root` 662 | without need to run Vim under that user (or use `$ sudo`) and lost our 663 | configuration advantages by doing that. 664 | 665 | - *quick save* save quickly the file without need to run the `:w` command 666 | 667 | - *open ranger* call the external ncurses file manager [Ranger][rngr] to browse 668 | the directory hierarchy and choose the file that you want to edit. 669 | 670 | [rngr]:http://joedicastro.com/productividad-linux-ranger.html 671 | 672 | ![ranger](http://joedicastro.com/static/pictures/ranger_vim_en.gif "ranger") 673 | 674 | - *open vimfiler* open the file explorer Vimfiler, Unite based and very 675 | powerful. I used mainly in those computers where ranger is not available. It 676 | has a safe mode (enabled by default) in which you cannot copy, rename, move, 677 | create or delete files and directories. 678 | 679 | ![vimfiler](http://joedicastro.com/static/pictures/vimfiler_en.png "vimfiler") 680 | 681 | > __Mappings__ 682 | 683 | > - `` open a new vertical window, if is already opened toggle between them 684 | > - `j`, `k` and `gg` typical vim motions to move between the files 685 | > - `h`, `l` move between the parent and child directories 686 | > - `` select/deselect the current line 687 | > - `*` select/deselect all the lines 688 | > - `&` select similar lines 689 | > - `U` deselect everything 690 | > - `S` change the sort type (by name, date, size, ...) 691 | > - `c` copy the file (preceded by `C` do it to the clipboard) 692 | > - `m` move the file(preceded by `C` do it to the clipboard) 693 | > - `d` delete the file 694 | > - `r` rename the file 695 | > - `Cp` paste file from clipboard 696 | > - `K` new directory 697 | > - `N` new file 698 | > - `x` run the file's system associated program 699 | > - `e` edit the file 700 | > - `E` edit the file in a new window 701 | > - `v` preview the file 702 | > - `L` change the drive unit 703 | > - `~` go to the `home` directory 704 | > - \\ go to the `root` directory 705 | > - `` open the visited directories history (opened by ) 706 | > - `` open a directory 707 | > - `` return to the parent directory 708 | > - `t` expand the directory tree 709 | > - `T` expand the directory tree recursively 710 | - `I` change to the directory entered in the command line 711 | > - `M` set the current mask (to filter files) 712 | > - `.` show/hide the hidden files (dotfiles) 713 | > - `q` hide vimfiler 714 | > - `Q` exit vimfiler 715 | > - `H` exit to the shell (exit from shell to return to vimfiler) 716 | > - `-` close the current vimfiler window 717 | > - `?` show the vimfiler help (mappings) 718 | > - `o` sync another vimfiler with this one 719 | > - `O` open a file/directory in another vimfiler 720 | > - `yy` yank the full path 721 | > - `gr` make grep into the current directory 722 | > - `gf` make find into the current directory 723 | > - `gc` make the current directory in the Vim working directory 724 | > - `a` choose the action to apply to the file 725 | > - `Y` save the current path in a temporal list 726 | > - `P` show the paths saved in the temporal list 727 | > - `` redraw the screen 728 | > - `gs` toggle the safe mode __Warning!__ 729 | > - `gS` toggle the simple mode 730 | 731 | 732 | ## Git 733 | 734 | ![unite git](http://joedicastro.com/static/pictures/unite_menu_git_en.png "unite git") 735 | 736 | __Unite__ 737 | 738 | - `g` or `:Unite menu:git` show the git menu 739 | 740 | __Menu__ 741 | 742 | - *tig* open the external application [tig][tig], which is a ncurses interface 743 | for git. Obviously, this only works when the working directory is into a git 744 | repository. 745 | 746 | ![tig](http://joedicastro.com/static/pictures/tig_en.gif "tig") 747 | 748 | [tig]: https://github.com/jonas/tig 749 | 750 | - *git viewer* and *git viewer - buffer* use the __gitv__ plugin that is a clone 751 | of the `gitk` tool for Vim, which is the viewer provided originally by `git`. 752 | This plugin allows us to view the repository history, to do diffs, checkouts, 753 | merges, ... It works atop of Fugitive and requires of it for work, and both 754 | have a similar behavior. The first entry will open a viewer relative to the 755 | whole repository (explorer mode), while the second one will do it in function 756 | of the current buffer or a visual selection (file mode) 757 | 758 | ![gitv](http://joedicastro.com/static/pictures/gitv_en.png "gitv") 759 | 760 | > __Mappings__ 761 | 762 | > - `` open a commit, a diff, a tree, a file, more commits, etc, 763 | > depending of where is used, with a similar behavior that Fugitive 764 | 765 | > - `o` open the commit in a new horizontal window 766 | 767 | > - `O` open the commit in a new tab 768 | 769 | > - `s` open the commit in a new vertical window 770 | 771 | > - `i` in "explorer mode" open the file & in "file mode" open the commit 772 | > details 773 | 774 | > - `q` exit from gitv 775 | 776 | > - `a` toggle the `-all` argument and update the window 777 | 778 | > - `u` update the window content 779 | 780 | > - `co` do a `git checkout`. In "explorer mode" dot it over the whole 781 | > repository and in the "file mode" do it over the current file 782 | 783 | > - `D` do a diff via vimdiff. 784 | 785 | > - `S` show a `diffstat` 786 | 787 | > - `m` and `m` do a merge in visual and normal modes respectively 788 | 789 | > - `git` enter the `:Git ` command in the command line to enter a custom 790 | > git command. If the command changes the repository status, the changes 791 | > will be updated in gitv 792 | 793 | > - `yc` yank the commit short hash, `sha` 794 | 795 | > __Motions__ 796 | 797 | > - `x` and `X` to move around the branch points (where a merge is created) 798 | 799 | > - `r` and `R` to move around the references 800 | 801 | > - `P` jump to the commit tagged as `HEAD` 802 | 803 | 804 | - Almost of the rest of the entries are typical git commands which are executed 805 | via the __Fugitive__ tool. Fugitive is a git wrapper, so good that allows us 806 | to manage git repositories without leave Vim. It's so complete and powerful 807 | that requires a certain amount of time to get used to it and get total control 808 | over its particular interface. The author, Tim Pope, says that about it: "A 809 | Git wrapper so awesome, it should be illegal" and is almost true. 810 | 811 | ![fugitive](http://joedicastro.com/static/pictures/fugitive_en.png "fugitive") 812 | 813 | - *status* show the repository status and from this window we can access to 814 | multiple options. In this window this mappings are available: 815 | 816 | > __Mappings__ 817 | 818 | > - `` and `` allow us to move between files 819 | 820 | > - `` run the `:Gedit` command that allow us to "edit" a revision 821 | 822 | > - `-` using it over a file that is not included in the 'stage area' 823 | > (index) it add it, is like run a `git add` or `git stage` in the 824 | > shell. Using it over a file included in the `stage area`, remove it 825 | > from there, like using a `git reset` 826 | 827 | > - `cc` or `C` do a commit with the command `:Gcommit` the same as 828 | > doing a `git commit` 829 | 830 | > - `ca` do a commit which add the new changes to the previous commit, 831 | > useful when we forgot add something in a commit. Same as `git commit 832 | > --amend` 833 | 834 | > - `D` make a diff between the current version and the index one, using 835 | > vimfiler via the `:Gdiff` command 836 | 837 | > - `ds` do a diff with `:Gsdiff`, same as above but split windows 838 | > horizontally 839 | 840 | > - `dv` do a diff without `:Gvdiff`, with vertical split windows. A 841 | > synonym of `D` 842 | 843 | > - `dp` has a dual behavior. On the one hand, if there are changes but 844 | > those are not in the `stage area` (index), then show a diff with the 845 | > changes, like running the `git diff` command. Then, if we make a 846 | > `:Gwrite` (`gw`) the changes are added to the index and we 847 | > can submit a commit now. On the other hand, if there are files that 848 | > are not being tracked, try to add them using the `git add 849 | > --intent-to-add .` command 850 | 851 | > - `p` to submit partial commits, where we choose interactively which 852 | > changes portions are included in the index and which not. If we use 853 | > it over a file that is not in the index, we will we asked about what 854 | > parts we want to index, like running `git add --patch`. If we use it 855 | > with an already indexed file, we'll choose what parts remove from 856 | > the index, same as `git reset --patch` 857 | 858 | > - `o` open the file in a new horizontal window 859 | 860 | > - `O` open the file in a new tab 861 | 862 | > - `S` open the file in a new vertical window 863 | 864 | > - `R` update the status window 865 | 866 | > - `q` close the status window 867 | 868 | - *diff* make a diff (`:Gdiff`) between the current version of the file versus 869 | the one in the index. In conflict situations like in a merge, it will we a 870 | three-way diff, which makes it a good tool for dealing with `merge` and 871 | `rebase`. The mapping available for this window are the following (to know how 872 | vimdiff works, look up the help): 873 | 874 | > __Mappings__ 875 | 876 | > - `do` do a `:diffget`, get the changes from the other file 877 | > - `dp` do a `:diffput`, put the changes to the other file 878 | > - `du` do a `:diffupdate`, update changes 879 | > - `dq` exit from diffmode 880 | > - `u` undoes all changes 881 | > - `[c` and `]c` to move between diffs 882 | > - `:Gwrite` or `gw` write the changes to the index 883 | 884 | - *commit* use the `:Gcommit` command (same as `git commit`). If there is 885 | nothing in the index, then do a `:Gstatus` and show the status window. 886 | __Warning__: Unlike when running the actual git-commit command, it is 887 | possible (but unadvisable) to muck with the index with commands like 888 | git-add and git-reset while a commit message is pending 889 | 890 | - *log* show all the previous revisions of the current file in a Unite 891 | window, starting for the most recent and open the last in the current 892 | buffer. To return to the current file, use `:Gedit` (`ge`). Within 893 | the buffer we can move between revision using the commands `:cnext`, 894 | `:cprevious`, `:cfirst` and `:clast` 895 | 896 | - *log - all* similar as the previous one, but in this case all the 897 | repository commits are showed, and what appears in the buffer is something 898 | similar to the `git show` command output 899 | 900 | - *blame* use the `:Gblame` command that opens a new vertical widow at the 901 | left of the current buffer, where is displayed the commit, the author and 902 | date for each line of the file. Similar to run `git blame`. 903 | 904 | > __Mappings__ 905 | 906 | > - `A` resize the blame window to end of author column 907 | > - `C` resize the blame window to end of commit column 908 | > - `D` resize the blame window to end of date column 909 | > - `q` close the blame window 910 | > - `gq` close the blame window and runs `:Gedit` to restore the current 911 | > version 912 | > - `` close the blame window and open the selected commit 913 | > - `o` open the selected commit in a new horizontal window 914 | > - `O` open the selected commit in a new tab 915 | > - `-` runs a new `blame` in the selected commit 916 | 917 | - *add/stage* use the `:Gwrite` command that save the actual file and adds 918 | it to the index with the changes made. Is like doing a `git add` or its 919 | synonym `git stage` 920 | 921 | - *checkout* do a `:Gread`, empty the current buffer and restore the index 922 | copy or what is the same, like if we were making a `git checkout` to the 923 | file. The changes are not permanent until we save the file. 924 | 925 | - *rm* remove the file with the `:Gremove` command and empty the buffer. We 926 | get the same as if we do a `git rm` in the shell 927 | 928 | - *mv* as for a new path and move the file there, renaming automatically the 929 | buffer. The similar git command would be `git mv`. The target is relative to 930 | the current path, unless is preceded by `/` in which case is relative to the 931 | repository root 932 | 933 | - *push* execute the `:Git! push` command, showing the output in the buffer 934 | 935 | - *pull* do a `:Git! pull` redirecting the output to the buffer 936 | 937 | - *command* run the git command that we entered in the command line and show 938 | the result in a new buffer (exit from there by pressing `q`). We can use 939 | the current custom alias in our git config. This option by itself is 940 | reason enough to use Fugitive. 941 | 942 | - *edit* allow us to "edit" any git object (blobs, trees, commits, tags). It 943 | supports auto-completion and we can use a SHA, a branch, a tag, a tree or a 944 | commit. 945 | 946 | - *grep* do a grep over the repository using `:Ggrep` which in turn use `git 947 | grep` 948 | 949 | - *grep (messages)* make a grep over the repository using `:Glog --grep=` to 950 | search into the commit messages 951 | 952 | - *grep (text)* make a grep over the repository using `:Glog -S` to search 953 | into the commits where the text had been added or removed 954 | 955 | - *init* create a new git repository or reset a previous one (safe) 956 | 957 | - *cd* change the working directory to the repository one 958 | 959 | - *lcd* change the current buffer's working directory to the repository one 960 | 961 | - *browse* if the remote repository is at GitHub open it in a browser, 962 | showing the git object that we have selected in that moment. Otherwise, 963 | use `git instaweb` to display the current selected blob, tree, commit or 964 | tag. If a range is given, it is appropriately appended to the URL as an 965 | anchor 966 | 967 | Fugitive is a very powerful plugin that you only can learn how to use it by 968 | using it. And is very advisable to read the help to get a global vision of 969 | it. 970 | 971 | - *github dashboard* and *github activity* are two options to browse events at 972 | GitHub. With the first one we can browse the GitHub Dashboard of a given user. 973 | The last one allow us to view the public activity of a given user or repository. 974 | There is a limit of 60 calls/hour on the GitHub API without authentication. 975 | 976 | ![gh dashboard](http://joedicastro.com/static/pictures/gh_dashboard.png "gh dashboard") 977 | 978 | > __Mappings__ 979 | 980 | > - `` & `` to navigate back and forth through the links 981 | > - `` open a link in the browser 982 | > - R refresh the window 983 | > - q close the window 984 | 985 | - *github issues & PR* open the external ncurses application [shipit][shpt] 986 | that is an interface for GitHub issues and pull requests. The application is 987 | still in development but is an amazing way to manage GitHub issues without 988 | leaving Vim and the terminal. If you are inside a git repository that have a 989 | remote in GitHub, it will open the app for that repository. 990 | 991 | ![shipit](http://joedicastro.com/static/pictures/shipit.png "shipit") 992 | 993 | [shpt]: https://github.com/alejandrogomez/shipit 994 | 995 | __Other tools__ 996 | 997 | - *vim-gitgutter* show the changes that are made in the buffer versus the git 998 | repository index. It makes a `git diff` and shows the status 999 | (changed/added/deleted) of each line in the gutter (signs column). 1000 | 1001 | 1002 | ## Python 1003 | 1004 | ![unite python](https://github.com/liangxianzhe/oh-my-vim-image/blob/master/unite_menu_python.png?raw=true "unite python") 1005 | 1006 | __Unite__ 1007 | 1008 | - `p` or `:Unite menu:python` shows the python menu 1009 | 1010 | __Menu__ 1011 | 1012 | - *run python code* run the current buffer python code via pymode. It shows the 1013 | output in a new vertical window below 1014 | 1015 | - *show docs for the current word* show the documentation available for the word 1016 | under the cursor 1017 | 1018 | - *insert a breakpoint* insert a breakpoint in python code. If we have `ipython` 1019 | or `pudb` installed, it will use one of those instead the python `pdb` 1020 | 1021 | - *pylint check* do a code revision by [pylint][pylint] by demand 1022 | 1023 | [pylint]: http://www.pylint.org/ 1024 | 1025 | - *rope auto-completion* allow us to use the rope auto-completion. Useful for 1026 | methods auto-completion. 1027 | 1028 | - *jump to definition* jump to the location where the word under the cursor 1029 | (variable, function, class, method, ...) is defined. Open a new window with 1030 | the location, even if it is in another module or library 1031 | 1032 | - *reorganize imports* reorganize automatically the import statements 1033 | 1034 | - *refactorize - x* the entries that begin in this way are for refactorize the 1035 | python code with rope, using the method mentioned in each description 1036 | 1037 | - *show docs for current word* use rope to show the available documentation 1038 | about the word under the cursor. The advantage of this entry against the 1039 | pymode one is that this one allow us to search in the external libraries 1040 | documentation 1041 | 1042 | - *list virtualenvs* use the virtualenv plugin to list the python virtualenvs. 1043 | 1044 | - *activate virtualenv* activate the virtualenv 1045 | 1046 | - *deactivate virtualenv* deactivate the virtualenv 1047 | 1048 | - *run coverage2* and *run coverage3* use the [coverage.py][cvg] tool for 1049 | python2 and python3 respectively. It shows us the results in a window and as 1050 | marks in the signs column (gutter) to know the code coverage of the current 1051 | code. 1052 | 1053 | [cvg]: http://nedbatchelder.com/code/coverage/ 1054 | 1055 | - *toggle coverage report* and *toggle coverage marks* toggle the visibility of 1056 | the marks and report from coverage 1057 | 1058 | 1059 | ## Web Development 1060 | 1061 | __HTML5__ 1062 | 1063 | Provides autocompletion, syntax and indentation for HTML5. For that purpose 1064 | supports SVG, RDFa, microdata and WAI-AIRA 1065 | 1066 | 1067 | __Emmet__ 1068 | 1069 | ![emmet](http://joedicastro.com/static/pictures/emmet.gif "emmet") 1070 | 1071 | Emmet (former Zen Coding) allow us to write HTML/XML and CSS files more fast and 1072 | in a more brief and less tedious way. Emmet takes the snippets idea to a whole 1073 | new level: you can type CSS-like expressions that can be dynamically parsed, and 1074 | produce output depending on what you type in the abbreviation. 1075 | 1076 | The best way to know how this works is to look at the tutorial (`:h 1077 | emmet-tutorial` ) or read the official documentation, 1078 | [Emmet docs](http://docs.emmet.io/) 1079 | 1080 | > __Mappings__ 1081 | 1082 | > - `,` expand abbreviation (works as a wraper in visual mode, see the help) 1083 | > - `d` select the tag inward 1084 | > - `D` select the tag outward 1085 | > - `n` go to the next edit point 1086 | > - `N` go to the previous edit point 1087 | > - `i` update image size 1088 | > - `k` remove tag 1089 | > - `j` split/join tag 1090 | > - `/` toggle comment 1091 | > - `a` make anchor from url 1092 | > - `A` make quoted text from url 1093 | > - `c` code pretty 1094 | 1095 | 1096 | ## Bookmarks 1097 | 1098 | ![unite bookmarks](http://joedicastro.com/static/pictures/unite_menu_bookmarks.png "unite bookmarks") 1099 | 1100 | With this menu we can manage the bookmarks easily. 1101 | 1102 | __Unite__ 1103 | 1104 | `m` or `:Unite menu:bookmarks` shows the bookmarks menu 1105 | 1106 | 1107 | ## Vim 1108 | 1109 | ![unite vim](https://github.com/liangxianzhe/oh-my-vim-image/blob/master/unite_menu_vim.png?raw=true "unite vim") 1110 | 1111 | __Unite__ 1112 | 1113 | - `v` or `:Unite menu:vim` shows the vim menu 1114 | 1115 | __Menu__ 1116 | 1117 | These are the menu entries in detail: 1118 | 1119 | - *choose color scheme* display color scheme with preview support 1120 | 1121 | ![unite_colorscheme](http://joedicastro.com/static/pictures/unite_colorscheme_en.gif "unite colorscheme") 1122 | 1123 | - *mappings* shows all the customized mappings available whit their 1124 | corresponding associated action. Those ones that corresponds with plugins that 1125 | are Lazy are not showed unless the plugin is already loaded. 1126 | 1127 | - *edit configuration file (vimrc)* edits the vim configuration file `~./.vimrc` 1128 | 1129 | - *choose filetype* choose a filetype from a list to apply to the current buffer 1130 | 1131 | - *vim help* search into the vim help (slow) 1132 | 1133 | - *vim commands* list all commands available as candidates. For Lazy plugins, 1134 | these need to be loaded before appears in the list. 1135 | 1136 | - *vim functions* same as above for functions instead of commands 1137 | 1138 | - *vim runtimepath* shows all paths in the vim runtimepath 1139 | 1140 | - *vim command output* shows the output of a Vim command through the Unite 1141 | interface (e.g. `:ls`) 1142 | 1143 | - *unite sources* all the Unite sources available 1144 | 1145 | - *kill process* shows the output of the Unix command `top` where we can select 1146 | one or more process to kill them with `kill` 1147 | 1148 | - *launch executable* launch an executable from a list, in a similar behavior as 1149 | `dmenu` 1150 | 1151 | 1152 | ## Neobundle 1153 | 1154 | ![neobundle](http://joedicastro.com/static/pictures/unite_menu_neobundle_en.png "neobundle") 1155 | 1156 | A plugin to rule them all! NeoBundle allows us to manage the rest of the plugins, 1157 | itself included. __I have it configured to auto install itself and all of the 1158 | plugins when Vim is executed for the first time__. 1159 | 1160 | The advantages of NeoBundle versus Vundle and other similar plugins are the 1161 | following: 1162 | 1163 | - Allows to use another VCS other than git (hg, svn), even a local dir 1164 | - Allows revision lock or even set a plugin to not be updated 1165 | - Supports lazy initialization of plugins to optimizing startup time 1166 | - Supports multiple config options per plugin, like automatic building if needed 1167 | - and so on... 1168 | 1169 | The best way to use NeoBundle is through Unite: 1170 | 1171 | __Unite__ 1172 | 1173 | - `n` or `:Unite menu:neobundle`, shows the NeoBundle menu 1174 | 1175 | __Menu__ 1176 | 1177 | These are the menu entries in detail: 1178 | 1179 | - *neobundle* shows the installed plugins as candidates. Via the actions we can 1180 | delete them, browse the repository page, ... 1181 | 1182 | - *log* shows the last NeoBundle log 1183 | 1184 | - *lazy* shows all the installed plugins configured as Lazy. Those are loaded on 1185 | demand and allow us to have a lot of plugins installed that are not frequently 1186 | used without delaying the vim startup. I use this option a lot in this 1187 | configuration. 1188 | 1189 | - *update* updates all the plugins automatically (and installs those not already 1190 | installed) 1191 | 1192 | - *search* searches plugins by name on vim.org & GitHub (duplicates prone) 1193 | 1194 | - *install* installs all the plugins already present in the `.vimrc` file or in 1195 | the `direct_bundles.vim` file that are not yet installed 1196 | 1197 | - *check* checks if all the plugins are already installed, and if not, prompt 1198 | for their installation 1199 | 1200 | - *docs* installs help docs for all plugins manually 1201 | 1202 | - *clean* deletes, upon confirmation, those plugin folders that are no longer 1203 | needed because they are not still installed 1204 | 1205 | - *list* lists all the installed plugins 1206 | 1207 | - *direct edit* edits the `~/.vim/bundle/.neobundle/direct_bundles.vim` file 1208 | where NeoBundle stores those plugins installed directly (e.g. via NeoBundle 1209 | search) 1210 | 1211 | > __Plugins updating__ 1212 | 1213 | > Since we often install plugins from repositories, we are exposed to error- 1214 | > prone updates. Once in a while, a plugin update introduces a bug and you end up 1215 | > with an unstable configuration until that bug is fixed (which may take a while). 1216 | > If we use Vim for work, that is very inconvenient. 1217 | 1218 | > A way to avoid this is by using symbolic links and backups of our vim folder. 1219 | > If we made a backup of our vim config before an update, is easy to restore it 1220 | > to a previous stable state without much effort. But this is tedious and 1221 | > error-prone too. And alternative is managing this via NeoBundle. We can use 1222 | > the revision lock feature to specify what revision we want to install or even 1223 | > say to NeoBundle that a plugin should not be updated. But it is not a perfect 1224 | > solution either, and very manual. Maybe in a future, we could do plugin 1225 | > rollbacks... 1226 | 1227 | 1228 | ## Spell checking & translation 1229 | 1230 | ![unite spelling](https://github.com/liangxianzhe/oh-my-vim-image/blob/master/unite_menu_spelling.png?raw=true "unite spelling") 1231 | 1232 | __Unite__ 1233 | 1234 | - `s` or `:Unite menu:spelling` shows the spelling menu 1235 | 1236 | __Other tools__ 1237 | 1238 | - `T` Translate selected text to Chinese. 1239 | 1240 | 1241 | ## Markdown 1242 | 1243 | ![unite markdown](http://joedicastro.com/static/pictures/unite_menu_markdown_en.png "unite markdown") 1244 | 1245 | This allows us to preview the rendering of a Markdown file in the browser, 1246 | it supports the Markdown `extra` extension. The file is rendered by 1247 | Python-markdown, creating a temporal html file and open it in a browser tab. 1248 | 1249 | Used in conjunction with a plugin that refresh the browser tab when the html file 1250 | changes, we get a way to preview your document changes without leaving vim . 1251 | 1252 | __Unite__ 1253 | 1254 | - `k` or`:Unite menu:markdown` shows the markdown menu 1255 | 1256 | __Menu__ 1257 | 1258 | - *preview* renders the Markdown document in a temporal html file and open it in 1259 | a new browser tab (currently only work on Mac) 1260 | 1261 | - *refresh* rewrites the html file with the changes 1262 | 1263 | ![mep]( http://joedicastro.com/static/pictures/mep_en.gif "mep") 1264 | 1265 | 1266 | ## Some other tools 1267 | 1268 | ![unite tools](http://joedicastro.com/static/pictures/unite_menu_tools.png "unite tools") 1269 | 1270 | __Unite__ 1271 | 1272 | `t` or `:Unite menu:tools` shows the tools menu 1273 | 1274 | __Menu__ 1275 | 1276 | These are the menu entries in detail: 1277 | 1278 | - *run with python2 in tmux panel* use the Vimux plugin to interact with Tmux. 1279 | It allows to send commands to a Tmux panel and interact with it without losing 1280 | focus in Vim. If there are no other tmux panels opened, then a new panel is 1281 | opened in the 20% lower space. In other case, the command runs in the already 1282 | opened panel. This specific command run the buffer content with the `python2` 1283 | executable in the tmux panel. In the next image we can see the actual 1284 | behavior: 1285 | 1286 | ![vimux](http://joedicastro.com/static/pictures/vimux_en.gif "vimux") 1287 | 1288 | - *run with python3 in tmux panel* same as above but using the `python3` 1289 | interpreter 1290 | 1291 | - *run with python2 & time in tmux panel* run the python code wrapped by the 1292 | Unix `time` program to know the time consumed in the execution 1293 | 1294 | - *run with pypy & time in tmux panel* same as above but using `pypy` instead of 1295 | `python2` 1296 | 1297 | - *command prompt to run in tmux panel* open a command line prompt to enter a 1298 | custom command to run in a tmux panel 1299 | 1300 | - *repeat last command* repeat the last vimux command 1301 | 1302 | - *stop command execution in tmux panel* stop the execution of the last vimux 1303 | command 1304 | 1305 | - *inspect tmux panel* jump to the tmux panel where the last vimux command was 1306 | executed and enter in the tmux *copy mode* allowing us to scroll around the 1307 | panel and use the *vi mode* to copy text lines 1308 | 1309 | - *close tmux panel* close the tmux panel opened or used by Vimux 1310 | 1311 | - *open link* open link under cursor using utl.vim 1312 | ![utl](http://joedicastro.com/static/pictures/utl_en.gif "utl") 1313 | 1314 | __Other tools__ 1315 | 1316 | - DirDiff 1317 | 1318 | It has a similar behavior that the vimdiff tool but for directories instead 1319 | of individual files 1320 | 1321 | ![DirDiff](http://joedicastro.com/static/pictures/dirdiff_en.gif "DirDiff") 1322 | 1323 | > __Commands__ 1324 | 1325 | > - `:DirDiff {A:directory 1} {B: directory 2}` shows the differences between 1326 | > the two directories 1327 | > - `:DirDiffQuit` exit from DirDiff mode 1328 | 1329 | 1330 | - Hexadecimal Editor 1331 | 1332 | For this I use the Vinarise plugin, a well thought hexadecimal editor for Vim. 1333 | 1334 | No play with this, is not a toy, this is for grown ups only! If you do not know 1335 | what you are doing, keep your hands out of it! :smile: If you are all thumbs, 1336 | this tool is a sure candidate for a disaster. 1337 | 1338 | ![hex](http://joedicastro.com/static/pictures/vinarise_en.png "hex") 1339 | 1340 | > __Mappings__ 1341 | 1342 | - `` entry into the Hexadecimal mode 1343 | - `V` edit the file in ASCII mode with Vim (Vinarise keeps opened) 1344 | - `q` hide Vinarise 1345 | - `Q` quit Vinarise 1346 | - `` show current position 1347 | - `r` change current address 1348 | - `R` overwrite from current address 1349 | - `gG` move to input address 1350 | - `go` move by offset address 1351 | - `/` search binary value 1352 | - `?` search binary value reverse 1353 | - `g/` search string value 1354 | - `g?` search string value reverse 1355 | - `e/` search regular expression (search only forward) 1356 | - `E` change encoding 1357 | - `` redraw 1358 | - `g` reload 1359 | 1360 | # Plugins & Colorschemes 1361 | 1362 | - __badwolf__ 1363 | - __coveragepy.vim__ 1364 | - __crontab.vim__ 1365 | - __csapprox__ 1366 | - __delimitMate__ 1367 | - __DirDiff.vim__ 1368 | - __easydigraph.vim__ 1369 | - __emmet-vim__ 1370 | - __gitv__ 1371 | - __gundo.vim__ 1372 | - __harlequin__ 1373 | - __html5.vim__ 1374 | - __indentLine__ 1375 | - __JSON.vim__ 1376 | - __junkfile.vim__ 1377 | - __loremipsum__ 1378 | - __molokai__ 1379 | - __neobundle.vim__ 1380 | - __neocomplete.vim__ 1381 | - __po.vim--gray__ 1382 | - __python-mode__ 1383 | - __summerfruit256.vim__ 1384 | - __syntastic__ 1385 | - __ultisnips__ 1386 | - __unite-colorscheme__ 1387 | - __unite-filetype__ 1388 | - __unite-fold__ 1389 | - __unite-help__ 1390 | - __unite-locate__ 1391 | - __unite-mark__ 1392 | - __unite-outline__ 1393 | - __unite-quickfix__ 1394 | - __unite.vim__ 1395 | - __utl.vim__ 1396 | - __vim-airline__ 1397 | - __vim-characterize__ 1398 | - __vim-commentary__ 1399 | - __vim-fugitive__ 1400 | - __vim-gitgutter__ 1401 | - __vim-github256__ 1402 | - __vim-github-dashboard__ 1403 | - __vim-markdown__ 1404 | - __vim-markdown-extra-preview__ 1405 | - __vim-molokai256__ 1406 | - __vim-pentadactyl__ 1407 | - __vim-repeat__ 1408 | - __vim-signature__ 1409 | - __vim-snippets__ 1410 | - __vim-speeddating__ 1411 | - __vim-surround__ 1412 | - __vim-textobj-entire__ 1413 | - __vim-textobj-indent__ 1414 | - __vim-textobj-lastpat__ 1415 | - __vim-textobj-line__ 1416 | - __vim-textobj-underscore__ 1417 | - __vim-textobj-user__ 1418 | - __vim-tmux__ 1419 | - __vim-transpose__ 1420 | - __vim-unite-history__ 1421 | - __vim-virtualenv__ 1422 | - __vimfiler__ 1423 | - __vimproc__ 1424 | - __vimux__ 1425 | - __vinarise.vim__ 1426 | - __webapi-vim__ 1427 | - __winresizer__ 1428 | - __zoomwintab.vim__ 1429 | -------------------------------------------------------------------------------- /UltiSnips/all.snippets: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # Snippets for all filetypes # 3 | ########################################################################### 4 | 5 | 6 | ########### 7 | # Folds # 8 | ########### 9 | 10 | snippet myfold "Fold" b 11 | " ${1:Title} {{{ 12 | 13 | ${2:Text} 14 | 15 | " }}} 16 | 17 | endsnippet 18 | 19 | 20 | ########### 21 | # Dates # 22 | ########### 23 | 24 | snippet timestamp "TimeStamp" ! 25 | `date` 26 | endsnippet 27 | 28 | snippet ahora "Fecha" ! 29 | `date +\%d-\%m-\%Y\ \%H:\%M:\%S` 30 | endsnippet 31 | 32 | snippet dia "Dia" ! 33 | `date +\%d-\%m-\%Y` 34 | endsnippet 35 | 36 | snippet hora "Hora" ! 37 | `date +\%H:\%M:\%S` 38 | endsnippet 39 | 40 | 41 | -------------------------------------------------------------------------------- /UltiSnips/base_django.snippets: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Django model fields snippets 3 | ############################################################################# 4 | 5 | snippet auto "autofield" b 6 | ${1:FIELDNAME} = models.AutoField() 7 | endsnippet 8 | 9 | snippet bool "boolean field" b 10 | ${1:FIELDNAME} = models.BooleanField(${2:default=True}) 11 | endsnippet 12 | 13 | snippet char "char field" b 14 | ${1:FIELDNAME} = models.CharField(max_length=${2}${3:, blank=True}) 15 | endsnippet 16 | 17 | snippet comma "comma sepparated field" b 18 | ${1:FIELDNAME} = models.CommaSeparatedIntegerField(max_length=${2}${3:, blank=True}) 19 | endsnippet 20 | 21 | snippet date "date fieldname" b 22 | ${1:FIELDNAME} = models.DateField(${2:auto_now_add=True, auto_now=True}${3:, blank=True, null=True}) 23 | endsnippet 24 | 25 | snippet datetime "datetime field" b 26 | ${1:FIELDNAME} = models.DateTimeField(${2:auto_now_add=True, auto_now=True}${3:, blank=True, null=True}) 27 | endsnippet 28 | 29 | snippet decimal "decimal field" b 30 | ${1:FIELDNAME} = models.DecimalField(max_digits=${2}, decimal_places=${3}) 31 | endsnippet 32 | 33 | snippet email "email field" b 34 | ${1:FIELDNAME} = models.EmailField(max_length=${2:75}${3:, blank=True}) 35 | endsnippet 36 | 37 | snippet file "file field" b 38 | ${1:FIELDNAME} = models.FileField(upload_to=${2:path/for/upload}${3:, max_length=100}) 39 | endsnippet 40 | 41 | snippet filepath "file path" b 42 | ${1:FIELDNAME} = models.FilePathField(path=${2:"/abs/path/to/dir"}${3:, max_length=100}${4:, match="*.ext"}${5:, recursive=True}${6:, blank=True, }) 43 | endsnippet 44 | 45 | snippet float "float field" b 46 | {1:FIELDNAME} = models.FloatField() 47 | endsnippet 48 | 49 | snippet image "image field" b 50 | ${1:FIELDNAME} = models.ImageField(upload_to=${2:path/for/upload}${3:, height_field=height, width_field=width}${4:, max_length=100}) 51 | endsnippet 52 | 53 | snippet int "integer field" b 54 | ${1:FIELDNAME} = models.IntegerField(default=${1}) 55 | endsnippet 56 | 57 | snippet ip "ip field" b 58 | ${1:FIELDNAME} = models.IPAddressField() 59 | endsnippet 60 | 61 | snippet nullbool "nullable boolean" b 62 | ${1:FIELDNAME} = models.NullBooleanField() 63 | endsnippet 64 | 65 | snippet posint "positive integer field" b 66 | ${1:FIELDNAME} = models.PositiveIntegerField() 67 | endsnippet 68 | 69 | snippet possmallint "possitive small integer field" b 70 | ${1:FIELDNAME} = models.PositiveSmallIntegerField() 71 | endsnippet 72 | 73 | snippet slug "slug field" b 74 | ${1:FIELDNAME} = models.SlugField(max_length=${2:50}${3:, blank=True}) 75 | endsnippet 76 | 77 | snippet smallint "small integer field" b 78 | ${1:FIELDNAME} = models.SmallIntegerField() 79 | endsnippet 80 | 81 | snippet text "text field" b 82 | ${1:FIELDNAME} = models.TextField(${2:blank=True}) 83 | endsnippet 84 | 85 | snippet time "time field" b 86 | ${1:FIELDNAME} = models.TimeField(${2:auto_now_add=True, auto_now=True}${3:, blank=True, null=True}) 87 | endsnippet 88 | 89 | snippet url "url field" b 90 | ${1:FIELDNAME} = models.URLField(${2:verify_exists=False}${3:, max_length=200}${4:, blank=True}) 91 | endsnippet 92 | 93 | snippet xml "xml field" b 94 | ${1:FIELDNAME} = models.XMLField(schema_path=${2:None}${3:, blank=True}) 95 | endsnippet 96 | 97 | # Relational Fields 98 | snippet fk "foreing key" b 99 | ${1:FIELDNAME} = models.ForeignKey(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, to_field=''}) 100 | endsnippet 101 | 102 | snippet m2m "many to many field" b 103 | ${1:FIELDNAME} = models.ManyToManyField(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, symmetrical=False}${6:, through=''}${7:, db_table=''}) 104 | endsnippet 105 | 106 | snippet o2o "one to one" b 107 | ${1:FIELDNAME} = models.OneToOneField(${2:OtherModel}${3:, parent_link=True}${4:, related_name=''}${5:, limit_choices_to=}${6:, to_field=''}) 108 | endsnippet 109 | 110 | 111 | # Code Skeletons 112 | 113 | snippet iform "Imports for forms" b 114 | #!/usr/bin/env python 115 | # -*- coding: UTF-8 -*- 116 | 117 | from django import forms 118 | from django.utils.translation import ugettext_lazy as _ 119 | ${0} 120 | endsnippet 121 | 122 | snippet imodels "Imports for models" b 123 | #!/usr/bin/env python 124 | # -*- coding: UTF-8 -*- 125 | 126 | from django.db import models 127 | from django.utils.translation import ugettext_lazy as _ 128 | endsnippet 129 | 130 | snippet iadmin "Import for admin" b 131 | #!/usr/bin/env python 132 | # -*- coding: UTF-8 -*- 133 | 134 | from django.contrib import admin 135 | from django.utils.translation import ugettext_lazy as _ 136 | endsnippet 137 | 138 | snippet iurl "Import for urls" b 139 | #!/usr/bin/env python 140 | # -*- coding: UTF-8 -*- 141 | 142 | from django.conf.urls import patterns, url 143 | 144 | urlpatterns = patterns('', 145 | url(r'^${1:re}/$', ${2:view}, name="${3}"),${0} 146 | ) 147 | endsnippet 148 | 149 | 150 | snippet form "base form" b 151 | class ${1:FormName}(forms.Form): 152 | """${2:docstring}""" 153 | ${3} 154 | endsnippet 155 | 156 | snippet mform "Model form" b 157 | class ${1}Form(ModelForm): 158 | """Modelform for $1""" 159 | 160 | class Meta: 161 | model = $1 162 | $0 163 | endsnippet 164 | 165 | snippet cleanf "cleand field validation" b 166 | def clean_${1:field}(self): 167 | # should raise forms.ValidationError 168 | data = self.cleaned_data['$1'] 169 | ${0} 170 | return data 171 | endsnippet 172 | 173 | snippet model "base model" b 174 | class ${1:ModelName}(models.Model): 175 | """${2:docstring}""" 176 | 177 | ${3} 178 | 179 | class Meta: 180 | verbose_name = u"${4}" 181 | verbose_name_plural = u"${5}" 182 | 183 | def __unicode__(self): 184 | return self.${6} 185 | 186 | def save(self, force_insert=False, force_update=False): 187 | super($1, self).save(**kwargs) 188 | 189 | @models.permalink 190 | def get_absolute_url(self): 191 | return ('${7:view_or_url_name}' ${8}) 192 | endsnippet 193 | 194 | 195 | snippet modeladmin "base model admin" b 196 | class ${1:ModelName}Admin(admin.ModelAdmin): 197 | ${2} 198 | 199 | admin.site.register($1, $1Admin) 200 | endsnippet 201 | 202 | snippet r2r "base render to response" b 203 | return render_to_response('${1:template.html}', { 204 | ${2} 205 | }${3:, context_instance=RequestContext(request)} 206 | ) 207 | endsnippet 208 | 209 | 210 | snippet tabularinline "tabular inline class" b 211 | class ${1:ModelName}Inline(admin.TabularInline): 212 | model = $1 213 | extra = ${2:3} 214 | endsnippet 215 | 216 | 217 | snippet stackedinline "stacked inline class" b 218 | class ${1:ModelName}Inline(admin.StackedInline): 219 | model = $1 220 | extra = ${2:3} 221 | endsnippet 222 | 223 | 224 | snippet fview "form view" b 225 | class ${1:ClassName}(FormView): 226 | """${0:docstring for $1}""" 227 | 228 | form_class = ${2:} 229 | template_name = '${3:}' 230 | success_url = reverse_lazy('${4:url_for_success}') 231 | 232 | def get_context_data(self, **kwargs): 233 | context = super($1, self).get_context_data(**kwargs) 234 | return context 235 | 236 | def form_valid(self, form): 237 | """${6:docstring for $1}""" 238 | #!TODO Complete 239 | return super($1, self).form_valid(form) 240 | 241 | def form_invalid(self, form): 242 | """${7:docstring for $1}""" 243 | #!TODO Complete 244 | return super($1, self).form_valid(form) 245 | endsnippet 246 | 247 | 248 | snippet tview "template view" b 249 | class ${1:ClassName}(TemplateView): 250 | template_name = '${2:}' 251 | 252 | def get_context_data(self, **kwargs): 253 | context = super($1, self).get_context_data(**kwargs) 254 | ${3:} 255 | return context 256 | endsnippet 257 | 258 | 259 | snippet rview "reverse view" b 260 | class ${1:ClassName}(RedirectView): 261 | permanent = ${2:true} 262 | 263 | def get_redirect_url(self, **kwargs): 264 | return reverse(${3}) 265 | endsnippet 266 | 267 | 268 | snippet lview "list view" b 269 | class ${1:ClassName}(ListView): 270 | model = ${2:Model} 271 | 272 | def get_queryset(self): 273 | queryset = ${3:$2.objects.all()} 274 | ${4} 275 | return queryset 276 | endsnippet 277 | 278 | #localize 279 | snippet mt "Marc as translatable" 280 | _(${VISUAL}) 281 | endsnippet 282 | 283 | snippet ts "Translatable string" 284 | _(u"${1:string}") 285 | endsnippet 286 | 287 | snippet tt "surround text as unicode string an make translatable" 288 | _(u"${VISUAL}") 289 | endsnippet 290 | -------------------------------------------------------------------------------- /UltiSnips/markdown.snippets: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # Markdown Snippets # 3 | ########################################################################### 4 | 5 | extends pelican 6 | 7 | ############# 8 | # Headers # 9 | ############# 10 | 11 | snippet h1 "Header h1" b 12 | # ${1:Header name} 13 | 14 | $0 15 | endsnippet 16 | 17 | snippet h1i "Header h1 with id" b 18 | # ${1:Header name} {#${2:id}} 19 | 20 | $0 21 | endsnippet 22 | 23 | snippet h2 "Header h2" b 24 | ## ${1:Header name} 25 | 26 | $0 27 | endsnippet 28 | 29 | snippet h2i "Header h2 with id" b 30 | ## ${1:Header name} {#${2:id}} 31 | 32 | $0 33 | endsnippet 34 | 35 | snippet h3 "Header h3" b 36 | ### ${1:Header name} 37 | 38 | $0 39 | endsnippet 40 | 41 | snippet h3i "Header h3 with id" b 42 | ### ${1:Header name} {#${2:id}} 43 | 44 | $0 45 | endsnippet 46 | 47 | snippet h4 "Header h4" b 48 | #### ${1:Header name} 49 | 50 | $0 51 | endsnippet 52 | 53 | snippet h4i "Header h4 with id" b 54 | #### ${1:Header name} {#${2:id}} 55 | 56 | $0 57 | endsnippet 58 | 59 | snippet h5 "Header h5" b 60 | ##### ${1:Header name} 61 | 62 | $0 63 | endsnippet 64 | 65 | snippet h5i "Header h5 with id" b 66 | ##### ${1:Header name} {#${2:id}} 67 | 68 | $0 69 | endsnippet 70 | 71 | snippet h6 "Header h6" b 72 | ###### ${1:Header name} 73 | 74 | $0 75 | endsnippet 76 | 77 | snippet h6i "Header h6 with id" b 78 | ###### ${1:Header name} {#${2:id}} 79 | 80 | $0 81 | endsnippet 82 | 83 | snippet hrlnk "Header ID Link" 84 | [${1:Text}](#${2:Header ID})$0 85 | endsnippet 86 | 87 | snippet hrlac "Header ID Link auto-complete" 88 | [${1:Text}](#${1/(\w+)(\s*)/\L$1\E(?2:-)/g})$0 89 | endsnippet 90 | 91 | ########### 92 | # Links # 93 | ########### 94 | 95 | snippet lnk "Inline Link" 96 | [${1:${VISUAL:Text}}](${3:http://${2:www.url.com}}${4/.+/ "/}${4:opt title}${4/.+/"/})$0 97 | endsnippet 98 | 99 | snippet rlnk "Reference-style link" 100 | [${1:${VISUAL:Text}}][${2:Reference}]$0 101 | endsnippet 102 | 103 | snippet rdef "Reference-style link ID" 104 | [${1}]: ${3:http://${2:www.url.com}} 105 | $0 106 | endsnippet 107 | 108 | snippet flnk "Fast link" 109 | $0 110 | endsnippet 111 | 112 | 113 | ############## 114 | # Emphasis # 115 | ############## 116 | 117 | snippet * "Italic" 118 | *${1:${VISUAL:Text}}*$0 119 | endsnippet 120 | 121 | snippet _ "Strong" 122 | __${1:${VISUAL:Text}}__$0 123 | endsnippet 124 | 125 | snippet *_ "Italic and Strong" 126 | ***${1:${VISUAL:Text}}***$0 127 | endsnippet 128 | 129 | 130 | ############ 131 | # Quotes # 132 | ############ 133 | 134 | snippet > "Quote" !b 135 | > ${1:${VISUAL:Text}:${VISUAL:Text}} 136 | 137 | $0 138 | endsnippet 139 | 140 | 141 | ########### 142 | # Lists # 143 | ########### 144 | 145 | snippet ol "Ordered List" 146 | 1. ${1} 147 | 2. ${2} 148 | 3. ${3} 149 | 4. ${4} 150 | $0 151 | endsnippet 152 | 153 | snippet ul "Unordered List" 154 | * ${1} 155 | * ${2} 156 | * ${3} 157 | * ${4} 158 | $0 159 | endsnippet 160 | 161 | 162 | ###################### 163 | # Definition Lists # 164 | ###################### 165 | 166 | snippet dl "Definition List" !b 167 | ${1:Word 1} 168 | : ${2:Definition} 169 | ${3:Word 2} 170 | : ${4:Definition} 171 | ${5:Word 3} 172 | : ${6:Definition} 173 | ${7:Word 4} 174 | : ${8:Definition} 175 | 176 | $0 177 | endsnippet 178 | 179 | 180 | ############ 181 | # Images # 182 | ############ 183 | 184 | snippet img! "Image" 185 | ![${1:pic alt}](${2:path}${3/.+/ "/}${3:opt title}${3/.+/"/})$0 186 | endsnippet 187 | 188 | snippet ilnk "Reference-style Image" 189 | ![${1:${VISUAL:Text}}][${2:Reference}] $0 190 | endsnippet 191 | 192 | snippet idef "Reference-style Image ID" 193 | [${1}]: ${2:path}${3/.+/ "/}${3:opt title}${3/.+/"/} 194 | $0 195 | endsnippet 196 | 197 | 198 | ############ 199 | # Tables # 200 | ############ 201 | 202 | snippet table "Table" 203 | ${1:First Header} | ${6:First Header} 204 | --------------------|-------------------- 205 | ${2:Content Cell} | ${7:Content Cell} 206 | ${3:Content Cell} | ${8:Content Cell} 207 | ${4:Content Cell} | ${9:Content Cell} 208 | ${5:Content Cell} | ${10:Content Cell} 209 | $0 210 | endsnippet 211 | 212 | 213 | ########## 214 | # Code # 215 | ########## 216 | 217 | snippet ` "Inline code" 218 | \`${1:code}\` $0 219 | endsnippet 220 | 221 | snippet ~ "Code" b 222 | ~~~ 223 | ${1:${VISUAL:Code}} 224 | ~~~ 225 | $0 226 | endsnippet 227 | 228 | 229 | ##################### 230 | # Horizontal Rule # 231 | ##################### 232 | 233 | snippet hr "Horizontal Rule" b 234 | ---------- 235 | 236 | $0 237 | endsnippet 238 | 239 | 240 | ############### 241 | # Footnotes # 242 | ############### 243 | 244 | snippet ft "Footnote Reference" 245 | [^${1:Footnote label}] 246 | endsnippet 247 | 248 | snippet ftd "Footnote Definition" 249 | [^${1:footnote label}]: ${2:Footnote} 250 | $0 251 | endsnippet 252 | 253 | 254 | ################## 255 | # Abbreviations # 256 | ################## 257 | 258 | 259 | snippet abb "Abbreviation" b 260 | *[${1:abbreviation}]: ${2:definition} 261 | endsnippet 262 | 263 | 264 | -------------------------------------------------------------------------------- /UltiSnips/pelican.snippets: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # Pelican Snippets # 3 | ########################################################################### 4 | 5 | #################### 6 | # Article Header # 7 | #################### 8 | 9 | snippet head "Header" b 10 | title: ${1} 11 | date: `date +%Y-%m-%d\ %H:%M` 12 | tags: ${2} 13 | status: draft 14 | 15 | $0 16 | endsnippet 17 | 18 | 19 | #################### 20 | # Pygments Lexer # 21 | #################### 22 | 23 | snippet lex "Pygments Lexer" b 24 | :::${1:lexer} 25 | $0 26 | endsnippet 27 | 28 | #################### 29 | # Centered Image # 30 | #################### 31 | 32 | snippet cimg "Centered Image" b 33 |

${4:image name}

35 | 36 | $0 37 | endsnippet 38 | 39 | 40 | -------------------------------------------------------------------------------- /UltiSnips/python.snippets: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # Python Snippets # 3 | ########################################################################### 4 | 5 | ############## 6 | # New File # 7 | ############## 8 | 9 | snippet script "Template for new script" !b 10 | #!/usr/bin/env python 11 | # -*- coding: utf8 -*- 12 | 13 | """ 14 | `!p snip.rv =snip.rv = fn` 15 | 16 | ${1} 17 | 18 | """ 19 | 20 | __author__ = "" 21 | __license__ = "MIT" 22 | __date__ = "`date +%Y-%m-%d`" 23 | __version__ = "0.1" 24 | 25 | try: 26 | import sys 27 | import os 28 | ${2} 29 | except ImportError: 30 | print(''' 31 |           An error found importing one module: 32 |            33 |           {0} 34 |            35 |           You need to install it 36 |            37 |           Stopping... 38 |           '''.format(str(sys.exc_info()[1])).replace(' ', '') 39 | ) 40 | sys.exit(-2) 41 | 42 | 43 | def main(): 44 | """Main section.""" 45 | ${4:pass} 46 | 47 | if __name__ == '__main__': 48 | main() 49 | endsnippet 50 | 51 | ########################################################################### 52 | # Simple Script # 53 | ########################################################################### 54 | 55 | snippet ss "Template for a new simple script" !b 56 | #!/usr/bin/env python 57 | # -*- coding: utf8 -*- 58 | 59 | """ 60 | ${1} 61 | """ 62 | 63 | ${2} 64 | endsnippet 65 | -------------------------------------------------------------------------------- /autoload/helperfuncs.vim: -------------------------------------------------------------------------------- 1 | let s:leaderKey = exists("&mapleader")?&mapleader:',' 2 | 3 | function! helperfuncs#unite_menu_gen(unite_menu, empty_list) 4 | let l:empty_list = a:empty_list 5 | 6 | if empty(a:unite_menu) 7 | return l:empty_list 8 | endif 9 | 10 | for entry in a:unite_menu 11 | if type(entry) == 1 12 | let entry = substitute(entry, '\V\c', '\1'.s:leaderKey, 'g') 13 | elseif type(entry) == 3 14 | let entry = helperfuncs#unite_menu_gen(entry, []) 15 | endif 16 | 17 | call add(l:empty_list, entry) 18 | endfor 19 | 20 | return l:empty_list 21 | endfunction 22 | -------------------------------------------------------------------------------- /font/DroidSansMono/Droid Sans Mono for Powerline.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangxianzhe/oh-my-vim/385c782829b06a05611e4e7bbfe21c1c037e1ce1/font/DroidSansMono/Droid Sans Mono for Powerline.otf -------------------------------------------------------------------------------- /font/DroidSansMono/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2006, 2007, 2008, 2009, 2010 Google Corp. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /font/DroidSansMono/README.rst: -------------------------------------------------------------------------------- 1 | Droid Sans Mono for Powerline 2 | ============================= 3 | 4 | :Font creator: Ascender Corporation 5 | :Source: Provided by system 6 | :Patched by: `mt3 `_ 7 | -------------------------------------------------------------------------------- /packages/basic.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " Basic options {{{ 4 | 5 | scriptencoding utf-8 6 | set encoding=utf-8 " setup the encoding to UTF-8 7 | set ls=2 " status line always visible 8 | set go-=T " hide the toolbar 9 | set go-=m " hide the menu 10 | " The next two lines are quite tricky, but in Gvim, if you don't do this, if you 11 | " only hide all the scrollbars, the vertical scrollbar is showed anyway 12 | set go+=rRlLbh " show all the scrollbars 13 | set go-=rRlLbh " hide all the scrollbars 14 | set visualbell " turn on the visual bell 15 | set cursorline " highlight the line under the cursor 16 | set fillchars+=vert:│ " better looking for windows separator 17 | set ttyfast " better screen redraw 18 | set title " set the terminal title to the current file 19 | set showcmd " shows partial commands 20 | set hidden " hide the inactive buffers 21 | set ruler " sets a permanent rule 22 | set lazyredraw " only redraws if it is needed 23 | set autoread " update a open file edited outside of Vim 24 | set ttimeoutlen=0 " toggle between modes almost instantly 25 | set backspace=indent,eol,start " defines the backspace key behavior 26 | set virtualedit=all " to edit where there is no actual character 27 | set scrolloff=7 " buffer when scrolling 28 | 29 | " Never goback to compatible mode 30 | nnoremap Q 31 | 32 | " }}} 33 | 34 | " Searching {{{ 35 | 36 | set incsearch " incremental searching 37 | set showmatch " show pairs match 38 | set hlsearch " highlight search results 39 | set smartcase " smart case ignore 40 | set ignorecase " ignore case letters 41 | 42 | " }}} 43 | 44 | " History and permanent undo levels {{{ 45 | 46 | set history=1000 47 | set undofile 48 | set undoreload=1000 49 | 50 | " }}} 51 | 52 | " Make a dir if no exists {{{ 53 | 54 | function! MakeDirIfNoExists(path) 55 | if !isdirectory(expand(a:path)) 56 | call mkdir(expand(a:path), "p") 57 | endif 58 | endfunction 59 | 60 | " }}} 61 | 62 | " Backups {{{ 63 | 64 | set backup 65 | set noswapfile 66 | set backupdir=$HOME/.vim/tmp/backup/ 67 | set undodir=$HOME/.vim/tmp/undo/ 68 | set directory=$HOME/.vim/tmp/swap/ 69 | set viminfo+=n$HOME/.vim/tmp/viminfo 70 | 71 | " make this dirs if no exists previously 72 | silent! call MakeDirIfNoExists(&undodir) 73 | silent! call MakeDirIfNoExists(&backupdir) 74 | silent! call MakeDirIfNoExists(&directory) 75 | 76 | " }}} 77 | 78 | " Wildmenu {{{ 79 | 80 | set wildmenu " Command line autocompletion 81 | set wildmode=list:longest,full " Shows all the options 82 | 83 | set wildignore+=*.sw? " Vim swap files 84 | set wildignore+=*.bak,*.?~,*.??~,*.???~,*.~ " Backup files 85 | set wildignore+=*.luac " Lua byte code 86 | set wildignore+=*.jar " java archives 87 | set wildignore+=*.pyc " Python byte code 88 | set wildignore+=*.stats " Pylint stats 89 | 90 | " }}} 91 | 92 | " Tabs, space and wrapping {{{ 93 | 94 | set expandtab " spaces instead of tabs 95 | set tabstop=4 " a tab = four spaces 96 | set shiftwidth=4 " number of spaces for auto-indent 97 | set softtabstop=4 " a soft-tab of four spaces 98 | set autoindent " set on the auto-indent 99 | 100 | " set formatoptions=qrn1ct 101 | set textwidth=80 102 | set colorcolumn=81 103 | 104 | function! ToggleWrap() 105 | let s:nowrap_cc_bg = [22, '#005f00'] 106 | redir => s:curr_cc_hi 107 | silent hi ColorColumn 108 | redir END 109 | let s:curr_cc_ctermbg = matchstr(s:curr_cc_hi, 'ctermbg=\zs.\{-}\s\ze\1') 110 | let s:curr_cc_guibg = matchstr(s:curr_cc_hi, 'guibg=\zs.\{-}\_$\ze\1') 111 | if s:curr_cc_ctermbg != s:nowrap_cc_bg[0] 112 | let g:curr_cc_ctermbg = s:curr_cc_ctermbg 113 | endif 114 | if s:curr_cc_guibg != s:nowrap_cc_bg[1] 115 | let g:curr_cc_guibg = s:curr_cc_guibg 116 | endif 117 | if &textwidth == 80 118 | set textwidth=0 119 | exec 'hi ColorColumn ctermbg='.s:nowrap_cc_bg[0]. 120 | \' guibg='.s:nowrap_cc_bg[1] 121 | elseif &textwidth == 0 122 | set textwidth=80 123 | exec 'hi ColorColumn ctermbg='.g:curr_cc_ctermbg. 124 | \' guibg='.g:curr_cc_guibg 125 | endif 126 | endfunction 127 | 128 | nmap ew :call ToggleWrap() 129 | 130 | " }}} 131 | 132 | " Ok, a vim for men, get off the cursor keys {{{ 133 | 134 | " nnoremap 135 | " nnoremap 136 | " nnoremap 137 | " nnoremap 138 | " inoremap 139 | " inoremap 140 | " inoremap 141 | " inoremap 142 | 143 | " }}} 144 | 145 | " Colorscheme {{{ 146 | 147 | syntax enable " enable the syntax highlight 148 | set background=dark " set a dark background 149 | set t_Co=256 " 256 colors for the terminal 150 | if has('gui_running') 151 | colorscheme molokai 152 | else 153 | colorscheme molokai256 154 | endif 155 | 156 | " }}} 157 | 158 | " Resize the divisions if the Vim window size changes {{{ 159 | 160 | au VimResized * exe "normal! \=" 161 | 162 | " }}} 163 | 164 | " New windows {{{ 165 | 166 | nnoremap v v 167 | nnoremap h s 168 | 169 | " }}} 170 | 171 | " Fast window moves {{{ 172 | 173 | nnoremap h 174 | nnoremap j 175 | nnoremap k 176 | nnoremap l 177 | 178 | " }}} 179 | 180 | " Fast window & buffer close and kill {{{ 181 | 182 | nnoremap k c 183 | nnoremap K :bd 184 | 185 | " }}} 186 | 187 | " Autoload configuration when this file changes ($MYVIMRC) {{{ 188 | 189 | autocmd! BufWritePost vimrc source % 190 | autocmd! BufWritePost *.vimrc source ~/.vimrc 191 | 192 | " }}} 193 | 194 | " Toggle the Quickfix window {{{ 195 | 196 | function! s:QuickfixToggle() 197 | for i in range(1, winnr('$')) 198 | let bnum = winbufnr(i) 199 | if getbufvar(bnum, '&buftype') == 'quickfix' 200 | cclose 201 | lclose 202 | return 203 | endif 204 | endfor 205 | copen 206 | endfunction 207 | command! ToggleQuickfix call QuickfixToggle() 208 | 209 | nnoremap q :ToggleQuickfix 210 | 211 | " }}} 212 | 213 | " Quick exiting without save {{{ 214 | 215 | nnoremap `` :qa! 216 | 217 | " }}} 218 | 219 | " Execution permissions by default to shebang (#!) files {{{ 220 | 221 | augroup shebang_chmod 222 | autocmd! 223 | autocmd BufNewFile * let b:brand_new_file = 1 224 | autocmd BufWritePost * unlet! b:brand_new_file 225 | autocmd BufWritePre * 226 | \ if exists('b:brand_new_file') | 227 | \ if getline(1) =~ '^#!' | 228 | \ let b:chmod_post = '+x' | 229 | \ endif | 230 | \ endif 231 | autocmd BufWritePost,FileWritePost * 232 | \ if exists('b:chmod_post') && executable('chmod') | 233 | \ silent! execute '!chmod '.b:chmod_post.' ""' | 234 | \ unlet b:chmod_post | 235 | \ endif 236 | augroup END 237 | 238 | " }}} 239 | 240 | " Load matchit by default {{{ 241 | 242 | if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# '' 243 | runtime! macros/matchit.vim 244 | endif 245 | 246 | " }}} 247 | 248 | " Make the Y behavior similar to D & C {{{ 249 | 250 | nnoremap Y y$ 251 | 252 | " }}} 253 | 254 | " END VIM SETUP }}} 255 | 256 | " Plugins {{{ 257 | 258 | " END Plugins }}} 259 | 260 | " Plugin Setup {{{ 261 | 262 | " END Plugin Setup }}} 263 | 264 | " Unite Menu {{{ 265 | 266 | " END Unite Menu }}} 267 | -------------------------------------------------------------------------------- /packages/bookmarks.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | 7 | " END Plugins }}} 8 | 9 | " Plugin Setup {{{ 10 | 11 | " END Plugin Setup }}} 12 | 13 | " Unite Menu {{{ 14 | let g:unite_source_menu_menus.bookmarks = { 15 | \ 'description' : ' bookmarks 16 | \ ⌘ [space]m', 17 | \} 18 | let g:unite_source_menu_menus.bookmarks.command_candidates = [ 19 | \['▷ open bookmarks', 20 | \'Unite bookmark:*'], 21 | \['▷ add bookmark', 22 | \'UniteBookmarkAdd'], 23 | \] 24 | 25 | let g:unite_source_menu_menus.bookmarks.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.bookmarks.command_candidates, []) 26 | 27 | nnoremap [menu]m :Unite -silent menu:bookmarks 28 | 29 | " END Unite Menu }}} 30 | -------------------------------------------------------------------------------- /packages/code.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " Count lines of code {{{ 4 | 5 | function! LinesOfCode() 6 | echo system('cloc --quiet '.bufname("%")) 7 | endfunction 8 | 9 | "}}} 10 | 11 | " FILETYPES {{{ ============================================================== 12 | 13 | " DJANGO HTML (Templates) {{{ 14 | 15 | au BufRead,BufNewFile */templates/*.html setlocal filetype=htmldjango.html 16 | 17 | " }}} 18 | 19 | " JSON {{{ ------------------------------------------------------------------- 20 | 21 | " autocmd BufNewFile,BufRead *.json set ft=javascript 22 | autocmd BufNewFile,BufRead *.json set ft=json 23 | 24 | augroup json_autocmd 25 | autocmd! 26 | autocmd FileType json set autoindent 27 | autocmd FileType json set formatoptions=tcq2l 28 | autocmd FileType json set textwidth=78 shiftwidth=2 29 | autocmd FileType json set softtabstop=2 tabstop=8 30 | autocmd FileType json set expandtab 31 | autocmd FileType json set foldmethod=syntax 32 | augroup END 33 | 34 | " }}} 35 | 36 | " LUA {{{ 37 | 38 | au BufRead,BufNewFile rc.lua setlocal foldmethod=marker 39 | 40 | " }}} 41 | 42 | " MARKDOWN {{{ 43 | 44 | " markdown filetype file 45 | au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=markdown 46 | autocmd FileType markdown NeoBundleSource vim-markdown 47 | autocmd FileType markdown NeoBundleSource vim-markdown-extra-preview 48 | 49 | " }}} 50 | 51 | " END FILETYPES }}} 52 | 53 | " END VIM SETUP }}} 54 | 55 | " Plugins {{{ 56 | call neobundle#append() 57 | 58 | " Autocompletion 59 | NeoBundle 'Shougo/neocomplete.vim' 60 | " Powerful and advanced Snippets tool 61 | NeoBundle 'SirVer/ultisnips' 62 | " Snippets for Ultisnips 63 | NeoBundle 'honza/vim-snippets' 64 | 65 | " Syntax {{{ 66 | 67 | NeoBundleLazy 'vim-scripts/JSON.vim', {'autoload': {'filetypes': ['json']}} 68 | NeoBundleLazy 'vim-scripts/po.vim--gray', {'autoload': {'filetypes': ['po']}} 69 | NeoBundleLazy 'joedicastro/vim-pentadactyl', { 70 | \ 'autoload': {'filetypes': ['pentadactyl']}} 71 | NeoBundle 'scrooloose/syntastic' 72 | 73 | " }}} 74 | 75 | call neobundle#end() 76 | " END Plugins }}} 77 | 78 | " Plugin Setup {{{ 79 | 80 | " Syntastic {{{ 81 | 82 | nmap N :SyntasticCheck:Errors 83 | 84 | let g:syntastic_python_pylint_exe = "pylint2" 85 | let g:syntastic_mode_map = { 'mode': 'active', 86 | \ 'active_filetypes': [], 87 | \ 'passive_filetypes': ['python'] } 88 | 89 | let g:syntastic_error_symbol='✗' 90 | let g:syntastic_warning_symbol='⚠' 91 | let g:syntastic_style_error_symbol = '⚡' 92 | let g:syntastic_style_warning_symbol = '⚡' 93 | 94 | " }}} 95 | 96 | " Commentary {{{ ------------------------------------------------------------- 97 | 98 | nmap c CommentaryLine 99 | xmap c Commentary 100 | 101 | augroup plugin_commentary 102 | au! 103 | au FileType python setlocal commentstring=#%s 104 | au FileType htmldjango setlocal commentstring={#\ %s\ #} 105 | au FileType puppet setlocal commentstring=#\ %s 106 | augroup END 107 | 108 | " }}} 109 | 110 | " Neocomplete {{{ 111 | 112 | let g:neocomplete#enable_at_startup = 1 113 | let g:neocomplete#enable_smart_case = 1 114 | let g:neocomplete#enable_refresh_always = 1 115 | let g:neocomplete#max_list = 30 116 | let g:neocomplete#min_keyword_length = 1 117 | let g:neocomplete#sources#syntax#min_keyword_length = 1 118 | let g:neocomplete#data_directory = $OH_MY_VIM.'/tmp/neocomplete' 119 | 120 | " disable the auto select feature by default to speed up writing without 121 | " obstacles (is optimal for certain situations) 122 | let g:neocomplete#enable_auto_select = 0 123 | 124 | " toggle the auto select feature 125 | function! ToggleNeoComplete() 126 | if !g:neocomplete#disable_auto_complete && g:neocomplete#enable_auto_select 127 | let g:neocomplete#disable_auto_complete = 0 128 | let g:neocomplete#enable_auto_select = 0 129 | elseif !g:neocomplete#disable_auto_complete && !g:neocomplete#enable_auto_select 130 | let g:neocomplete#disable_auto_complete = 1 131 | let g:neocomplete#enable_auto_select = 0 132 | elseif g:neocomplete#disable_auto_complete && !g:neocomplete#enable_auto_select 133 | let g:neocomplete#disable_auto_complete = 0 134 | let g:neocomplete#enable_auto_select = 1 135 | endif 136 | endfunction 137 | 138 | nnoremap ea :call ToggleNeoComplete() 139 | 140 | " Enable omni completion. 141 | autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS 142 | autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags 143 | autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS 144 | autocmd FileType python setlocal omnifunc=pythoncomplete#Complete 145 | autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete 146 | autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags 147 | 148 | if !exists('g:neocomplete#sources#omni#input_patterns') 149 | let g:neocomplete#sources#omni#input_patterns = {} 150 | endif 151 | 152 | let g:neocomplete#sources#omni#input_patterns.python='[^. \t]\.\w*' 153 | 154 | " }}} 155 | 156 | " END Plugin Setup }}} 157 | 158 | " Unite Menu {{{ 159 | 160 | let g:unite_source_menu_menus.code = { 161 | \ 'description' : ' coding 162 | \ ⌘ [space]c', 163 | \} 164 | let g:unite_source_menu_menus.code.command_candidates = [ 165 | \['▷ toggle auto-completion state (manual → disabled → auto) ⌘ ea', 166 | \'call ToggleNeoComplete()'], 167 | \['▷ syntastic toggle (syntastic)', 168 | \'SyntasticToggleMode'], 169 | \['▷ syntastic check & errors (syntastic) ⌘ N', 170 | \'normal N'], 171 | \['▷ count lines of code', 172 | \'Unite -default-action= output:call\\ LinesOfCode()'], 173 | \['▷ toggle indent lines ⌘ L', 174 | \'IndentLinesToggle'], 175 | \] 176 | 177 | let g:unite_source_menu_menus.code.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.code.command_candidates, []) 178 | 179 | nnoremap [menu]c :Unite -silent menu:code 180 | 181 | " END Unite Menu }}} 182 | 183 | -------------------------------------------------------------------------------- /packages/colorv.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | " A smart and powerful Color Management tool. Needs to be loaded to be able 7 | " to use the mappings 8 | NeoBundleLazy 'Rykka/colorv.vim', {'autoload' : { 9 | \ 'commands' : [ 10 | \ 'ColorV', 'ColorVView', 'ColorVPreview', 11 | \ 'ColorVPicker', 'ColorVEdit', 'ColorVEditAll', 12 | \ 'ColorVInsert', 'ColorVList', 'ColorVName', 13 | \ 'ColorVScheme', 'ColorVSchemeFav', 14 | \ 'ColorVSchemeNew', 'ColorVTurn2'], 15 | \ }} 16 | 17 | " END Plugins }}} 18 | 19 | " Plugin Setup {{{ 20 | function! GetColorFormat() 21 | let formats = {'r' : 'RGB', 22 | \'n' : 'NAME', 23 | \'s' : 'HEX', 24 | \'ar': 'RGBA', 25 | \'pr': 'RGBP', 26 | \'pa': 'RGBAP', 27 | \'m' : 'CMYK', 28 | \'l' : 'HSL', 29 | \'la' : 'HSLA', 30 | \'h' : 'HSV', 31 | \} 32 | let formats_menu = ["\n"] 33 | for [k, v] in items(formats) 34 | call add(formats_menu, " ".k."\t".v."\n") 35 | endfor 36 | let fsel = get(formats, input('Choose a format: '.join(formats_menu).'? ')) 37 | return fsel 38 | endfunction 39 | 40 | function! GetColorMethod() 41 | let methods = { 42 | \'h' : 'Hue', 43 | \'s' : 'Saturation', 44 | \'v' : 'Value', 45 | \'m' : 'Monochromatic', 46 | \'a' : 'Analogous', 47 | \'3' : 'Triadic', 48 | \'4' : 'Tetradic', 49 | \'n' : 'Neutral', 50 | \'c' : 'Clash', 51 | \'q' : 'Square', 52 | \'5' : 'Five-Tone', 53 | \'6' : 'Six-Tone', 54 | \'2' : 'Complementary', 55 | \'p' : 'Split-Complementary', 56 | \'l' : 'Luma', 57 | \'g' : 'Turn-To', 58 | \} 59 | let methods_menu = ["\n"] 60 | for [k, v] in items(methods) 61 | call add(methods_menu, " ".k."\t".v."\n") 62 | endfor 63 | let msel = get(methods, input('Choose a method: '.join(methods_menu).'? ')) 64 | return msel 65 | endfunction 66 | 67 | " ColorV {{{ 68 | 69 | let g:colorv_cache_file=$HOME.'/.vim/tmp/vim_colorv_cache' 70 | let g:colorv_cache_fav=$HOME.'/.vim/tmp/vim_colorv_cache_fav' 71 | 72 | " }}} 73 | 74 | " END Plugin Setup }}} 75 | 76 | " Unite Menu {{{ 77 | let g:unite_source_menu_menus.colorv = { 78 | \ 'description' : ' color management 79 | \ ⌘ [space]l', 80 | \} 81 | let g:unite_source_menu_menus.colorv.command_candidates = [ 82 | \['▷ open colorv ⌘ cv', 83 | \'ColorV'], 84 | \['▷ open colorv with the color under the cursor ⌘ cw', 85 | \'ColorVView'], 86 | \['▷ preview colors ⌘ cpp', 87 | \'ColorVPreview'], 88 | \['▷ color picker ⌘ cd', 89 | \'ColorVPicker'], 90 | \['▷ edit the color under the cursor ⌘ ce', 91 | \'ColorVEdit'], 92 | \['▷ edit the color under the cursor (and all the concurrences) ⌘ cE', 93 | \'ColorVEditAll'], 94 | \['▷ insert a color ⌘ cii', 95 | \'exe "ColorVInsert " .GetColorFormat()'], 96 | \['▷ color list relative to the current ⌘ cgh', 97 | \'exe "ColorVList " .GetColorMethod() " 98 | \ ".input("number of colors? (optional): ") 99 | \ " ".input("number of steps? (optional): ")'], 100 | \['▷ show colors list (Web W3C colors) ⌘ cn', 101 | \'ColorVName'], 102 | \['▷ choose color scheme (ColourLovers, Kuler) ⌘ css', 103 | \'ColorVScheme'], 104 | \['▷ show favorite color schemes ⌘ csf', 105 | \'ColorVSchemeFav'], 106 | \['▷ new color scheme ⌘ csn', 107 | \'ColorVSchemeNew'], 108 | \['▷ create hue gradation between two colors', 109 | \'exe "ColorVTurn2 " " ".input("Color 1 (hex): ") 110 | \" ".input("Color 2 (hex): ")'], 111 | \] 112 | 113 | let g:unite_source_menu_menus.colorv.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.colorv.command_candidates, []) 114 | 115 | nnoremap [menu]l :Unite -silent menu:colorv 116 | 117 | " END Unite Menu }}} 118 | -------------------------------------------------------------------------------- /packages/files.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " Save as root 4 | cmap w!! w !sudo tee % >/dev/null:e! 5 | 6 | " Quick saving 7 | nmap w :update 8 | 9 | " Use Ranger as a file explorer {{{ 10 | fun! RangerChooser() 11 | exec "silent !ranger --choosefile=/tmp/chosenfile " . expand("%:p:h") 12 | if filereadable('/tmp/chosenfile') 13 | exec 'edit ' . system('cat /tmp/chosenfile') 14 | call system('rm /tmp/chosenfile') 15 | endif 16 | redraw! 17 | endfun 18 | map x :call RangerChooser() 19 | " }}} 20 | 21 | " END VIM SETUP }}} 22 | 23 | " Plugins {{{ 24 | call neobundle#append() 25 | 26 | " File explorer (needed where ranger is not available) 27 | NeoBundleLazy 'Shougo/vimfiler', {'autoload' : { 'commands' : ['VimFiler']}} 28 | 29 | " Junk files 30 | NeoBundleLazy 'Shougo/junkfile.vim', {'autoload':{'commands':'JunkfileOpen', 31 | \ 'unite_sources':['junkfile','junkfile/new']}} 32 | 33 | " Linux tools {{{ 34 | 35 | " A diff tool for directories 36 | NeoBundleLazy 'joedicastro/DirDiff.vim', { 'autoload': { 'commands' : 'DirDiff'}} 37 | " Hexadecimal editor 38 | NeoBundle 'Shougo/vinarise.vim' 39 | 40 | " }}} 41 | 42 | call neobundle#end() 43 | " END Plugins }}} 44 | 45 | " Plugin Setup {{{ 46 | 47 | " Junk files {{{ 48 | 49 | nnoremap d :Unite -silent junkfile/new junkfile 50 | let g:junkfile#directory=expand($HOME."/.vim/tmp/junk") 51 | 52 | " }}} 53 | 54 | " VimFiler {{{ 55 | 56 | nnoremap X :VimFiler 57 | 58 | let g:vimfiler_as_default_explorer = 1 59 | 60 | let g:vimfiler_tree_leaf_icon = '├' 61 | let g:vimfiler_tree_opened_icon = '┐' 62 | let g:vimfiler_tree_closed_icon = '─' 63 | let g:vimfiler_file_icon = '┄' 64 | let g:vimfiler_marked_file_icon = '✓' 65 | let g:vimfiler_readonly_file_icon = '✗' 66 | 67 | let g:vimfiler_force_overwrite_statusline = 0 68 | 69 | let g:vimfiler_time_format = '%d-%m-%Y %H:%M:%S' 70 | let g:vimfiler_data_directory = $HOME.'/.vim/tmp/vimfiler' 71 | 72 | " }}} 73 | 74 | " END Plugin Setup }}} 75 | 76 | " Unite Menu {{{ 77 | let g:unite_source_menu_menus.files = { 78 | \ 'description' : ' files & dirs 79 | \ ⌘ [space]o', 80 | \} 81 | let g:unite_source_menu_menus.files.command_candidates = [ 82 | \['▷ open file ⌘ o', 83 | \'Unite -start-insert file'], 84 | \['▷ open more recently used files ⌘ m', 85 | \'Unite file_mru'], 86 | \['▷ open file with recursive search ⌘ O', 87 | \'Unite -start-insert file_rec/async'], 88 | \['▷ edit new file', 89 | \'Unite file/new'], 90 | \['▷ search directory', 91 | \'Unite directory'], 92 | \['▷ search recently used directories', 93 | \'Unite directory_mru'], 94 | \['▷ search directory with recursive search', 95 | \'Unite directory_rec/async'], 96 | \['▷ make new directory', 97 | \'Unite directory/new'], 98 | \['▷ change working directory', 99 | \'Unite -default-action=lcd directory'], 100 | \['▷ know current working directory', 101 | \'Unite output:pwd'], 102 | \['▷ junk files ⌘ d', 103 | \'Unite junkfile/new junkfile'], 104 | \['▷ save as root ⌘ :w!!', 105 | \'exe "write !sudo tee % >/dev/null"'], 106 | \['▷ quick save ⌘ w', 107 | \'normal w'], 108 | \['▷ open ranger ⌘ x', 109 | \'call RangerChooser()'], 110 | \['▷ open vimfiler ⌘ X', 111 | \'VimFiler'], 112 | \] 113 | 114 | let g:unite_source_menu_menus.files.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.files.command_candidates, []) 115 | 116 | nnoremap [menu]o :Unite -silent -winheight=17 -start-insert 117 | \ menu:files 118 | " END Unite Menu }}} 119 | -------------------------------------------------------------------------------- /packages/git.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | call neobundle#append() 7 | 8 | " Admin Git 9 | NeoBundle 'tpope/vim-fugitive' 10 | " Show git repository changes in the current file 11 | NeoBundle 'airblade/vim-gitgutter' 12 | " Git viewer 13 | NeoBundleLazy 'gregsexton/gitv', {'depends':['tpope/vim-fugitive'], 14 | \ 'autoload':{'commands':'Gitv'}} 15 | " Browse GitHub events in Vim 16 | NeoBundle 'joedicastro/vim-github-dashboard' 17 | 18 | call neobundle#end() 19 | " END Plugins }}} 20 | 21 | " Plugin Setup {{{ 22 | 23 | " Fugitive {{{ 24 | 25 | nnoremap gn :Unite output:echo\ system("git\ init") 26 | nnoremap gs :Gstatus 27 | nnoremap gw :Gwrite 28 | nnoremap go :Gread 29 | nnoremap gR :Gremove 30 | nnoremap gm :Gmove 31 | nnoremap gc :Gcommit 32 | nnoremap gd :Gdiff 33 | nnoremap gb :Gblame 34 | nnoremap gB :Gbrowse 35 | nnoremap gp :Git! push 36 | nnoremap gP :Git! pull 37 | nnoremap gi :Git! 38 | nnoremap ge :Gedit 39 | nnoremap gE :Gedit 40 | nnoremap gl :exe "silent Glog Unite -no-quit 41 | \ quickfix":redraw! 42 | nnoremap gL :exe "silent Glog -- Unite -no-quit 43 | \ quickfix":redraw! 44 | nnoremap gt :!tig:redraw! 45 | nnoremap gS :exe "silent !shipit":redraw! 46 | nnoremap gg :exe 'silent Ggrep -i '.input("Pattern: ")Unite 47 | \ quickfix -no-quit 48 | nnoremap ggm :exe 'silent Glog --grep='.input("Pattern: ").' 49 | \Unite -no-quit quickfix' 50 | nnoremap ggt :exe 'silent Glog -S='.input("Pattern: ").' 51 | \Unite -no-quit quickfix' 52 | 53 | nnoremap ggc :silent! Ggrep -i 54 | 55 | " for the diffmode 56 | noremap du :diffupdate 57 | 58 | if !exists(":Gdiffoff") 59 | command Gdiffoff diffoff | q | Gedit 60 | endif 61 | noremap dq :Gdiffoff 62 | " }}} 63 | 64 | " Gitv {{{ 65 | 66 | nnoremap gv :Gitv --all 67 | nnoremap gV :Gitv! --all 68 | vnoremap gV :Gitv! --all 69 | 70 | let g:Gitv_OpenHorizontal = 'auto' 71 | let g:Gitv_WipeAllOnClose = 1 72 | let g:Gitv_DoNotMapCtrlKey = 1 73 | " let g:Gitv_WrapLines = 1 74 | 75 | autocmd FileType git set nofoldenable 76 | 77 | " }}} 78 | 79 | " GitHub dashboard {{{ 80 | 81 | nnoremap gD :exe 'GHD! '.input("Username: ") 82 | nnoremap gA :exe 'GHA! '.input("Username or repository: ") 83 | 84 | function! GHDashboard (...) 85 | if &filetype == 'github-dashboard' 86 | " first variable is the statusline builder 87 | let builder = a:1 88 | 89 | call builder.add_section('airline_a', 'GitHub ') 90 | call builder.add_section('airline_b', 91 | \ ' %{get(split(get(split(github_dashboard#statusline(), " "), 92 | \ 1, ""), ":"), 0, "")} ') 93 | call builder.add_section('airline_c', 94 | \ ' %{get(split(get(split(github_dashboard#statusline(), " "), 95 | \ 2, ""), "]"), 0, "")} ') 96 | 97 | " tell the core to use the contents of the builder 98 | return 1 99 | endif 100 | endfunction 101 | 102 | autocmd FileType github-dashboard call airline#add_statusline_func('GHDashboard') 103 | 104 | " }}} 105 | 106 | " END Plugin Setup }}} 107 | 108 | " Unite Menu {{{ 109 | let g:unite_source_menu_menus.git = { 110 | \ 'description' : ' admin git repositories 111 | \ ⌘ [space]g', 112 | \} 113 | let g:unite_source_menu_menus.git.command_candidates = [ 114 | \['▷ tig ⌘ gt', 115 | \'normal gt'], 116 | \['▷ git viewer (gitv) ⌘ gv', 117 | \'normal gv'], 118 | \['▷ git viewer - buffer (gitv) ⌘ gV', 119 | \'normal gV'], 120 | \['▷ git status (fugitive) ⌘ gs', 121 | \'Gstatus'], 122 | \['▷ git diff (fugitive) ⌘ gd', 123 | \'Gdiff'], 124 | \['▷ git commit (fugitive) ⌘ gc', 125 | \'Gcommit'], 126 | \['▷ git log (fugitive) ⌘ gl', 127 | \'exe "silent Glog | Unite -no-quit quickfix"'], 128 | \['▷ git log - all (fugitive) ⌘ gL', 129 | \'exe "silent Glog -all | Unite -no-quit quickfix"'], 130 | \['▷ git blame (fugitive) ⌘ gb', 131 | \'Gblame'], 132 | \['▷ git add/stage (fugitive) ⌘ gw', 133 | \'Gwrite'], 134 | \['▷ git checkout (fugitive) ⌘ go', 135 | \'Gread'], 136 | \['▷ git rm (fugitive) ⌘ gR', 137 | \'Gremove'], 138 | \['▷ git mv (fugitive) ⌘ gm', 139 | \'exe "Gmove " input("destino: ")'], 140 | \['▷ git push (fugitive, buffer output) ⌘ gp', 141 | \'Git! push'], 142 | \['▷ git pull (fugitive, buffer output) ⌘ gP', 143 | \'Git! pull'], 144 | \['▷ git command (fugitive, buffer output) ⌘ gi', 145 | \'exe "Git! " input("comando git: ")'], 146 | \['▷ git edit (fugitive) ⌘ gE', 147 | \'exe "command Gedit " input(":Gedit ")'], 148 | \['▷ git grep (fugitive) ⌘ gg', 149 | \'exe "silent Ggrep -i ".input("Pattern: ") | Unite -no-quit quickfix'], 150 | \['▷ git grep - messages (fugitive) ⌘ ggm', 151 | \'exe "silent Glog --grep=".input("Pattern: ")." | Unite -no-quit quickfix"'], 152 | \['▷ git grep - text (fugitive) ⌘ ggt', 153 | \'exe "silent Glog -S".input("Pattern: ")." | Unite -no-quit quickfix"'], 154 | \['▷ git init ⌘ gn', 155 | \'Unite output:echo\ system("git\ init")'], 156 | \['▷ git cd (fugitive)', 157 | \'Gcd'], 158 | \['▷ git lcd (fugitive)', 159 | \'Glcd'], 160 | \['▷ git browse (fugitive) ⌘ gB', 161 | \'Gbrowse'], 162 | \['▷ github dashboard (github-dashboard) ⌘ gD', 163 | \'exe "GHD! " input("Username: ")'], 164 | \['▷ github activity (github-dashboard) ⌘ gA', 165 | \'exe "GHA! " input("Username or repository: ")'], 166 | \['▷ github issues & PR ⌘ gS', 167 | \'der>gSnormal gS'], 168 | \] 169 | 170 | let g:unite_source_menu_menus.git.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.git.command_candidates, []) 171 | 172 | nnoremap [menu]g :Unite -silent -winheight=29 -start-insert menu:git 173 | 174 | " END Unite Menu }}} 175 | -------------------------------------------------------------------------------- /packages/golang.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | 4 | " END VIM SETUP }}} 5 | 6 | " Plugins {{{ 7 | call neobundle#append() 8 | 9 | NeoBundleLazy 'fatih/vim-go', {'autoload': {'filetypes': ['go']}} 10 | 11 | call neobundle#end() 12 | " END Plugins }}} 13 | 14 | " Plugin Setup {{{ 15 | 16 | let g:go_fmt_command = "goimports" 17 | 18 | au FileType go nmap i :GoInfo 19 | au FileType go nmap l :GoLint 20 | au FileType go nmap D :GoDoc 21 | au FileType go nmap Db :GoDocBrowser 22 | au FileType go nmap f :GoFmt 23 | au FileType go nmap p :GoPlay 24 | au FileType go nmap v :GoVet 25 | au FileType go nmap d :GoDef 26 | au FileType go nmap r :GoRun 27 | au FileType go nmap b :GoBuild 28 | au FileType go nmap I :GoInstall 29 | au FileType go nmap t :GoTest 30 | au FileType go nmap e :GoErrCheck 31 | au FileType go nmap fi :GoFiles 32 | au FileType go nmap de :GoDeps 33 | au FileType go nmap R :GoRename 34 | au FileType go nmap im :GoImplements 35 | au FileType go nmap ce :GoCallees 36 | au FileType go nmap u :GoUpdateBinaries 37 | au FileType go nmap od :GoOracleDescribe 38 | au FileType go nmap oce :GoOracleCallees 39 | au FileType go nmap ocr :GoOracleCallers 40 | au FileType go nmap ocs :GoOracleCallstack 41 | au FileType go nmap ocg :GoOracleCallgraph 42 | au FileType go nmap oci :GoOracleImplements 43 | au FileType go nmap occ :GoOracleChannelPeers 44 | au FileType go nmap of :GoOracleFreevars 45 | au FileType go nmap or :GoOracleReferrers 46 | 47 | " END Plugin Setup }}} 48 | 49 | " Unite Menu {{{ 50 | let g:unite_source_menu_menus.golang = { 51 | \ 'description' : ' golang development 52 | \ ⌘ [space]d', 53 | \} 54 | let g:unite_source_menu_menus.golang.command_candidates = [ 55 | \['▷ go info ⌘ (C-C)i', 56 | \'GoInfo'], 57 | \['▷ go lint ⌘ (C-C)l', 58 | \'GoLint'], 59 | \['▷ go doc ⌘ (C-C)D', 60 | \'GoDoc'], 61 | \['▷ go fmt ⌘ (C-C)f', 62 | \'GoFmt'], 63 | \['▷ go play ⌘ (C-C)p', 64 | \'GoPlay'], 65 | \['▷ go def ⌘ (C-C)d', 66 | \'GoDef'], 67 | \['▷ go install ⌘ (C-C)I', 68 | \'GoInstall'], 69 | \['▷ go build ⌘ (C-C)b', 70 | \'GoBuild'], 71 | \['▷ go error check ⌘ (C-C)e', 72 | \'GoErrCheck'], 73 | \] 74 | nnoremap [menu]d :Unite -silent -winheight=42 menu:golang 75 | 76 | " END Unite Menu }}} 77 | -------------------------------------------------------------------------------- /packages/grep.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | call neobundle#append() 7 | 8 | " grep 9 | nnoremap a :Unite -silent -auto-preview -winheight=40 -no-quit 10 | \ grep 11 | nnoremap A :UniteWithCursorWord -silent -auto-preview 12 | \ -winheight=40 -no-quit grep 13 | 14 | " END Plugins }}} 15 | 16 | " Plugin Setup {{{ 17 | if executable('ag') 18 | let g:unite_source_grep_command='ag' 19 | let g:unite_source_grep_default_opts='--nocolor --nogroup -a -S' 20 | let g:unite_source_grep_recursive_opt='' 21 | let g:unite_source_grep_search_word_highlight = 1 22 | elseif executable('ack') 23 | let g:unite_source_grep_command='ack' 24 | let g:unite_source_grep_default_opts='--no-group --no-color' 25 | let g:unite_source_grep_recursive_opt='' 26 | let g:unite_source_grep_search_word_highlight = 1 27 | endif 28 | 29 | call neobundle#end() 30 | " END Plugin Setup }}} 31 | 32 | " Unite Menu {{{ 33 | let g:unite_source_menu_menus.grep = { 34 | \ 'description' : ' search files 35 | \ ⌘ [space]a', 36 | \} 37 | let g:unite_source_menu_menus.grep.command_candidates = [ 38 | \['▷ grep (ag → ack → grep) ⌘ a', 39 | \'Unite -auto-preview -winheight=40 -no-quit grep'], 40 | \['▷ grep current word ⌘ A', 41 | \'UniteWithCursorWord -auto-preview -winheight=40 -no-quit grep'], 42 | \['▷ find', 43 | \'Unite find'], 44 | \['▷ locate', 45 | \'Unite -start-insert locate'], 46 | \['▷ vimgrep (very slow)', 47 | \'Unite vimgrep'], 48 | \] 49 | 50 | let g:unite_source_menu_menus.grep.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.grep.command_candidates, []) 51 | 52 | nnoremap [menu]a :Unite -silent menu:grep 53 | 54 | " END Unite Menu }}} 55 | -------------------------------------------------------------------------------- /packages/markdown.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | call neobundle#append() 7 | 8 | " Markdown Syntax 9 | NeoBundleLazy 'joedicastro/vim-markdown' 10 | " Makes a Markdown Extra preview into the browser 11 | NeoBundleLazy 'joedicastro/vim-markdown-extra-preview' 12 | 13 | call neobundle#end() 14 | " END Plugins }}} 15 | 16 | " Plugin Setup {{{ 17 | 18 | " Vim-markdown-extra-preview {{{ 19 | 20 | map mp :Me 21 | map mr :Mer 22 | 23 | let g:VMEPextensions = ['extra', 'codehilite'] 24 | " This is for Mac only, need a program accept html file as parameter 25 | let g:VMEPhtmlreader= 'open' 26 | 27 | " }}} 28 | 29 | " END Plugin Setup }}} 30 | 31 | " Unite Menu {{{ 32 | let g:unite_source_menu_menus.markdown = { 33 | \ 'description' : ' preview markdown extra docs 34 | \ ⌘ [space]k', 35 | \} 36 | let g:unite_source_menu_menus.markdown.command_candidates = [ 37 | \['▷ preview', 38 | \'Me'], 39 | \['▷ refresh', 40 | \'Mer'], 41 | \] 42 | 43 | let g:unite_source_menu_menus.markdown.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.markdown.command_candidates, []) 44 | 45 | nnoremap [menu]k :Unite -silent menu:markdown 46 | 47 | " END Unite Menu }}} 48 | -------------------------------------------------------------------------------- /packages/navigation.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | call neobundle#append() 7 | 8 | " Zooms a window 9 | NeoBundleLazy 'vim-scripts/zoomwintab.vim', {'autoload' : 10 | \{'commands' : 'ZoomWinTabToggle'}} 11 | " easily window resizing 12 | NeoBundle 'jimsei/winresizer' 13 | 14 | call neobundle#end() 15 | " END Plugins }}} 16 | 17 | " Plugin Setup {{{ 18 | 19 | " winresizer {{{ 20 | 21 | let g:winresizer_start_key = '' 22 | " cancelar pulsando ESC 23 | " let g:winresizer_finish_with_escape = 1 24 | let g:winresizer_keycode_finish = 27 25 | 26 | " }}} 27 | 28 | " zoomwintab {{{ 29 | 30 | map z :ZoomWinTabToggle 31 | 32 | " }}} 33 | 34 | " END Plugin Setup }}} 35 | 36 | " Unite Menu {{{ 37 | let g:unite_source_menu_menus.navigation = { 38 | \ 'description' : ' navigate by buffers, tabs & windows 39 | \ ⌘ [space]b', 40 | \} 41 | let g:unite_source_menu_menus.navigation.command_candidates = [ 42 | \['▷ buffers ⌘ b', 43 | \'Unite buffer'], 44 | \['▷ tabs ⌘ B', 45 | \'Unite tab'], 46 | \['▷ windows', 47 | \'Unite window'], 48 | \['▷ location list', 49 | \'Unite location_list'], 50 | \['▷ quickfix', 51 | \'Unite quickfix'], 52 | \['▷ resize windows ⌘ C-C C-W', 53 | \'WinResizerStartResize'], 54 | \['▷ new vertical window ⌘ v', 55 | \'vsplit'], 56 | \['▷ new horizontal window ⌘ h', 57 | \'split'], 58 | \['▷ close current window ⌘ k', 59 | \'close'], 60 | \['▷ toggle quickfix window ⌘ q', 61 | \'normal q'], 62 | \['▷ zoom ⌘ z', 63 | \'ZoomWinTabToggle'], 64 | \['▷ delete buffer ⌘ K', 65 | \'bd'], 66 | \] 67 | 68 | let g:unite_source_menu_menus.navigation.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.navigation.command_candidates, []) 69 | 70 | nnoremap [menu]b :Unite -silent menu:navigation 71 | 72 | " END Unite Menu }}} 73 | -------------------------------------------------------------------------------- /packages/neobundle.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | 7 | " END Plugins }}} 8 | 9 | " Plugin Setup {{{ 10 | 11 | " END Plugin Setup }}} 12 | 13 | " Unite Menu {{{ 14 | let g:unite_source_menu_menus.neobundle = { 15 | \ 'description' : ' plugins administration with neobundle 16 | \ ⌘ [space]n', 17 | \} 18 | let g:unite_source_menu_menus.neobundle.command_candidates = [ 19 | \['▷ neobundle', 20 | \'Unite neobundle'], 21 | \['▷ neobundle log', 22 | \'Unite neobundle/log'], 23 | \['▷ neobundle lazy', 24 | \'Unite neobundle/lazy'], 25 | \['▷ neobundle update', 26 | \'Unite neobundle/update'], 27 | \['▷ neobundle search', 28 | \'Unite neobundle/search'], 29 | \['▷ neobundle install', 30 | \'Unite neobundle/install'], 31 | \['▷ neobundle check', 32 | \'Unite -no-empty output:NeoBundleCheck'], 33 | \['▷ neobundle docs', 34 | \'Unite output:NeoBundleDocs'], 35 | \['▷ neobundle clean', 36 | \'NeoBundleClean'], 37 | \['▷ neobundle list', 38 | \'Unite output:NeoBundleList'], 39 | \['▷ neobundle direct edit', 40 | \'NeoBundleDirectEdit'], 41 | \] 42 | 43 | let g:unite_source_menu_menus.neobundle.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.neobundle.command_candidates, []) 44 | 45 | nnoremap [menu]n :Unite -silent -start-insert menu:neobundle 46 | 47 | " END Unite Menu }}} 48 | -------------------------------------------------------------------------------- /packages/python.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | 4 | " END VIM SETUP }}} 5 | 6 | " Plugins {{{ 7 | call neobundle#append() 8 | 9 | " Admin virtualenvs 10 | NeoBundle 'jmcantrell/vim-virtualenv' 11 | " Show indent lines 12 | NeoBundleLazy 'Yggdroot/indentLine', {'autoload': {'filetypes': ['python']}} 13 | " A Python plugin 14 | NeoBundleLazy 'klen/python-mode', {'autoload': {'filetypes': ['python']}} 15 | " Show reports from coverage.py 16 | NeoBundleLazy 'alfredodeza/coveragepy.vim', {'autoload': {'filetypes': ['python']}} 17 | 18 | call neobundle#end() 19 | " END Plugins }}} 20 | 21 | " Plugin Setup {{{ 22 | 23 | " Virtualenv {{{ 24 | 25 | let g:virtualenv_auto_activate = 1 26 | let g:virtualenv_stl_format = '(%n)' 27 | 28 | " }}} 29 | 30 | " PythonMode {{{ ------------------------------------------------------------- 31 | 32 | nmap n :PymodeLint 33 | nmap N :PymodeLintAuto 34 | 35 | let g:pymode_breakpoint_bind = 'B' 36 | 37 | let g:pymode_lint = 1 38 | let g:pymode_lint_on_write = 0 39 | let g:pymode_lint_checkers = ['pylint', 'pep8', 'mccabe', 'pep257'] 40 | let g:pymode_lint_ignore = '' 41 | let g:pymode_virtualenv = 1 42 | let g:pymode_rope = 1 43 | 44 | let g:pymode_rope_completion = 0 45 | let g:pymode_rope_complete_on_dot = 1 46 | 47 | " Ignore missing docstring error 48 | let g:pymode_lint_ignore = "C0111,D100,D101,D102,D103" 49 | 50 | " }}} 51 | 52 | 53 | " vimux {{{ 54 | 55 | let g:VimuxUseNearestPane = 1 56 | 57 | map rr :call VimuxRunCommand('clear;cd '.expand("%:p:h") .' ;python2 '.bufname("%")) 58 | map r3 :call VimuxRunCommand('clear;cd '.expand("%:p:h") .' ;python3 '.bufname("%")) 59 | map rt :call VimuxRunCommand('clear;cd '.expand("%:p:h") .' ;time python2 '.bufname("%")) 60 | map rp :call VimuxRunCommand('clear;cd '.expand("%:p:h") .' ;time pypy '.bufname("%")) 61 | 62 | map rc :VimuxPromptCommand 63 | map rl :VimuxRunLastCommand 64 | map rs :VimuxInterruptRunner 65 | map ri :VimuxInspectRunner 66 | map rq :VimuxCloseRunner 67 | 68 | " }}} 69 | 70 | " indentLine {{{ 71 | 72 | map L :IndentLinesToggle 73 | let g:indentLine_enabled = 0 74 | let g:indentLine_char = '┊' 75 | let g:indentLine_color_term = 239 76 | 77 | " }}} 78 | 79 | " END Plugin Setup }}} 80 | 81 | " Unite Menu {{{ 82 | let g:unite_source_menu_menus.python = { 83 | \ 'description' : ' python tools 84 | \ ⌘ [space]p', 85 | \} 86 | let g:unite_source_menu_menus.python.command_candidates = [ 87 | \['▷ run python code (pymode) ⌘ r', 88 | \'PymodeRun'], 89 | \['▷ show docs for the current word (pymode) ⌘ K', 90 | \'normal K'], 91 | \['▷ insert a breakpoint (pymode) ⌘ B', 92 | \'normal B'], 93 | \['▷ pylint check (pymode) ⌘ n', 94 | \'PymodeLint'], 95 | \['▷ pylint auto correct (pymode) ⌘ N', 96 | \'PymodeLintAuto'], 97 | \['▷ go to definition (pymode-rope) ⌘ C-C g', 98 | \'call pymode#rope#goto_definition()'], 99 | \['▷ find where a function is used (pymode-rope) ⌘ C-C f', 100 | \'call pymode#rope#find_it()'], 101 | \['▷ show docs for current word (pymode-rope) ⌘ C-C d', 102 | \'call pymode#rope#show_doc()'], 103 | \['▷ reorganize imports (pymode-rope) ⌘ C-C r o', 104 | \'call pymode#rope#organize_imports()'], 105 | \['▷ refactorize - rename (pymode-rope) ⌘ C-C r r', 106 | \'call pymode#rope#rename()'], 107 | \['▷ refactorize - inline (pymode-rope) ⌘ C-C r i', 108 | \'call pymode#rope#inline()'], 109 | \['▷ refactorize - move (pymode-rope) ⌘ C-C r v', 110 | \'call pymode#rope#move()'], 111 | \['▷ refactorize - use function (pymode-rope) ⌘ C-C r u', 112 | \'call pymode#rope#use_function()'], 113 | \['▷ refactorize - change signature (pymode-rope) ⌘ C-C r s', 114 | \'call pymode#rope#signature()'], 115 | \['▷ refactorize - rename current module (pymode-rope) ⌘ C-C r 1 r', 116 | \'PymodeRopeRenameModule'], 117 | \['▷ refactorize - module to package (pymode-rope) ⌘ C-C r 1 p', 118 | \'PymodeRopeModuleToPackage'], 119 | \['▷ list virtualenvs (virtualenv)', 120 | \'Unite output:VirtualEnvList'], 121 | \['▷ activate virtualenv (virtualenv)', 122 | \'VirtualEnvActivate'], 123 | \['▷ deactivate virtualenv (virtualenv)', 124 | \'VirtualEnvDeactivate'], 125 | \['▷ run coverage2 (coveragepy)', 126 | \'call system("coverage2 run ".bufname("%")) | Coveragepy report'], 127 | \['▷ run coverage3 (coveragepy)', 128 | \'call system("coverage3 run ".bufname("%")) | Coveragepy report'], 129 | \['▷ toggle coverage report (coveragepy)', 130 | \'Coveragepy session'], 131 | \['▷ toggle coverage marks (coveragepy)', 132 | \'Coveragepy show'], 133 | \] 134 | 135 | let g:unite_source_menu_menus.python.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.python.command_candidates, []) 136 | 137 | nnoremap [menu]p :Unite -silent -winheight=42 menu:python 138 | 139 | " END Unite Menu }}} 140 | -------------------------------------------------------------------------------- /packages/registers.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | call neobundle#append() 7 | 8 | " browse the vim undo tree 9 | NeoBundleLazy 'sjl/gundo.vim', { 'autoload' : {'commands': 'GundoToggle'}} 10 | 11 | call neobundle#end() 12 | " END Plugins }}} 13 | 14 | " Plugin Setup {{{ 15 | 16 | " Gundo {{{ 17 | 18 | nnoremap u :GundoToggle 19 | 20 | let g:gundo_preview_bottom = 1 21 | 22 | " }}} 23 | 24 | " END Plugin Setup }}} 25 | 26 | " Unite Menu {{{ 27 | let g:unite_source_menu_menus.registers = { 28 | \ 'description' : ' yanks, registers & history 29 | \ ⌘ [space]i', 30 | \} 31 | let g:unite_source_menu_menus.registers.command_candidates = [ 32 | \['▷ yanks ⌘ i', 33 | \'Unite history/yank'], 34 | \['▷ commands (history) ⌘ q:', 35 | \'Unite history/command'], 36 | \['▷ searches (history) ⌘ q/', 37 | \'Unite history/search'], 38 | \['▷ registers', 39 | \'Unite register'], 40 | \['▷ messages', 41 | \'Unite output:messages'], 42 | \['▷ undo tree (gundo) ⌘ u', 43 | \'GundoToggle'], 44 | \] 45 | 46 | let g:unite_source_menu_menus.registers.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.registers.command_candidates, []) 47 | 48 | nnoremap [menu]i :Unite -silent menu:registers 49 | 50 | " END Unite Menu }}} 51 | -------------------------------------------------------------------------------- /packages/searching.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | 7 | " END Plugins }}} 8 | 9 | " Plugin Setup {{{ 10 | 11 | " END Plugin Setup }}} 12 | 13 | " Unite Menu {{{ 14 | let g:unite_source_menu_menus.searching = { 15 | \ 'description' : ' searchs inside the current buffer 16 | \ ⌘ [space]f', 17 | \} 18 | let g:unite_source_menu_menus.searching.command_candidates = [ 19 | \['▷ search line ⌘ f', 20 | \'Unite -auto-preview -start-insert line'], 21 | \['▷ search word under the cursor ⌘ [space]8', 22 | \'UniteWithCursorWord -no-split -auto-preview line'], 23 | \['▷ search outlines & tags (ctags) ⌘ t', 24 | \'Unite -vertical -winwidth=40 -direction=topleft -toggle outline'], 25 | \['▷ search marks', 26 | \'Unite -auto-preview mark'], 27 | \['▷ search folds', 28 | \'Unite -vertical -winwidth=30 -auto-highlight fold'], 29 | \['▷ search changes', 30 | \'Unite change'], 31 | \['▷ search jumps', 32 | \'Unite jump'], 33 | \['▷ search undos', 34 | \'Unite undo'], 35 | \['▷ search tasks ⌘ ;', 36 | \'Unite -toggle grep:%::FIXME|TODO|NOTE|XXX|COMBAK|@todo'], 37 | \] 38 | 39 | let g:unite_source_menu_menus.searching.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.searching.command_candidates, []) 40 | 41 | nnoremap [menu]f :Unite -silent menu:searching 42 | 43 | " END Unite Menu }}} 44 | -------------------------------------------------------------------------------- /packages/sessions.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | 7 | " END Plugins }}} 8 | 9 | " Plugin Setup {{{ 10 | 11 | " END Plugin Setup }}} 12 | 13 | " Unite Menu {{{ 14 | 15 | " END Unite Menu }}} 16 | -------------------------------------------------------------------------------- /packages/spelling.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " turn on the spell checking and set the English language 4 | nmap se :setlocal spell spelllang=en 5 | " turn off the spell checking 6 | nmap so :setlocal nospell 7 | " jump to the next bad spell word 8 | nmap sn ]s 9 | " suggest words 10 | nmap sp z= 11 | " jump to the next bad spell word and suggests a correct one 12 | nmap sc ]sz= 13 | " add word to the dictionary 14 | nmap sa zg 15 | 16 | " END VIM SETUP }}} 17 | 18 | " Plugins {{{ 19 | call neobundle#append() 20 | 21 | " translate text with google translator 22 | NeoBundle 'maksimr/vim-translator' 23 | 24 | call neobundle#end() 25 | " END Plugins }}} 26 | 27 | " Plugin Setup {{{ 28 | 29 | " Google Translator {{{ 30 | 31 | " Translate to zh (Chinese). Using language code iso 639-1 32 | " Selected words and press 'T' to translate 33 | let g:goog_user_conf = {'langpair': 'en|zh', 'v_key': 'T'} 34 | 35 | " }}} 36 | 37 | " END Plugin Setup }}} 38 | 39 | " Unite Menu {{{ 40 | let g:unite_source_menu_menus.spelling = { 41 | \ 'description' : ' spell checking 42 | \ ⌘ [space]s', 43 | \} 44 | let g:unite_source_menu_menus.spelling.command_candidates = [ 45 | \['▷ spell checking in English ⌘ se', 46 | \'setlocal spell spelllang=en'], 47 | \['▷ turn off spell checking ⌘ so', 48 | \'setlocal nospell'], 49 | \['▷ jumps to next bad spell word and show suggestions ⌘ sc', 50 | \'normal sc'], 51 | \['▷ jumps to next bad spell word ⌘ sn', 52 | \'normal sn'], 53 | \['▷ suggestions ⌘ sp', 54 | \'normal sp'], 55 | \['▷ add word to dictionary ⌘ sa', 56 | \'normal sa'], 57 | \] 58 | 59 | let g:unite_source_menu_menus.spelling.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.spelling.command_candidates, []) 60 | 61 | nnoremap [menu]s :Unite -silent menu:spelling 62 | 63 | " END Unite Menu }}} 64 | -------------------------------------------------------------------------------- /packages/text.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | 4 | " Folding {{{ 5 | 6 | set foldmethod=marker 7 | 8 | " Default open all folds 9 | set foldlevel=100 10 | 11 | " Toggle folding 12 | nnoremap \ za 13 | vnoremap \ za 14 | 15 | " }}} 16 | 17 | " Cut/Paste {{{ 18 | 19 | " to/from the clipboard 20 | map y "*y 21 | map p "*p 22 | 23 | " toggle paste mode 24 | map P :set invpaste 25 | 26 | " }}} 27 | 28 | " Toggle the search results highlighting {{{ 29 | 30 | map eq :set invhlsearch 31 | 32 | " }}} 33 | 34 | " Toggle line numbers {{{ 35 | 36 | nnoremap l :call ToggleRelativeAbsoluteNumber() 37 | function! ToggleRelativeAbsoluteNumber() 38 | if !&number && !&relativenumber 39 | set number 40 | set norelativenumber 41 | elseif &number && !&relativenumber 42 | set nonumber 43 | set relativenumber 44 | elseif !&number && &relativenumber 45 | set number 46 | set relativenumber 47 | elseif &number && &relativenumber 48 | set nonumber 49 | set norelativenumber 50 | endif 51 | endfunction 52 | 53 | " Set the relative number for default 54 | set number 55 | set relativenumber 56 | 57 | " }}} 58 | 59 | " Show hidden chars {{{ 60 | 61 | nmap eh :set list! 62 | set listchars=tab:→\ ,eol:↵,trail:·,extends:↷,precedes:↶ 63 | 64 | " }}} 65 | 66 | 67 | " Delete trailing whitespaces {{{ 68 | 69 | nmap et :let _s=@/:%s/\s\+$//e:let @/=_s:nohl 70 | 71 | " }}} 72 | 73 | " Text statistics {{{ 74 | 75 | " get the total of lines, words, chars and bytes (and for the current position) 76 | map es g 77 | 78 | " get the word frequency in the text 79 | function! WordFrequency() range 80 | let all = split(join(getline(a:firstline, a:lastline)), '\A\+') 81 | let frequencies = {} 82 | for word in all 83 | let frequencies[word] = get(frequencies, word, 0) + 1 84 | endfor 85 | let lst = [] 86 | for [key,value] in items(frequencies) 87 | call add(lst, value."\t".key."\n") 88 | endfor 89 | call sort(lst) 90 | echo join(lst) 91 | endfunction 92 | command! -range=% WordFrequency ,call WordFrequency() 93 | map ef :Unite output:WordFrequency 94 | 95 | " }}} 96 | 97 | " END VIM SETUP }}} 98 | 99 | " Plugins {{{ 100 | call neobundle#append() 101 | 102 | " Autocompletion of (, [, {, ', ", ... 103 | NeoBundle 'delimitMate.vim' 104 | " Smart and fast date changer 105 | NeoBundle 'tpope/vim-speeddating' 106 | " to surround vim objects with a pair of identical chars 107 | NeoBundle 'tpope/vim-surround' 108 | " extend repetitions by the 'dot' key 109 | NeoBundle 'tpope/vim-repeat' 110 | " toggle comments 111 | NeoBundle 'tpope/vim-commentary' 112 | " smart digraphs insertion 113 | NeoBundle 'Rykka/easydigraph.vim' 114 | " to insert lorem ipsum blocks 115 | NeoBundleLazy 'vim-scripts/loremipsum', { 'autoload' : 116 | \ { 'commands' : 'Loremipsum'}} 117 | " reveals all the character info, Unicode included 118 | NeoBundle 'tpope/vim-characterize' 119 | " transpose lines and text blocks 120 | NeoBundleLazy 'salsifis/vim-transpose', { 'autoload' : 121 | \ { 'commands' : 'Transpose'}} 122 | " marks admin 123 | NeoBundle 'kshenoy/vim-signature' 124 | " text-objects 125 | NeoBundle 'kana/vim-textobj-entire' " ae, ie 126 | NeoBundle 'kana/vim-textobj-indent' " ai, ii, aI, iI 127 | NeoBundle 'kana/vim-textobj-lastpat' " a/, i/, a?, i? 128 | NeoBundle 'kana/vim-textobj-line' " al, il 129 | NeoBundle 'kana/vim-textobj-underscore' " a_, i_ 130 | NeoBundle 'kana/vim-textobj-user' 131 | 132 | call neobundle#end() 133 | " END Plugins }}} 134 | 135 | " delimitmate {{{ 136 | 137 | let delimitMate_expand_space = 1 138 | 139 | " }}} 140 | 141 | " easydigraph {{{ 142 | 143 | let g:EasyDigraph_nmap = 'dd' 144 | 145 | " }}} 146 | 147 | " Plugin Setup {{{ 148 | 149 | " END Plugin Setup }}} 150 | 151 | " Unite Menu {{{ 152 | let g:unite_source_menu_menus.text = { 153 | \ 'description' : ' text edition 154 | \ ⌘ [space]e', 155 | \} 156 | let g:unite_source_menu_menus.text.command_candidates = [ 157 | \['▷ toggle search results highlight ⌘ eq', 158 | \'set invhlsearch'], 159 | \['▷ toggle line numbers ⌘ l', 160 | \'call ToggleRelativeAbsoluteNumber()'], 161 | \['▷ toggle wrapping ⌘ ew', 162 | \'call ToggleWrap()'], 163 | \['▷ show hidden chars ⌘ eh', 164 | \'set list!'], 165 | \['▷ toggle fold ⌘ /', 166 | \'normal za'], 167 | \['▷ open all folds ⌘ zR', 168 | \'normal zR'], 169 | \['▷ close all folds ⌘ zM', 170 | \'normal zM'], 171 | \['▷ copy to the clipboard ⌘ y', 172 | \'normal y'], 173 | \['▷ paste from the clipboard ⌘ p', 174 | \'normal p'], 175 | \['▷ toggle paste mode ⌘ P', 176 | \'normal P'], 177 | \['▷ remove trailing whitespaces ⌘ et', 178 | \'normal et'], 179 | \['▷ text statistics ⌘ es', 180 | \'Unite output:normal\ ,es -no-cursor-line'], 181 | \['▷ show word frequency ⌘ ef', 182 | \'Unite output:WordFrequency'], 183 | \['▷ show available digraphs', 184 | \'digraphs'], 185 | \['▷ insert lorem ipsum text', 186 | \'exe "Loremipsum" input("numero de palabras: ")'], 187 | \['▷ show current char info ⌘ ga', 188 | \'normal ga'], 189 | \] 190 | 191 | let g:unite_source_menu_menus.text.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.text.command_candidates, []) 192 | 193 | nnoremap [menu]e :Unite -silent -winheight=20 menu:text 194 | 195 | " END Unite Menu }}} 196 | -------------------------------------------------------------------------------- /packages/tools.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | 4 | " END VIM SETUP }}} 5 | 6 | " Plugins {{{ 7 | call neobundle#append() 8 | 9 | " Open external links {{{ 10 | 11 | " Open a url into the browser or another files with an external app 12 | NeoBundle 'vim-scripts/utl.vim' 13 | 14 | " }}} 15 | 16 | " Tmux {{{ 17 | 18 | " Easily interacts with Tmux from Vim 19 | NeoBundle 'benmills/vimux' 20 | " Tmux config file syntax 21 | NeoBundleLazy 'vimez/vim-tmux', { 'autoload' : { 'filetypes' : 'conf'}} 22 | 23 | " }}} 24 | 25 | call neobundle#end() 26 | " END Plugins }}} 27 | 28 | " Plugin Setup {{{ 29 | 30 | " Utl {{{ 31 | 32 | map j :Utl :redraw! 33 | 34 | " For mac only 35 | let g:utl_cfg_hdl_scm_http_system = "silent !firefox %u &" 36 | let g:utl_cfg_hdl_mt_application_pdf = 'silent :!zathura %p &' 37 | let g:utl_cfg_hdl_mt_image_jpeg = 'silent :!sxiv %p &' 38 | let g:utl_cfg_hdl_mt_image_gif = 'silent :!sxiv %p &' 39 | let g:utl_cfg_hdl_mt_image_png = 'silent :!sxiv %p &' 40 | 41 | " }}} 42 | 43 | " Vinarise {{{ 44 | 45 | map :Vinarise 46 | 47 | let g:vinarise_enable_auto_detect = 1 48 | 49 | au FileType vinarise let g:airline_section_warning = '' 50 | 51 | " }}} 52 | 53 | " Move between Vim and Tmux windows {{{ 54 | 55 | if exists('$TMUX') 56 | function! TmuxOrSplitSwitch(wincmd, tmuxdir) 57 | let previous_winnr = winnr() 58 | execute "wincmd " . a:wincmd 59 | if previous_winnr == winnr() 60 | " The sleep and & gives time to get back to vim so tmux's focus tracking 61 | " can kick in and send us our ^[[O 62 | execute "silent !sh -c 'sleep 0.01; tmux select-pane -" . a:tmuxdir . "' &" 63 | redraw! 64 | endif 65 | endfunction 66 | let previous_title = substitute(system("tmux display-message -p '#{pane_title}'"), '\n', '', '') 67 | let &t_ti = "\]2;vim\\\" . &t_ti 68 | let &t_te = "\]2;". previous_title . "\\\" . &t_te 69 | nnoremap :call TmuxOrSplitSwitch('h', 'L') 70 | nnoremap :call TmuxOrSplitSwitch('j', 'D') 71 | nnoremap :call TmuxOrSplitSwitch('k', 'U') 72 | nnoremap :call TmuxOrSplitSwitch('l', 'R') 73 | else 74 | map h 75 | map j 76 | map k 77 | map l 78 | endif 79 | 80 | " END Plugin Setup }}} 81 | 82 | " Unite Menu {{{ 83 | 84 | let g:unite_source_menu_menus.tools = { 85 | \ 'description' : ' other tools 86 | \ ⌘ [space]t', 87 | \} 88 | let g:unite_source_menu_menus.tools.command_candidates = [ 89 | \['▷ run with python2 in tmux panel (vimux) ⌘ rr', 90 | \'normal ,rr'], 91 | \['▷ run with python3 in tmux panel (vimux) ⌘ r3', 92 | \'normal ,r3'], 93 | \['▷ run with python2 & time in tmux panel (vimux) ⌘ rt', 94 | \'normal ,rt'], 95 | \['▷ run with pypy & time in tmux panel (vimux) ⌘ rp', 96 | \'normal ,rp'], 97 | \['▷ command prompt to run in a tmux panel (vimux) ⌘ rc', 98 | \'VimuxPromptCommand'], 99 | \['▷ repeat last command (vimux) ⌘ rl', 100 | \'VimuxRunLastCommand'], 101 | \['▷ stop command execution in tmux panel (vimux) ⌘ rs', 102 | \'VimuxInterruptRunner'], 103 | \['▷ inspect tmux panel (vimux) ⌘ ri', 104 | \'VimuxInspectRunner'], 105 | \['▷ close tmux panel (vimux) ⌘ rq', 106 | \'VimuxCloseRunner'], 107 | \['▷ open link ⌘ j', 108 | \'normal ,j'], 109 | \] 110 | 111 | let g:unite_source_menu_menus.tools.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.tools.command_candidates, []) 112 | 113 | nnoremap [menu]t :Unite -silent menu:tools 114 | 115 | " END Unite Menu }}} 116 | -------------------------------------------------------------------------------- /packages/vim.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | " END VIM SETUP }}} 4 | 5 | " Plugins {{{ 6 | 7 | 8 | " END Plugins }}} 9 | 10 | " Plugin Setup {{{ 11 | 12 | " END Plugin Setup }}} 13 | 14 | " Unite Menu {{{ 15 | let g:unite_source_menu_menus.vim = { 16 | \ 'description' : ' vim 17 | \ ⌘ [space]v', 18 | \} 19 | let g:unite_source_menu_menus.vim.command_candidates = [ 20 | \['▷ choose colorscheme', 21 | \'Unite colorscheme -auto-preview'], 22 | \['▷ mappings', 23 | \'Unite mapping -start-insert'], 24 | \['▷ edit configuration file (vimrc)', 25 | \'edit $MYVIMRC'], 26 | \['▷ choose filetype', 27 | \'Unite -start-insert filetype'], 28 | \['▷ vim help', 29 | \'Unite -start-insert help'], 30 | \['▷ vim commands', 31 | \'Unite -start-insert command'], 32 | \['▷ vim functions', 33 | \'Unite -start-insert function'], 34 | \['▷ vim runtimepath', 35 | \'Unite -start-insert runtimepath'], 36 | \['▷ vim command output', 37 | \'Unite output'], 38 | \['▷ unite sources', 39 | \'Unite source'], 40 | \['▷ kill process', 41 | \'Unite -default-action=sigkill -start-insert process'], 42 | \['▷ launch executable (dmenu like)', 43 | \'Unite -start-insert launcher'], 44 | \] 45 | 46 | let g:unite_source_menu_menus.vim.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.vim.command_candidates, []) 47 | 48 | nnoremap [menu]v :Unite menu:vim -silent -start-insert 49 | 50 | " END Unite Menu }}} 51 | -------------------------------------------------------------------------------- /packages/web.vimrc: -------------------------------------------------------------------------------- 1 | " VIM Setup {{{ 2 | 3 | 4 | " END VIM SETUP }}} 5 | 6 | " Plugins {{{ 7 | call neobundle#append() 8 | 9 | " HTML/CSS {{{ 10 | 11 | NeoBundleLazy 'othree/html5.vim', {'autoload': 12 | \ {'filetypes': ['html', 'xhttml', 'css']}} 13 | 14 | NeoBundleLazy 'mattn/emmet-vim', {'autoload': 15 | \ {'filetypes': ['html', 'xhttml', 'css', 'xml', 'xls', 'markdown']}} 16 | 17 | " }}} 18 | 19 | " API Web {{{ 20 | 21 | NeoBundle 'mattn/webapi-vim' 22 | 23 | " }}} 24 | 25 | call neobundle#end() 26 | " END Plugins }}} 27 | 28 | " Plugin Setup {{{ 29 | 30 | 31 | " END Plugin Setup }}} 32 | 33 | " Unite Menu {{{ 34 | 35 | let g:unite_source_menu_menus.web = { 36 | \ 'description' : ' web development 37 | \ ⌘ [space]w', 38 | \} 39 | let g:unite_source_menu_menus.web.command_candidates = [ 40 | \['▷ show emmet tutorial', 41 | \'h emmet-tutorial'], 42 | \] 43 | 44 | let g:unite_source_menu_menus.web.command_candidates = helperfuncs#unite_menu_gen(g:unite_source_menu_menus.web.command_candidates, []) 45 | 46 | nnoremap [menu]w :Unite -silent menu:web 47 | 48 | " END Unite Menu }}} 49 | -------------------------------------------------------------------------------- /templates/vimrc-template: -------------------------------------------------------------------------------- 1 | " This is the oh my vim directory 2 | let $OH_MY_VIM=$HOME."/.oh-my-vim" 3 | let &runtimepath=substitute(&runtimepath, '^', $OH_MY_VIM.",", 'g') 4 | 5 | " Select the packages you need 6 | let g:oh_my_vim_packages=[ 7 | \'vim', 8 | \'basic', 9 | \'code', 10 | \'text', 11 | \'grep', 12 | \'searching', 13 | \'registers', 14 | \'navigation', 15 | \'files', 16 | \'git', 17 | \'python', 18 | \'web', 19 | \'tools', 20 | \'markdown', 21 | \'bookmarks', 22 | \'sessions', 23 | \'spelling', 24 | \'neobundle', 25 | \'golang' 26 | \] 27 | 28 | exec ':so ' $OH_MY_VIM."/vimrc" 29 | -------------------------------------------------------------------------------- /tools/check_for_upgrade.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | _current_epoch() { 4 | echo $(($(date +%s) / 60 / 60 / 24)) 5 | } 6 | 7 | _update_vim_update() { 8 | echo "LAST_EPOCH=$(_current_epoch)" > ~/.vim-update 9 | } 10 | 11 | _upgrade_vim() { 12 | /usr/bin/env OH_MY_VIM=$OH_MY_VIM /bin/sh $OH_MY_VIM/tools/upgrade.sh 13 | # update the vim file 14 | _update_vim_update 15 | } 16 | 17 | epoch_target=$UPDATE_VIM_DAYS 18 | if [ -z "$epoch_target" ]; then 19 | # Default to old behavior 20 | epoch_target=13 21 | fi 22 | 23 | if [ -f ~/.vim-update ] 24 | then 25 | . ~/.vim-update 26 | 27 | if [ -z "$LAST_EPOCH" ]; then 28 | _update_vim_update && return 0; 29 | fi 30 | 31 | epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) 32 | if [ $epoch_diff -gt $epoch_target ] 33 | then 34 | echo "[Oh My Vim] Would you like to check for updates?" 35 | echo "Type Y to update oh-my-vim: \c" 36 | read line 37 | if [ "$line" = Y ] || [ "$line" = y ]; then 38 | _upgrade_vim 39 | echo "Press any key to continue." 40 | read line 41 | else 42 | _update_vim_update 43 | fi 44 | fi 45 | else 46 | # create the vim file 47 | _update_vim_update 48 | fi 49 | 50 | -------------------------------------------------------------------------------- /tools/install.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | if [ ! -n "$OH_MY_VIM" ]; then 4 | OH_MY_VIM=~/.oh-my-vim 5 | fi 6 | 7 | if [ -d "$OH_MY_VIM" ]; then 8 | echo "\033[0;33mYou already have Oh My Vim installed.\033[0m You'll need to remove $OH_MY_VIM if you want to install" 9 | exit 10 | fi 11 | 12 | echo "\033[0;34mCloning Oh My Vim...\033[0m" 13 | hash git >/dev/null 2>&1 && /usr/bin/env git clone https://github.com/liangxianzhe/oh-my-vim.git $OH_MY_VIM || { 14 | echo "git not installed" 15 | exit 16 | } 17 | 18 | echo "\033[0;34mLooking for an existing vim config...\033[0m" 19 | if [ -f ~/.vimrc ] || [ -h ~/.vimrc ]; then 20 | echo "\033[0;33mFound ~/.vimrc.\033[0m \033[0;32mBacking up to ~/.vimrc.pre-oh-my-vim\033[0m"; 21 | mv ~/.vimrc ~/.vimrc.pre-oh-my-vim; 22 | fi 23 | 24 | echo "\033[0;34mUsing the Oh My Vim template file and adding it to ~/.vimrc\033[0m" 25 | cp $OH_MY_VIM/templates/vimrc-template ~/.vimrc 26 | sed -i -e "/OH_MY_VIM=/ c\\ 27 | let \$OH_MY_VIM=\"$OH_MY_VIM\" 28 | " ~/.vimrc 29 | 30 | if [ ! -d "bundle" ]; then 31 | echo "\033[0;34mCreating a bundle directory...\033[0m" 32 | mkdir $OH_MY_VIM/bundle 33 | fi 34 | 35 | # Copy the font if using mac 36 | if [[ `uname` == 'Darwin' ]]; then 37 | echo "\033[0;34mInstalling font...\033[0m" 38 | cp $OH_MY_VIM"/font/DroidSansMono/Droid Sans Mono for Powerline.otf" ~/Library/fonts/ 39 | fi 40 | 41 | echo "\033[0;32m"' ____ __ __ _____ __ _ ________ ___ '"\033[0m" 42 | echo "\033[0;32m"' / __ \/ / / |/ /\ \/ / | | / / _/ |/ / '"\033[0m" 43 | echo "\033[0;32m"'/ /_/ / _ \ / /|_/ / \ / | |/ // // /|_/ / '"\033[0m" 44 | echo "\033[0;32m"'\____/_//_/ /_/ /_/ /_/ |___/___/_/ /_/ '"\033[0m" 45 | 46 | echo "\n\n \033[0;32mPlease look over the ~/.vimrc file to select plugins, themes, and options.\033[0m" 47 | echo "\n\n \033[0;32mThen open you vim and it will install plugins for you.\033[0m" 48 | echo "\n\n \033[0;32mEnjoy!.\033[0m" 49 | -------------------------------------------------------------------------------- /tools/prepare_mac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/env sh 2 | 3 | # Update brew 4 | brew update 5 | 6 | # Tools we need 7 | brew install ctags ag ack ranger tig 8 | 9 | # This config need lua installed for faster script excution 10 | brew install lua 11 | brew install luajit 12 | 13 | # Now install vim with lua support 14 | brew install vim --with-lua --with-clipboard --override-system-vi 15 | 16 | # Make sure you have pip 17 | brew install python 18 | 19 | # Install tools for Python 20 | echo "Pip need to be sudo. Please input your password:" 21 | sudo pip install pylint virtualenvwrapper coverage 22 | -------------------------------------------------------------------------------- /tools/uninstall.sh: -------------------------------------------------------------------------------- 1 | echo "Removing ~/.oh-my-vim" 2 | if [[ -d ~/.oh-my-vim ]] 3 | then 4 | rm -rf ~/.oh-my-vim 5 | fi 6 | 7 | echo "Looking for original vim config..." 8 | if [ -f ~/.vimrc.pre-oh-my-vim ] 9 | then 10 | echo "Found ~/.vimrc.pre-oh-my-vim -- Restoring to ~/.vimrc"; 11 | 12 | if [ -f ~/.vimrc ] 13 | then 14 | VIMRC_SAVE=".vimrc.omv-uninstalled-`date +%Y%m%d%H%M%S`"; 15 | echo "Found ~/.vimrc -- Renaming to ~/${VIMRC_SAVE}"; 16 | mv ~/.vimrc ~/${VIMRC_SAVE}; 17 | fi 18 | 19 | mv ~/.vimrc.pre-oh-my-vim ~/.vimrc; 20 | fi 21 | 22 | echo "Thanks for trying out Oh My Vim. It's been uninstalled." 23 | 24 | -------------------------------------------------------------------------------- /tools/upgrade.sh: -------------------------------------------------------------------------------- 1 | printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Vim" 2 | cd "$OH_MY_VIM" 3 | if git pull --rebase --stat origin master 4 | then 5 | printf '\033[0;32m%s\033[0m\n' ' ____ __ __ _____ __ _ ________ ___ ' 6 | printf '\033[0;32m%s\033[0m\n' ' / __ \/ / / |/ /\ \/ / | | / / _/ |/ / ' 7 | printf '\033[0;32m%s\033[0m\n' '/ /_/ / _ \ / /|_/ / \ / | |/ // // /|_/ / ' 8 | printf '\033[0;32m%s\033[0m\n' '\____/_//_/ /_/ /_/ /_/ |___/___/_/ /_/ ' 9 | printf '\033[0;32m%s\033[0m\n' '' 10 | printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Vim has been updated and/or is at the current version.' 11 | else 12 | printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?' 13 | fi 14 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | " 2 | " __ _(_)_ __ ___ _ __ ___ 3 | " \ \ / / | '_ ` _ \| '__/ __| 4 | " \ V /| | | | | | | | | (__ 5 | " (_)_/ |_|_| |_| |_|_| \___| 6 | " 7 | " Author: Xianzhe Liang 8 | " Source: https://github.com/liangxianzhe/oh-my-vim 9 | 10 | " Setup language {{{ ========================================================== 11 | 12 | " language en_US.UTF-8 " Solve some plugins incompatibilities 13 | 14 | " }}} 15 | 16 | set nocompatible " No to the total compatibility with the ancient vi 17 | 18 | " TODO use vimscript to check update, this will leave some blank lines after 19 | " leaving vim 20 | silent !sh $OH_MY_VIM/tools/check_for_upgrade.sh 21 | 22 | " Load external configuration before anything else {{{ 23 | 24 | let s:before_vimrc = expand('~/.before.vimrc') 25 | if filereadable(s:before_vimrc) 26 | exec ':so ' . s:before_vimrc 27 | endif 28 | " }}} 29 | " 30 | " NEOBUNDLE {{{ =============================================================== 31 | 32 | " NeoBundle auto-installation and setup {{{ 33 | 34 | " Auto installing NeoBundle 35 | let iCanHazNeoBundle=1 36 | let neobundle_readme=expand($OH_MY_VIM."/bundle/neobundle.vim/README.md") 37 | let neobundle_runtimepath=expand($OH_MY_VIM."/bundle/neobundle.vim/") 38 | if !filereadable(neobundle_readme) 39 | echo "Installing NeoBundle.." 40 | echo "" 41 | execute "silent !mkdir -p ".$OH_MY_VIM."/bundle" 42 | execute "silent !git clone https://github.com/Shougo/neobundle.vim ".$OH_MY_VIM."/bundle/neobundle.vim" 43 | let iCanHazNeoBundle=0 44 | endif 45 | 46 | " Call NeoBundle 47 | if has('vim_starting') 48 | let &rtp=neobundle_runtimepath.','.&rtp 49 | endif 50 | 51 | call neobundle#begin(expand($OH_MY_VIM.'/bundle/')) 52 | 53 | " is better if NeoBundle rules NeoBundle (needed!) 54 | NeoBundle 'Shougo/neobundle.vim' 55 | " }}} 56 | 57 | " BUNDLES (plugins administrated by NeoBundle) {{{ 58 | 59 | " Shougo's way {{{ 60 | 61 | " Vimproc to asynchronously run commands (NeoBundle, Unite) 62 | NeoBundle 'Shougo/vimproc', { 63 | \ 'build' : { 64 | \ 'windows' : 'make -f make_mingw32.mak', 65 | \ 'cygwin' : 'make -f make_cygwin.mak', 66 | \ 'mac' : 'make -f make_mac.mak', 67 | \ 'unix' : 'make -f make_unix.mak', 68 | \ }, 69 | \ } 70 | 71 | " Unite. The interface to rule almost everything 72 | NeoBundle 'Shougo/unite.vim' 73 | 74 | " Unite sources 75 | NeoBundleLazy 'Shougo/unite-outline', {'autoload':{'unite_sources':'outline'}} 76 | NeoBundleLazy 'tsukkee/unite-help', {'autoload':{'unite_sources':'help'}} 77 | NeoBundleLazy 'ujihisa/unite-colorscheme', {'autoload':{'unite_sources': 78 | \ 'colorscheme'}} 79 | NeoBundleLazy 'ujihisa/unite-locate', {'autoload':{'unite_sources':'locate'}} 80 | NeoBundleLazy 'thinca/vim-unite-history', { 'autoload' : { 'unite_sources' : 81 | \ ['history/command', 'history/search']}} 82 | NeoBundleLazy 'osyo-manga/unite-filetype', { 'autoload' : {'unite_sources' : 83 | \ 'filetype', }} 84 | NeoBundleLazy 'osyo-manga/unite-quickfix', {'autoload':{'unite_sources': 85 | \ ['quickfix', 'location_list']}} 86 | NeoBundleLazy 'osyo-manga/unite-fold', {'autoload':{'unite_sources':'fold'}} 87 | NeoBundleLazy 'tacroe/unite-mark', {'autoload':{'unite_sources':'mark'}} 88 | NeoBundleLazy 'tsukkee/unite-tag', {'autoload':{'unite_sources':'tag'}} 89 | NeoBundleLazy 'Shougo/neomru.vim', {'autoload':{'unite_sources': 90 | \['file_mru', 'directory_mru']}} 91 | 92 | " }}} 93 | 94 | " Colorschemes {{{ 95 | 96 | " Dark themes 97 | " Improved terminal version of molokai, almost identical to the GUI one 98 | NeoBundle 'joedicastro/vim-molokai256' 99 | 100 | NeoBundle 'tomasr/molokai' 101 | NeoBundleLazy 'sjl/badwolf', { 'autoload' : 102 | \ { 'unite_sources' : 'colorscheme', }} 103 | NeoBundleLazy 'nielsmadan/harlequin', { 'autoload' : 104 | \ { 'unite_sources' : 'colorscheme', }} 105 | 106 | 107 | " Light themes 108 | NeoBundleLazy 'vim-scripts/summerfruit256.vim', { 'autoload' : 109 | \ { 'unite_sources' : 'colorscheme', }} 110 | NeoBundleLazy 'joedicastro/vim-github256', { 'autoload' : 111 | \ { 'unite_sources' : 'colorscheme', }} 112 | 113 | " Make terminal themes from GUI themes 114 | NeoBundleLazy 'godlygeek/csapprox', { 'autoload' : 115 | \ { 'commands' : ['CSApprox', 'CSApproxSnapshot']}} 116 | 117 | " }}} 118 | 119 | " GUI {{{ 120 | 121 | " A better looking status line 122 | NeoBundle 'vim-airline/vim-airline' 123 | NeoBundle 'vim-airline/vim-airline-themes' 124 | 125 | " }}} 126 | 127 | call neobundle#end() 128 | " END BUNDLES }}} 129 | 130 | " & mapping {{{ 131 | 132 | let mapleader=',' 133 | let maplocalleader= ' ' 134 | 135 | " }}} 136 | 137 | " menus {{{ 138 | 139 | let g:unite_source_menu_menus = {} 140 | 141 | " menu prefix key (for all Unite menus) {{{ 142 | nnoremap [menu] 143 | nmap [menu] 144 | " }}} 145 | 146 | " menus menu 147 | nnoremap [menu]u :Unite -silent -winheight=20 menu 148 | 149 | " }}} 150 | 151 | " Local vimrc configuration {{{ 152 | 153 | let s:local_vimrc = expand('~/.local.vimrc') 154 | if filereadable(s:local_vimrc) 155 | exec ':so ' . s:local_vimrc 156 | endif 157 | 158 | " }}} 159 | 160 | 161 | " END NEOBUNDLE }}} 162 | 163 | 164 | " IMPORT PACKAGES {{{ 165 | 166 | exec ':so ' $OH_MY_VIM."/autoload/helperfuncs.vim" 167 | for package in g:oh_my_vim_packages 168 | let package_path = $OH_MY_VIM . "/packages/" . package . ".vimrc" 169 | if filereadable(package_path) 170 | exec ':so ' package_path 171 | endif 172 | endfor 173 | 174 | " Indent and plugins by filetype. Need to turn it on after importing packages. 175 | filetype plugin indent on 176 | 177 | " END IMPORT PACKAGES }}} 178 | 179 | " Auto install the plugins {{{ 180 | 181 | " First-time plugins installation 182 | if iCanHazNeoBundle == 0 183 | echo "Installing Bundles, please ignore key map error messages" 184 | echo "" 185 | set nomore 186 | NeoBundleInstall 187 | endif 188 | set more 189 | 190 | " Check if all of the plugins are already installed, in other case ask if we 191 | " want to install them (useful to add plugins in the .vimrc) 192 | NeoBundleCheck 193 | 194 | " }}} 195 | 196 | " PLUGINS Setup {{{ 197 | 198 | " Airline {{{ 199 | 200 | set noshowmode 201 | 202 | let g:airline_theme='powerlineish' 203 | let g:airline_powerline_fonts=1 204 | let g:airline#extensions#branch#enabled=1 205 | let g:airline#extensions#whitespace#enabled = 1 206 | let g:airline#extensions#hunks#non_zero_only = 1 207 | 208 | " let g:airline#extensions#tabline#enabled = 2 209 | " let g:airline#extensions#tabline#fnamemod = ':t' 210 | " let g:airline#extensions#tabline#buffer_min_count = 1 211 | 212 | " }}} 213 | 214 | " Font {{{ 215 | 216 | set guifont=Droid\ Sans\ Mono\ for\ Powerline\ 11 217 | 218 | " " }}}} 219 | 220 | " Neomru {{{ 221 | 222 | let g:neomru#file_mru_path = $OH_MY_VIM.'/tmp/neomru/file' 223 | let g:neomru#directory_mru_path = $OH_MY_VIM.'/tmp/neomru/directory' 224 | 225 | " }}} 226 | 227 | " Unite {{{ 228 | 229 | " files 230 | nnoremap o :Unite -silent -start-insert file 231 | nnoremap O :Unite -silent -start-insert file_rec/async 232 | nnoremap m :Unite -silent file_mru 233 | " buffers 234 | nnoremap b :Unite -silent buffer 235 | " tabs 236 | nnoremap B :Unite -silent tab 237 | " buffer search 238 | nnoremap f :Unite -silent -no-split -start-insert -auto-preview 239 | \ line 240 | nnoremap [menu]8 :UniteWithCursorWord -silent -no-split -auto-preview 241 | \ line 242 | " yankring 243 | nnoremap i :Unite -silent history/yank 244 | " help 245 | nnoremap g :UniteWithCursorWord -silent help 246 | " tasks 247 | nnoremap ; :Unite -silent -toggle 248 | \ grep:%::FIXME\|TODO\|NOTE\|XXX\|COMBAK\|@todo 249 | " outlines (also ctags) 250 | nnoremap t :Unite -silent -vertical -winwidth=40 251 | \ -direction=topleft -toggle outline 252 | 253 | " }}} 254 | 255 | call unite#filters#matcher_default#use(['matcher_fuzzy']) 256 | call unite#filters#sorter_default#use(['sorter_rank']) 257 | call unite#custom#source('file_mru,file_rec,file_rec/async,grep,locate', 258 | \ 'ignore_pattern', join(['\.git/', 'tmp/', 'bundle/'], '\|')) 259 | 260 | let g:unite_source_history_yank_enable = 1 261 | let g:unite_enable_start_insert = 0 262 | let g:unite_enable_short_source_mes = 0 263 | let g:unite_force_overwrite_statusline = 0 264 | let g:unite_prompt = '>>> ' 265 | let g:unite_marked_icon = '✓' 266 | " let g:unite_candidate_icon = '∘' 267 | let g:unite_winheight = 15 268 | let g:unite_update_time = 200 269 | let g:unite_split_rule = 'botright' 270 | let g:unite_data_directory = $OH_MY_VIM.'/tmp/unite' 271 | let g:unite_source_buffer_time_format = '(%d-%m-%Y %H:%M:%S) ' 272 | let g:unite_source_file_mru_time_format = '(%d-%m-%Y %H:%M:%S) ' 273 | let g:unite_source_directory_mru_time_format = '(%d-%m-%Y %H:%M:%S) ' 274 | 275 | " }}} 276 | 277 | 278 | " END PLUGINS SETUP }}} 279 | 280 | " Additional Configuration {{{ 281 | 282 | let s:after_vimrc = expand('~/.after.vimrc') 283 | if filereadable(s:after_vimrc) 284 | exec ':so ' . s:after_vimrc 285 | endif 286 | 287 | " }}} 288 | --------------------------------------------------------------------------------