Coder Social home page Coder Social logo

srushti / vim-get Goto Github PK

View Code? Open in Web Editor NEW
47.0 7.0 8.0 286 KB

Vim setup with special focus on Ruby/Rails development, with the ability to quickly get latest on all your plugins.

Home Page: http://srushti.net

Ruby 17.48% Vim Script 81.69% Shell 0.82%

vim-get's Introduction

Ruby/Rails based vimfiles and installer

With the support for ruby, git, rvm, rails, rspec and so on.

Requirements

Vim 7.3 or better Tested on MacOS and Linux

Introduction to Vim: http://blog.interlinked.org/tutorials/vim_tutorial.html

Quick Install

curl https://raw.github.com/srushti/vim-get/master/install.sh -o - | sh

If you want to add another plugin, just edit the plugins.yml file and add the name & url of the source control of the plugin.

Basic Mappings

The leader is mapped to ,

Esc is mapped to jj

In Normal mode (Esc or jj)

,w - Save all buffers and place the cursor back to sameplace.

,W - Save all buffers and place the cursor back to sameplace.

,n - File browser (NerdTree Toggle)

,/ - File browser (NERDTree Find)

Space - Page Down

Shift + Space - Page Down

Ctrl + Shift + Right - Goto Next buffer

Ctrl + Shift + Left - Goto Previous buffer

,a - Search in files (Ack)

,f - Search open buffers (Fuzzy Finder like Textmate)

,d - close buffer

,D - close all buffers

,u - GUI Undo history (GUndo) (Needs Python version more than 2.4v)

,, - Toggle between last two buffers

Open/Edit files

,ew - Open/Edit file in the current directory

,es - Open/Edit file in HORIZONTAL SPLIT

,ev - Open/Edit file in VERTICAL SPLIT

,et - Open/Edit file in NEW TAB

Execute Ruby Specs

,s - Run one spec under the cursor

,S - Run all specs in the current file

,- - Rerun last rake command (most likely the last run spec)

In Insert mode (i)

jj - Back to normal mode(or ESC) #

uu - Replaces with the charecter -

hh - Replaces with the charecter =>

aa - Replaces with the charecter @

<tab> - auto complete or expand snippet

See .vimrc for more.

Plugins

ruby (F5)

F5 Executes the current file.

rails

So many good stuff - get to know this plugin!

,m - Jump to model

,v - Jump to view

,c - Jump to controller

Test Ruby Specs

,s - Performs .Rake from rails plugin => normal .rake

,S - Performs Rake from rails plugin => normal rake

,- - Perform Rake - from rails plugin => normal rake -

:help rails

coffee-script

CoffeeScript support

`:CoffeeCompile watch` show compiled js in split

https://github.com/kchmck/vim-coffee-script

ruby-block

Provides text-objects for Ruby blocks

`var` (visual around Ruby)

`vir` (visual inner Ruby)

`ar` / `ir` (expand/contract selection)

`cir` (change inner Ruby)

`dar` (delete around Ruby)

http://vimcasts.org/blog/2010/12/a-text-object-for-ruby-blocks/

sparkup (ctrl+e)

Expand CSS selectors div.event in to markup <div class='event'></div>

http://net.tutsplus.com/articles/general/quick-tip-even-quicker-markup-with-sparkup/

fugitive

Git integration

,gd - Git diff

,gs - Git status press - to stage file

,gw - Git write

,ga - Git add

,gb - Git blame

,gco - Git checkout

,gci - Git commit

,gm - Git move

,gr - Git remove

:help fugitive

http://vimcasts.org/episodes/fugitive-vim---a-complement-to-command-line-git/

snippets usage (TAB)

Snippets, press TAB to expand

Examples (in a Ruby file):

def<tab>

.each<tab>

.eado<tab>

ife<tab>

gundo (,u)

Navigate changes history tree

http://vimcasts.org/episodes/undo-branching-and-gundo-vim/

conque

Terminal/Interactive programs

:Conque zsh

:Conque ls

Note you can also drop back to the terminal using Ctrl+Z, to get back to Vim with %1. This is not a feature of Conque.

yankring

Shows history of yanked (copied) text

