oleg-shilo / Favorites.vscode

VSCode extension for managing Favorites

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stand with Ukraine

Favorites - VSCode Extension

Manage and quickly access frequently used files, folders and favorites' lists.

paypal

Overview

This simple extension allows adding, removing and managing documents in the globally maintained Favorites' list(s).

This extensions is similar to other plugins of the "Favorites" family. Though apart from traditional item context menu and buttons this plugin offers an extremely simple and intuitive way of structuring your favorites.

The items definition is just a text document that can be freely edited with the changes reflected in the VSCode panel automatically after saving the file.

Another distinction points are the ability to have both file and folder items as well as the ability to switch between multiple Favorites' lists. This is particularly useful for grouping favorite items according the problem domain into individual lists, which can be easily switched depending on the user activity.

Key Features

The functionality is self explanatory and includes following features:

  • The items can be either files or folders
  • Support for custom/multiple favorites lists.
  • Opening document or folder by clicking (or double-clicking) the item in the Favorites list.
  • Managing items and lists via the dedicated toolbar button or the node context menu.
  • Refreshing (reloading) Favorites via the dedicated toolbar button.
  • Moving items up and down in the list
  • Managing (editing) Favorites list directly in VSCode. Once the Favorites list definition is edited and saved the changes are automatically reflected in the Favorites panel. Below is a sample of the Favorites list definition.

Managing list items:

image

Managing lists:

image

List definition rules

The item definition (in "<name>.list.txt") may contain environment variables, which are extended at runtime into a full path:

$USERPROFILE\AppData\Roaming\Code\User\cs-script.user\new_script.cs

In cases if an alternative display title (alias) for a file is desired you can use this simple syntax to achieve that: <file path>|<file alias>

image

The definition syntax also allows comments - any line that starts with '#'.

And you can also use non-path text as an items' separator (e.g. "|-- Folders --"). Any line that starts with | is interpreted as a separator. It makes sense as |<separator> is nothing else but a specific case of <file path>|<file alias> definition where file path is empty and the display name is just a text that you want to display on the non-clickable item.

The extension also allows showing Favorite folder item content. This feature is not a substitution of the Workspace explorer view, which does by far superior job. It's just a convenience measure for a quick access of the top level folder files. The feature can be enabled/disabled with favorites.showFolderFiles setting.

You can group some lists that somewhat logically related. The groping is based on the naming convention: [group_name.]<list_name>.list.txt

There is another type of customization that helps managing excessive amount lists. Thus some lists can be workspace/folder specific. Meaning that if you have a workspace/folder is opened and some of the configured lists are marked as folder specific (associated with teh folder) then only these lits will be shown in the lists tree.

You can associate or disassociate a list by selecting the list selecting the desired action from the context (right-click) menu.

Experimental features

From v1.5.3 you can use workspace local list local.list.txt in the workspace folder <workspace>\.fav\. This list can only be added, removed and edited manually.

This list can contain both absolute and relative paths. All relative paths are resolved at runtime against the workspace folder. The simplest content of the <workspace>\.fav\local.list.txt:

.\.fav\local.list.txt 

Limitations

  • ShowFolderFiles feature overall experience is subject to the limitations/defects of the VSCode tree view. Thus TreeView node always triggers node selection when you try to expand it. This defect is officially reported and being dealt with by the VSCode team:
    microsoft/vscode#34130
    patrys/vscode-code-outline#24

Hints/Tips

  • By default VSCode opens any file clicked from the Favorites list in the so called "preview mode". Thus the document tabs are reused and every new file is opened in the same tab. If you prefer to open a clicked Favorites document in a new tab then you need to disable document the previewMode is the settings:
    1. Use Command Palette to open your settings file ("Preferences: Open User Settings")
    2. Add the "workbench.editor.enablePreview" property, and set it's value to false.
    3. Use "favorites.singleListMode" to disable support for multiple lists and hide the <Default> tree view item as well as the whole list selection UI elements.

About

VSCode extension for managing Favorites

License:MIT License


Languages

Language:TypeScript 100.0%