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.
- first find out scope of caret position (
bundles -> bundle development -> show scope). shouldsource.ruby string.quoted.double.ruby. - then create snippet contains newline , tab.
- 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
Post a Comment