mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 00:10:07 +08:00
Merge remote-tracking branch 'upstream/dev' into feature/lsp-layer
This commit is contained in:
commit
4b4fddf4ae
@ -10,7 +10,7 @@
|
||||
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
|
||||
[![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/dev?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/dev)
|
||||
[![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev)
|
||||
![Version](https://img.shields.io/badge/version-0.6.0--dev-FF00CC.svg--dev-FF00CC.svg)
|
||||
![Version](https://img.shields.io/badge/version-0.6.0--dev-FF00CC.svg)
|
||||
[![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")
|
||||
|
@ -157,6 +157,27 @@ let g:spacevim_enable_cursorline = 1
|
||||
"
|
||||
let g:spacevim_statusline_separator = 'arrow'
|
||||
let g:spacevim_statusline_inactive_separator = 'arrow'
|
||||
|
||||
""
|
||||
" Define the left section of statusline in active windows. By default:
|
||||
" >
|
||||
" let g:spacevim_statusline_left_sections =
|
||||
" \ [
|
||||
" \ 'winnr',
|
||||
" \ 'filename',
|
||||
" \ 'major mode',
|
||||
" \ 'minor mode lighters',
|
||||
" \ 'version control info'
|
||||
" \ ]
|
||||
" <
|
||||
let g:spacevim_statusline_left_sections = ['winnr', 'filename', 'major mode', 'minor mode lighters', 'version control info']
|
||||
""
|
||||
" Define the right section of statusline in active windows. By default:
|
||||
" >
|
||||
" let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos']
|
||||
" <
|
||||
let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos', 'percentage']
|
||||
|
||||
""
|
||||
" Enable/Disable unicode symbols in statusline
|
||||
let g:spacevim_statusline_unicode_symbols = 1
|
||||
@ -288,8 +309,8 @@ let g:spacevim_auto_disable_touchpad = 1
|
||||
let g:spacevim_debug_level = 1
|
||||
let g:spacevim_hiddenfileinfo = 1
|
||||
let g:spacevim_plugin_groups_exclude = []
|
||||
let g:spacevim_gitcommit_pr_icon = 'p'
|
||||
let g:spacevim_gitcommit_issue_icon = 'i'
|
||||
let g:spacevim_gitcommit_pr_icon = ''
|
||||
let g:spacevim_gitcommit_issue_icon = ''
|
||||
""
|
||||
" Set SpaceVim buffer index type, default is 0.
|
||||
" >
|
||||
|
@ -47,14 +47,13 @@ let s:system['isDarwin'] = function('s:isDarwin')
|
||||
|
||||
function! s:fileformat() abort
|
||||
let fileformat = ''
|
||||
|
||||
if &fileformat ==? 'dos'
|
||||
let fileformat = ''
|
||||
let fileformat = ''
|
||||
elseif &fileformat ==? 'unix'
|
||||
if s:isDarwin()
|
||||
let fileformat = ''
|
||||
let fileformat = ''
|
||||
else
|
||||
let fileformat = ''
|
||||
let fileformat = ''
|
||||
endif
|
||||
elseif &fileformat ==? 'mac'
|
||||
let fileformat = ''
|
||||
|
@ -5,6 +5,10 @@ function! s:self.current_time() abort
|
||||
return strftime('%I:%M %p')
|
||||
endfunction
|
||||
|
||||
function! s:self.current_date() abort
|
||||
return strftime('%a %b %d')
|
||||
endfunction
|
||||
|
||||
|
||||
function! SpaceVim#api#time#get() abort
|
||||
return deepcopy(s:self)
|
||||
|
@ -111,7 +111,7 @@ function! s:self._update_content() abort
|
||||
let left_max_key_len = max([len(key.key), left_max_key_len])
|
||||
elseif type(key.key) == 3 " is a list
|
||||
let left_max_key_len = max([len(join(key.key, '/')), left_max_key_len])
|
||||
elseif type(key.key) == 4 " is a list
|
||||
elseif type(key.key) == 4 " is a dict
|
||||
let left_max_key_len = max([len(key.key.name), left_max_key_len])
|
||||
endif
|
||||
endfor
|
||||
@ -122,7 +122,7 @@ function! s:self._update_content() abort
|
||||
elseif type(key.key) == 3 " is a list
|
||||
let g:wsd = key.key
|
||||
let right_max_key_len = max([len(join(key.key, '/')), right_max_key_len])
|
||||
elseif type(key.key) == 4 " is a list
|
||||
elseif type(key.key) == 4 " is a dict
|
||||
let right_max_key_len = max([len(key.key.name), right_max_key_len])
|
||||
endif
|
||||
endfor
|
||||
@ -140,6 +140,23 @@ function! s:self._update_content() abort
|
||||
call extend(self._handle_inputs, {left.key : left.func})
|
||||
endif
|
||||
elseif type(left.key) == 3
|
||||
let line .= '[' . join(left.key, '/') . '] '
|
||||
let line .= repeat(' ', left_max_key_len - len(join(left.key, '/')))
|
||||
let line .= left.desc
|
||||
let begin = 1
|
||||
for key in left.key
|
||||
call self.highlight_keys(left.exit, i + 2, begin, begin + len(key))
|
||||
let begin = begin + len(key) + 1
|
||||
endfor
|
||||
if !empty(left.cmd)
|
||||
for key in left.key
|
||||
call extend(self._handle_inputs, {key : left.cmd})
|
||||
endfor
|
||||
elseif !empty(left.func)
|
||||
for key in left.key
|
||||
call extend(self._handle_inputs, {key : left.func})
|
||||
endfor
|
||||
endif
|
||||
elseif type(left.key) == 4
|
||||
let line .= '[' . left.key.name . '] '
|
||||
let line .= repeat(' ', left_max_key_len - len(left.key.name))
|
||||
@ -180,6 +197,17 @@ function! s:self._update_content() abort
|
||||
call extend(self._handle_inputs, {key : right.func})
|
||||
endfor
|
||||
endif
|
||||
elseif type(right.key) == 4
|
||||
let line .= '[' . right.key.name . '] '
|
||||
let line .= repeat(' ', right_max_key_len - len(right.key.name))
|
||||
let line .= right.desc
|
||||
let begin = 41
|
||||
for pos in right.key.pos
|
||||
call self.highlight_keys(right.exit, i + 2, begin + pos[0], begin + pos[1])
|
||||
endfor
|
||||
for handles in right.key.handles
|
||||
call extend(self._handle_inputs, {handles[0] : handles[1]})
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
call append(line('$'), line)
|
||||
|
22
autoload/SpaceVim/api/unicode/icon.vim
Normal file
22
autoload/SpaceVim/api/unicode/icon.vim
Normal file
@ -0,0 +1,22 @@
|
||||
scriptencoding utf-8
|
||||
let s:self = {}
|
||||
|
||||
function! s:self.battery_status(v) abort
|
||||
if a:v >= 90
|
||||
return ''
|
||||
elseif a:v >= 75
|
||||
return ''
|
||||
elseif a:v >= 50
|
||||
return ''
|
||||
elseif a:v >= 25
|
||||
return ''
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#api#unicode#icon#get()
|
||||
|
||||
return deepcopy(s:self)
|
||||
|
||||
endfunction
|
@ -37,7 +37,7 @@ function! SpaceVim#commands#load() abort
|
||||
\ SPUpdate call SpaceVim#commands#update_plugin(<f-args>)
|
||||
|
||||
""
|
||||
" Command for reinstall plugin, support completion of plugin anme.
|
||||
" Command for reinstall plugin, support completion of plugin name.
|
||||
command! -nargs=+
|
||||
\ -complete=custom,SpaceVim#commands#complete_plugin
|
||||
\ SPReinstall call SpaceVim#commands#reinstall_plugin(<f-args>)
|
||||
|
@ -124,6 +124,7 @@ function! SpaceVim#default#SetPlugins() abort
|
||||
call add(g:spacevim_plugin_groups, 'format')
|
||||
call add(g:spacevim_plugin_groups, 'chat')
|
||||
call add(g:spacevim_plugin_groups, 'git')
|
||||
call add(g:spacevim_plugin_groups, 'VersionControl')
|
||||
call add(g:spacevim_plugin_groups, 'javascript')
|
||||
call add(g:spacevim_plugin_groups, 'ruby')
|
||||
call add(g:spacevim_plugin_groups, 'python')
|
||||
|
99
autoload/SpaceVim/layers/VersionControl.vim
Normal file
99
autoload/SpaceVim/layers/VersionControl.vim
Normal file
@ -0,0 +1,99 @@
|
||||
function! SpaceVim#layers#VersionControl#config() abort
|
||||
let g:_spacevim_mappings_space.g = get(g:_spacevim_mappings_space, 'g', {'name' : '+VersionControl/git'})
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', '.'], 'call call('
|
||||
\ . string(s:_function('s:buffer_transient_state')) . ', [])',
|
||||
\ 'buffer transient state', 1)
|
||||
endfunction
|
||||
|
||||
function! s:buffer_transient_state() abort
|
||||
let state = SpaceVim#api#import('transient_state')
|
||||
call state.set_title('VCS Transient State')
|
||||
call state.defind_keys(
|
||||
\ {
|
||||
\ 'layout' : 'vertical split',
|
||||
\ 'left' : [
|
||||
\ {
|
||||
\ 'key' : 'n',
|
||||
\ 'desc' : 'next hunk',
|
||||
\ 'func' : '',
|
||||
\ 'cmd' : 'normal ]c',
|
||||
\ 'exit' : 0,
|
||||
\ },
|
||||
\ {
|
||||
\ 'key' : ['N', 'p'],
|
||||
\ 'desc' : 'previous hunk',
|
||||
\ 'func' : '',
|
||||
\ 'cmd' : 'normal [c',
|
||||
\ 'exit' : 0,
|
||||
\ },
|
||||
\ {
|
||||
\ 'key' : ['r', 's', 'h'],
|
||||
\ 'desc' : 'revert/stage/show',
|
||||
\ 'func' : '',
|
||||
\ 'cmd' : 'normal [c',
|
||||
\ 'exit' : 0,
|
||||
\ },
|
||||
\ {
|
||||
\ 'key' : 't',
|
||||
\ 'desc' : 'toggle diff signs',
|
||||
\ 'func' : '',
|
||||
\ 'cmd' : '',
|
||||
\ 'exit' : 0,
|
||||
\ },
|
||||
\ ],
|
||||
\ 'right' : [
|
||||
\ {
|
||||
\ 'key' : {
|
||||
\ 'name' : 'w/u',
|
||||
\ 'pos': [[0,1], [2,3]],
|
||||
\ 'handles' : [
|
||||
\ ['w', 'Gina add %'],
|
||||
\ ['u', 'Gina reset %'],
|
||||
\ ],
|
||||
\ },
|
||||
\ 'desc' : 'stage/unstage in current file',
|
||||
\ 'func' : '',
|
||||
\ 'cmd' : '',
|
||||
\ 'exit' : 0,
|
||||
\ },
|
||||
\ {
|
||||
\ 'key' : ['c', 'C'],
|
||||
\ 'desc' : 'commit with popup/direct commit',
|
||||
\ 'func' : '',
|
||||
\ 'cmd' : '',
|
||||
\ 'exit' : 1,
|
||||
\ },
|
||||
\ {
|
||||
\ 'key' : ['f', 'F', 'P'],
|
||||
\ 'desc' : 'fetch/pull/push popup',
|
||||
\ 'func' : '',
|
||||
\ 'cmd' : '',
|
||||
\ 'exit' : 1,
|
||||
\ },
|
||||
\ {
|
||||
\ 'key' : ['l', 'D'],
|
||||
\ 'desc' : 'log/diff popup',
|
||||
\ 'func' : '',
|
||||
\ 'cmd' : '',
|
||||
\ 'exit' : 1,
|
||||
\ },
|
||||
\ ],
|
||||
\ }
|
||||
\ )
|
||||
call state.open()
|
||||
endfunction
|
||||
|
||||
" function() wrapper
|
||||
if v:version > 703 || v:version == 703 && has('patch1170')
|
||||
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
|
||||
endif
|
@ -15,6 +15,8 @@ let s:TIME = SpaceVim#api#import('time')
|
||||
let s:HI = SpaceVim#api#import('vim#highlight')
|
||||
let s:STATUSLINE = SpaceVim#api#import('vim#statusline')
|
||||
let s:VIMCOMP = SpaceVim#api#import('vim#compatible')
|
||||
let s:SYSTEM = SpaceVim#api#import('system')
|
||||
let s:ICON = SpaceVim#api#import('unicode#icon')
|
||||
|
||||
" init
|
||||
let s:separators = {
|
||||
@ -64,16 +66,133 @@ let s:modes = {
|
||||
\ },
|
||||
\ }
|
||||
|
||||
" TODO This can not be deleted, it is used for toggle section
|
||||
let s:loaded_sections = ['syntax checking', 'major mode', 'minor mode lighters', 'version control info', 'cursorpos']
|
||||
|
||||
function! s:battery_status() abort
|
||||
if executable('acpi')
|
||||
return ' ⚡' . substitute(split(system('acpi'))[-1], '%', '%%', 'g') . ' '
|
||||
let s:loaded_sections_r = g:spacevim_statusline_right_sections
|
||||
let s:loaded_sections_l = g:spacevim_statusline_left_sections
|
||||
|
||||
" build in sections for SpaceVim statusline
|
||||
function! s:winnr(...) abort
|
||||
if a:0 > 1
|
||||
if g:spacevim_windows_index_type == 3
|
||||
return ' ' . winnr() . ' '
|
||||
else
|
||||
return ' ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' '
|
||||
endif
|
||||
else
|
||||
if g:spacevim_enable_statusline_display_mode == 1
|
||||
return '%{SpaceVim#layers#core#statusline#mode(mode())} %{SpaceVim#layers#core#statusline#mode_text(mode())}' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' '
|
||||
elseif g:spacevim_windows_index_type == 3
|
||||
return '%{SpaceVim#layers#core#statusline#mode(mode())} ' . winnr() . ' '
|
||||
else
|
||||
return '%{SpaceVim#layers#core#statusline#mode(mode())} ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' '
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:filename() abort
|
||||
let name = fnamemodify(bufname('%'), ':t')
|
||||
if empty(name)
|
||||
let name = 'No Name'
|
||||
endif
|
||||
return "%{ &modified ? ' * ' : ' - '}" . s:filesize() . name . ' '
|
||||
endfunction
|
||||
|
||||
if g:spacevim_statusline_unicode_symbols == 1
|
||||
let g:_spacevim_statusline_fileformat = s:SYSTEM.fileformat()
|
||||
else
|
||||
let g:_spacevim_statusline_fileformat = &ff
|
||||
endif
|
||||
function! s:fileformat() abort
|
||||
return '%{" " . g:_spacevim_statusline_fileformat . " | " . (&fenc!=""?&fenc:&enc) . " "}'
|
||||
endfunction
|
||||
|
||||
function! s:major_mode() abort
|
||||
return '%{empty(&ft)? "" : " " . &ft . " "}'
|
||||
endfunction
|
||||
|
||||
function! s:modes() abort
|
||||
let m = ' ❖ '
|
||||
for mode in s:loaded_modes
|
||||
if g:spacevim_statusline_unicode_symbols == 1
|
||||
let m .= s:modes[mode].icon . ' '
|
||||
else
|
||||
let m .= s:modes[mode].icon_asc . ' '
|
||||
endif
|
||||
endfor
|
||||
return m . ' '
|
||||
endfunction
|
||||
|
||||
function! s:git_branch() abort
|
||||
if exists('g:loaded_fugitive')
|
||||
let l:head = fugitive#head()
|
||||
if empty(l:head)
|
||||
call fugitive#detect(getcwd())
|
||||
let l:head = fugitive#head()
|
||||
endif
|
||||
return empty(l:head) ? '' : ' '.l:head . ' '
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:percentage() abort
|
||||
return ' %P '
|
||||
endfunction
|
||||
|
||||
function! s:cursorpos() abort
|
||||
return ' %l:%c '
|
||||
endfunction
|
||||
|
||||
function! s:time() abort
|
||||
return ' ' . s:TIME.current_time() . ' '
|
||||
endfunction
|
||||
|
||||
function! s:date() abort
|
||||
|
||||
return ' ' . s:TIME.current_date() . ' '
|
||||
|
||||
endfunction
|
||||
|
||||
function! s:whitespace() abort
|
||||
let ln = search('\s\+$', 'n')
|
||||
if ln != 0
|
||||
return ' trailing[' . ln . '] '
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:battery_status() abort
|
||||
if executable('acpi')
|
||||
let battery = split(system('acpi'))[-1][:-2]
|
||||
if g:spacevim_statusline_unicode_symbols
|
||||
return ' ' . s:ICON.battery_status(battery) . ' '
|
||||
else
|
||||
return ' ⚡' . battery . ' '
|
||||
endif
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
let s:registed_sections = {
|
||||
\ 'winnr' : function('s:winnr'),
|
||||
\ 'filename' : function('s:filename'),
|
||||
\ 'fileformat' : function('s:fileformat'),
|
||||
\ 'major mode' : function('s:major_mode'),
|
||||
\ 'minor mode lighters' : function('s:modes'),
|
||||
\ 'version control info' : function('s:git_branch'),
|
||||
\ 'cursorpos' : function('s:cursorpos'),
|
||||
\ 'percentage' : function('s:percentage'),
|
||||
\ 'time' : function('s:time'),
|
||||
\ 'date' : function('s:date'),
|
||||
\ 'whitespace' : function('s:whitespace'),
|
||||
\ 'battery status' : function('s:battery_status'),
|
||||
\ }
|
||||
|
||||
|
||||
function! s:check_mode() abort
|
||||
if mode() == 'n'
|
||||
return 'n'
|
||||
@ -109,10 +228,6 @@ function! s:search_status() abort
|
||||
return ' ' . (str2nr(tt) - str2nr(ct) + 1) . '/' . tt . ' '
|
||||
endfunction
|
||||
|
||||
function! s:time() abort
|
||||
return ' ' . s:TIME.current_time() . ' '
|
||||
endfunction
|
||||
|
||||
if g:spacevim_enable_neomake
|
||||
function! s:syntax_checking()
|
||||
if !exists('g:loaded_neomake')
|
||||
@ -151,69 +266,6 @@ else
|
||||
endfunction
|
||||
endif
|
||||
|
||||
function! s:winnr(...) abort
|
||||
if a:0 > 1
|
||||
if g:spacevim_windows_index_type == 3
|
||||
return ' ' . winnr() . ' '
|
||||
else
|
||||
return ' ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' '
|
||||
endif
|
||||
else
|
||||
if g:spacevim_enable_statusline_display_mode == 1
|
||||
return '%{SpaceVim#layers#core#statusline#mode(mode())} %{SpaceVim#layers#core#statusline#mode_text(mode())}' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' '
|
||||
elseif g:spacevim_windows_index_type == 3
|
||||
return '%{SpaceVim#layers#core#statusline#mode(mode())} ' . winnr() . ' '
|
||||
else
|
||||
return '%{SpaceVim#layers#core#statusline#mode(mode())} ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' '
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:filename() abort
|
||||
let name = fnamemodify(bufname('%'), ':t')
|
||||
if empty(name)
|
||||
let name = 'No Name'
|
||||
endif
|
||||
return (&modified ? ' * ' : ' - ') . s:filesize() . name . ' '
|
||||
endfunction
|
||||
|
||||
function! s:git_branch() abort
|
||||
if exists('g:loaded_fugitive')
|
||||
let l:head = fugitive#head()
|
||||
if empty(l:head)
|
||||
call fugitive#detect(getcwd())
|
||||
let l:head = fugitive#head()
|
||||
endif
|
||||
return empty(l:head) ? '' : ' '.l:head . ' '
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:whitespace() abort
|
||||
let ln = search('\s\+$', 'n')
|
||||
if ln != 0
|
||||
return ' trailing[' . ln . '] '
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:cursorpos() abort
|
||||
return ' %l:%c '
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:modes() abort
|
||||
let m = ' ❖ '
|
||||
for mode in s:loaded_modes
|
||||
if g:spacevim_statusline_unicode_symbols == 1
|
||||
let m .= s:modes[mode].icon . ' '
|
||||
else
|
||||
let m .= s:modes[mode].icon_asc . ' '
|
||||
endif
|
||||
endfor
|
||||
return m . ' '
|
||||
endfunction
|
||||
|
||||
function! s:filesize() abort
|
||||
let l:size = getfsize(bufname('%'))
|
||||
@ -280,40 +332,18 @@ function! SpaceVim#layers#core#statusline#get(...) abort
|
||||
endfunction
|
||||
|
||||
function! s:active() abort
|
||||
let lsec = [s:winnr(), s:filename()]
|
||||
if index(s:loaded_sections, 'search status') != -1
|
||||
call add(lsec, s:search_status())
|
||||
endif
|
||||
if index(s:loaded_sections, 'major mode') != -1 && !empty(&filetype)
|
||||
call add(lsec, ' ' . &filetype . ' ')
|
||||
endif
|
||||
let lsec = []
|
||||
for section in s:loaded_sections_l
|
||||
if has_key(s:registed_sections, section)
|
||||
call add(lsec, call(s:registed_sections[section], []))
|
||||
endif
|
||||
endfor
|
||||
let rsec = []
|
||||
if index(s:loaded_sections, 'syntax checking') != -1 && s:syntax_checking() != ''
|
||||
call add(lsec, s:syntax_checking())
|
||||
endif
|
||||
|
||||
if index(s:loaded_sections, 'minor mode lighters') != -1
|
||||
call add(lsec, s:modes())
|
||||
endif
|
||||
if index(s:loaded_sections, 'version control info') != -1
|
||||
call add(lsec, s:git_branch())
|
||||
endif
|
||||
call add(lsec, SpaceVim#plugins#searcher#count())
|
||||
if index(s:loaded_sections, 'battery status') != -1
|
||||
call add(rsec, s:battery_status())
|
||||
endif
|
||||
call add(rsec, '%{" " . &ff . " | " . (&fenc!=""?&fenc:&enc) . " "}')
|
||||
if index(s:loaded_sections, 'cursorpos') != -1
|
||||
call add(rsec, s:cursorpos())
|
||||
endif
|
||||
call add(rsec, ' %P ')
|
||||
if index(s:loaded_sections, 'time') != -1
|
||||
call add(rsec, s:time())
|
||||
endif
|
||||
|
||||
if index(s:loaded_sections, 'whitespace') != -1
|
||||
call add(rsec, s:whitespace())
|
||||
endif
|
||||
for section in s:loaded_sections_r
|
||||
if has_key(s:registed_sections, section)
|
||||
call add(rsec, call(s:registed_sections[section], []))
|
||||
endif
|
||||
endfor
|
||||
let fname = s:buffer_name()
|
||||
return s:STATUSLINE.build(lsec, rsec, s:lsep, s:rsep, fname,
|
||||
\ 'SpaceVim_statusline_a', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z')
|
||||
@ -388,11 +418,26 @@ function! SpaceVim#layers#core#statusline#toggle_mode(name) abort
|
||||
let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
||||
endfunction
|
||||
|
||||
let s:section_old_pos = {
|
||||
\ }
|
||||
|
||||
function! SpaceVim#layers#core#statusline#toggle_section(name) abort
|
||||
if index(s:loaded_sections, a:name) != -1
|
||||
call remove(s:loaded_sections, index(s:loaded_sections, a:name))
|
||||
else
|
||||
call add(s:loaded_sections, a:name)
|
||||
if index(s:loaded_sections_l, a:name) == -1
|
||||
\ && index(s:loaded_sections_r, a:name) == -1
|
||||
\ && !has_key(s:section_old_pos, a:name)
|
||||
call add(s:loaded_sections_r, a:name)
|
||||
elseif index(s:loaded_sections_r, a:name) != -1
|
||||
let s:section_old_pos[a:name] = ['r', index(s:loaded_sections_r, a:name)]
|
||||
call remove(s:loaded_sections_r, index(s:loaded_sections_r, a:name))
|
||||
elseif index(s:loaded_sections_l, a:name) != -1
|
||||
let s:section_old_pos[a:name] = ['l', index(s:loaded_sections_l, a:name)]
|
||||
call remove(s:loaded_sections_l, index(s:loaded_sections_l, a:name))
|
||||
elseif has_key(s:section_old_pos, a:name)
|
||||
if s:section_old_pos[a:name][0] == 'r'
|
||||
call insert(s:loaded_sections_r, a:name, s:section_old_pos[a:name][1])
|
||||
else
|
||||
call insert(s:loaded_sections_l, a:name, s:section_old_pos[a:name][1])
|
||||
endif
|
||||
endif
|
||||
let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
||||
endfunction
|
||||
@ -412,6 +457,8 @@ function! SpaceVim#layers#core#statusline#config() abort
|
||||
\ 'toggle the major mode', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'b'], 'call SpaceVim#layers#core#statusline#toggle_section("battery status")',
|
||||
\ 'toggle the battery status', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'd'], 'call SpaceVim#layers#core#statusline#toggle_section("date")',
|
||||
\ 'toggle the date', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 't'], 'call SpaceVim#layers#core#statusline#toggle_section("time")',
|
||||
\ 'toggle the time', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'p'], 'call SpaceVim#layers#core#statusline#toggle_section("cursorpos")',
|
||||
@ -533,4 +580,16 @@ function! SpaceVim#layers#core#statusline#unite_mode()
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#layers#core#statusline#register_sections(name, func)
|
||||
|
||||
if has_key(s:registed_sections, a:name)
|
||||
call SpaceVim#logger#info('statusline build-in section ' . a:name . ' has been changed!')
|
||||
call extend(s:registed_sections, {a:name : a:func})
|
||||
else
|
||||
call extend(s:registed_sections, {a:name : a:func})
|
||||
endif
|
||||
|
||||
endfunction
|
||||
|
||||
|
||||
" vim:set et sw=2 cc=80:
|
||||
|
@ -21,6 +21,7 @@ function! SpaceVim#layers#edit#plugins() abort
|
||||
\ ['haya14busa/vim-easyoperator-line'],
|
||||
\ ['editorconfig/editorconfig-vim', { 'merged' : 0}],
|
||||
\ ['floobits/floobits-neovim', { 'on_cmd' : ['FlooJoinWorkspace','FlooShareDirPublic','FlooShareDirPrivate']}],
|
||||
\ ['osyo-manga/vim-jplus', { 'on_map' : '<Plug>(jplus' }],
|
||||
\ ]
|
||||
if executable('fcitx')
|
||||
call add(plugins,['lilydjwg/fcitx.vim', { 'on_event' : 'InsertEnter'}])
|
||||
@ -44,6 +45,12 @@ function! SpaceVim#layers#edit#config() abort
|
||||
"noremap <SPACE> <Plug>(wildfire-fuel)
|
||||
vnoremap <C-SPACE> <Plug>(wildfire-water)
|
||||
let g:wildfire_objects = ["i'", 'i"', 'i)', 'i]', 'i}', 'ip', 'it']
|
||||
|
||||
" osyo-manga/vim-jplus {{{
|
||||
nmap <silent> J <Plug>(jplus)
|
||||
vmap <silent> J <Plug>(jplus)
|
||||
" }}}
|
||||
|
||||
let g:_spacevim_mappings_space.x = {'name' : '+Text'}
|
||||
let g:_spacevim_mappings_space.x.a = {'name' : '+align'}
|
||||
let g:_spacevim_mappings_space.x.d = {'name' : '+delete'}
|
||||
|
@ -1,8 +1,7 @@
|
||||
function! SpaceVim#layers#git#plugins() abort
|
||||
let plugins = [
|
||||
\ ['cohama/agit.vim', { 'on_cmd' : ['Agit','AgitFile']}],
|
||||
\ ['gregsexton/gitv', { 'on_cmd' : ['Gitv']}],
|
||||
\ ['junegunn/gv.vim', { 'on_cmd' : 'GV'}],
|
||||
\ ['airblade/vim-gitgutter', { 'merged' : 0}],
|
||||
\ ['tpope/vim-fugitive', { 'merged' : 0}],
|
||||
\ ]
|
||||
if has('patch-8.0.0027') || has('nvim')
|
||||
@ -15,40 +14,25 @@ endfunction
|
||||
|
||||
|
||||
function! SpaceVim#layers#git#config() abort
|
||||
let g:_spacevim_mappings_space.g = get(g:_spacevim_mappings_space, 'g', {'name' : '+VersionControl/git'})
|
||||
if has('patch-8.0.0027') || has('nvim')
|
||||
nnoremap <silent> <Leader>gd :Gina diff<CR>
|
||||
nnoremap <silent> <Leader>gs :Gina status<CR>
|
||||
nnoremap <silent> <Leader>gc :Gina commit<CR>
|
||||
nnoremap <silent> <Leader>gb :Gina blame :<CR>
|
||||
nnoremap <silent> <Leader>gp :Gina push<CR>
|
||||
nnoremap <silent> <Leader>ga :Gina add %<CR>
|
||||
nnoremap <silent> <Leader>gA :Gina add .<CR>
|
||||
let g:_spacevim_mappings.g = {'name' : '+git function',
|
||||
\ 'd' : ['Gina diff', 'git diff'],
|
||||
\ 's' : ['Gina status', 'git status'],
|
||||
\ 'c' : ['Gina commit', 'git commit'],
|
||||
\ 'b' : ['Gina blame', 'git blame'],
|
||||
\ 'p' : ['Gina push', 'git push'],
|
||||
\ 'a' : ['Gina add %', 'git add current buffer'],
|
||||
\ 'A' : ['Gina add .', 'git add all files'],
|
||||
\ }
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 's'], 'Gina status', 'git status', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'S'], 'Gina add %', 'stage current file', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'U'], 'Gina reset -q %', 'unstage current file', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'c'], 'Gina commit', 'edit git commit', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'p'], 'Gina push', 'git push', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'd'], 'Gina diff', 'view git diff', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'A'], 'Gina add .', 'state all files', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'b'], 'Gina blame', 'view git blame', 1)
|
||||
else
|
||||
nnoremap <silent> <Leader>gd :Gita diff<CR>
|
||||
nnoremap <silent> <Leader>gs :Gita status<CR>
|
||||
nnoremap <silent> <Leader>gc :Gita commit<CR>
|
||||
nnoremap <silent> <Leader>gb :Gita blame :<CR>
|
||||
nnoremap <silent> <Leader>gp :Gita push<CR>
|
||||
nnoremap <silent> <Leader>ga :Gita add %<CR>
|
||||
nnoremap <silent> <Leader>gA :Gita add .<CR>
|
||||
let g:_spacevim_mappings.g = {'name' : 'git function',
|
||||
\ 'd' : ['Gita diff', 'git diff'],
|
||||
\ 's' : ['Gita status', 'git status'],
|
||||
\ 'c' : ['Gita commit', 'git commit'],
|
||||
\ 'b' : ['Gita blame', 'git blame'],
|
||||
\ 'p' : ['Gita push', 'git push'],
|
||||
\ 'a' : ['Gita add %', 'git add current buffer'],
|
||||
\ 'A' : ['Gita add .', 'git add all files'],
|
||||
\ }
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 's'], 'Gita status', 'git status', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'S'], 'Gita add %', 'stage current file', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'U'], 'Gita reset %', 'unstage current file', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'c'], 'Gita commit', 'edit git commit', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'p'], 'Gita push', 'git push', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'd'], 'Gita diff', 'view git diff', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'A'], 'Gita add .', 'state all files', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'b'], 'Gina blame', 'view git blame', 1)
|
||||
endif
|
||||
nmap <leader>hj <plug>(signify-next-hunk)
|
||||
nmap <leader>hk <plug>(signify-prev-hunk)
|
||||
@ -59,6 +43,22 @@ function! SpaceVim#layers#git#config() abort
|
||||
autocmd FileType diff nnoremap <buffer><silent> q :bd!<CR>
|
||||
autocmd FileType gitcommit setl omnifunc=SpaceVim#plugins#gitcommit#complete
|
||||
augroup END
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'M'], 'call call('
|
||||
\ . string(function('s:display_last_commit_of_current_line')) . ', [])',
|
||||
\ 'display the last commit message of the current line', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'V'], 'AgitFile', 'View git log of current file', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'v'], 'Agit', 'View git log of current repo', 1)
|
||||
endfunction
|
||||
|
||||
function! s:display_last_commit_of_current_line() abort
|
||||
let line = line('.')
|
||||
let file = expand('%')
|
||||
let cmd = 'git log -L ' . line . ',' . line . ':' . file
|
||||
let cmd .= ' --pretty=format:"%s" -1'
|
||||
let title = systemlist(cmd)[0]
|
||||
if v:shell_error == 0
|
||||
echo 'Last commit of current line is: ' . title
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" vim:set et sw=2 cc=80:
|
||||
|
@ -28,7 +28,6 @@ function! SpaceVim#layers#tools#plugins() abort
|
||||
\ 'loadconf' : 1,
|
||||
\}],
|
||||
\ ['godlygeek/tabular', { 'on_cmd' : 'Tabularize'}],
|
||||
\ ['airblade/vim-gitgutter', { 'on_cmd' : 'GitGutterEnable'}],
|
||||
\ ['itchyny/calendar.vim', { 'on_cmd' : 'Calendar'}],
|
||||
\ ['wsdjeg/Mysql.vim', { 'on_cmd' : 'SQLGetConnection'}],
|
||||
\ ['wsdjeg/job.vim', { 'merged' : 0}],
|
||||
|
@ -2,7 +2,6 @@ scriptencoding utf-8
|
||||
function! SpaceVim#layers#ui#plugins() abort
|
||||
let plugins = [
|
||||
\ ['Yggdroot/indentLine'],
|
||||
\ ['mhinz/vim-signify'],
|
||||
\ ['majutsushi/tagbar', {'loadconf' : 1}],
|
||||
\ ['tenfyzhong/tagbar-makefile.vim', {'merged': 0}],
|
||||
\ ['tenfyzhong/tagbar-proto.vim', {'merged': 0}],
|
||||
|
@ -194,6 +194,25 @@ Set the statusline separators of statusline, default is 'arrow'
|
||||
See more details in: http://spacevim.org/documentation/#statusline
|
||||
|
||||
|
||||
*g:spacevim_statusline_left_sections*
|
||||
Define the left section of statusline in active windows. By default:
|
||||
>
|
||||
let g:spacevim_statusline_left_sections =
|
||||
\ [
|
||||
\ 'winnr',
|
||||
\ 'filename',
|
||||
\ 'major mode',
|
||||
\ 'minor mode lighters',
|
||||
\ 'version control info'
|
||||
\ ]
|
||||
<
|
||||
|
||||
*g:spacevim_statusline_right_sections*
|
||||
Define the right section of statusline in active windows. By default:
|
||||
>
|
||||
let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos']
|
||||
<
|
||||
|
||||
*g:spacevim_statusline_unicode_symbols*
|
||||
Enable/Disable unicode symbols in statusline
|
||||
|
||||
@ -451,7 +470,7 @@ COMMANDS *SpaceVim-commands*
|
||||
<
|
||||
|
||||
:SPReinstall *:SPReinstall*
|
||||
Command for reinstall plugin, support completion of plugin anme.
|
||||
Command for reinstall plugin, support completion of plugin name.
|
||||
|
||||
:SPInstall *:SPInstall*
|
||||
Command for install plugins.
|
||||
|
@ -519,6 +519,7 @@ let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
|
||||
| `SPC t m n` | toggle the cat! (if colors layer is declared in your dotfile)(TODO) |
|
||||
| `SPC t m p` | 显示/隐藏鼠标位置信息 |
|
||||
| `SPC t m t` | 显示/隐藏时间 |
|
||||
| `SPC t m d` | 显示/隐藏日期 |
|
||||
| `SPC t m T` | 显示/隐藏状态栏 |
|
||||
| `SPC t m v` | 显示/隐藏版本控制信息 |
|
||||
|
||||
|
14
docs/_posts/2017-03-30-SpaceVim-release-v0.2.0.md
Normal file
14
docs/_posts/2017-03-30-SpaceVim-release-v0.2.0.md
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
title: SpaceVim release v0.2.0
|
||||
categories: changelog
|
||||
excerpt: "Mnemonic key bindings in SpaceVim"
|
||||
---
|
||||
|
||||
# [Changelogs](https://spacevim.org/development#changelog) > SpaceVim release v0.2.0
|
||||
|
||||
SpaceVim is a community-driven vim distribution inspired by spacemacs.
|
||||
|
||||
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.
|
||||
|
||||
**Denite support:** <kbd>[Denite]</kbd> key guide for denite.
|
37
docs/_posts/2017-06-27-SpaceVim-release-v0.3.1.md
Normal file
37
docs/_posts/2017-06-27-SpaceVim-release-v0.3.1.md
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
title: SpaceVim release v0.3.1
|
||||
categories: changelog
|
||||
excerpt: "Here you can check what has been done so far."
|
||||
---
|
||||
|
||||
# [Changelogs](https://spacevim.org/development#changelog) > SpaceVim release v0.3.1
|
||||
|
||||
**Install:** https://github.com/SpaceVim/SpaceVim/wiki/Installing-SpaceVim
|
||||
|
||||
### FEATURES:
|
||||
|
||||
- Add complete function for gitcommit buffer [#568](https://github.com/SpaceVim/SpaceVim/pull/#568) [#567](https://github.com/SpaceVim/SpaceVim/pull/#567) [#579](https://github.com/SpaceVim/SpaceVim/pull/#579) [#575](https://github.com/SpaceVim/SpaceVim/pull/#575)
|
||||
- Undo quit window && redo quit window [#599](https://github.com/SpaceVim/SpaceVim/pull/#599)
|
||||
- Add mappings for buffer [#600](https://github.com/SpaceVim/SpaceVim/pull/#600)
|
||||
- Add mappings for file [#607](https://github.com/SpaceVim/SpaceVim/pull/#607)
|
||||
- Add doc for file tree [#612](https://github.com/SpaceVim/SpaceVim/pull/#612)
|
||||
- g prefix guide [#618](https://github.com/SpaceVim/SpaceVim/pull/#618)
|
||||
- z prefix guide [#662](https://github.com/SpaceVim/SpaceVim/pull/#662)
|
||||
- tmux lang layer [#658](https://github.com/SpaceVim/SpaceVim/pull/#658)
|
||||
- Improve searching feature [#652](https://github.com/SpaceVim/SpaceVim/pull/#652)
|
||||
- complete parameter for ycm [#663](https://github.com/SpaceVim/SpaceVim/pull/#663)
|
||||
- Improve searching index [#676](https://github.com/SpaceVim/SpaceVim/pull/#676)
|
||||
|
||||
|
||||
### CHANGES:
|
||||
|
||||
- Change mappings for buffer jumpping and window jumpping [#572](https://github.com/SpaceVim/SpaceVim/pull/#572)
|
||||
|
||||
### FIXES:
|
||||
|
||||
- [#564](https://github.com/SpaceVim/SpaceVim/pull/#564) Fix [Window]Q close current buffer
|
||||
- [#574](https://github.com/SpaceVim/SpaceVim/pull/#574) Fix ctrlp file finder
|
||||
- [#584](https://github.com/SpaceVim/SpaceVim/pull/#584) Fix spacevim startup errors
|
||||
- [#610](https://github.com/SpaceVim/SpaceVim/pull/#610) Support old vim version
|
||||
|
||||
|
40
docs/_posts/2017-08-05-SpaceVim-release-v0.4.0.md
Normal file
40
docs/_posts/2017-08-05-SpaceVim-release-v0.4.0.md
Normal file
@ -0,0 +1,40 @@
|
||||
---
|
||||
title: SpaceVim release v0.4.0
|
||||
categories: changelog
|
||||
excerpt: "Here you can check what has been done so far."
|
||||
---
|
||||
|
||||
# [Changelogs](https://spacevim.org/development#changelog) > SpaceVim release v0.4.0
|
||||
|
||||
### FEATURES:
|
||||
|
||||
- Add comment mappings [#683](https://github.com/SpaceVim/SpaceVim/pull/#683)
|
||||
- Achievements [#677](https://github.com/SpaceVim/SpaceVim/pull/#677)
|
||||
- Add text manipulation commands [#684](https://github.com/SpaceVim/SpaceVim/pull/#684)
|
||||
- Add text insertion commands [#685](https://github.com/SpaceVim/SpaceVim/pull/#685)
|
||||
- Add CompleteParameter [#688](https://github.com/SpaceVim/SpaceVim/pull/#688)
|
||||
- Toggle cursor position [#697](https://github.com/SpaceVim/SpaceVim/pull/#697)
|
||||
- Add background searching feture [#699](https://github.com/SpaceVim/SpaceVim/pull/#699)
|
||||
- Improve plugin manager [#702](https://github.com/SpaceVim/SpaceVim/pull/#702) [#703](https://github.com/SpaceVim/SpaceVim/pull/#703)
|
||||
- Grep on the fly [#705](https://github.com/SpaceVim/SpaceVim/pull/#705) [#709](https://github.com/SpaceVim/SpaceVim/pull/#709) [#714](https://github.com/SpaceVim/SpaceVim/pull/#714) [#717](https://github.com/SpaceVim/SpaceVim/pull/#717)
|
||||
- Add prompt api [#715](https://github.com/SpaceVim/SpaceVim/pull/#715)
|
||||
- Add web api [#726](https://github.com/SpaceVim/SpaceVim/pull/#726)
|
||||
- Add check requirement script [#736](https://github.com/SpaceVim/SpaceVim/pull/#736)
|
||||
- Add language specified mappings [#748](https://github.com/SpaceVim/SpaceVim/pull/#748)
|
||||
- Improve Java layer [#749](https://github.com/SpaceVim/SpaceVim/pull/#749)
|
||||
- Add project manager mappings [#751](https://github.com/SpaceVim/SpaceVim/pull/#751)
|
||||
- Add plugin for mark active window [#755](https://github.com/SpaceVim/SpaceVim/pull/#755) (not sure if it will be removed)
|
||||
- Add help for mappings [#756](https://github.com/SpaceVim/SpaceVim/pull/#756)
|
||||
- Update autocomplete layer doc [#759](https://github.com/SpaceVim/SpaceVim/pull/#759)
|
||||
- Add tags layer [#764](https://github.com/SpaceVim/SpaceVim/pull/#764)
|
||||
|
||||
### FIX:
|
||||
|
||||
- Fix vimfiler direction [#686](https://github.com/SpaceVim/SpaceVim/pull/#686)
|
||||
- Fix welcome page [#707](https://github.com/SpaceVim/SpaceVim/pull/#707)
|
||||
- Fix visual SPC [#708](https://github.com/SpaceVim/SpaceVim/pull/#708)
|
||||
- Fix windows support [#712](https://github.com/SpaceVim/SpaceVim/pull/#712)
|
||||
- Fix n/N hl state [#720](https://github.com/SpaceVim/SpaceVim/pull/#720)
|
||||
- Fix guibg parse [#723](https://github.com/SpaceVim/SpaceVim/pull/#723)
|
||||
- Fix unknown option [#727](https://github.com/SpaceVim/SpaceVim/pull/#727)
|
||||
- Fix select mode statusline [#737](https://github.com/SpaceVim/SpaceVim/pull/#737)
|
114
docs/_posts/2017-11-06-SpaceVim-release-v0.5.0.md
Normal file
114
docs/_posts/2017-11-06-SpaceVim-release-v0.5.0.md
Normal file
@ -0,0 +1,114 @@
|
||||
---
|
||||
title: SpaceVim release v0.5.0
|
||||
categories: changelog
|
||||
excerpt: "Many new features come out with v0.5.0"
|
||||
---
|
||||
|
||||
# [Changelogs](https://spacevim.org/development#changelog) > SpaceVim release v0.5.0
|
||||
|
||||
## New Features
|
||||
|
||||
- Add clojure layer [#964](https://github.com/SpaceVim/SpaceVim/pull/964)
|
||||
- Add lang#solidity layer [#959](https://github.com/SpaceVim/SpaceVim/pull/959)
|
||||
- Add complete script [#954](https://github.com/SpaceVim/SpaceVim/pull/954)
|
||||
- Add remote manager [#949](https://github.com/SpaceVim/SpaceVim/pull/949)
|
||||
- add wiki [#946](https://github.com/SpaceVim/SpaceVim/pull/946)
|
||||
- Added a new plugin thinca/vim-quickrun [#939](https://github.com/SpaceVim/SpaceVim/pull/939)
|
||||
- Added a new plugin vimwiki/vimwiki [#938](https://github.com/SpaceVim/SpaceVim/pull/938)
|
||||
- Added a new plugin vimwiki/vimwiki [#935](https://github.com/SpaceVim/SpaceVim/pull/935)
|
||||
- Add statusline errors / warnings report for ale [#934](https://github.com/SpaceVim/SpaceVim/pull/934)
|
||||
- Add quickfix plugin [#930](https://github.com/SpaceVim/SpaceVim/pull/930)
|
||||
- Add base64 api [#924](https://github.com/SpaceVim/SpaceVim/pull/924)
|
||||
- Added a new layer, japanese [#921](https://github.com/SpaceVim/SpaceVim/pull/921)
|
||||
- Added auto-completion settings for Haskell [#920](https://github.com/SpaceVim/SpaceVim/pull/920)
|
||||
- Added Shougo/echodoc.vim to autocomplete layer [#919](https://github.com/SpaceVim/SpaceVim/pull/919)
|
||||
- Add mail layer [#904](https://github.com/SpaceVim/SpaceVim/pull/904)
|
||||
- Add pmd support [#902](https://github.com/SpaceVim/SpaceVim/pull/902)
|
||||
- Add appveyor badges [#888](https://github.com/SpaceVim/SpaceVim/pull/888)
|
||||
- Add server support [#870](https://github.com/SpaceVim/SpaceVim/pull/870)
|
||||
- Add option for disable unicode symbols in statusline [#858](https://github.com/SpaceVim/SpaceVim/pull/858)
|
||||
- Add project manager [#850](https://github.com/SpaceVim/SpaceVim/pull/850)
|
||||
- Add lang#typescript layer [#839](https://github.com/SpaceVim/SpaceVim/pull/839)
|
||||
- Add key binding for clear saved buffers [#830](https://github.com/SpaceVim/SpaceVim/pull/830)
|
||||
- Add airline/tabline theme for nord [#825](https://github.com/SpaceVim/SpaceVim/pull/825)
|
||||
- Add layer for Pony programming language [#823](https://github.com/SpaceVim/SpaceVim/pull/823)
|
||||
- Add vim-repeat to edit layer [#818](https://github.com/SpaceVim/SpaceVim/pull/818)
|
||||
- Add lang#julia layer [#814](https://github.com/SpaceVim/SpaceVim/pull/814)
|
||||
- Add lang#ruby layer [#812](https://github.com/SpaceVim/SpaceVim/pull/812)
|
||||
- Add buffer # keymap [#811](https://github.com/SpaceVim/SpaceVim/pull/811)
|
||||
- Add help desc [#798](https://github.com/SpaceVim/SpaceVim/pull/798)
|
||||
|
||||
|
||||
## Bug Fixs
|
||||
|
||||
- Fix multiple cursor [#963](https://github.com/SpaceVim/SpaceVim/pull/963)
|
||||
- fix help info for rg [#950](https://github.com/SpaceVim/SpaceVim/pull/950)
|
||||
- Fix #908 [#947](https://github.com/SpaceVim/SpaceVim/pull/947)
|
||||
- Fix Typo [#937](https://github.com/SpaceVim/SpaceVim/pull/937)
|
||||
- Fixed ALE setting issues [#936](https://github.com/SpaceVim/SpaceVim/pull/936)
|
||||
- Fix shell layer [#926](https://github.com/SpaceVim/SpaceVim/pull/926)
|
||||
- Fix a typo in doc/SpaceVim.txt [#905](https://github.com/SpaceVim/SpaceVim/pull/905)
|
||||
- fix spellcheck msg & some documentations [#878](https://github.com/SpaceVim/SpaceVim/pull/878)
|
||||
- Fix command documentation [#810](https://github.com/SpaceVim/SpaceVim/pull/810)
|
||||
- fix typo [#795](https://github.com/SpaceVim/SpaceVim/pull/795)
|
||||
- Fix mapping to ( [#782](https://github.com/SpaceVim/SpaceVim/pull/782)
|
||||
|
||||
|
||||
## Unmarked PRs
|
||||
|
||||
- Installer windows [#965](https://github.com/SpaceVim/SpaceVim/pull/965)
|
||||
- Cache E117 when load neomake conf [#958](https://github.com/SpaceVim/SpaceVim/pull/958)
|
||||
- Help describe key bindings [#948](https://github.com/SpaceVim/SpaceVim/pull/948)
|
||||
- resolve conflicts between tmux layer and edit layer [#945](https://github.com/SpaceVim/SpaceVim/pull/945)
|
||||
- Update Docs [#943](https://github.com/SpaceVim/SpaceVim/pull/943)
|
||||
- Improve wording on the README.md [#942](https://github.com/SpaceVim/SpaceVim/pull/942)
|
||||
- WIP: Update syntax checker layer [#933](https://github.com/SpaceVim/SpaceVim/pull/933)
|
||||
- WIP: improve Neomake integration [#931](https://github.com/SpaceVim/SpaceVim/pull/931)
|
||||
- Codecov [#928](https://github.com/SpaceVim/SpaceVim/pull/928)
|
||||
- Minor fix for Vim help language setting example [#927](https://github.com/SpaceVim/SpaceVim/pull/927)
|
||||
- Offer the possibility to add custom palette [#922](https://github.com/SpaceVim/SpaceVim/pull/922)
|
||||
- Update appveyor setting [#918](https://github.com/SpaceVim/SpaceVim/pull/918)
|
||||
- Update SPC e c command [#916](https://github.com/SpaceVim/SpaceVim/pull/916)
|
||||
- translate the buffer section to chinese [#915](https://github.com/SpaceVim/SpaceVim/pull/915)
|
||||
- Display mode in statusline like in some airline theme [#907](https://github.com/SpaceVim/SpaceVim/pull/907)
|
||||
- tests: use stable covimerage [#901](https://github.com/SpaceVim/SpaceVim/pull/901)
|
||||
- Made gitcommit completion source changeable [#900](https://github.com/SpaceVim/SpaceVim/pull/900)
|
||||
- typo: fix typo 'colorcolume' in ui. [#898](https://github.com/SpaceVim/SpaceVim/pull/898)
|
||||
- Improve test for SpaceVim [#895](https://github.com/SpaceVim/SpaceVim/pull/895)
|
||||
- rename open browser [#894](https://github.com/SpaceVim/SpaceVim/pull/894)
|
||||
- update golang keybindings [#893](https://github.com/SpaceVim/SpaceVim/pull/893)
|
||||
- Test changed vim scripts only [#891](https://github.com/SpaceVim/SpaceVim/pull/891)
|
||||
- test main vimrc [#890](https://github.com/SpaceVim/SpaceVim/pull/890)
|
||||
- Update project layout [#889](https://github.com/SpaceVim/SpaceVim/pull/889)
|
||||
- Edits: Minor spelling and grammar changes [#886](https://github.com/SpaceVim/SpaceVim/pull/886)
|
||||
- Use v:false if possible [#885](https://github.com/SpaceVim/SpaceVim/pull/885)
|
||||
- Markdown list item [#883](https://github.com/SpaceVim/SpaceVim/pull/883)
|
||||
- Update job api [#882](https://github.com/SpaceVim/SpaceVim/pull/882)
|
||||
- Build improvements [#881](https://github.com/SpaceVim/SpaceVim/pull/881)
|
||||
- Travis fix [#880](https://github.com/SpaceVim/SpaceVim/pull/880)
|
||||
- Travis: set -e with script blocks [#879](https://github.com/SpaceVim/SpaceVim/pull/879)
|
||||
- [WIP] Add Runner for spacevim [#876](https://github.com/SpaceVim/SpaceVim/pull/876)
|
||||
- [WIP] Improve tests [#872](https://github.com/SpaceVim/SpaceVim/pull/872)
|
||||
- Update shell layer [#871](https://github.com/SpaceVim/SpaceVim/pull/871)
|
||||
- Update readme [#869](https://github.com/SpaceVim/SpaceVim/pull/869)
|
||||
- Update doc for git layer [#867](https://github.com/SpaceVim/SpaceVim/pull/867)
|
||||
- Update website [#863](https://github.com/SpaceVim/SpaceVim/pull/863)
|
||||
- `eslint --fix` for javascript [#851](https://github.com/SpaceVim/SpaceVim/pull/851)
|
||||
- Mod stylesheets [#849](https://github.com/SpaceVim/SpaceVim/pull/849)
|
||||
- 翻译了窗口操作章节的剩余内容. [#844](https://github.com/SpaceVim/SpaceVim/pull/844)
|
||||
- Update index [#843](https://github.com/SpaceVim/SpaceVim/pull/843)
|
||||
- Translate some contents in Chinese documentation [#837](https://github.com/SpaceVim/SpaceVim/pull/837)
|
||||
- Set img size [#836](https://github.com/SpaceVim/SpaceVim/pull/836)
|
||||
- Update remark config [#821](https://github.com/SpaceVim/SpaceVim/pull/821)
|
||||
- Improve markdown layer & Update chinese documentation. [#806](https://github.com/SpaceVim/SpaceVim/pull/806)
|
||||
- Update php layer [#805](https://github.com/SpaceVim/SpaceVim/pull/805)
|
||||
- Split lang#json layer [#804](https://github.com/SpaceVim/SpaceVim/pull/804)
|
||||
- Update autocomplete layer options [#800](https://github.com/SpaceVim/SpaceVim/pull/800)
|
||||
- Update autocomplete layer [#799](https://github.com/SpaceVim/SpaceVim/pull/799)
|
||||
- Move context from readme [#797](https://github.com/SpaceVim/SpaceVim/pull/797)
|
||||
- remove stray chars from documentation [#790](https://github.com/SpaceVim/SpaceVim/pull/790)
|
||||
- Update statusline for ctrlp buffer [#783](https://github.com/SpaceVim/SpaceVim/pull/783)
|
||||
- Remove g:delimitMate_matchpairs setting. [#781](https://github.com/SpaceVim/SpaceVim/pull/781)
|
||||
- Remove plugin that does not exist [#780](https://github.com/SpaceVim/SpaceVim/pull/780)
|
||||
- Update lang#python layer [#779](https://github.com/SpaceVim/SpaceVim/pull/779)
|
||||
- plugin: json-vim: update to newer, forked version [#776](https://github.com/SpaceVim/SpaceVim/pull/776)
|
@ -13,7 +13,7 @@ going on.
|
||||
<li>
|
||||
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
|
||||
<span class="post-date">{{ post.date | date_to_string }}</span>
|
||||
<h4>{{ post.excerpt | truncatewords: 100 }}</h4>
|
||||
<h3>{{ post.excerpt | truncatewords: 100 }}</h3>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
@ -444,6 +444,7 @@ Some elements can be dynamically toggled:
|
||||
| `SPC t m n` | toggle the cat! (if colors layer is declared in your dotfile)(TODO) |
|
||||
| `SPC t m p` | toggle the cursor position |
|
||||
| `SPC t m t` | toggle the time |
|
||||
| `SPC t m d` | toggle the date |
|
||||
| `SPC t m T` | toggle the mode line itself |
|
||||
| `SPC t m v` | toggle the version control info |
|
||||
|
||||
|
@ -3,60 +3,64 @@ title: "Home"
|
||||
description: "SpaceVim is a community-driven vim distribution that seeks to provide layer feature."
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
[![Gitter](https://badges.gitter.im/SpaceVim/SpaceVim.svg)](https://gitter.im/SpaceVim/SpaceVim)
|
||||
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
|
||||
![Version](https://img.shields.io/badge/version-0.6.0--dev-FF00CC.svg)
|
||||
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/SpaceVim/SpaceVim/dev/LICENSE)
|
||||
[![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg?style=flat-square)](https://raw.githubusercontent.com/SpaceVim/SpaceVim/dev/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")
|
||||
[![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/dev?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/dev)
|
||||
[![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev)
|
||||
[![Version](https://img.shields.io/badge/version-0.6.0--dev-FF00CC.svg)](https://github.com/SpaceVim/SpaceVim/releases/tag/0.5.0)
|
||||
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/SpaceVim/SpaceVim/blob/dev/LICENSE)
|
||||
|
||||
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.
|
||||
SpaceVim is a community-driven vim distribution that supports vim and Neovim. SpaceVim manages collections of plugins in layers. Layers make it easy for you, the user, to enable a new language or feature by grouping all the related plugins together.
|
||||
|
||||
See the [documentation](https://spacevim.org/documentation) or [the list of layers](http://spacevim.org/layers/) for more information. [Hack-SpaceVim](https://github.com/Gabirel/Hack-SpaceVim) will tell you how to hack SpaceVim.
|
||||
Please star the project on github - it is a great way to show your appreciation while providing us motivation to continue working on this project. The extra visibility for the project doesn't hurt either!
|
||||
|
||||
![2017-04-29-20 54 49](https://cloud.githubusercontent.com/assets/13142418/25555650/d7d2c07e-2d1e-11e7-975d-646a07b38a62.png)
|
||||
![welcome-page](https://cloud.githubusercontent.com/assets/13142418/26402270/28ad72b8-40bc-11e7-945e-003f41e057be.png)
|
||||
|
||||
See the [documentation](https://spacevim.org/documentation) or [the list of layers](http://spacevim.org/layers/) for more information.
|
||||
|
||||
Here is a throughput graph of the repository for the last few weeks:
|
||||
|
||||
[![Throughput Graph](https://graphs.waffle.io/SpaceVim/SpaceVim/throughput.svg)](https://waffle.io/SpaceVim/SpaceVim/metrics/throughput)
|
||||
|
||||
## Requirements
|
||||
|
||||
At a minimum, SpaceVim requires `git` and `wget` to be installed. These tools are needed for downloading plugins and fonts.
|
||||
|
||||
If you are new to vim, you should learning about Vim in general, read [vim-galore](https://github.com/mhinz/vim-galore).
|
||||
|
||||
## Install
|
||||
|
||||
### Linux/Mac
|
||||
### Linux and macOS
|
||||
|
||||
If you are using linux or mac os, it is recommended to use this command to install SpaceVim:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
curl -sLf https://spacevim.org/install.sh | bash
|
||||
```
|
||||
|
||||
with this command, SpaceVim will be installed. All the plugins will be installed **automatically** when vim/nvim is run for the first time.
|
||||
After SpaceVim is installed, launch `vim` and SpaceVim will **automatically** install plugins.
|
||||
|
||||
For more info about the install script, please check:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
curl -sLf https://spacevim.org/install.sh | bash -s -- -h
|
||||
```
|
||||
|
||||
### windows support
|
||||
### Windows
|
||||
|
||||
- For vim in windows, please just clone this repo as vimfiles in you Home directory.
|
||||
by default, when open a cmd, the current dir is your Home directory, run this command in cmd.
|
||||
make sure you have a backup of your own vimfiles.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/SpaceVim/SpaceVim.git vimfiles
|
||||
```
|
||||
|
||||
- For neovim in windows, please clone this repo as `AppData\Local\nvim` in your home directory.
|
||||
for more info, please check out [neovim's wiki](https://github.com/neovim/neovim/wiki/Installing-Neovim).
|
||||
by default, when open a cmd, the current dir is your Home directory, run this command in cmd.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/SpaceVim/SpaceVim.git AppData\Local\nvim
|
||||
```
|
||||
The easist way is to download [install.cmd](https://spacevim.org/install.cmd) and run it as administrator, or install SpaceVim manually.
|
||||
|
||||
## Features
|
||||
|
||||
- **Great documentation:** access documentation in Vim with <kbd>SPC h SPC</kbd>.
|
||||
![SPC h SPC](https://user-images.githubusercontent.com/13142418/31620230-48b53eea-b2c9-11e7-90d0-b717878875d4.gif)
|
||||
- **Beautiful GUI:** you'll love the awesome UI and its useful features.
|
||||
- **Mnemonic key bindings:** all key bindings have mnemonic prefixes.
|
||||
![mapping guide](https://user-images.githubusercontent.com/13142418/31550099-c8173ff8-b062-11e7-967e-6378a9c3b467.gif)
|
||||
- **Describe key bindings:** use <kbd>SPC h d k</kbd> to describe key bindings.
|
||||
![describe key](https://user-images.githubusercontent.com/13142418/32134986-060a3b8a-bc2a-11e7-89a2-3ee4e616bf06.gif)
|
||||
- **Lazy load plugins:** Lazy-load 90% of plugins with [dein.vim](https://github.com/Shougo/dein.vim)
|
||||
![UI for dein](https://user-images.githubusercontent.com/13142418/31309093-36c01150-abb3-11e7-836c-3ad406bdd71a.gif)
|
||||
- **Neovim centric:** Dark powered mode of SpaceVim
|
||||
|
||||
## News
|
||||
|
||||
[Newsletter #1 - A New Hope](https://spacevim.org/SpaceVim-Newsletter-A-New-Hope/)
|
||||
@ -77,16 +81,12 @@ Contribute code, report bugs and request features at [GitHub](https://github.com
|
||||
|
||||
1. What is the project status?
|
||||
|
||||
The current stable version is 0.2.0. See the milestones page for development progress and the roadmap for high-level plans.
|
||||
The current stable version is 0.5.0. See the milestones page for development progress and the roadmap for high-level plans.
|
||||
|
||||
2. Is SpaceVim trying to turn Vim/Neovim into an IDE?
|
||||
|
||||
With layers feature, this [version](<>) of vim distribution to turn vim/neovim into an IDE for many language.
|
||||
With layers feature, this version of vim distribution try to turn vim/neovim into an IDE for many language.
|
||||
|
||||
3. Will SpaceVim deprecate Vimscript?
|
||||
3. Which version of vim/neovim is needed?
|
||||
|
||||
No, the custom configration file is written in vim script.
|
||||
|
||||
4. Which version of vim/neovim is needed?
|
||||
|
||||
vim 7.4/neovim v0.1.7
|
||||
vim 7.4/neovim v0.1.7, and `+lua` or `+python3` is needed.
|
||||
|
@ -200,6 +200,44 @@ usage () {
|
||||
}
|
||||
|
||||
|
||||
|
||||
download_font () {
|
||||
url="https://raw.githubusercontent.com/wsdjeg/DotFiles/master/local/share/fonts/$1"
|
||||
path="$HOME/.local/share/fonts/$1"
|
||||
if [[ -f "$path" ]]
|
||||
then
|
||||
success "Downloaded $1"
|
||||
else
|
||||
info "Downloading $1"
|
||||
wget -q -O "$path" "$url"
|
||||
success "Downloaded $1"
|
||||
fi
|
||||
}
|
||||
|
||||
install_fonts () {
|
||||
if [[ ! -d "$HOME/.local/share/fonts" ]]; then
|
||||
mkdir -p $HOME/.local/share/fonts
|
||||
fi
|
||||
download_font "DejaVu Sans Mono Bold Oblique for Powerline.ttf"
|
||||
download_font "DejaVu Sans Mono Bold for Powerline.ttf"
|
||||
download_font "DejaVu Sans Mono Oblique for Powerline.ttf"
|
||||
download_font "DejaVu Sans Mono for Powerline.ttf"
|
||||
download_font "DroidSansMonoForPowerlinePlusNerdFileTypesMono.otf"
|
||||
download_font "Ubuntu Mono derivative Powerline Nerd Font Complete.ttf"
|
||||
download_font "WEBDINGS.TTF"
|
||||
download_font "WINGDNG2.ttf"
|
||||
download_font "WINGDNG3.ttf"
|
||||
download_font "devicons.ttf"
|
||||
download_font "mtextra.ttf"
|
||||
download_font "symbol.ttf"
|
||||
download_font "wingding.ttf"
|
||||
echo -n "Updating font cache... "
|
||||
fc-cache -fv
|
||||
mkfontdir "$HOME/.local/share/fonts"
|
||||
mkfontscale "$HOME/.local/share/fonts"
|
||||
echo "done"
|
||||
}
|
||||
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
case $1 in
|
||||
@ -247,3 +285,4 @@ fetch_repo
|
||||
install_vim
|
||||
install_neovim
|
||||
install_package_manager
|
||||
install_fonts
|
||||
|
Loading…
Reference in New Issue
Block a user