Monday, December 3, 2018

notepad++ - How to know cursor position index in an editor


I'm working with an HTML file, and I need to know my cursor position index in the overall file.


In Visual Studio, I can see the line number and column number in status bar.


In Notepad++ too, in the status bar, line number and column number are shown.


But I need to know the index of the cursor. For example, instead of line 4 column 23, I want to know that I'm at the 256th character in the file.


Does any editor exist out there with this feature?


Answer



I need to know the index of the cursor.



For example, instead of line 4 column 23, I want to know that I'm at the 256th character in the file.**



Notepad++ already has the feature you are looking for.



  1. Select all characters from the current cursor position to the start of the file using ctrl+shift+home

  2. Look at the status bar where it says "Sel: characters|rows"



    • The first value characters is the number of characters in the selection.

    • The second value rows is the number of rows in the selection.

    • The selection starts from the beginning of the file and ends where the cursor was previously .

    • The value of characters is the "index" of the cursor.


    enter image description here



Note that characters includes the end of line characters.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...