www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Are people using textmate for D programming?

reply "Stephan Schiffels" <stephan_schiffels mac.com> writes:
Hi everyone,

I would like to get an idea how many people are using Textmate as 
editor in Mac OS X. I am keen to improve the current bundle. 
Especially the syntax highlighting seems to be stuck somewhere in 
D1 or so... also, it'd be great to have some command to run 
unittests and code-coverage...

I can just proceed and suggest improvements (the bundle is on 
github), but learning about other people using it would increase 
my motivation :-)

Stephan
May 18 2013
next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2013-05-18 13:41, Stephan Schiffels wrote:
 Hi everyone,

 I would like to get an idea how many people are using Textmate as editor
 in Mac OS X. I am keen to improve the current bundle. Especially the
 syntax highlighting seems to be stuck somewhere in D1 or so... also,
 it'd be great to have some command to run unittests and code-coverage...

 I can just proceed and suggest improvements (the bundle is on github),
 but learning about other people using it would increase my motivation :-)

 Stephan

I'm using it. I have made some improvements to the bundle as well. I have updated the build and run commands. The build command will look for a shell script in the project with the name "build.sh". The run command will do the same but look for "run.sh". If no run.sh file exists it will run RDMD on the current file. Both commands will properly handle compile errors and runtime exceptions by creating links back to the source code. Unfortunately I never made the changes under source control. But I put the whole bundle here: https://dl.dropboxusercontent.com/u/18386187/D.tmbundle.zip Note, this bundle is for TextMate 1.5, if there's any difference. -- /Jacob Carlborg
May 18 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-05-18 16:05, Stephan Schiffels wrote:
 thanks for sharing. I am using TM2 (https://github.com/textmate), and I
 think it might make a difference. Anyway, I think I will try to
 reanimate the github bundle. You could think about committing your
 changes to it.

I might do that. -- /Jacob Carlborg
May 18 2013
prev sibling next sibling parent "Stephan Schiffels" <stephan_schiffels mac.com> writes:
thanks for sharing. I am using TM2 (https://github.com/textmate), 
and I think it might make a difference. Anyway, I think I will 
try to reanimate the github bundle. You could think about 
committing your changes to it.

Stephan


On Saturday, 18 May 2013 at 13:22:11 UTC, Jacob Carlborg wrote:
 On 2013-05-18 13:41, Stephan Schiffels wrote:
 Hi everyone,

 I would like to get an idea how many people are using Textmate 
 as editor
 in Mac OS X. I am keen to improve the current bundle. 
 Especially the
 syntax highlighting seems to be stuck somewhere in D1 or so... 
 also,
 it'd be great to have some command to run unittests and 
 code-coverage...

 I can just proceed and suggest improvements (the bundle is on 
 github),
 but learning about other people using it would increase my 
 motivation :-)

 Stephan

I'm using it. I have made some improvements to the bundle as well. I have updated the build and run commands. The build command will look for a shell script in the project with the name "build.sh". The run command will do the same but look for "run.sh". If no run.sh file exists it will run RDMD on the current file. Both commands will properly handle compile errors and runtime exceptions by creating links back to the source code. Unfortunately I never made the changes under source control. But I put the whole bundle here: https://dl.dropboxusercontent.com/u/18386187/D.tmbundle.zip Note, this bundle is for TextMate 1.5, if there's any difference.

May 18 2013
prev sibling next sibling parent reply "TommiT" <tommitissari hotmail.com> writes:
On Saturday, 18 May 2013 at 11:41:22 UTC, Stephan Schiffels wrote:
 Hi everyone,

 I would like to get an idea how many people are using Textmate 
 as editor in Mac OS X. I am keen to improve the current bundle. 
 Especially the syntax highlighting seems to be stuck somewhere 
 in D1 or so... also, it'd be great to have some command to run 
 unittests and code-coverage...

 I can just proceed and suggest improvements (the bundle is on 
 github), but learning about other people using it would 
 increase my motivation :-)

 Stephan

I've started using TextMate recently. I added some code snippets, but don't really know anything about the bundle stuff. Fumbling in the dark I managed to change the bundle indentation rules to make switch cases indent to the switch column, and I added some missing keywords for syntax highlighting though. Any improvements to the bundle highly appreciated.
May 18 2013
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/25/13 5:08 AM, TommiT wrote:
 I just tried out Sublime Text 2 and found it to be quite similar but
 somewhat better than TextMate 2. And there's an improved D syntax
 highlighter for it at: https://github.com/alexrp/st2-d

 All the keywords seem to be there, indentation works etc.

 Sublime Text does from time to time annoy you about buying the license,
 but luckily there's google.

OK, you convinced me to try. But my SublimeText OSX installation does not contain the D.tmPackage file described at https://github.com/alexrp/st2-d. Where do I put it? Thanks, Andrei
May 25 2013
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/25/13 7:01 PM, TommiT wrote:
 On Saturday, 25 May 2013 at 12:56:02 UTC, Andrei Alexandrescu wrote:
 OK, you convinced me to try. But my SublimeText OSX installation does
 not contain the D.tmPackage file described at
 https://github.com/alexrp/st2-d. Where do I put it?

 Thanks,

 Andrei

