1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 20:10:05 +08:00
SpaceVim/docs/layers/edit.md

71 lines
1.9 KiB
Markdown
Raw Normal View History

2018-09-12 20:14:20 +08:00
---
title: "SpaceVim edit layer"
description: "Improve code edit expr in SpaceVim, provide more text opjects."
---
# [Available Layers](../) >> edit
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Options](#options)
2018-12-20 23:19:44 +08:00
- [Key bindings](#key-bindings)
2018-09-12 20:14:20 +08:00
<!-- vim-markdown-toc -->
## Description
This layer provides many edit key bindings for SpaceVim, and also provides more text objects.
2018-09-12 20:14:20 +08:00
## Features
- change surround symbol via vim-surround
- repeat latest action via vim-repeat
- multiple cursor
- align
- set justification for paragraph
- highlight whitespaces at the end of a line
- load ditorconfig config, need `+python` or `+python3`
2018-09-12 20:14:20 +08:00
## Options
- `textobj`: specified a list of text objects to be enabled, the avaliable list is :`indent`, `line`, `entire`
2018-12-20 23:19:44 +08:00
## Key bindings
| Key bindings | Descraptions |
| --------------------- | -------------------------------- |
| `SPC x a {delimiter}` | align content based on delimiter |
2018-12-20 23:19:44 +08:00
**default delimiters**
- `=`: align `===`, `==`, `!=`, `>=` etc.
- `&`: align `&`
- `¦`: align `¦`
- `|`: align `|`
2018-12-20 23:19:44 +08:00
- `;`: align `;`
- `:`: align `:`
- `,`: align `,`
- `.`: align `.`
- `[`: align `[`
- `(`: align `(`
- `{`: align `{`
- `]`: align `]`
- `}`: align `}`
- `)`: align `)`
- `[SPC]`: align `[SPC]`
- `o`: align `+ - * / % ^` etc.
- `r`: align user specified regular expression.
| Key bindings | Descraptions |
| ------------ | ------------------------------------ |
| `SPC x j c` | set the justification to center |
| `SPC x j f` | set the justification to full (TODO) |
| `SPC x j l` | set the justification to left |
| `SPC x j n` | set the justification to none (TODO) |
| `SPC x j r` | set the justification to right |
| `SPC x u` | set the selected text to lower case |
| `SPC x U` | set the selected text to upper case |
| `SPC x w c` | count the words in the select region |