AutoHotkey Community

It is currently May 27th, 2012, 9:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: May 16th, 2004, 12:21 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
I've yet to find an editor that can somehow save bookmarks to files between sessions. you close a file and then re-open it and u've to fish out that particular location in that heap of lines... too bad!

here's a script to help with it...

Image

It works like this... while in the editor u launch this script, it shows a menu with existing bookmarks and an 'add bookmark' option... just click the menu according to need.

bookmarks are made so that they work even if the file contents are changed... they don't remember line number ... rather they remember what's on the bookmarked line! ... this'll help u get back to THAT particular location in your code even after u changed something above it!

when adding a bookmark, the format is:
complete line in file that u want to bookmark**text that'll be shown on menu

( the 2 asterisks delimit the file text & bookmark name )

and if u want to delete a bookmark... press shift while clicking on the menu!

i've made it keeping PSPad in mind but i've made it re-configurable and commented it so that users using other editors can easily adapt it.

Script

_________________
Image


Last edited by Rajat on May 14th, 2005, 11:19 am, edited 6 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 16th, 2004, 4:44 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Pretty interesting, I've scripted a few bookmarks in one particular text file based on the position of certain heading lines.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 16th, 2004, 9:04 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
if anyone found the script interesting & d/l it then do check that it matches the one in the forum now. as after initial posting i made a couple of changes to take care of spl chars.

though it was before the timestamp of Chris's message.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 25th, 2004, 2:37 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
just a note,
As i was writing a script i used the ToolTip menu from this script and adapted it to my under-devpt script. So it occurred to me to make a note in the forum that the main feature of this ToolTip menu is its single-use-only and doesn't use any hotkey.

so for ToolTip menus of this type this can also be taken as a template.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2004, 9:46 am 
nice script... As for an editor capable of storing bookmarks and all that, you should try Syn Text Editor. It's an open source project and can be found @ http://syn.sourceforge.net.[/url]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2004, 4:10 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
just a note.

I don't know how most of you guys manage your BIG scripts as traversing through it to a certain location takes time... for smaller scripts simply scrolling does it, but for bigger ones i find this script very efficient...

the best places to bookmark are section names... like if the name of a section is 'EditGUI' then i enter the bookmark as:
EditGUI:**EditGUI:
(two times the name separated by two asterisks, though the text after the asterisks can be anything)

now no matter how much code i add/modify above, below or in the section, the bookmark always works.
eg. for SGUI code approaching 2000 lines, i've my most frequently used sections bookmarked.

do give it a try if u've some big codes.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 28th, 2004, 9:04 am 
Rajat wrote:
I've yet to find an editor that can somehow save bookmarks to files between sessions. you close a file and then re-open it and u've to fish out that particular location in that heap of lines... too bad!

Emacs can do it for 10+ years. It even finds the bookmarked location if the file changed in the meantime. Unfortantely, this editor has its own philosophy which only few people bother to learn.


Report this post
Top
  
Reply with quote  
PostPosted: November 29th, 2004, 11:56 pm 
Offline

Joined: May 24th, 2004, 7:45 pm
Posts: 23
Location: Bellevue, WA USA
Anonymous wrote:
Emacs can do it for 10+ years. It even finds the bookmarked location if the file changed in the meantime. Unfortantely, this editor has its own philosophy which only few people bother to learn.


vim can do this, too, and has again won text editor of the year from Linux Journal. It's available for Windows, too, and does a very nice job there.

But, like emacs, it will require some adjustment for people used to most Windows text editors.

_________________
Tommy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2004, 12:36 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
thanx for the info guyz... all this'd been very useful had i got it before i coded this script... but now i'm getting all the features i want in my fav. editor, and ppl don't easily change their editors...

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Script is very helpful
PostPosted: December 5th, 2004, 9:53 pm 
Offline

Joined: December 1st, 2004, 6:58 pm
Posts: 10
Hey Rajat,
I'm using the script (my texteditor is EditPlus, but other than changing the window title name in the script, everything else was flawless!). Just wanted to say thanks...very useful!

--Jim

P.S. One line I did change for my personal taste was the one which pops up the input dialog:
InputBox, InputText, Bookmarks for [%FileName%],Line from file**Bookmark name, , 300, 120

I just made it a bit more compact.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 6th, 2004, 12:17 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
jtran21 wrote:
One line I did change for my personal taste...

that's the beauty of scripting... customisation and control! ;)

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2004, 10:32 pm 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
Quote:
vim can do this, too


Lol, I learn something new about vim! The best part about it and emacs, IMO, is that you can use them forever (or a few months like me) and still learn new stuff about them.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2005, 11:15 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
i just updated the script to use ahk menu instead of the now obsolete tooltip menu. also updated to use pspad by default.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: sks and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group