2017-07-28 05:22:12 +08:00
|
|
|
---
|
|
|
|
title: "SpaceVim shell layer"
|
2021-06-21 20:39:29 +08:00
|
|
|
description: "This layer provides shell support in SpaceVim"
|
2017-07-28 05:22:12 +08:00
|
|
|
---
|
|
|
|
|
2018-06-23 14:37:41 +08:00
|
|
|
# [Available Layers](../) >> shell
|
2017-07-28 05:22:12 +08:00
|
|
|
|
|
|
|
<!-- vim-markdown-toc GFM -->
|
2017-12-02 23:23:58 +08:00
|
|
|
|
|
|
|
- [Description](#description)
|
|
|
|
- [Install](#install)
|
|
|
|
- [Configuration](#configuration)
|
|
|
|
- [Default shell](#default-shell)
|
|
|
|
- [Default shell position and height](#default-shell-position-and-height)
|
|
|
|
- [Key bindings](#key-bindings)
|
2020-02-24 18:18:53 +08:00
|
|
|
- [Additional key bindings on Windows](#additional-key-bindings-on-windows)
|
2017-07-28 05:22:12 +08:00
|
|
|
|
|
|
|
<!-- vim-markdown-toc -->
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
|
|
This layer provide shell support in SpaceVim.
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
2018-05-27 13:05:57 +08:00
|
|
|
To use this configuration layer, add following snippet to your custom configuration file.
|
|
|
|
|
|
|
|
```toml
|
|
|
|
[[layers]]
|
|
|
|
name = "shell"
|
|
|
|
```
|
2017-07-28 05:22:12 +08:00
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
### Default shell
|
|
|
|
|
2021-06-21 20:39:29 +08:00
|
|
|
Vim supports these kinds of shells:
|
2017-07-28 05:22:12 +08:00
|
|
|
|
|
|
|
To define the default shell you can set the layer variable `default_shell` to the following variables:
|
|
|
|
|
2018-09-25 22:17:36 +08:00
|
|
|
- terminal
|
|
|
|
- VimShell
|
2017-07-28 05:22:12 +08:00
|
|
|
|
|
|
|
The default shell is quickly accessible via a the default shortcut key `SPC '`.
|
|
|
|
|
|
|
|
### Default shell position and height
|
|
|
|
|
2019-01-07 21:15:22 +08:00
|
|
|
It is possible to choose where the shell should pop up by setting the
|
2020-02-24 18:18:53 +08:00
|
|
|
variable `default_position` to either `top`, `bottom`, `left`, `right`, `float`
|
|
|
|
or `full`. Default value is `top`. It is also possible to set the default height
|
2018-05-27 13:05:57 +08:00
|
|
|
in percents with the variable `default_height`. Default value is 30.
|
2017-07-28 05:22:12 +08:00
|
|
|
|
2018-05-27 13:05:57 +08:00
|
|
|
```toml
|
|
|
|
[[layers]]
|
|
|
|
name = "shell"
|
|
|
|
default_position = "top"
|
|
|
|
default_height = 30
|
2017-07-28 05:22:12 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
## Key bindings
|
|
|
|
|
2021-10-17 23:51:28 +08:00
|
|
|
| Key Binding | Description |
|
|
|
|
| --------------- | ---------------------------------------- |
|
|
|
|
| `SPC '` | Open or switch to the terminal windows |
|
|
|
|
| `Ctrl-d` | Close terminal windows in terminal mode |
|
|
|
|
| `q` | Hide terminal windows in Normal mode |
|
|
|
|
| `` Ctrl-` `` | Hide terminal windows in terminal mode |
|
|
|
|
| `Ctrl-\-Ctrl-n` | Switch to Normal mode from terminal mode |
|
|
|
|
| `Ctrl-Left` | Switch to the windows on the left |
|
|
|
|
| `Ctrl-Down` | Switch to the windows below |
|
|
|
|
| `Ctrl-Up` | Switch to the windows on the top |
|
|
|
|
| `Ctrl-Right` | Switch to the windows on the right |
|
2019-07-18 06:59:30 +08:00
|
|
|
|
|
|
|
### Additional key bindings on Windows
|
2019-07-18 08:42:50 +08:00
|
|
|
|
2020-07-16 22:44:38 +08:00
|
|
|
| Key Binding | Description |
|
|
|
|
| ----------- | ---------------------------------- |
|
|
|
|
| `Ctrl-d` | Sends `exit <CR>` if at a prompt |
|
|
|
|
| `Ctrl-u` | Clears the line before the cursor |
|
|
|
|
| `Ctrl-r` | Pastes from clipboard if given `+` |
|
|
|
|
| `Ctrl-w` | Deletes the word before the cursor |
|