Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9867
    user
    Participant

    hello!

    I would like with one click to:

    1) automatically replace all two or more spaces with one space, two or more tabs with one tab
    2) automatically delete spaces and tabs at the begining or end of lines

    any help?

    thanks!

    #9869
    Cirillo
    Participant

    Hello user!

    You may want to use the following .jsee macro

    //---Begin Macro---
    Window.Redraw = false;

    // remove trailing blanks (whitespaces, tabs ecc.) & their combos
    document.selection.Replace ("([[:blank:]]){2,}", "1", eeFindReplaceRegExp | eeFindAround | eeReplaceAll | eeFindReplaceQuiet);

    // remove StartOfLine blanks
    document.selection.Replace ("^[[:blank:]]", "", eeFindReplaceRegExp | eeFindAround | eeReplaceAll | eeFindReplaceQuiet);

    // remove EndOfLine blanks
    document.selection.Replace ("[[:blank:]]$", "", eeFindReplaceRegExp | eeFindAround | eeReplaceAll | eeFindReplaceQuiet);

    document.selection.StartOfDocument (false);
    document.HighlightFind = false;
    Window.Redraw = true;
    //---End Macro---

    Hope this will help.

    #10198
    ldm
    Participant

    How is it possible to remove empty/blank lines in the end of the file (or to leave just one empty/blank line)?
    Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.