Exclude dash (-) from word separators in vi - unix

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.

Related

What do these characters mean?(ANSI Code)

It's the code I'm printing with node:
const m = `[38;5;1;48;5;16m TEST`
console.log(m)
output:
It changes the text color.
As you can see `` is a special char I don't understand(It's not being shown by the browser). How does it work?
Is there any alternative for ESC?
As #puucee already mentions they are terminal control characters. I find it surprising that it says ESC[ in the code as that won't be escaped in normal node. I suspect that maybe your IDE is converting the "true" escape character to ESC. Node does not support octal escapes (such as \033), but hexadecimal escapes. That is, you string should usually be like this:
console.log('\x1b[38;5;1;48;5;16m TEST \x1b[0m')
These are terminal control characters. They are often used e.g. for coloring the output. Some are non-printable. Backticks ` in your javascript example are called template literals.

Why do I see the ASCII symbols in Notepad++?

(I am new with this) I see these weird black text-boxes and, as far as I know, they are ascii symbols, but I don't know how to see it in a "normal" view, if possible. Thanks in advance!
It was a bit hard to follow your link, I included the screenshot in your question. The ESC indicates a non-printable character. In this case it is the Escape character (ASCII 27), which from the screen shot appears to be part of escape sequences to change text color.
Unfortunately, Notepad++ does not have the means to render them as intended. One option is that you select one and find/replace with nothing. If you want to get rid of not only the ESC but also its associated "parameters" you can use this regular expression to find and replace them
\x1b[^m]*m

RegEx for Client-Side Validation of FileUpload

I'm trying to create a RegEx Validator that checks the file extension in the FileUpload input against a list of allowed extensions (which are user specified). The following is as far as I have got, but I'm struggling with the syntax of the backward slash (\) that appears in the file path. Obviously the below is incorrect because it just escapes the (]) which causes an error. I would be really grateful for any help here. There seems to be a lot of examples out there, but none seem to work when I try them.
[a-zA-Z_-s0-9:\]+(.pdf|.PDF)$
To include a backslash in a character class, you need to use a specific escape sequence (\b):
[a-zA-Z_\s0-9:\b]+(\.pdf|\.PDF)$
Note that this might be a bit confusing, because outside of character classes, \b represents a word boundary. I also assumed, that -s was a typo and should have represented a white space. (otherwise it shouldn't compile, I think)
EDIT: You also need to escape the dots. Otherwise they will be meta character for any character but line breaks.
another EDIT: If you actually DO want to allow hyphens in filenames, you need to put the hyphen at the end of the character class. Like this:
[a-zA-Z_\s0-9:\b-]+(\.pdf|\.PDF)$
You probably want to use something like
[a-zA-Z_0-9\s:\\-]+\.[pP][dD][fF]$
which is same as
[\w\s:\\-]+\.[pP][dD][fF]$
because \w = [a-zA-Z0-9_]
Be sure character - to put as very first or very last item in the [...] list, otherwise it has special meaning for range or characters, such as a-z.
Also \ character has to be escaped by another slash, even inside of [...].

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.

What is the best invisible character can I use to replace ?

I use some telerik report to print some report.
I need to use Telerik.Reporting.TextBox to print labels.
Some labels are stock in .txt files, like " Apple".
When I see a label with spaces, it means I have to indent it in the report, so in the TextBox.
The thing is when we export the report in pdf, we have the indentation, but not when we see in the browser. If I replace the spaces by "& nbsp;", we see the indentation in the browser, but when exporting to pdf, we see the "& nbsp;".
One way to do this is to use HtmlTextBox, so both the browser and the export works fine, but we have other constraints that says we must keep the TextBox.
My idea is to replace the spaces by a blank character, an invisble one, like alt+0160, but there is a lot of choice, and I want the one that will work in any browser, any export (TIFF, PDF, Excel...).
Is someone have a good clue about this choice ?
You could use Unicode code point U+00A0 (non-breaking space), which is what the entity represents. How this should be encoded in your document depends on the character set in use.
You can replace the with ""

Resources