i've found notepad++ is a very convenient tool for my c++ programming. but i find that its code formatting function does not meet my needs. so i want to add astyle to notepad++. so is there anyone who can give me some details about applying astyle in notepad++? thank you a lot!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BUT Notepad++ doesn't/won't reload this immediately after astyle overwrites it; if ever. (Even if you have the check boxes in the preferences to check for those sorts of things)
So you will either need to install the ReloadButton plugin. (Yet another step)
Or click out of the program and back into it, hoping for a file change detection.
If there were an environment variable available to the NPPExec plugin, then that could be called (eg npp_reload $(FILE_NAME) ) But using nppexec you seem to lose the single hotkey to call the particular script you want to use. But does get rid of the also extra step of saving the file, as your npp_exec script could use the NPP_SAVE before calling astyle.
Everything is a trade off.
My current nppexec script looks like.
NPP_SAVE
cd $(CURRENT_DIRECTORY)
c:\astyle $(FILE_NAME) --style=ansi -s2
To use the Run command, only the 3rd line is used, since there isn't a way to concatenate several commands into one string.
And then hit the reload button to refresh it.
Richard
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for the detailed information. However, I'd like to correct some points:
1) npp v5.0 can reload the modified file after using astyle in Run dialog.
2) nppexec supports mapping script into Macro submenu,thus you can assign hotkey with your script. Remeber to use nppexec v0.2.4, which is not included in npp v5.0 yet.
XS
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you are talking about automatic indentation, NppAutoIndent provides a somewhat more intelligent approach for c-style languages, though it isnt advanced as astyle seems to be, but it does work during typing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i've found notepad++ is a very convenient tool for my c++ programming. but i find that its code formatting function does not meet my needs. so i want to add astyle to notepad++. so is there anyone who can give me some details about applying astyle in notepad++? thank you a lot!
You can use AStyle via the Run command (F5)
use:
astyle.exe $(FILE_NAME) --style=ansi -s2
or whatever your astyle styles you like.
Note: You will need to Save the file first.
BUT Notepad++ doesn't/won't reload this immediately after astyle overwrites it; if ever. (Even if you have the check boxes in the preferences to check for those sorts of things)
So you will either need to install the ReloadButton plugin. (Yet another step)
Or click out of the program and back into it, hoping for a file change detection.
If there were an environment variable available to the NPPExec plugin, then that could be called (eg npp_reload $(FILE_NAME) ) But using nppexec you seem to lose the single hotkey to call the particular script you want to use. But does get rid of the also extra step of saving the file, as your npp_exec script could use the NPP_SAVE before calling astyle.
Everything is a trade off.
My current nppexec script looks like.
NPP_SAVE
cd $(CURRENT_DIRECTORY)
c:\astyle $(FILE_NAME) --style=ansi -s2
To use the Run command, only the 3rd line is used, since there isn't a way to concatenate several commands into one string.
And then hit the reload button to refresh it.
Richard
Richard,
Thank you for the detailed information. However, I'd like to correct some points:
1) npp v5.0 can reload the modified file after using astyle in Run dialog.
2) nppexec supports mapping script into Macro submenu,thus you can assign hotkey with your script. Remeber to use nppexec v0.2.4, which is not included in npp v5.0 yet.
XS
If you are talking about automatic indentation, NppAutoIndent provides a somewhat more intelligent approach for c-style languages, though it isnt advanced as astyle seems to be, but it does work during typing.