# Find and replace in diagram code Search and replace inside diagram source is the fastest way to do the edit people most often do by hand: renaming something that appears in fifteen places. Column select is the other tool worth knowing, for editing the same position across many lines. ![image-20260907-090226.png](https://help.gocapable.com/images/3b1204e4-ed68-48d4-bb9a-cf29aa34a011.webp) --- ## What this is for * Renaming a node, service or entity throughout a diagram. * Editing the same field across many lines. * Finding where something is defined in a long source. --- ## How it works ![The diagram text editor showing numbered lines of Mermaid flowchart code with several matches highlighted, and a find and replace bar along the bottom.](https://help.gocapable.com/images/5083d3f2-9fba-4e86-a906-83729f30e4e2.webp) The bar opens under the code with match case, regular expression and whole word options, and replaces one match or all of them. | **Action** | **How** | | ------------- | ---------------------------------------------------------- | | Find | Ctrl+F opens the search panel. | | Replace | Ctrl+H, or the replace field in the search panel. | | Replace all | Applies to the whole source at once. | | Column select | Hold Alt and drag to select the same columns across lines. | | Multi-cursor | Alt+click to place several cursors. | --- ## A few things that catch people out * Replace all is not undone selectively. Check the count before confirming a large replace. * Column select is how you add the same suffix to twenty lines in one gesture. * The preview updates after the replace, so an error is immediately visible. --- ## Related [Diagram code templatesA working starting point per language.](https://help.gocapable.com/diagrams/diagram-code-templates.html) [Import diagram source from a fileBringing in source you already have.](https://help.gocapable.com/diagrams/import-diagram-source-from-a-file.html) [Text editorBack to the editor overview.](https://help.gocapable.com/diagrams/text-editor.html) --- _The source is right there. Read it._