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?
Solution 1:
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.
- Select all characters from the current cursor position to the start of the file using ctrl+shift+home
-
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.
Note that characters includes the end of line characters.
Solution 2:
Press Ctrl+G and click the Offset
radio button. Your cursor position will be shown in the You are here:
line
Example: