mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-24 10:26:18 +04:00
deploy: 27891cdc8d
This commit is contained in:
parent
b667e964a8
commit
6326a4d2ca
@ -278,7 +278,7 @@ You can get <a href="https://www.microsoft.com/p/app-installer/9nblggh4nns1#acti
|
||||
<ul>
|
||||
<li>The <a href="https://www.rust-lang.org/tools/install">Rust toolchain</a></li>
|
||||
<li>The <a href="https://git-scm.com/">Git version control system</a></li>
|
||||
<li>A c++14 compatible compiler to build the tree-sitter grammars, for example GCC or Clang</li>
|
||||
<li>A C++14 compatible compiler to build the tree-sitter grammars, for example GCC or Clang</li>
|
||||
</ul>
|
||||
<p>If you are using the <code>musl-libc</code> standard library instead of <code>glibc</code> the following environment variable must be set during the build to ensure tree-sitter grammars can be loaded correctly:</p>
|
||||
<pre><code class="language-sh">RUSTFLAGS="-C target-feature=-crt-static"
|
||||
|
@ -519,7 +519,7 @@ end = "no_op"
|
||||
<h2 id="select--extend-mode"><a class="header" href="#select--extend-mode">Select / extend mode</a></h2>
|
||||
<p>Select mode echoes Normal mode, but changes any movements to extend
|
||||
selections rather than replace them. Goto motions are also changed to
|
||||
extend, so that <code>vgl</code> for example extends the selection to the end of
|
||||
extend, so that <code>vgl</code>, for example, extends the selection to the end of
|
||||
the line.</p>
|
||||
<p>Search is also affected. By default, <code>n</code> and <code>N</code> will remove the current
|
||||
selection and select the next instance of the search term. Toggling this
|
||||
|
@ -154,16 +154,14 @@ in <code>languages.toml</code> files.</p>
|
||||
<p>There are three possible locations for a <code>languages.toml</code> file:</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p>In the Helix source code, this lives in the
|
||||
<p>In the Helix source code, which lives in the
|
||||
<a href="https://github.com/helix-editor/helix/blob/master/languages.toml">Helix repository</a>.
|
||||
It provides the default configurations for languages and language servers.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>In your <a href="./configuration.html">configuration directory</a>. This overrides values
|
||||
from the built-in language configuration. For example to disable
|
||||
from the built-in language configuration. For example, to disable
|
||||
auto-LSP-formatting in Rust:</p>
|
||||
</li>
|
||||
</ol>
|
||||
<pre><code class="language-toml"># in <config_dir>/helix/languages.toml
|
||||
|
||||
[language-server.mylang-lsp]
|
||||
@ -173,11 +171,13 @@ command = "mylang-lsp"
|
||||
name = "rust"
|
||||
auto-format = false
|
||||
</code></pre>
|
||||
<ol start="3">
|
||||
<li>In a <code>.helix</code> folder in your project. Language configuration may also be
|
||||
</li>
|
||||
<li>
|
||||
<p>In a <code>.helix</code> folder in your project. Language configuration may also be
|
||||
overridden local to a project by creating a <code>languages.toml</code> file in a
|
||||
<code>.helix</code> folder. Its settings will be merged with the language configuration
|
||||
in the configuration directory and the built-in configuration.</li>
|
||||
in the configuration directory and the built-in configuration.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h2 id="language-configuration"><a class="header" href="#language-configuration">Language configuration</a></h2>
|
||||
<p>Each language is configured by adding a <code>[[language]]</code> section to a
|
||||
@ -261,7 +261,7 @@ languages = { typescript = [ { formatCommand ="prettier --stdin-filepath ${
|
||||
</div>
|
||||
<p>A <code>format</code> sub-table within <code>config</code> can be used to pass extra formatting options to
|
||||
<a href="https://github.com/microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-17.md#document-formatting-request--leftwards_arrow_with_hook">Document Formatting Requests</a>.
|
||||
For example with typescript:</p>
|
||||
For example, with typescript:</p>
|
||||
<pre><code class="language-toml">[language-server.typescript-language-server]
|
||||
# pass format options according to https://github.com/typescript-language-server/typescript-language-server#workspacedidchangeconfiguration omitting the "[language].format." prefix.
|
||||
config = { format = { "semicolons" = "insert", "insertSpaceBeforeFunctionParenthesis" = true } }
|
||||
@ -272,8 +272,8 @@ config = { format = { "semicolons" = "insert", "insertS
|
||||
<p>Different languages can use the same language server instance, e.g. <code>typescript-language-server</code> is used for javascript, jsx, tsx and typescript by default.</p>
|
||||
<p>In case multiple language servers are specified in the <code>language-servers</code> attribute of a <code>language</code>,
|
||||
it's often useful to only enable/disable certain language-server features for these language servers.</p>
|
||||
<p>For example <code>efm-lsp-prettier</code> of the previous example is used only with a formatting command <code>prettier</code>,
|
||||
so everything else should be handled by the <code>typescript-language-server</code> (which is configured by default)
|
||||
<p>As an example, <code>efm-lsp-prettier</code> of the previous example is used only with a formatting command <code>prettier</code>,
|
||||
so everything else should be handled by the <code>typescript-language-server</code> (which is configured by default).
|
||||
The language configuration for typescript could look like this:</p>
|
||||
<pre><code class="language-toml">[[language]]
|
||||
name = "typescript"
|
||||
@ -285,10 +285,10 @@ name = "typescript"
|
||||
language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "efm-lsp-prettier" ]
|
||||
</code></pre>
|
||||
<p>Each requested LSP feature is prioritized in the order of the <code>language-servers</code> array.
|
||||
For example the first <code>goto-definition</code> supported language server (in this case <code>typescript-language-server</code>) will be taken for the relevant LSP request (command <code>goto_definition</code>).
|
||||
For example, the first <code>goto-definition</code> supported language server (in this case <code>typescript-language-server</code>) will be taken for the relevant LSP request (command <code>goto_definition</code>).
|
||||
The features <code>diagnostics</code>, <code>code-action</code>, <code>completion</code>, <code>document-symbols</code> and <code>workspace-symbols</code> are an exception to that rule, as they are working for all language servers at the same time and are merged together, if enabled for the language.
|
||||
If no <code>except-features</code> or <code>only-features</code> is given all features for the language server are enabled.
|
||||
If a language server itself doesn't support a feature the next language server array entry will be tried (and so on).</p>
|
||||
If no <code>except-features</code> or <code>only-features</code> is given, all features for the language server are enabled.
|
||||
If a language server itself doesn't support a feature, the next language server array entry will be tried (and so on).</p>
|
||||
<p>The list of supported features is:</p>
|
||||
<ul>
|
||||
<li><code>format</code></li>
|
||||
|
@ -287,7 +287,7 @@ You can get <a href="https://www.microsoft.com/p/app-installer/9nblggh4nns1#acti
|
||||
<ul>
|
||||
<li>The <a href="https://www.rust-lang.org/tools/install">Rust toolchain</a></li>
|
||||
<li>The <a href="https://git-scm.com/">Git version control system</a></li>
|
||||
<li>A c++14 compatible compiler to build the tree-sitter grammars, for example GCC or Clang</li>
|
||||
<li>A C++14 compatible compiler to build the tree-sitter grammars, for example GCC or Clang</li>
|
||||
</ul>
|
||||
<p>If you are using the <code>musl-libc</code> standard library instead of <code>glibc</code> the following environment variable must be set during the build to ensure tree-sitter grammars can be loaded correctly:</p>
|
||||
<pre><code class="language-sh">RUSTFLAGS="-C target-feature=-crt-static"
|
||||
@ -905,7 +905,7 @@ end = "no_op"
|
||||
<h2 id="select--extend-mode"><a class="header" href="#select--extend-mode">Select / extend mode</a></h2>
|
||||
<p>Select mode echoes Normal mode, but changes any movements to extend
|
||||
selections rather than replace them. Goto motions are also changed to
|
||||
extend, so that <code>vgl</code> for example extends the selection to the end of
|
||||
extend, so that <code>vgl</code>, for example, extends the selection to the end of
|
||||
the line.</p>
|
||||
<p>Search is also affected. By default, <code>n</code> and <code>N</code> will remove the current
|
||||
selection and select the next instance of the search term. Toggling this
|
||||
@ -1961,16 +1961,14 @@ in <code>languages.toml</code> files.</p>
|
||||
<p>There are three possible locations for a <code>languages.toml</code> file:</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p>In the Helix source code, this lives in the
|
||||
<p>In the Helix source code, which lives in the
|
||||
<a href="https://github.com/helix-editor/helix/blob/master/languages.toml">Helix repository</a>.
|
||||
It provides the default configurations for languages and language servers.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>In your <a href="./configuration.html">configuration directory</a>. This overrides values
|
||||
from the built-in language configuration. For example to disable
|
||||
from the built-in language configuration. For example, to disable
|
||||
auto-LSP-formatting in Rust:</p>
|
||||
</li>
|
||||
</ol>
|
||||
<pre><code class="language-toml"># in <config_dir>/helix/languages.toml
|
||||
|
||||
[language-server.mylang-lsp]
|
||||
@ -1980,11 +1978,13 @@ command = "mylang-lsp"
|
||||
name = "rust"
|
||||
auto-format = false
|
||||
</code></pre>
|
||||
<ol start="3">
|
||||
<li>In a <code>.helix</code> folder in your project. Language configuration may also be
|
||||
</li>
|
||||
<li>
|
||||
<p>In a <code>.helix</code> folder in your project. Language configuration may also be
|
||||
overridden local to a project by creating a <code>languages.toml</code> file in a
|
||||
<code>.helix</code> folder. Its settings will be merged with the language configuration
|
||||
in the configuration directory and the built-in configuration.</li>
|
||||
in the configuration directory and the built-in configuration.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h2 id="language-configuration"><a class="header" href="#language-configuration">Language configuration</a></h2>
|
||||
<p>Each language is configured by adding a <code>[[language]]</code> section to a
|
||||
@ -2068,7 +2068,7 @@ languages = { typescript = [ { formatCommand ="prettier --stdin-filepath ${
|
||||
</div>
|
||||
<p>A <code>format</code> sub-table within <code>config</code> can be used to pass extra formatting options to
|
||||
<a href="https://github.com/microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-17.md#document-formatting-request--leftwards_arrow_with_hook">Document Formatting Requests</a>.
|
||||
For example with typescript:</p>
|
||||
For example, with typescript:</p>
|
||||
<pre><code class="language-toml">[language-server.typescript-language-server]
|
||||
# pass format options according to https://github.com/typescript-language-server/typescript-language-server#workspacedidchangeconfiguration omitting the "[language].format." prefix.
|
||||
config = { format = { "semicolons" = "insert", "insertSpaceBeforeFunctionParenthesis" = true } }
|
||||
@ -2079,8 +2079,8 @@ config = { format = { "semicolons" = "insert", "insertS
|
||||
<p>Different languages can use the same language server instance, e.g. <code>typescript-language-server</code> is used for javascript, jsx, tsx and typescript by default.</p>
|
||||
<p>In case multiple language servers are specified in the <code>language-servers</code> attribute of a <code>language</code>,
|
||||
it's often useful to only enable/disable certain language-server features for these language servers.</p>
|
||||
<p>For example <code>efm-lsp-prettier</code> of the previous example is used only with a formatting command <code>prettier</code>,
|
||||
so everything else should be handled by the <code>typescript-language-server</code> (which is configured by default)
|
||||
<p>As an example, <code>efm-lsp-prettier</code> of the previous example is used only with a formatting command <code>prettier</code>,
|
||||
so everything else should be handled by the <code>typescript-language-server</code> (which is configured by default).
|
||||
The language configuration for typescript could look like this:</p>
|
||||
<pre><code class="language-toml">[[language]]
|
||||
name = "typescript"
|
||||
@ -2092,10 +2092,10 @@ name = "typescript"
|
||||
language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "efm-lsp-prettier" ]
|
||||
</code></pre>
|
||||
<p>Each requested LSP feature is prioritized in the order of the <code>language-servers</code> array.
|
||||
For example the first <code>goto-definition</code> supported language server (in this case <code>typescript-language-server</code>) will be taken for the relevant LSP request (command <code>goto_definition</code>).
|
||||
For example, the first <code>goto-definition</code> supported language server (in this case <code>typescript-language-server</code>) will be taken for the relevant LSP request (command <code>goto_definition</code>).
|
||||
The features <code>diagnostics</code>, <code>code-action</code>, <code>completion</code>, <code>document-symbols</code> and <code>workspace-symbols</code> are an exception to that rule, as they are working for all language servers at the same time and are merged together, if enabled for the language.
|
||||
If no <code>except-features</code> or <code>only-features</code> is given all features for the language server are enabled.
|
||||
If a language server itself doesn't support a feature the next language server array entry will be tried (and so on).</p>
|
||||
If no <code>except-features</code> or <code>only-features</code> is given, all features for the language server are enabled.
|
||||
If a language server itself doesn't support a feature, the next language server array entry will be tried (and so on).</p>
|
||||
<p>The list of supported features is:</p>
|
||||
<ul>
|
||||
<li><code>format</code></li>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user