Visual studio 2012 как поменять тему
Как большинство интегрированных сред разработки, система Visual Studio 2013 построена на основе главного окна редактирования кода. Со временем система эволюционировала и теперь представляет собой нечто большее, чем простой текстовый редактор. Несмотря на то что большинство разработчиков по-прежнему проводят значительное время, работая над кодом программ в области редактирования, все большее количество проектировщиков имеют возможность решать такие задачи, как создание форм, настройка параметров проекта и редактирование ресурсов. Независимо от того, пишете ли вы код или создаете форму проекта, вам придется провести много времени в системы Visual Studio 2013. По этой причине важно знать, как наладить среду так, чтобы ваша работа была более эффективной.
Одним из важных нововведений, появившемся в Visual Studio 2012, является возможность менять цветовые темы (color themes). Дизайн предыдущих версий Visual Studio изобиловал различными градиентами и графическими эффектами, в то время, как, начиная с версии 2012, появился более "строгий" монотонный графический интерфейс, который используется и в Visual Studio 2013. Благодаря цветовым темам можно изменять графический интерфейс. Существует три основных темы: темная (dark), светлая (light) и синяя (blue). Синяя тема добавлена в Visual Studio 2013 для людей, которые привыкли работать с более старыми версиями Visual Studio.
Для смены темы используйте диалоговое окно Tools --> Options, в котором в разделе Environment --> General можно изменить тему из выпадающего меню. На рисунках ниже показаны темная и светлая темы:
Шрифты и цвета
Одной из первых настроек, которую презентаторы программ обычно изменяют в системе Visual Studio, стремясь повысить читабельность кода, являются шрифты и цвета в области редактирования. Однако это делают не только презентаторы. Выбрав шрифт и цвет, которые не утомляют глаза, вы можете повысить производительность своей работы. На рисунке ниже показаны узлы Fonts и Colors в диалоговом окне Options, позволяющие настроить шрифт, размер, цвет и стиль разных элементов экрана. Следует лишь помнить, что эти узлы диалогового окна Options загружаются очень долго, поэтому старайтесь не открыть их непреднамеренно.
Для того чтобы изменить визуальное представление конкретного текстового элемента в системе Visual Studio 2013, сначала выберите область интегрированной среды разработки, к которой хотите применить новые настройки. Например, на рисунке был выбран элемент Text Editor. Это предопределило элементы, которые должны были появиться в списке Display Items. Выбрав требуемый элемент в этом списке, настройте шрифт и цвета.
Некоторые элементы этого списка, например Plain Text, используются во многих областях системы Visual Studio 2013, поэтому последствия изменения шрифтов и цветов иногда могут быть непредсказуемыми.
Выбирая шрифт, помните, что пропорциональные шрифты, как правило, не так эффективны для написания программ, как непропорциональные (известные также как моноширинные). Моноширинные шрифты выделены полужирным, что позволяет легко найти их.
Принципы визуального представления
На нижнем рисунке продемонстрированы еще две возможности визуального представления кода. Во-первых, слева от маркеров блоков кода указаны номера строк. Эту возможность можно подключить с помощью флажка Line Numbers, расположенного под флажками Word Wrap и VisualGlyphs. Другая возможность - это точки, обозначающие пробелы в тексте кода. В отличие от других элементов визуального представления эту возможность можно включить с помощью команды Edit --> Advanced --> View White Space, при условии, что область редактирования находится в фокусе.
Полноэкранный режим
Когда пользователь открывает много инструментальных окон и панелей, пространство для редактирования кода быстро уменьшается. По этой причине в системе Visual Studio 2013 предусмотрен полноэкранный режим, запустить который можно с помощью команды View --> Full Screen. В качестве альтернативы можно нажать комбинацию клавиш Shift+Alt+Enter , которая включает и отключает полноэкранный режим. На рисунке ниже показана верхняя часть окна системы Visual Studio 2013 в полноэкранном режиме, в котором не видны ни инструментальные панели, ни инструментальные окна, причем окно раскрыто максимально широко, так, что даже кнопки Minimize, Restore и Close не видны:
Если вы используете несколько экранов, то полноэкранный режим может оказаться очень полезным. Открепите инструментальные окна и расположите их на втором мониторе. Когда окно редактирования находится в полноэкранном режиме, вы получаете доступ к инструментальным окнам, не переключая режимы. Если вы открепите окно редактирования кода, оно не перейдет в полноэкранный режим.
Отслеживание изменений
Для того чтобы обогатить возможности редактирования, система Visual Studio 2013 предусматривает отслеживание строк, изменившихся в ходе сеанса редактирования. Когда вы открываете файл для редактирования, ни одна из строк не раскрашена. Но когда вы начнете редактировать текст, то заметите желтую метку возле измененных строк. На рисунке ниже показано, что строка, содержащая ссылку на объект MessageBox, была модифицирована за время, прошедшее с момента последнего сохранения файла:
После сохранения файла в конце измененных строк появится зеленый маркер. На рисунке выше видно, что первая строка, содержащая ссылку на объект MessageBox, была изменена за время, прошедшее с открытия файла, но эти изменения уже записаны на диск. В то же время вторая строка, содержащая ссылку на объект MessageBox, еще не была сохранена.
Если вы не считаете полезной возможность отслеживать изменения строк, отключите ее, сбросив флажок Text Editor --> Genera --> Track Change в окне Options.
В этой статье мы настроим цветовую тему Visual Studio. Мы также настроим цвета для двух различных типов текста в редакторе кода.
Установите Visual Studio бесплатно со страницы скачиваемых материалов Visual Studio, если еще не сделали этого.
Настройка цветовой темы для интегрированной среды разработки
По умолчанию в пользовательском интерфейсе Visual Studio установлена темная тема. Далее рассмотрим, как изменить ее на другую цветовую тему.
В строке меню выберите Сервис > Параметры.
В списке параметров выберите Среда > Общие.
В списке Цветовая тема выберите нужную тему: заданную по умолчанию темную тему, синюю тему, синюю тему с повышенной контрастностью или светлую тему. Также можно выбрать параметр Использовать настройки системы, чтобы выбрать тему, используемую в Windows.
При изменении цветовой темы шрифты текста и их размер в интегрированной среде разработки возвращаются к значениям по умолчанию или ранее настроенным значениям.
Требуется больше тем? Ознакомьтесь с широким набором настраиваемых тем в магазине Visual Studio Marketplace. Дополнительные сведения о примерах новых настраиваемых тем Visual Studio 2022 на основе VS Code см. в записи блога Новая коллекция тем Visual Studio.
Из этой статьи вы узнаете, как переключить синюю цветовую тему Visual Studio на темный режим. Мы также настроим цвета для двух различных типов текста в редакторе кода.
Установите Visual Studio бесплатно со страницы скачиваемых материалов Visual Studio, если еще не сделали этого.
Настройка цветовой темы для интегрированной среды разработки
По умолчанию в пользовательском интерфейсе Visual Studio установлена синяя тема. Давайте изменим ее на тему Темная.
В строке меню, где расположены такие вкладки, как Файл и Правка, выберите Сервис > Параметры.
На странице параметров Среда > Общие измените значение параметра Цветовая тема на Темная и нажмите кнопку ОК.
Цветовая тема для всей среды разработки (IDE) Visual Studio изменяется на Темная.
Вы можете создать собственные темы, установив конструктор цветовых тем Visual Studio из Visual Studio Marketplace.
Из этой статьи вы узнаете, как переключить синюю цветовую тему Visual Studio на темный режим. Мы также настроим цвета для двух различных типов текста в редакторе кода.
Установите Visual Studio бесплатно со страницы скачиваемых материалов Visual Studio, если еще не сделали этого.
Настройка цветовой темы для интегрированной среды разработки
По умолчанию в пользовательском интерфейсе Visual Studio установлена синяя тема. Давайте изменим ее на тему Темная.
В строке меню, где расположены такие вкладки, как Файл и Правка, выберите Сервис > Параметры.
На странице параметров Среда > Общие измените значение параметра Цветовая тема на Темная и нажмите кнопку ОК.
Цветовая тема для всей среды разработки (IDE) Visual Studio изменяется на Темная.
Вы можете выбрать дополнительные предопределенные темы, установив редактор цветовых тем Visual Studio из Visual Studio Marketplace. Когда вы установите это средство, в раскрывающемся списке Цветовая тема появятся дополнительные темы.
Изменение цветов текста в редакторе
Теперь настроим несколько цветов текста для редактора. Сначала создадим XML-файл, чтобы просмотреть цвета по умолчанию.
В строке меню выберите Файл > Создать > Файл.
В диалоговом окне Новый файл в разделе Общие выберите XML-файл и нажмите кнопку Открыть.
Вставьте приведенный ниже XML-код под строкой с .
Обратите внимание, что цвет номеров строк бирюзовый, а атрибутов XML (например id="bk101" ) — голубой. Давайте изменим цвет этих элементов.
Чтобы открыть диалоговое окно Параметры, в строке меню выберите Сервис > Параметры.
В разделе Среда выберите категорию Шрифты и цвета.
Обратите внимание, что в поле Показать параметры для указано значение Текстовый редактор,—именно это нам и нужно. Раскройте список, чтобы узнать, для каких еще элементов можно настроить шрифты и цвет текста.
Чтобы изменить цвет номера строки, в списке Отображение элементов выберите Номер строки. В поле Основной цвет элемента выберите Оливковый.
Некоторые языки имеют собственные параметры шрифтов и цветов. Если вы являетесь разработчиком на C++ и хотите изменить цвет, используемый для выделения функций, найдите элемент Функции C++ в списке Отображение элементов.
Прежде чем закрыть диалоговое окно, давайте также изменим цвет атрибутов XML. В списке Отображение элементов прокрутите вниз до элемента Атрибут XML и выберите его. В поле Основной цвет элемента выберите Травяной. Нажмите ОК, чтобы сохранить изменения и закрыть диалоговое окно.
Мы изучили только некоторые способы настраивать цвета в Visual Studio. Ознакомьтесь с другими возможностями в диалоговом окне Параметры, чтобы настроить Visual Studio в соответствии со своими предпочтениями.
In this how-to article, we'll customize the Visual Studio color theme. Then, we'll customize the colors for two different types of text in the code editor.
If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.
Set the color theme for the IDE
The default color theme for Visual Studio's user interface is Dark. Here's how to change it to a different color theme.
On the menu bar, select Tools > Options.
In the options list, select Environment > General.
In the Color theme list, choose between the default Dark theme, the Blue theme, the Blue (Extra Contrast) theme, and the Light theme. Or, choose the Use system setting option to select the theme that Windows uses.
When you change a color theme, text in the IDE reverts to the default or previously customized fonts and sizes for that theme.
Want even more themes to choose from? Check out the wide range of custom themes on the Visual Studio Marketplace. And to see examples of new Visual Studio 2022 custom themes based on VS Code, take a look at the Introducing a collection of new Visual Studio themes blog post.
In this how-to article, we'll customize the Visual Studio color theme from the blue theme to the dark theme. Then, we'll customize the colors for two different types of text in the code editor.
If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.
Set the color theme for the IDE
The default color theme for Visual Studio's user interface is Blue. Let's change it to Dark.
On the menu bar, which is the row of menus such as File and Edit, choose Tools > Options.
On the Environment > General options page, change the Color theme selection to Dark, and then choose OK.
The color theme for the entire Visual Studio development environment (IDE) changes to Dark.
You can create your own themes by installing the Visual Studio Color Theme Designer from the Visual Studio Marketplace.
In this how-to article, we'll customize the Visual Studio color theme from the blue theme to the dark theme. Then, we'll customize the colors for two different types of text in the code editor.
If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.
Set the color theme for the IDE
The default color theme for Visual Studio's user interface is Blue. Let's change it to Dark.
On the menu bar, which is the row of menus such as File and Edit, choose Tools > Options.
On the Environment > General options page, change the Color theme selection to Dark, and then choose OK.
The color theme for the entire Visual Studio development environment (IDE) changes to Dark.
You can install additional predefined themes by installing the Visual Studio Color Theme Editor from the Visual Studio Marketplace. After you install this tool, additional color themes appear in the Color theme drop-down list.
Change text colors in the editor
Now we'll customize some text colors for the editor. First, let's create a new XML file to see the default colors.
From the menu bar, choose File > New > File.
In the New File dialog box, under the General category, choose XML File, and then choose Open.
Paste the following XML below the line that contains .
Notice that the line numbers are a turquoise-blue color, and the XML attributes (such as id="bk101" ) are a light blue color. We're going to change the text color for these items.
To open the Options dialog box, choose Tools > Options from the menu bar.
Under Environment, choose the Fonts and Colors category.
Notice that the text under Show settings for says Text Editor—this is what we want. Expand the drop-down list just to see the extensive list of places where you can customize fonts and text color.
To change the color of the line numbers text, in the Display items list, choose Line Number. In the Item foreground box, choose Olive.
Some languages have their own specific fonts and colors settings. If you are a C++ developer and you want to change the color used for functions, for example, you can look for C++ Functions in the Display items list.
Before we exit out of the dialog box, let's also change the color of XML attributes. In the Display items list, scroll down to XML Attribute and select it. In the Item foreground box, choose Lime. Choose OK to save our selections and close the dialog box.
We explored just a couple ways of customizing the colors in Visual Studio. We hope that you'll explore the other customization options in the Options dialog box, to truly make Visual Studio your own.
When I use a standard Windows aero theme in Windows 8, the VS2012 lets me to choose between light and dark themes, but I created myself a convenient high contrast theme in Windows 8, and now there is only a greyed option in the VS settings that says "high contrast", and I cannot change it.
I belong to the few people, who like the new dark theme of Visual Studio, but unfortunately I can't use it with the new high contrast Windows themes.
Can someone help me with this one?
4 Answers 4
My colleague found a way to use the Dark theme in Visual Studio when Windows uses the High Contrast mode. He followed these steps:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Themes (this should the key of the Dark theme)
In the exported file replace the GUID of the Dark Theme () with the GUID of the High Contrast theme ():
Import the reg file
Start Visual Studio. This works for him. It's even possible to mix theme settings from the High Contrast theme with those of the Dark theme. Just replace one of the subkeys content with one of the subkeys of another theme.
The GUID's for the themes appear to be the same on both our systems. But you should always check them before you try this. Also a backup of the keys is recommended!
Also works for VS2013 by the way. Just substitute 11.0_Config with 12.0_Config in the registry key name and check the GUIDs of the keys just to be sure.
Have no idea why, but on VS 2015 on Win10 x64 it does not work. I spoiled up registry GUID's, switched back system theme from HighContrast and it works while Themes GUID's are messed. The same happens when I switch to HighContrast - it works like default, nothing changed, nothing gives error. The only thing changes is disabled combobox with "HighContrast" to "Dark".
Worked for me, I'm using VS 2015 + Win10 64x. In the registry I've changed the directory:"HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\Themes".
As so many people are interested, is there any way to get Microsoft to understand they should provide an official option for this.
Here's the register change that changes the high contrast skin into the dark skin in Visual Studio 2015. By applying this file you can use the dark skin when Windows runs in High Contrast.
USE AT OWN RISK.
Export the reg values for the High contrast and Dark skin from HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\Themes\ (You can see which one it is at the value from the name field)
Change the GUID in the Dark Skin export to the GUID from the High Contrast skin export. (Use "Replace All" to do this) (The GUID looks something like this: )
Addition: Copy the values from the Workflow Designer part of the High Contrast skin export and paste it in the Dark skin export (this layout is better than the Dark skin layout for this designer)
Save the changed Dark skin export and execute it while VS2015 is not running.
Color themes let you modify the colors in Visual Studio Code's user interface to suit your preferences and work environment.
Selecting the Color Theme
- In VS Code, open the Color Theme picker with File >Preferences >Color Theme. (Code >Preferences >Color Theme on macOS).
- You can also use the keyboard shortcut ⌘K ⌘T (Windows, Linux Ctrl+K Ctrl+T ) to display the picker.
- Use the cursor keys to preview the colors of the theme.
- Select the theme you want and press Enter .
The active color theme is stored in your user settings (keyboard shortcut ⌘, (Windows, Linux Ctrl+, ) ).
Tip: By default, the theme is stored in your user settings and applies globally to all workspaces. You can also configure a workspace specific theme. To do so, set a theme in the Workspace settings.
Color Themes from the Marketplace
There are several out-of-the-box color themes in VS Code for you to try.
Many more themes have been uploaded to the VS Code Extension Marketplace by the community. If you find one you want to use, install it and restart VS Code and the new theme will be available.
You can search for themes in the Extensions view ( ⇧⌘X (Windows, Linux Ctrl+Shift+X ) ) search box using the @category:"themes" filter.
Auto switch based on OS color scheme
Windows and macOS support light and dark color schemes. There is a setting, window.autoDetectColorScheme , that instructs VS Code to listen to changes to the OS's color scheme and switch to a matching theme accordingly.
To customize the themes that are used when a color scheme changes, you can set the preferred light, dark, and high contrast themes with the settings:
- workbench.preferredLightColorTheme - defaults to "Default Light+"
- workbench.preferredDarkColorTheme - defaults to "Default Dark+"
- workbench.preferredHighContrastColorTheme - defaults to "Default High Contrast"
- workbench.preferredHighContrastLightColorTheme - defaults to "Default High Contrast Light"
Customizing a Color Theme
Workbench colors
You can customize your active color theme with the workbench.colorCustomizations and editor.tokenColorCustomizations user settings.
To set the colors of VS Code UI elements such as list & trees (File Explorer, suggestions widget), diff editor, Activity Bar, notifications, scroll bar, split view, buttons, and more, use workbench.colorCustomizations .
You can use IntelliSense while setting workbench.colorCustomizations values or, for a list of all customizable colors, see the Theme Color Reference.
To customize a specific theme only, use the following syntax:
If a customization applies to more than one themes, you can name multiple themes or use * as wildcard at the beginning and the end of the name:
Editor syntax highlighting
To tune the editor's syntax highlighting colors, use editor.tokenColorCustomizations in your user settings settings.json file:
A pre-configured set of syntax tokens ('comments', 'strings', . ) is available for the most common constructs. If you want more, you can do so by directly specifying TextMate theme color rules:
Note: Directly configuring TextMate rules is an advanced skill as you need to understand on how TextMate grammars work. Go to the Color Theme guide for more information.
Again, to customize specific themes, you can do this in one of the following ways:
Editor semantic highlighting
Some languages (currently: TypeScript, JavaScript, Java) provide semantic tokens. Semantic tokens are based on the language service's symbol understanding and are more accurate than the syntax tokens coming from the TextMate grammars that are driven by regular expressions. The semantic highlighting that is computed from the semantic tokens goes on top of syntax highlighting and can correct and enrich the highlighting as seen in the following example:
The "Tomorrow Night Blue" color theme without semantic highlighting:
The "Tomorrow Night Blue" color theme with semantic highlighting:
Notice the color differences based on language service symbol understanding:
- line 10: languageModes is colored as a parameter.
- line 11: Range and Position are colored as classes and document as a parameter.
- line 13: getFoldingRanges is colored as a function.
The settings editor.semanticHighlighting.enabled serves as the main control on whether semantic highlighting is applied. It can have values true , false , and configuredByTheme .
- true and false turn semantic highlighting on or off for all themes.
- configuredByTheme is the default and lets each theme control whether semantic highlighting is enabled or not. All the themes that ship with VS Code (for example, the "Dark+" default) have semantic highlighting enabled by default.
Users can override the theme setting by:
When semantic highlighting is enabled and available for a language, it is up to the theme to configure whether and how semantic tokens are colored. Some semantic tokens are standardized and map to well-established TextMate scopes. If the theme has a coloring rule for these TextMate scopes, the semantic token will be rendered with that color, without the need for any additional coloring rules.
Additional styling rules can be configured by the user in editor.semanticTokenColorCustomizations" :
To see what semantic tokens are computed and how they are styled, users can use the scope inspector (Developer: Inspect Editor Tokens and Scopes), which displays information for the text at the current cursor position.
If semantic tokens are available for the language at the given position and enabled by theme, the inspect tool shows a section semantic token type . The section shows the semantic token information (type and any number of modifiers) as well as the styling rules that apply.
More information on semantic tokens and styling rule syntax can be found in the Semantic Highlighting Guide.
Creating your own Color Theme
Creating and publishing a theme extension is easy. Customize your colors in your user settings then generate a theme definition file with the Developer: Generate Color Theme From Current Settings command.
VS Code's Yeoman extension generator will help you generate the rest of the extension.
See the Create a new Color Theme topic in our Extension API section to learn more.
Remove default Color Themes
If you'd like to remove some of the default themes shipped with VS Code from the Color Theme picker, you can disable them from the Extensions view ( ⇧⌘X (Windows, Linux Ctrl+Shift+X ) ). Open the . More Actions dropdown menu from the top of the Extensions view, select Show Built-in Extensions, and you'll see a THEMES section listing the default themes.
You can disable a built-in theme extension as you would any other VS Code extension with the Disable command on the gear context menu.
File Icon Themes
File icon themes can be contributed by extensions and selected by users as their favorite set of file icons. File icons are shown in the File Explorer and tabbed headings.
Selecting the File Icon Theme
- In VS Code, open the File Icon Theme picker with File >Preferences >File Icon Theme. (Code >Preferences >File Icon Theme on macOS).
- You can also use the Preferences: File Icon Theme command from the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ).
- Use the cursor keys to preview the icons of the theme.
- Select the theme you want and hit Enter .
By default, the Seti file icon set is used and those are the icons you see in the File Explorer. Once a file icon theme is selected, the selected theme will be remembered and appear again whenever VS Code is restarted. You can disable file icons by selecting None.
VS code ships with two file icon themes; Minimal and Seti. To install more file icon themes, select the Install Additional File Icon Themes item in the file icon theme picker and you'll see a query for file icon themes (tag:icon-theme) in the Extensions view.
You can also browse the VS Code Marketplace site directly to find available themes.
The active File Icon theme is persisted in your user settings (keyboard shortcut ⌘, (Windows, Linux Ctrl+, ) ).
Creating your own File Icon Theme
You can create your own File Icon Theme from icons (preferably SVG), see the File Icon Theme topic in our Extension API section for details.
Next steps
Themes are just one way to customize VS Code. If you'd like to learn more about VS Code customization and extensibility, try these topics:
Читайте также: