ATOM how to enable selecting "$" symbol along with the variable name? - atom-editor

I am using ATOM as my IDE. Whenever I double click on a variable it selects only the variable name and leaves out $. For example, if I double click on variable $var it will only highlight var and $ will not get highlighted. I am using the default nonWordCharacters in settings /\()"':,.;<>~!##$%^&*|+=[]{}?-…. How can I enable highlighting the whole variable including the $ sign?

That's very simple. I believe currently you are trying to mess with "Non Word Characters" under Settings > Editor > Non Word Characters. Which is wrong. Leave that as it is (default). Changing that will have no effect. You need to change the "Non Word Characters" value under your preferred programming language's language preferences. Assuming that you are using PHP (since PHP is the language that uses $ symbol to define a variable name), please follow the steps below:
Navigate to Settings > Packages > Search for language-php
Click on settings
Scroll down to find "Non Word Characters"
Remove $ symbol from the list of the characters
That's it. Done! Now double clicking will select whole variable including the $ symbol. If you are using any other language instead of PHP just make sure to search for language-yourlanguagename in the first step above.

Related

Define global variables

I'm trying to test some algorithms in LibreOffice Calc and I would like to have some global variables visible in all cell/sheets. I searched the Internet and all the posts I have seen are so cryptic and verbose!
What are some simple instructions of how can I do that?
Go to Sheet → Named Ranges and Expressions → Define. Set name to "MyVar1" and expression to 5. Or for strings, use quotes as in "foo". Then press Add.
Now enter =MyVar1 * 2 in a cell.
One strategy is to save the global variables you need on a sheet:
Select the cell you want to reference in a calculation and type a variable name into the 'Name Box' in the top left where it normally says the Cell Column Row.
Elsewhere in your project you can reference the variable name from the previous step:
Using user-defined functions should be the most flexible solution to define constants. In the following, I assume the current Calc spreadsheet file is named test1.ods. Replace it with the real file name in the following steps:
In Calc, open menu Tools → Macros → Organize Macros → LibreOffice Basic:
At the left, select the current document test1.ods, and click New...:
Click OK (Module1 is OK).
Now, the Basic IDE should appear:
Below End Sub, enter the following BASIC code:
Function Var1()
Var1 = "foo"
End Function
Function Var2()
Var2 = 42
End Function
The IDE should look as follows:
[![Enter image description here][5]][5]
Hit Ctrl + S to save.
This way, you've defined two global constants (to be precise: two custom functions that return a constant value). Now, we will use them in your spreadsheet. Switch to the LibreOffice Calc's main window with file test1.ods, select an empty cell, and enter the following formula:
=Var1()
LibreOffice will display the return value of your custom Var1() formula, a simple string. If your constant is a number, you can use it for calculations. Select another empty cell, and enter:
=Var2() * 2
LibreOffice will display the result 84.

inserting line breaks after every record in the textpad

I have a textpad file that has rows of text. For e.g.
Cat: Meaning - animal. The cat ran up the house
Rat: Meaning- rodent. The rat lives in the borough and feeds on leftovers
Word 3: Description
Word 4: Description
I have many such record in my file. I want to insert a line break at the end of every record for proper presentation. Doing it manually is tedious. Please help if you know an automated process to insert line break.
You can quickly do this by using a feature called "Regular Expressions" to find and add empty lines.
Open up the Find/Replace (Search menu > Replace)
In the "Find what" field, type the following: (^.+$)\n(^.+$)
In the "Replace with" field, type the following: \1\n\n\2
Tick the "Regular expression" checkbox
Click the Replace All button at least twice, but perhaps 3 times, until you get the message Cannot find the Regular Expression
Untick the "Regular expression" checkbox
Close the Replace dialog
Confirm the file is formatted as you are expecting
Save the file.
You can write a simple C# prgram that uses a loop that adds this code after every line :
But first add the namespace using System.Enviorment
Enviorment.NewLine;
If you have any more trouble i'll help with some code to get started
Open up the Find/Replace (Search menu > Replace)
In the "Find what" field, type the following so that the replace occurs at the end of each line: $
In the "Replace with" field, type the following. Note each 'n' represents a <return>. In this instance, I added a return at the end of a SQL statement, the word 'GO' on the next line and another <return>: \n\GO\n
Started with text file containing:
select * from <tablename>
select * from <tablename>
Ended with text file containing:
select * from <tablename
GO
select * from <tablename>
GO
Hope that helps.
from your text it is difficult to understand what you are intending to do. I'll give you some questions. The answers will help others to help you.
Do you really mean textpad as the product from company helios in UK or do you use this word as a general word for a class of tools (like notepad - but there is a general definition AND the tool as part of Windows).
Your file hase line breaks yet. You don't see them, but in the file itself they are present (in Unix systems line feed (hex code 0A) or in the windows world carriage return followed by line feed (hex code 0D 0A)).
Or would you like to publish your text in HTML? So you have to put the necessary tags around each line like paragraph, line break, list item etc.?

How can I disable string decoration (or however this is called) in Aptana?

When I mark a string within a php file and then type a ', ", ( or [, then the marked text will not be replaced by the typed in character. Instead it well be enclosed by '…', "…", …
I know this is a feature, of course. But I want to turn off this feature because I don't like it. Can you tell me how?
Window > Preferences > Aptana Studio > Editors - Deselect 'Wrap selected text with matching characters'.
This used to drive me crazy too, but it has grown on me.

Exclude dash (-) from word separators in vi

vi uses dash and space as word separators.
is there any way to exclude dash from word separators ?
This is required to work with the symbols generated by ctags exe.
when symbol contain a "-" ,vi tags fails to locate that even though symbol is generated properly.
For example
Symbol - EX01-VAR-LOCAL
when using the ctrl+] to search tag for this, vi looks only for EX01 not the complete symbol EX01-VAR-LOCAL
although if used with vi -t EX01-VAR-LOCAL or in command mode :tag EX01-VAR-LOCAL
works fine.
Thanks in advance :)
To unset dash as a word separator you have to set this as a normal character using 'iskeyword' setting.
If you look the default iskeyword content (using ":set all") you may have this:
iskeyword=#,48-57,_,192-255
The dash symbol is 45 in ASCII characters, so you have to set as normal character.
Try this:
set iskeyword=#,45,48-57,_,192-255
FZapp's answer is correct. The only thing I'd like to add is that looking at the content of iskeyword would be easier using :set iskeyword instead of :set all.

restricting character set in a Textinput field

I have a TextInput field that should be restricted to either capital letters, lowercase letters, numbers and underscores. This is the code I'm trying to use to restrict characters:
restrict="\\A-Z\\a-z\\0-9\\ \\_\\-"
I'm using MXML for this Textinput component.
Unfortunately this does not restrict the \ character, which is the last character I'd like to restrict.
How can I add the backslash to the list of restricted characters?
Thanks
Stephen
Actually found the solution I've amended the restrict code to:
restrict="A-Za-z0-9 _\-"
I took out all the back slashes which I thought or was using as delimiters.
Works fine now.

Resources