Text Editor which tells the index of the cursor position

混江龙づ霸主 提交于 2019-12-11 04:56:31

问题


I need a text editor which tells me the position of the cursor (so I can determine ranges of text to then load into strings). Unfortunately the text editors ive tried (TextWrangler, Aquamacs, EditPad) only tell me the line number the cursor is on, and the character index on that line. I need the index from the beginning of the file to that point - ie the absolute index. Any recommendations for an editor (or a technique im missing in the editors ive already got) which can tell me this?


回答1:


If you select some text in TextWrangler you will find 3 numbers at the bottom right of the screen. The first says how many characters are selected, the second how many words and the last how many lines. If you select everything from the beginning of the file until the position you are interested in, the first number will give you what you want.




回答2:


Emacs and Vim tell you. If you have Aquamacs, it's probably just as case of setting it up to show in your modeline:

As you can see - my modeline shows that the caret is on line 3, column 8 -> the (3,8)



来源:https://stackoverflow.com/questions/17153333/text-editor-which-tells-the-index-of-the-cursor-position

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!