I am using vi editor in Linux server. I want to set certain configurations like set ai and set ts=4 in my login profile itself so that I don't have to set it each and every time I get into Vi editor. Please assist. Thanks.
Asked
Active
Viewed 1,647 times
-1
-
Related: [Where is my .vimrc file](https://stackoverflow.com/questions/10921441/where-is-my-vimrc-file) – Mark Plotnick Aug 09 '19 at 04:02
-
1Possible duplicate of [Where is my .vimrc file?](https://stackoverflow.com/questions/10921441/where-is-my-vimrc-file) – Subhrajyoti Das Aug 09 '19 at 04:43
-
[Vim/.vimrc configuration](https://wiki.archlinux.org/index.php/Vim#Example_configurations) a very good reference. – David C. Rankin Aug 09 '19 at 07:07
1 Answers
-1
You can use a the .vimrc/.exrc file for in this case. vimrc sample
Christina Jacob
- 665
- 5
- 17
-
Will vimrc file work for Vi editor. Thought it's only for Vim. Sorry - I am new to vim – SSS Aug 09 '19 at 06:46
-
It depends. In some distributions vi might actually be vim-minimal which would use ~/.vimrc as config file. Otherwise it is .exrc file in your home directory – Christina Jacob Aug 09 '19 at 07:03
-
I have neither .vimrc nor .exrc files in my home directory. I don't have .bashrc as well. If I create them on my own, how do I ensure it will be executed automatically when I login? – SSS Aug 12 '19 at 01:54
-
you can create one. I should be automatically used. you can source it in case you want to be sure – Christina Jacob Aug 12 '19 at 08:38