mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-25 17:23:39 +01:00
Merge remote-tracking branch 'origin/master' into HEAD
This commit is contained in:
commit
a65b0828ee
14
.github/workflows/CICD.yml
vendored
14
.github/workflows/CICD.yml
vendored
@ -24,14 +24,14 @@ jobs:
|
|||||||
default: true
|
default: true
|
||||||
profile: minimal
|
profile: minimal
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- run: cargo fmt -- --check
|
- run: cargo fmt -- --check
|
||||||
|
|
||||||
license_checks:
|
license_checks:
|
||||||
name: License checks
|
name: License checks
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: true # we especially want to perform license checks on submodules
|
submodules: true # we especially want to perform license checks on submodules
|
||||||
- run: tests/scripts/license-checks.sh
|
- run: tests/scripts/license-checks.sh
|
||||||
@ -43,7 +43,7 @@ jobs:
|
|||||||
MSRV_FEATURES: --no-default-features --features minimal-application,bugreport,build-assets
|
MSRV_FEATURES: --no-default-features --features minimal-application,bugreport,build-assets
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }})
|
- name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }})
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@ -68,7 +68,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: true # we need all syntax and theme submodules
|
submodules: true # we need all syntax and theme submodules
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
@ -113,7 +113,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: Prepare environment variables
|
- name: Prepare environment variables
|
||||||
run: |
|
run: |
|
||||||
echo "BAT_SYSTEM_CONFIG_PREFIX=$GITHUB_WORKSPACE/tests/examples/system_config" >> $GITHUB_ENV
|
echo "BAT_SYSTEM_CONFIG_PREFIX=$GITHUB_WORKSPACE/tests/examples/system_config" >> $GITHUB_ENV
|
||||||
@ -139,7 +139,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
@ -186,7 +186,7 @@ jobs:
|
|||||||
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
|
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install prerequisites
|
- name: Install prerequisites
|
||||||
shell: bash
|
shell: bash
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -244,3 +244,6 @@
|
|||||||
url = https://github.com/victor-gp/cmd-help-sublime-syntax.git
|
url = https://github.com/victor-gp/cmd-help-sublime-syntax.git
|
||||||
branch = main
|
branch = main
|
||||||
shallow = true
|
shallow = true
|
||||||
|
[submodule "assets/syntaxes/02_Extra/Ada"]
|
||||||
|
path = assets/syntaxes/02_Extra/Ada
|
||||||
|
url = https://github.com/wiremoons/ada-sublime-syntax
|
||||||
|
@ -2,12 +2,19 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
- Implemented `-S` and `--chop-long-lines` flags as aliases for `--wrap=never`. See #2309 (@johnmatthiggins)
|
||||||
|
|
||||||
## Bugfixes
|
## Bugfixes
|
||||||
|
|
||||||
## Other
|
## Other
|
||||||
|
|
||||||
|
- Various bash completion improvements, see #2310 (@scop)
|
||||||
|
|
||||||
## Syntaxes
|
## Syntaxes
|
||||||
|
|
||||||
|
- Added support for Ada, see #1300 and #2316 (@dkm)
|
||||||
|
- Improve Manpage.sublime-syntax. See #2364 (@Freed-Wu)
|
||||||
|
|
||||||
## Themes
|
## Themes
|
||||||
|
|
||||||
## `bat` as a library
|
## `bat` as a library
|
||||||
@ -19,7 +26,6 @@
|
|||||||
|
|
||||||
- Bring back pre-processing of ANSI escape characters to so that some common `bat` use cases starts working again. See #2308 (@Enselic)
|
- Bring back pre-processing of ANSI escape characters to so that some common `bat` use cases starts working again. See #2308 (@Enselic)
|
||||||
|
|
||||||
|
|
||||||
# v0.22.0
|
# v0.22.0
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
@ -367,7 +367,7 @@ Existing packages may be available, but are not officially supported and may con
|
|||||||
|
|
||||||
### On macOS (or Linux) via Homebrew
|
### On macOS (or Linux) via Homebrew
|
||||||
|
|
||||||
You can install `bat` with [Homebrew on MacOS](https://formulae.brew.sh/formula/bat) or [Homebrew on Linux](https://formulae.brew.sh/formula-linux/bat):
|
You can install `bat` with [Homebrew](https://formulae.brew.sh/formula/bat):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install bat
|
brew install bat
|
||||||
|
1
assets/syntaxes/02_Extra/Ada
vendored
Submodule
1
assets/syntaxes/02_Extra/Ada
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit e2b8fd51756e0cc42172c1c3405832ce9c19b6b6
|
@ -75,7 +75,7 @@ contexts:
|
|||||||
|
|
||||||
options:
|
options:
|
||||||
# command-line options like --option=value, --some-flag, or -x
|
# command-line options like --option=value, --some-flag, or -x
|
||||||
- match: '^[ ]{7}(?=-)'
|
- match: '^[ ]{7}(?=-|\+)'
|
||||||
push: expect-command-line-option
|
push: expect-command-line-option
|
||||||
- match: '(?:[^a-zA-Z0-9_-]|^|\s){{command_line_option}}'
|
- match: '(?:[^a-zA-Z0-9_-]|^|\s){{command_line_option}}'
|
||||||
captures:
|
captures:
|
||||||
@ -96,7 +96,7 @@ contexts:
|
|||||||
- include: env-var
|
- include: env-var
|
||||||
|
|
||||||
expect-command-line-option:
|
expect-command-line-option:
|
||||||
- match: '[A-Za-z0-9-]+'
|
- match: '[A-Za-z0-9-\.\?:#\$\+]+'
|
||||||
scope: entity.name.command-line-option.man
|
scope: entity.name.command-line-option.man
|
||||||
- match: '(\[)(=)'
|
- match: '(\[)(=)'
|
||||||
captures:
|
captures:
|
||||||
@ -122,7 +122,7 @@ contexts:
|
|||||||
pop: true
|
pop: true
|
||||||
|
|
||||||
expect-parameter:
|
expect-parameter:
|
||||||
- match: '[A-Za-z0-9-]+'
|
- match: '[A-Za-z0-9-_]+'
|
||||||
scope: variable.parameter.man
|
scope: variable.parameter.man
|
||||||
- match: (?=\s+\|)
|
- match: (?=\s+\|)
|
||||||
pop: true
|
pop: true
|
||||||
|
@ -77,12 +77,12 @@ themes (`bat cache --clear`).
|
|||||||
|
|
||||||
The following files have been manually modified after converting from a `.tmLanguage` file:
|
The following files have been manually modified after converting from a `.tmLanguage` file:
|
||||||
|
|
||||||
* `Apache.sublime_syntax`=> removed `.conf` and `.CONF` file types.
|
* `Apache.sublime_syntax`=> removed `conf` and `CONF` file types.
|
||||||
* `Dart.sublime-syntax` => removed `#regex.dart` include.
|
* `Dart.sublime-syntax` => removed `#regex.dart` include.
|
||||||
* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types and support for comments after section headers
|
* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types and support for comments after section headers.
|
||||||
* `Org mode.sublime-syntax` => removed `task` file type.
|
* `Org mode.sublime-syntax` => removed `task` file type.
|
||||||
|
* `Robot.sublime_syntax` => changed name to "Robot Framework", added `.resource` extension.
|
||||||
* `SML.sublime_syntax` => removed `ml` file type.
|
* `SML.sublime_syntax` => removed `ml` file type.
|
||||||
* `Robot.sublime_syntax` => changed name to "Robot Framework", added `.resource` extension
|
|
||||||
|
|
||||||
### Non-submodule additions
|
### Non-submodule additions
|
||||||
|
|
||||||
|
@ -161,17 +161,21 @@ impl App {
|
|||||||
}),
|
}),
|
||||||
show_nonprintable: self.matches.get_flag("show-all"),
|
show_nonprintable: self.matches.get_flag("show-all"),
|
||||||
wrapping_mode: if self.interactive_output || maybe_term_width.is_some() {
|
wrapping_mode: if self.interactive_output || maybe_term_width.is_some() {
|
||||||
match self.matches.get_one::<String>("wrap").map(|s| s.as_str()) {
|
if !self.matches.get_flag("chop-long-lines") {
|
||||||
Some("character") => WrappingMode::Character,
|
match self.matches.get_one::<String>("wrap").map(|s| s.as_str()) {
|
||||||
Some("never") => WrappingMode::NoWrapping(true),
|
Some("character") => WrappingMode::Character,
|
||||||
Some("auto") | None => {
|
Some("never") => WrappingMode::NoWrapping(true),
|
||||||
if style_components.plain() {
|
Some("auto") | None => {
|
||||||
WrappingMode::NoWrapping(false)
|
if style_components.plain() {
|
||||||
} else {
|
WrappingMode::NoWrapping(false)
|
||||||
WrappingMode::Character
|
} else {
|
||||||
|
WrappingMode::Character
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
_ => unreachable!("other values for --wrap are not allowed"),
|
||||||
}
|
}
|
||||||
_ => unreachable!("other values for --wrap are not allowed"),
|
} else {
|
||||||
|
WrappingMode::NoWrapping(true)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We don't have the tty width when piping to another program.
|
// We don't have the tty width when piping to another program.
|
||||||
|
@ -185,6 +185,13 @@ pub fn build_app(interactive_output: bool) -> Command {
|
|||||||
The '--terminal-width' option can be used in addition to \
|
The '--terminal-width' option can be used in addition to \
|
||||||
control the output width."),
|
control the output width."),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::new("chop-long-lines")
|
||||||
|
.long("chop-long-lines")
|
||||||
|
.short('S')
|
||||||
|
.action(ArgAction::SetTrue)
|
||||||
|
.help("Truncate all lines longer than screen width. Alias for '--wrap=never'."),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("terminal-width")
|
Arg::new("terminal-width")
|
||||||
.long("terminal-width")
|
.long("terminal-width")
|
||||||
|
1
tests/examples/long-single-line.txt
vendored
Normal file
1
tests/examples/long-single-line.txt
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
abcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyz
|
@ -1499,6 +1499,47 @@ fn ignored_suffix_arg() {
|
|||||||
.stderr("");
|
.stderr("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn wrapping_test(wrap_flag: &str, expect_wrap: bool) {
|
||||||
|
let expected = match expect_wrap {
|
||||||
|
true =>
|
||||||
|
"abcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcde\nfghigklmnopqrstuvxyz\n",
|
||||||
|
false =>
|
||||||
|
"abcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyz\n",
|
||||||
|
};
|
||||||
|
|
||||||
|
bat()
|
||||||
|
.arg(wrap_flag)
|
||||||
|
.arg("--style=rule")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--terminal-width=80")
|
||||||
|
.arg("long-single-line.txt")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(expected.to_owned())
|
||||||
|
.stderr("");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn no_line_wrapping_when_set_to_never() {
|
||||||
|
wrapping_test("--wrap=never", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn line_wrapping_when_auto() {
|
||||||
|
wrapping_test("--wrap=auto", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn no_line_wrapping_with_s_flag() {
|
||||||
|
wrapping_test("-S", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn no_wrapping_with_chop_long_lines() {
|
||||||
|
wrapping_test("--chop-long-lines", false);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn highlighting_is_skipped_on_long_lines() {
|
fn highlighting_is_skipped_on_long_lines() {
|
||||||
let expected = "\u{1b}[38;5;231m{\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;208mapi\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;231m:\u{1b}[0m\n".to_owned() +
|
let expected = "\u{1b}[38;5;231m{\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;208mapi\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;231m:\u{1b}[0m\n".to_owned() +
|
||||||
|
308
tests/syntax-tests/highlighted/Ada/click.adb
vendored
Normal file
308
tests/syntax-tests/highlighted/Ada/click.adb
vendored
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
[38;2;230;219;116mwith Chests.Ring_Buffers;[0m
|
||||||
|
[38;2;230;219;116mwith USB.Device.HID.Keyboard;[0m
|
||||||
|
|
||||||
|
[38;2;249;38;114mpackage[0m[38;2;248;248;242m [0m[38;2;249;38;114mbody[0m[38;2;248;248;242m [0m[38;2;166;226;46mClick[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m--------------[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m DEBOUNCE --[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m--------------[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Ideally, in a separate package.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m should be [], but not fixed yet in GCC 11.[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCurrent_Status[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Key_Matrix := [[0m[38;2;249;38;114mothers[0m[38;2;248;248;242m => [[0m[38;2;249;38;114mothers[0m[38;2;248;248;242m => False]];[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mNew_Status[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Key_Matrix := [[0m[38;2;249;38;114mothers[0m[38;2;248;248;242m => [[0m[38;2;249;38;114mothers[0m[38;2;248;248;242m => False]];[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mSince[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural := [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Nb_Bounce : Natural := 5;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mUpdate[0m[38;2;248;248;242m (NewS : Key_Matrix) [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Boolean [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m The new state is the same as the current stable state => Do nothing.[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m Current_Status = NewS [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mSince[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m False;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m New_Status /= NewS [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m The new state differs from the previous[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m new state (bouncing) => reset[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mNew_Status[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= NewS;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mSince[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114melse[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m The new state hasn't changed since last[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m update => towards stabilization.[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mSince[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= Since + [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m Since > Nb_Bounce [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mdeclare[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mTmp[0m[38;2;249;38;114m :[0m[38;2;248;248;242m [0m[38;2;249;38;114mconstant[0m[38;2;248;248;242m Key_Matrix := Current_Status;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m New state has been stable enough.[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Latch it and notifies caller.[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCurrent_Status[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= New_Status;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mNew_Status[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= Tmp;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mSince[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m True;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114melse[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Not there yet[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m False;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mUpdate[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mprocedure[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Matrix[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Could use := []; but GNAT 12 has a bug (fixed in upcoming 13)[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mRead_Status[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Key_Matrix := [[0m[38;2;249;38;114mothers[0m[38;2;248;248;242m => [[0m[38;2;249;38;114mothers[0m[38;2;248;248;242m => False]];[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Events[0m[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Events [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mNum_Evt[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural := [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mNew_S[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Key_Matrix [0m[38;2;249;38;114mrenames[0m[38;2;248;248;242m Read_Status;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m Get_Matrix;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m Update (New_S) [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m I [0m[38;2;249;38;114min[0m[38;2;248;248;242m Current_Status'[0m[38;2;249;38;114mRange[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m) [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m J [0m[38;2;249;38;114min[0m[38;2;248;248;242m Current_Status'[0m[38;2;249;38;114mRange[0m[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m) [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m ([0m[38;2;249;38;114mnot[0m[38;2;248;248;242m New_Status (I, J) [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m[38;2;248;248;242m Current_Status (I, J))[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mor[0m[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m (New_Status (I, J) [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m[38;2;248;248;242m [0m[38;2;249;38;114mnot[0m[38;2;248;248;242m Current_Status (I, J))[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mNum_Evt[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= Num_Evt + [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mdeclare[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mEvts[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Events (Natural [0m[38;2;249;38;114mrange[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m .. Num_Evt);[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCursor[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural [0m[38;2;249;38;114mrange[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m .. Num_Evt + [0m[38;2;190;132;255m1[0m[38;2;248;248;242m := [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m I [0m[38;2;249;38;114min[0m[38;2;248;248;242m Current_Status'[0m[38;2;249;38;114mRange[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m) [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m J [0m[38;2;249;38;114min[0m[38;2;248;248;242m Current_Status'[0m[38;2;249;38;114mRange[0m[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m) [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;249;38;114mnot[0m[38;2;248;248;242m New_Status (I, J)[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m[38;2;248;248;242m Current_Status (I, J)[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Pressing I, J[0m
|
||||||
|
[38;2;248;248;242m Evts (Cursor) := [[0m
|
||||||
|
[38;2;248;248;242m Evt => Press,[0m
|
||||||
|
[38;2;248;248;242m Col => I,[0m
|
||||||
|
[38;2;248;248;242m Row => J[0m
|
||||||
|
[38;2;248;248;242m ];[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCursor[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= Cursor + [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114melsif[0m[38;2;248;248;242m New_Status (I, J)[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m[38;2;248;248;242m [0m[38;2;249;38;114mnot[0m[38;2;248;248;242m Current_Status (I, J)[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Release I, J[0m
|
||||||
|
[38;2;248;248;242m Evts (Cursor) := [[0m
|
||||||
|
[38;2;248;248;242m Evt => Release,[0m
|
||||||
|
[38;2;248;248;242m Col => I,[0m
|
||||||
|
[38;2;248;248;242m Row => J[0m
|
||||||
|
[38;2;248;248;242m ];[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCursor[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= Cursor + [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Evts;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [];[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Events[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mprocedure[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Matrix[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m return Key_Matrix is[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Row [0m[38;2;249;38;114min[0m[38;2;248;248;242m Keys.Rows'[0m[38;2;249;38;114mRange[0m[38;2;248;248;242m [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m Keys.Rows (Row).Clear;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Col [0m[38;2;249;38;114min[0m[38;2;248;248;242m Keys.Cols'[0m[38;2;249;38;114mRange[0m[38;2;248;248;242m [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m Read_Status (Col, Row) := [0m[38;2;249;38;114mnot[0m[38;2;248;248;242m Keys.Cols (Col).Set;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m Keys.Rows (Row).Set;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Matrix[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m End of DEBOUNCE[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m------------[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Layout --[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m------------[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mpackage[0m[38;2;248;248;242m [0m[38;2;166;226;46mEvents_Ring_Buffers[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114mnew[0m[38;2;248;248;242m Chests.Ring_Buffers[0m
|
||||||
|
[38;2;248;248;242m (Element_Type => Event,[0m
|
||||||
|
[38;2;248;248;242m Capacity => [0m[38;2;190;132;255m16[0m[38;2;248;248;242m);[0m
|
||||||
|
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mQueued_Events[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Events_Ring_Buffers.Ring_Buffer;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Statet [0m[38;2;249;38;114mis[0m[38;2;248;248;242m (Normal_Key, Layer_Mod, None);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m State [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114mrecord[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mTyp[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Statet;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCode[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Key_Code_T;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mLayer_Value[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Col : ColR;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Row : RowR;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend record[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m State_Array [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114marray[0m[38;2;248;248;242m (ColR, RowR) [0m[38;2;249;38;114mof[0m[38;2;248;248;242m State;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mStates[0m[38;2;249;38;114m :[0m[38;2;248;248;242m State_Array := [[0m[38;2;249;38;114mothers[0m[38;2;248;248;242m => [[0m[38;2;249;38;114mothers[0m[38;2;248;248;242m => (Typ => None, Code => No, Layer_Value => [0m[38;2;190;132;255m0[0m[38;2;248;248;242m)]];[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mKw[0m[38;2;248;248;242m (Code : Key_Code_T) [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Action [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m (T => Key, C => Code, L => [0m[38;2;190;132;255m0[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mKw[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mLw[0m[38;2;248;248;242m (V : Natural) [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Action [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m (T => Layer, C => No, L => V);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mLw[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m FIXME: hardcoded max number of events[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114msubtype[0m[38;2;248;248;242m Events_Range [0m[38;2;249;38;114mis[0m[38;2;248;248;242m Natural [0m[38;2;249;38;114mrange[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m .. [0m[38;2;190;132;255m60[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Array_Of_Reg_Events [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114marray[0m[38;2;248;248;242m (Events_Range) [0m[38;2;249;38;114mof[0m[38;2;248;248;242m Event;[0m
|
||||||
|
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mStamp[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural := [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mprocedure[0m[38;2;248;248;242m [0m[38;2;166;226;46mRegister_Events[0m[38;2;248;248;242m (L : Layout; Es : Events) [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mStamp[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= Stamp + [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Log ([0m[38;2;230;219;116m"[0m[38;2;230;219;116mReg events: [0m[38;2;230;219;116m"[0m[38;2;248;248;242m & Stamp'Image);[0m
|
||||||
|
[38;2;248;248;242m Log (Es'Length'Image);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m E [0m[38;2;249;38;114mof[0m[38;2;248;248;242m Es [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mdeclare[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m Events_Ring_Buffers.Is_Full (Queued_Events) [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mraise[0m[38;2;248;248;242m Program_Error;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Events_Ring_Buffers.Append (Queued_Events, E);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Log ("Reg'ed events:" & Events_Mark'Image);[0m
|
||||||
|
[38;2;248;248;242m Log ([0m[38;2;230;219;116m"[0m[38;2;230;219;116mReg'ed events:[0m[38;2;230;219;116m"[0m[38;2;248;248;242m & Events_Ring_Buffers.Length (Queued_Events)'Image);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mRegister_Events[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mprocedure[0m[38;2;248;248;242m [0m[38;2;166;226;46mRelease[0m[38;2;248;248;242m (Col: Colr; Row: Rowr) [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m States (Col, Row).Typ = None [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mraise[0m[38;2;248;248;242m Program_Error;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m States (Col, Row) := (Typ => None, Code => No, Layer_Value => [0m[38;2;190;132;255m0[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mRelease[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Current_Layer[0m[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Natural [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mL[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural := [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m S [0m[38;2;249;38;114mof[0m[38;2;248;248;242m States [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m S.Typ = Layer_Mod [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mL[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= L + S.Layer_Value;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m L;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Current_Layer[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Tick the event.[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Returns TRUE if it needs to stay in the queued events[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m FALSE if the event has been consumed.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mTick[0m[38;2;248;248;242m (L: Layout; E : [0m[38;2;249;38;114min[0m[38;2;248;248;242m [0m[38;2;249;38;114mout[0m[38;2;248;248;242m Event) [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Boolean [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCurrent_Layer[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural := Get_Current_Layer;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mA[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Action [0m[38;2;249;38;114mrenames[0m[38;2;248;248;242m L (Current_Layer, E.Row, E.Col);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mcase[0m[38;2;248;248;242m E.Evt [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m Press =>[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mcase[0m[38;2;248;248;242m A.T [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m Key =>[0m
|
||||||
|
[38;2;248;248;242m States (E.Col, E.Row) :=[0m
|
||||||
|
[38;2;248;248;242m (Typ => Normal_Key,[0m
|
||||||
|
[38;2;248;248;242m Code => A.C,[0m
|
||||||
|
[38;2;248;248;242m Layer_Value => [0m[38;2;190;132;255m0[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m Layer =>[0m
|
||||||
|
[38;2;248;248;242m States (E.Col, E.Row) := (Typ => Layer_Mod, Layer_Value => A.L, Code => No);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m [0m[38;2;249;38;114mothers[0m[38;2;248;248;242m =>[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mraise[0m[38;2;248;248;242m Program_Error;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend case[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m Release =>[0m
|
||||||
|
[38;2;248;248;242m Release (E.Col, E.Row);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend case[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m False;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mTick[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mLast_Was_Empty_Log[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Boolean := False;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mprocedure[0m[38;2;248;248;242m [0m[38;2;166;226;46mTick[0m[38;2;248;248;242m (L : Layout) [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m I [0m[38;2;249;38;114min[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m .. Events_Ring_Buffers.Length(Queued_Events) [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mdeclare[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mE[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Event := Events_Ring_Buffers.Last_Element (Queued_Events);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m Events_Ring_Buffers.Delete_Last (Queued_Events);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m Tick (L, E) [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m Events_Ring_Buffers.Prepend (Queued_Events, E);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;249;38;114mnot[0m[38;2;248;248;242m Last_Was_Empty_Log [0m[38;2;249;38;114mor[0m[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m Events_Ring_Buffers.Length(Queued_Events) /= [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m Log ([0m[38;2;230;219;116m"[0m[38;2;230;219;116mEnd Tick layout, events: [0m[38;2;230;219;116m"[0m[38;2;248;248;242m & Events_Ring_Buffers.Length(Queued_Events)'Image);[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mLast_Was_Empty_Log[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= Events_Ring_Buffers.Length(Queued_Events) = [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mTick[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Key_Codes[0m[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Key_Codes_T [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCodes[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Key_Codes_T ([0m[38;2;190;132;255m0[0m[38;2;248;248;242m .. [0m[38;2;190;132;255m10[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mWm[0m[38;2;249;38;114m:[0m[38;2;248;248;242m Natural := [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m S [0m[38;2;249;38;114mof[0m[38;2;248;248;242m States [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m S.Typ = Normal_Key [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m (S.Code < LCtrl [0m[38;2;249;38;114mor[0m[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m S.Code > RGui)[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m Codes (Wm) := S.Code;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mWm[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= Wm + [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m Wm = [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [];[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114melse[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Codes ([0m[38;2;190;132;255m0[0m[38;2;248;248;242m .. Wm - [0m[38;2;190;132;255m1[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Key_Codes[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Modifiers[0m[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Key_Modifiers [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114muse[0m[38;2;248;248;242m USB.Device.HID.Keyboard;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mKM[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Key_Modifiers ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m..[0m[38;2;190;132;255m8[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mI[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural := [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m S [0m[38;2;249;38;114mof[0m[38;2;248;248;242m States [0m[38;2;249;38;114mloop[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m S.Typ = Normal_Key [0m[38;2;249;38;114mthen[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mI[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= I + [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mcase[0m[38;2;248;248;242m S.Code [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m LCtrl =>[0m
|
||||||
|
[38;2;248;248;242m KM(I) := Ctrl_Left;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m RCtrl =>[0m
|
||||||
|
[38;2;248;248;242m KM(I) := Ctrl_Right;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m LShift =>[0m
|
||||||
|
[38;2;248;248;242m KM(I) := Shift_Left;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m RShift =>[0m
|
||||||
|
[38;2;248;248;242m KM(I) := Shift_Right;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m LAlt =>[0m
|
||||||
|
[38;2;248;248;242m KM(I) := Alt_Left;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m RAlt =>[0m
|
||||||
|
[38;2;248;248;242m KM(I) := Alt_Right;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m LGui =>[0m
|
||||||
|
[38;2;248;248;242m KM(I) := Meta_Left;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m RGui =>[0m
|
||||||
|
[38;2;248;248;242m KM(I) := Meta_Right;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m [0m[38;2;249;38;114mothers[0m[38;2;248;248;242m =>[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mI[0m[38;2;249;38;114m :[0m[38;2;248;248;242m= I - [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend case[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend if[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend loop[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m KM ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m..I);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Modifiers[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mprocedure[0m[38;2;248;248;242m [0m[38;2;166;226;46mInit[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m
|
||||||
|
[38;2;248;248;242m Events_Ring_Buffers.Clear (Queued_Events);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mInit[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mClick[0m[38;2;248;248;242m;[0m
|
339
tests/syntax-tests/highlighted/Ada/click.ads
vendored
Normal file
339
tests/syntax-tests/highlighted/Ada/click.ads
vendored
Normal file
@ -0,0 +1,339 @@
|
|||||||
|
[38;2;230;219;116mwith HAL.GPIO;[0m
|
||||||
|
[38;2;230;219;116mwith USB.Device.HID.Keyboard;[0m
|
||||||
|
|
||||||
|
[38;2;249;38;114mgeneric[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mNb_Bounce[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m ColR [0m[38;2;249;38;114mis[0m[38;2;248;248;242m (<>);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m RowR [0m[38;2;249;38;114mis[0m[38;2;248;248;242m (<>);[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m GPIOP [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114mnew[0m[38;2;248;248;242m HAL.GPIO.GPIO_Point [0m[38;2;249;38;114mwith[0m[38;2;248;248;242m [0m[38;2;249;38;114mprivate[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Cols_T [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114marray[0m[38;2;248;248;242m (ColR) [0m[38;2;249;38;114mof[0m[38;2;248;248;242m GPIOP;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Rows_T [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114marray[0m[38;2;248;248;242m (RowR) [0m[38;2;249;38;114mof[0m[38;2;248;248;242m GPIOP;[0m
|
||||||
|
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCols[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Cols_T;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mRows[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Rows_T;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mNum_Layers[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mwith[0m[38;2;248;248;242m [0m[38;2;249;38;114mprocedure[0m[38;2;248;248;242m [0m[38;2;166;226;46mLog[0m[38;2;248;248;242m (S : String; L : Integer := [0m[38;2;190;132;255m1[0m[38;2;248;248;242m; Deindent : Integer := [0m[38;2;190;132;255m0[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;249;38;114mpackage[0m[38;2;248;248;242m [0m[38;2;166;226;46mClick[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Keys_T [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114mrecord[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCols[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Cols_T;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mRows[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Rows_T;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend record[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mKeys[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Keys_T :=[0m
|
||||||
|
[38;2;248;248;242m (Rows => Rows, Cols => Cols);[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Key_Matrix [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114marray[0m[38;2;248;248;242m (ColR, RowR) [0m[38;2;249;38;114mof[0m[38;2;248;248;242m Boolean;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m------------------------[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Events & Debouncing --[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m------------------------[0m
|
||||||
|
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mMaxEvents[0m[38;2;249;38;114m :[0m[38;2;248;248;242m [0m[38;2;249;38;114mconstant[0m[38;2;248;248;242m Positive := [0m[38;2;190;132;255m20[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m EventT [0m[38;2;249;38;114mis[0m[38;2;248;248;242m (Press, Release);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Event [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114mrecord[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mEvt[0m[38;2;249;38;114m :[0m[38;2;248;248;242m EventT;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mCol[0m[38;2;249;38;114m :[0m[38;2;248;248;242m ColR;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mRow[0m[38;2;249;38;114m :[0m[38;2;248;248;242m RowR;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend record[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Events [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114marray[0m[38;2;248;248;242m (Natural [0m[38;2;249;38;114mrange[0m[38;2;248;248;242m <>) [0m[38;2;249;38;114mof[0m[38;2;248;248;242m Event;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Events[0m[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Events;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mUpdate[0m[38;2;248;248;242m (NewS : Key_Matrix) [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Boolean;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m-----------[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Layout --[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m-----------[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m-------------[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Keycodes --[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m-------------[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Keycodes copy/pasted from the excelent Keyberon Rust firmware:[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m https://github.com/TeXitoi/keyberon/[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Key_Code_T [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m ([0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m The "no" key, a placeholder to express nothing.[0m
|
||||||
|
[38;2;248;248;242m No, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m = 0x00,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m / Error if too much keys are pressed at[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m the same time.[0m
|
||||||
|
[38;2;248;248;242m ErrorRollOver,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m / The POST fail error.[0m
|
||||||
|
[38;2;248;248;242m PostFail,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m / An undefined error occured.[0m
|
||||||
|
[38;2;248;248;242m ErrorUndefined,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m / `a` and `A`.[0m
|
||||||
|
[38;2;248;248;242m A,[0m
|
||||||
|
[38;2;248;248;242m B,[0m
|
||||||
|
[38;2;248;248;242m C,[0m
|
||||||
|
[38;2;248;248;242m D,[0m
|
||||||
|
[38;2;248;248;242m E,[0m
|
||||||
|
[38;2;248;248;242m F,[0m
|
||||||
|
[38;2;248;248;242m G,[0m
|
||||||
|
[38;2;248;248;242m H,[0m
|
||||||
|
[38;2;248;248;242m I,[0m
|
||||||
|
[38;2;248;248;242m J,[0m
|
||||||
|
[38;2;248;248;242m K,[0m
|
||||||
|
[38;2;248;248;242m L,[0m
|
||||||
|
[38;2;248;248;242m M, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0x10[0m
|
||||||
|
[38;2;248;248;242m N,[0m
|
||||||
|
[38;2;248;248;242m O,[0m
|
||||||
|
[38;2;248;248;242m P,[0m
|
||||||
|
[38;2;248;248;242m Q,[0m
|
||||||
|
[38;2;248;248;242m R,[0m
|
||||||
|
[38;2;248;248;242m S,[0m
|
||||||
|
[38;2;248;248;242m T,[0m
|
||||||
|
[38;2;248;248;242m U,[0m
|
||||||
|
[38;2;248;248;242m V,[0m
|
||||||
|
[38;2;248;248;242m W,[0m
|
||||||
|
[38;2;248;248;242m X,[0m
|
||||||
|
[38;2;248;248;242m Y,[0m
|
||||||
|
[38;2;248;248;242m Z,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `1` and `!`.[0m
|
||||||
|
[38;2;248;248;242m Kb1,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `2` and `@`.[0m
|
||||||
|
[38;2;248;248;242m Kb2,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `3` and `#`.[0m
|
||||||
|
[38;2;248;248;242m Kb3, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0x20[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m / `4` and `$`.[0m
|
||||||
|
[38;2;248;248;242m Kb4,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `5` and `%`.[0m
|
||||||
|
[38;2;248;248;242m Kb5,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `6` and `^`.[0m
|
||||||
|
[38;2;248;248;242m Kb6,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `7` and `&`.[0m
|
||||||
|
[38;2;248;248;242m Kb7,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `8` and `*`.[0m
|
||||||
|
[38;2;248;248;242m Kb8,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `9` and `(`.[0m
|
||||||
|
[38;2;248;248;242m Kb9,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `0` and `)`.[0m
|
||||||
|
[38;2;248;248;242m Kb0,[0m
|
||||||
|
[38;2;248;248;242m Enter,[0m
|
||||||
|
[38;2;248;248;242m Escape,[0m
|
||||||
|
[38;2;248;248;242m BSpace,[0m
|
||||||
|
[38;2;248;248;242m Tab,[0m
|
||||||
|
[38;2;248;248;242m Space,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `-` and `_`.[0m
|
||||||
|
[38;2;248;248;242m Minus,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `=` and `+`.[0m
|
||||||
|
[38;2;248;248;242m Equal,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `[` and `{`.[0m
|
||||||
|
[38;2;248;248;242m LBracket,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `]` and `}`.[0m
|
||||||
|
[38;2;248;248;242m RBracket, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0x30[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m / `\` and `|`.[0m
|
||||||
|
[38;2;248;248;242m Bslash,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Non-US `#` and `~` (Typically near the Enter key).[0m
|
||||||
|
[38;2;248;248;242m NonUsHash,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `;` and `:`.[0m
|
||||||
|
[38;2;248;248;242m SColon,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `'` and `"`.[0m
|
||||||
|
[38;2;248;248;242m Quote,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m How to have ` as code?[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m \` and `~`.[0m
|
||||||
|
[38;2;248;248;242m Grave,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `,` and `<`.[0m
|
||||||
|
[38;2;248;248;242m Comma,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `.` and `>`.[0m
|
||||||
|
[38;2;248;248;242m Dot,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m `/` and `?`.[0m
|
||||||
|
[38;2;248;248;242m Slash,[0m
|
||||||
|
[38;2;248;248;242m CapsLock,[0m
|
||||||
|
[38;2;248;248;242m F1,[0m
|
||||||
|
[38;2;248;248;242m F2,[0m
|
||||||
|
[38;2;248;248;242m F3,[0m
|
||||||
|
[38;2;248;248;242m F4,[0m
|
||||||
|
[38;2;248;248;242m F5,[0m
|
||||||
|
[38;2;248;248;242m F6,[0m
|
||||||
|
[38;2;248;248;242m F7, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0x40[0m
|
||||||
|
[38;2;248;248;242m F8,[0m
|
||||||
|
[38;2;248;248;242m F9,[0m
|
||||||
|
[38;2;248;248;242m F10,[0m
|
||||||
|
[38;2;248;248;242m F11,[0m
|
||||||
|
[38;2;248;248;242m F12,[0m
|
||||||
|
[38;2;248;248;242m PScreen,[0m
|
||||||
|
[38;2;248;248;242m ScrollLock,[0m
|
||||||
|
[38;2;248;248;242m Pause,[0m
|
||||||
|
[38;2;248;248;242m Insert,[0m
|
||||||
|
[38;2;248;248;242m Home,[0m
|
||||||
|
[38;2;248;248;242m PgUp,[0m
|
||||||
|
[38;2;248;248;242m Delete,[0m
|
||||||
|
[38;2;248;248;242m Endd,[0m
|
||||||
|
[38;2;248;248;242m PgDown,[0m
|
||||||
|
[38;2;248;248;242m Right,[0m
|
||||||
|
[38;2;248;248;242m Left, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0x50[0m
|
||||||
|
[38;2;248;248;242m Down,[0m
|
||||||
|
[38;2;248;248;242m Up,[0m
|
||||||
|
[38;2;248;248;242m NumLock,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Keypad `/`[0m
|
||||||
|
[38;2;248;248;242m KpSlash,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Keypad `*`[0m
|
||||||
|
[38;2;248;248;242m KpAsterisk,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Keypad `-`.[0m
|
||||||
|
[38;2;248;248;242m KpMinus,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Keypad `+`.[0m
|
||||||
|
[38;2;248;248;242m KpPlus,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Keypad enter.[0m
|
||||||
|
[38;2;248;248;242m KpEnter,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Keypad 1.[0m
|
||||||
|
[38;2;248;248;242m Kp1,[0m
|
||||||
|
[38;2;248;248;242m Kp2,[0m
|
||||||
|
[38;2;248;248;242m Kp3,[0m
|
||||||
|
[38;2;248;248;242m Kp4,[0m
|
||||||
|
[38;2;248;248;242m Kp5,[0m
|
||||||
|
[38;2;248;248;242m Kp6,[0m
|
||||||
|
[38;2;248;248;242m Kp7,[0m
|
||||||
|
[38;2;248;248;242m Kp8, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0x60[0m
|
||||||
|
[38;2;248;248;242m Kp9,[0m
|
||||||
|
[38;2;248;248;242m Kp0,[0m
|
||||||
|
[38;2;248;248;242m KpDot,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Non-US `\` and `|` (Typically near the Left-Shift key)[0m
|
||||||
|
[38;2;248;248;242m NonUsBslash,[0m
|
||||||
|
[38;2;248;248;242m Application, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0x65[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m / not a key, used for errors[0m
|
||||||
|
[38;2;248;248;242m Power,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Keypad `=`.[0m
|
||||||
|
[38;2;248;248;242m KpEqual,[0m
|
||||||
|
[38;2;248;248;242m F13,[0m
|
||||||
|
[38;2;248;248;242m F14,[0m
|
||||||
|
[38;2;248;248;242m F15,[0m
|
||||||
|
[38;2;248;248;242m F16,[0m
|
||||||
|
[38;2;248;248;242m F17,[0m
|
||||||
|
[38;2;248;248;242m F18,[0m
|
||||||
|
[38;2;248;248;242m F19,[0m
|
||||||
|
[38;2;248;248;242m F20,[0m
|
||||||
|
[38;2;248;248;242m F21, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0x70[0m
|
||||||
|
[38;2;248;248;242m F22,[0m
|
||||||
|
[38;2;248;248;242m F23,[0m
|
||||||
|
[38;2;248;248;242m F24,[0m
|
||||||
|
[38;2;248;248;242m Execute,[0m
|
||||||
|
[38;2;248;248;242m Help,[0m
|
||||||
|
[38;2;248;248;242m Menu,[0m
|
||||||
|
[38;2;248;248;242m Selectt,[0m
|
||||||
|
[38;2;248;248;242m Stop,[0m
|
||||||
|
[38;2;248;248;242m Again,[0m
|
||||||
|
[38;2;248;248;242m Undo,[0m
|
||||||
|
[38;2;248;248;242m Cut,[0m
|
||||||
|
[38;2;248;248;242m Copy,[0m
|
||||||
|
[38;2;248;248;242m Paste,[0m
|
||||||
|
[38;2;248;248;242m Find,[0m
|
||||||
|
[38;2;248;248;242m Mute,[0m
|
||||||
|
[38;2;248;248;242m VolUp, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0x80[0m
|
||||||
|
[38;2;248;248;242m VolDown,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Deprecated.[0m
|
||||||
|
[38;2;248;248;242m LockingCapsLock,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Deprecated.[0m
|
||||||
|
[38;2;248;248;242m LockingNumLock,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Deprecated.[0m
|
||||||
|
[38;2;248;248;242m LockingScrollLock,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m / Keypad `,`, also used for the[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m brazilian keypad period (.) key.[0m
|
||||||
|
[38;2;248;248;242m KpComma,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Used on AS/400 keyboard[0m
|
||||||
|
[38;2;248;248;242m KpEqualSign,[0m
|
||||||
|
[38;2;248;248;242m Intl1,[0m
|
||||||
|
[38;2;248;248;242m Intl2,[0m
|
||||||
|
[38;2;248;248;242m Intl3,[0m
|
||||||
|
[38;2;248;248;242m Intl4,[0m
|
||||||
|
[38;2;248;248;242m Intl5,[0m
|
||||||
|
[38;2;248;248;242m Intl6,[0m
|
||||||
|
[38;2;248;248;242m Intl7,[0m
|
||||||
|
[38;2;248;248;242m Intl8,[0m
|
||||||
|
[38;2;248;248;242m Intl9,[0m
|
||||||
|
[38;2;248;248;242m Lang1, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0x90[0m
|
||||||
|
[38;2;248;248;242m Lang2,[0m
|
||||||
|
[38;2;248;248;242m Lang3,[0m
|
||||||
|
[38;2;248;248;242m Lang4,[0m
|
||||||
|
[38;2;248;248;242m Lang5,[0m
|
||||||
|
[38;2;248;248;242m Lang6,[0m
|
||||||
|
[38;2;248;248;242m Lang7,[0m
|
||||||
|
[38;2;248;248;242m Lang8,[0m
|
||||||
|
[38;2;248;248;242m Lang9,[0m
|
||||||
|
[38;2;248;248;242m AltErase,[0m
|
||||||
|
[38;2;248;248;242m SysReq,[0m
|
||||||
|
[38;2;248;248;242m Cancel,[0m
|
||||||
|
[38;2;248;248;242m Clear,[0m
|
||||||
|
[38;2;248;248;242m Prior,[0m
|
||||||
|
[38;2;248;248;242m Returnn,[0m
|
||||||
|
[38;2;248;248;242m Separator,[0m
|
||||||
|
[38;2;248;248;242m Outt, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0xA0[0m
|
||||||
|
[38;2;248;248;242m Oper,[0m
|
||||||
|
[38;2;248;248;242m ClearAgain,[0m
|
||||||
|
[38;2;248;248;242m CrSel,[0m
|
||||||
|
[38;2;248;248;242m ExSel,[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m According to QMK, 0xA5-0xDF are not[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m usable on modern keyboards[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Modifiers[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Left Control.[0m
|
||||||
|
[38;2;248;248;242m LCtrl, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m = 0xE0,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m / Left Shift.[0m
|
||||||
|
[38;2;248;248;242m LShift,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Left Alt.[0m
|
||||||
|
[38;2;248;248;242m LAlt,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Left GUI (the Windows key).[0m
|
||||||
|
[38;2;248;248;242m LGui,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Right Control.[0m
|
||||||
|
[38;2;248;248;242m RCtrl,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Right Shift.[0m
|
||||||
|
[38;2;248;248;242m RShift,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Right Alt (or Alt Gr). [0m
|
||||||
|
[38;2;248;248;242m RAlt,[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Right GUI (the Windows key).[0m
|
||||||
|
[38;2;248;248;242m RGui, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0xE7[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Unofficial[0m
|
||||||
|
[38;2;248;248;242m MediaPlayPause, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0xE8,[0m
|
||||||
|
[38;2;248;248;242m MediaStopCD,[0m
|
||||||
|
[38;2;248;248;242m MediaPreviousSong,[0m
|
||||||
|
[38;2;248;248;242m MediaNextSong,[0m
|
||||||
|
[38;2;248;248;242m MediaEjectCD,[0m
|
||||||
|
[38;2;248;248;242m MediaVolUp,[0m
|
||||||
|
[38;2;248;248;242m MediaVolDown,[0m
|
||||||
|
[38;2;248;248;242m MediaMute,[0m
|
||||||
|
[38;2;248;248;242m MediaWWW, [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0xF0[0m
|
||||||
|
[38;2;248;248;242m MediaBack,[0m
|
||||||
|
[38;2;248;248;242m MediaForward,[0m
|
||||||
|
[38;2;248;248;242m MediaStop,[0m
|
||||||
|
[38;2;248;248;242m MediaFind,[0m
|
||||||
|
[38;2;248;248;242m MediaScrollUp,[0m
|
||||||
|
[38;2;248;248;242m MediaScrollDown,[0m
|
||||||
|
[38;2;248;248;242m MediaEdit,[0m
|
||||||
|
[38;2;248;248;242m MediaSleep,[0m
|
||||||
|
[38;2;248;248;242m MediaCoffee,[0m
|
||||||
|
[38;2;248;248;242m MediaRefresh,[0m
|
||||||
|
[38;2;248;248;242m MediaCalc [0m[38;2;117;113;94m--[0m[38;2;117;113;94m 0xFB[0m
|
||||||
|
[38;2;248;248;242m );[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Action_Type [0m[38;2;249;38;114mis[0m[38;2;248;248;242m (Key, No_Op, Trans, Layer, Multiple_Actions);[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Should be a discriminated type[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Action [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114mrecord[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mT[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Action_Type; [0m[38;2;117;113;94m--[0m[38;2;117;113;94m hould be the discriminant[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mC[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Key_Code_T;[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mL[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Natural;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend record[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mKw[0m[38;2;248;248;242m (Code : Key_Code_T) [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Action;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mLw[0m[38;2;248;248;242m (V : Natural) [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Action;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Key_Modifiers [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114marray[0m[38;2;248;248;242m (Natural [0m[38;2;249;38;114mrange[0m[38;2;248;248;242m <>) [0m[38;2;249;38;114mof[0m[38;2;248;248;242m USB.Device.HID.Keyboard.Modifiers;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Key_Codes_T [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114marray[0m[38;2;248;248;242m (Natural [0m[38;2;249;38;114mrange[0m[38;2;248;248;242m <>) [0m[38;2;249;38;114mof[0m[38;2;248;248;242m Key_Code_T;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114msubtype[0m[38;2;248;248;242m Ac [0m[38;2;249;38;114mis[0m[38;2;248;248;242m Action;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Layout [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;249;38;114marray[0m[38;2;248;248;242m ([0m[38;2;190;132;255m0[0m[38;2;248;248;242m .. Num_Layers - [0m[38;2;190;132;255m1[0m[38;2;248;248;242m, RowR, ColR) [0m[38;2;249;38;114mof[0m[38;2;248;248;242m Action;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mprocedure[0m[38;2;248;248;242m [0m[38;2;166;226;46mRegister_Events[0m[38;2;248;248;242m (L : Layout; Es : Events);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mprocedure[0m[38;2;248;248;242m [0m[38;2;166;226;46mTick[0m[38;2;248;248;242m (L : Layout);[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Key_Codes[0m[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Key_Codes_T;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mGet_Modifiers[0m[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m Key_Modifiers;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mprocedure[0m[38;2;248;248;242m [0m[38;2;166;226;46mInit[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mClick[0m[38;2;248;248;242m;[0m
|
29
tests/syntax-tests/highlighted/Ada/click.gpr
vendored
Normal file
29
tests/syntax-tests/highlighted/Ada/click.gpr
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
[38;2;249;38;114mwith[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mconfig/click_config.gpr[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242mproject Click [0m[38;2;249;38;114mis[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Library_Name [0m[38;2;249;38;114muse[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mClick[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Library_Version [0m[38;2;249;38;114muse[0m[38;2;248;248;242m Project'Library_Name & [0m[38;2;230;219;116m"[0m[38;2;230;219;116m.so.[0m[38;2;230;219;116m"[0m[38;2;248;248;242m & Click_Config.Crate_Version;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Source_Dirs [0m[38;2;249;38;114muse[0m[38;2;248;248;242m ([0m[38;2;230;219;116m"[0m[38;2;230;219;116msrc/[0m[38;2;230;219;116m"[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"[0m[38;2;230;219;116mconfig/[0m[38;2;230;219;116m"[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Object_Dir [0m[38;2;249;38;114muse[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mobj/[0m[38;2;230;219;116m"[0m[38;2;248;248;242m & Click_Config.Build_Profile;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Create_Missing_Dirs [0m[38;2;249;38;114muse[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mTrue[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Library_Dir [0m[38;2;249;38;114muse[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mlib[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mtype[0m[38;2;248;248;242m Library_Type_Type [0m[38;2;249;38;114mis[0m[38;2;248;248;242m ([0m[38;2;230;219;116m"[0m[38;2;230;219;116mrelocatable[0m[38;2;230;219;116m"[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"[0m[38;2;230;219;116mstatic[0m[38;2;230;219;116m"[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"[0m[38;2;230;219;116mstatic-pic[0m[38;2;230;219;116m"[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;249;38;114m [0m[38;2;166;226;46mLibrary_Type[0m[38;2;249;38;114m :[0m[38;2;248;248;242m Library_Type_Type :=[0m
|
||||||
|
[38;2;248;248;242m external ([0m[38;2;230;219;116m"[0m[38;2;230;219;116mCLICK_LIBRARY_TYPE[0m[38;2;230;219;116m"[0m[38;2;248;248;242m, external ([0m[38;2;230;219;116m"[0m[38;2;230;219;116mLIBRARY_TYPE[0m[38;2;230;219;116m"[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"[0m[38;2;230;219;116mstatic[0m[38;2;230;219;116m"[0m[38;2;248;248;242m));[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Library_Kind [0m[38;2;249;38;114muse[0m[38;2;248;248;242m Library_Type;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mpackage[0m[38;2;248;248;242m [0m[38;2;166;226;46mCompiler[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Default_Switches ([0m[38;2;230;219;116m"[0m[38;2;230;219;116mAda[0m[38;2;230;219;116m"[0m[38;2;248;248;242m) [0m[38;2;249;38;114muse[0m[38;2;248;248;242m Click_Config.Ada_Compiler_Switches & ([0m[38;2;230;219;116m"[0m[38;2;230;219;116m-gnatX[0m[38;2;230;219;116m"[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"[0m[38;2;230;219;116m-gnat2022[0m[38;2;230;219;116m"[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mCompiler[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mpackage[0m[38;2;248;248;242m [0m[38;2;166;226;46mBinder[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Switches ([0m[38;2;230;219;116m"[0m[38;2;230;219;116mAda[0m[38;2;230;219;116m"[0m[38;2;248;248;242m) [0m[38;2;249;38;114muse[0m[38;2;248;248;242m ([0m[38;2;230;219;116m"[0m[38;2;230;219;116m-Es[0m[38;2;230;219;116m"[0m[38;2;248;248;242m); [0m[38;2;117;113;94m--[0m[38;2;117;113;94m Symbolic traceback[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mBinder[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mpackage[0m[38;2;248;248;242m [0m[38;2;166;226;46mInstall[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m Artifacts ([0m[38;2;230;219;116m"[0m[38;2;230;219;116m.[0m[38;2;230;219;116m"[0m[38;2;248;248;242m) [0m[38;2;249;38;114muse[0m[38;2;248;248;242m ([0m[38;2;230;219;116m"[0m[38;2;230;219;116mshare[0m[38;2;230;219;116m"[0m[38;2;248;248;242m);[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mInstall[0m[38;2;248;248;242m;[0m
|
||||||
|
|
||||||
|
[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;166;226;46mClick[0m[38;2;248;248;242m;[0m
|
773
tests/syntax-tests/highlighted/Manpage/fzf-0.33.0.man
vendored
Normal file
773
tests/syntax-tests/highlighted/Manpage/fzf-0.33.0.man
vendored
Normal file
@ -0,0 +1,773 @@
|
|||||||
|
[38;2;248;248;242mfzf(1) fzf - a command-line fuzzy finder fzf(1)[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mNAME[0m
|
||||||
|
[38;2;248;248;242m fzf - a command-line fuzzy finder[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mSYNOPSIS[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;248;248;242m[[0m[38;2;248;248;242moptions[0m[38;2;248;248;242m][0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mDESCRIPTION[0m
|
||||||
|
[38;2;248;248;242m fzf is a general-purpose command-line fuzzy finder.[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mOPTIONS[0m
|
||||||
|
[38;2;248;248;242m Search mode[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-x[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--extended[0m
|
||||||
|
[38;2;248;248;242m Extended-search mode. Since 0.10.9, this is enabled by default. You can disable it with +x or [0m[38;2;166;226;46m--no-extended[0m[38;2;248;248;242m.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-e[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--exact[0m
|
||||||
|
[38;2;248;248;242m Enable exact-match[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-i[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mCase-insensitive[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mmatch[0m[38;2;248;248;242m ([0m[3;38;2;253;151;31mdefault[0m[38;2;248;248;242m: [0m[3;38;2;253;151;31msmart-case[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mmatch[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m+i[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mCase-sensitive[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mmatch[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--literal[0m
|
||||||
|
[38;2;248;248;242m Do not normalize latin script letters for matching.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--scheme[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSCHEME[0m
|
||||||
|
[38;2;248;248;242m Choose scoring scheme tailored for different types of input.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m default Generic scoring scheme designed to work well with any type of input[0m
|
||||||
|
[38;2;248;248;242m path Scoring scheme for paths (additional bonus point only after path separator)[0m
|
||||||
|
[38;2;248;248;242m history Scoring scheme for command history (no additional bonus points).[0m
|
||||||
|
[38;2;248;248;242m Sets [0m[38;2;166;226;46m--tiebreak[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mindex[0m[38;2;248;248;242m as well.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--algo[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mTYPE[0m
|
||||||
|
[38;2;248;248;242m Fuzzy matching algorithm (default: v2)[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m v2 Optimal scoring algorithm (quality)[0m
|
||||||
|
[38;2;248;248;242m v1 Faster but not guaranteed to find the optimal result (performance)[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-n[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--nth[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mN[[0m[38;2;248;248;242m,..][0m
|
||||||
|
[38;2;248;248;242m Comma-separated list of field index expressions for limiting search scope. See FIELD INDEX EXPRESSION for the details.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--with-nth[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mN[0m[38;2;248;248;242m[[0m[38;2;248;248;242m,..][0m
|
||||||
|
[38;2;248;248;242m Transform the presentation of each line using field index expressions[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-d[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--delimiter[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSTR[0m
|
||||||
|
[38;2;248;248;242m Field delimiter regex for [0m[38;2;166;226;46m--nth[0m[38;2;248;248;242m and [0m[38;2;166;226;46m--with-nth[0m[38;2;248;248;242m (default: AWK-style)[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--disabled[0m
|
||||||
|
[38;2;248;248;242m Do not perform search. With this option, fzf becomes a simple selector interface rather than a "fuzzy finder". You can later enable the search using enable-search or toggle-[0m
|
||||||
|
[38;2;248;248;242m search action.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Search result[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m+s[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--no-sort[0m
|
||||||
|
[38;2;248;248;242m Do not sort the result[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--tac[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mReverse[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mthe[0m[38;2;248;248;242m [0m[3;38;2;253;151;31morder[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mof[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mthe[0m[38;2;248;248;242m [0m[3;38;2;253;151;31minput[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m history | fzf [0m[38;2;166;226;46m--tac[0m[38;2;248;248;242m [0m[38;2;166;226;46m--no-sort[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--tiebreak[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mCRI[0m[38;2;248;248;242m[[0m[38;2;248;248;242m,..][0m
|
||||||
|
[38;2;248;248;242m Comma-separated list of sort criteria to apply when the scores are tied.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m length Prefers line with shorter length[0m
|
||||||
|
[38;2;248;248;242m chunk Prefers line with shorter matched chunk (delimited by whitespaces)[0m
|
||||||
|
[38;2;248;248;242m begin Prefers line with matched substring closer to the beginning[0m
|
||||||
|
[38;2;248;248;242m end Prefers line with matched substring closer to the end[0m
|
||||||
|
[38;2;248;248;242m index Prefers line that appeared earlier in the input stream[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m - Each criterion should appear only once in the list[0m
|
||||||
|
[38;2;248;248;242m - index is only allowed at the end of the list[0m
|
||||||
|
[38;2;248;248;242m - index is implicitly appended to the list when not specified[0m
|
||||||
|
[38;2;248;248;242m - Default is length (or equivalently length,index)[0m
|
||||||
|
[38;2;248;248;242m - If end is found in the list, fzf will scan each line backwards[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Interface[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-m[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--multi[0m
|
||||||
|
[38;2;248;248;242m Enable multi-select with tab/shift-tab. It optionally takes an integer argument which denotes the maximum number of items that can be selected.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m+m[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--no-multi[0m
|
||||||
|
[38;2;248;248;242m Disable multi-select[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--no-mouse[0m
|
||||||
|
[38;2;248;248;242m Disable mouse[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--bind[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mKEYBINDS[0m
|
||||||
|
[38;2;248;248;242m Comma-separated list of custom key bindings. See KEY/EVENT BINDINGS for the details.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--cycle[0m
|
||||||
|
[38;2;248;248;242m Enable cyclic scroll[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--keep-right[0m
|
||||||
|
[38;2;248;248;242m Keep the right end of the line visible when it's too long. Effective only when the query string is empty.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--scroll-off[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mLINES[0m
|
||||||
|
[38;2;248;248;242m Number of screen lines to keep above or below when scrolling to the top or to the bottom (default: 0).[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--no-hscroll[0m
|
||||||
|
[38;2;248;248;242m Disable horizontal scroll[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--hscroll-off[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mCOLS[0m
|
||||||
|
[38;2;248;248;242m Number of screen columns to keep to the right of the highlighted substring (default: 10). Setting it to a large value will cause the text to be positioned on the center of the[0m
|
||||||
|
[38;2;248;248;242m screen.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--filepath-word[0m
|
||||||
|
[38;2;248;248;242m Make word-wise movements and actions respect path separators. The following actions are affected:[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m backward-kill-word[0m
|
||||||
|
[38;2;248;248;242m backward-word[0m
|
||||||
|
[38;2;248;248;242m forward-word[0m
|
||||||
|
[38;2;248;248;242m kill-word[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--jump-labels[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mCHARS[0m
|
||||||
|
[38;2;248;248;242m Label characters for jump and jump-accept[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Layout[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--height[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mHEIGHT[0m[38;2;248;248;242m[[0m[38;2;248;248;242m%[0m[38;2;248;248;242m][0m
|
||||||
|
[38;2;248;248;242m Display fzf window below the cursor with the given height instead of using the full screen.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--min-height[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mHEIGHT[0m
|
||||||
|
[38;2;248;248;242m Minimum height when [0m[38;2;166;226;46m--height[0m[38;2;248;248;242m is given in percent (default: 10). Ignored when [0m[38;2;166;226;46m--height[0m[38;2;248;248;242m is not specified.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--layout[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mLAYOUT[0m
|
||||||
|
[38;2;248;248;242m Choose the layout (default: default)[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m default Display from the bottom of the screen[0m
|
||||||
|
[38;2;248;248;242m reverse Display from the top of the screen[0m
|
||||||
|
[38;2;248;248;242m reverse-list Display from the top of the screen, prompt at the bottom[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--reverse[0m
|
||||||
|
[38;2;248;248;242m A synonym for [0m[38;2;166;226;46m--layout[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mreverse[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--border[0m[38;2;248;248;242m[[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mBORDER_OPT[0m[38;2;248;248;242m][0m
|
||||||
|
[38;2;248;248;242m Draw border around the finder[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m rounded Border with rounded corners (default)[0m
|
||||||
|
[38;2;248;248;242m sharp Border with sharp corners[0m
|
||||||
|
[38;2;248;248;242m horizontal Horizontal lines above and below the finder[0m
|
||||||
|
[38;2;248;248;242m vertical Vertical lines on each side of the finder[0m
|
||||||
|
[38;2;248;248;242m top (up)[0m
|
||||||
|
[38;2;248;248;242m bottom (down)[0m
|
||||||
|
[38;2;248;248;242m left[0m
|
||||||
|
[38;2;248;248;242m right[0m
|
||||||
|
[38;2;248;248;242m none[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--no-unicode[0m
|
||||||
|
[38;2;248;248;242m Use ASCII characters instead of Unicode box drawing characters to draw border[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--margin[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mMARGIN[0m
|
||||||
|
[38;2;248;248;242m Comma-separated expression for margins around the finder.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m TRBL Same margin for top, right, bottom, and left[0m
|
||||||
|
[38;2;248;248;242m TB,RL Vertical, horizontal margin[0m
|
||||||
|
[38;2;248;248;242m T,RL,B Top, horizontal, bottom margin[0m
|
||||||
|
[38;2;248;248;242m T,R,B,L Top, right, bottom, left margin[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Each part can be given in absolute number or in percentage relative to the terminal size with % suffix.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--margin[0m[38;2;248;248;242m 10%[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--margin[0m[38;2;248;248;242m 1,5%[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--padding[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mPADDING[0m
|
||||||
|
[38;2;248;248;242m Comma-separated expression for padding inside the border. Padding is distinguishable from margin only when [0m[38;2;166;226;46m--border[0m[38;2;248;248;242m option is used.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--margin[0m[38;2;248;248;242m 5% [0m[38;2;166;226;46m--padding[0m[38;2;248;248;242m 5% [0m[38;2;166;226;46m--border[0m[38;2;248;248;242m [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'cat {}' \[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;248;248;242m bg:#222222,preview-bg:#333333[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m TRBL Same padding for top, right, bottom, and left[0m
|
||||||
|
[38;2;248;248;242m TB,RL Vertical, horizontal padding[0m
|
||||||
|
[38;2;248;248;242m T,RL,B Top, horizontal, bottom padding[0m
|
||||||
|
[38;2;248;248;242m T,R,B,L Top, right, bottom, left padding[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--info[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSTYLE[0m
|
||||||
|
[38;2;248;248;242m Determines the display style of finder info.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m default Display on the next line to the prompt[0m
|
||||||
|
[38;2;248;248;242m inline Display on the same line[0m
|
||||||
|
[38;2;248;248;242m hidden Do not display finder info[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--no-info[0m
|
||||||
|
[38;2;248;248;242m A synonym for [0m[38;2;166;226;46m--info[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mhidden[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--prompt[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSTR[0m
|
||||||
|
[38;2;248;248;242m Input prompt (default: '> ')[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--pointer[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSTR[0m
|
||||||
|
[38;2;248;248;242m Pointer to the current line (default: '>')[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--marker[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSTR[0m
|
||||||
|
[38;2;248;248;242m Multi-select marker (default: '>')[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--header[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSTR[0m
|
||||||
|
[38;2;248;248;242m The given string will be printed as the sticky header. The lines are displayed in the given order from top to bottom regardless of [0m[38;2;166;226;46m--layout[0m[38;2;248;248;242m option, and are not affected by[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--with-nth[0m[38;2;248;248;242m. ANSI color codes are processed even when [0m[38;2;166;226;46m--ansi[0m[38;2;248;248;242m is not set.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--header-lines[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mN[0m
|
||||||
|
[38;2;248;248;242m The first N lines of the input are treated as the sticky header. When [0m[38;2;166;226;46m--with-nth[0m[38;2;248;248;242m is set, the lines are transformed just like the other lines that follow.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--header-first[0m
|
||||||
|
[38;2;248;248;242m Print header before the prompt line[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--ellipsis[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSTR[0m
|
||||||
|
[38;2;248;248;242m Ellipsis to show when line is truncated (default: '..')[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Display[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--ansi[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mEnable[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mprocessing[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mof[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mANSI[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mcolor[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mcodes[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--tabstop[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSPACES[0m
|
||||||
|
[38;2;248;248;242m Number of spaces for a tab character (default: 8)[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;249;38;114m=[0m[38;2;248;248;242m[[0m[3;38;2;253;151;31mBASE_SCHEME[0m[38;2;248;248;242m][0m[38;2;248;248;242m[[0m[38;2;248;248;242m,COLOR_NAME[:ANSI_COLOR][:ANSI_ATTRIBUTES]]...[0m
|
||||||
|
[38;2;248;248;242m Color configuration. The name of the base color scheme is followed by custom color mappings.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m BASE SCHEME:[0m
|
||||||
|
[38;2;248;248;242m (default: dark on 256-color terminal, otherwise 16)[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m dark Color scheme for dark 256-color terminal[0m
|
||||||
|
[38;2;248;248;242m light Color scheme for light 256-color terminal[0m
|
||||||
|
[38;2;248;248;242m 16 Color scheme for 16-color terminal[0m
|
||||||
|
[38;2;248;248;242m bw No colors (equivalent to [0m[38;2;166;226;46m--no-color[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m COLOR NAMES:[0m
|
||||||
|
[38;2;248;248;242m fg Text[0m
|
||||||
|
[38;2;248;248;242m bg Background[0m
|
||||||
|
[38;2;248;248;242m preview-fg Preview window text[0m
|
||||||
|
[38;2;248;248;242m preview-bg Preview window background[0m
|
||||||
|
[38;2;248;248;242m hl Highlighted substrings[0m
|
||||||
|
[38;2;248;248;242m fg+ Text (current line)[0m
|
||||||
|
[38;2;248;248;242m bg+ Background (current line)[0m
|
||||||
|
[38;2;248;248;242m gutter Gutter on the left (defaults to bg+)[0m
|
||||||
|
[38;2;248;248;242m hl+ Highlighted substrings (current line)[0m
|
||||||
|
[38;2;248;248;242m query Query string[0m
|
||||||
|
[38;2;248;248;242m disabled Query string when search is disabled[0m
|
||||||
|
[38;2;248;248;242m info Info line (match counters)[0m
|
||||||
|
[38;2;248;248;242m border Border around the window ([0m[38;2;166;226;46m--border[0m[38;2;248;248;242m and [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m)[0m
|
||||||
|
[38;2;248;248;242m prompt Prompt[0m
|
||||||
|
[38;2;248;248;242m pointer Pointer to the current line[0m
|
||||||
|
[38;2;248;248;242m marker Multi-select marker[0m
|
||||||
|
[38;2;248;248;242m spinner Streaming input indicator[0m
|
||||||
|
[38;2;248;248;242m header Header[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m ANSI COLORS:[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-1[0m[38;2;248;248;242m Default terminal foreground/background color[0m
|
||||||
|
[38;2;248;248;242m (or the original color of the text)[0m
|
||||||
|
[38;2;248;248;242m 0 ~ 15 16 base colors[0m
|
||||||
|
[38;2;248;248;242m black[0m
|
||||||
|
[38;2;248;248;242m red[0m
|
||||||
|
[38;2;248;248;242m green[0m
|
||||||
|
[38;2;248;248;242m yellow[0m
|
||||||
|
[38;2;248;248;242m blue[0m
|
||||||
|
[38;2;248;248;242m magenta[0m
|
||||||
|
[38;2;248;248;242m cyan[0m
|
||||||
|
[38;2;248;248;242m white[0m
|
||||||
|
[38;2;248;248;242m bright-black (gray | grey)[0m
|
||||||
|
[38;2;248;248;242m bright-red[0m
|
||||||
|
[38;2;248;248;242m bright-green[0m
|
||||||
|
[38;2;248;248;242m bright-yellow[0m
|
||||||
|
[38;2;248;248;242m bright-blue[0m
|
||||||
|
[38;2;248;248;242m bright-magenta[0m
|
||||||
|
[38;2;248;248;242m bright-cyan[0m
|
||||||
|
[38;2;248;248;242m bright-white[0m
|
||||||
|
[38;2;248;248;242m 16 ~ 255 ANSI 256 colors[0m
|
||||||
|
[38;2;248;248;242m #rrggbb 24-bit colors[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m ANSI ATTRIBUTES: (Only applies to foreground colors)[0m
|
||||||
|
[38;2;248;248;242m regular Clears previously set attributes; should precede the other ones[0m
|
||||||
|
[38;2;248;248;242m bold[0m
|
||||||
|
[38;2;248;248;242m underline[0m
|
||||||
|
[38;2;248;248;242m reverse[0m
|
||||||
|
[38;2;248;248;242m dim[0m
|
||||||
|
[38;2;248;248;242m italic[0m
|
||||||
|
[38;2;248;248;242m strikethrough[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m EXAMPLES:[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m # Seoul256 theme with 8-bit colors[0m
|
||||||
|
[38;2;248;248;242m # (https://github.com/junegunn/seoul256.vim)[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--color[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m'bg:237[0m[38;2;248;248;242m,bg+:236,info:143,border:240,spinner:108' \[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m'hl:65[0m[38;2;248;248;242m,fg:252,header:65,fg+:252' \[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m'pointer:161[0m[38;2;248;248;242m,marker:168,prompt:110,hl+:108'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m # Seoul256 theme with 24-bit colors[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--color[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m'bg:#4B4B4B[0m[38;2;248;248;242m,bg+:#3F3F3F,info:#BDBB72,border:#6B6B6B,spinner:#98BC99' \[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m'hl:#719872[0m[38;2;248;248;242m,fg:#D9D9D9,header:#719872,fg+:#D9D9D9' \[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m'pointer:#E12672[0m[38;2;248;248;242m,marker:#E17899,prompt:#98BEDE,hl+:#98BC99'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--no-bold[0m
|
||||||
|
[38;2;248;248;242m Do not use bold text[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--black[0m
|
||||||
|
[38;2;248;248;242m Use black background[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m History[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--history[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mHISTORY_FILE[0m
|
||||||
|
[38;2;248;248;242m Load search history from the specified file and update the file on completion. When enabled, CTRL-N and CTRL-P are automatically remapped to next-history and previous-history.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--history-size[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mN[0m
|
||||||
|
[38;2;248;248;242m Maximum number of entries in the history file (default: 1000). The file is automatically truncated when the number of the lines exceeds the value.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Preview[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--preview[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mCOMMAND[0m
|
||||||
|
[38;2;248;248;242m Execute the given command for the current line and display the result on the preview window. {} in the command is the placeholder that is replaced to the single-quoted string of[0m
|
||||||
|
[38;2;248;248;242m the current line. To transform the replacement string, specify field index expressions between the braces (See FIELD INDEX EXPRESSION for the details).[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m'head[0m[38;2;248;248;242m -[0m[38;2;255;255;255m$[0m[38;2;190;132;255mLINES[0m[38;2;248;248;242m {}'[0m
|
||||||
|
[38;2;248;248;242m ls [0m[38;2;166;226;46m-l[0m[38;2;248;248;242m | fzf [0m[38;2;166;226;46m--preview[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m"echo[0m[38;2;248;248;242m user={3} when={[0m[38;2;166;226;46m-4[0m[38;2;248;248;242m..[0m[38;2;166;226;46m-2[0m[38;2;248;248;242m}; cat {[0m[38;2;166;226;46m-1[0m[38;2;248;248;242m}" [0m[38;2;166;226;46m--header-lines[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m1[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m fzf exports [0m[38;2;255;255;255m$[0m[38;2;190;132;255mFZF_PREVIEW_LINES[0m[38;2;248;248;242m and [0m[38;2;255;255;255m$[0m[38;2;190;132;255mFZF_PREVIEW_COLUMNS[0m[38;2;248;248;242m so that they represent the exact size of the preview window. (It also overrides [0m[38;2;255;255;255m$[0m[38;2;190;132;255mLINES[0m[38;2;248;248;242m and [0m[38;2;255;255;255m$[0m[38;2;190;132;255mCOLUMNS[0m[38;2;248;248;242m with the same values[0m
|
||||||
|
[38;2;248;248;242m but they can be reset by the default shell, so prefer to refer to the ones with FZF_PREVIEW_ prefix.)[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m A placeholder expression starting with + flag will be replaced to the space-separated list of the selected lines (or the current line if no selection was made) individually[0m
|
||||||
|
[38;2;248;248;242m quoted.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--multi[0m[38;2;248;248;242m [0m[38;2;166;226;46m--preview[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m'head[0m[38;2;248;248;242m [0m[38;2;166;226;46m-10[0m[38;2;248;248;242m {+}'[0m
|
||||||
|
[38;2;248;248;242m git log [0m[38;2;166;226;46m--oneline[0m[38;2;248;248;242m | fzf [0m[38;2;166;226;46m--multi[0m[38;2;248;248;242m [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'git show {+1}'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m When using a field index expression, leading and trailing whitespace is stripped from the replacement string. To preserve the whitespace, use the s flag.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Also, {q} is replaced to the current query string, and {n} is replaced to zero-based ordinal index of the line. Use {+n} if you want all index numbers when multiple lines are[0m
|
||||||
|
[38;2;248;248;242m selected.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m A placeholder expression with f flag is replaced to the path of a temporary file that holds the evaluated list. This is useful when you multi-select a large number of items and[0m
|
||||||
|
[38;2;248;248;242m the length of the evaluated string may exceed ARG_MAX.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m # Press CTRL-A to select 100K items and see the sum of all the numbers.[0m
|
||||||
|
[38;2;248;248;242m # This won't work properly without 'f' flag due to ARG_MAX limit.[0m
|
||||||
|
[38;2;248;248;242m seq 100000 | fzf [0m[38;2;166;226;46m--multi[0m[38;2;248;248;242m [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m ctrl-a:select-all \[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m "awk '{sum+=\$1} END {print sum}' {+f}"[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Note that you can escape a placeholder pattern by prepending a backslash.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Preview window will be updated even when there is no match for the current query if any of the placeholder expressions evaluates to a non-empty string.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Since 0.24.0, fzf can render partial preview content before the preview command completes. ANSI escape sequence for clearing the display (CSI 2 J) is supported, so you can use[0m
|
||||||
|
[38;2;248;248;242m it to implement preview window that is constantly updating.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'for i in $(seq 100000); do[0m
|
||||||
|
[38;2;248;248;242m (( i % 200 == 0 )) && printf "\033[2J"[0m
|
||||||
|
[38;2;248;248;242m echo "[0m[38;2;255;255;255m$[0m[38;2;190;132;255mi[0m[38;2;248;248;242m"[0m
|
||||||
|
[38;2;248;248;242m sleep 0.01[0m
|
||||||
|
[38;2;248;248;242m done'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--preview-window[0m[38;2;249;38;114m=[0m[38;2;248;248;242m[[0m[3;38;2;253;151;31mPOSITION[0m[38;2;248;248;242m][0m[38;2;248;248;242m[[0m[38;2;248;248;242m,[0m[38;2;166;226;46mSIZE[0m[38;2;166;226;46m[%][0m[38;2;248;248;242m][,border-BORDER_OPT][,[no]wrap][,[no]follow][,[no]cycle][,[no]hidden][,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES][,default][,<SIZE_THRESHOLD(ALTER‐[0m
|
||||||
|
[38;2;248;248;242m NATIVE_LAYOUT)][0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m POSITION: (default: right)[0m
|
||||||
|
[38;2;248;248;242m up[0m
|
||||||
|
[38;2;248;248;242m down[0m
|
||||||
|
[38;2;248;248;242m left[0m
|
||||||
|
[38;2;248;248;242m right[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Determines the layout of the preview window.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m * If the argument contains :hidden, the preview window will be hidden by default until toggle-preview action is triggered.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m * If size is given as 0, preview window will not be visible, but fzf will still execute the command in the background.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m * Long lines are truncated by default. Line wrap can be enabled with wrap flag.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m * Preview window will automatically scroll to the bottom when follow flag is set, similarly to how tail [0m[38;2;166;226;46m-f[0m[38;2;248;248;242m works.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m follow [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'for i in $(seq 100000); do[0m
|
||||||
|
[38;2;248;248;242m echo "[0m[38;2;255;255;255m$[0m[38;2;190;132;255mi[0m[38;2;248;248;242m"[0m
|
||||||
|
[38;2;248;248;242m sleep 0.01[0m
|
||||||
|
[38;2;248;248;242m (( i % 300 == 0 )) && printf "\033[2J"[0m
|
||||||
|
[38;2;248;248;242m done'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m * Cyclic scrolling is enabled with cycle flag.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m * To change the style of the border of the preview window, specify one of the options for [0m[38;2;166;226;46m--border[0m[38;2;248;248;242m with border- prefix. e.g. border-rounded (border with rounded edges, de‐[0m
|
||||||
|
[38;2;248;248;242m fault), border-sharp (border with sharp edges), border-left, border-none, etc.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m * [:+SCROLL[OFFSETS][/DENOM]] determines the initial scroll offset of the preview window.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m - SCROLL can be either a numeric integer or a single-field index expression that refers to a numeric integer.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m - The optional OFFSETS part is for adjusting the base offset. It should be given as a series of signed integers ([0m[38;2;166;226;46m-INTEGER[0m[38;2;248;248;242m or +INTEGER).[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m - The final /DENOM part is for specifying a fraction of the preview window height.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m * ~HEADER_LINES keeps the top N lines as the fixed header so that they are always visible.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m * default resets all options previously set to the default.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m # Non-default scroll window positions and sizes[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m"head[0m[38;2;248;248;242m {}" [0m[38;2;166;226;46m--preview-window[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mup[0m[38;2;248;248;242m,30%[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m"file[0m[38;2;248;248;242m {}" [0m[38;2;166;226;46m--preview-window[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mdown[0m[38;2;248;248;242m,1[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m # Initial scroll offset is set to the line number of each line of[0m
|
||||||
|
[38;2;248;248;242m # git grep output *minus* 5 lines ([0m[38;2;166;226;46m-5[0m[38;2;248;248;242m)[0m
|
||||||
|
[38;2;248;248;242m git grep [0m[38;2;166;226;46m--line-number[0m[38;2;248;248;242m '' |[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--delimiter[0m[38;2;248;248;242m : [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'nl {1}' [0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m '+{2}[0m[38;2;166;226;46m-5[0m[38;2;248;248;242m'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m # Preview with bat, matching line in the middle of the window below[0m
|
||||||
|
[38;2;248;248;242m # the fixed header of the top 3 lines[0m
|
||||||
|
[38;2;248;248;242m #[0m
|
||||||
|
[38;2;248;248;242m # ~3 Top 3 lines as the fixed header[0m
|
||||||
|
[38;2;248;248;242m # +{2} Base scroll offset extracted from the second field[0m
|
||||||
|
[38;2;248;248;242m # +3 Extra offset to compensate for the 3-line header[0m
|
||||||
|
[38;2;248;248;242m # /2 Put in the middle of the preview area[0m
|
||||||
|
[38;2;248;248;242m #[0m
|
||||||
|
[38;2;248;248;242m git grep [0m[38;2;166;226;46m--line-number[0m[38;2;248;248;242m '' |[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--delimiter[0m[38;2;248;248;242m : \[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'bat [0m[38;2;166;226;46m--style[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mfull[0m[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31malways[0m[38;2;248;248;242m [0m[38;2;166;226;46m--highlight-line[0m[38;2;248;248;242m {2} {1}' \[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m '~3,+{2}+3/2'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m # Display top 3 lines as the fixed header[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'bat [0m[38;2;166;226;46m--style[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mfull[0m[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31malways[0m[38;2;248;248;242m {}' [0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m '~3'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m * You can specify an alternative set of options that are used only when the size[0m
|
||||||
|
[38;2;248;248;242m of the preview window is below a certain threshold. Note that only one[0m
|
||||||
|
[38;2;248;248;242m alternative layout is allowed.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'cat {}' [0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m 'right,border-left,<[0m[38;2;166;226;46m30[0m[38;2;249;38;114m([0m[38;2;190;132;255mup,30%,border-bottom[0m[38;2;249;38;114m)[0m[38;2;248;248;242m'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Scripting[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-q[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--query[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSTR[0m
|
||||||
|
[38;2;248;248;242m Start the finder with the given query[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-1[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--select-1[0m
|
||||||
|
[38;2;248;248;242m If there is only one match for the initial query ([0m[38;2;166;226;46m--query[0m[38;2;248;248;242m), do not start interactive finder and automatically select the only match[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-0[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--exit-0[0m
|
||||||
|
[38;2;248;248;242m If there is no match for the initial query ([0m[38;2;166;226;46m--query[0m[38;2;248;248;242m), do not start interactive finder and exit immediately[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-f[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--filter[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mSTR[0m
|
||||||
|
[38;2;248;248;242m Filter mode. Do not start interactive finder. When used with [0m[38;2;166;226;46m--no-sort[0m[38;2;248;248;242m, fzf becomes a fuzzy-version of grep.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--print-query[0m
|
||||||
|
[38;2;248;248;242m Print query as the first line[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--expect[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mKEY[0m[38;2;248;248;242m[[0m[38;2;248;248;242m,..][0m
|
||||||
|
[38;2;248;248;242m Comma-separated list of keys that can be used to complete fzf in addition to the default enter key. When this option is set, fzf will print the name of the key pressed as the[0m
|
||||||
|
[38;2;248;248;242m first line of its output (or as the second line if [0m[38;2;166;226;46m--print-query[0m[38;2;248;248;242m is also used). The line will be empty if fzf is completed with the default enter key. If [0m[38;2;166;226;46m--expect[0m[38;2;248;248;242m option is[0m
|
||||||
|
[38;2;248;248;242m specified multiple times, fzf will expect the union of the keys. [0m[38;2;166;226;46m--no-expect[0m[38;2;248;248;242m will clear the list.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--expect[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mctrl-v[0m[38;2;248;248;242m,ctrl-t,alt-s [0m[38;2;166;226;46m--expect[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mf1[0m[38;2;248;248;242m,f2,~,@[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--read0[0m
|
||||||
|
[38;2;248;248;242m Read input delimited by ASCII NUL characters instead of newline characters[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--print0[0m
|
||||||
|
[38;2;248;248;242m Print output delimited by ASCII NUL characters instead of newline characters[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--no-clear[0m
|
||||||
|
[38;2;248;248;242m Do not clear finder interface on exit. If fzf was started in full screen mode, it will not switch back to the original screen, so you'll have to manually run tput rmcup to re‐[0m
|
||||||
|
[38;2;248;248;242m turn. This option can be used to avoid flickering of the screen when your application needs to start fzf multiple times in order.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--sync[0m[38;2;248;248;242m Synchronous search for multi-staged filtering. If specified, fzf will launch ncurses finder only after the input stream is complete.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g. fzf [0m[38;2;166;226;46m--multi[0m[38;2;248;248;242m | fzf [0m[38;2;166;226;46m--sync[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--version[0m
|
||||||
|
[38;2;248;248;242m Display version information and exit[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Note that most options have the opposite versions with [0m[38;2;166;226;46m--no-[0m[38;2;248;248;242m prefix.[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mENVIRONMENT VARIABLES[0m
|
||||||
|
[38;2;248;248;242m FZF_DEFAULT_COMMAND[0m
|
||||||
|
[38;2;248;248;242m Default command to use when input is tty. On *nix systems, fzf runs the command with [0m[38;2;255;255;255m$[0m[38;2;190;132;255mSHELL[0m[38;2;248;248;242m [0m[38;2;166;226;46m-c[0m[38;2;248;248;242m if SHELL is set, otherwise with sh [0m[38;2;166;226;46m-c[0m[38;2;248;248;242m, so in this case make sure that the command[0m
|
||||||
|
[38;2;248;248;242m is POSIX-compliant.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m FZF_DEFAULT_OPTS[0m
|
||||||
|
[38;2;248;248;242m Default options. e.g. export FZF_DEFAULT_OPTS="[0m[38;2;166;226;46m--extended[0m[38;2;248;248;242m [0m[38;2;166;226;46m--cycle[0m[38;2;248;248;242m"[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mEXIT STATUS[0m
|
||||||
|
[38;2;248;248;242m 0 Normal exit[0m
|
||||||
|
[38;2;248;248;242m 1 No match[0m
|
||||||
|
[38;2;248;248;242m 2 Error[0m
|
||||||
|
[38;2;248;248;242m 130 Interrupted with CTRL-C or ESC[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mFIELD INDEX EXPRESSION[0m
|
||||||
|
[38;2;248;248;242m A field index expression can be a non-zero integer or a range expression ([BEGIN]..[END]). [0m[38;2;166;226;46m--nth[0m[38;2;248;248;242m and [0m[38;2;166;226;46m--with-nth[0m[38;2;248;248;242m take a comma-separated list of field index expressions.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Examples[0m
|
||||||
|
[38;2;248;248;242m 1 The 1st field[0m
|
||||||
|
[38;2;248;248;242m 2 The 2nd field[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-1[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mThe[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mlast[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mfield[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m-2[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mThe[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m2nd[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mto[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mlast[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mfield[0m
|
||||||
|
[38;2;248;248;242m 3..5 From the 3rd field to the 5th field[0m
|
||||||
|
[38;2;248;248;242m 2.. From the 2nd field to the last field[0m
|
||||||
|
[38;2;248;248;242m ..[0m[38;2;166;226;46m-3[0m[38;2;248;248;242m From the 1st field to the 3rd to the last field[0m
|
||||||
|
[38;2;248;248;242m .. All the fields[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mEXTENDED SEARCH MODE[0m
|
||||||
|
[38;2;248;248;242m Unless specified otherwise, fzf will start in "extended-search mode". In this mode, you can specify multiple patterns delimited by spaces, such as: 'wild ^music .mp3$ sbtrkt !rmx[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m You can prepend a backslash to a space (\ ) to match a literal space character.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Exact-match (quoted)[0m
|
||||||
|
[38;2;248;248;242m A term that is prefixed by a single-quote character (') is interpreted as an "exact-match" (or "non-fuzzy") term. fzf will search for the exact occurrences of the string.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Anchored-match[0m
|
||||||
|
[38;2;248;248;242m A term can be prefixed by ^, or suffixed by $ to become an anchored-match term. Then fzf will search for the lines that start with or end with the given string. An anchored-match term[0m
|
||||||
|
[38;2;248;248;242m is also an exact-match term.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Negation[0m
|
||||||
|
[38;2;248;248;242m If a term is prefixed by !, fzf will exclude the lines that satisfy the term from the result. In this case, fzf performs exact match by default.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Exact-match by default[0m
|
||||||
|
[38;2;248;248;242m If you don't prefer fuzzy matching and do not wish to "quote" (prefixing with ') every word, start fzf with [0m[38;2;166;226;46m-e[0m[38;2;248;248;242m or [0m[38;2;166;226;46m--exact[0m[38;2;248;248;242m option. Note that when [0m[38;2;166;226;46m--exact[0m[38;2;248;248;242m is set, '[0m[38;2;166;226;46m-prefix[0m[38;2;248;248;242m "unquotes" the[0m
|
||||||
|
[38;2;248;248;242m term.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m OR operator[0m
|
||||||
|
[38;2;248;248;242m A single bar character term acts as an OR operator. For example, the following query matches entries that start with core and end with either go, rb, or py.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g. ^core go$ | rb$ | py$[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mKEY/EVENT BINDINGS[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m option allows you to bind a key or an event to one or more actions. You can use it to customize key bindings or implement dynamic behaviors.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m takes a comma-separated list of binding expressions. Each binding expression is KEY:ACTION or EVENT:ACTION.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--bind[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mctrl-j:accept[0m[38;2;248;248;242m,ctrl-k:kill-line[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m AVAILABLE KEYS: (SYNONYMS)[0m
|
||||||
|
[38;2;248;248;242m ctrl-[a-z][0m
|
||||||
|
[38;2;248;248;242m ctrl-space[0m
|
||||||
|
[38;2;248;248;242m ctrl-\[0m
|
||||||
|
[38;2;248;248;242m ctrl-][0m
|
||||||
|
[38;2;248;248;242m ctrl-^ (ctrl-6)[0m
|
||||||
|
[38;2;248;248;242m ctrl-/ (ctrl-_)[0m
|
||||||
|
[38;2;248;248;242m ctrl-alt-[a-z][0m
|
||||||
|
[38;2;248;248;242m alt-[*] (Any case-sensitive single character is allowed)[0m
|
||||||
|
[38;2;248;248;242m f[1-12][0m
|
||||||
|
[38;2;248;248;242m enter (return ctrl-m)[0m
|
||||||
|
[38;2;248;248;242m space[0m
|
||||||
|
[38;2;248;248;242m bspace (bs)[0m
|
||||||
|
[38;2;248;248;242m alt-up[0m
|
||||||
|
[38;2;248;248;242m alt-down[0m
|
||||||
|
[38;2;248;248;242m alt-left[0m
|
||||||
|
[38;2;248;248;242m alt-right[0m
|
||||||
|
[38;2;248;248;242m alt-enter[0m
|
||||||
|
[38;2;248;248;242m alt-space[0m
|
||||||
|
[38;2;248;248;242m alt-bspace (alt-bs)[0m
|
||||||
|
[38;2;248;248;242m tab[0m
|
||||||
|
[38;2;248;248;242m btab (shift-tab)[0m
|
||||||
|
[38;2;248;248;242m esc[0m
|
||||||
|
[38;2;248;248;242m del[0m
|
||||||
|
[38;2;248;248;242m up[0m
|
||||||
|
[38;2;248;248;242m down[0m
|
||||||
|
[38;2;248;248;242m left[0m
|
||||||
|
[38;2;248;248;242m right[0m
|
||||||
|
[38;2;248;248;242m home[0m
|
||||||
|
[38;2;248;248;242m end[0m
|
||||||
|
[38;2;248;248;242m insert[0m
|
||||||
|
[38;2;248;248;242m pgup (page-up)[0m
|
||||||
|
[38;2;248;248;242m pgdn (page-down)[0m
|
||||||
|
[38;2;248;248;242m shift-up[0m
|
||||||
|
[38;2;248;248;242m shift-down[0m
|
||||||
|
[38;2;248;248;242m shift-left[0m
|
||||||
|
[38;2;248;248;242m shift-right[0m
|
||||||
|
[38;2;248;248;242m alt-shift-up[0m
|
||||||
|
[38;2;248;248;242m alt-shift-down[0m
|
||||||
|
[38;2;248;248;242m alt-shift-left[0m
|
||||||
|
[38;2;248;248;242m alt-shift-right[0m
|
||||||
|
[38;2;248;248;242m left-click[0m
|
||||||
|
[38;2;248;248;242m right-click[0m
|
||||||
|
[38;2;248;248;242m double-click[0m
|
||||||
|
[38;2;248;248;242m or any single character[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m AVAILABLE EVENTS:[0m
|
||||||
|
[38;2;248;248;242m change[0m
|
||||||
|
[38;2;248;248;242m Triggered whenever the query string is changed[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m # Move cursor to the first entry whenever the query is changed[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m change:first[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m backward-eof[0m
|
||||||
|
[38;2;248;248;242m Triggered when the query string is already empty and you try to delete it backward.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m backward-eof:abort[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m AVAILABLE ACTIONS:[0m
|
||||||
|
[38;2;248;248;242m A key or an event can be bound to one or more of the following actions.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m ACTION: DEFAULT BINDINGS (NOTES):[0m
|
||||||
|
[38;2;248;248;242m abort ctrl-c ctrl-g ctrl-q esc[0m
|
||||||
|
[38;2;248;248;242m accept enter double-click[0m
|
||||||
|
[38;2;248;248;242m accept-non-empty (same as accept except that it prevents fzf from exiting without selection)[0m
|
||||||
|
[38;2;248;248;242m backward-char ctrl-b left[0m
|
||||||
|
[38;2;248;248;242m backward-delete-char ctrl-h bspace[0m
|
||||||
|
[38;2;248;248;242m backward-delete-char/eof (same as backward-delete-char except aborts fzf if query is empty)[0m
|
||||||
|
[38;2;248;248;242m backward-kill-word alt-bs[0m
|
||||||
|
[38;2;248;248;242m backward-word alt-b shift-left[0m
|
||||||
|
[38;2;248;248;242m beginning-of-line ctrl-a home[0m
|
||||||
|
[38;2;248;248;242m cancel (clear query string if not empty, abort fzf otherwise)[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46mchange-preview[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m (change [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m option)[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46mchange-preview-window[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m (change [0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m option; rotate through the multiple option sets separated by '|')[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46mchange-prompt[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m (change prompt to the given string)[0m
|
||||||
|
[38;2;248;248;242m clear-screen ctrl-l[0m
|
||||||
|
[38;2;248;248;242m clear-selection (clear multi-selection)[0m
|
||||||
|
[38;2;248;248;242m close (close preview window if open, abort fzf otherwise)[0m
|
||||||
|
[38;2;248;248;242m clear-query (clear query string)[0m
|
||||||
|
[38;2;248;248;242m delete-char del[0m
|
||||||
|
[38;2;248;248;242m delete-char/eof ctrl-d (same as delete-char except aborts fzf if query is empty)[0m
|
||||||
|
[38;2;248;248;242m deselect[0m
|
||||||
|
[38;2;248;248;242m deselect-all (deselect all matches)[0m
|
||||||
|
[38;2;248;248;242m disable-search (disable search functionality)[0m
|
||||||
|
[38;2;248;248;242m down ctrl-j ctrl-n down[0m
|
||||||
|
[38;2;248;248;242m enable-search (enable search functionality)[0m
|
||||||
|
[38;2;248;248;242m end-of-line ctrl-e end[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46mexecute[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m (see below for the details)[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46mexecute-silent[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m (see below for the details)[0m
|
||||||
|
[38;2;248;248;242m first (move to the first match)[0m
|
||||||
|
[38;2;248;248;242m forward-char ctrl-f right[0m
|
||||||
|
[38;2;248;248;242m forward-word alt-f shift-right[0m
|
||||||
|
[38;2;248;248;242m ignore[0m
|
||||||
|
[38;2;248;248;242m jump (EasyMotion-like 2-keystroke movement)[0m
|
||||||
|
[38;2;248;248;242m jump-accept (jump and accept)[0m
|
||||||
|
[38;2;248;248;242m kill-line[0m
|
||||||
|
[38;2;248;248;242m kill-word alt-d[0m
|
||||||
|
[38;2;248;248;242m last (move to the last match)[0m
|
||||||
|
[38;2;248;248;242m next-history (ctrl-n on [0m[38;2;166;226;46m--history[0m[38;2;248;248;242m)[0m
|
||||||
|
[38;2;248;248;242m page-down pgdn[0m
|
||||||
|
[38;2;248;248;242m page-up pgup[0m
|
||||||
|
[38;2;248;248;242m half-page-down[0m
|
||||||
|
[38;2;248;248;242m half-page-up[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46mpreview[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m (see below for the details)[0m
|
||||||
|
[38;2;248;248;242m preview-down shift-down[0m
|
||||||
|
[38;2;248;248;242m preview-up shift-up[0m
|
||||||
|
[38;2;248;248;242m preview-page-down[0m
|
||||||
|
[38;2;248;248;242m preview-page-up[0m
|
||||||
|
[38;2;248;248;242m preview-half-page-down[0m
|
||||||
|
[38;2;248;248;242m preview-half-page-up[0m
|
||||||
|
[38;2;248;248;242m preview-bottom[0m
|
||||||
|
[38;2;248;248;242m preview-top[0m
|
||||||
|
[38;2;248;248;242m previous-history (ctrl-p on [0m[38;2;166;226;46m--history[0m[38;2;248;248;242m)[0m
|
||||||
|
[38;2;248;248;242m print-query (print query and exit)[0m
|
||||||
|
[38;2;248;248;242m put (put the character to the prompt)[0m
|
||||||
|
[38;2;248;248;242m refresh-preview[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46mrebind[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m (rebind bindings after unbind)[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46mreload[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m (see below for the details)[0m
|
||||||
|
[38;2;248;248;242m replace-query (replace query string with the current selection)[0m
|
||||||
|
[38;2;248;248;242m select[0m
|
||||||
|
[38;2;248;248;242m select-all (select all matches)[0m
|
||||||
|
[38;2;248;248;242m toggle (right-click)[0m
|
||||||
|
[38;2;248;248;242m toggle-all (toggle all matches)[0m
|
||||||
|
[38;2;248;248;242m toggle+down ctrl-i (tab)[0m
|
||||||
|
[38;2;248;248;242m toggle-in ([0m[38;2;166;226;46m--layout[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mreverse*[0m[38;2;248;248;242m ? toggle+up : toggle+down)[0m
|
||||||
|
[38;2;248;248;242m toggle-out ([0m[38;2;166;226;46m--layout[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mreverse*[0m[38;2;248;248;242m ? toggle+down : toggle+up)[0m
|
||||||
|
[38;2;248;248;242m toggle-preview[0m
|
||||||
|
[38;2;248;248;242m toggle-preview-wrap[0m
|
||||||
|
[38;2;248;248;242m toggle-search (toggle search functionality)[0m
|
||||||
|
[38;2;248;248;242m toggle-sort[0m
|
||||||
|
[38;2;248;248;242m toggle+up btab (shift-tab)[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46munbind[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m (unbind bindings)[0m
|
||||||
|
[38;2;248;248;242m unix-line-discard ctrl-u[0m
|
||||||
|
[38;2;248;248;242m unix-word-rubout ctrl-w[0m
|
||||||
|
[38;2;248;248;242m up ctrl-k ctrl-p up[0m
|
||||||
|
[38;2;248;248;242m yank ctrl-y[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m ACTION COMPOSITION[0m
|
||||||
|
[38;2;248;248;242m Multiple actions can be chained using + separator.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--multi[0m[38;2;248;248;242m [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m 'ctrl-a:select-all+accept'[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--multi[0m[38;2;248;248;242m [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m 'ctrl-a:select-all' [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m 'ctrl-a:+accept'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m ACTION ARGUMENT[0m
|
||||||
|
[38;2;248;248;242m An action denoted with (...) suffix takes an argument.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m 'ctrl-a:[0m[38;2;166;226;46mchange-prompt[0m[38;2;249;38;114m([0m[38;2;190;132;255mNewPrompt> [0m[38;2;249;38;114m)[0m[38;2;248;248;242m'[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m 'ctrl-v:[0m[38;2;166;226;46mpreview[0m[38;2;249;38;114m([0m[38;2;190;132;255mcat {}[0m[38;2;249;38;114m)[0m[38;2;248;248;242m' [0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m hidden[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m If the argument contains parentheses, fzf may fail to parse the expression. In that case, you can use any of the following alternative notations to avoid parse errors.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m action-name[...][0m
|
||||||
|
[38;2;248;248;242m action-name~...~[0m
|
||||||
|
[38;2;248;248;242m action-name!...![0m
|
||||||
|
[38;2;248;248;242m action-name@...@[0m
|
||||||
|
[38;2;248;248;242m action-name#...#[0m
|
||||||
|
[38;2;248;248;242m action-name$...$[0m
|
||||||
|
[38;2;248;248;242m action-name%...%[0m
|
||||||
|
[38;2;248;248;242m action-name^...^[0m
|
||||||
|
[38;2;248;248;242m action-name&...&[0m
|
||||||
|
[38;2;248;248;242m action-name*...*[0m
|
||||||
|
[38;2;248;248;242m action-name;...;[0m
|
||||||
|
[38;2;248;248;242m action-name/.../[0m
|
||||||
|
[38;2;248;248;242m action-name|...|[0m
|
||||||
|
[38;2;248;248;242m action-name:...[0m
|
||||||
|
[38;2;248;248;242m The last one is the special form that frees you from parse errors as it does not expect the closing character. The catch is that it should be the last one in the comma-separated[0m
|
||||||
|
[38;2;248;248;242m list of key-action pairs.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m COMMAND EXECUTION[0m
|
||||||
|
[38;2;248;248;242m With [0m[38;2;166;226;46mexecute[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m action, you can execute arbitrary commands without leaving fzf. For example, you can turn fzf into a simple file browser by binding enter key to less command like[0m
|
||||||
|
[38;2;248;248;242m follows.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m "enter:[0m[38;2;166;226;46mexecute[0m[38;2;249;38;114m([0m[38;2;190;132;255mless {}[0m[38;2;249;38;114m)[0m[38;2;248;248;242m"[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m You can use the same placeholder expressions as in [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m fzf switches to the alternate screen when executing a command. However, if the command is expected to complete quickly, and you are not interested in its output, you might want to use[0m
|
||||||
|
[38;2;248;248;242m execute-silent instead, which silently executes the command without the switching. Note that fzf will not be responsive until the command is complete. For asynchronous execution, start[0m
|
||||||
|
[38;2;248;248;242m your command as a background process (i.e. appending &).[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m On *nix systems, fzf runs the command with [0m[38;2;255;255;255m$[0m[38;2;190;132;255mSHELL[0m[38;2;248;248;242m [0m[38;2;166;226;46m-c[0m[38;2;248;248;242m if SHELL is set, otherwise with sh [0m[38;2;166;226;46m-c[0m[38;2;248;248;242m, so in this case make sure that the command is POSIX-compliant.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m RELOAD INPUT[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46mreload[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m action is used to dynamically update the input list without restarting fzf. It takes the same command template with placeholder expressions as [0m[38;2;166;226;46mexecute[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m See https://github.com/junegunn/fzf/issues/1750 for more info.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m # Update the list of processes by pressing CTRL-R[0m
|
||||||
|
[38;2;248;248;242m ps [0m[38;2;166;226;46m-ef[0m[38;2;248;248;242m | fzf [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m 'ctrl-r:[0m[38;2;166;226;46mreload[0m[38;2;249;38;114m([0m[38;2;190;132;255mps -ef[0m[38;2;249;38;114m)[0m[38;2;248;248;242m' [0m[38;2;166;226;46m--header[0m[38;2;248;248;242m 'Press CTRL-R to reload' \[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--header-lines[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31m1[0m[38;2;248;248;242m [0m[38;2;166;226;46m--layout[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mreverse[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m # Integration with ripgrep[0m
|
||||||
|
[38;2;248;248;242m RG_PREFIX="rg [0m[38;2;166;226;46m--column[0m[38;2;248;248;242m [0m[38;2;166;226;46m--line-number[0m[38;2;248;248;242m [0m[38;2;166;226;46m--no-heading[0m[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31malways[0m[38;2;248;248;242m [0m[38;2;166;226;46m--smart-case[0m[38;2;248;248;242m "[0m
|
||||||
|
[38;2;248;248;242m INITIAL_QUERY="foobar"[0m
|
||||||
|
[38;2;248;248;242m FZF_DEFAULT_COMMAND="[0m[38;2;255;255;255m$[0m[38;2;190;132;255mRG_PREFIX[0m[38;2;248;248;242m '[0m[38;2;255;255;255m$[0m[38;2;190;132;255mINITIAL_QUERY[0m[38;2;248;248;242m'" \[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m "change:reload:[0m[38;2;255;255;255m$[0m[38;2;190;132;255mRG_PREFIX[0m[38;2;248;248;242m {q} || true" \[0m
|
||||||
|
[38;2;248;248;242m [0m[38;2;166;226;46m--ansi[0m[38;2;248;248;242m [0m[38;2;166;226;46m--disabled[0m[38;2;248;248;242m [0m[38;2;166;226;46m--query[0m[38;2;248;248;242m "[0m[38;2;255;255;255m$[0m[38;2;190;132;255mINITIAL_QUERY[0m[38;2;248;248;242m"[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m PREVIEW BINDING[0m
|
||||||
|
[38;2;248;248;242m With [0m[38;2;166;226;46mpreview[0m[38;2;249;38;114m([0m[38;2;190;132;255m...[0m[38;2;249;38;114m)[0m[38;2;248;248;242m action, you can specify multiple different preview commands in addition to the default preview command given by [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m option.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m # Default preview command with an extra preview binding[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'file {}' [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m '?:preview:cat {}'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m # A preview binding with no default preview command[0m
|
||||||
|
[38;2;248;248;242m # (Preview window is initially empty)[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m '?:preview:cat {}'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m # Preview window hidden by default, it appears when you first hit '?'[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m '?:preview:cat {}' [0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m hidden[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m CHANGE PREVIEW WINDOW ATTRIBUTES[0m
|
||||||
|
[38;2;248;248;242m change-preview-window action can be used to change the properties of the preview window. Unlike the [0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m option, you can specify multiple sets of options separated by '|'[0m
|
||||||
|
[38;2;248;248;242m characters.[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m e.g.[0m
|
||||||
|
[38;2;248;248;242m # Rotate through the options using CTRL-/[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'cat {}' [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m 'ctrl-/:[0m[38;2;166;226;46mchange-preview-window[0m[38;2;249;38;114m([0m[38;2;190;132;255mright,70%|down,40%,border-horizontal|hidden|right[0m[38;2;249;38;114m)[0m[38;2;248;248;242m'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m # The default properties given by `[0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m` are inherited, so an empty string in the list is interpreted as the default[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'cat {}' [0m[38;2;166;226;46m--preview-window[0m[38;2;248;248;242m 'right,40%,border-left' [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m 'ctrl-/:[0m[38;2;166;226;46mchange-preview-window[0m[38;2;249;38;114m([0m[38;2;190;132;255m70%|down,border-top|hidden|[0m[38;2;249;38;114m)[0m[38;2;248;248;242m'[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m # This is equivalent to toggle-preview action[0m
|
||||||
|
[38;2;248;248;242m fzf [0m[38;2;166;226;46m--preview[0m[38;2;248;248;242m 'cat {}' [0m[38;2;166;226;46m--bind[0m[38;2;248;248;242m 'ctrl-/:[0m[38;2;166;226;46mchange-preview-window[0m[38;2;249;38;114m([0m[38;2;190;132;255mhidden|[0m[38;2;249;38;114m)[0m[38;2;248;248;242m'[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mAUTHOR[0m
|
||||||
|
[38;2;248;248;242m Junegunn Choi (junegunn.c@gmail.com)[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mSEE ALSO[0m
|
||||||
|
[38;2;248;248;242m Project homepage:[0m
|
||||||
|
[38;2;248;248;242m https://github.com/junegunn/fzf[0m
|
||||||
|
|
||||||
|
[38;2;248;248;242m Extra Vim plugin:[0m
|
||||||
|
[38;2;248;248;242m https://github.com/junegunn/fzf.vim[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mLICENSE[0m
|
||||||
|
[38;2;248;248;242m MIT[0m
|
||||||
|
|
||||||
|
[38;2;253;151;31mfzf 0.33.0 Aug 2022 fzf(1)[0m
|
23
tests/syntax-tests/source/Ada/LICENSE.md
vendored
Normal file
23
tests/syntax-tests/source/Ada/LICENSE.md
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
The files `click.adb`, `click.ads` and `click.gpr` have been added from https://github.com/dkm/click under the following license:
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2022 Marc Poulhiès <dkm@kataplop.net>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
308
tests/syntax-tests/source/Ada/click.adb
vendored
Normal file
308
tests/syntax-tests/source/Ada/click.adb
vendored
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
with Chests.Ring_Buffers;
|
||||||
|
with USB.Device.HID.Keyboard;
|
||||||
|
|
||||||
|
package body Click is
|
||||||
|
----------------
|
||||||
|
-- DEBOUNCE --
|
||||||
|
----------------
|
||||||
|
|
||||||
|
-- Ideally, in a separate package.
|
||||||
|
|
||||||
|
-- should be [], but not fixed yet in GCC 11.
|
||||||
|
Current_Status : Key_Matrix := [others => [others => False]];
|
||||||
|
New_Status : Key_Matrix := [others => [others => False]];
|
||||||
|
Since : Natural := 0;
|
||||||
|
-- Nb_Bounce : Natural := 5;
|
||||||
|
|
||||||
|
function Update (NewS : Key_Matrix) return Boolean is
|
||||||
|
begin
|
||||||
|
-- The new state is the same as the current stable state => Do nothing.
|
||||||
|
if Current_Status = NewS then
|
||||||
|
Since := 0;
|
||||||
|
return False;
|
||||||
|
end if;
|
||||||
|
|
||||||
|
if New_Status /= NewS then
|
||||||
|
-- The new state differs from the previous
|
||||||
|
-- new state (bouncing) => reset
|
||||||
|
New_Status := NewS;
|
||||||
|
Since := 1;
|
||||||
|
else
|
||||||
|
-- The new state hasn't changed since last
|
||||||
|
-- update => towards stabilization.
|
||||||
|
Since := Since + 1;
|
||||||
|
end if;
|
||||||
|
|
||||||
|
if Since > Nb_Bounce then
|
||||||
|
declare
|
||||||
|
Tmp : constant Key_Matrix := Current_Status;
|
||||||
|
begin
|
||||||
|
-- New state has been stable enough.
|
||||||
|
-- Latch it and notifies caller.
|
||||||
|
Current_Status := New_Status;
|
||||||
|
New_Status := Tmp;
|
||||||
|
Since := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
return True;
|
||||||
|
else
|
||||||
|
-- Not there yet
|
||||||
|
return False;
|
||||||
|
end if;
|
||||||
|
end Update;
|
||||||
|
|
||||||
|
procedure Get_Matrix;
|
||||||
|
-- Could use := []; but GNAT 12 has a bug (fixed in upcoming 13)
|
||||||
|
Read_Status : Key_Matrix := [others => [others => False]];
|
||||||
|
|
||||||
|
function Get_Events return Events is
|
||||||
|
Num_Evt : Natural := 0;
|
||||||
|
New_S : Key_Matrix renames Read_Status;
|
||||||
|
begin
|
||||||
|
Get_Matrix;
|
||||||
|
if Update (New_S) then
|
||||||
|
for I in Current_Status'Range (1) loop
|
||||||
|
for J in Current_Status'Range (2) loop
|
||||||
|
if (not New_Status (I, J) and then Current_Status (I, J))
|
||||||
|
or else (New_Status (I, J) and then not Current_Status (I, J))
|
||||||
|
then
|
||||||
|
Num_Evt := Num_Evt + 1;
|
||||||
|
end if;
|
||||||
|
end loop;
|
||||||
|
end loop;
|
||||||
|
|
||||||
|
declare
|
||||||
|
Evts : Events (Natural range 1 .. Num_Evt);
|
||||||
|
Cursor : Natural range 1 .. Num_Evt + 1 := 1;
|
||||||
|
begin
|
||||||
|
for I in Current_Status'Range (1) loop
|
||||||
|
for J in Current_Status'Range (2) loop
|
||||||
|
if not New_Status (I, J)
|
||||||
|
and then Current_Status (I, J)
|
||||||
|
then
|
||||||
|
-- Pressing I, J
|
||||||
|
Evts (Cursor) := [
|
||||||
|
Evt => Press,
|
||||||
|
Col => I,
|
||||||
|
Row => J
|
||||||
|
];
|
||||||
|
Cursor := Cursor + 1;
|
||||||
|
elsif New_Status (I, J)
|
||||||
|
and then not Current_Status (I, J)
|
||||||
|
then
|
||||||
|
-- Release I, J
|
||||||
|
Evts (Cursor) := [
|
||||||
|
Evt => Release,
|
||||||
|
Col => I,
|
||||||
|
Row => J
|
||||||
|
];
|
||||||
|
Cursor := Cursor + 1;
|
||||||
|
end if;
|
||||||
|
end loop;
|
||||||
|
end loop;
|
||||||
|
return Evts;
|
||||||
|
end;
|
||||||
|
end if;
|
||||||
|
|
||||||
|
return [];
|
||||||
|
end Get_Events;
|
||||||
|
|
||||||
|
procedure Get_Matrix is -- return Key_Matrix is
|
||||||
|
begin
|
||||||
|
for Row in Keys.Rows'Range loop
|
||||||
|
Keys.Rows (Row).Clear;
|
||||||
|
|
||||||
|
for Col in Keys.Cols'Range loop
|
||||||
|
Read_Status (Col, Row) := not Keys.Cols (Col).Set;
|
||||||
|
end loop;
|
||||||
|
Keys.Rows (Row).Set;
|
||||||
|
end loop;
|
||||||
|
end Get_Matrix;
|
||||||
|
|
||||||
|
-- End of DEBOUNCE
|
||||||
|
|
||||||
|
--------------
|
||||||
|
-- Layout --
|
||||||
|
--------------
|
||||||
|
|
||||||
|
package Events_Ring_Buffers is new Chests.Ring_Buffers
|
||||||
|
(Element_Type => Event,
|
||||||
|
Capacity => 16);
|
||||||
|
|
||||||
|
Queued_Events : Events_Ring_Buffers.Ring_Buffer;
|
||||||
|
|
||||||
|
type Statet is (Normal_Key, Layer_Mod, None);
|
||||||
|
type State is record
|
||||||
|
Typ : Statet;
|
||||||
|
Code : Key_Code_T;
|
||||||
|
Layer_Value : Natural;
|
||||||
|
-- Col : ColR;
|
||||||
|
-- Row : RowR;
|
||||||
|
end record;
|
||||||
|
|
||||||
|
type State_Array is array (ColR, RowR) of State;
|
||||||
|
States : State_Array := [others => [others => (Typ => None, Code => No, Layer_Value => 0)]];
|
||||||
|
|
||||||
|
function Kw (Code : Key_Code_T) return Action is
|
||||||
|
begin
|
||||||
|
return (T => Key, C => Code, L => 0);
|
||||||
|
end Kw;
|
||||||
|
|
||||||
|
function Lw (V : Natural) return Action is
|
||||||
|
begin
|
||||||
|
return (T => Layer, C => No, L => V);
|
||||||
|
end Lw;
|
||||||
|
|
||||||
|
-- FIXME: hardcoded max number of events
|
||||||
|
subtype Events_Range is Natural range 0 .. 60;
|
||||||
|
type Array_Of_Reg_Events is array (Events_Range) of Event;
|
||||||
|
|
||||||
|
Stamp : Natural := 0;
|
||||||
|
|
||||||
|
procedure Register_Events (L : Layout; Es : Events) is
|
||||||
|
begin
|
||||||
|
Stamp := Stamp + 1;
|
||||||
|
|
||||||
|
Log ("Reg events: " & Stamp'Image);
|
||||||
|
Log (Es'Length'Image);
|
||||||
|
for E of Es loop
|
||||||
|
declare
|
||||||
|
begin
|
||||||
|
if Events_Ring_Buffers.Is_Full (Queued_Events) then
|
||||||
|
raise Program_Error;
|
||||||
|
end if;
|
||||||
|
|
||||||
|
Events_Ring_Buffers.Append (Queued_Events, E);
|
||||||
|
end;
|
||||||
|
-- Log ("Reg'ed events:" & Events_Mark'Image);
|
||||||
|
Log ("Reg'ed events:" & Events_Ring_Buffers.Length (Queued_Events)'Image);
|
||||||
|
end loop;
|
||||||
|
end Register_Events;
|
||||||
|
|
||||||
|
procedure Release (Col: Colr; Row: Rowr) is
|
||||||
|
begin
|
||||||
|
if States (Col, Row).Typ = None then
|
||||||
|
raise Program_Error;
|
||||||
|
end if;
|
||||||
|
States (Col, Row) := (Typ => None, Code => No, Layer_Value => 0);
|
||||||
|
end Release;
|
||||||
|
|
||||||
|
function Get_Current_Layer return Natural is
|
||||||
|
L : Natural := 0;
|
||||||
|
begin
|
||||||
|
for S of States loop
|
||||||
|
if S.Typ = Layer_Mod then
|
||||||
|
L := L + S.Layer_Value;
|
||||||
|
end if;
|
||||||
|
end loop;
|
||||||
|
|
||||||
|
return L;
|
||||||
|
end Get_Current_Layer;
|
||||||
|
|
||||||
|
-- Tick the event.
|
||||||
|
-- Returns TRUE if it needs to stay in the queued events
|
||||||
|
-- FALSE if the event has been consumed.
|
||||||
|
|
||||||
|
function Tick (L: Layout; E : in out Event) return Boolean is
|
||||||
|
Current_Layer : Natural := Get_Current_Layer;
|
||||||
|
A : Action renames L (Current_Layer, E.Row, E.Col);
|
||||||
|
begin
|
||||||
|
case E.Evt is
|
||||||
|
when Press =>
|
||||||
|
case A.T is
|
||||||
|
when Key =>
|
||||||
|
States (E.Col, E.Row) :=
|
||||||
|
(Typ => Normal_Key,
|
||||||
|
Code => A.C,
|
||||||
|
Layer_Value => 0);
|
||||||
|
when Layer =>
|
||||||
|
States (E.Col, E.Row) := (Typ => Layer_Mod, Layer_Value => A.L, Code => No);
|
||||||
|
when others =>
|
||||||
|
raise Program_Error;
|
||||||
|
end case;
|
||||||
|
|
||||||
|
when Release =>
|
||||||
|
Release (E.Col, E.Row);
|
||||||
|
end case;
|
||||||
|
return False;
|
||||||
|
end Tick;
|
||||||
|
|
||||||
|
Last_Was_Empty_Log : Boolean := False;
|
||||||
|
|
||||||
|
procedure Tick (L : Layout) is
|
||||||
|
begin
|
||||||
|
for I in 1 .. Events_Ring_Buffers.Length(Queued_Events) loop
|
||||||
|
declare
|
||||||
|
E : Event := Events_Ring_Buffers.Last_Element (Queued_Events);
|
||||||
|
begin
|
||||||
|
Events_Ring_Buffers.Delete_Last (Queued_Events);
|
||||||
|
if Tick (L, E) then
|
||||||
|
Events_Ring_Buffers.Prepend (Queued_Events, E);
|
||||||
|
end if;
|
||||||
|
end;
|
||||||
|
end loop;
|
||||||
|
if not Last_Was_Empty_Log or else Events_Ring_Buffers.Length(Queued_Events) /= 0 then
|
||||||
|
Log ("End Tick layout, events: " & Events_Ring_Buffers.Length(Queued_Events)'Image);
|
||||||
|
Last_Was_Empty_Log := Events_Ring_Buffers.Length(Queued_Events) = 0;
|
||||||
|
end if;
|
||||||
|
end Tick;
|
||||||
|
|
||||||
|
function Get_Key_Codes return Key_Codes_T is
|
||||||
|
Codes : Key_Codes_T (0 .. 10);
|
||||||
|
Wm: Natural := 0;
|
||||||
|
begin
|
||||||
|
for S of States loop
|
||||||
|
if S.Typ = Normal_Key and then
|
||||||
|
(S.Code < LCtrl or else S.Code > RGui)
|
||||||
|
then
|
||||||
|
Codes (Wm) := S.Code;
|
||||||
|
Wm := Wm + 1;
|
||||||
|
end if;
|
||||||
|
end loop;
|
||||||
|
|
||||||
|
if Wm = 0 then
|
||||||
|
return [];
|
||||||
|
else
|
||||||
|
return Codes (0 .. Wm - 1);
|
||||||
|
end if;
|
||||||
|
end Get_Key_Codes;
|
||||||
|
|
||||||
|
function Get_Modifiers return Key_Modifiers is
|
||||||
|
use USB.Device.HID.Keyboard;
|
||||||
|
KM : Key_Modifiers (1..8);
|
||||||
|
I : Natural := 0;
|
||||||
|
begin
|
||||||
|
for S of States loop
|
||||||
|
if S.Typ = Normal_Key then
|
||||||
|
I := I + 1;
|
||||||
|
case S.Code is
|
||||||
|
when LCtrl =>
|
||||||
|
KM(I) := Ctrl_Left;
|
||||||
|
when RCtrl =>
|
||||||
|
KM(I) := Ctrl_Right;
|
||||||
|
when LShift =>
|
||||||
|
KM(I) := Shift_Left;
|
||||||
|
when RShift =>
|
||||||
|
KM(I) := Shift_Right;
|
||||||
|
when LAlt =>
|
||||||
|
KM(I) := Alt_Left;
|
||||||
|
when RAlt =>
|
||||||
|
KM(I) := Alt_Right;
|
||||||
|
when LGui =>
|
||||||
|
KM(I) := Meta_Left;
|
||||||
|
when RGui =>
|
||||||
|
KM(I) := Meta_Right;
|
||||||
|
when others =>
|
||||||
|
I := I - 1;
|
||||||
|
end case;
|
||||||
|
end if;
|
||||||
|
end loop;
|
||||||
|
return KM (1..I);
|
||||||
|
end Get_Modifiers;
|
||||||
|
|
||||||
|
procedure Init is
|
||||||
|
begin
|
||||||
|
Events_Ring_Buffers.Clear (Queued_Events);
|
||||||
|
end Init;
|
||||||
|
|
||||||
|
end Click;
|
339
tests/syntax-tests/source/Ada/click.ads
vendored
Normal file
339
tests/syntax-tests/source/Ada/click.ads
vendored
Normal file
@ -0,0 +1,339 @@
|
|||||||
|
with HAL.GPIO;
|
||||||
|
with USB.Device.HID.Keyboard;
|
||||||
|
|
||||||
|
generic
|
||||||
|
Nb_Bounce : Natural;
|
||||||
|
type ColR is (<>);
|
||||||
|
type RowR is (<>);
|
||||||
|
|
||||||
|
type GPIOP is new HAL.GPIO.GPIO_Point with private;
|
||||||
|
|
||||||
|
type Cols_T is array (ColR) of GPIOP;
|
||||||
|
type Rows_T is array (RowR) of GPIOP;
|
||||||
|
|
||||||
|
Cols : Cols_T;
|
||||||
|
Rows : Rows_T;
|
||||||
|
Num_Layers : Natural;
|
||||||
|
|
||||||
|
with procedure Log (S : String; L : Integer := 1; Deindent : Integer := 0);
|
||||||
|
package Click is
|
||||||
|
|
||||||
|
type Keys_T is record
|
||||||
|
Cols : Cols_T;
|
||||||
|
Rows : Rows_T;
|
||||||
|
end record;
|
||||||
|
|
||||||
|
Keys : Keys_T :=
|
||||||
|
(Rows => Rows, Cols => Cols);
|
||||||
|
|
||||||
|
type Key_Matrix is array (ColR, RowR) of Boolean;
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
-- Events & Debouncing --
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
MaxEvents : constant Positive := 20;
|
||||||
|
|
||||||
|
type EventT is (Press, Release);
|
||||||
|
type Event is record
|
||||||
|
Evt : EventT;
|
||||||
|
Col : ColR;
|
||||||
|
Row : RowR;
|
||||||
|
end record;
|
||||||
|
|
||||||
|
type Events is array (Natural range <>) of Event;
|
||||||
|
|
||||||
|
function Get_Events return Events;
|
||||||
|
function Update (NewS : Key_Matrix) return Boolean;
|
||||||
|
|
||||||
|
-------------
|
||||||
|
-- Layout --
|
||||||
|
-------------
|
||||||
|
---------------
|
||||||
|
-- Keycodes --
|
||||||
|
---------------
|
||||||
|
|
||||||
|
-- Keycodes copy/pasted from the excelent Keyberon Rust firmware:
|
||||||
|
-- https://github.com/TeXitoi/keyberon/
|
||||||
|
|
||||||
|
type Key_Code_T is
|
||||||
|
(
|
||||||
|
-- The "no" key, a placeholder to express nothing.
|
||||||
|
No, -- = 0x00,
|
||||||
|
-- / Error if too much keys are pressed at
|
||||||
|
-- the same time.
|
||||||
|
ErrorRollOver,
|
||||||
|
-- / The POST fail error.
|
||||||
|
PostFail,
|
||||||
|
-- / An undefined error occured.
|
||||||
|
ErrorUndefined,
|
||||||
|
-- / `a` and `A`.
|
||||||
|
A,
|
||||||
|
B,
|
||||||
|
C,
|
||||||
|
D,
|
||||||
|
E,
|
||||||
|
F,
|
||||||
|
G,
|
||||||
|
H,
|
||||||
|
I,
|
||||||
|
J,
|
||||||
|
K,
|
||||||
|
L,
|
||||||
|
M, -- 0x10
|
||||||
|
N,
|
||||||
|
O,
|
||||||
|
P,
|
||||||
|
Q,
|
||||||
|
R,
|
||||||
|
S,
|
||||||
|
T,
|
||||||
|
U,
|
||||||
|
V,
|
||||||
|
W,
|
||||||
|
X,
|
||||||
|
Y,
|
||||||
|
Z,
|
||||||
|
-- `1` and `!`.
|
||||||
|
Kb1,
|
||||||
|
-- `2` and `@`.
|
||||||
|
Kb2,
|
||||||
|
-- `3` and `#`.
|
||||||
|
Kb3, -- 0x20
|
||||||
|
-- / `4` and `$`.
|
||||||
|
Kb4,
|
||||||
|
-- `5` and `%`.
|
||||||
|
Kb5,
|
||||||
|
-- `6` and `^`.
|
||||||
|
Kb6,
|
||||||
|
-- `7` and `&`.
|
||||||
|
Kb7,
|
||||||
|
-- `8` and `*`.
|
||||||
|
Kb8,
|
||||||
|
-- `9` and `(`.
|
||||||
|
Kb9,
|
||||||
|
-- `0` and `)`.
|
||||||
|
Kb0,
|
||||||
|
Enter,
|
||||||
|
Escape,
|
||||||
|
BSpace,
|
||||||
|
Tab,
|
||||||
|
Space,
|
||||||
|
-- `-` and `_`.
|
||||||
|
Minus,
|
||||||
|
-- `=` and `+`.
|
||||||
|
Equal,
|
||||||
|
-- `[` and `{`.
|
||||||
|
LBracket,
|
||||||
|
-- `]` and `}`.
|
||||||
|
RBracket, -- 0x30
|
||||||
|
-- / `\` and `|`.
|
||||||
|
Bslash,
|
||||||
|
-- Non-US `#` and `~` (Typically near the Enter key).
|
||||||
|
NonUsHash,
|
||||||
|
-- `;` and `:`.
|
||||||
|
SColon,
|
||||||
|
-- `'` and `"`.
|
||||||
|
Quote,
|
||||||
|
-- How to have ` as code?
|
||||||
|
-- \` and `~`.
|
||||||
|
Grave,
|
||||||
|
-- `,` and `<`.
|
||||||
|
Comma,
|
||||||
|
-- `.` and `>`.
|
||||||
|
Dot,
|
||||||
|
-- `/` and `?`.
|
||||||
|
Slash,
|
||||||
|
CapsLock,
|
||||||
|
F1,
|
||||||
|
F2,
|
||||||
|
F3,
|
||||||
|
F4,
|
||||||
|
F5,
|
||||||
|
F6,
|
||||||
|
F7, -- 0x40
|
||||||
|
F8,
|
||||||
|
F9,
|
||||||
|
F10,
|
||||||
|
F11,
|
||||||
|
F12,
|
||||||
|
PScreen,
|
||||||
|
ScrollLock,
|
||||||
|
Pause,
|
||||||
|
Insert,
|
||||||
|
Home,
|
||||||
|
PgUp,
|
||||||
|
Delete,
|
||||||
|
Endd,
|
||||||
|
PgDown,
|
||||||
|
Right,
|
||||||
|
Left, -- 0x50
|
||||||
|
Down,
|
||||||
|
Up,
|
||||||
|
NumLock,
|
||||||
|
-- Keypad `/`
|
||||||
|
KpSlash,
|
||||||
|
-- Keypad `*`
|
||||||
|
KpAsterisk,
|
||||||
|
-- Keypad `-`.
|
||||||
|
KpMinus,
|
||||||
|
-- Keypad `+`.
|
||||||
|
KpPlus,
|
||||||
|
-- Keypad enter.
|
||||||
|
KpEnter,
|
||||||
|
-- Keypad 1.
|
||||||
|
Kp1,
|
||||||
|
Kp2,
|
||||||
|
Kp3,
|
||||||
|
Kp4,
|
||||||
|
Kp5,
|
||||||
|
Kp6,
|
||||||
|
Kp7,
|
||||||
|
Kp8, -- 0x60
|
||||||
|
Kp9,
|
||||||
|
Kp0,
|
||||||
|
KpDot,
|
||||||
|
-- Non-US `\` and `|` (Typically near the Left-Shift key)
|
||||||
|
NonUsBslash,
|
||||||
|
Application, -- 0x65
|
||||||
|
-- / not a key, used for errors
|
||||||
|
Power,
|
||||||
|
-- Keypad `=`.
|
||||||
|
KpEqual,
|
||||||
|
F13,
|
||||||
|
F14,
|
||||||
|
F15,
|
||||||
|
F16,
|
||||||
|
F17,
|
||||||
|
F18,
|
||||||
|
F19,
|
||||||
|
F20,
|
||||||
|
F21, -- 0x70
|
||||||
|
F22,
|
||||||
|
F23,
|
||||||
|
F24,
|
||||||
|
Execute,
|
||||||
|
Help,
|
||||||
|
Menu,
|
||||||
|
Selectt,
|
||||||
|
Stop,
|
||||||
|
Again,
|
||||||
|
Undo,
|
||||||
|
Cut,
|
||||||
|
Copy,
|
||||||
|
Paste,
|
||||||
|
Find,
|
||||||
|
Mute,
|
||||||
|
VolUp, -- 0x80
|
||||||
|
VolDown,
|
||||||
|
-- Deprecated.
|
||||||
|
LockingCapsLock,
|
||||||
|
-- Deprecated.
|
||||||
|
LockingNumLock,
|
||||||
|
-- Deprecated.
|
||||||
|
LockingScrollLock,
|
||||||
|
-- / Keypad `,`, also used for the
|
||||||
|
-- brazilian keypad period (.) key.
|
||||||
|
KpComma,
|
||||||
|
-- Used on AS/400 keyboard
|
||||||
|
KpEqualSign,
|
||||||
|
Intl1,
|
||||||
|
Intl2,
|
||||||
|
Intl3,
|
||||||
|
Intl4,
|
||||||
|
Intl5,
|
||||||
|
Intl6,
|
||||||
|
Intl7,
|
||||||
|
Intl8,
|
||||||
|
Intl9,
|
||||||
|
Lang1, -- 0x90
|
||||||
|
Lang2,
|
||||||
|
Lang3,
|
||||||
|
Lang4,
|
||||||
|
Lang5,
|
||||||
|
Lang6,
|
||||||
|
Lang7,
|
||||||
|
Lang8,
|
||||||
|
Lang9,
|
||||||
|
AltErase,
|
||||||
|
SysReq,
|
||||||
|
Cancel,
|
||||||
|
Clear,
|
||||||
|
Prior,
|
||||||
|
Returnn,
|
||||||
|
Separator,
|
||||||
|
Outt, -- 0xA0
|
||||||
|
Oper,
|
||||||
|
ClearAgain,
|
||||||
|
CrSel,
|
||||||
|
ExSel,
|
||||||
|
|
||||||
|
-- According to QMK, 0xA5-0xDF are not
|
||||||
|
-- usable on modern keyboards
|
||||||
|
|
||||||
|
-- Modifiers
|
||||||
|
-- Left Control.
|
||||||
|
LCtrl, -- = 0xE0,
|
||||||
|
-- / Left Shift.
|
||||||
|
LShift,
|
||||||
|
-- Left Alt.
|
||||||
|
LAlt,
|
||||||
|
-- Left GUI (the Windows key).
|
||||||
|
LGui,
|
||||||
|
-- Right Control.
|
||||||
|
RCtrl,
|
||||||
|
-- Right Shift.
|
||||||
|
RShift,
|
||||||
|
-- Right Alt (or Alt Gr).
|
||||||
|
RAlt,
|
||||||
|
-- Right GUI (the Windows key).
|
||||||
|
RGui, -- 0xE7
|
||||||
|
|
||||||
|
-- Unofficial
|
||||||
|
MediaPlayPause, -- 0xE8,
|
||||||
|
MediaStopCD,
|
||||||
|
MediaPreviousSong,
|
||||||
|
MediaNextSong,
|
||||||
|
MediaEjectCD,
|
||||||
|
MediaVolUp,
|
||||||
|
MediaVolDown,
|
||||||
|
MediaMute,
|
||||||
|
MediaWWW, -- 0xF0
|
||||||
|
MediaBack,
|
||||||
|
MediaForward,
|
||||||
|
MediaStop,
|
||||||
|
MediaFind,
|
||||||
|
MediaScrollUp,
|
||||||
|
MediaScrollDown,
|
||||||
|
MediaEdit,
|
||||||
|
MediaSleep,
|
||||||
|
MediaCoffee,
|
||||||
|
MediaRefresh,
|
||||||
|
MediaCalc -- 0xFB
|
||||||
|
);
|
||||||
|
|
||||||
|
type Action_Type is (Key, No_Op, Trans, Layer, Multiple_Actions);
|
||||||
|
|
||||||
|
-- Should be a discriminated type
|
||||||
|
type Action is record
|
||||||
|
T : Action_Type; -- hould be the discriminant
|
||||||
|
C : Key_Code_T;
|
||||||
|
L : Natural;
|
||||||
|
end record;
|
||||||
|
|
||||||
|
function Kw (Code : Key_Code_T) return Action;
|
||||||
|
function Lw (V : Natural) return Action;
|
||||||
|
|
||||||
|
type Key_Modifiers is array (Natural range <>) of USB.Device.HID.Keyboard.Modifiers;
|
||||||
|
|
||||||
|
type Key_Codes_T is array (Natural range <>) of Key_Code_T;
|
||||||
|
|
||||||
|
subtype Ac is Action;
|
||||||
|
type Layout is array (0 .. Num_Layers - 1, RowR, ColR) of Action;
|
||||||
|
procedure Register_Events (L : Layout; Es : Events);
|
||||||
|
procedure Tick (L : Layout);
|
||||||
|
|
||||||
|
function Get_Key_Codes return Key_Codes_T;
|
||||||
|
function Get_Modifiers return Key_Modifiers;
|
||||||
|
procedure Init;
|
||||||
|
end Click;
|
29
tests/syntax-tests/source/Ada/click.gpr
vendored
Normal file
29
tests/syntax-tests/source/Ada/click.gpr
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
with "config/click_config.gpr";
|
||||||
|
project Click is
|
||||||
|
|
||||||
|
for Library_Name use "Click";
|
||||||
|
for Library_Version use Project'Library_Name & ".so." & Click_Config.Crate_Version;
|
||||||
|
|
||||||
|
for Source_Dirs use ("src/", "config/");
|
||||||
|
for Object_Dir use "obj/" & Click_Config.Build_Profile;
|
||||||
|
for Create_Missing_Dirs use "True";
|
||||||
|
for Library_Dir use "lib";
|
||||||
|
|
||||||
|
type Library_Type_Type is ("relocatable", "static", "static-pic");
|
||||||
|
Library_Type : Library_Type_Type :=
|
||||||
|
external ("CLICK_LIBRARY_TYPE", external ("LIBRARY_TYPE", "static"));
|
||||||
|
for Library_Kind use Library_Type;
|
||||||
|
|
||||||
|
package Compiler is
|
||||||
|
for Default_Switches ("Ada") use Click_Config.Ada_Compiler_Switches & ("-gnatX", "-gnat2022");
|
||||||
|
end Compiler;
|
||||||
|
|
||||||
|
package Binder is
|
||||||
|
for Switches ("Ada") use ("-Es"); -- Symbolic traceback
|
||||||
|
end Binder;
|
||||||
|
|
||||||
|
package Install is
|
||||||
|
for Artifacts (".") use ("share");
|
||||||
|
end Install;
|
||||||
|
|
||||||
|
end Click;
|
773
tests/syntax-tests/source/Manpage/fzf-0.33.0.man
vendored
Normal file
773
tests/syntax-tests/source/Manpage/fzf-0.33.0.man
vendored
Normal file
@ -0,0 +1,773 @@
|
|||||||
|
fzf(1) fzf - a command-line fuzzy finder fzf(1)
|
||||||
|
|
||||||
|
NAME
|
||||||
|
fzf - a command-line fuzzy finder
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
fzf [options]
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
fzf is a general-purpose command-line fuzzy finder.
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
Search mode
|
||||||
|
-x, --extended
|
||||||
|
Extended-search mode. Since 0.10.9, this is enabled by default. You can disable it with +x or --no-extended.
|
||||||
|
|
||||||
|
-e, --exact
|
||||||
|
Enable exact-match
|
||||||
|
|
||||||
|
-i Case-insensitive match (default: smart-case match)
|
||||||
|
|
||||||
|
+i Case-sensitive match
|
||||||
|
|
||||||
|
--literal
|
||||||
|
Do not normalize latin script letters for matching.
|
||||||
|
|
||||||
|
--scheme=SCHEME
|
||||||
|
Choose scoring scheme tailored for different types of input.
|
||||||
|
|
||||||
|
default Generic scoring scheme designed to work well with any type of input
|
||||||
|
path Scoring scheme for paths (additional bonus point only after path separator)
|
||||||
|
history Scoring scheme for command history (no additional bonus points).
|
||||||
|
Sets --tiebreak=index as well.
|
||||||
|
|
||||||
|
--algo=TYPE
|
||||||
|
Fuzzy matching algorithm (default: v2)
|
||||||
|
|
||||||
|
v2 Optimal scoring algorithm (quality)
|
||||||
|
v1 Faster but not guaranteed to find the optimal result (performance)
|
||||||
|
|
||||||
|
-n, --nth=N[,..]
|
||||||
|
Comma-separated list of field index expressions for limiting search scope. See FIELD INDEX EXPRESSION for the details.
|
||||||
|
|
||||||
|
--with-nth=N[,..]
|
||||||
|
Transform the presentation of each line using field index expressions
|
||||||
|
|
||||||
|
-d, --delimiter=STR
|
||||||
|
Field delimiter regex for --nth and --with-nth (default: AWK-style)
|
||||||
|
|
||||||
|
--disabled
|
||||||
|
Do not perform search. With this option, fzf becomes a simple selector interface rather than a "fuzzy finder". You can later enable the search using enable-search or toggle-
|
||||||
|
search action.
|
||||||
|
|
||||||
|
Search result
|
||||||
|
+s, --no-sort
|
||||||
|
Do not sort the result
|
||||||
|
|
||||||
|
--tac Reverse the order of the input
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
history | fzf --tac --no-sort
|
||||||
|
|
||||||
|
--tiebreak=CRI[,..]
|
||||||
|
Comma-separated list of sort criteria to apply when the scores are tied.
|
||||||
|
|
||||||
|
length Prefers line with shorter length
|
||||||
|
chunk Prefers line with shorter matched chunk (delimited by whitespaces)
|
||||||
|
begin Prefers line with matched substring closer to the beginning
|
||||||
|
end Prefers line with matched substring closer to the end
|
||||||
|
index Prefers line that appeared earlier in the input stream
|
||||||
|
|
||||||
|
- Each criterion should appear only once in the list
|
||||||
|
- index is only allowed at the end of the list
|
||||||
|
- index is implicitly appended to the list when not specified
|
||||||
|
- Default is length (or equivalently length,index)
|
||||||
|
- If end is found in the list, fzf will scan each line backwards
|
||||||
|
|
||||||
|
Interface
|
||||||
|
-m, --multi
|
||||||
|
Enable multi-select with tab/shift-tab. It optionally takes an integer argument which denotes the maximum number of items that can be selected.
|
||||||
|
|
||||||
|
+m, --no-multi
|
||||||
|
Disable multi-select
|
||||||
|
|
||||||
|
--no-mouse
|
||||||
|
Disable mouse
|
||||||
|
|
||||||
|
--bind=KEYBINDS
|
||||||
|
Comma-separated list of custom key bindings. See KEY/EVENT BINDINGS for the details.
|
||||||
|
|
||||||
|
--cycle
|
||||||
|
Enable cyclic scroll
|
||||||
|
|
||||||
|
--keep-right
|
||||||
|
Keep the right end of the line visible when it's too long. Effective only when the query string is empty.
|
||||||
|
|
||||||
|
--scroll-off=LINES
|
||||||
|
Number of screen lines to keep above or below when scrolling to the top or to the bottom (default: 0).
|
||||||
|
|
||||||
|
--no-hscroll
|
||||||
|
Disable horizontal scroll
|
||||||
|
|
||||||
|
--hscroll-off=COLS
|
||||||
|
Number of screen columns to keep to the right of the highlighted substring (default: 10). Setting it to a large value will cause the text to be positioned on the center of the
|
||||||
|
screen.
|
||||||
|
|
||||||
|
--filepath-word
|
||||||
|
Make word-wise movements and actions respect path separators. The following actions are affected:
|
||||||
|
|
||||||
|
backward-kill-word
|
||||||
|
backward-word
|
||||||
|
forward-word
|
||||||
|
kill-word
|
||||||
|
|
||||||
|
--jump-labels=CHARS
|
||||||
|
Label characters for jump and jump-accept
|
||||||
|
|
||||||
|
Layout
|
||||||
|
--height=HEIGHT[%]
|
||||||
|
Display fzf window below the cursor with the given height instead of using the full screen.
|
||||||
|
|
||||||
|
--min-height=HEIGHT
|
||||||
|
Minimum height when --height is given in percent (default: 10). Ignored when --height is not specified.
|
||||||
|
|
||||||
|
--layout=LAYOUT
|
||||||
|
Choose the layout (default: default)
|
||||||
|
|
||||||
|
default Display from the bottom of the screen
|
||||||
|
reverse Display from the top of the screen
|
||||||
|
reverse-list Display from the top of the screen, prompt at the bottom
|
||||||
|
|
||||||
|
--reverse
|
||||||
|
A synonym for --layout=reverse
|
||||||
|
|
||||||
|
--border[=BORDER_OPT]
|
||||||
|
Draw border around the finder
|
||||||
|
|
||||||
|
rounded Border with rounded corners (default)
|
||||||
|
sharp Border with sharp corners
|
||||||
|
horizontal Horizontal lines above and below the finder
|
||||||
|
vertical Vertical lines on each side of the finder
|
||||||
|
top (up)
|
||||||
|
bottom (down)
|
||||||
|
left
|
||||||
|
right
|
||||||
|
none
|
||||||
|
|
||||||
|
--no-unicode
|
||||||
|
Use ASCII characters instead of Unicode box drawing characters to draw border
|
||||||
|
|
||||||
|
--margin=MARGIN
|
||||||
|
Comma-separated expression for margins around the finder.
|
||||||
|
|
||||||
|
TRBL Same margin for top, right, bottom, and left
|
||||||
|
TB,RL Vertical, horizontal margin
|
||||||
|
T,RL,B Top, horizontal, bottom margin
|
||||||
|
T,R,B,L Top, right, bottom, left margin
|
||||||
|
|
||||||
|
Each part can be given in absolute number or in percentage relative to the terminal size with % suffix.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --margin 10%
|
||||||
|
fzf --margin 1,5%
|
||||||
|
|
||||||
|
--padding=PADDING
|
||||||
|
Comma-separated expression for padding inside the border. Padding is distinguishable from margin only when --border option is used.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --margin 5% --padding 5% --border --preview 'cat {}' \
|
||||||
|
--color bg:#222222,preview-bg:#333333
|
||||||
|
|
||||||
|
TRBL Same padding for top, right, bottom, and left
|
||||||
|
TB,RL Vertical, horizontal padding
|
||||||
|
T,RL,B Top, horizontal, bottom padding
|
||||||
|
T,R,B,L Top, right, bottom, left padding
|
||||||
|
|
||||||
|
--info=STYLE
|
||||||
|
Determines the display style of finder info.
|
||||||
|
|
||||||
|
default Display on the next line to the prompt
|
||||||
|
inline Display on the same line
|
||||||
|
hidden Do not display finder info
|
||||||
|
|
||||||
|
--no-info
|
||||||
|
A synonym for --info=hidden
|
||||||
|
|
||||||
|
--prompt=STR
|
||||||
|
Input prompt (default: '> ')
|
||||||
|
|
||||||
|
--pointer=STR
|
||||||
|
Pointer to the current line (default: '>')
|
||||||
|
|
||||||
|
--marker=STR
|
||||||
|
Multi-select marker (default: '>')
|
||||||
|
|
||||||
|
--header=STR
|
||||||
|
The given string will be printed as the sticky header. The lines are displayed in the given order from top to bottom regardless of --layout option, and are not affected by
|
||||||
|
--with-nth. ANSI color codes are processed even when --ansi is not set.
|
||||||
|
|
||||||
|
--header-lines=N
|
||||||
|
The first N lines of the input are treated as the sticky header. When --with-nth is set, the lines are transformed just like the other lines that follow.
|
||||||
|
|
||||||
|
--header-first
|
||||||
|
Print header before the prompt line
|
||||||
|
|
||||||
|
--ellipsis=STR
|
||||||
|
Ellipsis to show when line is truncated (default: '..')
|
||||||
|
|
||||||
|
Display
|
||||||
|
--ansi Enable processing of ANSI color codes
|
||||||
|
|
||||||
|
--tabstop=SPACES
|
||||||
|
Number of spaces for a tab character (default: 8)
|
||||||
|
|
||||||
|
--color=[BASE_SCHEME][,COLOR_NAME[:ANSI_COLOR][:ANSI_ATTRIBUTES]]...
|
||||||
|
Color configuration. The name of the base color scheme is followed by custom color mappings.
|
||||||
|
|
||||||
|
BASE SCHEME:
|
||||||
|
(default: dark on 256-color terminal, otherwise 16)
|
||||||
|
|
||||||
|
dark Color scheme for dark 256-color terminal
|
||||||
|
light Color scheme for light 256-color terminal
|
||||||
|
16 Color scheme for 16-color terminal
|
||||||
|
bw No colors (equivalent to --no-color)
|
||||||
|
|
||||||
|
COLOR NAMES:
|
||||||
|
fg Text
|
||||||
|
bg Background
|
||||||
|
preview-fg Preview window text
|
||||||
|
preview-bg Preview window background
|
||||||
|
hl Highlighted substrings
|
||||||
|
fg+ Text (current line)
|
||||||
|
bg+ Background (current line)
|
||||||
|
gutter Gutter on the left (defaults to bg+)
|
||||||
|
hl+ Highlighted substrings (current line)
|
||||||
|
query Query string
|
||||||
|
disabled Query string when search is disabled
|
||||||
|
info Info line (match counters)
|
||||||
|
border Border around the window (--border and --preview)
|
||||||
|
prompt Prompt
|
||||||
|
pointer Pointer to the current line
|
||||||
|
marker Multi-select marker
|
||||||
|
spinner Streaming input indicator
|
||||||
|
header Header
|
||||||
|
|
||||||
|
ANSI COLORS:
|
||||||
|
-1 Default terminal foreground/background color
|
||||||
|
(or the original color of the text)
|
||||||
|
0 ~ 15 16 base colors
|
||||||
|
black
|
||||||
|
red
|
||||||
|
green
|
||||||
|
yellow
|
||||||
|
blue
|
||||||
|
magenta
|
||||||
|
cyan
|
||||||
|
white
|
||||||
|
bright-black (gray | grey)
|
||||||
|
bright-red
|
||||||
|
bright-green
|
||||||
|
bright-yellow
|
||||||
|
bright-blue
|
||||||
|
bright-magenta
|
||||||
|
bright-cyan
|
||||||
|
bright-white
|
||||||
|
16 ~ 255 ANSI 256 colors
|
||||||
|
#rrggbb 24-bit colors
|
||||||
|
|
||||||
|
ANSI ATTRIBUTES: (Only applies to foreground colors)
|
||||||
|
regular Clears previously set attributes; should precede the other ones
|
||||||
|
bold
|
||||||
|
underline
|
||||||
|
reverse
|
||||||
|
dim
|
||||||
|
italic
|
||||||
|
strikethrough
|
||||||
|
|
||||||
|
EXAMPLES:
|
||||||
|
|
||||||
|
# Seoul256 theme with 8-bit colors
|
||||||
|
# (https://github.com/junegunn/seoul256.vim)
|
||||||
|
fzf --color='bg:237,bg+:236,info:143,border:240,spinner:108' \
|
||||||
|
--color='hl:65,fg:252,header:65,fg+:252' \
|
||||||
|
--color='pointer:161,marker:168,prompt:110,hl+:108'
|
||||||
|
|
||||||
|
# Seoul256 theme with 24-bit colors
|
||||||
|
fzf --color='bg:#4B4B4B,bg+:#3F3F3F,info:#BDBB72,border:#6B6B6B,spinner:#98BC99' \
|
||||||
|
--color='hl:#719872,fg:#D9D9D9,header:#719872,fg+:#D9D9D9' \
|
||||||
|
--color='pointer:#E12672,marker:#E17899,prompt:#98BEDE,hl+:#98BC99'
|
||||||
|
|
||||||
|
--no-bold
|
||||||
|
Do not use bold text
|
||||||
|
|
||||||
|
--black
|
||||||
|
Use black background
|
||||||
|
|
||||||
|
History
|
||||||
|
--history=HISTORY_FILE
|
||||||
|
Load search history from the specified file and update the file on completion. When enabled, CTRL-N and CTRL-P are automatically remapped to next-history and previous-history.
|
||||||
|
|
||||||
|
--history-size=N
|
||||||
|
Maximum number of entries in the history file (default: 1000). The file is automatically truncated when the number of the lines exceeds the value.
|
||||||
|
|
||||||
|
Preview
|
||||||
|
--preview=COMMAND
|
||||||
|
Execute the given command for the current line and display the result on the preview window. {} in the command is the placeholder that is replaced to the single-quoted string of
|
||||||
|
the current line. To transform the replacement string, specify field index expressions between the braces (See FIELD INDEX EXPRESSION for the details).
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --preview='head -$LINES {}'
|
||||||
|
ls -l | fzf --preview="echo user={3} when={-4..-2}; cat {-1}" --header-lines=1
|
||||||
|
|
||||||
|
fzf exports $FZF_PREVIEW_LINES and $FZF_PREVIEW_COLUMNS so that they represent the exact size of the preview window. (It also overrides $LINES and $COLUMNS with the same values
|
||||||
|
but they can be reset by the default shell, so prefer to refer to the ones with FZF_PREVIEW_ prefix.)
|
||||||
|
|
||||||
|
A placeholder expression starting with + flag will be replaced to the space-separated list of the selected lines (or the current line if no selection was made) individually
|
||||||
|
quoted.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --multi --preview='head -10 {+}'
|
||||||
|
git log --oneline | fzf --multi --preview 'git show {+1}'
|
||||||
|
|
||||||
|
When using a field index expression, leading and trailing whitespace is stripped from the replacement string. To preserve the whitespace, use the s flag.
|
||||||
|
|
||||||
|
Also, {q} is replaced to the current query string, and {n} is replaced to zero-based ordinal index of the line. Use {+n} if you want all index numbers when multiple lines are
|
||||||
|
selected.
|
||||||
|
|
||||||
|
A placeholder expression with f flag is replaced to the path of a temporary file that holds the evaluated list. This is useful when you multi-select a large number of items and
|
||||||
|
the length of the evaluated string may exceed ARG_MAX.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
# Press CTRL-A to select 100K items and see the sum of all the numbers.
|
||||||
|
# This won't work properly without 'f' flag due to ARG_MAX limit.
|
||||||
|
seq 100000 | fzf --multi --bind ctrl-a:select-all \
|
||||||
|
--preview "awk '{sum+=\$1} END {print sum}' {+f}"
|
||||||
|
|
||||||
|
Note that you can escape a placeholder pattern by prepending a backslash.
|
||||||
|
|
||||||
|
Preview window will be updated even when there is no match for the current query if any of the placeholder expressions evaluates to a non-empty string.
|
||||||
|
|
||||||
|
Since 0.24.0, fzf can render partial preview content before the preview command completes. ANSI escape sequence for clearing the display (CSI 2 J) is supported, so you can use
|
||||||
|
it to implement preview window that is constantly updating.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --preview 'for i in $(seq 100000); do
|
||||||
|
(( i % 200 == 0 )) && printf "\033[2J"
|
||||||
|
echo "$i"
|
||||||
|
sleep 0.01
|
||||||
|
done'
|
||||||
|
|
||||||
|
--preview-window=[POSITION][,SIZE[%]][,border-BORDER_OPT][,[no]wrap][,[no]follow][,[no]cycle][,[no]hidden][,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES][,default][,<SIZE_THRESHOLD(ALTER‐
|
||||||
|
NATIVE_LAYOUT)]
|
||||||
|
|
||||||
|
POSITION: (default: right)
|
||||||
|
up
|
||||||
|
down
|
||||||
|
left
|
||||||
|
right
|
||||||
|
|
||||||
|
Determines the layout of the preview window.
|
||||||
|
|
||||||
|
* If the argument contains :hidden, the preview window will be hidden by default until toggle-preview action is triggered.
|
||||||
|
|
||||||
|
* If size is given as 0, preview window will not be visible, but fzf will still execute the command in the background.
|
||||||
|
|
||||||
|
* Long lines are truncated by default. Line wrap can be enabled with wrap flag.
|
||||||
|
|
||||||
|
* Preview window will automatically scroll to the bottom when follow flag is set, similarly to how tail -f works.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --preview-window follow --preview 'for i in $(seq 100000); do
|
||||||
|
echo "$i"
|
||||||
|
sleep 0.01
|
||||||
|
(( i % 300 == 0 )) && printf "\033[2J"
|
||||||
|
done'
|
||||||
|
|
||||||
|
* Cyclic scrolling is enabled with cycle flag.
|
||||||
|
|
||||||
|
* To change the style of the border of the preview window, specify one of the options for --border with border- prefix. e.g. border-rounded (border with rounded edges, de‐
|
||||||
|
fault), border-sharp (border with sharp edges), border-left, border-none, etc.
|
||||||
|
|
||||||
|
* [:+SCROLL[OFFSETS][/DENOM]] determines the initial scroll offset of the preview window.
|
||||||
|
|
||||||
|
- SCROLL can be either a numeric integer or a single-field index expression that refers to a numeric integer.
|
||||||
|
|
||||||
|
- The optional OFFSETS part is for adjusting the base offset. It should be given as a series of signed integers (-INTEGER or +INTEGER).
|
||||||
|
|
||||||
|
- The final /DENOM part is for specifying a fraction of the preview window height.
|
||||||
|
|
||||||
|
* ~HEADER_LINES keeps the top N lines as the fixed header so that they are always visible.
|
||||||
|
|
||||||
|
* default resets all options previously set to the default.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
# Non-default scroll window positions and sizes
|
||||||
|
fzf --preview="head {}" --preview-window=up,30%
|
||||||
|
fzf --preview="file {}" --preview-window=down,1
|
||||||
|
|
||||||
|
# Initial scroll offset is set to the line number of each line of
|
||||||
|
# git grep output *minus* 5 lines (-5)
|
||||||
|
git grep --line-number '' |
|
||||||
|
fzf --delimiter : --preview 'nl {1}' --preview-window '+{2}-5'
|
||||||
|
|
||||||
|
# Preview with bat, matching line in the middle of the window below
|
||||||
|
# the fixed header of the top 3 lines
|
||||||
|
#
|
||||||
|
# ~3 Top 3 lines as the fixed header
|
||||||
|
# +{2} Base scroll offset extracted from the second field
|
||||||
|
# +3 Extra offset to compensate for the 3-line header
|
||||||
|
# /2 Put in the middle of the preview area
|
||||||
|
#
|
||||||
|
git grep --line-number '' |
|
||||||
|
fzf --delimiter : \
|
||||||
|
--preview 'bat --style=full --color=always --highlight-line {2} {1}' \
|
||||||
|
--preview-window '~3,+{2}+3/2'
|
||||||
|
|
||||||
|
# Display top 3 lines as the fixed header
|
||||||
|
fzf --preview 'bat --style=full --color=always {}' --preview-window '~3'
|
||||||
|
|
||||||
|
* You can specify an alternative set of options that are used only when the size
|
||||||
|
of the preview window is below a certain threshold. Note that only one
|
||||||
|
alternative layout is allowed.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --preview 'cat {}' --preview-window 'right,border-left,<30(up,30%,border-bottom)'
|
||||||
|
|
||||||
|
Scripting
|
||||||
|
-q, --query=STR
|
||||||
|
Start the finder with the given query
|
||||||
|
|
||||||
|
-1, --select-1
|
||||||
|
If there is only one match for the initial query (--query), do not start interactive finder and automatically select the only match
|
||||||
|
|
||||||
|
-0, --exit-0
|
||||||
|
If there is no match for the initial query (--query), do not start interactive finder and exit immediately
|
||||||
|
|
||||||
|
-f, --filter=STR
|
||||||
|
Filter mode. Do not start interactive finder. When used with --no-sort, fzf becomes a fuzzy-version of grep.
|
||||||
|
|
||||||
|
--print-query
|
||||||
|
Print query as the first line
|
||||||
|
|
||||||
|
--expect=KEY[,..]
|
||||||
|
Comma-separated list of keys that can be used to complete fzf in addition to the default enter key. When this option is set, fzf will print the name of the key pressed as the
|
||||||
|
first line of its output (or as the second line if --print-query is also used). The line will be empty if fzf is completed with the default enter key. If --expect option is
|
||||||
|
specified multiple times, fzf will expect the union of the keys. --no-expect will clear the list.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --expect=ctrl-v,ctrl-t,alt-s --expect=f1,f2,~,@
|
||||||
|
|
||||||
|
--read0
|
||||||
|
Read input delimited by ASCII NUL characters instead of newline characters
|
||||||
|
|
||||||
|
--print0
|
||||||
|
Print output delimited by ASCII NUL characters instead of newline characters
|
||||||
|
|
||||||
|
--no-clear
|
||||||
|
Do not clear finder interface on exit. If fzf was started in full screen mode, it will not switch back to the original screen, so you'll have to manually run tput rmcup to re‐
|
||||||
|
turn. This option can be used to avoid flickering of the screen when your application needs to start fzf multiple times in order.
|
||||||
|
|
||||||
|
--sync Synchronous search for multi-staged filtering. If specified, fzf will launch ncurses finder only after the input stream is complete.
|
||||||
|
|
||||||
|
e.g. fzf --multi | fzf --sync
|
||||||
|
|
||||||
|
--version
|
||||||
|
Display version information and exit
|
||||||
|
|
||||||
|
Note that most options have the opposite versions with --no- prefix.
|
||||||
|
|
||||||
|
ENVIRONMENT VARIABLES
|
||||||
|
FZF_DEFAULT_COMMAND
|
||||||
|
Default command to use when input is tty. On *nix systems, fzf runs the command with $SHELL -c if SHELL is set, otherwise with sh -c, so in this case make sure that the command
|
||||||
|
is POSIX-compliant.
|
||||||
|
|
||||||
|
FZF_DEFAULT_OPTS
|
||||||
|
Default options. e.g. export FZF_DEFAULT_OPTS="--extended --cycle"
|
||||||
|
|
||||||
|
EXIT STATUS
|
||||||
|
0 Normal exit
|
||||||
|
1 No match
|
||||||
|
2 Error
|
||||||
|
130 Interrupted with CTRL-C or ESC
|
||||||
|
|
||||||
|
FIELD INDEX EXPRESSION
|
||||||
|
A field index expression can be a non-zero integer or a range expression ([BEGIN]..[END]). --nth and --with-nth take a comma-separated list of field index expressions.
|
||||||
|
|
||||||
|
Examples
|
||||||
|
1 The 1st field
|
||||||
|
2 The 2nd field
|
||||||
|
-1 The last field
|
||||||
|
-2 The 2nd to last field
|
||||||
|
3..5 From the 3rd field to the 5th field
|
||||||
|
2.. From the 2nd field to the last field
|
||||||
|
..-3 From the 1st field to the 3rd to the last field
|
||||||
|
.. All the fields
|
||||||
|
|
||||||
|
EXTENDED SEARCH MODE
|
||||||
|
Unless specified otherwise, fzf will start in "extended-search mode". In this mode, you can specify multiple patterns delimited by spaces, such as: 'wild ^music .mp3$ sbtrkt !rmx
|
||||||
|
|
||||||
|
You can prepend a backslash to a space (\ ) to match a literal space character.
|
||||||
|
|
||||||
|
Exact-match (quoted)
|
||||||
|
A term that is prefixed by a single-quote character (') is interpreted as an "exact-match" (or "non-fuzzy") term. fzf will search for the exact occurrences of the string.
|
||||||
|
|
||||||
|
Anchored-match
|
||||||
|
A term can be prefixed by ^, or suffixed by $ to become an anchored-match term. Then fzf will search for the lines that start with or end with the given string. An anchored-match term
|
||||||
|
is also an exact-match term.
|
||||||
|
|
||||||
|
Negation
|
||||||
|
If a term is prefixed by !, fzf will exclude the lines that satisfy the term from the result. In this case, fzf performs exact match by default.
|
||||||
|
|
||||||
|
Exact-match by default
|
||||||
|
If you don't prefer fuzzy matching and do not wish to "quote" (prefixing with ') every word, start fzf with -e or --exact option. Note that when --exact is set, '-prefix "unquotes" the
|
||||||
|
term.
|
||||||
|
|
||||||
|
OR operator
|
||||||
|
A single bar character term acts as an OR operator. For example, the following query matches entries that start with core and end with either go, rb, or py.
|
||||||
|
|
||||||
|
e.g. ^core go$ | rb$ | py$
|
||||||
|
|
||||||
|
KEY/EVENT BINDINGS
|
||||||
|
--bind option allows you to bind a key or an event to one or more actions. You can use it to customize key bindings or implement dynamic behaviors.
|
||||||
|
|
||||||
|
--bind takes a comma-separated list of binding expressions. Each binding expression is KEY:ACTION or EVENT:ACTION.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --bind=ctrl-j:accept,ctrl-k:kill-line
|
||||||
|
|
||||||
|
AVAILABLE KEYS: (SYNONYMS)
|
||||||
|
ctrl-[a-z]
|
||||||
|
ctrl-space
|
||||||
|
ctrl-\
|
||||||
|
ctrl-]
|
||||||
|
ctrl-^ (ctrl-6)
|
||||||
|
ctrl-/ (ctrl-_)
|
||||||
|
ctrl-alt-[a-z]
|
||||||
|
alt-[*] (Any case-sensitive single character is allowed)
|
||||||
|
f[1-12]
|
||||||
|
enter (return ctrl-m)
|
||||||
|
space
|
||||||
|
bspace (bs)
|
||||||
|
alt-up
|
||||||
|
alt-down
|
||||||
|
alt-left
|
||||||
|
alt-right
|
||||||
|
alt-enter
|
||||||
|
alt-space
|
||||||
|
alt-bspace (alt-bs)
|
||||||
|
tab
|
||||||
|
btab (shift-tab)
|
||||||
|
esc
|
||||||
|
del
|
||||||
|
up
|
||||||
|
down
|
||||||
|
left
|
||||||
|
right
|
||||||
|
home
|
||||||
|
end
|
||||||
|
insert
|
||||||
|
pgup (page-up)
|
||||||
|
pgdn (page-down)
|
||||||
|
shift-up
|
||||||
|
shift-down
|
||||||
|
shift-left
|
||||||
|
shift-right
|
||||||
|
alt-shift-up
|
||||||
|
alt-shift-down
|
||||||
|
alt-shift-left
|
||||||
|
alt-shift-right
|
||||||
|
left-click
|
||||||
|
right-click
|
||||||
|
double-click
|
||||||
|
or any single character
|
||||||
|
|
||||||
|
AVAILABLE EVENTS:
|
||||||
|
change
|
||||||
|
Triggered whenever the query string is changed
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
# Move cursor to the first entry whenever the query is changed
|
||||||
|
fzf --bind change:first
|
||||||
|
|
||||||
|
backward-eof
|
||||||
|
Triggered when the query string is already empty and you try to delete it backward.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --bind backward-eof:abort
|
||||||
|
|
||||||
|
AVAILABLE ACTIONS:
|
||||||
|
A key or an event can be bound to one or more of the following actions.
|
||||||
|
|
||||||
|
ACTION: DEFAULT BINDINGS (NOTES):
|
||||||
|
abort ctrl-c ctrl-g ctrl-q esc
|
||||||
|
accept enter double-click
|
||||||
|
accept-non-empty (same as accept except that it prevents fzf from exiting without selection)
|
||||||
|
backward-char ctrl-b left
|
||||||
|
backward-delete-char ctrl-h bspace
|
||||||
|
backward-delete-char/eof (same as backward-delete-char except aborts fzf if query is empty)
|
||||||
|
backward-kill-word alt-bs
|
||||||
|
backward-word alt-b shift-left
|
||||||
|
beginning-of-line ctrl-a home
|
||||||
|
cancel (clear query string if not empty, abort fzf otherwise)
|
||||||
|
change-preview(...) (change --preview option)
|
||||||
|
change-preview-window(...) (change --preview-window option; rotate through the multiple option sets separated by '|')
|
||||||
|
change-prompt(...) (change prompt to the given string)
|
||||||
|
clear-screen ctrl-l
|
||||||
|
clear-selection (clear multi-selection)
|
||||||
|
close (close preview window if open, abort fzf otherwise)
|
||||||
|
clear-query (clear query string)
|
||||||
|
delete-char del
|
||||||
|
delete-char/eof ctrl-d (same as delete-char except aborts fzf if query is empty)
|
||||||
|
deselect
|
||||||
|
deselect-all (deselect all matches)
|
||||||
|
disable-search (disable search functionality)
|
||||||
|
down ctrl-j ctrl-n down
|
||||||
|
enable-search (enable search functionality)
|
||||||
|
end-of-line ctrl-e end
|
||||||
|
execute(...) (see below for the details)
|
||||||
|
execute-silent(...) (see below for the details)
|
||||||
|
first (move to the first match)
|
||||||
|
forward-char ctrl-f right
|
||||||
|
forward-word alt-f shift-right
|
||||||
|
ignore
|
||||||
|
jump (EasyMotion-like 2-keystroke movement)
|
||||||
|
jump-accept (jump and accept)
|
||||||
|
kill-line
|
||||||
|
kill-word alt-d
|
||||||
|
last (move to the last match)
|
||||||
|
next-history (ctrl-n on --history)
|
||||||
|
page-down pgdn
|
||||||
|
page-up pgup
|
||||||
|
half-page-down
|
||||||
|
half-page-up
|
||||||
|
preview(...) (see below for the details)
|
||||||
|
preview-down shift-down
|
||||||
|
preview-up shift-up
|
||||||
|
preview-page-down
|
||||||
|
preview-page-up
|
||||||
|
preview-half-page-down
|
||||||
|
preview-half-page-up
|
||||||
|
preview-bottom
|
||||||
|
preview-top
|
||||||
|
previous-history (ctrl-p on --history)
|
||||||
|
print-query (print query and exit)
|
||||||
|
put (put the character to the prompt)
|
||||||
|
refresh-preview
|
||||||
|
rebind(...) (rebind bindings after unbind)
|
||||||
|
reload(...) (see below for the details)
|
||||||
|
replace-query (replace query string with the current selection)
|
||||||
|
select
|
||||||
|
select-all (select all matches)
|
||||||
|
toggle (right-click)
|
||||||
|
toggle-all (toggle all matches)
|
||||||
|
toggle+down ctrl-i (tab)
|
||||||
|
toggle-in (--layout=reverse* ? toggle+up : toggle+down)
|
||||||
|
toggle-out (--layout=reverse* ? toggle+down : toggle+up)
|
||||||
|
toggle-preview
|
||||||
|
toggle-preview-wrap
|
||||||
|
toggle-search (toggle search functionality)
|
||||||
|
toggle-sort
|
||||||
|
toggle+up btab (shift-tab)
|
||||||
|
unbind(...) (unbind bindings)
|
||||||
|
unix-line-discard ctrl-u
|
||||||
|
unix-word-rubout ctrl-w
|
||||||
|
up ctrl-k ctrl-p up
|
||||||
|
yank ctrl-y
|
||||||
|
|
||||||
|
ACTION COMPOSITION
|
||||||
|
Multiple actions can be chained using + separator.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --multi --bind 'ctrl-a:select-all+accept'
|
||||||
|
fzf --multi --bind 'ctrl-a:select-all' --bind 'ctrl-a:+accept'
|
||||||
|
|
||||||
|
ACTION ARGUMENT
|
||||||
|
An action denoted with (...) suffix takes an argument.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
fzf --bind 'ctrl-a:change-prompt(NewPrompt> )'
|
||||||
|
fzf --bind 'ctrl-v:preview(cat {})' --preview-window hidden
|
||||||
|
|
||||||
|
If the argument contains parentheses, fzf may fail to parse the expression. In that case, you can use any of the following alternative notations to avoid parse errors.
|
||||||
|
|
||||||
|
action-name[...]
|
||||||
|
action-name~...~
|
||||||
|
action-name!...!
|
||||||
|
action-name@...@
|
||||||
|
action-name#...#
|
||||||
|
action-name$...$
|
||||||
|
action-name%...%
|
||||||
|
action-name^...^
|
||||||
|
action-name&...&
|
||||||
|
action-name*...*
|
||||||
|
action-name;...;
|
||||||
|
action-name/.../
|
||||||
|
action-name|...|
|
||||||
|
action-name:...
|
||||||
|
The last one is the special form that frees you from parse errors as it does not expect the closing character. The catch is that it should be the last one in the comma-separated
|
||||||
|
list of key-action pairs.
|
||||||
|
|
||||||
|
COMMAND EXECUTION
|
||||||
|
With execute(...) action, you can execute arbitrary commands without leaving fzf. For example, you can turn fzf into a simple file browser by binding enter key to less command like
|
||||||
|
follows.
|
||||||
|
|
||||||
|
fzf --bind "enter:execute(less {})"
|
||||||
|
|
||||||
|
You can use the same placeholder expressions as in --preview.
|
||||||
|
|
||||||
|
fzf switches to the alternate screen when executing a command. However, if the command is expected to complete quickly, and you are not interested in its output, you might want to use
|
||||||
|
execute-silent instead, which silently executes the command without the switching. Note that fzf will not be responsive until the command is complete. For asynchronous execution, start
|
||||||
|
your command as a background process (i.e. appending &).
|
||||||
|
|
||||||
|
On *nix systems, fzf runs the command with $SHELL -c if SHELL is set, otherwise with sh -c, so in this case make sure that the command is POSIX-compliant.
|
||||||
|
|
||||||
|
RELOAD INPUT
|
||||||
|
reload(...) action is used to dynamically update the input list without restarting fzf. It takes the same command template with placeholder expressions as execute(...).
|
||||||
|
|
||||||
|
See https://github.com/junegunn/fzf/issues/1750 for more info.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
# Update the list of processes by pressing CTRL-R
|
||||||
|
ps -ef | fzf --bind 'ctrl-r:reload(ps -ef)' --header 'Press CTRL-R to reload' \
|
||||||
|
--header-lines=1 --layout=reverse
|
||||||
|
|
||||||
|
# Integration with ripgrep
|
||||||
|
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
|
||||||
|
INITIAL_QUERY="foobar"
|
||||||
|
FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \
|
||||||
|
fzf --bind "change:reload:$RG_PREFIX {q} || true" \
|
||||||
|
--ansi --disabled --query "$INITIAL_QUERY"
|
||||||
|
|
||||||
|
PREVIEW BINDING
|
||||||
|
With preview(...) action, you can specify multiple different preview commands in addition to the default preview command given by --preview option.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
# Default preview command with an extra preview binding
|
||||||
|
fzf --preview 'file {}' --bind '?:preview:cat {}'
|
||||||
|
|
||||||
|
# A preview binding with no default preview command
|
||||||
|
# (Preview window is initially empty)
|
||||||
|
fzf --bind '?:preview:cat {}'
|
||||||
|
|
||||||
|
# Preview window hidden by default, it appears when you first hit '?'
|
||||||
|
fzf --bind '?:preview:cat {}' --preview-window hidden
|
||||||
|
|
||||||
|
CHANGE PREVIEW WINDOW ATTRIBUTES
|
||||||
|
change-preview-window action can be used to change the properties of the preview window. Unlike the --preview-window option, you can specify multiple sets of options separated by '|'
|
||||||
|
characters.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
# Rotate through the options using CTRL-/
|
||||||
|
fzf --preview 'cat {}' --bind 'ctrl-/:change-preview-window(right,70%|down,40%,border-horizontal|hidden|right)'
|
||||||
|
|
||||||
|
# The default properties given by `--preview-window` are inherited, so an empty string in the list is interpreted as the default
|
||||||
|
fzf --preview 'cat {}' --preview-window 'right,40%,border-left' --bind 'ctrl-/:change-preview-window(70%|down,border-top|hidden|)'
|
||||||
|
|
||||||
|
# This is equivalent to toggle-preview action
|
||||||
|
fzf --preview 'cat {}' --bind 'ctrl-/:change-preview-window(hidden|)'
|
||||||
|
|
||||||
|
AUTHOR
|
||||||
|
Junegunn Choi (junegunn.c@gmail.com)
|
||||||
|
|
||||||
|
SEE ALSO
|
||||||
|
Project homepage:
|
||||||
|
https://github.com/junegunn/fzf
|
||||||
|
|
||||||
|
Extra Vim plugin:
|
||||||
|
https://github.com/junegunn/fzf.vim
|
||||||
|
|
||||||
|
LICENSE
|
||||||
|
MIT
|
||||||
|
|
||||||
|
fzf 0.33.0 Aug 2022 fzf(1)
|
Loading…
Reference in New Issue
Block a user