This page was generated from 31.vi.mth.

This page is part of the course work for CS360: Systems Tools course offered by the Computer Science Department at CalState, San Bernardino, California, USA. It was generated by Dr. Dick Botting.

Contents


    cs360/notes/31.vi

    Why

    You wish that 'vi' had a 'swap two characters' command.

    You want to make life easy for yourself.

    You want to make life easier for your users.

    I use a keyboard with no Esc key, so I told vi that when I input a pair of "Z"s that they mean an Esc.

    Sections


    (why): 31.01
    (exam): See [ PostIt Note ] below.
    (PostIt Note): 31.02(unmapped keys)
    (useful): 31.02, 31.03, 31.06, 31.07, 31.08. 31.10 31.14 31.15
    (perhaps): 31.04, 31.09 31.11, 31.12 31.16
    (skip): 31.05 31.13
    (wrong): Nothing.

    Facts


    (31.01):
    (31.02): Using 'map' in simple ways is worth knowing... and may be mentioned in the exam, but the actual examples are less important.

    31.03 on some systems 'vi' doesn't wait long enough after an ESC forthe network to transmit the rest ofthe "arrow key" sequence. This is controlled by the environment variable ESCDELAY. Set it to a large value and export it. So this in your .profile/.bash_profile.

    31.09: I once tried an .exrc file like this and it was slooooooow.

    31.11: I tend to type in lower case and then use the ~ command to make the letters upper case.

    31.16: Cutting long lines... neat ideas.... but we have 'br' so '!!br' works well.

    Exceptions

    Definitions

  1. map::vi_ex_command, lists or defines mappings from keys to commands.
  2. unmap::vi_ex_command, removes meaning of key.

  3. map!::vi_ex_command, lists or defines mapping from keys to texts.
  4. unmap!::vi_ex_command, removes meaning of key in text input mode.

  5. list_key_mappings::ex_command=map.
  6. map_key_to_command::ex_command=map key commands.
  7. key::= a single key. prefix special keys (Space, Enter, Esc, ...) with CTRL/V.
  8. commands::=any sequence of vi commands, but prefix some control characters with CTRL/V.
  9. vi_ex_command::=in vi command mode tap the colon(:) key before the ex_command and tap the return after the end.
  10. ex_command::= See http://www.csci.csusb.edu/dick/cs360/notes/30.vi.html#Some vi Line mode/ex commands
  11. ex_command::= See http://www.csci.csusb.edu/dick/cs360/notes/30.vi.html#Some vi Line mode/ex commands

    Submit Your Notes Here

    To earn credit for completing this part of the course you need to send me a short list of things you have learned. A simple way to do this is to follow this [click here [socket symbol] if you can fill this hole] link and fill in the form.

End