1

I've been using cygwin mintty for awhile now and it supports the use of custom alias's by simply defining them in the bashRC file of my user properties. Essentially I could type "test" and have it execute a script that may look something like "C:\randomfolder\manySubfolders\someScript.pl" as it simply replaces the shortcut alias with the long path to a script.

This behavior is supported in the notepad++ plugin NPPExec using npe_cmdalias alias = full command.

This works well, however my custom alias's are lost when NPP is restarted. Is there a way to make these alias's persist?

Thanks!

Abbas
  • 6,720
  • 4
  • 35
  • 49
user551258
  • 11
  • 2

1 Answers1

0

NPPExec has a rather convulated way of doing this. Here's what you need to do:

  1. Start by creating a text file for the commands. I named mine 'NppStartScript.txt' and saved it in the 'scripts' folder. Here's what the folder structure should look like: $(NPP_DIRECTORY)\scripts\NppStartScript.txt where $(NPP_DIRECTORY) represents your Notepad++ application folder.

  2. Locate the 'NppExec.ini' file. It should be in the '$(NPP_DIRECTORY)\plugins\config' folder. Open the file, add the following configuration setting at the bottom of the file (separated from the rest of the settings with a line break) and save the file:

    [Options]

    ScriptNppStart=$(NPP_DIRECTORY)\scripts\NppStartScript.txt

  3. Create the 'NppStartScript.txt', type your command(s) and save the file. In your case it would be: npe_cmdalias alias = Full command

  4. "Full command" should be a npp_exec directive to a file which will contain the commands that you want to execute repeatedly. Here's what my run python command looks like: npe_cmdalias rpy = npp_exec "$(NPP_DIRECTORY)\scripts\rpy.txt"

  5. The "rpy.txt" contains the command to invoke the python interpreter on the file that is open in the current Notepad++ tab. Here's what I have written: D:\Portable Apps\Python\python.exe "$(FULL_CURRENT_PATH)"

  6. Restart Notepad++, open the NPPExec console and type your alias. It should run the command that you specified

Hope this helps, let me know if you encounter any errors.

Abbas
  • 6,720
  • 4
  • 35
  • 49
  • don't work for me. For me it worked when I saved a command via F6 (run command). Then via the menu I specified that the command I just svaed should run when NppExec starts. – Sawny Mar 11 '12 at 10:47