how to auto-ident in Textmate similar to Emacs -


how auto-indent in textmate similar effect of code under emacs:

(defun set-newline-and-indent ()   (local-set-key (kbd "ret") 'newline-and-indent)) (add-hook 'c-mode 'set-newline-and-indent) 

i.e. don't want hit return, tab indent. want hit return , have textmate automatically indent correct location based on language.

thanks hints.

textmate should automatically. if if doesn't, can create custom macro, command, or snippet in bundle editor you.

  1. first find out scope of caret position (bundles -> bundle development -> show scope). should source.ruby string.quoted.double.ruby.
  2. then create snippet contains newline , tab.
  3. then assign snippet mentioned scope , assign shortcut.

if done correctly, shortcut should trigger bundle item in assigned scope instead of inserting new line.

look inside bundle editor @ css -> properties {}(}) bundle item example.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -