简体   繁体   中英

Default code editor in Visual studio 2013

I am learning C++ as well using VS 2013. Yesterday, I wrote some code but today when I click/double click to open the source code, it opens with Notepad inside VS2013.

看到图片在这里!

What is the problem here?

It turned out that the file was actually corrupted as I shutdown the computer yesterday.

像这样在记事本++

I went into the projects folder > MyPointer > Mypointer.cpp opened with Notepad++ and found the file is corrupted as in picture above. I deleted the corrupted code and rewrote the code, saved and opened the project in VS2013 and the file opens fine.

Inside visual studio:

  • right click the source file you want to open
  • Select 'open with'
  • In the window that appears, select 'C++ source Code Editior'
  • Click 'Set as default'
  • Click 'Ok'

From now on it should work.

Visual Studio keeps a list of file extensions and program mappings. By default Visual Studio opens every file type it is designed for in its own editor window, but you can change that. This has been the case for nearly all Visual Studio Versions.

Its also easy to change that behavior. Right-click on the file and select "open with..." and you will be presented a range of tools that Visual Studio knows. There you also find the "As default" button that sets the default program that starts on double-clicking the file next time.

The dialog looks something like this

默认程序选择

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM