In gvim, how do I create a shortcut to open a file using the gui file open dialog - file

In gvim, when I open a file via the file menu I get my operating system's native GUI file open dialog. In most other editors you can access this via a keyboard shortcut instead of going to the file menu. But in gvim the shortcut (as it appears in the file menu) is :edit which is a "command line oriented" way of opening files, not a GUI for opening files.
Is there a command :blah that will start the file open dialog for me? I know other, similiar such commands exist (for example :set guifont=* will open the GUI font selector.)

:browse confirm e
should be what you're looking for.

For Gvim on Windows, just hit "Alt + F + O" key combo (equivalent to typing ":browse confirm e").

Related

How to open plain text file in KDevelop with embedded text editor

I cannot open some text files with an embedded text editor depending on the extension in the file name.
For example, if I have Wavefront .obj file, KDevelop will open it with hex editor, in the Open With menu only hex editors are available.
There is File Type Options button in the file properties, but if I click to this button nothing happens and no output in stdout/stderr from KDevelop.
I am using Gentoo Linux distribution with KDevelop 5.5.2
Had same problem, and here's quick solution:
Click right on your file in file manager (in my kde it's default dolphin);
Select "Properties";
In opened window click "File type options";
In the next opened window select "Embedding" tab;
In services prefering order list select Okteta, and then remove it;
Click ok and it's done.
KDevelop after that, stops use hex editor and open files in embedded text viewer. Note, that this recipe would work only for one file type (or extension), that was selected in first step.

Drag and Drop a file into a shortcut to call a CMD.EXE with the path as a parameter

I like the Drag/Drop interface very much. Especially to start a simple command-line program from the command shell by dropping a file to a shortcut would be a nice feature (Shortcuts are dropping targets for dragged files).
Unfortunately the shortcut doesn't call the command-line program with the path to the file dropped.
Dropping a file to such a shortcut only starts some kind of a window which disappears immediately. Using a shortcut to call a batch file executes the batch but does not append the dropped file as a path as a parameter.
Any idea how to get a simple solution for this simple dropping target?
The problem of not getting the name of the file to drop is rather trivial: I had coded a CMD.EXE /k in the shortcut to execute the batch file. After removing that and only coding the batch file it works flawlessly.

How to print Trace32 terminal view to a file?

I have a script that initializes terminal and prints information in it in Trace32 terminal and I cannot edit that file. I am using term.write command to log the contents in terminal window to a file. But it does log the information that were written before executing this command.
So, I tried to Printer.file and winprint.term.view commands. Now I get this error.
terminal window with this configuration already open
What should I do to log all the contents of terminal (including contents that were already written and will be written in the terminal) to a file?
If you want to get the content from a window in TRACE32 while using the debugger interactively, click on the context menu, and choose "To Clipboard all". Then open a text editor and paste your clipboard to an empty document (Ctrl+V).
If you want to get the content of a window in TRACE32 via a PRACTICE script use the command PRinTer.FILE <FilenName> ASCIIE (as you did) and then the command WinPRT <WindowName> /ALL.
The pre-command WinPRINT creates a new window on the printer, which will not give what you want with Terminal windows. The command WinPRT however, actually sends the content of an open window to the printer (and the printer can be redirected to a file).
The tricky thing with WinPRT is to know the name of your window. The command WinPOS allows you set the name for next opening window. So I recommend to use WinPOS in the script opening your terminal window. But since you can't change that script use the command WinPAGE.List to get the names of all open windows.
E.g. In the following WinPAGE.List you can see that the window opened with TERM.VIEW has the window-name "W000".
Thus, I can get the content of my terminal window with
PRinTer.FILE "C:\temp\mywindow.txt ASCIIE
WinPRT W000 /ALL
Note, that window names are case sensitive.
The window names starting with a capital 'W' followed by three decimal digits are set by TRACE32 in the order they appear. So if you want to be sure that your terminal window always gets the same name, ensure that no window is open before opening your terminal window with your script. You can close all windows with WinPAGE.RESet.
So all together you get:
WinPAGE.RESet
DO "C:\T32\user\my_script_to_open_the_terminal.cmm"
PRinTer.FILE "C:\temp\mywindow.txt ASCIIE
WinPRT W000 /ALL
If you script is only opening one terminal window and no other window, I recommend to do this:
WinPOS ,,,,,,myTerminal
DO "C:\T32\user\my_script_to_open_the_terminal.cmm"
PRinTer.FILE "C:\temp\mywindow.txt ASCIIE
WinPRT myTerminal /ALL
I am late, but figured out the answer.
&LOGFILENAME=OS.PPF()+".log" ; so, filename here is "<this_current_path_filename_with_extension>.log"
PRINT " Printing to log file: &(LOGFILENAME)"
PRinTer.FILE &LOGFILENAME ASCIIE
; select and open display the AREA you want to print to file; here it is default T32 log area A000
AREA.Select A000
AREA.View A000
WinPrint.AREA.View
;AREA.CLEAR ;if you want to clear the view for next set of prints
Alternatively, in real-time, write-to-file is
OPEN #1 OS.PPF()+".log" /CREATE ; so, filename here is "<this_current_path_filename_with_extension>.log"
;...
WRITE #1 "Hello World - it is " DATE.TIME()
;how many ever WRITE's you want in the code
;...
;...
WRITE #1 " BYE"
;...
CLOSE #1

Find a file by name in Visual Studio Code

How can I find a file by name in Visual Studio Code?
A Visual Studio shortcut I'm used to is CTRL+,, but it does not work here.
When you have opened a folder in a workspace you can do Ctrl+P (Cmd+P on Mac) and start typing the filename, or extension to filter the list of filenames
if you have:
plugin.ts
page.css
plugger.ts
You can type css and press enter and it will open the page.css. If you type .ts the list is filtered and contains two items.
Press Ctl+T will open a search box. Delete # symbol and enter your file name.
I believe the action name is "workbench.action.quickOpen".
It is CMD + P (or CTRL + P) by default. However the keyboard bindings may differ according to your preferences.
To know your bindings go to the "Keyboard Shortcuts" settings and search for "Go to File"
It's Ctrl+Shift+O / Cmd+Shift+O on mac.
You can see it if you close all tabs
According to this Github page, it's now a simple Cmd+F inside the File Explorer tree on Mac (and presumably Ctrl+F on Windows). Found and highlighted all the README.md files I've been working on:
file search results in vscode file explorer pane
Caveat: The tree has to be fully expanded for this to work.

Open text file via batch?

I am trying to access a text file using batch when a user enters a certain command. I have tried doing
start E:\Programming\Important\Folder\Textfile
Cls
And it closes the cmd window but wont open the file. Does someone mind telling me what I did wrong? (sorry for the code not being in the gray box im using the web browser on phone)
I guess the problem is Textfile has no file extension, so windows does not know how to open it. Instead of using start you could use the notepad command, as notepad.exe is in the search path of the system, you can simply write:
notepad 'E:\Programming\Important\Folder\Textfile'
This will open your file.
You can do that easily with PowerShell, like so:
say we want to open 2 files in Sublime Text:
Start-Process -FilePath "C:\Program Files\Sublime Text 3\subl.exe" -ArgumentList D:\PathToMyFile\myFile.txt, D:\PathToMySecondFile\myFile.txt

Resources