V4P Cheat-Sheet

Here you find a complete overview of all the features contained in V4P, including a short description and the corresponding default Visual Studio Code Shortcut. This list not only contains V4P specific commands and functions, but also standard features natively supported by Visual Studio Code which you might find handy.

Preferences (Libraries, Excludes, Settings)

V4P supports a separate set of preferences for each root-folder. You just need to create a file named config.v4p or .config.v4p in the respective root-folder. This is useful as you often have projects that combine various sub-projects with possibly different coding styles. The configuration file can either be INI-based or JSON-based, just as the following examples show. V4P provides code-snippets and colorization for the INI-based format (which is recommended for improved readability).
Section Description
libraries Assign libraries to design files: You can specify a comma-separated list of libraries for each design file. Files are specified as   Glob-Pattern as shown in the example avoce. Usually there is only one library per file, but multiple libraries per file might be useful for shared projects. All paths are relative to the root-folder.
If you do not use libraries, you can remove the entire section from the file.
excludes Exclude design files from parsing: In addition to Visual Studio Code's exclude list, you can provide a separate list of excludes for each root-folder. The files (again specified as   Glob-Pattern) will not be parsed or analyzed by V4P. Notice that you need to assign true to the entries, otherwise the entry will be ignored. All paths are relative to the root-folder.
settings Define specific preferences: Each root-folder can have its own set of preferences. If no config.v4p is present, the settings from the file with highest V4p.Settings.Basics.Priority will be used.

Each entry can have two special assignments:

  • @default: Uses the value from V4P's default settings. The list below shows the default value for each setting.
  • @inherit: Uses the value from the config.v4p with highest priority.
Setting Default Datatype
V4p.Settings.Basics.TopLevelEntity (empty) String
(Not yet supported) Specifies the top-level entity of the design.
V4p.Settings.Basics.LogSeverity Note Enum
Specifies minimum severity for log-messages. Messages below the given threshold are not written to the logfile. Allowed values are (in ascending priority) Detail, Debug, Note, Info, Warning, Error, Fatal.
V4p.Settings.Basics.Priority 0 Int
Specifies the priority of this config.v4p file. Higher number means higher priority. The file with highest priority is used when no config.v4p is specified for a root-folder, or if the @inherit tag is used as value.
V4p.Settings.Basics.LicenseFile (empty) String
(Not yet supported) Optional path to the license file. There are   other ways as well to specify a license file.
V4p.Settings.Formatting.Vhdl.AutoAlignSnippets True Bool
(Not yet supported) Automatically aligns the output of a snippet to the style of the previous line. Eg, the ':' and ':=' of signal declarations are aligned.
V4p.Settings.Formatting.Vhdl.StandardLibraryStyle Lower Enum
Defines the capitalization style of standard-library elements for snippets and code-completion. Allowed values are AsDefined, Lower, Upper.
V4p.Settings.Formatting.Vhdl.KeywordStyle Lower Enum
Defines the capitalization style of keywords. Allowed values are Lower, Upper, VbaStyle. If style VbaStyle is used, the first letter is converted to upper case, while the reset is lower case.
V4p.Settings.Formatting.EndIdentifiers.* False Bool
(Not yet supported) Defines whether the label/name of a block shall be repeated at the end of the block as well. For example:
procedure proc (...) is begin end procedure proc;
The * in the above definition can be replaced with any one of those values: Process, Procedure, Function, Entity, Architecture, Context, Package, Component, Block, Generate, Record, Protected, Case
V4p.Settings.Formatting.Newlines.* (mixed) Bool
(Not yet supported) Defines when V4P inserts newlines when formatting code. Allowed values for the * in the definition above are Vhdl.ProtectedKeyword, Vhdl.RecordKeyword, Vhdl.WhenStatements.
V4p.Settings.Formatting.Indentation.UseTabs False Bool
Defines whether to use tab-stops or whitespaces for indentation. This affecs code-completion, snippets and type-time (smart) indenation.
V4p.Settings.Formatting.Indentation.TabWidth 2 Int
Defines how many spaces to insert for each level of indentation. See also V4p.Settings.Formatting.Indentation.UseTabs
V4p.Settings.Formatting.Indentation.* True Bool
Specifies when V4P shall add indentation (relative to the previous line). Allowed values for the * in the definition above are Vhdl.IndentReportSeverity, Vhdl.IndentWhenChoices, Vhdl.IndentDeclarations, Vhdl.IndentPortMaps, Vhdl.IndentUseClauses.
V4p.Settings.Completion.ShowKeywords True Bool
Defines whether keywords shall be part of the code-completion list.
V4p.Settings.Completion.ShowUncommon False Bool
Defines whether uncommon elemments of the IEEE standard libs shall be part of the completion list. Uncommon elements are for example character-literals, ux01, to_ux01, ...
V4p.Settings.Completion.ShowEnums True Bool
Defines whether enumeration values shall be part of the code-completion list.
V4p.Settings.HoverInfo.ShowLibraries False Bool
If true, the hoverinfo shows the library to which the current symbol belongs.
V4p.Settings.HoverInfo.ShowLocation False Bool
If true, the hoverinfo shows the file and location of the current symbol.
V4p.Settings.HoverInfo.ResolveStdTypes False Bool
If true, standard ieee types are further resolved into their primitive types (if any).
V4p.Settings.HoverInfo.ResolveTypes True Bool
If true, complex types (eg, arrays) will be further resolved to their primitive types.
V4p.Settings.HoverInfo.ShowAllOverloads False Bool
If true, the hoverinfo contains all overloads of the current subroutine. Notice that this might result in truncated output. If false, only a summary of the overloaded subroutines is displayed.

