fix typos and spelling errors
This commit is contained in:
parent
66bc692ab3
commit
d98b16680c
1 changed files with 45 additions and 45 deletions
90
README.md
90
README.md
|
@ -3,8 +3,8 @@
|
||||||
[![GitHub release][1]][2] [![GitHub Release Date][3]][4]
|
[![GitHub release][1]][2] [![GitHub Release Date][3]][4]
|
||||||
![Github commits (since latest release)][5] ![license][6]
|
![Github commits (since latest release)][5] ![license][6]
|
||||||
|
|
||||||
**fzf.kak** is a plugin for [Kakoune][7] editor, that provides integration with the [fzf][8] tool.
|
fzf.kak is a plugin for [Kakoune][7] editor, that provides integration with the [fzf][8] tool.
|
||||||
There's also a limited support for [skim][9], which can be enabled by changing `fzf_implementation` option.
|
There's also limited support for [skim][9], which can be enabled by changing the `fzf_implementation` option.
|
||||||
|
|
||||||
![showcase][10]
|
![showcase][10]
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ There's also a limited support for [skim][9], which can be enabled by changing `
|
||||||
|
|
||||||
### With [plug.kak][11]
|
### With [plug.kak][11]
|
||||||
|
|
||||||
The recommended way to install **fzf.kak** is to use plug.kak plugin manager.
|
The recommended way to install fzf.kak is to use a plug.kak plugin manager.
|
||||||
To install **fzf.kak** add this to the `kakrc`:
|
To install fzf.kak add this to the `kakrc`:
|
||||||
|
|
||||||
``` kak
|
``` kak
|
||||||
plug "andreyorst/fzf.kak"
|
plug "andreyorst/fzf.kak"
|
||||||
|
@ -26,15 +26,15 @@ Then reload the configuration file or restart Kakoune and run `:plug-install`.
|
||||||
|
|
||||||
### Without plugin manager
|
### Without plugin manager
|
||||||
|
|
||||||
This plugin consists of several parts which are referred here as "modules".
|
This plugin consists of several parts which are referred to as "modules".
|
||||||
So, for plugin to work the base module must be loaded:
|
So, for the plugin to work the base module must be loaded:
|
||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
source "/path/to/fzf.kak/rc/fzf.kak" # loading base fzf module
|
source "/path/to/fzf.kak/rc/fzf.kak" # loading base fzf module
|
||||||
```
|
```
|
||||||
|
|
||||||
This module doesn't do anything on it's own.
|
This module doesn't do anything on its own.
|
||||||
Each module in the `modules` directory provides features that extend base `fzf` module with new commands and mappings.
|
Each module in the `modules` directory provides features that extend the base `fzf` module with new commands and mappings.
|
||||||
Those can be loaded manually one by one the same way as the base module, or with the use of the `find` command:
|
Those can be loaded manually one by one the same way as the base module, or with the use of the `find` command:
|
||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
|
@ -46,7 +46,7 @@ evaluate-commands %sh{
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
**fzf.kak** provides a `fzf-mode` command that can be mapped to preferred key:
|
fzf.kak provides a `fzf-mode` command that can be mapped to preferred key:
|
||||||
|
|
||||||
```kak
|
```kak
|
||||||
map global normal <c-p> ': fzf-mode<ret>'
|
map global normal <c-p> ': fzf-mode<ret>'
|
||||||
|
@ -67,16 +67,16 @@ If all modules were loaded, the following mappings are available:
|
||||||
- <kbd>p</kbd> - Project selector.
|
- <kbd>p</kbd> - Project selector.
|
||||||
- <kbd>Alt</kbd>+<kbd>p</kbd> - Project related commands.
|
- <kbd>Alt</kbd>+<kbd>p</kbd> - Project related commands.
|
||||||
|
|
||||||
When Kakoune runs inside Tmux, **fzf.kak** will use bottom split to display `fzf` window.
|
When Kakoune runs inside Tmux, fzf.kak will use the bottom split to display the `fzf` window.
|
||||||
Additional keybindings are also made available to open file in vertical or horizontal split.
|
Additional keybindings are also made available to open files in a vertical or horizontal split.
|
||||||
Otherwise, the `terminal` command is being used to create new windows.
|
Otherwise, the `terminal` command is being used to create new windows.
|
||||||
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
**fzf.kak** features a lot of settings via options that can be altered to change how **fzf.kak** behaves.
|
fzf.kak features a lot of settings via options that can be altered to change how fzf.kak behaves.
|
||||||
Each `.kak` file provides a Kakoune module, so any settings which alter variable values should be wrapped in `ModuleLoaded` hook.
|
Each `.kak` file provides a Kakoune module, so any settings which alter variable values should be wrapped in the `ModuleLoaded` hook.
|
||||||
See [plug.kak manual section for `defer`](https://github.com/andreyorst/plug.kak/tree/master#deferring-plugin-configuration) that explains how to do this when using plug.kak.
|
See [plug.kak manual section for `defer`](https://github.com/andreyorst/plug.kak/tree/master#deferring-plugin-configuration) that explains how to do this when using the plug.kak.
|
||||||
|
|
||||||
|
|
||||||
### Default query
|
### Default query
|
||||||
|
@ -85,7 +85,7 @@ See [plug.kak manual section for `defer`](https://github.com/andreyorst/plug.kak
|
||||||
|--------|
|
|--------|
|
||||||
| `fzf` |
|
| `fzf` |
|
||||||
|
|
||||||
By default main selection is used as the default query for `fzf`, but only if the selection more than 1 character long.
|
By default main selection is used as the default query for `fzf`, but only if the selection is more than 1 character long.
|
||||||
This can be disabled by setting `fzf_use_main_selection` to `false`.
|
This can be disabled by setting `fzf_use_main_selection` to `false`.
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ This can be disabled by setting `fzf_use_main_selection` to `false`.
|
||||||
| `fzf` |
|
| `fzf` |
|
||||||
|
|
||||||
When using Tmux fzf.kak automatically creates all needed Tmux splits and panes for you.
|
When using Tmux fzf.kak automatically creates all needed Tmux splits and panes for you.
|
||||||
In other cases **fzf.kak** uses `fzf_terminal_command` option to call windowing command to create new windows.
|
In other cases fzf.kak uses the `fzf_terminal_command` option to call the windowing command to create new windows.
|
||||||
By default it is set to use `terminal` alias: `terminal kak -c %val{session} -e "%arg{@}"`, but some terminals can provide other aliases or commands, like `terminal-tab` in Kitty.
|
By default it is set to use `terminal` alias: `terminal kak -c %val{session} -e "%arg{@}"`, but some terminals can provide other aliases or commands, like `terminal-tab` in Kitty.
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ By default it is set to use `terminal` alias: `terminal kak -c %val{session} -e
|
||||||
|
|
||||||
Keys that are used in the `fzf` window can be configured with these options:
|
Keys that are used in the `fzf` window can be configured with these options:
|
||||||
|
|
||||||
- `fzf_window_map` - mapping to perform an action in new window,
|
- `fzf_window_map` - mapping to perform an action in a new window,
|
||||||
- `fzf_vertical_map` - mapping to perform an action in new vertical split (Tmux),
|
- `fzf_vertical_map` - mapping to perform an action in new vertical split (Tmux),
|
||||||
- `fzf_horizontal_map` - mapping to perform an action in new horizontal split.
|
- `fzf_horizontal_map` - mapping to perform an action in new horizontal split.
|
||||||
|
|
||||||
|
@ -121,16 +121,16 @@ These options should be set to work with fzf `--expect` parameter, so check out
|
||||||
|------------|
|
|------------|
|
||||||
| `fzf-file` |
|
| `fzf-file` |
|
||||||
|
|
||||||
A command that is used to search for files and it's arguments can be configured by changing the value of `fzf_file_command` variable, that is available in the `fzf-file` module.
|
A command that is used to search for files and their arguments can be configured by changing the value of the `fzf_file_command` variable, which is available in the `fzf-file` module.
|
||||||
|
|
||||||
Supported tools are [GNU Find][12], [The Silver Searcher][13], [ripgrep][14], [fd][15].
|
Supported tools are [GNU Find][12], [The Silver Searcher][13], [ripgrep][14], [fd][15].
|
||||||
Default set of arguments is provided for each of these searchers, only the name of the tool can be assigned to the `fzf_file_command` variable:
|
A default set of arguments is provided for each of these searchers, only the name of the tool can be assigned to the `fzf_file_command` variable:
|
||||||
|
|
||||||
```kak
|
```kak
|
||||||
set-option global fzf_file_command 'rg' # 'ag', 'fd', or 'find'
|
set-option global fzf_file_command 'rg' # 'ag', 'fd', or 'find'
|
||||||
```
|
```
|
||||||
|
|
||||||
Default arguments can be changing by setting the complete command to execute:
|
Default arguments can be changed by setting the complete command to execute:
|
||||||
|
|
||||||
```kak
|
```kak
|
||||||
set-option global fzf_file_command "find . \( -path '*/.svn*' -o -path '*/.git*' \) -prune -o -type f -print"
|
set-option global fzf_file_command "find . \( -path '*/.svn*' -o -path '*/.git*' \) -prune -o -type f -print"
|
||||||
|
@ -143,18 +143,18 @@ set-option global fzf_file_command "find . \( -path '*/.svn*' -o -path '*/.git*'
|
||||||
|------------|
|
|------------|
|
||||||
| `fzf-file` |
|
| `fzf-file` |
|
||||||
|
|
||||||
**fzf.kak** tries to automatically detect where to show preview window, depending on aspect ratio of the new terminal window.
|
fzf.kak tries to automatically detect where to show preview window, depending on the aspect ratio of the new terminal window.
|
||||||
By default if the doubled height is bigger than the width, preview occupies upper 60% of space.
|
By default, if the doubled height is bigger than the width, preview occupies the upper 60% of space.
|
||||||
If height is smaller than the width, preview is shown at the right side.
|
If the height is smaller than the width, a preview is shown on the right side.
|
||||||
These amounts can be configured with `fzf_preview_height` and `fzf_preview_width` options.
|
These amounts can be configured with `fzf_preview_height` and `fzf_preview_width` options.
|
||||||
|
|
||||||
When using **fzf.kak** inside `tmux`, bottom pane is used for all `fzf` commands, and preview window is displayed on the right side.
|
When using fzf.kak inside `tmux`, the bottom pane is used for all `fzf` commands, and the preview window is displayed on the right side.
|
||||||
When preview is turned on, height of `tmux` split is increased to provide more space.
|
When the preview is turned on, the height of the `tmux` split is increased to provide more space.
|
||||||
Split height can be configured with the `fzf_preview_tmux_height` variable.
|
Split height can be configured with the `fzf_preview_tmux_height` variable.
|
||||||
|
|
||||||
Amount of lines in preview window can be changed with `fzf_preview_lines` option.
|
Amount of lines in the preview window can be changed with the `fzf_preview_lines` option.
|
||||||
|
|
||||||
Preview feature can be disabled entirely by setting `fzf_preview` option to `false`.
|
The preview feature can be disabled entirely by setting the `fzf_preview` option to `false`.
|
||||||
|
|
||||||
|
|
||||||
#### Highlighting preview window
|
#### Highlighting preview window
|
||||||
|
@ -163,8 +163,8 @@ Preview feature can be disabled entirely by setting `fzf_preview` option to `fal
|
||||||
|------------|
|
|------------|
|
||||||
| `fzf-file` |
|
| `fzf-file` |
|
||||||
|
|
||||||
Contents of the file displayed within preview window can be syntax highlighted.
|
Contents of the file displayed within the preview window can be syntax highlighted.
|
||||||
This can be enabled by specifying highlighter to use with the `fzf_highlight_command` option.
|
This can be enabled by specifying a highlighter to use with the `fzf_highlight_command` option.
|
||||||
These highlighters are are supported out of the box:
|
These highlighters are are supported out of the box:
|
||||||
|
|
||||||
* [Bat][16]
|
* [Bat][16]
|
||||||
|
@ -172,7 +172,7 @@ These highlighters are are supported out of the box:
|
||||||
* [Highlight][18]
|
* [Highlight][18]
|
||||||
* [Rouge][19]
|
* [Rouge][19]
|
||||||
|
|
||||||
Although other tools are not supported by the script, then should work fine as long as they work with `fzf`.
|
Although other tools are not supported by the script, they should work fine as long as they work with `fzf`.
|
||||||
|
|
||||||
|
|
||||||
### VCS
|
### VCS
|
||||||
|
@ -203,8 +203,8 @@ Feature requests and merge requests are welcome.
|
||||||
| `fzf` |
|
| `fzf` |
|
||||||
|
|
||||||
When running inside Tmux, `fzf` will use bottom split.
|
When running inside Tmux, `fzf` will use bottom split.
|
||||||
Height of this split can be changed with the `fzf_tmux_height` option.
|
The height of this split can be changed with the `fzf_tmux_height` option.
|
||||||
`fzf_tmux_height_file_preview` option is used to control height of the split when file-preview is turned on.
|
`fzf_tmux_height_file_preview` option is used to control the height of the split when file-preview is turned on.
|
||||||
|
|
||||||
|
|
||||||
### Projects
|
### Projects
|
||||||
|
@ -213,11 +213,11 @@ Height of this split can be changed with the `fzf_tmux_height` option.
|
||||||
|---------------|
|
|---------------|
|
||||||
| `fzf-project` |
|
| `fzf-project` |
|
||||||
|
|
||||||
**fzf.kak** has basic project manipulation capabilities.
|
fzf.kak has basic project manipulation capabilities.
|
||||||
|
|
||||||
To store projects a hidden file is created in `%val{config}` and called `.fzf-projects`.
|
To store projects a hidden file is created in `%val{config}` and called `.fzf-projects`.
|
||||||
The location of this file and its name can be changed by modifying the `fzf_project_file` option.
|
The location of this file and its name can be changed by modifying the `fzf_project_file` option.
|
||||||
By default project paths which start from home directory will use `~` instead of read path.
|
By default project paths that start from the home directory will use `~` instead of the real path.
|
||||||
To change this, set `fzf_project_use_tilda` option to `false`.
|
To change this, set `fzf_project_use_tilda` option to `false`.
|
||||||
|
|
||||||
|
|
||||||
|
@ -227,33 +227,33 @@ To change this, set `fzf_project_use_tilda` option to `false`.
|
||||||
The following arguments are supported:
|
The following arguments are supported:
|
||||||
|
|
||||||
- `-kak-cmd`: A Kakoune command that is applied to `fzf` resulting value, e.g. `edit -existing`, `change-directory`, e.t.c.
|
- `-kak-cmd`: A Kakoune command that is applied to `fzf` resulting value, e.g. `edit -existing`, `change-directory`, e.t.c.
|
||||||
- `-multiple-cmd`: A Kakoune command that is applied when multiple items selected to every item but the first one.
|
- `-multiple-cmd`: A Kakoune command that is applied when multiple items are selected to every item but the first one.
|
||||||
- `-items-cmd`: A command that is used as a pipe to provide list of values to `fzf`.
|
- `-items-cmd`: A command that is used as a pipe to provide a list of values to `fzf`.
|
||||||
For example, if we want to pass list of all files recursively in current directory, we would use `-items-cmd %{find .}` which will be piped to `fzf` tool.
|
For example, if we want to pass a list of all files recursively in the current directory, we would use `-items-cmd %{find .}` which will be piped to the `fzf` tool.
|
||||||
- `-fzf-impl`: Override `fzf` implementation variable.
|
- `-fzf-impl`: Override `fzf` implementation variable.
|
||||||
Can be used if command needs to provide a different arguments to `fzf`.
|
Can be used if the command needs to provide different arguments to `fzf`.
|
||||||
See [sk-grep.kak][21] as example.
|
See [sk-grep.kak][21] as example.
|
||||||
- `-fzf-args`: Additional flags for `fzf` program.
|
- `-fzf-args`: Additional flags for `fzf` program.
|
||||||
- `-preview-cmd`: A preview command.
|
- `-preview-cmd`: A preview command.
|
||||||
Can be used to override default preview handling.
|
Can be used to override default preview handling.
|
||||||
- `-preview`: If specified, command will ask for preview.
|
- `-preview`: If specified, the command will ask for a preview.
|
||||||
- `-filter`: A pipe which will be applied to result provided by `fzf`.
|
- `-filter`: A pipe which will be applied to the result provided by `fzf`.
|
||||||
For example, if we are returning such line `3 hello, world!` from `fzf`, and we are interested only in the first field which is `3`, we can use `-filter %{cut -f 1}`.
|
For example, if we are returning such line `3 hello, world!` from `fzf`, and we are interested only in the first field which is `3`, we can use `-filter %{cut -f 1}`.
|
||||||
Basically everything what `fzf` returns is piped to this filter command.
|
Basically, everything that `fzf` returns is piped to this filter command.
|
||||||
See [fzf-search.kak][22] as example.
|
See [fzf-search.kak][22] as example.
|
||||||
- `-post-action`: Extra commands that are preformed after `-kak-cmd` command.
|
- `-post-action`: Extra commands that are performed after the `-kak-cmd` command.
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Please do.
|
Please do.
|
||||||
If you want to contribute to **fzf.kak** by adding a module, you can submit one by providing a pull request, or just open a feature request and we'll see what can be done.
|
If you want to contribute to fzf.kak by adding a module, you can submit one by providing a pull request, or just open a feature request and we'll see what can be done.
|
||||||
|
|
||||||
The basic idea behind the module structure can be described as:
|
The basic idea behind the module structure can be described as:
|
||||||
|
|
||||||
1. Provide a user module;
|
1. Provide a user module;
|
||||||
2. Define a command that calls `fzf` function with appropriate arguments;
|
2. Define a command that calls the `fzf` function with appropriate arguments;
|
||||||
3. Create a mapping in a `ModuleLoaded` hook, that requires new module, and calls the command.
|
3. Create a mapping in a `ModuleLoaded` hook, that requires a new module, and calls the command.
|
||||||
|
|
||||||
See how existing modules are implemented to understand the idea of how modules are constructed.
|
See how existing modules are implemented to understand the idea of how modules are constructed.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue