Author Topic: In VIM emulator, how to select columns, and how to indent 1 or several spaces  (Read 1574 times)

studentpower

  • Community Member
  • Posts: 7
  • Hero Points: 0
for several lines? For example, if I have:
for (...)
{
    ...;
}

I want to change it to:
#ifdef ...
    for (...)
    {
        ...;
    }
#endif

Instead of using beautify, any other easier way to do this?

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Assuming you are doing C/C++, I would say using the existing "Surround With" alias would be the easiest way.  Just select the lines you want to surround with the #ifdef, right-click, select "Surround Selection With...", and choose "#ifdef".

In general, in Vim if you want to indent a certain number of lines you can just use the ">" command.  Start a line selection with "Shift+V", use "j" or "k" to cursor up or down and select all the lines, then hit ">" as many times as desired.  "<" will move the lines the other way.

Hope this helps.

- Ryan