Access current file path in JetBrains Rider - jetbrains-ide

Is there any way to access file path to the current file in JetBrains Rider? I am looking for an environment variable or something similar that I can use to frame a URL, something that looks like www.abc.com/$FILE_PATH$

If anyone is curious, I did this.
Preferences -> Tools -> External Tools.
When I right click, I see "External tools" option. "I also mapped it to a keyboard shortcut.

Related

Open path of a file in project explorer

Often I have the case that I have a file opened in the tabs like item_category.xml here:
The project explorer still shows something else. Any way to open the path to item_category.xml in the project explorer? I already checked the right-click menu of item_category.xml, but couldn't find a matching option.
Use that symbol in the project explorer (shortcut: Alt+F1, 1):
More information on the feature: Locate a file in the Project tool window.
If you don't want to use mouse but keyboard shortcut
First option could be assigning a shortcut to Select in Project View may do the trick. It is located under Keymap/Other.
Second option could be to install Scroll From Source plugin for this. The details are here
Set the keyboard shortcut to the function of "Scroll From Source" in Project Panel. You can set the special shortcut by yourself to all OS(Window/Linux/Mac)
Default shortcut is Command + Control + S for Mac.

Import IntelliJ key mapping in to Rider IDE

Is it possible to import IntelliJ (Version: 2018.1.3) key mappings (or all settings) in to other JetBrains IDE's specifically Rider (Version: 2018.1)?
From what I can tell this is only possible when moving settings across new installation of the same IDE.
There is an easy way to do this:
Go to -> File -> Export Settings -> choose everything and click ok to save it somewhere
This will export a .jar, that contains everything, like code highlighting, shortcuts and plugins, it is really the whole IDEA settings. Then do the same thing with import and choose the exported .jar file. Now everything should look and feel the same.
Some things to notice:
- The colouring might be different in some edge cases, as a comment from html and c# looks different. So exporting phpstorm settings to rider might look funny sometimes.
- Shortcuts also are sometimes not 100% correct, as there are some different workflows in the ideas. Like Rider uses ctrl + . for auto completion where the other ideas do it somehow different. But those are very few occasions (2-3 at max) and not very annoying.
You should just be aware of it. But other than this, exporting settings and plugins could not be easier!
Marquis Blount, yes you can do it if your keymap based on IDEA keymap with name available in Rider.

Show GNOME "Open with" dialog

Is there a way to open the "Open with" dialog programmatically for a given file? I mean the dialog that you get when you right-click a file in Nautilus and select "Open with".
I'm preferably looking for a simple shell command to use, but an API or a DBUS interface would also work. I'm stuck with GNOME 2.28.2 on this PC, but would be also interested in a solution for recent GNOME. Maybe there is even a standardized solution for multiple Linux-ish desktops (something like xdg-open-as)?
I tried gnome-open and xdg-open, but both just use the standard association and don't let me choose the application.
I am unsure I understand your question.
If you want that a particular application appears in the "Open with" menu, then you have to register the MIME type for that application with xdg-mime, and then Nautilus will show it.
If you want a menu similar to "Open with" that opens only for specific files, then you should write a Nautilus Extension (for example, in Python or C). In the extension's code, you can check things like MIME Type, if selection is multiple, etc. Nautilus provides access to that information. See How to create nautilus C extensions
If you mean something different, then please rephrase your question :-)
I could not find a command line tool like that either, so I made one. Surprisingly it is really trivial.
https://github.com/timgott/gtk-open-with
If you want to do this programatically in Gtk, it requires only few lines of code (example using the C++ bindings):
auto dialog = Gtk::AppChooserDialog(file);
int response = dialog.run();
if (response == Gtk::RESPONSE_OK)
dialog.get_app_info()->launch(file);

Eclipse shortcuts in Resharper

I just started with Visual Studio + Resharper, coming from Java development with Eclipse. I can navigate eclipse pretty quickly, because I memorized all the shortcuts I need. Now it seems like Resharper knows all what eclipse can do (probably even more), but its mapped to different keys, and i really don't feel like learning a new set of shortcuts for the same stuff.
So my question:
Where is Resharpers shortcut configuration file (if there is any)? I saw a bunch of .xml files in it's bin directory, but I'm not sure it's the right place to look. Couldn't find anything in the docs, only how to change the shortcuts from VS one-by-one.
Is there an eclipse preset? I found this on github, but there is absolutely no explanation, on what to do with it, and in the file name it states, it's for r# 5.0 and i have 8.1 (not sure if there is any difference in the configuration part).
I found this file using Google Search: https://github.com/chrismo/jetbrains.keymaps/blob/master/resharper.5.0.eclipse.shortcuts.vs2010.vssettings
You can download it and use Visual Studio's Tools -> Import and Export Settings ... command to import it.
Resharper comes with only two default keyboard schemes, 'Visual Studio' or 'IntelliJ IDEA' (see here). Choose one that you are most happy with (under Resharper->Options...->Environment->Keyboard & Menus) and change any shortcuts in Visual Studio (under Tools->Options...->Environment->Keyboard) to match the ones in Eclipse. It may be easier just to re-learn one of the default schemes though.

"Registering" GVim in Windows XP

This is probably bordering off-topic-ness here, but not a lot of people on SuperUser use GVim, as opposed to here, so I'm leaving it here.
The problem is simple - I'm using GVim 7.3. from vim.org, downloaded it in the form of archived binaries (the two archive files) like always and replaced the older version. However, I can't get Windows to recognize it and to associate a file extension to it.
From windows explorer go to, let's say, .py file, Open with ... / Browse / gvim.exe in its directory and ... nothing. Like it never happened.
Does anyone have any idea what could be causing this behaviour? It's mighty annoying to have to open every file from within Vim manually.
I think the default installer ("self-installing executable") from vim.org lets you register shell associations; this means you get an entry "open with vim" in every context menu from the explorer. Did you not use this file?
I'm looking at this page and I'm thinking about this download.
This doesn't answer your question, but it's a different way to edit with gvim from the context menu.
Create a .reg file with the contents below (adjusting your path to gvim.exe) and execute it. Then whenever you right-click on a file in explorer you will have an "Open with GVIM" option.
REGEDIT4
[HKEY_CLASSES_ROOT\Unknown\shell]
#="Open with GVIM"
[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell]
[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with &GVim]
#="Open with GVIM"
[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with &GVim\command]
#="C:\\Vim\\gvim.exe \"%1\""
I gave up trying all kinds of tricks through the registry, but this solution works for me just fine. I might add, I'm having the same issue on Windows 7. Since Windows seems to be able to do the association with vim.exe just fine, and this is apparently tied to the file name, I moved vim.exe off as say vim.ex$ and made a copy of gvim.exe to vim.exe. Cheap and easy way around this goofy problem, and I can't say I ever use vim.exe on purpose.

Resources