I found it through: Sublime Text 2 -> Preferences -> Browse Packages... That opens finder at ~/Library/Application Support/Sublime Text 2/Packages/ There's a folder called D, which holds D.tmLanguage file among other things. I just replaced that and removed D.tmLanguage.cache file and restarted ST2 to force a refresh.

Thanks! Did that. What can I do to make sure I have the right config? Andrei
May 25 2013
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/25/13 7:31 PM, TommiT wrote:
 I knew the config had updated due to the fact that keyword pure was
 colored like a keyword. In the default config file that was one of the
 keywords missing. Also you can check that ST -> View -> Syntax has 'D'
 checked when a d-file is open.

Yay to that, looks like my install is in good shape. I guess I'll pester y'all with more question. You know what would be awesome? If we had a DDoc (sic!) mode for Sublime Text whenever .dd documents are opened. Also, is it possible to switch to an alternative syntax inside D comments? Andrei
May 25 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-05-26 02:33, Andrei Alexandrescu wrote:

 Also, is it possible to switch to an alternative syntax inside D comments?

I would guess so. At least it's possible in TextMate. You would probably need a specific character to indicate that the text that would follow should be parsed as a different language. -- /Jacob Carlborg
May 27 2013
prev sibling next sibling parent "Stephan Schiffels" <stephan_schiffels mac.com> writes:
On Saturday, 18 May 2013 at 16:16:50 UTC, TommiT wrote:
 On Saturday, 18 May 2013 at 11:41:22 UTC, Stephan Schiffels 
 wrote:
 Hi everyone,

 I would like to get an idea how many people are using Textmate 
 as editor in Mac OS X. I am keen to improve the current 
 bundle. Especially the syntax highlighting seems to be stuck 
 somewhere in D1 or so... also, it'd be great to have some 
 command to run unittests and code-coverage...

 I can just proceed and suggest improvements (the bundle is on 
 github), but learning about other people using it would 
 increase my motivation :-)

 Stephan

I've started using TextMate recently. I added some code snippets, but don't really know anything about the bundle stuff. Fumbling in the dark I managed to change the bundle indentation rules to make switch cases indent to the switch column, and I added some missing keywords for syntax highlighting though. Any improvements to the bundle highly appreciated.

Ah that's cool. Why don't you fork the repo and send a pull request with these changes? It's pretty much these small changes (keywords, indentation) that I had in mind... they add up over time. Stephan
May 18 2013
prev sibling next sibling parent "TommiT" <tommitissari hotmail.com> writes:
I just tried out Sublime Text 2 and found it to be quite similar 
but somewhat better than TextMate 2. And there's an improved D 
syntax highlighter for it at: https://github.com/alexrp/st2-d

All the keywords seem to be there, indentation works etc.

Sublime Text does from time to time annoy you about buying the 
license, but luckily there's google.
May 25 2013
prev sibling next sibling parent "Michael" <pr m1xa.com> writes:
 OK, you convinced me to try. But my SublimeText OSX 
 installation does not contain the D.tmPackage file described at 
 https://github.com/alexrp/st2-d. Where do I put it?

 Thanks,

 Andrei

ST2 and ST3 have built-in D Syntax highlighting. ST3 now in the beta stage, but have improved mac os x support. ST3 beta for registered users only, but it's worth the money.
May 25 2013
prev sibling next sibling parent "Michael" <pr m1xa.com> writes:
 Where do I put it?

 Thanks,

 Andrei

http://docs.sublimetext.info/en/latest/extensibility/syntaxdefs.html
May 25 2013
prev sibling next sibling parent "TommiT" <tommitissari hotmail.com> writes:
On Saturday, 25 May 2013 at 12:56:02 UTC, Andrei Alexandrescu 
wrote:
 OK, you convinced me to try. But my SublimeText OSX 
 installation does not contain the D.tmPackage file described at 
 https://github.com/alexrp/st2-d. Where do I put it?

 Thanks,

 Andrei

I found it through: Sublime Text 2 -> Preferences -> Browse Packages... That opens finder at ~/Library/Application Support/Sublime Text 2/Packages/ There's a folder called D, which holds D.tmLanguage file among other things. I just replaced that and removed D.tmLanguage.cache file and restarted ST2 to force a refresh.
May 25 2013
prev sibling next sibling parent "TommiT" <tommitissari hotmail.com> writes:
On Saturday, 25 May 2013 at 23:18:22 UTC, Andrei Alexandrescu 
wrote:
 On 5/25/13 7:01 PM, TommiT wrote:
 On Saturday, 25 May 2013 at 12:56:02 UTC, Andrei Alexandrescu 
 wrote:
 OK, you convinced me to try. But my SublimeText OSX 
 installation does
 not contain the D.tmPackage file described at
 https://github.com/alexrp/st2-d. Where do I put it?

 Thanks,

 Andrei

