Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Bookmark eBooks / scripts / source code etc.


  • Please log in to reply
12 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
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...

Posted 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

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Pretty interesting, I've scripted a few bookmarks in one particular text file based on the position of certain heading lines.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
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.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
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.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


  • Guests
  • Last active:
  • Joined: --
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]

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
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.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


  • Guests
  • Last active:
  • Joined: --

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.

twwilliams
  • Members
  • 23 posts
  • Last active: May 07 2010 09:01 PM
  • Joined: 24 May 2004

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

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
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...

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


jtran21
  • Members
  • 10 posts
  • Last active: Jan 16 2005 11:56 PM
  • Joined: 01 Dec 2004
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.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

One line I did change for my personal taste...

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

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


savage
  • Members
  • 207 posts
  • Last active: Jul 03 2008 03:12 AM
  • Joined: 02 Jul 2004

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.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
i just updated the script to use ahk menu instead of the now obsolete tooltip menu. also updated to use pspad by default.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat