Amount of spaces not configurable in eclipse mars - linux

I do not want to use tabs for indentation. So I check the option "Indent using spaces" but I can't set the amount of spaces. The Plus and Minus buttons are not clickable and I can't edit the value by hand, which means typing in a number. Indenting only one space is far too little.
I remember some hack including editing the workspace configuration files but I can't find the correct file or page I once read it on.
I am using Linux Mint, Eclipse for PHP Developers 4.5.1.

This is Eclipse bug 479274
You can work around it by editing the indentationSize entry in the properties file org.eclipse.wst.css.core.prefs which is in the workspace .metadata/.plugins/org.eclipse.core.runtime/.settings folder.

Related

Forward slash key not working in VS2019 code editor

Since a few days (I don't know exactly when it started) the forward key in VS2019 is not working in the code editor. No matter how many times I press it, it doesn't do anything.
It also doesn't work in the seach box in the menu bar (labelled 'Search (Ctrl+Q)') nor in the search box which appears with Ctrl+F.
It does work in other places, like the solution explorer search box (Ctrl+;) and in the resource editor.
The forward slash is working in any other application that I tried (including Visual Studio Code and MS Excel). The question mark (Shift+/) is working everywhere, including in the code editor window. Even AltGr+/ is working (producing the Spanish upside down question mark).
I tried all other keys, including the AltGr combinations. They all work fine. Keyboard layout is US International.
The foward slash key doesn't work in the code editor when typing it on the laptop keyboard, and doesn't work when typing it on an external keyboard, or via an RDP session.
I am running Windows 10 Pro 64-bit, version 20H2, build 19042.685. System is up to date.
Visual Studio Professional 2019, 16.8.3, also up to date.
What is causing the forward slash key to fail?
How can I solve this problem?
(Too long for a comment.)
The OP indicated that the problem was resolved after resetting the keyboard shortcuts, which suggests that / was set as a keyboard shortcut either by accident or perhaps by an installed extension.
However, the question remains in such cases of how to identify what a particular keyboard shortcut is assigned to, in order to turn off just that one shortcut as opposed to resetting all.
Visual Studio does not appear to provide a place to see the list of all active keyboard shortcuts. An alternative is to go to Tools / Import and Export Settings / Export Selected / All Settings and save a .vssettings file with all the current settings. That is a plain text file with extended XML sections, and the keyboard shortcuts can be found under the following node (reformatted for readability):
<Category name="Environment_KeyBindings" ... >
<Version>16.0.0.0</Version>
<KeyboardShortcuts>
<DefaultShortcuts>
<Shortcut Command="View.ViewCode" Scope="Global">F7</Shortcut>
...
</DefaultShortcuts>
<UserShortcuts>
...
</UserShortcuts>
</KeyboardShortcuts>
</Category>
One of the <Shortcut> lines would have been listing / before the reset, and the Command attribute on that line indicated the assignment, so that it could be located and turned off individually in Tools / Options / Environment / Keyboard.
#dxiv Your comment made me check the shortcuts. Tedious job, scrolling through those hundreds of options). Nothing. Then I clicked the Reset button. That solved the problem.
In my case, the CodeRush extension was the guilty party. "Selection comment" gets set to use / upon installation. WTG DevExpress ......
https://docs.devexpress.com/CodeRushForRoslyn/120205/coding-assistance/selection-tools/comment-uncomment-selection
Update:
Also adding a screenshot of it in VS 2022 to help people find it:

Search-Everywhere in Android Studio (IntelliJ) makes Search File redundant?

In Android Studio (and IntelliJ), shift-shift is used to Search File (and Everywhere, e.g. class name etc).
I just realize it also have shift-command-O that search for a file.
With shift-shift, it seems to me shift-command-O is redundant.
So I'm checking to see if I have miss something that is in shift-command-O but not in shift-shift?
Shift-Shift shows a popup with occurrences of the string you've entered in names of files, classes, symbols and actions. Shift-Command-O shows a popup with occurrences of the same string only in names of files. Same task, same UI (in recent IJ/AS versions) more narrow filter.
Well you're almost right but there is one main difference in those two commands.
Shift shift will search for a file.
While shift-command-o will go to the specified file.
I guess in a way they to de same, but if you use Shift-command-o you will be redirected to that file and saves you one click.
But feel free to use what you want, shortcuts are for convenience so you should use what is most comfortable.
Here is a link with all shortcuts in IntelliJ IDEA, could be usefull in the future :)
https://resources.jetbrains.com/storage/products/intellij-idea/docs/IntelliJIDEA_ReferenceCard.pdf

SFTP file alignment issues

