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

57 lines
1.6 KiB
Markdown
Raw Normal View History

2018-09-12 20:14:20 +08:00
---
title: "SpaceVim edit layer"
2021-06-21 20:39:29 +08:00
description: "Improve code edit experience in SpaceVim, provides more text objects."
2018-09-12 20:14:20 +08:00
---
# [Available Layers](../) >> edit
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Options](#options)
<!-- 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
2021-06-21 20:39:29 +08:00
- repeat last action via vim-repeat
- multiple cursors
- align
- set justification for paragraph
2021-06-21 20:39:29 +08:00
- highlight whitespace at the end of a line
2019-08-05 09:48:07 +08:00
- load editorconfig 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`
2022-02-05 22:57:15 +08:00
- `autosave_timeout`: set the timeoutlen of autosave plugin. By default it
is 0. And autosave is disabled. timeoutlen must be given in millisecods and
can't be > 100\*60\*1000 (100 minutes) or < 1000 (1 second). For example,
setup timer with 5 minutes:
2022-02-05 22:57:15 +08:00
```
[[layers]]
name = 'edit'
autosave_timeout = 300000
```
- `autosave_events`: set the events on which autosave will perform a save.
This option is an empty list by default. you can trigger saving based
on vim's events, for example:
2022-02-05 22:57:15 +08:00
```
[[layers]]
name = 'edit'
autosave_events = ['InsertLeave', 'TextChanged']
```
- `autosave_all_buffers`: By default autosave plugin only save current buffer.
If you want to save all buffers automatically. Set this option to `true`.
2022-02-05 22:57:15 +08:00
```
[[layers]]
name = 'edit'
autosave_all_buffers = true
```