Vim

7,757 views

Published on

Vim presentation

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
7,757
On SlideShare
0
From Embeds
0
Number of Embeds
5,853
Actions
Shares
0
Downloads
38
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide
  • Image from http://www.celsius1414.com/uploads/vim-editor_logo.png
  • Vim is not ViVi book: (6th ed, 1998)Last release – 1997? (vi specification)Vim book: (7th ed, 2008)v7.3 released 2010 – still under active development http://www.vim.org/mercurial.phpvim: first released 1991better than vi:- completion- vimdiff- integrated help- plugins- graphical support (gvim, mvim)- mouse interaction- folding- split windows, tabs- syntax highlighting- visual mode- command, search, cursor position, undo/redo histories
  • Learning curve puts people off.Above graph is not true – you can learn as much of vim as you need.
  • Many shortcuts – no need to learn them all at once
  • Reduce the latency in the Brain to Computer interface
  • as few keypresses as possible
  • Core features, and a few pluginsdemo: (use lgdm server model)moving text- moving parameters - dW f␣ p- moving methods - line above method, d shift}, shift}, P- moving lines - dd, pp- indent/outdent - shift>>, shift<<(use lgdm server controller)changing text- change a word - cw- change quoted string - ci"- change in brackets - ci(moving around the file- navigate word to word, and WORD to WORD - w, W- move down a paragraph - shift {,}- find a character - and subsequent matches - f,t, ;, ,- move to last position edited - ``, `.selecting text:- Word - ve- to a character- line- paragraph- methodusing the mouse (mvim/gvim)- single, double, triple, quadruple clickcut and paste:- default- named register – “<letter>file navigation:- NERDTree- command T- ctrl-] and ctrl-o- alternate file (:A)searching: (switch back to server model)- forward - /- backwards - ?- next/previousmatchbookmarks:- lastchange - .- positionbeforelastjump - '- bookmark - m- go to bookmark - line ', and position `buffers:- Bufexplorer - ,.splitwindows:- :sp- :vsp- ctrl-w + direction- swapwindows:ctrl-w rtabs:- :tabnew- gtmacros:- q- @search highlighting:- ,hstrip trailing whitespace:- ,swshow hiddencharacters:- ,cspellchecking:- ,swordwrap:- ,wusingvimhelp:- :helpvimtutor:- vimtutor on commandline
  • From: https://github.com/LevelbossMike/vim_shortcut_wallpaper#readme
  • Mostly pluginsPlugins:- ack- Align (use chef api model) - ,t=- Command-T- Endwise (end after if, do, def)- Fugitive  - :Gblame- NERD_tree- nerdcommenter:  - comment out current line - ,cc  - toggle comment - ,c␣  - copy then comment - ,cy  - try in an html file- ragtag:  - append <%= - C-x=  - append <% - C-x-  - make word a tag - C-x␣  - close tag - C-x/- Rails:  - highlighting of rails methods  - :R  - switch to appropriate controller/model- Ruby refactoring:  - add parameter - rap  - convert post conditional - rcpc  - extract contstant - rec (visual mode)  - extract local variable - relv (visual mode)  - extract method - rem (visual mode)  - rspec extract let - rel  - inline temp - rit  - rename local variable - rrlv (visual mode)  - rename instance variable - rriv (visual mode)- SuperTab- Surround:  - change single to double - cs'"  - delete surround - ds  - add surround - ys  - act on entire line - ss  - in visual mode use S  - can use 'b' instead of (  - wraps xml tags correctly  - when changing xml tags - refer to original tag as 't'
  • - sublime text 2 (Vintage mode) http://www.sublimetext.com/2- cloud9 IDE - http://c9.io- firefox - vimperator- chrome - vimium?- gmail- google reader
  • Vim

    1. 1. Alkesh Vaghmaria10th January 2012 IPRUG
    2. 2. The Vim Way http://vimgolf.com/
    3. 3. Demo
    4. 4. Modes
    5. 5. Combinations• Operator + Motion• Operator + Count + Motion• Count + Line Operation
    6. 6. More Demo
    7. 7. Vim Everywhere• Sublime Text (vintage mode)• Cloud9 IDE• Eclim• Firefox• Chrome• Gmail• Google Reader
    8. 8. Resources• My Vim config (github)• Vim Revisited - Mislav Marohnić• Vim – Walking without Crutches – Drew Neil• Graphical Cheat Sheet and Tutorial

    ×