3

I have TextPad on my home computer, but I can't use that on my work machine. It has an option where it remembers cursor position in certain cases. Here's an example:

<li>text one</li>
<li>text two is longer</li>

Let's say I put my cursor after the first LI and started typing

<li class="example">text one</li>
<li>text two is longer</li>

In TextPad, if I hit the down arrow, the cursor will snap back to be after the second LI, so I can immediately type (or paste) the same class. But in Notepad++ the cursor will simply end up after the n in longer, and I have to click or backtrack to get back to the LI tag.

Is there any option in Notepad++ to replicate the TextPad behavior?

3 Answers3

1

Though I don't know of a Notepad++ (NPP) feature to jump automatically to a place in text, NPP has different types of text marking that can be navigated by key-strokes. The following is a brief introduction to two types of placemarks.

Bookmarks and styles in Notepad++

  • Bookmarks can be set for the beginning of a line by clicking in the margin or with CtrlF2. Jump to the next bookmarked line with F2 or the previous with ShiftF2.
  • Styles can be set for a particular place within a line or for all instances of a specific string by right-clicking on the selected text and specifying a style number from one though five. Jump to the next marked text with Ctrl1 through Ctrl5.

Though this is not exactly what you requested, hopefully it will help find the place where text is to be pasted. Please see NPP documentation for other navigation aids that might be of more help.

1

Yes, via Location Navigate plugin.

You can install it using Plugin Manager, it is listed under the above name. This gives you possibility of skipping back and other options.

From description:

Navigate between your last edit/view points, it is useful for code/text edit and view, especially for many and large text files
1. Automatically record the cursor position and modified points
2. You can jump to any position that your cursor has visited.
3. Can use shortcuts (Ctrl+- for previous position and Ctrl+Shift+- for next position) to jump forward and back in code.
4. Can jump to any modified points(Ctrl+Alt+Z) back and forward (Ctrl+Alt+Y).
5. History positions are automatically adjusted when text is modified.
6. Can record positions data when application exit and it will be loaded in next run.
7. Can navigate only in current file.
Author: Austin Young
Source: https://sourceforge.net/projects/locationnav/files/
Homepage: https://sourceforge.net/projects/locationnav/

– WARNING –

This plugins was unstable when I last used it in 2017, it caused the entire Notepad++ to crash when doing certain Search/Replace operations (only). So install the plugin, do your job within the file and then disable it. Or copy your Notepad++ into another directory and use that second instance to work with the plugin, keeping your main Notepad++ without it.
It is a pity that the plugin has a bug because it is one of the most useful plugins around, it also provides saved/unsaved lines indication on the left margin, similar that in Visual Studio.

miroxlav
  • 14,845
0

Not sure if it's exactly what you want, but as you said you want to replicate the same class for each <li> tags, you could do the following, it is called multiline editing:

  1. position the cursor just after <li.
  2. Push the Ctrl key.
  3. Left click the second position (ie. in your example just after <li on second line.
  4. Type the text you want.

Repeat step 3 for as many lines as you want.

Toto
  • 19,304