License

Not yet applicable, because V4P is still in beta mode and thus FREE of charge.

Coding

Feature Description Default Shortcut
Renaming Allows semantically correct renaming of signals, variables, functions, entities, etc. F2
Find All References Finds all references of a given identifier in the entire project, shows the results in 'References' Activity Bar. Shift+Alt+F12
Go To References Finds all references of a given identifier in the entire project, shows the results in an inline window with code preview. Shift+F12
Syntax Highlighting Code highlighting according to VHDL 2008 syntax: Keywords, symbols, strings, identifiers, etc.
Type-time Syntax Checking On-the-fly syntax checking and highlighting. Output in Visual Studio Code's Problems Panel.
Smart Indentation Automatically sets the indent of new code lines according to formatting rules. See also Section Preferences.
Code Completion/Autocomplete Context sensitive code completion (for defined signals, types, entites, etc.), according to code completion rules. See also Section Preferences. Ctrl+Space
Block Selection Keyboard Very handy block/column-selection mode of Visual Studio Code. Ctrl+Alt+Shift+Cursors
Block Selection Mouse Use the middle mouse button for block-selection mode with the mouse. Middle Mouse Button
Increase Indent Increases the indent of the currently selected code lines. Tab
Decrease Indent Decreases the indent of the currently selected code lines. Shift+Tab
Hover Info / Quickinfo Show Hover Info for symbol at cursor. Usually you just hover the mouse over an item. Ctrl+K+Ctrl+I
Comment Lines Comments the current/selected lines (line commenting). Ctrl+K+Ctrl+C
Uncomment Lines Uncomments the current/selected lines (line commenting). Ctrl+K+Ctrl+U
Toggle Line Comment Toggle line comment for the current/selected lines. Ctrl+/
Toggle Block Comment Toggle block comment for the current selected. Shift+Alt+A
Copy Line Down Copys the current line / current selection and inserts it below Shift+Alt+Down
Copy Line Up Copys the current line / current selection and inserts it above Shift+Alt+Up
Code Snippets Snippets are part of code completion. All snippets start with a short prefix, followed by '-'. For some snippets, an identifier after the minus further defines the snippet (eg, for instances). Snippets respect your formatting settings, see also Section Preferences. The following snippets are defined:
  • if-: if cond then ... end if;
  • ife-: if cond then ... else ... end if;
  • sl-: std_logic
  • slv-: std_logic_vector(...)
  • o-: (others => '0')
  • oo-: (others => '...')
  • s-: signed
  • ts-: to_signed(...)
  • u-: unsigned
  • tu-: to_unsigned(...)
  • arch-: Architecture template
  • entarch-: Entity with architecture template
  • ent-: Entity template
  • comp-: Component template
  • const-: Template for a constant definition
  • func-: Function template
  • proc-: Procedure template
  • sig-: Signal declaration template
  • var-: Variable declaration template
  • sha-: Shared Variable declaration template
  • rec-: Record type declaration template
  • prot-: Protected type declaration template
  • protbdy-: Protected type body definition template
  • pkg-: Package head declaration template
  • pkgfull-: Package head and body template
  • p-: Process template
  • genif-: Generate IF template
  • genfor-: Generate FOR template
  • gencase-: Generate CASE template
