Top Banner
VIM @RoyOsherove http://key.bo/apps/16-vim 7enn.com
16

Vim - for newbies, by Roy Osherove

Jan 13, 2015

Download

Technology

Roy Osherove

Roy Osherove shows vim for newbies, and explains why everyone should know at least a little vim.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Vim - for newbies, by Roy Osherove

VIM

@RoyOsherovehttp://key.bo/apps/16-vim

7enn.com

Page 2: Vim - for newbies, by Roy Osherove

Why VIM?

• Lightweight• Everywhere• Remote coding via ssh• Pair programming (ssh + tmux)• Important skill (like regex)• Feel Stupid, Learn Something

Page 3: Vim - for newbies, by Roy Osherove

Learning

Page 4: Vim - for newbies, by Roy Osherove

versions

• 7.3+• Vi (vim)• Gui-vim (macvim, gvim on windows\linux)

Page 5: Vim - for newbies, by Roy Osherove

Configuration

• .vim file• .vim directory• Vim scripts and plugins• Google “vim Janus”• Github astrails dotvim

Page 6: Vim - for newbies, by Roy Osherove

http://tuxradar.com/content/vim-master-basics

Page 7: Vim - for newbies, by Roy Osherove

http://amalloy.hubpages.com/hub/Why-old-text-editors-are-still-great

Page 8: Vim - for newbies, by Roy Osherove

http://blog.interlinked.org/tutorials/vim_tutorial.html

Page 9: Vim - for newbies, by Roy Osherove

http://www.viemu.com/vi-vim-cheat-sheet.gif

Page 10: Vim - for newbies, by Roy Osherove

Favorite Plugins

• Surround plugin• Rails• Nerdtree• Command-t (fuzzy finding)

Page 11: Vim - for newbies, by Roy Osherove

Favorite keys

• Cw and ciw• S)• Shift-v to line selection• Cc to change line• Dd to delete line

Page 12: Vim - for newbies, by Roy Osherove

Practice cw

• Load up piece of text• Use / to find instance of ‘the’• Use ‘cw’ to change ‘the’ to ‘your’• Use ‘esc’ and then ‘n’ to move to next find• Use ‘.’ to repeat• Use ‘n’ and ‘.’ to repeat as many times as

possible

Page 13: Vim - for newbies, by Roy Osherove

Practice ciw

• Load up piece of text• Use / to find instance of ‘he’• Use ‘ciw’ to change ‘the’ to ‘your’• Use ‘esc’ and then ‘n’ to move to next find• Use ‘.’ to repeat• Use ‘n’ and ‘.’ to repeat as many times as

possible

Page 14: Vim - for newbies, by Roy Osherove

Practice o and O

• Load up piece of text• Use j to go to 2nd line• For each line use shift O to enter a line above

and o to insert a line below• Use . To repeat actions

Page 15: Vim - for newbies, by Roy Osherove

Other vims

• vsVim for visual studio• ViEmu for Word• Vimium and vimperator for firefox and chrome• Vi-like command line in zsh (configure

yourself)

Page 16: Vim - for newbies, by Roy Osherove