diff --git a/docs/ides.md b/docs/ides.md index 716306b0..16ba44b8 100644 --- a/docs/ides.md +++ b/docs/ides.md @@ -1,4 +1,4 @@ -# IDEs +#with TRAMP IDEs The following desktop IDEs have been tested with Coder, though any IDE with SSH support should work: @@ -17,8 +17,8 @@ support should work: - RubyMine - WebStorm - Web IDEs (code-server, JupyterLab, Jetbrains Projector) - - Note: These are [configured in the template](./ides/configuring-web-ides.md) -- Emacs (with [TRAMP](./ides/configuring-emacs-tramp.md)) + - Note: These are [configured in the template](./ides/configuring-web-ides.md) +- [Emacs](./ides/configuring-emacs-tramp.md) ## SSH configuration @@ -90,12 +90,11 @@ After installing Gateway on your local system, you may connect to a Coder worksp 8. Click "Download and Start IDE" to connect. | Version | Status | Notes | -|-----------|-------------|------------------------------------------------------------| +| --------- | ----------- | ---------------------------------------------------------- | | 2021.3.2 | Working | | | 2022.1.1 | Working | Windows clients are unable to connect to Linux workspace | | 2022.2 RC | Not working | [GitHub Issue](https://github.com/coder/coder/issues/3125) | - ## Web IDEs (Jupyter, code-server, Jetbrains Projector) Web IDEs (code-server, JetBrains Projector, VNC, etc.) are defined in the template. See [configuring IDEs](./ides/configuring-web-ides.md). diff --git a/docs/ides/configuring-emacs-tramp.md b/docs/ides/configuring-emacs-tramp.md index a3d0ea2b..65d4455b 100644 --- a/docs/ides/configuring-emacs-tramp.md +++ b/docs/ides/configuring-emacs-tramp.md @@ -1,7 +1,9 @@ # Configuring Emacs TRAMP + [Emacs TRAMP](https://www.emacswiki.org/emacs/TrampMode) is a method of running editing operations on a remote server. ## Connecting To A Workspace + To connect to your workspace first run: ``` @@ -13,6 +15,7 @@ Then you can connect to your workspace by its name in the format: `coder.:` and hit enter. This will open up Dired on the workspace's home directory. ### Using SSH + By default Emacs TRAMP is setup to use SCP to access files on the Coder workspace instance. However you might want to use SSH if you have a jumpbox or some other complex network setup. To do so set the following in your Emacs `init.el` file: @@ -24,12 +27,15 @@ To do so set the following in your Emacs `init.el` file: Then when you access the workspace instance via `/-:coder.` Emacs will use SSH. Setting `tramp-default-method` will also tell `ansi-term` mode the correct way to access the remote when directory tracking. ## Directory Tracking -### `ansi-term` + +### ansi-term + If you run your terminal in Emacs via `ansi-term` then you might run into a problem where while SSH-ed into a workspace Emacs will not change its `default-directory` to open files in the directory your shell is in. To fix this: 1. In your workspace Terraform template be sure to add the following: + ```hcl data "coder_workspace" "me" { } @@ -42,7 +48,9 @@ To fix this: } } ``` + 2. Next in the shell profile file on the workspace (ex., `~/.bashrc` for Bash and `~/.zshrc` for Zsh) add the following: + ```bash ansi_term_announce_host() { printf '\033AnSiTh %s\n' "coder.$CODER_WORKSPACE_NAME" @@ -68,12 +76,15 @@ To fix this: ansi_term_announce ``` + Ansi Term expects the terminal running inside of it to send escape codes to inform Emacs of the hostname, user, and working directory. The above code sends these escape codes and associated data whenever the terminal logs in and whenever the directory changes. -### `eshell` +### eshell + The `eshell` mode will perform directory tracking by default, no additional configuration is needed. ## Language Servers (Code Completion) + If you use [`lsp-mode`](https://emacs-lsp.github.io/lsp-mode) for code intelligence and completion some additional configuration is required. In your Emacs `init.el` file you must register a LSP client and tell `lsp-mode` how to find it on the remote machine using the `lsp-register-client` function. For each LSP server you want to use in your workspace add the following: diff --git a/docs/manifest.json b/docs/manifest.json index f3441af5..5cde6f16 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -86,8 +86,8 @@ "path": "./ides/configuring-web-ides.md" }, { - "title": "Configuring Emacs (with TRAMP)", - "description": "Learn how to configure Emacs in Coder", + "title": "Configuring Emacs", + "description": "Learn how to configure Emacs with TRAMP in Coder", "path": "./ides/configuring-emacs-tramp.md" } ]