Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into line_ending_detection
Browse files Browse the repository at this point in the history
  • Loading branch information
janhrastnik committed Jun 19, 2021
2 parents 97323dc + 2cbec2b commit cdd9347
Show file tree
Hide file tree
Showing 35 changed files with 1,704 additions and 750 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
- [Usage](./usage.md)
- [Configuration](./configuration.md)
- [Keymap](./keymap.md)
- [Key Remapping](./remapping.md)
- [Hooks](./hooks.md)
14 changes: 11 additions & 3 deletions book/src/configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Configuration

## LSP

To disable language server progress report from being displayed in the status bar add this option to your `config.toml`:
```toml
lsp-progress = false
```

## Theme

Use a custom theme by placing a theme.toml in your config directory (i.e ~/.config/helix/theme.toml). The default theme.toml can be found [here](https://github.com/helix-editor/helix/blob/master/theme.toml), and user submitted themes [here](https://github.com/helix-editor/helix/blob/master/contrib/themes).
Expand Down Expand Up @@ -32,11 +39,11 @@ Possible modifiers:
| `dim` |
| `italic` |
| `underlined` |
| `slow\_blink` |
| `rapid\_blink` |
| `slow_blink` |
| `rapid_blink` |
| `reversed` |
| `hidden` |
| `crossed\_out` |
| `crossed_out` |

Possible keys:

Expand Down Expand Up @@ -87,3 +94,4 @@ Possible keys:
These keys match [tree-sitter scopes](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme). We half-follow the common scopes from [macromates language grammars](https://macromates.com/manual/en/language_grammars) with some differences.

For a given highlight produced, styling will be determined based on the longest matching theme key. So it's enough to provide function to highlight `function.macro` and `function.builtin` as well, but you can use more specific scopes to highlight specific cases differently.

7 changes: 5 additions & 2 deletions book/src/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ We provide pre-built binaries on the [GitHub Releases page](https://github.com/h

## OSX

TODO: brew tap
A Homebrew tap is available:

Please use a pre-built binary release for the time being.
```
brew tap helix-editor/helix
brew install helix
```

## Linux

Expand Down
48 changes: 48 additions & 0 deletions book/src/remapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Key Remapping

One-way key remapping is temporarily supported via a simple TOML configuration
file. (More powerful solutions such as rebinding via commands will be
available in the feature).

To remap keys, write a `config.toml` file in your `helix` configuration
directory (default `~/.config/helix` in Linux systems) with a structure like
this:

```toml
# At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'
[keys.normal]
a = "move_char_left" # Maps the 'a' key to the move_char_left command
w = "move_line_up" # Maps the 'w' key move_line_up
C-S-esc = "select_line" # Maps Control-Shift-Escape to select_line

[keys.insert]
A-x = "normal_mode" # Maps Alt-X to enter normal mode
```

Control, Shift and Alt modifiers are encoded respectively with the prefixes
`C-`, `S-` and `A-`. Special keys are encoded as follows:

* Backspace => "backspace"
* Space => "space"
* Return/Enter => "ret"
* < => "lt"
* \> => "gt"
* \+ => "plus"
* \- => "minus"
* ; => "semicolon"
* % => "percent"
* Left => "left"
* Right => "right"
* Up => "up"
* Home => "home"
* End => "end"
* Page Up => "pageup"
* Page Down => "pagedown"
* Tab => "tab"
* Back Tab => "backtab"
* Delete => "del"
* Insert => "ins"
* Null => "null"
* Escape => "esc"

Commands can be found in the source code at `../../helix-term/src/commands.rs`
5 changes: 3 additions & 2 deletions contrib/themes/bogster.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@
"ui.background" = { bg = "#161c23" }
"ui.linenr" = { fg = "#415367" }
"ui.linenr.selected" = { fg = "#e5ded6" } # TODO
"ui.statusline" = { bg = "#232d38" }
"ui.statusline" = { fg = "#e5ded6", bg = "#232d38" }
"ui.statusline.inactive" = { fg = "#c6b8ad", bg = "#232d38" }
"ui.popup" = { bg = "#232d38" }
"ui.window" = { bg = "#232d38" }
"ui.help" = { bg = "#232d38", fg = "#e5ded6" }

"ui.text" = { fg = "#e5ded6" }
"ui.text.focus" = { fg = "#e5ded6", modifiers= ["bold"] }

"ui.selection" = { bg = "#540099" }
"ui.selection" = { bg = "#313f4e" }
"ui.menu.selected" = { fg = "#e5ded6", bg = "#313f4e" }

"warning" = "#dc7759"
Expand Down
3 changes: 2 additions & 1 deletion contrib/themes/ingrid.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"ui.background" = { bg = "#FFFCFD" }
"ui.linenr" = { fg = "#bbbbbb" }
"ui.linenr.selected" = { fg = "#F3EAE9" } # TODO
"ui.statusline" = { bg = "#F3EAE9" }
"ui.statusline" = { fg = "#250E07", bg = "#F3EAE9" }
"ui.statusline.inactive" = { fg = "#7b91b3", bg = "#F3EAE9" }
"ui.popup" = { bg = "#F3EAE9" }
"ui.window" = { bg = "#D8B8B3" }
"ui.help" = { bg = "#D8B8B3", fg = "#250E07" }
Expand Down
1 change: 1 addition & 0 deletions contrib/themes/onedark.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"ui.linenr.selected" = { fg = "#ABB2BF" }
"ui.popup" = { bg = "#3E4452" }
"ui.statusline" = { fg = "#ABB2BF", bg = "#2C323C" }
"ui.statusline.inactive" = { fg = "#ABB2Bf", bg = "#2C323C" }
"ui.selection" = { bg = "#3E4452" }
"ui.text" = { fg = "#ABB2BF", bg = "#282C34" }
"ui.text.focus" = { fg = "#ABB2BF", bg = "#2C323C", modifiers = ['bold'] }
Expand Down
26 changes: 13 additions & 13 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions helix-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ version = "0.2.0"
authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
edition = "2018"
license = "MPL-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

description = "Helix editor core editing primitives"
categories = ["editor"]
repository = "https://github.com/helix-editor/helix"
homepage = "https://helix-editor.com"
include = ["src/**/*", "README.md"]

[features]
embed_runtime = ["rust-embed"]

[dependencies]
helix-syntax = { path = "../helix-syntax" }
helix-syntax = { version = "0.2", path = "../helix-syntax" }

ropey = "1.2"
ropey = "1.3"
smallvec = "1.4"
tendril = "0.4.2"
unicode-segmentation = "1.7.1"
Expand Down
2 changes: 2 additions & 0 deletions helix-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ pub fn cache_dir() -> std::path::PathBuf {
path
}

pub use etcetera::home_dir;

use etcetera::base_strategy::{choose_base_strategy, BaseStrategy};

pub use ropey::{Rope, RopeSlice};
Expand Down
8 changes: 6 additions & 2 deletions helix-lsp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ version = "0.2.0"
authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
edition = "2018"
license = "MPL-2.0"
description = "LSP client implementation for Helix project"
categories = ["editor"]
repository = "https://github.com/helix-editor/helix"
homepage = "https://helix-editor.com"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
helix-core = { path = "../helix-core" }
helix-core = { version = "0.2", path = "../helix-core" }

anyhow = "1.0"
futures-executor = "0.3"
Expand All @@ -20,4 +24,4 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
tokio = { version = "1.6", features = ["full"] }
tokio-stream = "0.1.6"
tokio-stream = "0.1.6"
Loading

0 comments on commit cdd9347

Please sign in to comment.