how do you align javascript : assignments in textmate?
I see that = assignments are aligned with the keyboard shortcut, but couldn't find a way to align : assignments.
You need a bundle aptly named Align.
The semicolon is not really an assignment operator: it's beter to see it as a separator between a key ans its value.
Related
I am trying to use a double underscore "__" as word separator in Sublime Text 3. That means, I want the following to be selected by a double click (selection indicated by brackets):
(bar_foo)
(hello)__(world)
Is that possible? My first guess is "no", because nothing is specified in Preferences.sublime-settings, but maybe one of you guys knows a way to make this work?
Thanks in advance!
PS: I already had a look at some questions here at SO (e.g. Removed hyphen from word_separators, ctrl+d no longer makes sense and Sublime Text and Hypens vs Underscores), but they don't answer this specific question.
Edit: In case you're wondering, I want this because I want to select variables like bar_foo_counter but I also want to use double underscores for my CSS modifier classes, like bar__inner.
If you are a notepad++ user you will understand what I want Xcode to do for me , it's very simple I want when i place the cursor before or after a Braces, Parentheses, and Brackets , it highlight for me its pair to know the matching ones juste try to place the cursor in notepad++ and tell me how to do that in Xcode i know already the trick of the right arrow of the keyboard and the double click but the trick of notepad++ is faster , thanks in advance
The only thing I can add (and I have looked a fair bit) is to train your eyes on the vertical grey bar on the left edge of the editor, called the "code folding ribbon" in preferences. It will visually hint at matching braces (not parenthesis) at all nested levels, and mousing over it hints quite strongly and gives the interface for folding.
See here for a snapshot and brief description from Apple.
I have a specific language (its private, and closed source) that I'm writing code highlighting for in Notepad++. I've never done anything like this before... so, for the most part, I'm clueless.
There are a bunch of keywords, and I've figured out how to implement those, but the strings are denoted by square brackets ([ and ]) instead of normal quotes. How do I register those as strings in the XML file?
Another thing, the language relies heavily on recursion and nesting; is there some way to say "Level 1 of the square brackets is this color, level 2 is this color, etc..."?
There's a useful help page that explains how to use the GUI to define a custom language for Notepad++. As Alex K noted in a comment above, the option for setting string delimiters appears to be in the Delimiters boxes in the Operators tab. It doesn't look like it supports different colours for different levels of nesting, though.
Update for those who have been asking the same question:
(Temporary) Documentation for custom syntax highlighting is on: http://udl20.weebly.com/index.html
There is a link to this in Notepad++ but it doesn't stand out.
I had log4net files that I wanted to view in Notepad++. They contained lines like:
2015-06-03 16:38:10,751 [Compname][Thread:29][FATAL]
To highlight [FATAL] just the keyword list wasn't enough. I added this:
On tabpage "Folder & Default" > Folding in code style 1: >
Open: [
Close: ]
On tabpage "Keyword lists" > 1ste group > FATAL with some styling.
example:
Array = Range[1000]
I'll see 1000 numbers. Could I hide this output?
In Maple this problem solve by adding a ":" at the end.
First, in Mathematica you should not use capitalized variable names. The value "Array" is a built in function and Mathematica will not let you assign a value to it.
The answers above are completely correct, but there is another answer which some people might like. The Mathematica front end reformats output that it thinks might be hard to read. For example,
array = Range[100000]
will not print a giant list but instead will print:
"A very large output was generated. Here is a sample of it:"
It will then show only the beginning and end of the list with an ellipsis of sorts. Try it out. You will find 4 buttons beneath the output reading:
"Show Less", "Show More", "Show Full Output", "Set Size Limit..."
Their meaning is pretty clear. You can change Mathematica's option which tells it at what size to consider the output too big to put on the screen.
You can find this option by clicking on "Set Size Limit" or by going to the Evaluation Tab in the Preferences menu. The Preferences menu is found under Edit>Preferences or Mathematica>Preferences if you are using a Mac. In this dialog you will find a field called "Maximum output size before truncation". Here you can specify the number of bytes Mathematica can put on the screen before it should truncate your input for easier use.
Array = Range[1000];
The ";" hides the results in Mma.
HTH!
End the command in a ; like so:
Array = Range[1000];
Useful links:
The Mathematica help page on ;
you put a semicolon at the end. (eg: ar=Range[1000];)
Is there a way to write the ∴ therefore symbol with keyboard shortcuts in Textmate or just on a mac?
If you want to do this often, you can create a keybindings file in your Library to map it to a key combination.
In ~/Library create a directory named KeyBindings. Create a file named DefaultKeyBinding.dict inside the directory. You can add key bindings in this format:
{
"x" = (insertText:, "\U23CF");
"y" = (insertText:, "hi"); /* warning: this will change 'y' to 'hi'! */
}
The LHS is the key combination you'll hit to enter the character. You can use the following characters to indicate command keys:
# - Command
~ - Option
^ - Control
You'll need to look up the unicode for your character (in this case, ∴ is \U2234). So to type this character whenever you typed Control-M, you'd use
"^m" = (insertText:, "\U2234");
You can find more information here: http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html
First you use a full stop, then you hold down alt and press the letter H and put in another full stop.
.˙.
From System Preferences, turn on the "Show Keyboard & Character Viewer in menu bar" setting.
Then, the "Character Viewer" menu will pop up a tool that will let you search for any unicode character (by name) and insert it ∴ you're all set.
If using WORD for mac
enable 'use maths autocorrect rules outside maths regions'
Type \therefore
If you are trying to insert the therefore symbol into a WORD DOCUMENT
Hold down the ALT key and type 8756
Hope the answer ur question
Regards Al~Hash.