Skip to content

Instantly share code, notes, and snippets.

@wfro
Last active August 29, 2015 14:08
Show Gist options
  • Save wfro/d141939f35493984204f to your computer and use it in GitHub Desktop.
Save wfro/d141939f35493984204f to your computer and use it in GitHub Desktop.

Vim/tmux workshop (11/7)

Modes

  • visual - select
  • normal - where you can move around and modify stuff
  • insert - insert text
  • command - vim's command line (hit : and type things)

Rebinding esc

A couple popular bindings are jj, ii, jk, kj

In normal mode, hit :, then type the following: imap kj <Esc>

We'll assume that you have vim installed. If you're on OSX type $ which vim in the command line to confirm you have the executable (you should). Some linux distros have vi, but not vim so keep an eye on that.

.vimrc

This is your vim config file. Check if it exists, create one if not.

$ ls ~
$ touch .vimrc

Plugin managers - pathogen/vundle

Your two main choices are pathogen and vundle. With pathogen, you'll use git to clone plugins into your (soon to be created) ~/.vim/bundle directory. With vundle, you'll put the github paths to your plugins in your .vimrc.

For convenience here is the oneliner from the pathogen readme.

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

To install plugins you clone git repositories. It's pretty cool.:

cd ~/.vim/bundle
git clone git@github.com:scrooloose/nerdtree.git

Starting plugins

.vimrc

  • map your keybindings
  • set a colorscheme
  • let &t_Co256
  • syntax on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment