Updating vscode doesn't show user code snippets.
If I move the cursor after entering the prefix, it appear only then.
This issue can be resolved by following these steps:
Close Visual Studio Code.
Go to your user snippets folder, usually located at ~/.config/Code/User/snippets (for Linux), %APPDATA%\Code\User\snippets (for Windows) or ~/Library/Application Support/Code/User/snippets (for Mac).
Backup your user snippets folder by renaming it to something like snippets_backup.
Reopen Visual Studio Code.
Check if your user snippets are appearing now.
If the above steps don't solve the problem, you can try clearing the Visual Studio Code's cache:
Go to the Command Palette (Ctrl + Shift + P on Windows, or Cmd + Shift + P on Mac).
Type in "Developer: Delete Settings File".
Select the option "Developer: Delete Settings File" from the dropdown.
Confirm the deletion of the settings file by clicking on the "Yes" button.
Reopen Visual Studio Code.
These steps should resolve the issue with your user code snippets not appearing after updating Visual Studio Code.
I am getting a popup to choose a command to run when pressing the rename/refactor shortcut. I highlight a file in the Package Explorer, press the command, and popup!?!?!
I have used Eclipse for 13 years, and I have never seen anything like this issue. The rename/refactor shortcut has worked flawlessly on every other instance of Eclipse I have ever used.
The closest help which Google could find is to open the shortcut preferences. I unbinded every command associated to the shortcut binding. Still, the popup continues to appear.
If any of this helps, I am on MacOS Monterey 12.5 and using Eclipse 4.22.0.
Shortcut Command Choice Popup
There are some guides in stackoverflow for opening multiple windows in Visual Studio. But it is inside the Visual Studio they are talking about.
Here is what I want. There is one txt file called A.txt in my desktop, I right click it and the context option shows Open With Code, and I open it. There is another txt file called B.txt in my desktop. While I right clit it and open it with visual studio code, both the two files are in the same window.
Is there any setting that the two files can be opened in two windows?
Not sure why you want that but actually there is a setting which behaves like you want when turned to "On":
Window: Open Files In New Window Controls whether files should open in
a new window when using a command line or file dialog. Note that there
can still be cases where this setting is ignored (e.g. when using the
--new-window or --reuse-window command line option).
You can find it via: User -> Window -> New Window
You can quickly open the settings dialog by pressing CTRL + ,
I use vs-code as my go-to editor on Windows. Recently I've installed on Ubuntu and now the default key mapping is different.
Is there any way I can set the key mapping on Ubuntu similar to what they were for Windows, or at least a subset of it?
I have created an extension that provides the default Windows keybindings. It is on the VSCode extension marketplace and called Windows Default Keybindngs.
I have tested it on Linux with VSCode 1.38.0 and 1.36.1.
The new bindings take precedence where there is a conflict, but existing, non-conflicting bindings are still available.
Basically all I did was use HolyBlackCat's suggestion to run "Preferences: Open Default Keyboard Shortcuts (JSON)" and stuff the result into the appropriate place in package.json. (Plus document it and figure out how to publish it!)
Update 2020-06-05: In response to a question in a comment, I did a search and found LinuxKeybindings, an extension that provides the default Linux bindings. I have not tried it myself but this could be useful for those wanting the Linux bindings instead of Windows bindings.
A quick way to transfer the default keymap without an extension:
VS Code Windows (source)
open "Show All Commands" / Ctrl+Shift+P
select Open Default Keyboard Shortcuts (JSON) (docs)
Note: #Ville Venäläinen's answer did not work for me for default key bindings.
copy everthing to clipboard or a temporary file (like you need it)
VS Code Linux (target)
open user keybindings / CTRL + K CTRL + S → click Open Keyboard Shortcuts (JSON) button
paste all previously copied settings to this file. If you already have custom user settings, make sure to don't overwrite them. Also preserve the file JSON structure [{}, {}, ...].
Additional notes
You can make a backup of the keymaps before. Default file locations analogue to settings.json:
Linux: $HOME/.config/Code/User/keybindings.json
Windows: %APPDATA%\Code\User\keybindings.json
If needed, also copy custom user keyboard shortcuts in source and append them in the target keybindings.json file (as explained above).
This worked well for me with a Debian target distro. If you should happen to get a key conflict, just delete or change the relevant key binding for this case.
At least with the latest VSCode, you can go to File -> Preferences -> Keyboard Shortcuts. On that page, there is a text under the search field: For advanced customizations open and edit keybindings.json. That will open you a view showing the default keybindings on the left and an empty file on the right for your own bindings. You can try to copy those bindings from Windows and save the to your Ubuntu one.
If you're not customizing your keymap, look through VSCode Keymaps for keymaps and install on both Windows and Ubuntu.
I personally use the code-settings-sync extension.
Synchronize Settings, Snippets, Themes, File Icons, Launch, Keybindings, Workspaces and Extensions Across Multiple Machines Using GitHub Gist.
I have my default editor for .ahk files set to Notepad++ Portable on my work laptop, but selecting Edit This Script opens files in the standard Windows Notepad.
A post on the AHK forums suggests editing the registry, but I don't see any entries under HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command.
How can I configure AutoHotkey to edit scripts with Notepad++?
For whatever reason, the Registry entry doesn't exist by default, but it is recognized by the application once created.
Navigate to HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell in RegEdit.
Right-click the Shell folder, select New > Key and name this Edit.
Right-click the Edit folder, select New > Key and name this Command.
Double click the (Default) string entry in Command.
Paste in "C:\Program Files\Notepad++\Notepad++.exe" "%1" to this window.
Reload AutoHotkey for the changes to take effect.
Note: I don't use Notepad++, but this works for VS Code on my system, and will for N++ as long as the directory information for the executable is correct.
The corresponding .reg file looks like this:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command]
#="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\""
The registry entry in item 5 of the previous answer did not work. I don't even know what the extra %* at the end means, so I simplified it to:
"C:\Program Files\Notepad++\Notepad++.exe" "%1"
For AHK version 2, changing the registry didn't work for me (I tried both Computer\HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command and Computer\HKEY_CLASSES_ROOT\.ahk\Shell\Edit\Command), but this did it for me. It adds two menu items to the AHK tray menu after a divider:
EditWithNotepadPlusPlus(*)
{
Run "C:\Program Files\Notepad++\notepad++.exe " A_ScriptFullPath
}
EditWithVsCode(*)
{
Run "C:\Program Files\Microsoft VS Code\Code.exe " A_ScriptFullPath
}
A_TrayMenu.Add()
A_TrayMenu.Add("Edit with VS Code", EditWithVsCode)
A_TrayMenu.Add("Edit with Notepad++", EditWithNotepadPlusPlus)
return
If you are like me and you are hesitant to modify the registry, there is a way to do this using AutoHotKey code.
This is a method I use to edit the script with a different editor. Although I am using Visual Studio Code, the method is the same no matter which editor you want to use. One caveat though: we can't change the existing "Edit This Script" menu item, since that is considered one of the standard menu items and can't be modified. Instead I am adding a new menu item at the top of the menu that says "Edit With Notepad++".
EditWithNotepadPlusPlus()
{
Run "C:\Program Files (x86)\Notepad++\notepad++.exe" "%A_ScriptFullPath%"
}
; Remove the standard menu items temporarily
Menu, Tray, NoStandard
; Add our custom menu item labeled "Edit With Notepad++"
; and calls the function above
Menu, Tray, Add, Edit With Notepad++, EditWithNotepadPlusPlus
; Add a separator
Menu, Tray, Add
; Put the standard menu items back, under our custom menu item
Menu, Tray, Standard
Note: If you're wondering, the lines Menu, Tray, NoStandard and Menu, Tray, Standard are not required. The reason I use those lines is because by default, Menu, MenuName, Add adds menu items to the bottom of the menu. For aesthetic and practical reasons, I prefer Exit to be the last menu item. So Menu, Tray, NoStandard and Menu, Tray, Standard will cause our menu item to appear at the top.
One added benefit of this method is that if you transfer your scripts to a new computer, it should still work (provided you have Notepad++ installed on the other computer). If you edit the registry, you have to remember to edit the registry again.
Using AHK v1.1.3.02 on Win10 with string
"C:\Program Files\TextPad 8\TextPad.exe" "%1"
worked well.
The registry change mentioned in other answers for me worked, but you may want to further add the following flags:
C:\Program Files (x86)\Notepad++\notepad++.exe %1 -multiInst -nosession
These flags will stop Notepad++ from recognizing this window as part of your overall session, so it won't overwrite your normal session history or anything. I don't remember where I first found these solutions but I'm switching computers atm and found them in my registry and noticed they weren't mentioned anywhere in this thread.
Was not working for me, i fixed it by first using the suggestion by R River
C:\Program Files (x86)\Notepad++\notepad++.exe %1 -multiInst -nosession
But this would create a new session each time, so i tried removing the end parameters and it now works.
C:\Program Files (x86)\Notepad++\notepad++.exe %1
Simplest way I've found is to:
Right click the .ahk file
Select "Open with" -> "Choose another app"
Check "Always use this app to open .ahk files"
Then select NotePad++ from the list
If it's not listed select "More Apps" and scroll down to NotePad++. (Mind you this example is Windows 10 specific, but previous versions are very similar.)
Editing the registry is great, don't get me wrong, but it takes longer. It's kinda like using a truck to swat a fly! Anyways, hope this works for you. I use it all the time to set the file associations I want.