Too often I figure out how to do this or that on Linux systems and in my haste to complete whatever task I've been assigned this "How To" knowledge gets lost. So here, I will begin posting little odds and ends in hopes of not needing to re-research past efforts for Linux tips, tricks, hacks, and other good to know things. If you find yourself here and know of smaller, faster, better ways of doing any of this please let me know - only through cooperation can we all get better.
Thursday, June 21, 2012
Set tabstop in VI - Mac OSX
From within VI
(Assuming you would like to use four spaces for your tabs)
:set tabstop=4
To make this behaviour the default:
user@machine:~$ cd ~
(if ~/.exrc does not exist, create it. Otherwise skip to next cmd.)
user@machine:~$ touch .exrc
user@machiner:~$ vi .exrc
Add the following line to the file:
set tabstop=4
Save and close .exrc
user@machine:~$ . .exrc
user@machine:~$ vi someTextFile.txt
Basically, if the file .exrc does not exist in your home directory create it.
Open .exrc for editing.
Add the line (w/o quotes) "set tabstop=4"
Save .exrc
Source .exrc
Test to verify function.
This should also work in most flavors of *nix.
~Fin
Labels:
command line,
linux,
Mac,
OS X,
productivity,
tab,
vi,
Vim
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment