Brace Colors / Cursor Position

Brace Colors / Cursor Position

2
NewbieNewbie
2

    Oct 21, 2007#1

    Hello,

    I am a new UltraEdit user and haven't been able to find a solution to a couple of issues I am having.

    1) I would like to have my brackets and braces a different color. Is there a way to change the color of the brackets and braces? I understand I can highlight matching braces, but I would like them to stand out from the rest of the characters even when not being shown matching pairs.

    2) When editing a file, let's say I want to add 2 spaces in front of 3 or 4 lines. I don't want to highlight the lines, right-click, "Format" -> "Add Indent". Yes, if I wanted to indent a hundred lines I would do it that way, but when there are only a couple, I can do it quicker by going to the front of the line, pressing space space down-arrow down-arrow (double spaced lines), press space space, down-arrow down-arrow...etc... In UltraEdit, when I do this, the cursor moves to the position where it was in the previous line, rather than where it STARTED when on the previous line. In other words, if the cursor is in the 2nd column, right in front of the characters I want to Add Indent to, I press space space and now I am in the 4th column, I press down-arrow down-arrow and I am two lines down, but I am in the 4th column. I want to be in the 2nd column. Yes, I want the column to stay the same when moving from line to line, but if I edit a line and then move to a different line, I want to be in the column where I started editing on the previous line. Again, have I missed something in the configuration menu that would allow this behavior?

    Thanks for any suggestions that you may have!

    Tom / W1SDM

    6,675585
    Grand MasterGrand Master
    6,675585

      Oct 21, 2007#2

      1) Open Advanced - Configuration - Editor Display - Syntax Highlighting. There you can see which text file contains the syntax highlighting definitions for various languages. Press the button Open to open that file and close the dialog with button Cancel.

      I guess, you see the standard wordfile.txt in the UltraEdit program directory. The first definition is for "C/C++" which has 4 color groups: /C1"Keywords", /C2"C++ Keywords", /C3"Microsoft C extensions" and /C4"Operators". UltraEdit supports up to 8 color groups.

      Lets say you want to have different colors for () {} and [] for "C/C++" files. Then add following after last word of group /C4"Operators" at the first language definition:

      /C5"Brackets"
      [
      ]
      /C6"Braces"
      {
      }
      /C7"Parenthesis"
      (
      )

      After this modification you best save the file with Save As to a new name like mysyntaxdefinitions.txt. Wordfile.txt is on UltraEdit updates also updated. So it is a good advice to don't use the standard wordfile when it is customized for your needs.

      Open again Advanced - Configuration - Editor Display - Syntax Highlighting and browse for the just saved new syntax highlighting wordfile. Then select the language where you have made the modification like "C/C++" for my example. Now you can select one after the other the 2 new color groups and specify the color and style settings you want for the 3 type of braces.

      For more info read the big page about Syntax Highlighting in help of UltraEdit from top to bottom.


      2) It is not possible to insert characters like a space without cursor movement. You know that key HOME by default moves the cursor to first non white-space character on a line except the cursor is currently exactly on first non white-space character. That can be changed with the setting Home Key always Goto column 1. But in your case it could be helpful with the default setting (= not enabled).

      In column mode when pasting text the cursor position on the current line does not change. I use that trick sometimes to make what you do for a text. You could select a space character, copy it to clipboard with Ctrl+C, switch to column mode with Alt+C and insert the space with Ctrl+V as often as you want without change of the column. Don't forget to switch back to normal text edit mode with Alt+C when finished with inserting spaces.

      In colum mode there are more nice features like Insert/Fill Columns, Insert Number, Delete Columns and Cut Columns. The help of UltraEdit has more informations about that simple but often very useful functions. And with hotkeys I use it frequently.

      Last you could create a macro which contains only 3 lines:

      InsertMode
      " "
      Key LEFT ARROW

      and assign a hotkey like Alt+SPACE to this macro. When you now save this macro into a macro file which is specified to be automatically loaded on startup of UltraEdit, you can insert with Alt+SPACE a space character without visible change of the cursor position.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Re: File ownership / Brace Colors / Cursor Position

        Oct 21, 2007#3

        Mofi, thank you so much for replying so quickly and for the detailed answers, I really appreciate it!

        Tom / W1SDM