Technoleros

Observations from hacking around with all kinds of hardware and software

  • Home
  • Downloads
RSS
Tag Archives: vi

Useful Vim Commands for SAS Administrators on UNIX

Posted on January 29, 2010 by Fred Janssen
1 comment

After a successful installation of SAS Enterprise BI Server on my Sun Servers, a certain amount of time is spent modifying configuration files and backup scripts, as well as browsing log files.  I use the vi editor to accomplish the editing.  I used used vi a lot back when all of my GIS work was performed in the UNIX environment, but once the Intel hardware matured and the GIS tools because available on Windows, I thought I would be able to forget all about the UNIX command line.  Wrong.  I’m back there again, but now I’m armed with a cheat sheet:

Working with files

Vim Command

Action

vi filename

Opens a file with the Vim editor.

:w filename

Save changes to a file. If you don’t specify a file name, Vim saves as the file name you were editing. For saving the file under a different name, specify the file name.

:q

Quit Vim. If you have unsaved changes, Vim refuses to exit.

:q!

Exit Vim without saving changes.

:wq

Write the file and exit.

Moving around in the file

Vim command

Action

j or Up Arrow

Move the cursor up one line.

k or Down Arrow

Down one line.

h or Left Arrow

Left one character.

l or Right Arrow

Right one character.

0

To the beginning of a line.

$

To the end of a line.

:n

Jump to line number n.

Inserting and overwriting text

Vim command

Action

i

Insert before cursor.

o

Open a new line below and insert.

O

Open a new line above and insert.

C

Change the rest of the current line.

r

Overwrite one character. After overwriting the single character, go back to command mode.

R

Enter insert mode but replace characters rather than inserting.

The ESC key

Exit insert/overwrite mode and go back to command mode.

Deleting text

Vim command

Action

x

Delete characters under the cursor.

X

Delete characters before the cursor.

dd or :d

Delete the current line.

Undo and redo

Vim command

Action

u

Undo the last action.

U

Undo all the latest changes that were made to the current line.

Ctrl + r

Redo.

There are obviously many more Vim commands out there.  Typically if I find myself in a situation where extensive modifications need to be made with a text editor, I will use Crimson Editor on Windows.

The list of commands above are a subset of The Vim commands cheat sheet – 1.2.

Categories: Business Intelligence, Software, Technology | Tags: editor, solaris, Sun, UNIX, vi
  • Categories

    Biking Business Intelligence Data Downloads GIS GPS Hardware Maps Media Outdoors PDA Smartphone Software Statistics Technology Twitter Uncategorized Web

  • Tags

    analysis ArcGIS ArcPad ArcView attributes Austin BaseCamp browser Communicator coordinates elevation Enterprise Guide ESRI extension firmware Garmin geocaching geography geotagging Google GPS health hot fix Junction kml Maps MapSource mobile NOAA OLAP projection registry routes SAS satellite scripts toolbox topography tracks transfer utility waypoints Web Report Studio Webupdater Windows
  • Meta

    • Register
    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Recommended Links

    • Ed Bott’s Windows Expertise
    • Engadget
    • Free Geography Tools
    • Geocaching
    • Hardware 2.0
    • Lifehacker
    • MapMyRide
    • sasCommunity.org
    • the SAS BI-ogsource
    • Trails.com
  • Recent Tweets...

    • SAS Global Forum registration now OPEN! - http://t.co/6JjZXcth 2011-11-13
    • Flash is dead. Long live HTML5. http://t.co/sgKYHr0Y 2011-11-10
    • How to create multiple LSF users - http://t.co/va4rbPcv #SAS 2011-11-04
    • Adding WRS to Portal in #SAS 9.2 / 9.3 - http://t.co/pYU9gdYv 2011-11-04
    • CSR announces SiRFstarV chipset - http://t.co/D3fAgsPa 2011-11-04
    • Kinect for Windows is Confirmed for 2012- http://t.co/sVGZhexJ 2011-11-04
    • Using Windows PowerShell to report on your #SAS Enterprise Guide project files - http://t.co/kitxR3Ic 2011-11-04
    • New #SAS Job Site - http://t.co/IkcxaTm9 2011-11-04
    • How To Install Windows 8 From A USB Flash Drive - http://t.co/10A8dF4u 2011-11-04
    • GarageBand 1.1 available for iPhone and iPod touch users - http://t.co/7211B6EJ 2011-11-04
    • More updates...

    Posting tweet...

© Technoleros. Proudly Powered by WordPress | Nest Theme by YChong