Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

one-touch dir to copy output to editor

eNG1Ne
2013-10-03
2013-10-03
  • eNG1Ne
    eNG1Ne
    2013-10-03

    "Open current dir" is indeed a handy equivalent to !ls, but is there any one-click way/single command to run a dir command on the current directory and open the results in a N++ window? My [usual] apologies if I'm asking an obsolete question – still stuck with 5.8.5 on this corporate PC.

     
  • Jan Schreiber
    Jan Schreiber
    2013-10-03

    This is how I would do it with the NppExec plugin: Hit F6 for the NppExec prompt, make sure it says "temporary script" on the lower left, and type
    CD "$(CURRENT_DIRECTORY)"
    cmd /c CD "$(CURRENT_DIRECTORY)" && DIR > output.txt
    "C:\Programme\Notepad++\Notepad++.exe" "$(CURRENT_DIRECTORY)\output.txt"
    If everything works as expected, hit F6 again, click "Save" and save the snippet under some descriptive name. Optionally, add a keyboard shortcut via settings/keyboard.
    This has two minor drawbacks: (a) It will clutter your drive with output.txt files over time if you don't delete them. (b) Existing output.txt files will be overwritten without prompting.

     
    Last edit: Jan Schreiber 2013-10-03