Chuck
Chuck

Reputation: 1293

how to set vi options only for current session?

I often "set number" to see the line numbers, and also "set ic" in Linux vi.

I guess I could set this permanently in .viminfo, but that would affect everyone. Other users might have a different preference.

Is it possible to set them once at the command prompt when I login? Then I wouldn't have to set them every time I open a file.

Upvotes: 1

Views: 5011

Answers (1)

Shmuel
Shmuel

Reputation: 1668

You can create file named .vimrc in your home directory and add your preferred config there.
This will effect only in your user.

Example the command below will add set number option permanently only for your user.
echo 'set number' >> ~/.vimrc

Or jest edit the file using vim vim ~/.vimrc

Upvotes: 1

Related Questions