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. This is useful as you often have projects that combine various sub-projects with possibly different coding styles. You just need to create a file named config.v4p or .config.v4p in the respective root-folder. 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 above. Usually there is only one library per file, but multiple libraries might be useful for fils that are shared by multiple projects. All paths are relative to the root-folder. The Glob-patterns are case sensitive (also in Windows).
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. The Glob-patterns are case sensitive (also in Windows).
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. Furthermore, if a config file does not explicitly define certain settings, @inherit (see below) is assumed implicitly.

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.
V4p.Settings.Basics.TopLevelEntity
V4p.Settings.Basics.LogSeverity
V4p.Settings.Basics.Priority
V4p.Settings.Basics.LicenseFile
V4p.Settings.Formatting.Vhdl.AutoAlignSnippets
V4p.Settings.Formatting.Vhdl.StandardLibraryStyle
V4p.Settings.Formatting.Vhdl.KeywordStyle
V4p.Settings.Formatting.Vhdl.EndIdentifiers.*
V4p.Settings.Formatting.Newlines.*
V4p.Settings.Formatting.Indentation.UseTabs
V4p.Settings.Formatting.Indentation.TabWidth
V4p.Settings.Formatting.Indentation.*
V4p.Settings.Completion.ShowKeywords
V4p.Settings.Completion.ShowUncommon
V4p.Settings.Completion.ShowEnums
V4p.Settings.HoverInfo.ShowLibraries
V4p.Settings.HoverInfo.ShowLocation
V4p.Settings.HoverInfo.ResolveStdTypes
V4p.Settings.HoverInfo.ResolveTypes
V4p.Settings.HoverInfo.ShowAllOverloads
V4p.Settings.StutterMode.Enabled
V4p.Settings.StutterMode.HorizontalLineWidth

License

V4P comes with a pre-installed, 30-day trial license (full feature set, no restrictions). After the trial period, you have to purchase a license on my website. Once you have the license file, there are several options to activate it:
  • Option 1: Put the file in any of your root folders. The file must be named license.v4p.
  • Option 2: Put the file in V4P's installation directory (or any subfolder thereof). The file must be named license.v4p.
    • In Windows, the installation location is C:\Users\<user>\.vscode\extensions\vide-software...
    • In Linux, the installation location is <home>/.code/extensions/vide-software...
  • Option 3: Set the environment variable V4P_LICENSE_FILE to the location of the license file. The filename does not matter.
  • Option 4: In any of your config.v4p files, point to the location of the license file.
    • Add V4p.Settings.Basics.LicenseFile=<path> to the [Settings] section.

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.
Semantic Highlighting Code highlighting according to semantic analysis: Types, signals, ports, constants, etc.
Type-time Syntax Checking On-the-fly syntax checking and highlighting. Output in Visual Studio Code's Problems Panel.
Type-time Semantic Checking Performs error checks during design entry. Supported checks:
  • Symbol not defined
  • Signal vs. Variable assignment operator
  • Symbol already defined.
Stutter Mode If enabled (V4p.Settings.StutterMode.Enabled), stutter mode as known from EMACS can be used. The following shortcuts are supported:
  • '' (two single quotes) → " (double quote)
  • ;; : 
  • ;;; := 
  • .. => 
  • ,, <= 
  • [(
  • [[[
  • ])
  • ]]]
  • -------------- (horizontal line according to V4p.Settings.StutterMode.HorizontalLineWidth
Parameter Help Brings up a tooltip with parameter help for (possibly overloaded) functions/procedures/components/instances. Highlights the current parameter and provides type information. Ctrl+Shift+Space
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
Expression Evaluator For constants and generics, V4P displays the actual value of the symbol as part of the hover info, whereever possible. Ctrl+K+Ctrl+I
Number Conversion Converts numbers to different bases. Just hover the mouse over a number. 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
  • slvr-: std_logic_vector( range )
  • sul-: std_ulogic
  • sulv-: std_ulogic_vector
  • sulvr-: std_ulogic_vector( range )
  • o-: (others => '0')
  • oo-: (others => '...')
  • s-: signed
  • sr-: signed( range )
  • ts-: to_signed(...)
  • u-: unsigned
  • ur-: unsigned( range )
  • 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.


Commands

Name Description
v4p.version Displays the current version and build date
v4p.license Displays information about all found licenses
v4p.reload Reloads the workspace, especially reloads the config.v4p files. Does not reparse the .vhd files.
v4p.logfile Opens the logfile in Visual Studio Code
v4p.thirdparty Displays licensing and copyright information about Third Party software used in V4P

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.suggest.showSnippets Enable Required, enables VHDL/V4P specific snippets
[ctrl]+[,]   editor.semanticHighlighting.enabled True, ConfiguredByTheme Required, needed for semantic token highlighting. The color theme must support semantic highlighting!
[ctrl]+[,]   editor.showFoldingControls 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.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.