Specific Snippets
  • i-name: Create an instance of the given entity/component. The instance is created with all generic maps and port maps according to the module's definition.
  • cs-name: Create a case statement for the given signal/variable (of enumeration type). The case statement is created with all enumeration values.
*-
Code Snippets (Forward) When in snippet insertion mode, use this shortcut to move to the next field (and probably show the suggestions list). Tab
Code Snippets (Backward) When in snippet insertion mode, use this shortcut to move to the previous field (and commit the current value for previous, and probably show the suggestions list). Shift+Tab
Code Snippets (Leave) When in snippet insertion mode, use this shortcut to leave snippet mode. Shift+Escape
Code Snippets (Leave) When in snippet insertion mode, use this shortcut to leave snippet mode. Escape

Navigation

Feature Description Default Shortcut
Find All References Finds all references of a given identifier in the entire project, shows the results in 'References' Activity Bar. Shift+Alt+F12
Go To References Finds all references of a given identifier in the entire project, shows the results in an inline window with code preview. Shift+F12
Navigate Forward Move forward to an already visited location. Alt+Right
Navigate Backward Move backward to a previously visited location. Alt+Left
Code Folding Collapse certain code blocks for better overview and navigation efficiency (processes, function, entities, classes, methods, records, instances, ...).
Goto Definition Jumps to the definition of the current item (if different from its declaration, eg. package body or function implementation). F12
Goto Declaration Jumps to the declaration of the current item (if different from its definition, eg. package head or function declaration in package head).
Goto Type Definition Jumps to the type of the current item, eg. the type of the signal/variable/constant.


Recommended Visual Studio Code Settings

Shortcut Value Remarks
[ctrl]+[,]   editor.formatOnType Enable Required, for VHDL/V4P specific (smart) indentation
[ctrl]+[,]   editor.folding Enable Required, for VHDL/V4P specific code folding
[ctrl]+[,]   editor.foldingStrategy Auto Required, for VHDL/V4P specific code folding
[ctrl]+[,]   editor.foldingControls Always Optional, disallow the folding controls to disappear
[ctrl]+[,]   editor.minimap.enabled Enable Optional, shows teh mini-map next to the scrollbar. Very useful.
[ctrl]+[,]   editor.minimap.showSlider Always Optional, disallow the minimap slider to disappear
[ctrl]+[,]   editor.minimap.size Fit Optional, fit the minimap to show the preview of the entire file
[ctrl]+[,]   editor.suggest.showSnippets Enable Required, enables VHDL/V4P specific snippets
[ctrl]+[,]   editor.snippetSuggestions top, bottom or inline Optional, define the snippets' position inside the code-completion list
[ctrl]+[,]   editor.wordBasedSuggestions Disable Recommended, avoid code-completion suggestions from Visual Studio Code. Only show V4P's code-completion suggestions.