Not able to zoom in and out in vs code - visual-studio-code

I'm a newbie
I'm trying to zoom in using Ctrl+= but I'm getting a message "Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again."
Clicking on "Open Setting" is opening another file named "{} setting.json 1", the code in that file is:
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
cout <<"Hello World!\n";
}
There is a red underline on #include
What should I do?

Welcome to stackoverflow, Nikhil!
For me Ctrl-shift-plus works to zoom in (hold control & shift, then press +, the plus button, which on the US standard keyboard shares a key with the equal sign). Then Ctrl with the minus button zooms back out.
Work for you?

Your settings file obviously contains some C++ code, that shouldn't be in there. Delete everything from the file and save it. This will remove the red "1" next to the file name, which is indicator that the file contains errors. Afterwards you should be able to set the zoom level again.

Related

How to auto import FLUTTER packages Visual Studio Code ver: 1.51.1 Windows 10

I watch youtube tutorials and when the presenter types part of a screen name the import is automatically created. In one video the presenter enters part of a screen name and a list appears with the required screen at the top. He presses tab and the import is generated. When I do it the list appears I press tab and nothing happens. I have checked for "auto import" in the extension marketplace but am unable to locate one for Dart. Every video I watch it works. It is such a silly little thing but it is driving me crazy, which is not good for my blood pressure. :) Somebody please help me because I have tried searching the net and youtube.
First type the name of class you wish to import.
Since it has not already been imported, VSCode shows red underline below that identifier name. Make sure your cursor is pointed to that unrecognized identifier name and depending on your platform, press
ctrl + . or cmd + .
to see a list of available quick fixes.

How do I select all text in vistual studio code?

In visual studio code (1.29.1) ctrl+a doesn't do anything for me. I checked keyboard shortcuts and it's mapped to a few select all actions (editor.action.selectAll, etc.) but when I'm in a file and press it nothing happens. How do I select all text in the current file in visual studio code?
Thanks for the comments, it make me realize it must be an environmental issue. Turns out if you have any mapping starting with a key combination that will lock that mapping to the key combo and you can't use it for anything else.
To make save all ctrl+shift+s I had to re-map save as and I mapped it to ctrl+a+s, so everytime I hit ctrl+a it just waiting for second key. In the status bar at the bottom of my editor it said something like "Ctrl+a detected, waiting for second keystroke", which means Ctrl+a won't work on its own. I re-mapped Save As to some unused key combo and it fixed select all.
This question was luckily answered on another thread
I'll post the OG answer here, nonetheless.
Most new comers to VS-Code could resolve this issue with the 2nd method provided by the OG answer:
Goto File > Preferences > Keyboard Shortcuts
in the search bar type this Select All
There's should a couple of results, you'll obviously want the "Select All" result
right click on his line and click on Change When Expression
a textbox would be highlight for you to fill in text. type editorFocus
press enter and done!
The OG answer provides image if you need to confirm that you're doing it right.
side-note: This issue bugged for more than 3 years and is the main reason my I used VS-Community over VS-Code.
So it's nice to finally be able to work normally in this very robust customizable IDE text-editor.

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

What are the must know shortcuts in Xcode for faster application development?

What are the must know shortcuts in Xcode for faster application development?
As a special interest, the Mac shortcut I want to know is the one to open application menus (File, Edit, View, Project, Build etc.,). In Windows, if we type Alt + F, the File menu will drop down, and we can navigate through the sub-menus using the arrow keys or typing the letters that are underlined in the menus. How can we do something like that in Mac?
Thanks..
For debugging:
CMD+SHIFT+I (step into)
CMD+SHIFT+O (step)
Building & Running:
CMD+B (build project)
OPT+CMD+ENTER (debug project)
This is the PDF for all the shortcuts of Xcode
All Xcode Shorcuts
I hope it helps.
Alt + Cmd + Up to toggle between .h and .m files of a class
Cmd + ' to move to next error or warning
Cmd + Shift + ' to move to previous error or warning
Column Selection: Holding down the option key while dragging allows you to perform a column based selection of text. Might be useful in limited circumstances.
Control-. to select the next autocompletion, control-/ to select the next placeholder (add shift for previous), control-escape to show autocompletion list.
As a response to your request, if you have full keyboard access turned on, control-fn-F2 will select the menu bar. Then use the arrows to select an item, and space to choose it.
These shortcuts are for Xcode 3.2.x (they may vary from Xcode 3.1.x and other versions):
Command-double click on symbol/method name in source code editor > Open the .h file for symbol
Option-double click on symbol/method name in source code editor > Open the documentation for symbol
Command-Option-Shift-F > Find Selected Text in Project (custom shortcut)
I have the following one setup in User Scripts under Code to insert a standard logging call:
The inserted text is:
NSLog(#"[%# %#]", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
Shift-Command-D (Xcode 3.2) / Shift-Command-O (Xcode 4): Open quickly. Great way to get to the file you want.
"Alt + Cmd + Up to toggle between .h and .m files of a class"
This seems to have been disabled in Xcode 4. I've not been able to find a way to set it in Bindings, either. Any hints?
Update: Just found it. It has been changed to "Ctrl + Cmd + Up". It can also be executed with a three finger swipe up or down.
The command, by the way, is called "Jump to Next Counterpart". I knew that.... :-/
Sometimes it takes a Ph.D. in linguistics to figure computer terminology out. And I've been doing this since the early 80s.
Click on any method name in the Xcode.
Then use ALT + CMD + / to insert comments describing the input and return parameters.
This will encourage you to write descriptive comments explaining what is the method supposed to do, thus leading to a more maintainable code.
Use CMD + SHIFT + O to open the Open Quickly Dialog. While you type classes, methods and files will appear matching your entered description. Pressing enter will go to said method, class or file. This greatly improved productivity for me.

when i click the drive shoing opwn with window dialog box

When i click the c-drive it is now opening , instead it showing the dialog box,
please check the screen shot ,
When i click the c-drive it opening like this screen shot
image-url
Well, I googled a bit and was able to find
this.
You should also try opening the drive by clicking Explore in the context menu and see if there is an autorun.inf file that you could have copied by accident. It's probably going to be a hidden one, and maybe even a protected one, so check your Folder Option to make sure it shows all files. Although, that does sounds like something a virus would do.