Radare2: is it possible to open (with vi editor) the source file reference at position? - radare2

suppose you are in Visual mode and like to open with default editor (vi) the file start.S at line 43, how can that be done via radare command?
Thanks!

Related

How to let VS Code open file using the default program of the operating system?

I am using the latest VS Code to write python Qt code (under Ubuntu 20.04). One obstacle is that VS code does not recognize known file types such as .ui files, and opens it as raw text or xml file.
By comparison, other editors such as eclipse opens the .ui file with its OS default program -- Qt Designer. With VS Code, I had to open a file manager and then find and double-click the file to open it the right way (the same as opening the file using xdg-open in terminal), which is quite inefficient.
Does anyone know of a way to configure VS code to open a known file directly using its OS default program?
There are two extensions that I know of that tackle this problem (no affiliation):
Open in External App
... with this extension, you can do it more simply. Just right click to the file, and select Open in External App, that file would be opened by system default application. You can also use this way to open .psd files with photoshop, .html files with browser, and so on...
The configuration implies that you need to manually set which app to use for which extension, so it doesn't simply use the default configured in your OS (at least not in my brief test).
Open
Opens files using the OS's default program for the file type
This does what it says out of the box, but the keyboard shortcut seems to fail. The command can only be triggered via the right-click menu of the file in the vscode file browser.

How to create a file in VS Code with Vim extension?

Using the VIM extension for VSCode, is there a way to create a file inside the folder you are currently selecting on the explorer tab?
Similar to how it works with NERDTree on NVIM itself where you can press "a" and it lets you write a filename.
Brief example where the cursor would be placed on the "pages" folder.
You can use :e <filename> to create a file and simply use :w to save it.
It creates a file in the directory in which your current file is open. So in the screenshot you provided, if you would be editing _app.tsx, the new file will be created in this directory unless differently stated in your filename.

How to open a binary file (e.g. Excel) in Visual Studio Code with its default application

I use Visual Studio Code to work on projects that not only include program code, but also data files, e.g. in Excel format.
VSCode cannot edit such files, as they are binary. Attempting to do so shows a warning, and if you persist, the file is shown (as gibberish).
I've also tried to pass the file to the (CMD) terminal (right click, 'Open in Terminal'). In a regular CMD window that would invoke the default application, but that does not work in VSCode.
Is there a simple way that I can use from VSCode to open such files using the default applications?
The extension sandcastle.vscode-open does this. Install it, and you can open any file with its default application by right clicking on the filename in the explorer menu.
In v1.66 you can set a default editor for binary files and avoid the warning (see release notes: binary file):
Default binary editor
A new setting, workbench.editor.defaultBinaryEditor, lets you
circumvent the binary file warning and automatically open the editor
type of your choosing when a binary file is detected. You can select
the default binary editor from a dropdown in the Settings editor or
via IntelliSense in settings.json.
TBH, I am still investigating whether you can set this to some external application like Excel?

VSCode: Open file in project

I'm using Mac OS X with Visual Studio Code 0.10.10.
How do I use the keyboard to open a file, using its partial name, in the currently open project? I can't find a command in the Command Palette that would enable me to do this. There is a command that does this for Working Files (see screenshot), but not for the currently open project.
> prefix is for running commands in VSCode.
To open a file in the current project press Cmd ⌘ + P and type the full / partial name of the wanted file. VSCode uses fuzzy search, so you can even get away with typos in your input.
There is not a proper command for this but if your file has any file extension you can just open the command palette and replace the > with a .
It will have a section of the open files at the top and "file and symbol results" at the bottom containing every file name containing a . (= all files with a file extension)
If you know the name of the file you can simply remove the > in the command palette and type the name and it will show the file and symbols results again for any file containing what you have typed.
To open known file on a current project if you aware the file name is Ctrl+P Windows.
Open file opening pallet with ctrl+p (on Windows) and cmd+p on Mac OSX.
In that pallet you can either type the file name or a file relative path like shown in the below image
The important point for relative path is that, it should not start with a dot . but should start with a fwd slash /
Absolute path can be used as well.
Ctrl+O opens the command palette right to the file search mode. The command in the shortcuts is "workbench.action.files.openLocalFile".

How to open multiples files in one Code instance from command line?

If I open a file in Visual Studio Code from the command line or from within File Explorer, each file will open in a separate Code instance. Is there a way to make them all open in the same instance? I.e. add them all to the 'Working Files' list?
Upcoming version will have a new option files.openInNewWindow which you can set to off to always open files into the last active instance. This is then identical to starting VS Code with the -r option but is much nicer to use (e.g. when you open a file from the desktop).
Update for our VS Code 1.0 release:
The setting is available as window.openFilesInNewWindow
You can use the command line option of -r or --reuse-window to assure it opens in the last active VS Code window
You can review the other options here
code Folder1/File1.txt Folder2/File2.java Folder3/File3.css
This command opens three files in one instance of the editor. All files are going to be added to the working files list.
This even works with much more files in the parameter list.