topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 5:16 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: wanting a code snippets collection? use oneNote AND keep syntax highlighting  (Read 18190 times)

urlwolf

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,837
    • View Profile
    • Donate to Member
Some here (i.e., app) wanted a code snippets program, but where not satisfied with what they found.
I'm posting my hack here.
I wanted something that indexed things, and kept syntax highlighting.
Ideally my own note taker: oneNote. Problem is, it doesn't know how to do syntax highlighting.

Here is what I do to use oneNote AND keep syntax highlighting.

I use vim. You may want to use some other editor that allows you to dump html if you don't know vim-fu and are not inclined to spend 10 years training alone in the mountains to learn it.

1. From vim, call :Tohtml
2. ZZ the window that pops up (that's a shortcut for save and close)
3. F3 the resulting file in total commander: will show in a iexplore window inside lister (fast!)
4. Copy chunck you want
5. Paste into oneNote

Since onenote understands html. the syntax is there!

This may work with variations of browser/file manager/editor.

urlwolf

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,837
    • View Profile
    • Donate to Member
If you find a more streamlined solution let me know!

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Well I have a couple of solutions..

I use a couple of programs for different types of code. I use ToDoList from abstract spoon to manage my projects. It's notes are in RTF and sometimes I want to add small bits of code to the todo note for documentation reasons. So I use highlight with a command script from the prompt that takes the source file as a param and converts it to an rtf file that I feed to Wordpad and then just copy from there and paste into whatever RTF textarea I want. The command file looks like this:

@echo off
highlight -i %1 -o c:\work\hilight.rtf --outdir c:\work -R -D %UTILS%\tidy\WinHighlight --font-size 12 --font ProggyTinyTTSZ -s wsd_Typical
start c:\work\hilight.rtf

I also use evernote with the same process.

You can find highlight here: http://www.andre-simon.de/

I also use DevProject Manager to store and manage snippets with syntax highlighting, more info here:

http://www.portablef...om/?id=1273#comments

I use to use CodeDepot from Shingel Software, but that project has been dead for a while now..

Anybody else know of any really good code snipped database apps..

You know.. with the scintilla syntax aware control and the sqlite lib it would not be too hard to put together a pretty portable solution based on open source libs, I use the Scintilla control in a few WTL based apps for displaying embedded scripting syntax errors, and it works like a charm. It's the same control that notepad++ uses for it's editor :D
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

urlwolf

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,837
    • View Profile
    • Donate to Member
Great, Thanks ChankTrauma.

I also use todoList.
Unfortunately, highlight doesn't support some languages I'm working with.

I have a faster way of doing the same thing, but avoiding vim.

1) use syn2, a lister plugin for TC. assign a shortcut for 'export as html'
2) press shorcut ctrl q to see file in lister. press shortcut to dump html
3) view html dump in lister with F3. copy chunk. Paste in onenote



ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Just found this while checking out the Syn2 plugin for FreeCommander

SynTree v0.5 coders sourcebook
download [838.16Kb | 2050]

Programm used to store code snippets. For a long time i was using TreePad Lite and always want to syntax highlight & code indenting. But i've not fount any such progs in internet, so i 've to write myself.

    * Features : Tree-like code snippets organizer
    * Highlights incuded : Apache conf, Assembler (x86), C++ Source, CSS, Delphi&CBuilder Form, Delphi, HGL, INI, JAVA, Java Script, MSDOS Batch, PERL, PHP, SQL (Standard), Text Files, VBS, VRML, Windows Registry Files, XHTML.
    * Autocomplete function names & function parameters hint (Need extention)
    * TreePad format support (text only)
    * Fast hide prog to tray by Esc, restore from tray - Win + T

http://sepa.spb.ru/?syn_eng
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

tamasd

  • Supporting Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 64
    • View Profile
    • Donate to Member
Source Code Library from Overzone Software seemed nice when I tested it, though it's a bit pricey at $80.

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
I've got Syn setup pretty nice with FreeCommander, it's a pretty nice solution for browsing source files, although it's a bit tricky to get working right, but the end result is pretty stable and it does copy in RTF to retain the syntax color for pasting in documents, which I like...

I did a pretty extensive search for snippet librarian tools, and both the commercial and freeware offerings are pretty lean. I wasn't really impressed with anything. A lot of them didn't do enough or did way too much..

God help me, but I'm actually thinking about throwing together my own solution to get what I want. Most of the major parts are there, it's just a matter of fleshing out the requirements and coding the glue to tie all the libs together.. Another project I have little to no time for that I know I'm going to get totally involved with..

I'll be sure to post my solution here, if it sees the light of day..

'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Sounds like the topicstart could do with a bit of autohotkey love? :)