diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index 4dae49bc7..ce0e64108 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -152,6 +152,9 @@ let g:spacevim_enable_cursorline = 1 let g:spacevim_statusline_separator = 'arrow' let g:spacevim_statusline_inactive_separator = 'arrow' "" +" Enable/Disable unicode symbols in statusline +let g:spacevim_statusline_unicode_symbols = 1 +"" " Enable/Disable cursorcolumn. Default is 0, cursorcolumn will be " highlighted in normal mode. To enable this feature: " > @@ -269,6 +272,7 @@ let g:spacevim_buffer_index_type = 0 " " 0: 1 ➛ ➊ " " 1: 1 ➛ ➀ " " 2: 1 ➛ ⓵ +" " 3: 1 ➛ 1 " let g:spacevim_windows_index_type = 1 " < let g:spacevim_windows_index_type = 0 diff --git a/autoload/SpaceVim/layers/core/statusline.vim b/autoload/SpaceVim/layers/core/statusline.vim index 977fd166f..abc112325 100644 --- a/autoload/SpaceVim/layers/core/statusline.vim +++ b/autoload/SpaceVim/layers/core/statusline.vim @@ -34,26 +34,32 @@ let s:loaded_modes = ['syntax-checking'] let s:modes = { \ 'center-cursor': { \ 'icon' : '⊝', + \ 'icon_asc' : '-', \ 'desc' : 'centered-cursor mode', \ }, \ 'hi-characters-for-long-lines' :{ \ 'icon' : '⑧', + \ 'icon_asc' : '8', \ 'desc' : 'toggle highlight of characters for long lines', \ }, \ 'fill-column-indicator' :{ \ 'icon' : s:MESSLETTERS.circled_letter('f'), + \ 'icon_asc' : 'f', \ 'desc' : 'fill-column-indicator mode', \ }, \ 'syntax-checking' :{ \ 'icon' : s:MESSLETTERS.circled_letter('s'), + \ 'icon_asc' : 's', \ 'desc' : 'syntax-checking mode', \ }, \ 'spell-checking' :{ \ 'icon' : s:MESSLETTERS.circled_letter('S'), + \ 'icon_asc' : 'S', \ 'desc' : 'spell-checking mode', \ }, \ 'whitespace' :{ \ 'icon' : s:MESSLETTERS.circled_letter('w'), + \ 'icon_asc' : 'w', \ 'desc' : 'whitespace mode', \ }, \ } @@ -126,9 +132,17 @@ endif function! s:winnr(...) abort if a:0 > 1 - return ' ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' ' + if g:spacevim_windows_index_type == 3 + return ' ' . winnr() . ' ' + else + return ' ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' ' + endif else - return '%{SpaceVim#layers#core#statusline#mode(mode())} ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' ' + if 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 @@ -169,7 +183,11 @@ endfunction function! s:modes() abort let m = ' ❖ ' for mode in s:loaded_modes - let m .= s:modes[mode].icon . ' ' + 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 @@ -396,17 +414,17 @@ endfunction " +- a:marked : The number of marked files, or a comma separated list of " the marked filenames. function! SpaceVim#layers#core#statusline#ctrlp(focus, byfname, regex, prev, item, next, marked) abort - return s:STATUSLINE.build([' Ctrlp ', ' ' . a:prev . ' ', ' ' . a:item . ' ', ' ' . a:next . ' '], - \ [' ' . a:focus . ' ', ' ' . a:byfname . ' ', ' ' . getcwd() . ' '], s:lsep, s:rsep, - \ 'SpaceVim_statusline_a_bold', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z') + return s:STATUSLINE.build([' Ctrlp ', ' ' . a:prev . ' ', ' ' . a:item . ' ', ' ' . a:next . ' '], + \ [' ' . a:focus . ' ', ' ' . a:byfname . ' ', ' ' . getcwd() . ' '], s:lsep, s:rsep, + \ 'SpaceVim_statusline_a_bold', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z') endfunction " a:str : Either the number of files scanned so far, or a string indicating " the current directory is being scanned with a user_command. function! SpaceVim#layers#core#statusline#ctrlp_status(str) abort - return s:STATUSLINE.build([' Ctrlp ', ' ' . a:str . ' '], - \ [' ' . getcwd() . ' '], s:lsep, s:rsep, - \ 'SpaceVim_statusline_a', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z') + return s:STATUSLINE.build([' Ctrlp ', ' ' . a:str . ' '], + \ [' ' . getcwd() . ' '], s:lsep, s:rsep, + \ 'SpaceVim_statusline_a', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z') endfunction function! SpaceVim#layers#core#statusline#jump(i) abort diff --git a/autoload/SpaceVim/layers/lang/javascript.vim b/autoload/SpaceVim/layers/lang/javascript.vim index 78c7c0527..86775ea3b 100644 --- a/autoload/SpaceVim/layers/lang/javascript.vim +++ b/autoload/SpaceVim/layers/lang/javascript.vim @@ -15,8 +15,22 @@ function! SpaceVim#layers#lang#javascript#plugins() abort return plugins endfunction +let s:auto_fix = 0 + +function! SpaceVim#layers#lang#javascript#set_variable(var) abort + let s:auto_fix = get(a:var, 'auto_fix', s:auto_fix) +endfunction + function! SpaceVim#layers#lang#javascript#config() abort call SpaceVim#mapping#gd#add('javascript', function('s:gotodef')) + if s:auto_fix + " Only use eslint + let g:neomake_javascript_enabled_makers = ['eslint'] + " Use the fix option of eslint + let g:neomake_javascript_eslint_args = ['-f', 'compact', '--fix'] + au User NeomakeFinished checktime + au FocusGained * checktime + endif endfunction function! s:gotodef() abort diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 98504e8cf..3666dcb49 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -188,6 +188,9 @@ Set the statusline separators of statusline, default is 'arrow' See more details in: http://spacevim.org/documentation/#statusline + *g:spacevim_statusline_unicode_symbols* +Enable/Disable unicode symbols in statusline + *g:spacevim_enable_cursorcolumn* Enable/Disable cursorcolumn. Default is 0, cursorcolumn will be highlighted in normal mode. To enable this feature: @@ -300,6 +303,7 @@ Set SpaceVim windows index type, default is 0. " 0: 1 ➛ ➊ " 1: 1 ➛ ➀ " 2: 1 ➛ ⓵ + " 3: 1 ➛ 1 let g:spacevim_windows_index_type = 1 < diff --git a/docs/Gemfile b/docs/Gemfile index f8dd7464e..de67ab6c8 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,3 +1,4 @@ source 'https://rubygems.org' gem 'github-pages', group: :jekyll_plugins gem 'jekyll-redirect-from', group: :jekyll_plugins +gem 'jekyll-seo-tag' diff --git a/docs/README_zh_cn.md b/docs/README_zh_cn.md index 854ca1fc6..819d26524 100644 --- a/docs/README_zh_cn.md +++ b/docs/README_zh_cn.md @@ -1,3 +1,9 @@ +--- +title: "SpaceVim 中文手册" +description: "SpaceVim 是一个社区驱动的 Vim 配置,内含多种语言模块,提供了代码补全、语法检查、跳转等多种 IDE 特性。" +--- + + # SpaceVim 中文手册 [![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim) diff --git a/docs/_config.yml b/docs/_config.yml index cf23c2cda..d4760ed6c 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,15 +1,29 @@ theme: jekyll-theme-midnight title: SpaceVim -description: A community-driven Vim distribution +description: A community-driven vim distribution show_downloads: false google_analytics: UA-89745542-1 project_repo_url: https://github.com/SpaceVim/SpaceVim url: https://spacevim.org - +logo: https://spacevim.org/SpaceVim.png permalink: /:title/ plugins: - jekyll-redirect-from - jekyll-sitemap + - jekyll-seo-tag github: [metadata] + +author: + name: Shidong Wang + twitter: SpaceVim +twitter: + username: "@SpaceVim" + +social: + name: SpaceVim + links: + - https://twitter.com/SpaceVim + - https://github.com/SpaceVim/SpaceVim + - https://www.reddit.com/r/SpaceVim/ diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index 1eb0b706b..b5dea63e3 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -1,127 +1,122 @@ -
- - + + {% seo %} + + + + - - - - - - - - -