[TxMt] Re: How do you force carriage return after 80 characters?

Hans-Jörg Bibiko bibiko at eva.mpg.de
Sun Dec 20 22:06:50 UTC 2009


On 20.12.2009, at 22:00, Christopher Brewster wrote:

> in other words automate the process of automatically starting a new line after 80 characters.
> 
> I am sure there must be a setting somewhere .....

Hmm, I do not know whether the following could help you but maybe you play with it
[Is only a fast thought idea! ;) ]

- create a tmcommand in the Bundle Editor
input: none
output: discard
command:
if [ ${#TM_CURRENT_LINE} -gt $TM_COLUMNS ]; then
	osascript -e 'tell app "System Events" to keystroke " "' -e 'tell app "System Events" to keystroke "q" using (control down)' -e 'tell app "System Events" to keystroke " "'
else
	echo -en " "
	exit 203
fi

- bind that command e.g. to "space"

That command reformats the paragraph (^Q) if the current line length is greater than the wrap column setting (main menu > View > Wrap Column).



Cheers,
--Hans


More information about the textmate mailing list