I have sublime text 3 with SFTP plugin installed. Using it im able to download the code but the python files that are opened are not aligned properly.
I opened a ticket in SO but its not resolved.
https://askubuntu.com/questions/959866/files-improperly-aligned-after-transfer-via-ftp?noredirect=1#comment1533479_959866
Not sure I need to change in my py files either in the server or the editor. The lines are not aligned only after the SFTP.
My SFTP settings:-
"translate_tabs_to_spaces": true,
"detect_indentation": false,
"tab_size": 8,
"tab_width": 8
Indentation changes when viewing files on different computers or in different software are indicative of using tabs for indentation, as unlike spaces the amount of space that a tab takes up changes based on usage and configuration settings, and is one of the more hotly fought Holy Wars in the development arena.
As you have correctly surmised, you need to tell Sublime how wide you think a tab should be, since it's defaults are out of sync with what you expect.
For the most part your issue is that the settings you've mentioned in your post aren't SFTP Settings (the available settings are in the documentation). SFTP just moves files around as a series of bytes, it's not involved with the actual display and editing of anything.
In order to get things to work better, you should put those settings in your user preferences. That's Sublime Text > Preferences > Settings in the menu (i.e. press ⌘+,) and add them to the settings pane on the right.
That said, note that tab_width is not a setting that Sublime understands by default, although the other three you mentioned are valid. Additionally those settings will cause Sublime to expand all tabs into 8 spaces, removing the tab characters entirely.
Assuming you don't want your files to be indented with tabs any longer, that's what you want. If you prefer tabs, you should set translate_tabs_to_spaces to false instead, so that tab characters are retained.

How to add gvim icon to openwith menu

I have installed gvim in windows 7. When I right click on a file, I get list of editor to be opened with. I see a icon for notepad++, 7zip and beyond compare, but not for vim. it is tough to search "Edit with Vim" in the big list. Is it possible to add icon to "Edit with Vim". I tried setting ICON in registry to gvim.exe path, but that didn't work
I am currently having a crack at coding this up "for real" (but no success yet).
In the meantime, here's what I did on my machine as a sort of workaround:
Create a new text file and call it (for example) vim.reg
and paste this into the file:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Edit with Vim]
"Icon"="\"C:\\Program Files (x86)\\Vim\\vim74\\gvim.exe\""
[HKEY_CLASSES_ROOT\*\shell\Edit with Vim\command]
#="\"C:\\Program Files (x86)\\Vim\\vim74\\gvim.exe\" \"%1\""
and then right-click on the file and select Merge.
Or just manually add those keys directly in RegEdit if you're comfortable with that.
You may need to restart Explorer.exe (eg. log out and back in) for it to take effect.
This will add a new "Edit with vim" entry, with the icon, to the context menu for every filetype.
If you want it only for text files, for example, then change the two occurrences of "*" in the file to "txtfile".
The other vim context menu entries (eg. open with existing vim session) will not be affected - they will still not have icons.
UPDATE:
From the bug report that Christian mentioned, it looks like someone else has now implemented this, in version 7.4.724.
Vim.org reports that the currently release is 7.4.729, so it should include that.
The only trouble is that the Windows binaries available for download from the site are from 2013.
But vim.org also suggests a way to get the latest version, precompiled for Windows:
For the latest version with all patches included see Cream below.
These versions are unofficial, but the download number is high and
complaints are few.
And
For an unofficial version that does include all the latest patches and
optionally a bit more: Cream.
The "one-click installer" mentioned includes the Cream changes.
For the "real Vim" use the "without Cream" version listed further down.
As far as I know, this is not possible yet. There is a whishlist bug that requests this feature, but no one has contributed code yet.

Linux text editor supporting bookmarks

I have about 19k lines of configuration files (actually in a DSL - Nagios) that I need to do a bunch of analysis on, come up with a refactor plan, and then implement.
I'm looking for - but not finding - a GUI text editor for Linux that supports global bookmarks - i.e. I can click on a line, give it a name/tag, and have it show up in a global list that I can click on and then jump back to. The key point is that it has to work across files, so I can jump from a location in one file to the corresponding location in another.
Since it's a DSL, I haven't been able to find any IDE that natively supports the language. I've tried Kate, but the bookmarks list is per-file only, and "tags" each line with the text of the line itself, no way to add a custom note.
Is anyone aware of an application that meets this objective feature set?
You can use the Eclipse IDE. Add both EclipseColorer - for syntax highlighting (try the .ini file format) and Eclipse Color Theme plugins. Together, these plugins work quite well for highlighting Nagios config files. It does the bookmarking and has a separate view port, that is detachable, to easily navigate them - even in multiple files.

Resources