开发者

Can TextMate be changed to "shift text to right" by highlighting text and pressing Tab?

Can TextMate be changed to "shift text to right" by highlighting t开发者_开发技巧ext and pressing Tab?

Right now it actually replace the whole selected text with a tab character but I almost never want to do something like that. I think some other editors like Notepad++ will indent to the next level.


Cmd + ] will shift text to the right.

If you really want to use Tab for that, then make a new command in the bundle editor and paste this in:

#!/usr/bin/env ruby
$: << ENV['TM_SUPPORT_PATH'] + '/lib'
require 'escape'
def esc(str)
  e_sn(str).gsub(/\}/, '\\}') # escaping inside a placeholder
end

s = STDIN.read
if s.empty? then
  print "\t"
else
  print "\t#{e_sn s}"
end

Then set the key equivalent to Tab.


Alt+Tab works too.

Lorem ipsrum at least 30 chars..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