Sublime Forum

Orgmode

#1

Hi folks,

here’s my shot on bringing Org-Mode (orgmode.org/) to Sublime Text 2. This project is still in very early development. Nobody knows what will come next :smile:. This won’t be a simple copycat of the original one. I want to “port” useful things in a way that works for Sublime Text 2. So there may also be things that aren’t in the original version or just behave more or less differently.

You can grab the code here:
bitbucket.org/theblacklion/sublime_orgmode/src

Please read the README.org file. Therein you’ll find infos on how to enable proper keyboard interaction and coloring the syntax elements.

I’m curious what you think about it…

Regards,
Oktay.

0 Likes

Improved productivity workflow
#2

I’m not familiar with orgmode but it does look very nice. And your plugin does works as advertised (in the readme.org).

I sent you a message on this board - you may want to check it.

0 Likes

#3

I’ve adapted your theme and found that links do not appear to be underlined - contrarily to what I would have assumed from:

<dict> <key>name</key> <string>orgmode link</string> <key>scope</key> <string>link.orgmode</string> <key>settings</key> <dict> <key>foreground</key> <string>#FB9A4B</string> <key>fontStyle</key> <string>underline</string> </dict> </dict>

I’m using a modified version of Twilight, on OSX.

0 Likes

#4

[quote=“aroberge”]I’ve adapted your theme and found that links do not appear to be underlined - contrarily to what I would have assumed from:
…]
I’m using a modified version of Twilight, on OSX.[/quote]

Yeah - it seems that Sublime doesn’t support this yet :frowning:. Or have you seen bold, italic or underline somewhere? I think, it’s not in there yet…

0 Likes

#5

[quote]
Yeah - it seems that Sublime doesn’t support this yet :frowning:. Or have you seen bold, italic or underline somewhere? I think, it’s not in there yet…[/quote]

I have not seen it done directly. The original SublimeLint plugin which I forked used the following hack (which I kept) to underline stuff:

[code] # To underline a region, we use a “hack” specific to SublimeText
# where we create a list of empty regions for each character
# which we want to underline. When drawing with
# sublime.DRAW_EMPTY_AS_OVERWRITE, such empty regions
# will appear as underlined.

	line = view.full_line(view.text_point(lineno, 0))
	position += line.begin()

	for i in xrange(length):
		underline.append(sublime.Region(position + i))[/code]

André

0 Likes

#6

[quote=“aroberge”]I have not seen it done directly. The original SublimeLint plugin which I forked used the following hack (which I kept) to underline stuff:
…[/quote]

Hmm… what a hack :smiley:. I’ld rather avoid such things and wait for Jon to implement the correct functionality. Also the hack inflicts a huge overhead - using the syntax highlighting should be much faster. Just think about an org file which contains about 100 links. How many regions would that require to be managed? Short: Maaaaaaaaany :unamused:

0 Likes

#7

Does someone know an equivalent to “open something” (OSX) or “cmd /c start something” (Windows) for Linux?

0 Likes

#8

Which type of external links would you like to use?

Currently I’ve support for:

  • Jira
  • FishEye
  • Crucible
  • mailto
  • local file
  • website

What else would you like to use (and is based on an URI)?

0 Likes

#9

Just updated orgmode. New are:

  • follow ups
  • linked headlines
  • reworked external link opener to support plugins
  • added plugins for Jira, FishEye, Crucible, Email, local files
  • added support for Windows in link opener

Have fun :smile:.

0 Likes

#10

[quote=“theblacklion”]Which type of external links would you like to use?

Currently I’ve support for:

  • Jira
  • FishEye
  • Crucible
  • mailto
  • local file
  • website

What else would you like to use (and is based on an URI)?[/quote]

How about being able to open, within sublimetext, a local file at a given line number? Perhaps something like

[sublimetext://full_path?line=nb]]
0 Likes

#11

[quote=“aroberge”]How about being able to open, within sublimetext, a local file at a given line number? Perhaps something like

[sublimetext://full_path?line=nb]]

Just do [path/to/file.py:30]] or [path/to/file.py:30:5]]. The first param is the line, the second the column.
Just make sure that the file pattern is in FORCE_LOAD_DEFAULT or extend it by overwriting the setting. See file header of resolver/local_file.py for details. This will be handy for our search results :wink:.

Do you think we need this [sublimetext:/path/to/file]] notation? If there’s real need (use cases?) for it I could put this into local_file.py to signalize a forced load…

0 Likes

#12

The installation instructions say “Put the following into your theme file:”

What file is the theme file? I found “Packages/Theme - Default/Default.sublime-theme”, but that doesn’t have XML in it.

I’m also not sure how to start using this: I cloned the repository, and renamed it from “sublime_orgmode” to “orgmode”. I open a .org file and nothing interesting happens.

0 Likes

#13

The color schemes one can use in Sublime have the extension .tmTheme. I’ll change the the text to lay more weight on the term “color scheme”.
If you don’t add this to your color scheme you won’t see any syntax highlighting within .org files.
For example the color scheme “Monokai Bright” can be found in: Packages/Color Scheme - Default/Monokai Bright.tmTheme

As stated above you really have to make sure to add the color definitions into your .tmTheme file.
Then you should read the two lists below “* Features” within the README.org. The first part explains which elements exist and the second how to interact with them.
For starters you should play around with the README.org file. It demonstrates nearly all implemented elements.

0 Likes

#14

Just a little teaser on what I’m currently working at… ascii tables:
dl.dropbox.com/u/587049/Sublime% … tables.png

0 Likes

#15

I just tried it in Sublime 2 and got two problems: enter did not toggle checkboxes nor opened links. I have not tested it thoroughly so there might be more problems.

I have fixed those two in my fork bitbucket.org/rchl/sublime_orgmode/changesets

BTW. One question. I’ve looked at Readme.org and noticed that items that have child items with checkbox have counter ([0/1]). Is this supposed to be automatically added and updated?

Never mind. Counters work and are updated automatically if it’s added.

0 Likes

#16

Very nice, thanks!

i had problems with “enter” not working, applied Rafal Chlodnicki patches on bitbucket, and started working.

also tried this;
[sublimetext.com/forum/viewtopic.php?f=5&t=1838&p=18483#p18483]]

not working as expected ;p

0 Likes

#17

I cant get this plugin to work.

i am getting the following error in sublime console:

File “.\orgmode.py”, line 32, in find_resolvers
import(name)
ImportError: Import by filename is not supported.

Any help is much appreciated

UPDATE: i applied a patch mentioned at bitbucket and now the plugin is almost working. Resolvers however are not working :-/

0 Likes

#18

I love this addon, and I use it daily.

On my new system, however, it keeps ctrl+/ (comment line) from working in other file modes.

[code]To Recreate:

  1. Download Sublime Text 2 (2139) on linux
  2. Open Sublime
  3. Change mode to python
  4. Type a line and Ctrl+/ – notice the line is commented out
  5. Run: ~/.config/sublime-text-2/Packages$ hg clone https://bitbucket.org/theblacklion/sublime_orgmode
  6. Now attemp to Ctrl+/ – notice nothing happens[/code]
0 Likes

#19

I fixed some stuff for windows, probablly broken stuff on other os’s.

Forked to github and and included some fixes from other people in this thread.

Hope anyone find it useful.

https://github.com/danielmagnussons/orgmode

Biggest changes is;

0 Likes

#20

I am using ormode on my Windows system, and opening links takes a very long time. Is this just my experience?

0 Likes