Code Monkey home page Code Monkey logo

vimrc's Introduction

Slava's vim setup

This is my setup I've been using for the last 6 month or so. This configuration wasn't meant to be used on remote hosts where you edit your configs over ssh, because nobody does it. Likely, this config can be used for day-to-day development if you are brave enough to use someone's config on your Vim (I am not). However, it can act as a good learning material to someone.

Features

  • Syntax highlighting for common things in webdev
  • Unite.vim with awesome fuzzy search features
    • <C-N> to open a file in the current directory
    • <leader><C-N> to open a file in some subdirectory recursively using an external program for speed. (uses find by default, install ag for speed, will be used if available).
    • <C-P> to open a buffer
    • <leader>D to change the current directory
    • :VimShell to open a shell written in vimscript. It is not the best shell ever but is good enough to run tests quickly
      • You will probably need to change the default vim command from mvim to what you want (gvim or vim)
    • <leader>p to paste a segment from yank history
    • <leader>j to open a list of other menu items (editable in vimrc)
  • Gundo.vim to jump between file's edit versions
  • Surround.vim - to surround text with tags, brackets, parentheses or quotes
  • Fugitive.vim - git wrapper
  • Tern.js plugin with Meteor support - like IntelliSense for JavaScript

Weird visual things you might want to change

  • vim-airline - status bar
    • needs a customized font for MacVim (XXX add this to install script)
  • Tomorrow Night Theme - specifically, a fork extended for JS
  • vim-signature - to visually see marks
  • new splits are added on the bottom, not on the top;
  • new visual splits appear on the right, not on the left.

Weird bindings you might want to change

  • <leader> is mapped to comma ,
  • <C-hjkl> mapped to movement between splits
  • <leader>/ to kill current search
  • <leader>s to enable/disable the spellchecker
  • <leader>l to highlight non-printing characters
  • <leader>m and <leader>n to switch between tabs
  • <leader>w saves the file (maps to :w<enter>)
  • <leader>j to open a list of menu items
  • ; in the normal mode enters the command mode (just like :). The original action of ; (repeat the last t) is not preserved.
  • quick jk in insert mode is mapped to ESC to avoid pressing ESC

What sucks

I will be honest, the following things suck and I didn't fix them yet:

  • formatting is broken for a lot of things
  • plugins are written in JavaScript, Python and VimScript - 3 different languages
  • everything is <C-n> and <C-p> centric. Because I mapped them to my thumb on Kinesis doesn't mean it is great for everyone

Feature requests

  • Fixed identation for JS, Handlebars and CSS
  • no dependency on fonts
  • install script should take into consideration the existing .vimrc and .vim folders not to override someone's setup accidentally

Dependencies

Latest MacVim works well as of 7.4 patch around August 2013

  • Vim built with +python for ternjs and gundo
  • Vim built with +lua for neocomplete.vim
  • npm and node.js for ternjs
  • C compiler for unite.vim
  • make for vimproc
  • git to fetch dependencies (this sucks, I know)
  • ag (optional) for the speedy subdirectory search (see the repo)

Installation

First of all be sure to have a compatible version of Vim. The easiest way to install a full-featured Vim on Mac OS X with homebrew is to run brew install macvim -v --override-system-vim --with-lua --with-luajit in your terminal. (Instructions for other platforms satisfying the dependencies are welcome)

After you can run the bash script from this repo which will take care of everything but will do something terrible if you already have any of .vim or .vimrc. But it works great on a clean set up:

$ curl https://raw.github.com/Slava/vimrc/master/install-script.sh > install-script.sh
$ bash ./install-script.sh

Manual installation

Download .vimrc file.

$ curl https://raw.github.com/Slava/vimrc/master/.vimrc > ~/.vimrc

Install neobundle

$ mkdir -p ~/.vim/bundle
$ git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim

Open vim, install all the packages, quit vim:

$ vim -c "NeoBundleInstall" -c "q"

Finish installation by installing tern-meteor:

$ cd ~/.vim/bundle/tern_for_vim/
$ npm install
$ curl https://raw.github.com/Slava/tern-meteor/master/meteor.js > node_modules/tern/plugin/meteor.js

vimrc's People

Contributors

bdunnette avatar rgoomar avatar slava avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vimrc's Issues

a few things..

hey Slava,

great work here man. I'm finally making the transition to vim because you brought the last piece of the puzzle for me with this.

couple quick issues i hit setting it up.

most of your links are broken because of the 'githubusercontent' change.

https://raw.githubusercontent.com/Slava/vimrc/master/install-script.sh

for example.

second it seems like you're missing the git clone line in the install script to install the tern for vim plugin I had to do that step manually once i figured out what was going on.

just thought i'd throw some feedback your way and say thanks again!

Backspace

I really like the setup but backspace doesn't seem to work in insert mode. How do I fix this?

Forget to make vimproc

Before vimshell or fuzzy search from unite could work. Need to run make command for vimproc

Either:

  1. go in to the vimproc dir, and run make command
    or
  2. use this code
NeoBundle 'Shougo/vimproc', {
      \ 'build' : {
      \     'windows' : 'make -f make_mingw32.mak',
      \     'cygwin' : 'make -f make_cygwin.mak',
      \     'mac' : 'make -f make_mac.mak',
      \     'unix' : 'make -f make_unix.mak',
      \    },
      \ }

E117: Unknown function: unite#custom#source

Hi Slava
I am new to vim and meteor, I tried to install from the install script but I am getting the following error

*[master][~]$ bash ./install-script.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11984  100 11984    0     0   9010      0  0:00:01  0:00:01 --:--:--  9017
Cloning into '/Users/rakeshkalyankar/.vim/bundle/neobundle.vim'...
remote: Counting objects: 7444, done.
remote: Total 7444 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (7444/7444), 1.89 MiB | 234.00 KiB/s, done.
Resolving deltas: 100% (3252/3252), done.
Checking connectivity... done.
Error detected while processing /Users/removed/.vimrc:
line   90:
E117: Unknown function: unite#custom#source
Press ENTER or type command to continue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.