A hands-on workshop on Emacs and Vim: 21st Sept 2016

Some updates after the workshop today.

For Emacs

Vim

  • Use sed for mass editing of several files: http://sed.sourceforge.net/sed1line.txt (sed commands have close vim parallels)
  • Use vim with -w and -s options for writeout/scriptin options for complex systematic editing to be mass-performed on many files
  • Put the following line in your HOME/.vimrc for execution of previous command map V :w^M:!^[OA^M^M " for shortcut V to execute previous command
  • Put your favorite set into .vimrc.
  • Write to belur[AT]iitb.ac.in with "Vim help" in the subject for queries.

Old workshop announcement follows below

Please attend any one (or both) of the hands-on workshops on
  • Emacs
  • Vim

Any one of these two editors will help you use the full power of shortcuts. (Please use gtypist for a typing tutorial.)

Venue for both workshops: LA 301 (changed)
  • Date: 21st September (Wednesday), 2016
  • Time: Emacs: 2:10 to 3:25pm (Note the new modified timings!)
  • Time: Vim: 4:30 to 5:35pm (Note the new modified timings!)

Both these editors are very powerful and have many advantages compared to most other plain text editors that people tend to use. In fact, many other advanced packages allow you to configure their editors so that your Emacs skills or Vim skills become fully usable.

Both Vim and Emacs are available in both Windows, Linux and Mac.

Speakers:
  • Jinesh Jacob, Kumar A., Prasad (for Emacs)
  • Ashwith, Saurabh, Srikant, Prashant (for Vim)

Please install Emacs and Vim on your laptops and come prepared to learn in the hands-on workshop. We will not be able to provide installation help.

Below are the topics.

Emacs:

** Navigation
  • Initial screen, basic features
  • Open, save and close files/buffers
  • Exit/quit
  • Beginning, end of line, file etc.
  • Copy, paste delete etc.
  • Search, incremental search, query-replace
  • Undo/Redo
  • Spell check with ispell
** Buffers and windows
  • What are buffers?

Vim:

Vim is available in windows and Linux and Mac. Please install Vim (by going to http://www.vim.org/download.php or suitable installer)

  • 10 min: Modes of Vim, command mode, insert/replace modes, visual mode, ex mode
  • 02 min: save to file, quit without saving
  • 05 min: moving around document: forward, backward, begin/end page
  • 05 min: copy, paste, delete, (lines,blocks), dd, D, yank yy, x, X, paste p, P
  • 05 min: search, search-replace, :%s/old-pattern/new-pattern/cgi
  • 10 min: visual-mark copy/yank, cut/delete, : s/old-pattern/new-pattern/cgi
  • 02 min: repeat most recent command (.), undo, redo, u, ctrl-R
  • 02 min: syntax ON/OFF, code-wrap gqq, vim understands from extension: can include new languages
  • 04 min: spell-check, add to local dictionary, make directory ~/.vim/, z=, ctrl-x, ctrl-k

Up to above is hands-on.

Overview of advanced topics (in slides, and made available) - splitting window, .vimrc, map, regular expressions, - Execute shell commands (like !pdflatex %, !make, !gcc % -o name.out !python %) - code folding, tabs and split windows

Useful material (for vim):

Please visit this website for more updates.

-Madhu