Pressing ctrl + p will also cycle through paste history

ack (,a)

Search project for text (aka find in files)

,a word

,a "some words"

nerdtree (,n)

Project file browser

,n opens file browser

o / x open and close files/folders

m menu to move/delete/copy files/folders

? Help

I use nerdtree for creating or moving files, but find command-t quicker for opening files.

surround (ys/cs/ds)

Allows adding/removing/changing of surroundings

I would highly recommend getting to know this plugin, it is very useful. Especially when you grok text objects.

Characters

ysiw) - surround inner word with ()

ysiw( - surround inner word with ( )

In the above example iw can be replaced with any text object or motion.

If you find yourself manually adding surroundings, stop and work out the correct text object or motion.

cs"' - change surrounding from " to '

ds - delete surrounding

Install these vimfiles manually

Note: You will already have a ~/.vim folder, either delete or move it.

cp -r ~/.vim ~/.vim.old 2>/dev/null
rm -fr ~/.vim 2>/dev/null
rm -f ~/.vimrc 2>/dev/null
git clone https://github.com/srushti/vim-get.git ~/.vim && cd ~/.vim && rake update

or run:

curl https://raw.github.com/ravidsrk/vim-get/master/install.sh -o - | sh

To update to the latest vimfiles

cd ~/.vim
rake preinstall

Install Dependacies

MacOS

brew install ack
brew install ctags

Note: MacOS comes with the BSD version of ctags which is not compatible.

Ubuntu

sudo apt-get install exuberant-ctags
sudo apt-get install ack-grep
sudo ln -s /usr/bin/ack-grep /usr/local/bin/ack

vim-get's People

Contributors

gja avatar jithugopal avatar ravidsrk avatar srushti 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-get's Issues

Error with NERDTree

I get errors relating to NERDTree mapping not found. I figured out that pathogen has to be added to autoload, and probably nerdtree added to bundle. It works then.

Add vimL file that is sources after each install, For plug-ins that need initialization after installation.

vim-get should be able to source file with initialization of plug-ins on
each install/reinstall command.
Some plugins, like soywiki require initialization, e.g. here is a quote from https://github.com/danchoi/soywiki

You can start SoyWiki from within a running Vim session. To set this up, first install or update SoyWiki, and then run

soywiki --install-plugin

Please note that you will need to run this command after each time you update SoyWiki to a newer version

I'm trying to fix this with patch to soywiki that will restructure files so there is no need for anything to be execudted on each install here: danchoi/soywiki#15

Yet, in general it makes sense to allow plugin developers to source some commands once plugin is installed

Toggle between last two buffers

Following command not working in my vim. Even I am not able to find that corresponding command in my vimrc.

,, - Toggle between last two buffers

Feature Suggestion: Option to set install location

In order to use symliked folder as many people store all dotfiles together under version control, it would be nice to have an option to to set install folder location and if possible location of .vimrc and .gvimrc files.

Default .vimrc produces bug: pressing <Shift> in insert mode types <S-D-F1>

I know that this is not related to essence of project, yet this have to be fixed. I'm big fun of vimrc from get-vim and use it as a basis for my vimrc, so I have personal interest in finding what causes this bug. I couldn't find it.

Configuration:

  • Mac OS X 10.6.6
  • MacVim 7.3 (57) custom build with Ruby support

Follow DYI, remove redundant operation of adding plugins list to Rakefile

It's really inefficient to repeat same operation of entering plug-ins names twice, just read plug-in names from file.
Even adding to plugins.yml could be simplified, best would be just to add URL's of repo that would be auto-recognized (git/hg/svn) and auto-named.

I just created file with them like this any way:

git://github.com/cakebaker/scss-syntax.vim.git
git://github.com/rstacruz/sparkup.git
git://github.com/sophacles/vim-outliner.git
git://github.com/bbommarito/vim-slim.git

rest was done by automatic scripts:

new folders in private folder are not copied

I tried to add my "spell" new in private folder and reinstall, it seems that new folders in private are not copied.
adding it to Rakefile like this:

    FOLDERS = %w(colors spell ftdetect ftplugin indent syntax doc plugin autoload snippets macros after ruby)

Did't help

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.