1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00
denoland-deno/docs/getting_started/setup_your_environment.md
Bert Belder 36fde75d77
Miscellaneous documentation and spelling improvements (#5527)
* Extended/updated documentation on code editor setup and plugins.
* Moved documentation to the right file.
* Fixed spelling errors in documentation and code.
* Updated broken links.

Co-authored-by: 迷渡 <justjavac@gmail.com>
Co-authored-by: AlfieriChou <alfierichou@gmail.com>
Co-authored-by: Anil Seervi <anil13112000@gmail.com
Co-authored-by: Bert Belder <bertbelder@gmail.com>
Co-authored-by: Fernando Basso <fernandobasso.br@gmail.com>
Co-authored-by: József Sallai <jozsef@sallai.me>
Co-authored-by: S4ltyGo4t <mario.weidner@gmx.de>
Co-authored-by: Tommy May <tommymay37@gmail.com>
Co-authored-by: Turbinya <wownucleos@gmail.com>
Co-authored-by: ᴜɴвʏтᴇ <i@shangyes.net>
2020-05-17 19:24:39 +02:00

2.4 KiB

Setup your environment

To productively get going with Deno you should set up your environment. This means setting up shell autocomplete, environmental variables and your editor or IDE of choice.

Environmental variables

There are several env vars that control how Deno behaves:

DENO_DIR defaults to $HOME/.deno but can be set to any path to control where generated and cached source code is written and read to.

NO_COLOR will turn off color output if set. See https://no-color.org/. User code can test if NO_COLOR was set without having --allow-env by using the boolean constant Deno.noColor.

Shell autocomplete

You can generate completion script for your shell using the deno completions <shell> command. The command outputs to stdout so you should redirect it to an appropriate file.

The supported shells are:

  • zsh
  • bash
  • fish
  • powershell
  • elvish

Example:

deno completions bash > /usr/local/etc/bash_completion.d/deno.bash
source /usr/local/etc/bash_completion.d/deno.bash

Editors and IDEs

Because Deno requires the use of file extensions for module imports and allows http imports, and most editors and language servers do not natively support this at the moment, many editors will throw errors about being unable to find files or imports having unnecessary file extensions.

The community has developed extensions for some editors to solve these issues:

VS Code

The beta version of vscode_deno is published on the Visual Studio Marketplace. Please report any issues.

JetBrains IDEs

Support for JetBrains IDEs is not yet available, but you can follow and upvote these issues to stay up to date:

Vim and NeoVim

Vim works fairly well for Deno/TypeScript if you install CoC (intellisense engine and language server protocol). After CoC itself is installed, from inside Vim, simply run :CocInstall coc-deno. From now on, things like gd (go to definition) and gr (goto/find references) should work.

If you don't see your favorite IDE on this list, maybe you can develop an extension. Our community Discord group can give you some pointers on where to get started.