Notepad++ Confuguration

Development environment specific, Arduino, Eclipse, VS2013,Em::Blocks etc
Post Reply
User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Notepad++ Confuguration

Post by BennehBoy » Sun Feb 05, 2017 5:08 pm

Many of us use NPP to edit our code due to the host of powerful features which it provides, and the array of plugins available to further expand that power.

Here are some suggestions on how to make NPP even more useful for developing Arduino/STM32 code.

1.) Associate .ino files with NPP's C++ Language definition:

Code: Select all

Go to 'Settings'->'Style Configurator'

Choose C++ in the Language bar

Type ino into the 'User ext. :' box

Save & Close
2.) Turn on Function & Word autocompletion

Code: Select all

Go to 'Settings'->'Preferences'

Click on 'Auto-Completion' in the left hand list

Tick 'Enable auto-completion on each input'

Select 'Function and word completion'

Tick 'Ignore numbers' (if you wish)

Click 'Close'
3.) Add Macro's to Compile, Upload, switch Board, clean build folder, etc

To be able to make use of these you will first need to install the NPP plugin 'NppExec' using NPP's plugin manager (go to menu 'Plugins'->'Plugin Manager'->'Show Plugin Manager', scroll to NppExec, tick checkbox and choose Install, a restart will be required)

Once NppExec is installed you must first define a script for any action that you wish to run. (go to menu 'Plugins'->'NppExec'->'Execute', click the dropdown below the main dialog and choose '<temporary script>', paste the appropriate script from below into the 'Comman(s):' dialog, choose 'Save...' Supply an appropriate name for your script.

Now that you've defined a script, you can added it to the 'Macro' menu. (go to menu 'Plugins'->'NppExec'->'Advanced Options', Ensure that 'Place to the Macros submenu' checkbox is ticked. Click on the 'Associated script:' dropdown and choose the script you defined above, click on 'Add/Modify'. You can insert menu separators this way also, and move items up/down the Macros menu by highlighting the item to move and clicking on 'Move up' or 'Move down'

Compile:

Code: Select all

//save current file
NPP_SAVE
cd "$(CURRENT_DIRECTORY)" 
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref build.path="$(CURRENT_DIRECTORY)/build" --verify "$(FULL_CURRENT_PATH)"
Upload:

Code: Select all

//save current file
NPP_SAVE
cd "$(CURRENT_DIRECTORY)" 
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref build.path="$(CURRENT_DIRECTORY)/build" --upload "$(FULL_CURRENT_PATH)"
NOTE - the above will fail at present for Maple Mini (and presumably others) unless you hardcode the path to your tools folder into the appropriate platform.txt file

Change Board:

Code: Select all

Maple Mini
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref board="mapleMini" --pref custom_upload_method="genericSTM32F103C_serialMethod" --pref target_package="Arduino_STM32-master" --pref target_platform="STM32F1" --pref custom_bootloader_version="mapleMini_original"

Maple Mini BL2
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref board="mapleMini" --pref custom_upload_method="genericSTM32F103C_serialMethod" --pref target_package="Arduino_STM32-master" --pref target_platform="STM32F1" --pref custom_bootloader_version="mapleMini_bootloader20"

Nano
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref board="nano" --pref target_package="arduino" --pref target_platform="avr"
Change COM port:

Code: Select all

"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref serial.port="COM9" --pref serial.port.file="COM9"
Clean build folder:

Code: Select all

Clean

cd "$(CURRENT_DIRECTORY)" 
cmd /c del "$(CURRENT_DIRECTORY)/build" /F /S /Q
4.) Enable colour highlighting in NppExec

Go to menu 'Plugins'->'NppExec'->'NppExec Console Filters', click on the 'Highlight' tab, input each of the filters shown below into it's own 'Highlight mask(s) entry, choose appropriate colors for the warnings. I use 0xFF 0x00 0x00 for red, 0xFF 0xA5 0x00 for orange, etc.

Code: Select all

%FILE%:%LINE%: warning:*
%FILE%:%LINE%: error:*
Low memory available*
Sketch too big*
*#pragma message*
%FILE%:%LINE%: fatal error:*
5.) Add other useful plugins

I have these installed:
Compare
HEX-Editor


