How to get VSCode to "open as new file" from Go To File dialog - visual-studio-code

I have recently switched to VSCode, and am loving it, except for one specific thing that drives me nuts.
My "goto" command is {Command+P}, the easy search-and-open-file bar. If I type the name of a file into this bar and it does not exist, I want to be able to hit ENTER and have it open a tab editing that file as a new file. This is the behavior I would get in old-school Windows Notepad, or in mvim :e <filename>, but I can't figure out how to do it in VSCode.
Is there a toggle or a plugin I can use to get this behavior straight out of the Go To File dialog?

Answering my own question:
No, there's no way to do this using {Command+P}. This is strictly a file finder and I've yet to see any plugin that changes the behavior.
If you're using the VsCodeVim plugin, an almost-as-good approach is just :e <file> - immediately open a new buffer editing the given file. There's no tab autocomplete this way, but you just have to live with that.

Related

Disable VSCode file editor re-use

In VSCode if I press Ctrl+P, I can type a filename and open it.
Since some recent update, these files open in the same editor, so it isn't possible to open multiple files one after the other.
I remember there being a setting somewhere but I can't find it. What's the name of it? And/or, how do I change this behavior?
As #Mark pointed out, the key word here is "preview".
Under Workbench -> Editor, there is Enable Preview from Quick Open.
Hopefully this helps someone else out who also doesn't know what the feature is called, and who is annoyed about VS Code constantly resetting their config when it feels like it. :-)

Can't edit files in Vscode

I've just started using Vscode and have a created a WebAPI project. On trying to open any of the default code files (Startup.cs and Program.cs) whatever I type starts to appear in the blue bar as shown below instead of where I have placed the cursor. I have no idea what's going on or what that blue bar is.
I am able to add my own code files and edit these as I would expect.
I'm running Vscode 1.29.1 on Win 10 on a Dell Latitude 12 7275. The vscode extension
Enabled extensions :
That's caused by Vim extension. Uninstall or disable it, otherwise use insert key on your keyboard to put it in insert mode.
I'l leave this here for future readers
Basically, if I split files in tabs in VS Code, I could work with the files on the left hand side but could "read-only" all the files on the right hand side.
When I went to the extensions tabs I noticed that whatever I typed was being typed in the field in the extensions search bar. After deleting that, and clicking back on the "Files" tab, it went back to normal and can basically edit files on the both sides of my split screen.
If cannot type
Check where whatever you type is going (e.g. Extensions > Search bar)
Delete wherever it's being typed, and click back on the "Files tab"
Check if it works
I had to change the parent folders permission...
Try changing the entire folder to:
Read & Write: Allows a user to open the item and change it.
https://support.apple.com/guide/mac-help/change-permissions-for-files-folders-or-disks-mchlp1203/mac

urxvt: Open graphical file explorer in the current folder

While the command line is very useful for most of the tasks, I sometimes resort to a graphical file explorer (like Nautilus, Thunar, PCmanFM). I would like a keyboard shortcut or a context-menu entry to open such a graphical file explorer _in the current directory. I know the converse is possible with nautilus-open-terminal. Is there currently a way to do that?
It may require writing a perl-extension, but I do not know enough of perl and urxvt to find how to capture the current PWD.
Assuming you're using Bash as your shell, here's an alias you could add to your .bashrc:
alias nh="nautilus file://$(pwd)"
I called it nh for "Nautilus here". So from the comman-line you would simply type:
nh
for a nautilus window in the shell's current directory.
I have no idea what's involved in adding something to the urxvt context menu - sorry.
Well, I quickly hacked a small extension to do this: https://github.com/raphaelfournier/urxvt-perl.
The opening of the file browser can be triggered with the right-click menu or a keyboard shortcut. The selection can be a directory, but also a filename, which will then be opened by the application associated with it in the file browser.

Notepad++ AutoSave issue

It looks like Notepad++ as of ver. 6.6.7 is now actively blocking the AutoSave (ver. 1.4) plugin.
Notepad++ will remove AutoSave when upgrading and re-loading AutoSave with the Plugin Manager now fails.
Live and die by the ability to make a quick .PHP script change and switch over to the browser window without having to remember to click on the Save file toolbar icon.
Any suggestions or alternatives?
OK, found the solution.
Rather than relying on the Autosave version downloaded by Plugin Manager, go to the link listed -- http://sites.google.com/site/fstellari/nppplugins -- and download v1.40 from there.
The zip file will have 2 versions of the dll (A for ASCII and U for Unicode ?). Copy the AutoSaveU.dll file to "C:\Program Files (x86)\Notepad++\plugins\" and you should be back in business.
Update: After running for a few days with Autosave enabled, found that automatic spell check and the ability to right click on a word or phrase would randomly disappear. Disabling "Auto Save when Notepad++ looses focus" solves that problem. For now, have decided that spell check and right clicking are more important than auto-saving.
I have found the best solution to this, if you install notepad++ and use 'Resource Hacker' (google it) to change the menu (cut it down) and the icon (change to notepad), and install the autosave plugin in notepad++, then you have something that looks almost entirely indistinguishable to classic notepad! And txt files have the notepad logo.
Also you need to go into settings and turn off a bunch of settings, including under editing tab, turn off line numbering, and change colours in 'style configurator'.
The only notable difference is that highlighted text remains black.
Check out this image to see how close it is, you could even cut and rename menu items to look identical but there is no need to be that pedantic.

IntelliJ Macro menu

I've just started playing with macros in IntelliJ. I recorded several then played back until I decided to add keymap shortcuts to my macros. I went to Settings and pressed Alt+C to add a new child map because I couldn't edit the parent. Since then the macros are no longer accessible from the Tools menu, not to mention that the shortcuts don't work. I tried removing the shortcuts from the keymap but even though I press Alt+R or Alt+L, it still does not revert them back. And TAB has stopped working .. when writing sout +TAB ..nothing happens anymore... HELP
Sorted! sout+TAB is part of live templates..
If you open the IDE Settings window, you will see Live Templates.. Under output you should find sout(Prints a string to System.out).. if not, click Add and then type sout for the Abbreviation section, type in a description and then for the template text put System.out.println("$END$");
I use the Default keymap in IntelliJ now...
Thought this might help someone...
You can try to use the default keymap. When you modify the default keymap, a copy is created with your settings.
If that is not working, you can try to quit IntelliJ and to delete this file:
/.IntelliJIdea90/config/options/macros.xml
and check also for the folder
/.IntelliJIdea90/config/keymaps
To find the location of the config folder you should look for the file : idea.properties in the folder where the main executable for idea is.
Look for the line:
# path to IDEA config folder. Make sure you're using forward slashes
idea.config.path=${idea.home}/.IntelliJIdea90/config
And this is the location of the config. folder.
Restart IntelliJ.
Take a copy of any file you are going to delete!