1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

Update doc && fix problems (#2799)

* Update doc && fix problems

* Improve SPC b e

print info for canceled.

* Add canceled info for SPC b R

* Fix type

* Fix type

* Fix type
This commit is contained in:
Wang Shidong 2019-05-08 13:34:49 +08:00 committed by GitHub
parent db55d72e76
commit d87b918967
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 26 deletions

View File

@ -234,7 +234,7 @@ if (has('python3') && SpaceVim#util#haspy3lib('neovim')) &&
" endif
" <
"
" and you can alse set this option to coc, then coc.nvim will be useed.
" and you can alse set this option to coc, then coc.nvim will be used.
let g:spacevim_autocomplete_method = 'deoplete'
elseif has('lua')
let g:spacevim_autocomplete_method = 'neocomplete'

View File

@ -53,7 +53,7 @@ function! SpaceVim#layers#core#config() abort
nnoremap <silent> [<Space> :<c-u>put! =repeat(nr2char(10), v:count1)<cr>
nnoremap <silent> ]<Space> :<c-u>put =repeat(nr2char(10), v:count1)<cr>
"]e or [e move current line ,count can be useed
"]e or [e move current line ,count can be used
nnoremap <silent>[e :<c-u>execute 'move -1-'. v:count1<cr>
nnoremap <silent>]e :<c-u>execute 'move +'. v:count1<cr>
@ -437,8 +437,9 @@ endfunction
function! s:safe_erase_buffer() abort
if s:MESSAGE.confirm('Erase content of buffer ' . expand('%:t'))
normal! ggdG
else
echo 'canceled!'
endif
redraw!
endfunction
function! s:ToggleWinDiskManager() abort
@ -463,6 +464,8 @@ endfunction
function! s:safe_revert_buffer() abort
if s:MESSAGE.confirm('Revert buffer form ' . expand('%:p'))
edit!
else
echo 'canceled!'
endif
redraw!
endfunction

View File

@ -1,7 +1,7 @@
---
title: "Use Vim as a Go IDE"
categories: [tutorials, blog]
images: https://user-images.githubusercontent.com/13142418/57321608-4a484880-7134-11e9-8e43-5fa05085d7e5.png
image: https://user-images.githubusercontent.com/13142418/57321608-4a484880-7134-11e9-8e43-5fa05085d7e5.png
excerpt: "A general guide for using SpaceVim as Go IDE, including layer configuration, requiems installation and usage."
type: BlogPosting
comments: true

View File

@ -1,7 +1,7 @@
---
title: "使用 Vim 搭建 Go 开发环境"
categories: [tutorials_cn, blog_cn]
images: https://user-images.githubusercontent.com/13142418/57321608-4a484880-7134-11e9-8e43-5fa05085d7e5.png
image: https://user-images.githubusercontent.com/13142418/57321608-4a484880-7134-11e9-8e43-5fa05085d7e5.png
excerpt: "这篇文章主要介绍如何使用 SpaceVim 搭建 Go 的开发环境,简介 lang#go 模块所支持的功能特性以及使用技巧"
permalink: /cn/:title/
lang: cn

View File

@ -51,8 +51,8 @@ lang: cn
- [合并,拆分](#合并拆分)
- [窗口操作](#窗口操作)
- [窗口操作常用快捷键](#窗口操作常用快捷键)
- [文件和 Buffer 操作](#文件和-buffer-操作)
- [Buffer 操作相关快捷键](#buffer-操作相关快捷键)
- [文件和缓冲区操作](#文件和缓冲区操作)
- [缓冲区操作](#缓冲区操作)
- [新建空白 buffer](#新建空白-buffer)
- [特殊 buffer](#特殊-buffer)
- [文件操作相关快捷键](#文件操作相关快捷键)
@ -91,7 +91,7 @@ lang: cn
- [工程管理](#工程管理)
- [在工程中搜索文件](#在工程中搜索文件)
- [格式规范](#格式规范)
- [Vim 服务](#vim-服务)
- [Vim 服务](#vim-服务)
- [Achievements](#achievements)
- [issues](#issues)
- [Stars, forks and watchers](#stars-forks-and-watchers)
@ -1038,34 +1038,36 @@ Denite/Unite 是一个强大的信息筛选浏览器,这类似于 Emacs 中的
| `SPC w w` | 切换至前一窗口 |
| `SPC w W` | 选择一个窗口 |
#### 文件和 Buffer 操作
#### 文件和缓冲区操作
##### Buffer 操作相关快捷键
##### 缓冲区操作
Buffer 操作相关快捷键都是以 `SPC b` 为前缀的:
缓冲区Buffer操作相关快捷键都是以 `SPC b` 为前缀的,以下为常用的缓冲区操作快捷键,
主要包括了缓冲区的切换和删除等操作:
| 快捷键 | 功能描述 |
| --------------- | ------------------------------------------------------------------------------ |
| `SPC <Tab>` | 切换至前一 buffer可用于两个 buffer 来回切换 |
| `SPC b .` | 启用 buffer 临时快捷键 |
| `SPC b b` | 切换至某一 buffer通过 Unite/Denite 进行筛选 |
| `SPC b d` | 删除当前 buffer但保留 Vim 窗口 |
| `SPC <Tab>` | 切换至前一缓冲区,常用于两个缓冲区来回切换 |
| `SPC b .` | 启用缓冲区临时快捷键 |
| `SPC b b` | 通过模糊搜索工具进行缓冲区切换,需要启用一个模糊搜索工具模块 |
| `SPC b d` | 删除当前缓冲区,但保留编辑窗口 |
| `SPC u SPC b d` | kill the current buffer and window (does not delete the visited file) (TODO) |
| `SPC b D` | 选择一个窗口,并删除其 buffer |
| `SPC b D` | 选择一个窗口,并删除其缓冲区 |
| `SPC u SPC b D` | kill a visible buffer and its window using ace-window(TODO) |
| `SPC b C-d` | 删除其它 buffers |
| `SPC b c` | 删除其它已保存的缓冲区 |
| `SPC b C-d` | 删除其它所有缓冲区 |
| `SPC b C-D` | kill buffers using a regular expression(TODO) |
| `SPC b e` | 清除当前 buffer 内容,需要手动确认 |
| `SPC b h` | 打开 _SpaceVim_ 欢迎界面 |
| `SPC b n` | 切换至下一个 buffer排除特殊插件的 buffer |
| `SPC b m` | 打开 _Messages_ buffer |
| `SPC b e` | 清除当前缓冲区内容,需要手动确认 |
| `SPC b h` | 打开欢迎界面, 等同于快捷键 `SPC a s` |
| `SPC b n` | 切换至下一个缓冲区,排除特殊插件的缓冲区 |
| `SPC b m` | 打开消息缓冲区 |
| `SPC u SPC b m` | kill all buffers and windows except the current one(TODO) |
| `SPC b p` | 切换至前一个 buffer排除特殊插件的 buffer |
| `SPC b P` | 使用剪切板内容替换当前 buffer |
| `SPC b R` | 从磁盘重新读取当前 buffer 所对应的文件 |
| `SPC b p` | 切换至前一个缓冲区,排除特殊插件的缓冲区 |
| `SPC b P` | 使用系统剪切板内容替换当前缓冲区 |
| `SPC b R` | 从磁盘重新读取当前缓冲区所对应的文件 |
| `SPC b s` | switch to the _scratch_ buffer (create it if needed) (TODO) |
| `SPC b w` | 切换只读权限 |
| `SPC b Y` | 将整个 buffer 复制到剪切板 |
| `SPC b Y` | 将整个缓冲区复制到系统剪切板 |
| `z f` | Make current function or comments visible in buffer as much as possible (TODO) |
##### 新建空白 buffer
@ -1842,7 +1844,7 @@ SpaceVim 添加了 [EditorConfig](http://editorconfig.org/) 支持,通过一
更多配置方式,可以阅读其官方文档:[editorconfig-vim packages documentation](https://github.com/editorconfig/editorconfig-vim/blob/master/README.md).
## Vim 服务
## Vim 服务
SpaceVim 在启动时启动了一个服务器。无论何时,当你关闭了 Vim 窗口,该服务器就会被关闭。