g_ (g followed by underscore) moves to the last non-empty character of the string strings text . (As Khan Pintyan noted in the comments).
To go to the last non-empty character of the screen line, there is not the only operator that I could find, but you could combine g$ with ge to achieve this result: use g$ to go to the last character (empty or not empty) of the screen line and then, if the cursor is in a space, use ge to move back to the last character of the previous word. (And, of course, if the character under the cursor is not empty, just omit the ge statement).
If you are trying to write a script, it will not be as useful as a separate highlighted statement, because in order to make a decision about the character under the cursor after g$ completes, it must make a decision. But if you are just trying to go to the last non-empty character in visual mode or for interactive editing, the combination g$ ge should be sufficient for what you need.
Also try substituting ge for ge , depending on whether you want to skip punctuation or not. (See :help word-motions for the distinction between e and e : basically, e counts ALL non-whitespace as word characters, and e counts only letters, numbers, and underscores.)
source share