February 22, 2014

Configuring Notepad++

I've been using Notepad++ for a long time, but only as a simple text editor. Today I decided to delve into other available functions.
  • The console (needs plugin NppExec) can be opened at the bottom of the main window (icon looking like a terminal window, with cursor). It can pass commands to the Windows console and supports history browsing with the up and dnwn arrows, but not auto-completion, as far as I can see. I have not yet looked into the internal Notepad++ commands.
  • The plugin NppCalc sounded like a simple calculator (interesting in its own right), but it turns out to be much more complex than that, covering from string operations to file system actions and to RS-232 commands. For instance, the screenshot below is taken using the highlighted line. I'm still exploring it, and the help file is just a long list of examples. I had to figure out by myself that the file must be in Windows format (<cr><lf> as line terminator.)
A few commands selected from the NppCalc help (top) and Notepad++ console (bottom)

3 comments:

  1. Hi,

    I'm tryng to convert several URL file names to STRING
    Example: "A%20student%20grammar%20of%20french.pdf" to "A student grammar of french.pdf"

    See my NPPCalc code:
    arquiv:=FindFile(GetCurrentDir(), '*.*', false)
    For(i:=10,i<20,Inc(i), Aoldname:=ExtractFileName(arquiv[i]) Anewname:=URL_D(ExtractFileName(arquiv[i])) Move(oldname,newname))

    The problem is execute commands (3 of them: Extract and Move) inside FOR, after Inc(i), ...
    Now is resulting FALSE

    Do you have a glue, please?

    ReplyDelete
  2. Solved:

    Using ";" between commands and fix "Aoldname,Anewname" names in "Move" command.

    For(i:=3, i<110, Inc(i), echo(Aoldname:=ExtractFileName(arquiv[i])); echo(Anewname:=URL_D(ExtractFileName(arquiv[i]))); Move(Aoldname,Anewname))

    GREAT! Over 100 files renamed in one line code!

    I'll check your tip "Plugins/MIME Tools/URL Decode"
    Thanks your attention.

    ReplyDelete