I found it through: Sublime Text 2 -> Preferences -> Browse Packages... That opens finder at ~/Library/Application Support/Sublime Text 2/Packages/ There's a folder called D, which holds D.tmLanguage file among other things. I just replaced that and removed D.tmLanguage.cache file and restarted ST2 to force a refresh.

Thanks! Did that. What can I do to make sure I have the right config? Andrei

I knew the config had updated due to the fact that keyword pure was colored like a keyword. In the default config file that was one of the keywords missing. Also you can check that ST -> View -> Syntax has 'D' checked when a d-file is open.
May 25 2013
prev sibling next sibling parent "TommiT" <tommitissari hotmail.com> writes:
And, to make caseS and default of a switch indent to the same 
column as the switch, I made a small modification to the file 
"~/Library/Application Support/Sublime Text 
2/Packages/D/Indentation Rules.tmPreferences" and, again deleted 
the "Indentation Rules.tmPreferences.cache" file and restarted 
ST2. This is what my "Indentation Rules.tmPreferences" file 
contains now and it seems to work, but take it with a grain of 
salt, since I don't really know what I'm doing:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>name</key>
	<string>Indentation Rules</string>
	<key>scope</key>
	<string>source.d</string>
	<key>settings</key>
	<dict>
		<key>decreaseIndentPattern</key>
		<string>^(.*\*/)?\s*\}([^}{"']*\{)?[;\s]*(//.*|/\*.*\*/\s*)?$|^\s*(public|private|protected):\s*$|^\s*(case\s+[^:]*|default\s*):.*$</string>
		<key>increaseIndentPattern</key>
		<string>^.*\{[^}"']*$|^\s*(public|private|protected):\s*$|^\s*(case\s+[^:]*|default\s*):.*$</string>

		<key>bracketIndentNextLinePattern</key>
		<string>(?x)
		^ \s* \b(if|while|else|foreach)\b [^;]* $
		| ^ \s* \b(for)\b .* $
		</string>

	</dict>
	<key>uuid</key>
	<string>7C8F9C84-7DCC-4DD7-B32E-A638F322199F</string>
</dict>
</plist>
May 25 2013
prev sibling next sibling parent Timothee Cour <thelastmammoth gmail.com> writes:
--001a11c2ce162c138104dd943212
Content-Type: text/plain; charset=ISO-8859-1

what about for ST3? there's no ~/Library/Application\ Support/Sublime\
Text\ 3/Packages/D

On Sat, May 25, 2013 at 4:01 PM, TommiT <tommitissari hotmail.com> wrote:

 On Saturday, 25 May 2013 at 12:56:02 UTC, Andrei Alexandrescu wrote:

 OK, you convinced me to try. But my SublimeText OSX installation does not
 contain the D.tmPackage file described at https://github.com/alexrp/st2-*
 *d <https://github.com/alexrp/st2-d>. Where do I put it?

 Thanks,

 Andrei

I found it through: Sublime Text 2 -> Preferences -> Browse Packages... That opens finder at ~/Library/Application Support/Sublime Text 2/Packages/ There's a folder called D, which holds D.tmLanguage file among other things. I just replaced that and removed D.tmLanguage.cache file and restarted ST2 to force a refresh.

--001a11c2ce162c138104dd943212 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable what about for ST3? there&#39;s no=A0~/Library/Application\ Support/Sublime= \ Text\ 3/Packages/D<br><br><div class=3D"gmail_quote">On Sat, May 25, 2013= at 4:01 PM, TommiT <span dir=3D"ltr">&lt;<a href=3D"mailto:tommitissari ho= tmail.com" target=3D"_blank">tommitissari hotmail.com</a>&gt;</span> wrote:= <br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div class=3D"im">On Saturday, 25 May 2013 a= t 12:56:02 UTC, Andrei Alexandrescu wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> OK, you convinced me to try. But my SublimeText OSX installation does not c= ontain the D.tmPackage file described at <a href=3D"https://github.com/alex= rp/st2-d" target=3D"_blank">https://github.com/alexrp/st2-<u></u>d</a>. Whe= re do I put it?<br> <br> Thanks,<br> <br> Andrei<br> </blockquote> <br></div> I found it through: Sublime Text 2 -&gt; Preferences -&gt; Browse Packages.= ..<br> <br> That opens finder at ~/Library/Application Support/Sublime Text 2/Packages/= <br> <br> There&#39;s a folder called D, which holds D.tmLanguage file among other th= ings. I just replaced that and removed D.tmLanguage.cache file and restarte= d ST2 to force a refresh.<br> </blockquote></div><br> --001a11c2ce162c138104dd943212--
May 25 2013
prev sibling parent "TommiT" <tommitissari hotmail.com> writes:
On Sunday, 26 May 2013 at 00:34:46 UTC, Timothee Cour wrote:
 what about for ST3? there's no ~/Library/Application\ 
 Support/Sublime\
 Text\ 3/Packages/D

According to: http://www.sublimetext.com/docs/3/packages.html ...you create a new folder called "D" under the: "~/Library/Application Support/Sublime Text #/Packages/" folder and put the "D.tmLanguage" file to that "D" folder and it should override the default one.
May 25 2013