mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:50:04 +08:00
Update python doc (#4154)
This commit is contained in:
parent
4407b7c8af
commit
50c7c3bebc
@ -20,7 +20,7 @@ if exists('s:enabled_linters')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:enabled_linters = ['python', 'flake8']
|
||||
let s:enabled_linters = ['python']
|
||||
let s:format_on_save = 0
|
||||
let s:python_file_head = [
|
||||
\ '#!/usr/bin/env python',
|
||||
|
@ -108,6 +108,8 @@ pip install --user coverage
|
||||
|
||||
## 模块设置
|
||||
|
||||
- `python_file_head`: 设置默认的 Python 文件头信息模板。
|
||||
|
||||
默认情况下,当新建一个空白 python 文件时,会自动添加文件头,如果需要修改默认的文件头样式,
|
||||
可以通过设置 `python_file_head` 选项:
|
||||
|
||||
@ -130,6 +132,30 @@ pip install --user coverage
|
||||
enable_typeinfo = true
|
||||
```
|
||||
|
||||
- `format_on_save`: 启用或者禁用文件保存时的自动格式化,默认为禁用状态,
|
||||
若想启用这一功能,可以使用如下配置:
|
||||
```toml
|
||||
[[layers]]
|
||||
name = 'lang#python'
|
||||
format_on_save = true
|
||||
```
|
||||
|
||||
- `python_interpreter`: 设置 python 的可执行命令路劲,默认值为 `python3`,该选项的值将被应用于
|
||||
`g:neomake_python_python_exe` 和代码快速运行器。
|
||||
```toml
|
||||
[[layers]]
|
||||
name = 'lang#python'
|
||||
python_interpreter = 'D:\scoop\shims\python.exe'
|
||||
```
|
||||
|
||||
- `python_linters`: 设置 python 语言默认的语法检查工具,默认是 `['python']`,你也可以修改该选项为
|
||||
`['python', 'pylint']`。
|
||||
```toml
|
||||
[[layers]]
|
||||
name = 'lang#python'
|
||||
enabled_linters = ['python', 'pylint']
|
||||
```
|
||||
|
||||
## 快捷键
|
||||
|
||||
### 跳至定义处
|
||||
|
@ -134,7 +134,7 @@ you need to add following snippet into your spacevim configuration file.
|
||||
format_on_save = true
|
||||
```
|
||||
|
||||
* `python_interpreter`: Set the python interpreter, by default, it is `python3`. The value of this option will
|
||||
- `python_interpreter`: Set the python interpreter, by default, it is `python3`. The value of this option will
|
||||
be apply to `g:neomake_python_python_exe` and code runner.
|
||||
```toml
|
||||
[[layers]]
|
||||
@ -142,6 +142,14 @@ you need to add following snippet into your spacevim configuration file.
|
||||
python_interpreter = 'D:\scoop\shims\python.exe'
|
||||
```
|
||||
|
||||
- `python_linters`: Set the default linters for python language, by default it is `['python']`. You can change
|
||||
it to `['python', 'pylint']`.
|
||||
```toml
|
||||
[[layers]]
|
||||
name = 'lang#python'
|
||||
enabled_linters = ['python', 'pylint']
|
||||
```
|
||||
|
||||
## Key bindings
|
||||
|
||||
### Jump to definition
|
||||
|
Loading…
Reference in New Issue
Block a user