Thanks to @willfly1 for showing us how to get started in this thread -> http://www.stm32duino.com/viewtopic.php ... =20#p23314
-------------------------------------
https://github.com/BennehBoy

Riva
Posts: 42
Joined: Fri May 06, 2016 6:42 am

Re: Notepad++ Confuguration

Post by Riva » Mon Feb 06, 2017 9:07 am

I use NPP but use the standard Run menu with a couple of commands defined to launch an IDE (either V1.0.6 or v1.6.9) and load the current NPP file then I select the target board etc in the IDE and hit verify/upload. The Arduino IDE is set to 'use external editor' in its preferences.

The NPP plugins I tend to use most are Compare & Indent by fold but also have customize toolbar installed to err alter the toolbar.

I have also added a lot of the v1.0.6 commands to the syntax highlighter in NPP so keywords like digitalRead, pinMode etc highlight but have not updated these for a while.

Instruction word:
abs accept acos Adafruit_GFX Adafruit_ST7735 analogRead analogReference analogWrite answerCall asin atan atan2 attach attached attachGPRS attachInterrupt autoscroll available background begin beginPacket beginSMS beginTransmission begnWrite bit bitClear bitRead bitSet bitWrite blink blinkVersion BSSID byte callbackFunction ceil changePIN char checkPIN checkPUK checkReg circle class clear click Client close config connect connected const constrain cos createChar cursor degrees delay delayMicroseconds detach detachInterrupt digitalRead digitalWrite direction disconnect display double draw drawBitmap drawChar drawCircle drawCircleHelper drawFastHLine drawFastVLine drawLine drawPixel drawRect drawRoundRect drawTriangle EEPROM encryptionType end endPacket endSMS endTransmission endWrite Esplora Ethernet EthernetClient EthernetServer exists exp File fill fillCircle fillCircleHelper fillRect fillRoundRect fillScreen fillTriangle find findUntil Firmata float floor flush gatewayIP gatVoiceCallStatus getBand getCurrentCarrier getIMEI getPINUsed getResult getRotation getSignalStrength getSocket getvoiceCallStatus GPRS GSM GSM_SMS GSMBand GSMClient GSMModem GSMPIN GSMScanner GSMServer GSMVoiceCall hangCall height highByte home image int int16_t int32_t int64_t interrupts invertDisplay IPAddress isListening isPIN isPressed isValid Keyboard leftToRight LiquidCrystal listen loadImage localIP log long loop lowByte macAddress map max micros millis min mkdir Mouse move newColor NewSoftSerial noAutoscroll noBlink noCursor noDisplay noFill noInterrupts noStroke noTone null onReceive onRequest open overflow parseFloat parseInt parsePacket peek PImage pinMode point position press print printFirmwareVersion println printVersion private processInput prog_char prog_int16_t prog_int32_t prog_int64_t prog_int8_t prog_uchar prog_uint16_t prog_uint32_t prog_uint64_t prog_uint8_t prog_void PROGMEM protected public pulseIn quad radians random randomSeed read readAccelerometer readBlue readButton readBytes readBytesUntil readGreen readJoystickButton readJoystickSwitch readJoystickX readJoystickY readLightSensor readMicrophone readMicroseconds readNetworks readRed readSlider readTemperature ready receive rect register release releaseAll remoteIP remoteNumber remotePort remove requestFrom retrieveCallingNumber rightToLeft rmdir round RSSI scrollDisplayLeft scrollDisplayRight SD seek send sendAnalog sendDigital sendDigitalPort sendDigitalPortPair sendString sendSysex Serial Serial1 Serial2 Serial3 Server Servo setBand setBitOrder setClockDivider setCursor setDataMode setDNS setFirmwareNameAndVersion setFirmwareVersion setPINUsed setRotation setSpeed setTextColor setTextSize setTextWrap setTimeout setup shiftIn shiftOut short shutdown signed sin size speed SPI sq sqrt SSID static status step Stepper stop stringCallbackFunction stroke subnetMask switchPIN sysexCallbackFunction systemResetCallbackFunction tan text textSize textWrap TFT tone transfer triangle uint16_t uint32_t uint64_t uint8_t unsigned version voiceCall void width WiFi WiFiClient WiFiServer WiFiUDP Wire write writeBlue writeGreen writeMicroseconds writeRed writeRGB

