Mu2e Home
Vim Hints
Search
Mu2e@Work

If you use the vim editor, this web pages suggest some useful configuration options.

  1. What to do about Tab Characters?
  2. Removing Trailing Whitespace


What to do about Tab Characters?

I would like to propose the following as a standard practice for Mu2e:

Please configure your editor(s) so that they do not write tab characters to source code files. Please do configure your editor so that, when you hit the tab key, it inserts the appropriate number of spaces to achieve the desired formatting.

The short answer is:

For more details see the discussion on configuring editors not to use tabs.

Removing Trailing Whitespace

  1. To remove trailing whitespace, use the following command: %s/\s\+$//
  2. To remove trailing whitespace automatically when writing a file, put the following in your ~/.vimrc file:
    autocmd BufWritePre * :%s/\s\+$//e
    Some people don't use vim autocommands because every so often they need finer control.


Fermilab at Work ]  [ Mu2e Home ]  [ Mu2e @ Work ]  [ Mu2e DocDB ]  [ Mu2e Search ]

For web related questions: Mu2eWebMaster@fnal.gov.
For content related questions: kutschke@fnal.gov
This file last modified Thursday, 26-Jan-2012 17:58:43 CST
Security, Privacy, Legal Fermi National Accelerator Laboratory