Essential Notepad++ tips and features for working with AEM log files, XML, configurations, and scripts
Notepad++
Core features in Notepad++ that are essential for handling AEM log files, XML configurations, and automation scripts.
1. Column Mode Selection
Press Alt+Shift+↑/↓/←/→ or hold Alt while dragging the mouse to select text rectangularly (Column Mode).
AEM Use Case: Remove redundant log prefixes across multiple lines simultaneously, or extract specific data columns from log files.
Select the prefix block [ERROR] via Alt+Drag → Press Delete to strip prefixes in a single action.
2. Regular Expression Search & Replace
Press Ctrl+H → Enable Regular expression mode.
AEM Use Case — Remove Blank Lines:
Find:
Replace: (Leave empty)
AEM Use Case — Update Java Package Names in XML:
Find:
Replace:
AEM Use Case — Extract Class Names from Stack Traces:
Find:
Replace:
3. Mark and Highlight Text
Press Ctrl+M → Highlight selected text with custom colors. Up to 5 distinct style colors can be applied concurrently.
Navigate to Search → Mark All → Enter keyword → Highlight all instances across document.
AEM Use Case: Color-code different log levels and keywords while analyzing error.log:
- Style 1:
ERROR - Style 2:
WARN - Style 3:
NullPointerException - Style 4: Target component name under active investigation
4. Line Bookmarks
AEM Use Case: Bookmark key log entries within multi-thousand-line error.log files to navigate quickly between relevant trace points.
5. Folding and Unfolding Code Blocks
AEM Use Case: Collapse individual <node> blocks in large .content.xml files to inspect overall node hierarchy cleanly.
6. Compare Plugin
Install via Plugins → Plugins Admin → Compare.
Navigate to Plugins → Compare → Compare to inspect two open files side-by-side with highlighted differences.
AEM Use Case:
- Compare
dispatcher.anyconfigurations between production and staging environments. - Diff
_rep_policy.xmlACL definitions before and after editing. - Compare package manifest versions (
.content.xml) prior to package deployment.
7. XML Tools Plugin
Install via Plugins Admin → XML Tools.
AEM Use Case: Copy raw XML from CRXDE → Paste into Notepad++ → Execute Pretty Print to format node structure.
8. Macro Recording and Execution
- Navigate to
Macro → Start Recording. - Perform repetitive text transformation steps.
- Select
Macro → Stop Recording. - Press
Ctrl+Shift+Pto replay once, or selectMacro → Run a Macro Multiple Times.
AEM Use Case: Format raw stack traces line-by-line and execute the macro repeatedly to process large log files.
9. Column Editor
Press Alt+C while in column selection mode to launch the Column Editor.
Insert sequential numbers or static text into the active column across selected lines.
AEM Use Case: Prepend - to multiple lines to convert plain lists into formatted YAML/Markdown syntax.
10. Converting Line Endings
Navigate to Edit → EOL Conversion:
- Windows (CRLF):
\r\n - Unix (LF):
\n - Macintosh (CR):
\r
AEM Use Case: Bash scripts or Dispatcher configuration files created on Windows failing on Linux due to \r carriage returns → Convert to Unix (LF) before uploading.
11. Character Encoding Conversion
Navigate to Encoding menu to switch between UTF-8, UTF-8-BOM, ANSI, and UTF-16.
AEM Use Case: Ensure i18n .properties files use standard UTF-8 (avoid UTF-8-BOM as AEM property readers fail to parse BOM markers properly).
12. Workspace Sessions
Navigate to File → Save Session to save currently open files as a .nps session file.
Select File → Load Session to restore the designated group of files.
AEM Task Session Examples:
debug-dispatcher.nps:dispatcher.any,httpd.conf,access_log.aem-logs.nps:error.log,request.log,stdout.log.package-review.nps: Active.content.xmlvault files under review.
13. Function List Panel
Navigate to View → Function List to display a sidebar listing functions, methods, and definitions.
AEM Use Case: Navigate complex deployment shell scripts or Python automation scripts easily.
14. Document Map
Navigate to View → Document Map to view a high-level mini-map of the file on the right margin.
AEM Use Case: Navigate large log files spanning multiple megabytes quickly without manual scrolling.
15. Find in Files
Press Ctrl+Shift+F to search across directories.
Configuration parameters:
- Find what: Search term or regex.
- Filters:
*.log,*.xml,*.any,*.conf. - Directory: Target root directory.
AEM Use Case:
- Search log directories for
OutOfMemoryErroroccurrences. - Search XML files across vault packages for specific
sling:resourceTypedefinitions. - Locate
Includedirectives across Dispatcher configuration files.
16. User Defined Language (UDL)
Navigate to Language → User Defined Language → Define your language to construct custom syntax highlighting rules.
AEM Use Case: Import custom UDL rules for Sling log formats (highlight timestamps, log levels, and class names in distinct colors).
17. Smart Highlighting
Double-click any word to highlight all matching occurrences throughout the document.
AEM Use Case: Double-click a class name within a stack trace to highlight every reference to that class in the active log.
18. Auto-Completion
Navigate to Settings → Preferences → Auto-Completion:
- Enable word completion per document.
- Enable parameter hints.
AEM Use Case: Autocomplete JCR property names in .content.xml files based on existing document contents.
19. Word Wrap
Press Alt+H (or navigate to View → Word Wrap) to toggle line wrapping.
AEM Use Case: Long stack trace lines in log files wrap cleanly without horizontal scrolling.
20. Executing External Commands
Press F5 (Run → Run...) to execute external CLI tools using variables:
AEM Use Case: Create a shortcut to deploy the active XML file directly to CRXDE via curl:
21. Tail Monitoring Mode
Navigate to View → Monitoring (tail -f) to auto-refresh the file as new data is written to disk.
AEM Use Case: Monitor crx-quickstart/logs/error.log in real time within Notepad++ without installing third-party tail utilities on Windows.
22. Multi-View Split Editor
Navigate to View → Move/Clone Current Document → Move to Other View to split the editor into dual panes.
AEM Use Case: Display error.log on the left pane and .content.xml on the right pane during debugging.