Very powerful, with smart features. Very simple, requires just three lines of config! Very fast, finished in a blink.
- Features
- Diff local and remote
- Sync directory
- Upload/Download
- Upload on save
- File Watcher
- Multiple configs
- Switchable profiles
Usage
Try our Mac & Windows code editor, IDE, or Azure DevOps for free. Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications. Switching channels automatically starts the download process of new updates. If you have selected the option to Check Automatically, the updater box will pop up when Visual Studio for Mac is open to let you know that new updates are available. New downloads will start downloading automatically to your machine when this box appears.
Ctrl+Shift+P
on Windows/Linux orCmd+Shift+P
on Mac open command palette, runSFTP: config
command.- Enjoy.
For detailed usage. Please go to wiki.
Example Configs
You can see the full config here.
- Connection Hopping
Simple
Profiles
Note:
context
and watcher
are only available at root level.Use
SFTP: Set Profile
to switch profile.Multiple Context
The context must not be same.
Note:
name
is required in this mode.Connection Hopping
You can connect to a target server through a proxy with ssh protocol.
Note:Variable substitution is not working in a hop config.
Single Hop
local -> hop -> target
Multiple Hop
local -> hopa -> hopb -> target
Config in User Setting
You can use
remote
to tell sftp to get the config from remote-fs.In User Setting:
In sftp.json:
Remote Explorer
Remote Explorer lets you explore files in remote. You can open Remote Explorer by:
- Run Command
View: Show SFTP
. - Click SFTP view in Activity Bar.
You can only view a files content with Remote Explorer. Run command
SFTP: Edit in Local
to edit it in local.Note: You need to manually refresh the parent folder after you delete a file to make the explorer updated.
Debug
- Open User Settings.
- On Windows/Linux -
File > Preferences > Settings
- On macOS -
Code > Preferences > Settings
- On Windows/Linux -
- Set
sftp.debug
totrue
and reload vscode. - View the logs in
View > Output > sftp
.
Donation
If this project helped you reduce development time, you can give me a cup of coffee :)
Alipay
PayPal
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
JavaScript · TypeScript · Flow · JSX · JSON
CSS · SCSS · Less
HTML · Vue · Angular
GraphQL · Markdown · YAML
Your favorite language?
Installation
Install through VS Code extensions. Search for
Prettier - Code formatter
Can also be installed in VS Code: Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Default Formatter
To ensure that this extension is used over other extensions you may have installed, be sure to set it as the default formatter in your VS Code settings. This setting can be set for all languages or by a specific language.
Prettier Resolution
This extension will use prettier from your project's local dependencies (recommended). When the
prettier.resolveGlobalModules
is set to true
the extension can also attempt to resolve global modules. Should prettier not be installed locally with your project's dependencies or globally on the machine, the version of prettier that is bundled with the extension will be used.To install prettier in your project and pin its version as recommended, run:
Plugins
This extension supports Prettier plugins when you are using a locally or globally resolved version of prettier. If you have Prettier and a plugin registered in your
package.json
, this extension will attempt to register the language and provide automatic code formatting for the built-in and plugin languages.Configuration
There are multiple options for configuring Prettier with this extension. You can use VS Code settings, prettier configuration files, or an
.editorconfig
file. The VS Code settings are meant to be used as a fallback and are generally intended only for use on non-project files. It is recommended that you always include a prettier configuration file in your project specifying all settings for your project. This will ensure that no matter how you run prettier - from this extension, from the CLI, or from another IDE with Prettier, the same settings will get applied.Using Prettier Configuration files to set formatting options is the recommended approach. Options are searched recursively down from the file being formatted so if you want to apply prettier settings to your entire project simply set a configuration in the root. Settings can also be configured through VS Code - however, these settings will only apply while running the extension, not when running prettier through the command line.
Configuring Default Options
Some users may not wish to create a new Prettier config for every project or use the VS Code settings. Because Prettier searches recursively up the file path, you can place a global prettier config at
~/.prettierrc
to be used as a fallback.You can also use the setting
prettier.configPath
to provide a global configuration. However, be careful, if this is set this value will always be used and local configuration files will be ignored.Visual Studio Code Settings
You can use VS Code settings to configure prettier. Settings will be read from (listed by priority):
.editorconfig
- Visual Studio Code Settings (Ignored if any other configuration is present)
NOTE: If any local configuration file is present (i.e.
.prettierrc
) the VS Code settings will NOT be used.Usage
Using Command Palette (CMD/CTRL + Shift + P)
Keyboard Shortcuts
Visual Studio Code provides default keyboard shortcuts for code formatting. You can learn about these for each platform in the VS Code documentation.
If you don't like the defaults, you can rebind
editor.action.formatDocument
and editor.action.formatSelection
in the keyboard shortcuts menu of vscode.Format On Save
Respects
editor.formatOnSave
setting.You can turn on format-on-save on a per-language basis by scoping the setting:
Format Selection
Format selection works on several languages depending on what Prettier itself supports. The following languages currently are supported:
Linter Integration
There are two ways to use Prettier and linters together. The first approach is to simply let each tool do what it was meant for: Prettier formats and the linter lints. You do this by disabling any rules in your linter that check formatting and let Prettier automatically handle all the formatting. The second approach is to use the linter to run prettier though a plugin with the linter.
Disable Formatting Rules in the Linter
The easiest and recommended way of integrating with linters is to let Prettier do the formatting and configure the linter to not deal with formatting rules. You can find instructions on how to configure each linter on the Prettier docs site. You can then use each of the linting extensions as you normally would.
- ESLint: Extension | Configuration
- TSLint: Extension | Configuration
- Stylelint: Extension | Configuration
You can enable Auto-Fix on Save for ESLint, TSLint or Stylelint and still have formatting and quick fixes:
NOTE: If you are seeing conflicts between Prettier and ESLint this is because you don't have the right ESLint or TSLint rules set as explained in the Prettier documentation.
Run Prettier through Linters
Another option to run Prettier and linters together is to have the linters run Prettier. For these configurations you DO NOT USE THIS EXTENSION. Instead you use the linter extensions to run the linter and Prettier. See the Prettier documentation for instructions on how to configure each linter. This setup is generally not recommended, but can be useful in certain circumstances. To learn about why you probably should avoid this setup see the prettier documentation.
- ESLint: Extension | Configuration
- TSLint: Extension | Configuration
- Stylelint: Extension | Configuration
Disable format on save so this extension doesn't run and enable code actions to run the linters on save.
Settings
Prettier Settings
All prettier options can be configured directly in this extension. These settings are used as a fallback when no configuration file is present in your project, see the configuration section of this document for more details. For reference on the options see the prettier documentation.
The default values of these configurations are always to their Prettier 2.0 defaults. In order to use defaults from earlier versions of prettier you must set them manually using your VS Code settings or local project configurations.
Download Visual Studio 2019
Extension Settings
These settings are specific to VS Code and need to be set in the VS Code settings file. See the documentation for how to do that.
prettier.enable (default: true
)
Controls whether prettier is enabled or not. You must restart VS Code when you change this setting.
prettier.requireConfig (default: false
)
Require a prettier configuration file to format files. Untitled files will still be formatted using the VS Code Prettier configuration even with this option set to
true
.prettier.ignorePath (default: .prettierignore
)
Supply the path to an ignore file such as
.gitignore
or .prettierignore
.Files which match will not be formatted. Set to null
to not read ignore files.![Download Vscode For Mac Download Vscode For Mac](/uploads/1/1/7/7/117777800/857803897.png)
Note, if this is set, this value will always be used and local ignore files will be ignored.
prettier.configPath
Supply a custom path to the prettier configuration file.
Note, if this is set, this value will always be used and local configuration files will be ignored. A better option for global defaults is to put a
~/.prettierrc
file in your home directory.prettier.prettierPath
Supply a custom path to the prettier module. This path should be to the module folder, not the bin/script path. i.e.
./node_modules/prettier
, not ./bin/prettier
.prettier.packageManager
Controls the package manager to be used to resolve modules. This has only an influence if the
prettier.resolveGlobalModules
setting is true
and modules are resolved globally. Valid values are 'npm'
or 'yarn'
or 'pnpm'
.prettier.resolveGlobalModules (default: false
)
When enabled, this extension will attempt to use global npm or yarn modules if local modules cannot be resolved.
NOTE: This setting can have a negative performance impact, particularly on Windows when you have attached network drives. Only enable this if you must use global modules. It is recommended that you always use local modules when possible.
Ms Visual Studio
prettier.disableLanguages
A list of languages IDs to disable this extension on.
Note: Disabling a language enabled in a parent folder will prevent formatting instead of letting any other formatter to run
prettier.documentSelectors
A list of glob patterns to register Prettier formatter. Typically these will be in the format of
**/*.abc
to tell this extension to register itself as the formatter for all files with the abc
extension. This feature can be useful when you have overrides set in your config file to map custom extensions to a parser.It is likely will need to also update your prettier config. For example, if I register the following document selector by itself, Prettier still won't know what to do with that file. I either need a Prettier extension that formats
.abc
file format or I need to configure Prettier.To tell Prettier how to format a file of type
.abc
I can set an override in the prettier config that makes this file type use the babel
parser.prettier.useEditorConfig (default: true
)
Whether or not to take .editorconfig into account when parsing configuration. See the prettier.resolveConfig docs for details.
prettier.withNodeModules (default: false
)
Whether or not to process files in the
node_modules
folder.Error Messages
Failed to load module. If you have prettier or plugins referenced in package.json, ensure you have run
npm install
When a
package.json
is present in your project and it contains prettier, plugins, or linter libraries this extension will attempt to load these modules from your node_module
folder. If you see this error, it most likely means you need to run npm install
or yarn install
to install the packages in your package.json
.Your project is configured to use an outdated version of prettier that cannot be used by this extension. Upgrade to the latest version of prettier.
You must upgrade to a newer version of prettier.