Type word:
ANALOG_MESSAGE ANALOG_PORT BIN CALLING CH_JOYSTICK_SW CH_JOYSTICK_X CH_JOYSTICK_Y CH_LIGHT CH_MIC CH_SLIDER CH_SWITCH_1 CH_SWITCH_2 CH_SWITCH_3 CH_SWITCH_4 CH_TEMPERATURE CHANGE CONNECTING DEC DEFAULT DEGREES_C DEGREES_F DIGITAL_MESSAGE END_SYSEX ERROR EsploraTFT EXTERNAL FALLING FILE_READ FILE_WRITE GPRS_READY GSM_MODE_DCS GSM_MODE_EGSM GSM_MODE_EGSM_DCS GSM_MODE_GSM850_EGSM_DCS_PCS GSM_MODE_GSM850_PCS GSM_MODE_PCS GSM_MODE_UNDEFINED GSM_READY HALF_PI HEX HIGH IDLE IDLE_CALL INPUT INPUT_PULLUP INTERNAL INTERNAL1V1 INTERNAL2V56 JOYSTICK_BASE JOYSTICK_DOWN JOYSTICK_LEFT JOYSTICK_UP LOW LSBFIRST MAX_CHANNELS MAX_DATA_BYTES MSBFIRST OCT OUTPUT PI PRESSED PWM RECEIVINGCALL RELEASED REPORT_ANALOG REPORT_DIGITAL REPORT_VERSION RISING SERIAL_5E1 SERIAL_5E2 SERIAL_5N1 SERIAL_5N2 SERIAL_5O1 SERIAL_5O2 SERIAL_6E1 SERIAL_6E2 SERIAL_6N1 SERIAL_6N2 SERIAL_6O1 SERIAL_6O2 SERIAL_7E1 SERIAL_7E2 SERIAL_7N1 SERIAL_7N2 SERIAL_7O1 SERIAL_7O2 SERIAL_8E1 SERIAL_8E2 SERIAL_8N1 SERIAL_8N2 SERIAL_8O1 SERIAL_8O2 SET_PIN_MODE SPI_CLOCK_DIV128 SPI_CLOCK_DIV16 SPI_CLOCK_DIV2 SPI_CLOCK_DIV32 SPI_CLOCK_DIV4 SPI_CLOCK_DIV64 SPI_CLOCK_DIV8 SPI_MODE0 SPI_MODE1 SPI_MODE2 SPI_MODE3 START_SYSEX SWITCH_1 SWITCH_2 SWITCH_3 SWITCH_4 SWITCH_DOWN SWITCH_LEFT SWITCH_RIGHT SWITCH_UP SYSTEM_RESET TALKING TOTAL_ANALOG_PINS TOTAL_DIGITAL_PINS TOTAL_PORTS TRANSPARENT_CONNECTED TWO_PI X_AXIS Y_AXIS Z_AXIS

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Notepad++ Confuguration

Post by BennehBoy » Mon Feb 06, 2017 9:56 am

This works quite well for Arduino function and keyword highlighting -> https://sourceforge.net/projects/narduinoplugin/
-------------------------------------
https://github.com/BennehBoy

stevestrong
Posts: 1812
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Notepad++ Confuguration

Post by stevestrong » Tue Mar 14, 2017 1:38 pm


User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Notepad++ Confuguration

Post by BennehBoy » Tue Mar 14, 2017 9:46 pm

I think we should all just accept that if a nation state wants to own us, they will own us.
-------------------------------------
https://github.com/BennehBoy

User avatar
ahull
Posts: 1650
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Notepad++ Confuguration

Post by ahull » Wed Mar 15, 2017 1:31 am

BennehBoy wrote:I think we should all just accept that if a nation state wants to own us, they will own us.
- Andy Hull -

zmemw16
Posts: 1483
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Notepad++ Confuguration

Post by zmemw16 » Wed Mar 15, 2017 2:59 pm

sorry, all i see in that is potentially a crushed water melon and a lot of road rash.
stephen
1 cycle - extreme close up of a lorry wheel
2 motorbike - writing off a mini with my head

Post Reply