Skip to content

Latest commit

 

History

History
206 lines (167 loc) · 11.6 KB

README.markdown

File metadata and controls

206 lines (167 loc) · 11.6 KB

My personal VIM-config

This is my personal configuration for everybodies favorite editor VIM. I use it mainly for ruby development with a touch of PHP. My configuration is based on duwanis wonderful work.

This repository is meant to be used with the wonderful Homesick-Gem:

homesick clone thenoseman/vim_config
homesick symlink vim_config

Fork away!

Current Plugins:

Added non-plugin features

  • CopyMatches Script from vimtips (:CopyMatches)
  • my own "mvim" script (extras/mvim) that makes all passed cmdargs available to vim ($VIM_CMDARGS) This is used to enable you to call "mvim -d" with two directories (normally only two files). If you call "mvim -d" with two directories, the DirDiff Plugin will automatically be called to diff the directories.
  • A modified version of the railscasts theme as default theme
  • My favorite font Inconsolata-dz in extras
  • update_all_submodules_to_head script that updates all submodules and creates a commit for those updates
  • renew_php_functionlist script to update the PHP-OmniComplete Function list from the PHP SVN Repository
  • DiffOrig Function (:DiffOrig) to show the changes made to the current unsaved buffer

ack is a a grep alternative written in perl. It sports context sensitive search and is generally blazingly fast. Commands are :Ack which searches for a term and jumps to the first hit and :Ack! which searches and justs opens the hits in the quickfix window. I mapped Ack to Ack! because I don't like the auto-opening.

The revelation when it comes to file-finding. Alternative to fuzzyfinder and Command-T. Far superior to to those two in my opinion. Use ,m to open the finder in file-mode. If you add files to your project run :ClearCtrlPCache so the plugin can find those new files.

Enables the comparison of directories in addition to files. If you use my mvim shell script instead of the MacVim supplied one you can use mvim -d dir1 dir2 and vim will automatically jump into DirDiff mode. Manually usage is DirDiff SourceDir1 SourceDir2. After the comparison window is open use the commands described in the DirDiff readme.

Auto closes ruby structures with end where appropriate

A (the) git wrapper for vim. Use :Gc to commit, :Gs for status. When you are in a conflicted file use :Dland :Dr to copy the current hunk from left or right to the working copy.

Ever wanted to search/replace in all/some of the files in your project? That's an absolute nightmare using vimgrep. Fret not! :Gsearch has you covered! Use :Gsearch to search project-wide. The results will be opened in a buffer for you to edit in place. After editing (don't save that buffer) use :Greplace to integrate your changes back into the original files. This thing so rocks!

Adds syntax support for HTML5 elements like "data-*" or

Filetype sensitive commenting and uncommenting of textblocks. Mapped to ,c (thats ,c[space]) to toggle commenting in visual-mode.

The file-explorer for vim. Closed by default. Use ,d to open. After you add or delete files use :CtrlPClearCache to regenerate the ctrl-p cache.

Once there was a time where I was knee-deep into PHP :) See this "blog" about what it does.

This does so much good for you I can't even find a feature to start with. If you are in a rails file (eg. controller) you can use :Test to open the corresponding test-file in a horizontal-split.

Adds all the rails.vim goodies to your plain old ruby files.

Allows to repeat (.) plugin commands like they were edit-commands.

Snippet expansion using the tab key. There are three places currently with snippets:

  • home/.vim/snipmate/honza-snippets A collection of snippets for a lot of filetypes including ruby
  • home/.vim/snipmate/scrooloose Html, HAML, CSS, Javacript and ruby snippets and a few more
  • home/.vim/custom My personal snippets

If you want to add your own directory, go to home/.vim/config/plugins/snipmate.vim and add your path to the runtimepath

Smart text completion (eg. OmniComplete) configured to use the ctrl-space () key combo instead of tab which snipmate uses. I tried to make it as smart as possible. It first tries Omni-Completion and then falls back to local file complete. Soon: Try auto-completion based on the current tags. Doesn't work at the moment.

Easily surround text with brakets, quotes or what have you. Change an existing surrounding using csOldNew (eg. "Hello" would become 'Hello' via cs"'), add surrounding with ysTextobjectSurrounding (Hello would become "Hello" with ysiw") or delete them with dsSurrounding. Actions are repeatable with . via repeat.vim.

On the fly (actually "on the save" :)) syntax checking for a lot of languages. A locationlist will open if you have an error in your file. Deactivated filetypes (changeable home/.vim/config/plugins/syntastic.vim):

  • html
  • coffee
  • haml
  • sass

Adds :Bopen (bundle open) and :Bundle to vim. That's nice but more importantly it adds all tags files of all gems in your Gemfile to vims tags list. Generate those taks via the gem-ctags gem (gem install gem-ctags && gem ctags).

Support for CoffeeScript in VIM. Adds syntax highlighting, indention and compilation support. Also includes syntax support for eco templates.

Jump to characters the easy way: ,,tCharacter and easymotion will show letters for every Hit it got. Type those letters and easymotion jumps to that point. Also works with f or w. There is a nice tutorial.

Not really sure if I need his one but ... A git log viewer. Inside a git managed file do :Dl. Quit the plugin with q.

Adds support for SASS, Scss and HAML files to VIM.

Improvements to javascript indention in VIM.

Markdown syntax highlighting.

Jump to the beginning/end of the current selected group (eg. def ... end or class .. end) with %.

The Standard ruby support plugin. Configured in home/.vim/config/plugins/vim-ruby.vim to highlight trailing whitespace and for best OmniComplete support without booting rails inside vim (see the official docs on how this works)

Smart autocompletion of brakets, quotes and additionally highly customizable. There are additional mappings in home/.vim/config/plugins/vim-smartinput.vim to fix an issue smartinput currently has.

Adds the ar and ir text-objects to VIM so you can for example delete a complete method (with the cursor somewhere in it) via dir (deletes without def .. .end) or dar (deletes incl. def .. .end)

Select some text in visual mode and hit * or ? to search it in that file.

Edit XML and HTML files with tag-autoclosing

Manages the copy and paste registers for you. Restore a yanked text with ctrl-p or ctrl-n (previous and next) Does much more ... see official docs.