Skip to content

Instantly share code, notes, and snippets.

@aaira-a
Created March 5, 2015 06:04
Show Gist options
  • Save aaira-a/6942b485b5d0dcbcd6ae to your computer and use it in GitHub Desktop.
Save aaira-a/6942b485b5d0dcbcd6ae to your computer and use it in GitHub Desktop.
Sublime Text 2/3 script to show character position

Copied from here

Save as .py , put in (Preferences > Browse Packages > User) and restart Sublime

import sublime_plugin
class PositionListener(sublime_plugin.EventListener):
def on_selection_modified(self, view):
text = "Position: "
sels = view.sel()
for s in sels:
text += " " + str(s.begin())
if not s.empty():
text += "-" + str(s.end()) + " "
view.set_status('exact_pos', text)
@ariley
Copy link

ariley commented Nov 17, 2017

Thank you!

@ben-harack
Copy link

Awesome.

@SpenDM
Copy link

SpenDM commented Apr 11, 2019

This is great, thanks!

@janetlauyeung
Copy link

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment