All posts in TextMate

Multiple line support in SublimeTask

[废话]
鄙人新一年有个小计划,那便是需要开始protect起自己的private personal time,过去的一年因为工作牺牲了太多的个人时间,这样的策略抑或无奈是物有所值还是得不偿失需要被重新审视和评估;

==================== 废话的分割线 ====================

[Introduction]
Check out this introductory post if you don’t know what is SublimeTask.

[Overview]
Let’s keep it simple and short this time, since it’s very late now :(.

As issue #3 indicated, previous version of SublimeTask lacks the feature of multiple line support, this update just addressed this issue and addressed it well.

2 kinds of multiple types are now supported:

  • Multiple selections (hold ⌘ during multiple selections, one key fancy feature of Sublime Text)
  • One selection with multiple lines (this should be self explanatory)

So from now on you should be able to mark multiple tasks as completed/incomplete in just one shot, enjoy!
Continue reading →

Highlight URL in SublimeTask

[Redirection]
Check out this introductory post if you don’t know what is SublimeTask.

[Overview]
As this issue ticket indicated, people want the url (http, https, ftp etc) to be processed and displayed differently in SublimeTask.

Although opening url link in default browser is possible and actually turns out to be fairly simple, I still haven’t fully made my mind whether I want this functionality goes in or not, cuz it sounds like a separate project/plugin. Anyway, it’s really a nice-to-have feature, I will be glad to add this in in the future, either directly built in or as a separate plugin.

In this update/patch, what I did is just highlighting the url. One screenshot should be enough to tell the whole story.

[Screenshot]

Note all the url above are highlighted.

[Customization]
As always, check out the “Customization” section here should you need to customize the url display style.

Introducing SublimeTask (GTD)

[Overview]
We already have Vim-Task, now we need one task plugin for Sublime Text 2.

[Screenshot]
As always, I’m a fan of the mac default font monaco, unfortunately it doesn’t support bold and italic:

If you use font (e.g. Consolas) which support bold and italic and your current color scheme also support these highlighting, you can config the “scope” to display whatever style you want (see Customization section below).

[Code Repository]
github: https://github.com/samsonw/SublimeTask
Continue reading →

我的SQL.tmbundle fork

今天两篇post之后,还是对wordpress 3.2的full screen editor爱不释手 i,所以再来一篇……;这不是0day,所以请expect一切都会可能有延迟.

话说这还是上周一的事情了……

插入一个闪回:
我平时一般工作或是自己开发都开着两个editor,一个是macvim,这个目前看来是完全为了vim-task了,我用它来GTD;另外一个是textmate,我大部分的code,除了java和obj-c外 ii都是在textmate里面完成;可能你会觉得好奇,话说这已经牵涉到信仰的问题了,要知道textmate是我两年前我买mac的first bullet,如果抛弃textmate,我两年前的行为就似乎失去了意义;请不要告诉我mac的ui怎么怎么fancy,界面怎么怎么友好,我不是果粉,这些对我其实都没有杀伤力;我更不是那些个喜欢抱着macbook pro在星巴克靠窗的座位前展现各种独特品味的伙计,话说我到非常希望我能有如此的定力……

闪回完了回来,回到上周一;如果你像我这样用textmate编辑维护总和超过10000+行的 sql stored procedure (单文件3000+行)iii 代码,你会明白textmate默认自带的SQL.tmbundle其实做的蛮烂的,作为一种语言的bundle,它竟然不支持symbol list,这让本身在TM里面navigate就不方便的用户情何以堪……

一般语言定义的function或是method都会被作为symbol list的item,方便用户直接跳转到该function/method的definition处;没有symbol list的情景下,这意味着你只能search,还要人为或自动的filter掉一些不是definition的match字串,这在你debug的正high,正心急如焚抑或火冒三丈的时候,无疑不是种尴尬,接下来便是不情愿的敲上 ⌘ + F,然后嘴里嘀咕着:”人生啊”;这,就是我上周一之前一直的状态……
Continue reading →

[Footnotes]
  1. 美中不足,fullscreen模式下少一个preview的按钮,但瑕不掩瑜 []
  2. java当然eclipse了,obj-c更是当仁不让于xcode []
  3. for the record, 这是postgresql的pl/pgsql代码 []

From TextMate to MacVim: Markdown File Editing

Sunng号召大伙用markdown书写文档,这里积极响应一下~

TextMate out of box bundle了Markdown.tmbundle,所以默认就支持markdown file syntax,vim里面貌似默认没有那么幸运,也不是很确定,不过anyway,vim里面的default就是让你改的…

[Markdown Syntax Support]
具体markdown的syntax可以参见这里,这里不赘述。
市面上找到了不少关于vim markdown syntax的plugin(这个算不算是vim user幸福的烦恼?):
1. http://www.vim.org/scripts/script.php?script_id=1242 (http://github.com/plasticboy/vim-markdown)
2. http://github.com/tpope/vim-markdown
3. http://github.com/hallison/vim-markdown
4. http://github.com/mikewest/vim-markdown

make your choice then install it,你选择,你喜欢.

[Markdown Preview Support]
TextMate有个很nice的markdown preview功能,截图如下:


Continue reading →

From TextMate to MacVim: Introduce Vim-Task (GTD)

[ Update: Vim-Task 1.1 was released, the latest version can be downloaded here. ]

Introduce a recently written vim plugin for GTD, basically it’s just the TextMate Tasks Bundle port for Vim.

[Screenshot]
I like the Mac default font Monaco, unfortunately it doesn’t support bold and italic:

If use font like Consolas which support bold and italic, all the syntax highlights should take effect:

Continue reading →

TextMate’s magic: bundles, customized commands, snippets and macros recording

之前尝试过一段时间macvim后又转回了TextMate,想来我还是一个比较visual的人。都说“真正的程序员”都是用vi或是emacs的,不过有时候看着东西想用鼠标点却不能点,必须脑子里去想一下命令或是什么shortcut有时是不是也太隔靴搔痒了,这和五笔输入法其实很类似,重码少很高效很快速,但中断思路… 就是这么一个道理。
不过用久了也确实不排除熟能生巧的,所以我也对上面那句所谓的名言没有任何意见,比如退出vim的:q我基本不用思考 :)

好了闲话又扯远了……

[Bundles]
bundle应该是TextMate里名气最大的了,如果你熟悉eclipse的话,bundle其实和eclipse的plugin很像,虽然textmate也有plugin但bundle的应用显然要更为广泛,之于历史,特性,比较之类的请交给google,这不是我们这儿的focus。
一般TextMate一个release都会built-in一堆广泛使用并口碑较好的bundle,好的bundle很多以至于我本人从来是都是觉得bundle太多太眼花了,其实真正经常用到的bundle就这么几个,于是bundle的更新倒是成了更大的问题,好在TextMate继承了*nix的传统,会优先读取user home下的bundle,问题的解决于是变的异常之trivial。
以TextMate的ruby on rails bundle为例,安装只要几行命令:

mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/drnic/ruby-on-rails-tmbundle.git "Ruby on Rails.tmbundle"
osascript -e 'tell app "TextMate" to reload bundles'

下次更新只要git pull一下然后tell textmate to reload bundles就万事大吉了。
Continue reading →