Transcription of Notes on vim

Nothing too important in here...


.vimrc issues

Performing :version will reveal where Vim thinks it's getting your .vimrc, probably off ${HOME}/.vimrc. If you're not getting some of your function key mappings, you might look at your keyboard to see if the function keys are toggled on. (Some keyboards allow them to be off, default to off, etc. This is something to think about each time you start your host from cold/off.)


The 7 habits of effective text editing...

Bram’s presentation slides


EasyAccent to the rescue...

This gizmo lets me type diacritics in vim.

How to set it up

Download from http://vim.sourceforge.net/scripts/script.php?script_id=451.

Where do I drop this script (EasyAccents.vim) in order for it to be in effect (/home/russ/? c:\Documents and Settings\russ\My Documents?) and how do I set g:EasyAccents_VowelFirst to zero?

Bring up vim; type...

	:echo &rtp

...and you’ll see a comma-delimited list of directories. Pick one, preferably not a system one (i.e.: not where vim stores its plugins), and create a subdirectory, /plugin. Put the EasyAccents script in there. You can read more about this using:

	:help 'rtp'

Now for the second question: again, while in vim do:

	:echo $HOME

You should place in the directory so displayed the .vimrc (_vimrc) file. Within it, have the following lines in effect...

	set nocp
	filetype plugin on
	let g:EasyAccents_VowelFirst = 0

How to use it

It’s easy to toggle on and off, just type:

	\eza

Merely type a vowel after any of the following:

	`    (grave)
	'    (acute)
	^    (circumflex)
	:    (dieresis/umlaut)

...or a comma (,) followed by c or C for ç or Ç; and b or B for ß.

For remaining diacritics like ñ and å, you must do this instead...

let g:EasyAccents_VowelFirst = 1

...and type the vowel followed by the accent...

n~
a@
etc.


Copy using mouse...

Use mouse to select a block and press y.


Find word under cursor...

Use # to find the word under the cursor going backward. * will find the next occurrance of the word under the cursor.


Accumulated tricks
  1. Split window vertically: Ctrl-w v
  2.  
  3. Split window horizontally: Ctrl-w s
  4.  
  5. Click and drag for a visual selection; pressing : to begin search and replace will bring up '>,'< to which you add s/search/replace/g and it will act within that range rather than the whole file.
  6.  
  7. To move between Java methods, use
    n]m to move to start of nth succeeding method
    n]M to move to end of nth succeeding method
    n[m to move to start of nth previous method
    n[M to move to end of nth previous method
  8.  
  9. To set number of lines and width of window:
    set lines=66 columns=120
    
  10.  
  11. To keep wrapping text (visually), but avoid inserting line breaks, do this:
    set textwidth=0 wrapmargin=0
    
  12.  
  13. To append lines to a temporary register, use lower-case buffer name to overwrite, upper-case to append; do this:
    "ayy yanks first line and overwrites register
    "Ayy yanks another line and appends to register