mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 00:30:05 +08:00
Merge branch 'doc' into dev
This commit is contained in:
commit
42fda05647
@ -8,8 +8,10 @@
|
||||
|
||||
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
|
||||
![Version 0.2.0-dev](https://img.shields.io/badge/version-0.3.0--dev-FF00CC.svg)
|
||||
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)
|
||||
[![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg?style=flat-square)](doc/SpaceVim.txt)
|
||||
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
|
||||
[![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg)](doc/SpaceVim.txt)
|
||||
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/SpaceVim/SpaceVim.svg)](http://isitmaintained.com/project/SpaceVim/SpaceVim "Average time to resolve an issue")
|
||||
[![Percentage of issues still open](http://isitmaintained.com/badge/open/SpaceVim/SpaceVim.svg)](http://isitmaintained.com/project/SpaceVim/SpaceVim "Percentage of issues still open")
|
||||
|
||||
SpaceVim is a community-driven vim distribution that seeks to provide layer feature, especially for neovim. It offers a variety of layers to choose from. to create a suitable vim development environment, you just need to select the required layers.
|
||||
|
||||
@ -42,7 +44,7 @@ to select the layers they need. It got inspired by [spacemacs](https://github.co
|
||||
please star it on github. It's a great way of getting feedback and gives me the kick to
|
||||
put more time into development.
|
||||
|
||||
![2017-04-19-00 17 33](https://cloud.githubusercontent.com/assets/13142418/25141441/220b3a54-2496-11e7-9462-fcfdccb7aad8.png)
|
||||
![2017-04-29-20 54 49](https://cloud.githubusercontent.com/assets/13142418/25555650/d7d2c07e-2d1e-11e7-975d-646a07b38a62.png)
|
||||
|
||||
If you are new to vim, you should learning about Vim in general, read [vim-galore](https://github.com/mhinz/vim-galore).
|
||||
|
||||
|
@ -172,6 +172,9 @@ let g:spacevim_language = ''
|
||||
" The colorscheme of SpaceVim. Default is 'gruvbox'.
|
||||
let g:spacevim_colorscheme = 'gruvbox'
|
||||
""
|
||||
" The background of colorscheme. Default is 'dark'.
|
||||
let g:spacevim_colorscheme_bg = 'dark'
|
||||
""
|
||||
" The default colorscheme of SpaceVim. Default is 'desert'.
|
||||
" This colorscheme will be used if the colorscheme set by
|
||||
" `g:spacevim_colorscheme` is not installed.
|
||||
@ -491,6 +494,13 @@ function! SpaceVim#welcome() abort
|
||||
if exists('g:_spacevim_checking_flag') && g:_spacevim_checking_flag
|
||||
return
|
||||
endif
|
||||
let f = ''
|
||||
if argc()
|
||||
let f = expand(argv(0))
|
||||
if isdirectory(f)
|
||||
exe 'lcd ' . f
|
||||
endif
|
||||
endif
|
||||
if exists(':Startify') == 2
|
||||
Startify
|
||||
endif
|
||||
|
86
autoload/SpaceVim/api/vim/highlight.vim
Normal file
86
autoload/SpaceVim/api/vim/highlight.vim
Normal file
@ -0,0 +1,86 @@
|
||||
let s:self = {}
|
||||
|
||||
function! s:self.group2dict(name) abort
|
||||
let id = index(map(range(999), 'synIDattr(v:val, "name")'), a:name)
|
||||
if id == -1
|
||||
return {}
|
||||
endif
|
||||
let rst = {
|
||||
\ 'name' : synIDattr(id, 'name'),
|
||||
\ 'ctermbg' : synIDattr(id, 'bg'),
|
||||
\ 'ctermfg' : synIDattr(id, 'fg'),
|
||||
\ 'bold' : synIDattr(id, 'bold'),
|
||||
\ 'italic' : synIDattr(id, 'italic'),
|
||||
\ 'underline' : synIDattr(id, 'underline'),
|
||||
\ 'guibg' :synIDattr(id, 'bg#'),
|
||||
\ 'guifg' : synIDattr(id, 'fg#'),
|
||||
\ }
|
||||
return rst
|
||||
endfunction
|
||||
|
||||
function! s:self.unite(base, target, part) abort
|
||||
let base = self.group2dict(a:base)
|
||||
let target = self.group2dict(a:target)
|
||||
if empty(base) || empty(target)
|
||||
return
|
||||
elseif get(base,a:part, '') ==# get(target, a:part, '')
|
||||
return
|
||||
else
|
||||
let target[a:part] = base[a:part]
|
||||
call self.hi(target)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:self.hi(info) abort
|
||||
if empty(a:info)
|
||||
return
|
||||
endif
|
||||
let cmd = 'hi! ' . a:info.name
|
||||
if !empty(a:info.ctermbg)
|
||||
let cmd .= ' ctermbg=' . a:info.ctermbg
|
||||
endif
|
||||
if !empty(a:info.ctermfg)
|
||||
let cmd .= ' ctermfg=' . a:info.ctermfg
|
||||
endif
|
||||
if !empty(a:info.guibg)
|
||||
let cmd .= ' guibg=' . a:info.guibg
|
||||
endif
|
||||
if !empty(a:info.guifg)
|
||||
let cmd .= ' guifg=' . a:info.guifg
|
||||
endif
|
||||
let style = []
|
||||
for sty in ['hold', 'italic', 'underline']
|
||||
if get(a:info, sty, '') ==# '1'
|
||||
call add(style, sty)
|
||||
endif
|
||||
endfor
|
||||
if !empty(style)
|
||||
let cmd .= ' gui=' . join(style, ',') . ' cterm=' . join(style, ',')
|
||||
endif
|
||||
try
|
||||
exe cmd
|
||||
catch
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! s:self.hide_in_normal(name) abort
|
||||
let group = self.group2dict(a:name)
|
||||
if empty(group)
|
||||
return
|
||||
endif
|
||||
if &termguicolors || has('gui_running')
|
||||
let g:wsd = self.group2dict('Normal')
|
||||
let bg = self.group2dict('Normal').guibg
|
||||
let group.guifg = bg
|
||||
let group.guibg = bg
|
||||
else
|
||||
let bg = self.group2dict('Normal').ctermbg
|
||||
let group.ctermfg = bg
|
||||
let group.ctermbg = bg
|
||||
endif
|
||||
call self.hi(group)
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#api#vim#highlight#get() abort
|
||||
return deepcopy(s:self)
|
||||
endfunction
|
@ -64,10 +64,20 @@ function! SpaceVim#autocmds#init() abort
|
||||
autocmd FocusGained * call s:reload_touchpad_status()
|
||||
endif
|
||||
autocmd BufWritePost *.vim call s:generate_doc()
|
||||
autocmd VimEnter * if !argc() | call SpaceVim#welcome() | endif
|
||||
autocmd VimEnter * if !s:with_file() | call SpaceVim#welcome() | endif
|
||||
autocmd ColorScheme gruvbox call s:fix_gruvbox()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! s:with_file() abort
|
||||
if !argc()
|
||||
return 0
|
||||
elseif isdirectory(expand(argv(0)))
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
function! s:reload_touchpad_status() abort
|
||||
if s:touchpadoff
|
||||
call s:disable_touchpad()
|
||||
@ -104,11 +114,12 @@ endfunction
|
||||
function! s:fix_gruvbox() abort
|
||||
if &background ==# 'dark'
|
||||
hi VertSplit guibg=#282828 guifg=#181A1F
|
||||
hi EndOfBuffer guibg=#282828 guifg=#282828
|
||||
"hi EndOfBuffer guibg=#282828 guifg=#282828
|
||||
else
|
||||
hi VertSplit guibg=#fbf1c7 guifg=#e7e9e1
|
||||
hi EndOfBuffer guibg=#fbf1c7 guifg=#fbf1c7
|
||||
"hi EndOfBuffer guibg=#fbf1c7 guifg=#fbf1c7
|
||||
endif
|
||||
call SpaceVim#api#import('vim#highlight').hide_in_normal('EndOfBuffer')
|
||||
hi SpaceVimLeaderGuiderGroupName cterm=bold ctermfg=175 gui=bold guifg=#d3869b
|
||||
endfunction
|
||||
|
||||
|
@ -105,7 +105,6 @@ function! SpaceVim#default#SetOptions() abort
|
||||
set hidden
|
||||
set ttimeout
|
||||
set ttimeoutlen=50
|
||||
set background=dark
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#default#SetPlugins() abort
|
||||
|
@ -6,7 +6,8 @@ function! SpaceVim#layers#ui#plugins() abort
|
||||
\ ['majutsushi/tagbar', {'loadconf' : 1}],
|
||||
\ ['lvht/tagbar-markdown',{'merged' : 0}],
|
||||
\ ['t9md/vim-choosewin', {'merged' : 0}],
|
||||
\ ['vim-airline/vim-airline', { 'merged' : 0, 'loadconf' : 1}],
|
||||
\ ['vim-airline/vim-airline', { 'merged' : 0,
|
||||
\ 'loadconf' : 1}],
|
||||
\ ['vim-airline/vim-airline-themes', { 'merged' : 0}],
|
||||
\ ['mhinz/vim-startify', {'loadconf' : 1}],
|
||||
\ ]
|
||||
@ -23,22 +24,53 @@ function! SpaceVim#layers#ui#config() abort
|
||||
let g:signify_line_highlight = 0
|
||||
noremap <silent> <F2> :TagbarToggle<CR>
|
||||
" Ui toggles
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['T', 'F'], '<F11>', 'fullscreen-frame', 0)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['T', 'm'], 'call call(' . string(s:_function('s:toggle_menu_bar')) . ', [])', 'menu-bar', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', '8'], 'call call('
|
||||
\ . string(s:_function('s:toggle_fill_column')) . ', [])',
|
||||
\ 'toggle-colorcolume', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'b'], 'call ToggleBG()',
|
||||
\ 'toggle background', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'f'], 'call call('
|
||||
\ . string(s:_function('s:toggle_colorcolumn')) . ', [])',
|
||||
\ 'toggle-colorcolume', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'h'], 'set cursorline!',
|
||||
\ 'toggle highlight of the current line', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'i'], 'call call('
|
||||
\ . string(s:_function('s:toggle_indentline')) . ', [])',
|
||||
\ 'toggle highlight indentation levels', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'c'], 'set cursorcolumn!',
|
||||
\ 'toggle highlight indentation current column', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 's'], 'call call('
|
||||
\ . string(s:_function('s:toggle_syntax_hi')) . ', [])',
|
||||
\ 'toggle syntax highlighting', 1)
|
||||
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['T', 'F'], '<F11>',
|
||||
\ 'fullscreen-frame', 0)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['T', 'm'], 'call call('
|
||||
\ . string(s:_function('s:toggle_menu_bar')) . ', [])',
|
||||
\ 'toggle-menu-bar', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['T', 'f'], 'call call('
|
||||
\ . string(s:_function('s:toggle_win_fringe')) . ', [])',
|
||||
\ 'toggle-win-fringe', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['T', 't'], 'call call('
|
||||
\ . string(s:_function('s:toggle_tool_bar')) . ', [])',
|
||||
\ 'toggle-tool-bar', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['T', '~'], 'call call('
|
||||
\ . string(s:_function('s:toggle_end_of_buffer')) . ', [])',
|
||||
\ 'display ~ in the fringe on empty lines', 1)
|
||||
endfunction
|
||||
" function() wrapper
|
||||
if v:version > 703 || v:version == 703 && has('patch1170')
|
||||
function! s:_function(fstr) abort
|
||||
return function(a:fstr)
|
||||
endfunction
|
||||
function! s:_function(fstr) abort
|
||||
return function(a:fstr)
|
||||
endfunction
|
||||
else
|
||||
function! s:_SID() abort
|
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
|
||||
endfunction
|
||||
let s:_s = '<SNR>' . s:_SID() . '_'
|
||||
function! s:_function(fstr) abort
|
||||
return function(substitute(a:fstr, 's:', s:_s, 'g'))
|
||||
endfunction
|
||||
function! s:_SID() abort
|
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
|
||||
endfunction
|
||||
let s:_s = '<SNR>' . s:_SID() . '_'
|
||||
function! s:_function(fstr) abort
|
||||
return function(substitute(a:fstr, 's:', s:_s, 'g'))
|
||||
endfunction
|
||||
endif
|
||||
let s:tmflag = 0
|
||||
function! s:toggle_menu_bar() abort
|
||||
@ -50,3 +82,92 @@ function! s:toggle_menu_bar() abort
|
||||
let s:tmflag = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:ttflag = 0
|
||||
function! s:toggle_tool_bar() abort
|
||||
if !s:ttflag
|
||||
set go+=T
|
||||
let s:ttflag = 1
|
||||
else
|
||||
set go-=T
|
||||
let s:ttflag = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:ccflag = 0
|
||||
function! s:toggle_colorcolumn() abort
|
||||
if !s:ccflag
|
||||
set cc=80
|
||||
let s:ccflag = 1
|
||||
else
|
||||
set cc=
|
||||
let s:ccflag = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:fcflag = 0
|
||||
function! s:toggle_fill_column() abort
|
||||
if !s:fcflag
|
||||
let &colorcolumn=join(range(80,999),",")
|
||||
let s:fcflag = 1
|
||||
else
|
||||
set cc=
|
||||
let s:fcflag = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:idflag = 0
|
||||
function! s:toggle_indentline() abort
|
||||
if !s:idflag
|
||||
IndentLinesDisable
|
||||
let s:idflag = 1
|
||||
else
|
||||
IndentLinesEnable
|
||||
let s:idflag = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:shflag = 0
|
||||
function! s:toggle_syntax_hi() abort
|
||||
if !s:shflag
|
||||
syntax off
|
||||
let s:shflag = 1
|
||||
else
|
||||
syntax on
|
||||
let s:shflag = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:ebflag = 0
|
||||
let s:HI = SpaceVim#api#import('vim#highlight')
|
||||
function! s:toggle_end_of_buffer() abort
|
||||
if !s:ebflag
|
||||
if &background ==# 'dark'
|
||||
hi EndOfBuffer guifg=white
|
||||
else
|
||||
hi EndOfBuffer guifg=gray
|
||||
endif
|
||||
let s:ebflag = 1
|
||||
else
|
||||
if &termguicolors || has('gui_running')
|
||||
let normalbg = s:HI.group2dict('Normal').guibg
|
||||
else
|
||||
let normalbg = s:HI.group2dict('Normal').ctermbg
|
||||
endif
|
||||
exe 'hi! EndOfBuffer guifg=' . normalbg . ' guibg=' . normalbg
|
||||
let s:ebflag = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:tfflag = 0
|
||||
function! s:toggle_win_fringe() abort
|
||||
if !s:tfflag
|
||||
set guioptions+=L
|
||||
set guioptions+=r
|
||||
let s:tfflag = 1
|
||||
else
|
||||
set guioptions-=L
|
||||
set guioptions-=r
|
||||
let s:tfflag = 0
|
||||
endif
|
||||
endfunction
|
||||
|
@ -7,6 +7,7 @@ function! SpaceVim#mapping#space#init() abort
|
||||
let g:_spacevim_mappings_space = {}
|
||||
let g:_spacevim_mappings_space['?'] = ['Unite menu:CustomKeyMaps -input=[SPC]', 'show mappings']
|
||||
let g:_spacevim_mappings_space.t = {'name' : '+Toggles'}
|
||||
let g:_spacevim_mappings_space.t.h = {'name' : '+Toggles highlight'}
|
||||
let g:_spacevim_mappings_space.T = {'name' : '+UI toggles/themes'}
|
||||
let g:_spacevim_mappings_space.a = {'name' : '+Applications'}
|
||||
let g:_spacevim_mappings_space.b = {'name' : '+Buffers'}
|
||||
@ -46,8 +47,8 @@ function! SpaceVim#mapping#space#init() abort
|
||||
call SpaceVim#mapping#menu('Open previous buffer', '[SPC]bN', 'bp')
|
||||
let g:_spacevim_mappings_space.e = {'name' : '+Errors'}
|
||||
let g:_spacevim_mappings_space.B = {'name' : '+Global-uffers'}
|
||||
nnoremap <silent> [SPC]tn :<C-u>set nu!<CR>
|
||||
let g:_spacevim_mappings_space.t.n = ['set nu!', 'toggle line number']
|
||||
nnoremap <silent> [SPC]tn :<C-u>setlocal nonumber! norelativenumber!<CR>
|
||||
let g:_spacevim_mappings_space.t.n = ['setlocal nonumber! norelativenumber!', 'toggle line number']
|
||||
call SpaceVim#mapping#menu('toggle line number', '[SPC]tn', 'set nu!')
|
||||
endfunction
|
||||
|
||||
@ -70,6 +71,8 @@ function! SpaceVim#mapping#space#def(m, keys, cmd, desc, is_cmd) abort
|
||||
exe a:m . ' <silent> [SPC]' . join(a:keys, '') . ' ' . substitute(cmd, '|', '\\|', 'g')
|
||||
if len(a:keys) == 2
|
||||
let g:_spacevim_mappings_space[a:keys[0]][a:keys[1]] = [lcmd, a:desc]
|
||||
elseif len(a:keys) == 3
|
||||
let g:_spacevim_mappings_space[a:keys[0]][a:keys[1]][a:keys[2]] = [lcmd, a:desc]
|
||||
elseif len(a:keys) == 1
|
||||
let g:_spacevim_mappings_space[a:keys[0]] = [lcmd, a:desc]
|
||||
endif
|
||||
|
@ -6,7 +6,8 @@ if has('filterpipe')
|
||||
endif
|
||||
if count(g:spacevim_plugin_groups, 'colorscheme') && g:spacevim_colorscheme !=# '' "{{{
|
||||
try
|
||||
exec 'colorscheme '. g:spacevim_colorscheme
|
||||
exec 'colorscheme ' . g:spacevim_colorscheme
|
||||
exec 'set background=' . g:spacevim_colorscheme_bg
|
||||
catch
|
||||
exec 'colorscheme '. g:spacevim_colorscheme_default
|
||||
endtry
|
||||
|
@ -57,7 +57,7 @@ call vimfiler#custom#profile('default', 'context', {
|
||||
augroup vfinit
|
||||
au!
|
||||
autocmd FileType vimfiler call s:vimfilerinit()
|
||||
autocmd BufEnter * if (winnr('$') == 1 && &filetype ==# 'vimfiler') |
|
||||
autocmd BufEnter * if (!has('vim_starting') && winnr('$') == 1 && &filetype ==# 'vimfiler') |
|
||||
\ q | endif
|
||||
augroup END
|
||||
function! s:vimfilerinit()
|
||||
|
@ -198,6 +198,9 @@ Set the message language of vim. Default is 'en_US.UTF-8'.
|
||||
*g:spacevim_colorscheme*
|
||||
The colorscheme of SpaceVim. Default is 'gruvbox'.
|
||||
|
||||
*g:spacevim_colorscheme_bg*
|
||||
The background of colorscheme. Default is 'dark'.
|
||||
|
||||
*g:spacevim_colorscheme_default*
|
||||
The default colorscheme of SpaceVim. Default is 'desert'. This colorscheme
|
||||
will be used if the colorscheme set by `g:spacevim_colorscheme` is not
|
||||
|
@ -17,8 +17,7 @@ title: "chinese totur"
|
||||
[![GitHub forks](https://img.shields.io/github/forks/SpaceVim/SpaceVim.svg?style=social&label=Fork)](https://github.com/SpaceVim/SpaceVim)
|
||||
[![Twitter Follow](https://img.shields.io/twitter/follow/SpaceVim.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/SpaceVim)
|
||||
|
||||
![2017-02-26_1365x739](https://cloud.githubusercontent.com/assets/13142418/23339920/590f2e9a-fc67-11e6-99ec-794f79ba0902.png)
|
||||
|
||||
![2017-04-29-20 54 49](https://cloud.githubusercontent.com/assets/13142418/25555650/d7d2c07e-2d1e-11e7-975d-646a07b38a62.png)
|
||||
|
||||
项 目 主 页: [spacevim.org](https://spacevim.org)
|
||||
|
||||
|
@ -6,6 +6,39 @@ title: "Documentation"
|
||||
|
||||
---
|
||||
|
||||
- [Core Pillars](#core-pillars)
|
||||
- [Mnemonic](#mnemonic)
|
||||
- [Discoverable](#discoverable)
|
||||
- [Consistent](#consistent)
|
||||
- [Crowd-Configured](#crowd-configured)
|
||||
- [Highlighted features](#highlighted-features)
|
||||
- [Screenshots](#screenshots)
|
||||
- [Who can benefit from this?](#who-can-benefit-from-this)
|
||||
- [Update and Rollback](#update-and-rollback)
|
||||
- [Update SpaceVim itself](#update-spacevim-itself)
|
||||
- [Automatic Updates](#automatic-updates)
|
||||
- [Updating from the SpaceVim Buffer](#updating-from-the-spacevim-buffer)
|
||||
- [Updating Manually with git](#updating-manually-with-git)
|
||||
- [Update plugins](#update-plugins)
|
||||
- [Custom Configuration](#custom-configuration)
|
||||
- [Automatic Generation](#automatic-generation)
|
||||
- [Alternative directory](#alternative-directory)
|
||||
- [Synchronization of dotfile changes](#synchronization-of-dotfile-changes)
|
||||
- Testing the dotfile
|
||||
- [Dotfile Contents](#dotfile-contents)
|
||||
- [Configuration functions](#configuration-functions)
|
||||
- [Custom variables](#custom-variables)
|
||||
- [Declaring Configuration layers](#declaring-configuration-layers)
|
||||
- [Setting configuration layers variables](#setting-configuration-layers-variables)
|
||||
- [Disabling layer services in other layers](#disabling-layer-services-in-other-layers)
|
||||
- [Selecting/Ignoring packages of a layer](#selectingignoring-packages-of-a-layer)
|
||||
- [Excluding packages](#excluding-packages)
|
||||
- [Awesome ui](#awesome-ui)
|
||||
- [Colorscheme](#colorscheme)
|
||||
- [Font](#font)
|
||||
- [UI Toggles](#ui-toggles)
|
||||
- [statusline](#statusline)
|
||||
|
||||
- Features
|
||||
- [Modular configuration](#modular-configuration)
|
||||
- [Awesome ui](#awesome-ui)
|
||||
@ -18,6 +51,262 @@ title: "Documentation"
|
||||
- [Layers](https://spacevim.org/layers)
|
||||
- [APIs](#apis)
|
||||
|
||||
## Core Pillars
|
||||
|
||||
Four core pillars: Mnemonic, Discoverable, Consistent and “Crowd-Configured”.
|
||||
|
||||
If any of these core pillars is violated open an issue and we’ll try our best to fix it.
|
||||
|
||||
### Mnemonic
|
||||
|
||||
Key bindings are organized using mnemonic prefixes like b for buffer, p for project, s for search, h for help, etc…
|
||||
|
||||
### Discoverable
|
||||
|
||||
Innovative real-time display of available key bindings. Simple query system to quickly find available layers, packages, and more.
|
||||
|
||||
### Consistent
|
||||
|
||||
Similar functionalities have the same key binding everywhere thanks to a clearly defined set of conventions. Documentation is mandatory for any layer that ships with Spacemacs.
|
||||
|
||||
### Crowd-Configured
|
||||
|
||||
Community-driven configuration provides curated packages tuned by power users and bugs are fixed quickly.
|
||||
|
||||
## Highlighted features
|
||||
|
||||
- **Great documentation:** access documentation in Vim with
|
||||
<kbd>:h SpaceVim</kbd>.
|
||||
- **Beautiful GUI:** you'll love the awesome UI and its useful features.
|
||||
- **Mnemonic key bindings:** commands have mnemonic prefixes like
|
||||
<kbd>[Window]</kbd> for all the window and buffer commands or <kbd>[Unite]</kbd> for the
|
||||
unite work flow commands.
|
||||
- **Lazy load plugins:** Lazy-load 90% of plugins with [dein.vim]
|
||||
- **Batteries included:** discover hundreds of ready-to-use packages nicely
|
||||
organised in configuration layers following a set of
|
||||
[conventions](http://spacevim.org/development/).
|
||||
- **Neovim centric:** Dark powered mode of SpaceVim
|
||||
|
||||
## Screenshots
|
||||
|
||||
### welcome page
|
||||
|
||||
![2017-04-29-20 54 49](https://cloud.githubusercontent.com/assets/13142418/25555650/d7d2c07e-2d1e-11e7-975d-646a07b38a62.png)
|
||||
|
||||
### working flow
|
||||
|
||||
![screen shot 2017-04-26 at 4 28 07 pm](https://cloud.githubusercontent.com/assets/296716/25455341/6af0b728-2a9d-11e7-9721-d2a694dde1a8.png)
|
||||
|
||||
Neovim on iTerm2 using the SpaceVim color scheme _base16-solarized-dark_
|
||||
|
||||
Depicts a common frontend development scenario with JavaScript (jQuery), SASS, and PHP buffers.
|
||||
|
||||
Non-code buffers show a Neovim terminal, a TagBar window, a Vimfiler window and a TernJS definition window.
|
||||
|
||||
to get more screenshots, see: [issue #415](https://github.com/SpaceVim/SpaceVim/issues/415)
|
||||
|
||||
## Who can benefit from this?
|
||||
|
||||
- the **elementary** vim users.
|
||||
- Vim users pursuing a beautiful appearance.
|
||||
- Vim users wanting to lower the [risk of RSI](http://en.wikipedia.org/wiki/Repetitive_strain_injury).
|
||||
- Vim users wanting to learn a different way to edit files.
|
||||
- Vim users wanting a simple but deep configuration system.
|
||||
|
||||
## Update and Rollback
|
||||
|
||||
### Update SpaceVim itself
|
||||
|
||||
There are several methods of updating the core files of SpaceVim. It is recommended to update the packages first; see the next section.
|
||||
|
||||
#### Automatic Updates
|
||||
|
||||
NOTE: By default, this feature is disabled, It will slow down the startup of vim/neovim. If you like this feature, add `let g:spacevim_automatic_update = 1` to your custom configuration file.
|
||||
|
||||
SpaceVim will automatically check for a new version every startup. You must restart Vim after updating.
|
||||
|
||||
#### Updating from the SpaceVim Buffer
|
||||
|
||||
Use `:SPUpdate SpaceVim` in SpaceVim buffer, This command will open a buffer to show the process of updating.
|
||||
|
||||
#### Updating Manually with git
|
||||
|
||||
To update manually close Vim and update the git repository:
|
||||
|
||||
`git -C ~/.SpaceVim pull`.
|
||||
|
||||
### Update plugins
|
||||
|
||||
Use `:SPUpdate` command will update all the plugins and SpaceVim itself. after `:SPUpdate`, you can assign plugins need to be updated. Use <kbd>Tab</kbd> to complete plugin names after `:SPUpdate`.
|
||||
|
||||
## Configuration layers
|
||||
|
||||
This section is an overview of layers. A more extensive introduction to writing configuration layers can be found in [SpaceVim's layers page](http://spacevim.org/layers/) (recommended reading!).
|
||||
|
||||
## Custom Configuration
|
||||
|
||||
User configuration can be stored in your ~/.SpaceVim.d directory.
|
||||
|
||||
### Automatic Generation
|
||||
|
||||
The very first time SpaceVim starts up, it will ask you several questions and then create the `SpaceVim.d/init.vim` in your `HOME` directory.
|
||||
|
||||
### Alternative directory
|
||||
|
||||
`~/.SpaceVim.d/` will be added to `&runtimepath` of vim. read <kbd>:h rtp</kbd>.
|
||||
|
||||
It is also possible to override the location of `~/.SpaceVim.d/` using the environment variable `SPACEVIMDIR`. Of course you can also use symlinks to change the location of this directory.
|
||||
|
||||
SpaceVim also support local config file for project, the init file is `.SpaceVim.d/init.vim`
|
||||
in the root of your project. `.SpaceVim.d/` will also be added into runtimepath.
|
||||
|
||||
here is an example config file for SpaceVim:
|
||||
|
||||
```vim
|
||||
" Here are some basic customizations, please refer to the ~/.SpaceVim.d/init.vim
|
||||
" file for all possible options:
|
||||
let g:spacevim_default_indent = 3
|
||||
let g:spacevim_max_column = 80
|
||||
|
||||
" Change the default directory where all miscellaneous persistent files go.
|
||||
" By default it is ~/.cache/vimfiles.
|
||||
let g:spacevim_plugin_bundle_dir = '~/.cache/vimfiles'
|
||||
|
||||
" set SpaceVim colorscheme
|
||||
let g:spacevim_colorscheme = 'jellybeans'
|
||||
|
||||
" Set plugin manager, you want to use, default is dein.vim
|
||||
let g:spacevim_plugin_manager = 'dein' " neobundle or dein or vim-plug
|
||||
|
||||
" use space as `<Leader>`
|
||||
let mapleader = "\<space>"
|
||||
|
||||
" Set windows shortcut leader [Window], default is `s`
|
||||
let g:spacevim_windows_leader = 's'
|
||||
|
||||
" Set unite work flow shortcut leader [Unite], default is `f`
|
||||
let g:spacevim_unite_leader = 'f'
|
||||
|
||||
" By default, language specific plugins are not loaded. This can be changed
|
||||
" with the following, then the plugins for go development will be loaded.
|
||||
call SpaceVim#layers#load('lang#go')
|
||||
|
||||
" loaded ui layer
|
||||
call SpaceVim#layers#load('ui')
|
||||
|
||||
" If there is a particular plugin you don't like, you can define this
|
||||
" variable to disable them entirely:
|
||||
let g:spacevim_disabled_plugins=[
|
||||
\ ['junegunn/fzf.vim'],
|
||||
\ ]
|
||||
|
||||
" If you want to add some custom plugins, use these options:
|
||||
let g:spacevim_custom_plugins = [
|
||||
\ ['plasticboy/vim-markdown', {'on_ft' : 'markdown'}],
|
||||
\ ['wsdjeg/GitHub.vim'],
|
||||
\ ]
|
||||
|
||||
" set the guifont
|
||||
let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
|
||||
```
|
||||
|
||||
Comprehensive documentation is available for each layer by <kbd>:h SpaceVim</kbd>.
|
||||
|
||||
## Awesome ui
|
||||
|
||||
SpaceVim has a minimalistic and distraction free UI:
|
||||
|
||||
- custom airline with color feedback according to current check status
|
||||
- custom icon in sign column and error feedbacks for checker.
|
||||
|
||||
### Colorschemes
|
||||
|
||||
The default colorscheme of SpaceVim is [gruvbox](https://github.com/morhetz/gruvbox). There are two variants of this colorscheme, a dark one and a light one. Some aspects of these colorscheme can be customized in the custom configuration file, read <kbd>:h gruvbox</kbd>.
|
||||
|
||||
It is possible to define your default themes in your `~/.SpaceVim.d/init.vim` with the variable colorschemes. For instance, to specify [vim-one with dark colorscheme](https://github.com/rakr/vim-one):
|
||||
|
||||
```vim
|
||||
let g:spacevim_colorscheme = 'one'
|
||||
let g:spacevim_colorscheme_bg = 'dark'
|
||||
```
|
||||
|
||||
Mappings | Description
|
||||
------------- | ----------------------
|
||||
<kbd>SPC T n</kbd> | switch to next random colorscheme listed in colorscheme layer.
|
||||
<kbd>SPC T s</kbd> | select a theme using a unite buffer.
|
||||
|
||||
all the included colorscheme can be found in [colorscheme layer](http://spacevim.org/layers/colorscheme/).
|
||||
|
||||
**NOTE**:
|
||||
|
||||
SpaceVim use true colors by default, so you should make sure your terminal support true colors. for more information see: [Colours in terminal](https://gist.github.com/XVilka/8346728)
|
||||
|
||||
### Font
|
||||
|
||||
The default font used by SpaceVim is DejaVu Sans Mono for Powerline. It is recommended to install it on your system if you wish to use it.
|
||||
|
||||
To change the default font set the variable `g:spacevim_guifont` in your `~/.SpaceVim.d/init.vim` file. By default its value is:
|
||||
|
||||
```vim
|
||||
let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
|
||||
```
|
||||
|
||||
If the specified font is not found, the fallback one will be used (depends on your system). Also note that changing this value has no effect if you are running Vim/Neovim in terminal.
|
||||
|
||||
### UI Toggles
|
||||
|
||||
Some UI indicators can be toggled on and off (toggles start with t and T):
|
||||
|
||||
Key Binding | Description
|
||||
----------- | -----------
|
||||
SPC t 8 | highlight any character past the 80th column
|
||||
SPC t f | display the fill column (by default the fill column is set to 80)
|
||||
SPC t h h | toggle highlight of the current line
|
||||
SPC t h i | toggle highlight indentation levels
|
||||
SPC t h c | toggle highlight indentation current column
|
||||
SPC t h s | toggle syntax highlighting
|
||||
SPC t i | toggle indentation guide at point
|
||||
SPC t n | toggle line numbers
|
||||
SPC T ~ | display ~ in the fringe on empty lines
|
||||
SPC T F | toggle frame fullscreen
|
||||
SPC T f | toggle display of the fringe
|
||||
SPC T m | toggle menu bar
|
||||
SPC T t | toggle tool bar
|
||||
|
||||
### Statusline && tabline
|
||||
|
||||
The statusline and tabline is a heavily customized [airline](https://github.com/vim-airline/vim-airline) with the following capabilities:
|
||||
|
||||
- tabline index of each buffer or tab.
|
||||
- vim mode (INSERT/NORMAL etc.)
|
||||
- git info : diff/branch
|
||||
- checker info: numbers of errors and warnings.
|
||||
- trailing line number.
|
||||
|
||||
Key Binding | Description
|
||||
----------- | -----------
|
||||
`SPC [1-9]` | jump to the index of tabline.
|
||||
|
||||
|
||||
## Manual
|
||||
|
||||
### Discovering
|
||||
|
||||
#### Mappings
|
||||
|
||||
##### Mappings guide
|
||||
|
||||
A guide buffer is displayed each time the prefix key is pressed in normal mode. It lists the available key bindings and their short description.
|
||||
The prefix can be `[SPC]`, `[Window]`, `denite`, `<leader>` and `[unite]`.
|
||||
|
||||
The default key of these prefix is:
|
||||
|
||||
Prefix name | custom option and default value | description
|
||||
----------- | ------------------------------- | -----------
|
||||
`[SPC]` | NONE / `<Space>` | default mapping prefix of SpaceVim
|
||||
|
||||
By default the guide buffer will be displayed 1000ms after the key has been pressed. You can change the delay by setting `'timeoutlen'` option to your liking (the value is in milliseconds).
|
||||
|
||||
# Features
|
||||
|
||||
## Awesome ui
|
||||
@ -496,65 +785,6 @@ Key | Mode | Action
|
||||
`<leader>`+`W` | Normal | Wiki
|
||||
`<leader>`+`K` | Normal | Thesaurus
|
||||
|
||||
#### Custom configuration
|
||||
SpaceVim use `~/.SpaceVim.d/init.vim` as default global init file. you can set
|
||||
SpaceVim-options or config layers in it. SpaceVim also will add `~/.SpaceVim.d/`
|
||||
into runtimepath. so you can write your own vim script in it.
|
||||
|
||||
SpaceVim also support local config file for project, the init file is `.SpaceVim.d/init.vim`
|
||||
in the root of your project. `.SpaceVim.d/` will also be added into runtimepath.
|
||||
|
||||
here is an example config file for SpaceVim:
|
||||
|
||||
```vim
|
||||
" Here are some basic customizations, please refer to the ~/.SpaceVim.d/init.vim
|
||||
" file for all possible options:
|
||||
let g:spacevim_default_indent = 3
|
||||
let g:spacevim_max_column = 80
|
||||
|
||||
" Change the default directory where all miscellaneous persistent files go.
|
||||
" By default it is ~/.cache/vimfiles.
|
||||
let g:spacevim_plugin_bundle_dir = '~/.cache/vimfiles'
|
||||
|
||||
" set SpaceVim colorscheme
|
||||
let g:spacevim_colorscheme = 'jellybeans'
|
||||
|
||||
" Set plugin manager, you want to use, default is dein.vim
|
||||
let g:spacevim_plugin_manager = 'dein' " neobundle or dein or vim-plug
|
||||
|
||||
" use space as `<Leader>`
|
||||
let mapleader = "\<space>"
|
||||
|
||||
" Set windows shortcut leader [Window], default is `s`
|
||||
let g:spacevim_windows_leader = 's'
|
||||
|
||||
" Set unite work flow shortcut leader [Unite], default is `f`
|
||||
let g:spacevim_unite_leader = 'f'
|
||||
|
||||
" By default, language specific plugins are not loaded. This can be changed
|
||||
" with the following, then the plugins for go development will be loaded.
|
||||
call SpaceVim#layers#load('lang#go')
|
||||
|
||||
" loaded ui layer
|
||||
call SpaceVim#layers#load('ui')
|
||||
|
||||
" If there is a particular plugin you don't like, you can define this
|
||||
" variable to disable them entirely:
|
||||
let g:spacevim_disabled_plugins=[
|
||||
\ ['junegunn/fzf.vim'],
|
||||
\ ]
|
||||
|
||||
" If you want to add some custom plugins, use these options:
|
||||
let g:spacevim_custom_plugins = [
|
||||
\ ['plasticboy/vim-markdown', {'on_ft' : 'markdown'}],
|
||||
\ ['wsdjeg/GitHub.vim'],
|
||||
\ ]
|
||||
|
||||
" set the guifont
|
||||
let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
|
||||
```
|
||||
|
||||
Comprehensive documentation is available for each layer by <kbd>:h SpaceVim</kbd>.
|
||||
|
||||
<!-- plublic links -->
|
||||
[dein.vim]: https://github.com/Shougo/dein.vim
|
||||
|
18
docs/layers/autocomplete.md
Normal file
18
docs/layers/autocomplete.md
Normal file
@ -0,0 +1,18 @@
|
||||
# [Layers](https://spacevim.org/layers) > autocomplete
|
||||
|
||||
SpaceVim uses neocomplete as the default completion engine if vim has lua
|
||||
support. If there is no lua support, neocomplcache will be used for the
|
||||
completion engine. Spacevim uses deoplete as the default completion engine
|
||||
for neovim. Deoplete requires neovim to be compiled with python support. For
|
||||
more information about python support in neovim, please read neovim's documentation `:h provider-python`.
|
||||
|
||||
SpaceVim includes YouCompleteMe, but it is disabled by default. To enable
|
||||
ycm, see `:h g:spacevim_enable_ycm`.
|
||||
|
||||
SpaceVim use neosnippet as the default snippet engine. The default snippets
|
||||
are provided by `Shougo/neosnippet-snippets`. For more information, please read
|
||||
`:h neosnippet`. Neosnippet support custom snippets, and the default snippets
|
||||
directory is `~/.SpaceVim/snippets/`. If `g:spacevim_force_global_config = 1`,
|
||||
SpaceVim will not append `./.SpaceVim/snippets` as default snippets directory.
|
||||
|
||||
## Key Mappings
|
22
docs/layers/chat.md
Normal file
22
docs/layers/chat.md
Normal file
@ -0,0 +1,22 @@
|
||||
# [Layers](https://spacevim.org/layers) > chat
|
||||
|
||||
SpaceVim chatting layer provide chatting feature in vim.
|
||||
|
||||
## plugins
|
||||
|
||||
|
||||
Name | Description
|
||||
----- | ------------------
|
||||
[vim-chat](https://github.com/vim-chat/vim-chat) | chatting in vim.
|
||||
|
||||
## Key Mappings
|
||||
|
||||
`Alt + x` : open chatting buffer for qq.
|
||||
`Alt + w` : open chatting buffer for weixin.
|
||||
|
||||
within chatting buffer:
|
||||
|
||||
`Alt + Left/Right` : switch between buffer.
|
||||
`Alt + 1-9` : jump to specified channel.
|
||||
|
||||
for more mappings in chatting buffer, please read <kbd>:h vim-chat</kbd>.
|
@ -3,3 +3,4 @@
|
||||
Name | Description | Documentation
|
||||
----- |:----:| ------------------
|
||||
default | better default for vim and neovim | [documentation](https://spacevim.org/layers/default)
|
||||
chat | chatting in vim | [documentation](https://spacevim.org/layers/chat)
|
||||
|
Loading…
Reference in New Issue
Block a user