Code Monkey home page Code Monkey logo

vimfiles's Introduction

vimfiles

These are the new Codegram vimfiles! Slightly changed by me, still cleaning up the mess though.

Installing

Clone this repo:

$ git clone https://github.com/ItsGenis/vimfiles.git ~/.vim
$ rm ~/.vimrc && ln -s ~/.vim/vimrc ~/.vimrc

Install Vundle:

$ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

Set up your ~/vimrc.local with your custom plugins, themes, for example:

" Color theme
Bundle 'sjl/badwolf'
colorscheme badwolf

Open up Vim, and issue this command:

:BundleInstall

TA-DA! Everything's done!

Custom mappings

  • The leader key is , (comma).

Files

  • ,n renames current file, asking for the new name.

Moving

  • Arrow keys are disabled.
  • jk is mapped to <ESC>, so you don't have to reach out to <ESC>.

Search

  • ,<Space> clears the search.

Buffers

  • ,w maps to :w!: it saves the current buffer.
  • ,q maps to :wqa!: it saves all buffers and quits.
  • <tab> / <S-tab> rotates among open buffers.
  • <leader>d closes the current buffer.
  • <leader>D closes ALL the buffers.

Splits

  • ,v opens a new vertical split and switches to it.
  • <C-h> switches to the left split.
  • <C-j> switches to the split below.
  • <C-k> switches to the split above.
  • <C-l> switches to the right split.

Running tests (Ruby)

  • ,t runs the current test file (RSpec, MiniTest or Cucumber).
  • ,T runs the specific test under the cursor (RSpec or Cucumber).

Other

  • <F2> to toggle Paste mode (to paste stuff from the system clipboard).
  • ,gb in Visual mode to perform a git blame on the selected lines. test.

Plug-ins

Use Ag (the silver searcher) to search through your code.

  • ,a performs an Ag search.
  • <C-n> / <C-p>: Rotate among results.

Auto-closes, parens, curly braces, everything.

First, brew install ctags and run the ctags -R . command on your working directory to generate the tag list.

  • <C-]> to go to the definition of the word under the cursor (constant, method, whatever
  • <C-p> to come back.
  • <F7> / <F9> to rotate among multiple definitions of the same tag.
  • <Leader>c to search among tags with the CtrlP plugin.
  • <Leader>b to toggle the Tagbar

Puts end after a method definition, if clause, etc. (Ruby)

Use Git from Vim.

  • ,gs: Git status.
  • ,gc: Git commit.
  • :Gist [-p|-P]: Post a [p]rivate or [P]ublic gist with the current buffer. You can also run it from Visual mode to post only a part.

Integration with Rails.

  • cs"' changes surround from " to '.
  • ysiw" surrounds inside the word with ".
  • ,' switches ' and " quotes.

Comments any kind of code.

  • ,co: In visual mode, comments the selected block.

vimfiles's People

Contributors

divins avatar itsgenis avatar josepjaume avatar mrcasals avatar oriolgual avatar

Watchers

 avatar

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.