I have a slice format problem when I am using vim to edit c++ source code. I don't know how to discribe the problem exactly. You see, usually when I use the command "vi hello.cpp" to write a code, it will have the format like this:
#include <iostream>
using namespace std;
int main()
{
cout << "hello, world!" << endl;
cin.get();cin.get();
return 0;
}
Recently, I don't know what I did, when I do the same thing, it becomes like this:
#include <iostream>
using namespace std;
int main()
{
cout << "hello, world!" << endl;
cin.get();cin.get();
return 0;
}
I mean I could use <tab> to move around the code, but it would be unconvnient. Besides, usually when I used an open parenthesis or bracket, it would remind me to close it. Now the warning is gone, too.
Could anyone help me change vim back to the original setting?
which means set the tabstop. You may set it and then check.
also check if your vi is vi and not vim. sometimes vi is aliased to vim or soft linked to vim. in that case your configuration file will not be .exrc. it will be .vimrc
There are a couple of more things that set the tabs
autoindent
smartindent
cindents
to know more of these you can simple type h cindents in the vi editor's command mode i.e. the : mode
Thank you, guys. I didn't find the .exrc file. I think I might delete or damage it by incident. I think I just install vi again to see what will happen. Thanx again.