Geany editor messing up special characters - text

I don't know what I did or not but suddenly my geany editor is not printing some special characters like
(. , < - ) I have to type another character to make them appear, and I cannot find any answer on the internet, if someone knows the solution please answer.

Change keyboard layout to English(Canada)
In windows 10
settings > Time & Language > Language > Keyboard
Override the input method to English(Canada)-US

Related

Restrict autocompletion with HLS and vscode

Autocompletion in the Haskell Language Server (with VScode) gives suggestions before a single character in the next word is typed (starts with !!) and adds often non-sense text. How can the useful auto-completion function be limited to start only after say 2 or 3 characers are typed?
I tried
"editor.acceptSuggestionOnCommitCharacter": false,
in the settings, but it did not produce the desired effect.
Addition: could somebody start a Haskell-Language-Server tag?

notepad++ select hyphenated text

I could'nt find a solution to a problem that has been hindering the use of notepad++.
When you double click text to highlight that text and others like it, camelCase or under_score words work great, but when hyphen-words-are-clicked this does not treat it as a single word and only highlights the segment between the "-".
question: how can you customize notepad++ so that hyphenated words are treated as single words? or does anyone know a text editor that does this?
saw this, but not sure how to implement it: http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Word_Customisation
this was really helpful: Where are the recorded macros stored in Notepad++?
Notepad++ rely on Scintilla for word selection. As caoanan noticed in his answer, Scintilla can be configured with the SCI_SETWORDCHARS variable. You can set this variable in Notepad++ with a simple NppExec script:
Install NppExec
Menu Plugins -> plugin Manager -> Show Plugin Manager
locate NppExec, check the box and hit Install
Create the script
Menu Plugins -> NppExec -> Execute ...
write this code (you can add other characters, like .$## at the end of the list):
NPP_CONSOLE 0
sci_sendmsg SCI_SETWORDCHARS 0 "CDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"
hit Save...
You can now execute it by pressing OK
(optionnal) Execute when Notepad++ starts
Menu Plugins -> NppExec -> Advanced Options...
Choose your script in the Execute this script when Notepad++ starts drop down
2018
I tried with the published solutions but when I move to another file I have to run the script again every time. So I did this way, in the menu:
Settings > Preferences > Delimiter
select:
Add you character as part of word
insert hyphen:
-
and it worked.
I met with the same problem when editing Lisp/Scheme source codes with Notepad++.
The cure lies in the underlying Scintilla library (SciLexer.dll).
I've tried in a "blunt" way -- hack the code and rebuild SciLexer.dll.
Note the '-' added to the following code
CharClassify.cxx
void CharClassify::SetDefaultCharClasses(bool includeWordClass) {
// Initialize all char classes to default values
for (int ch = 0; ch < 256; ch++) {
if (ch == '\r' || ch == '\n')
charClass[ch] = ccNewLine;
else if (ch < 0x20 || ch == ' ')
charClass[ch] = ccSpace;
else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_' || ch == '-'))
charClass[ch] = ccWord;
else
charClass[ch] = ccPunctuation;
}
}
Or, the "smart" way, as mentioned at ScintillaDoc.html
SCI_SETWORDCHARS(<unused>, const char *characters)
Scintilla has several functions that operate on words, which are
defined to be contiguous sequences of characters from a particular set
of characters. This message defines which characters are members of
that set. The character sets are set to default values before
processing this function. For example, if you don't allow '_' in your
set of characters use: SCI_SETWORDCHARS(0,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
http://sourceforge.net/p/notepad-plus/discussion/1290590/thread/39ba5cd8/
Install Npp_Exec plugin and copy the string from this thread adding the signs you want Npp considers as part of a word.
I don't know that option in Notepad++ yet. Since, you've asked about any other text editor that does so, I would recommend you to use Sublime Text. It's a really cool text editor with lots of smart features. I bet you'll love it. By default, it does not treat the hyphenated words as a single word. But it's way too easy to customize the setting for that. All you need to do is go to 'Preference-> Setting-Default', where you'll find the following setting:
"word_separators": "./\\()\"'-:,.;<>~!##$%^&*|+=[]{}`~?",
From there, just remove the hyphen and we're done!
A workaround is to:
In the Find window, set the text to find to a space
In the Shortcut Mapper (Main Menu section) assign "Find Next" to Ctrl+Right and "Find Previous" to Ctrl+Left
Now, so long as the search text is only a space, it will effectively be the only delimiter. If you need other delimiters, for instance comma and period, set the Find text to [ ,.].
If you don't have admin rights and no Plugin Mgr, you can install most plugins by downloading a dll/zip file and saving the dll to the 'plugins' sub-folder under your npp install. Then restart npp.

Keyboard shortcut to "Comment" a line in NANO?

I love NANO. It's always there, it can slice and dice, and its NOT VIM!
But I am constantly hitting Command / - inadvertently - as I go along, out of habit.. Most IDE's use this convention to "comment out" a line.
NANO has great syntax highlighting.. so it knows the context of my documents.. but I haven't been able to figure out a way to get it to perform this basic, yet relatively important function.. Hand-commenting is for the birds.
I suppose this is sorta a super-user question, but in my experience, this would get a bunch of blank stares and then a few people asking who Nano was, so... here it is...
Oh and PS, brownie points for anyone that knows how to get DashCode to be able to do this as well... It would be the finest Javascript IDE EVER if it could perform this trick... and I'm convinced Apple omitted the feature for just that reason, lol.
The simplest workaround I've found:
Comment-out:
set the cursor at the first row that should be commented-out
hit twice 'M-R' (or 'Alt-r'; in order to Replace a RegExp)
Search for: '^'
Replace with: '# '
Replace this instance?: 'y'
press 'y' for each row to be commented-out
Comment-in:
The same procedure, replacing '# ' by ''
New in nano 2.6
(2016 June 17)
comment/uncomment lines with default binding M-3 (Meta-3)
(http://git.savannah.gnu.org/cgit/nano.git/tree/NEWS)
Customization
If you do not like the default mapping, note following:
Using Ctrl-/ by rebinding it in ~.nanorc with bind ^/ comment main is not possible. On a linux console this is equivalent to a backspace (https://savannah.gnu.org/bugs/?53248).
Some possible alternatives could be:
Meta-; (emacs)
Alt-/ (micro)
While accepted answer is de jure correct, it doesn't really help if you're not proficient in Nano already.
Indeed since Nano 2.6 this functionality is available as M-3 (Meta-3). But what it actually means (see doc) is that comment\uncomment can be done via these hotkeys:
<Alt> + 3 // <Alt> is default <Meta> command
<Esc> + 3 // Single <Esc> should also work
And since usually you need to comment out several lines, you can use Alt + a (or Meta + a / Esc + a) to switch to selection mode which will allow to select several lines. Then comment command will be applied on all selected lines at once.
Related question: How to comment multiple lines in nano at once?

How to type ASCII 145/146 (quotes) in vim?

Using vim 7.2.330 on a Ubuntu host from an XP host, I'm stuck at how to type/paste the following line in a text file:
include_once(‘/full/path/to/app’);
The document says it's important to use ASCII 145 and 146, but vim turns them into "<92><93>", and Nano turns them into �.
Note that I'm using a European keyboard layout, not the US layout.
Does someone know how to solve this?
Thank you.
Er, you should not be using the 2 types of special quotes for string quoting in PHP.
You should be typing
include_once('/full/path/to/app');
( That's ASCII character 39 )
This is not what it says at the end of
this document:
www.wpbbpthemes.org/integration/
"beware some pasting of this code make
the ‘ character change, make sure it’s
the button left of the enter key on
your [US] keyboard"
No, you are misinterpreting it. Lots of software in windows, and varying keyboards, erroneously do "smart quotes". Word and Internet Explorer are such examples. As a result, copy-pasting from these applications results in the wrong type of character in your source code, often conflicting with the content-encoding the document is served as, which renders on the displaying browser as a silly Ä or similar character.
Do not use characters 145 and 146 in your PHP source, it is not necessary, and it won't work.
Also, Important to note, the authors of that page have USED THE WRONG QUOTES IN THEIR EXAMPLES and as such, WILL NOT WORK AS STATED.
Their statement with regard to "beware some pasting will make the character change" is bogusly incorrect, they have the incorrect character in their source, and as such, copy-pasting it at any time will not work.

What is the most convincing command in Vim

I want to ditch my current editor. I feel I need something else. That do not expose my hands to the risk of RSI. I need to see why I should change editor. And it would be nice to believe, that I will be coding when I'm 80 years old.
All the big guys out there are using Vim. The only Emacs guy I know are RMS. Paul Graham is a Vi dude.
. (dot) - repeats the last editing action. Really handy when you need to perform a few similar edits.
:help usr_12.txt
That'll bring up a section in the help system that discusses "Clever Tricks". If those don't get you excited I don't know what will!
Recording macros
The asterisk.
*
Its effect: Immediately search for the next instance of the word under the cursor.
The best thing is the efficiency with which you can edit code (which is done a lot in programming). The commands such as
cw to change a word
dw to delete a word
ct, to change all text until the next comma
ci( to change the contents of the parentheses you're currently in
xp to correct spelling mistakes ("spleling" -> cursor on l -> xp -> "spelling")
o to insert a new line below and start editing
O to insert a new line above
Then there is the possibility to work with named registers very quickly. To move a block, just select it, press d, then move to it's new location and press p. Much faster than Ctrl-C and Ctrl-V. Use "ud to delete text and move it to register u (I use this one for the commenting template).
And also Vim has all the scripting support you need (either using it's native scripting language or using Python, Ruby, ...)
the numbers.
in command mode
type a number ( any number of digits )
type a command.
that command will be executed $number times
ie:
99dd
erases the next 99 lines.
The fast startup time.
The sharp distinction between editing and viewing. (you know when you edit)
The only way you ever find what you are looking for is with search "/" and that is good, since it much faster than your eyes.
But the best command(s) are:
/ - search string
ZZ - quit
. - repeat last insert (I think)
%! - insert unix command
Handling multi line regexps in search strings with "\_.". While checking over 4GB text files of various formats, it had saved my life several times.
Why are you looking to be convinced to start using a different editor? If you're happy with what you have now, stick. If not, perhaps ask about editors with features that you lack.
Even if you are using Visual Studio there is the wonderful vsvim.
I love the speed of Vim but I find it lacks the features of a modern IDE for C++ development. Eclipse CDT with the viPlugin is a good compromise.
You get the power and source overview provided by Eclipse CDT with the speed and flexibility of Vim for coding.
The lovely built in regular expression evaluator.
Maybe reading "Come home to vim" by Steve Losh article is a good start, or
a series of videos about interesting plugins. And be sure to see some articles on the site vimcasts.org
You should map Caps Lock to Esc. It will make getting out of insert mode feel natural as opposed to the awkward move you must make to press the ESC key. Besides, who uses Caps Lock anyway?
\v
Make your regular expressions mostly Perl compatible.
See very magic section here for more information.
To be truly inspired, you must see a vim guru in action. If you do not have a local guru, here is a video to inspire you.
http://www.youtube.com/watch?v=jDWBJOXs_iI&feature=related
If you don't already know vim, the speed at which code is navigated, sliced, and diced will be indistinguishable from magic. After a few months of studying vim, the same editing speed will seem commonplace.

Resources