1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-11 08:55:43 +08:00

Merge branch 'master' into feature/python-docstring

This commit is contained in:
Wang Shidong 2018-01-20 06:06:32 -06:00 committed by GitHub
commit 60a55965d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 231 additions and 99 deletions

View File

@ -1,5 +1,3 @@
let s:url = ''
let s:api = '/api/site_admin' let s:api = '/api/site_admin'

View File

@ -7,7 +7,7 @@ function! SpaceVim#dev#releases#open() abort
let is_dev = g:spacevim_version =~ 'dev' let is_dev = g:spacevim_version =~ 'dev'
let releases = { let releases = {
\ 'tag_name': (is_dev ? 'nightly' : g:spacevim_version), \ 'tag_name': (is_dev ? 'nightly' : g:spacevim_version),
\ 'target_commitish': 'dev', \ 'target_commitish': 'master',
\ 'name': (is_dev ? 'nightly' : 'SpaceVim v' . g:spacevim_version), \ 'name': (is_dev ? 'nightly' : 'SpaceVim v' . g:spacevim_version),
\ 'body': (is_dev ? s:body() : SpaceVim#dev#releases#content()), \ 'body': (is_dev ? s:body() : SpaceVim#dev#releases#content()),
\ 'draft': v:false, \ 'draft': v:false,

View File

@ -10,7 +10,7 @@ elif [ "$LINT" = "vimlint-errors" ]; then
if [[ -f build_log ]]; then if [[ -f build_log ]]; then
rm build_log rm build_log
fi fi
for file in $(git diff --name-only HEAD dev | grep .vim$); for file in $(git diff --name-only HEAD master | grep .vim$);
do do
/tmp/vimlint/bin/vimlint.sh -E -l /tmp/vimlint -p /tmp/vimlparser $file >> build_log 2>&1; /tmp/vimlint/bin/vimlint.sh -E -l /tmp/vimlint -p /tmp/vimlparser $file >> build_log 2>&1;
done done

View File

@ -7,9 +7,9 @@
[Gitter **Chat**](https://gitter.im/SpaceVim/SpaceVim) \| [Gitter **Chat**](https://gitter.im/SpaceVim/SpaceVim) \|
[中文文档](http://spacevim.org/README_zh_cn/) [中文文档](http://spacevim.org/README_zh_cn/)
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim) [![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=master)](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) [![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/master?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/master)
[![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev) [![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/master/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/master)
![Version](https://img.shields.io/badge/version-0.7.0--dev-FF00CC.svg) ![Version](https://img.shields.io/badge/version-0.7.0--dev-FF00CC.svg)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![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) [![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg)](doc/SpaceVim.txt)

View File

@ -195,11 +195,18 @@ let g:spacevim_statusline_inactive_separator = 'arrow'
" \ 'version control info' " \ 'version control info'
" \ ] " \ ]
" < " <
let g:spacevim_statusline_left_sections = ['winnr', 'filename', 'major mode', 'syntax checking', 'minor mode lighters', 'version control info', 'hunks'] let g:spacevim_statusline_left_sections = ['winnr', 'filename', 'major mode',
\ 'syntax checking', 'minor mode lighters',
\ 'version control info', 'hunks']
"" ""
" Define the right section of statusline in active windows. By default: " Define the right section of statusline in active windows. By default:
" > " >
" let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos'] " g:spacevim_statusline_right_sections =
" \ [
" \ 'fileformat',
" \ 'cursorpos',
" \ 'percentage'
" \ ]
" < " <
let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos', 'percentage'] let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos', 'percentage']

View File

@ -18,7 +18,6 @@ function! SpaceVim#autocmds#init() abort
autocmd FileType jsp call JspFileTypeInit() autocmd FileType jsp call JspFileTypeInit()
autocmd QuitPre * call SpaceVim#plugins#windowsmanager#UpdateRestoreWinInfo() autocmd QuitPre * call SpaceVim#plugins#windowsmanager#UpdateRestoreWinInfo()
autocmd WinEnter * call SpaceVim#plugins#windowsmanager#MarkBaseWin() autocmd WinEnter * call SpaceVim#plugins#windowsmanager#MarkBaseWin()
autocmd FileType html,css,scss,sass,less,javascript,jsp,vue,eex EmmetInstall
autocmd BufRead,BufNewFile *.pp setfiletype puppet autocmd BufRead,BufNewFile *.pp setfiletype puppet
if g:spacevim_enable_cursorline == 1 if g:spacevim_enable_cursorline == 1
autocmd BufEnter,WinEnter,InsertLeave * setl cursorline autocmd BufEnter,WinEnter,InsertLeave * setl cursorline

View File

@ -171,7 +171,7 @@ function! SpaceVim#layers#colorscheme#plugins() abort
\ ['romainl/Apprentice'], \ ['romainl/Apprentice'],
\ ['icymind/NeoSolarized'], \ ['icymind/NeoSolarized'],
\ ['jacoborus/tender'], \ ['jacoborus/tender'],
\ ['rakr/vim-one'], \ ['wsdjeg/vim-one'],
\ ['arcticicestudio/nord-vim'], \ ['arcticicestudio/nord-vim'],
\ ['KeitaNakamura/neodark.vim'], \ ['KeitaNakamura/neodark.vim'],
\ ] \ ]

View File

@ -33,12 +33,6 @@ let s:i_separators = {
\ 'nil' : ['', ''], \ 'nil' : ['', ''],
\ } \ }
let s:loaded_modes = [] let s:loaded_modes = []
if index(g:spacevim_plugin_groups, 'checkers') != -1
call add(s:loaded_modes, 'syntax-checking')
endif
if &cc ==# '80'
call add(s:loaded_modes, 'fill-column-indicator')
endif
let s:modes = { let s:modes = {
\ 'center-cursor': { \ 'center-cursor': {
\ 'icon' : '⊝', \ 'icon' : '⊝',
@ -81,6 +75,15 @@ let s:loaded_sections_l = g:spacevim_statusline_left_sections
let [s:lsep , s:rsep] = get(s:separators, g:spacevim_statusline_separator, s:separators['arrow']) let [s:lsep , s:rsep] = get(s:separators, g:spacevim_statusline_separator, s:separators['arrow'])
let [s:ilsep , s:irsep] = get(s:i_separators, g:spacevim_statusline_inactive_separator, s:i_separators['arrow']) let [s:ilsep , s:irsep] = get(s:i_separators, g:spacevim_statusline_inactive_separator, s:i_separators['arrow'])
if index(g:spacevim_plugin_groups, 'checkers') != -1
call add(s:loaded_modes, 'syntax-checking')
endif
if &cc ==# '80'
call add(s:loaded_modes, 'fill-column-indicator')
endif
if index(s:loaded_sections_r, 'whitespace')
call add(s:loaded_modes, 'whitespace')
endif
" build in sections for SpaceVim statusline " build in sections for SpaceVim statusline
function! s:winnr(...) abort function! s:winnr(...) abort
if a:0 > 1 if a:0 > 1

View File

@ -15,7 +15,6 @@ function! SpaceVim#layers#edit#plugins() abort
\ ['kana/vim-textobj-line'], \ ['kana/vim-textobj-line'],
\ ['kana/vim-textobj-entire'], \ ['kana/vim-textobj-entire'],
\ ['scrooloose/nerdcommenter', { 'loadconf' : 1}], \ ['scrooloose/nerdcommenter', { 'loadconf' : 1}],
\ ['mattn/emmet-vim', { 'on_cmd' : 'EmmetInstall'}],
\ ['gcmt/wildfire.vim',{'on_map' : '<Plug>(wildfire-'}], \ ['gcmt/wildfire.vim',{'on_map' : '<Plug>(wildfire-'}],
\ ['easymotion/vim-easymotion'], \ ['easymotion/vim-easymotion'],
\ ['haya14busa/vim-easyoperator-line'], \ ['haya14busa/vim-easyoperator-line'],
@ -35,7 +34,6 @@ function! SpaceVim#layers#edit#config() abort
let g:multi_cursor_skip_key=get(g:, 'multi_cursor_skip_key', '<C-x>') let g:multi_cursor_skip_key=get(g:, 'multi_cursor_skip_key', '<C-x>')
let g:multi_cursor_quit_key=get(g:, 'multi_cursor_quit_key', '<Esc>') let g:multi_cursor_quit_key=get(g:, 'multi_cursor_quit_key', '<Esc>')
let g:user_emmet_install_global = 0 let g:user_emmet_install_global = 0
let g:user_emmet_leader_key=get(g:, 'user_emmet_leader_key', '<C-e>')
let g:user_emmet_mode='a' let g:user_emmet_mode='a'
let g:user_emmet_settings = { let g:user_emmet_settings = {
\ 'javascript': { \ 'javascript': {

View File

@ -1,11 +1,29 @@
function! SpaceVim#layers#lang#html#plugins() abort function! SpaceVim#layers#lang#html#plugins() abort
let plugins = [ let plugins = [
\ ['groenewege/vim-less', { 'on_ft' : ['less']}], \ ['groenewege/vim-less', { 'on_ft' : ['less']}],
\ ['cakebaker/scss-syntax.vim', { 'on_ft' : ['scss','sass']}], \ ['cakebaker/scss-syntax.vim', { 'on_ft' : ['scss','sass']}],
\ ['hail2u/vim-css3-syntax', { 'on_ft' : ['css','scss','sass']}], \ ['hail2u/vim-css3-syntax', { 'on_ft' : ['css','scss','sass']}],
\ ['ap/vim-css-color', { 'on_ft' : ['css','scss','sass','less','styl']}], \ ['ap/vim-css-color', { 'on_ft' : ['css','scss','sass','less','styl']}],
\ ['othree/html5.vim', { 'on_ft' : ['html']}], \ ['othree/html5.vim', { 'on_ft' : ['html']}],
\ ['wavded/vim-stylus', { 'on_ft' : ['stylus']}], \ ['wavded/vim-stylus', { 'on_ft' : ['stylus']}],
\ ] \ ['mattn/emmet-vim', { 'on_cmd' : 'EmmetInstall'}],
return plugins \ ]
return plugins
endfunction
function! SpaceVim#layers#lang#html#config() abort
let g:user_emmet_leader_key=get(g:, 'user_emmet_leader_key', '<C-e>')
augroup spacevim_lang_html
autocmd!
autocmd FileType html,css,scss,sass,less,javascript,jsp,vue,eex call s:install_emmet()
augroup END
endfunction
function! s:install_emmet() abort
try
EmmetInstall
catch
endtry
endfunction endfunction

View File

@ -82,6 +82,7 @@ let s:lsp_servers = {
\ 'go' : ['go-langserver', '-mode', 'stdio'], \ 'go' : ['go-langserver', '-mode', 'stdio'],
\ 'rust' : ['rustup', 'run', 'nightly', 'rls'], \ 'rust' : ['rustup', 'run', 'nightly', 'rls'],
\ 'python' : ['pyls'], \ 'python' : ['pyls'],
\ 'html' : ['html-languageserver', '--stdio'],
\ 'php' : ['php', g:spacevim_plugin_bundle_dir . 'repos/github.com/felixfbecker/php-language-server/bin/php-language-server.php'] \ 'php' : ['php', g:spacevim_plugin_bundle_dir . 'repos/github.com/felixfbecker/php-language-server/bin/php-language-server.php']
\ } \ }

View File

@ -310,7 +310,24 @@ function! s:highlight_cursor() abort
\ } \ }
hi def link SpaceVimGuideCursor Cursor hi def link SpaceVimGuideCursor Cursor
call s:VIMH.hi(info) call s:VIMH.hi(info)
let s:cursor_hi = matchaddpos('SpaceVimGuideCursor', [[line('.'), col('.'), 1]]) if s:vis == 'gv'
" [bufnum, lnum, col, off]
let begin = getpos("'<")
let end = getpos("'>")
if begin[1] == end[1]
let s:cursor_hi = matchaddpos('SpaceVimGuideCursor', [[begin[1], min([begin[2], end[2]]), abs(begin[2] - end[2]) + 1]])
else
let pos = [[begin[1], begin[2], len(getline(begin[1])) - begin[2] + 1],
\ [end[1], 1, end[2]],
\ ]
for lnum in range(begin[1] + 1, end[1] - 1)
call add(pos, [lnum, 1, len(getline(lnum))])
endfor
let s:cursor_hi = matchaddpos('SpaceVimGuideCursor', pos)
endif
else
let s:cursor_hi = matchaddpos('SpaceVimGuideCursor', [[line('.'), col('.'), 1]])
endif
endfunction endfunction
function! s:remove_cursor_highlight() abort function! s:remove_cursor_highlight() abort

View File

@ -227,7 +227,12 @@ Define the left section of statusline in active windows. By default:
*g:spacevim_statusline_right_sections* *g:spacevim_statusline_right_sections*
Define the right section of statusline in active windows. By default: Define the right section of statusline in active windows. By default:
> >
let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos'] g:spacevim_statusline_right_sections =
\ [
\ 'fileformat',
\ 'cursorpos',
\ 'percentage'
\ ]
< <
*g:spacevim_statusline_unicode_symbols* *g:spacevim_statusline_unicode_symbols*

View File

@ -93,9 +93,10 @@
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-58a01d3aac22bd89"></script> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-58a01d3aac22bd89"></script>
</body> </body>
<root> <root>
<p align="center"> <p align="center">
<span class="credits right">Hosted on GitHub &mdash; Theme by <a href="https://twitter.com/michigangraham">mattgraham</a></span> <span class="credits right">Hosted on GitHub, <a href="https://github.com/SpaceVim/SpaceVim/edit/master/docs/{{ page.path }}">Help improve this page</a> &mdash; Theme by <a href="https://twitter.com/michigangraham">mattgraham</a>,
</p> </span>
</p>
</root> </root>
</html> </html>

View File

@ -27,7 +27,7 @@ All of these channels are bridged together. Click on one of the badges below to
- [`SpaceVim/SpaceVim` on gitter](https://gitter.im/SpaceVim/SpaceVim) - [`SpaceVim/SpaceVim` on gitter](https://gitter.im/SpaceVim/SpaceVim)
- [`#spacevim` on FreeNode](https://webchat.freenode.net/?channels=spacevim) - [`#spacevim` on FreeNode](https://webchat.freenode.net/?channels=spacevim)
- [`t.me/SpaceVim` on telegram](t.me/SpaceVim) - [`t.me/SpaceVim` on telegram](https://t.me/SpaceVim)
- [`#spacevim:matrix.org` on Matrix](https://riot.im/app/#/room/%23spacevim:matrix.org) - [`#spacevim:matrix.org` on Matrix](https://riot.im/app/#/room/%23spacevim:matrix.org)
- [`#spacevim` on slack](https://spacevim.slack.com/messages/C88CTJ62J) - [`#spacevim` on slack](https://spacevim.slack.com/messages/C88CTJ62J)

View File

@ -1,7 +1,6 @@
--- ---
title: "Conventions" title: "Conventions"
description: "conventions of contributing to SpaceVim, including the coding style guides about vim script and markdown" description: "conventions of contributing to SpaceVim, including the coding style guides about vim script and markdown"
permalink: "/conventions"
--- ---
# Conventions # Conventions

View File

@ -74,7 +74,7 @@ For files not belonging to Spacemacs like local packages and libraries, refer to
#### Conventions #### Conventions
SpaceVim is based on conventions, mainly for naming functions, keybindings definition and writing documentation. Please read the [conventions](https://spacevim.org/development/conventions) before your first contribution to get to know them. SpaceVim is based on conventions, mainly for naming functions, keybindings definition and writing documentation. Please read the [conventions](https://spacevim.org/conventions/) before your first contribution to get to know them.
#### Pull Request #### Pull Request
@ -86,7 +86,7 @@ PR = Pull-Request
##### Ideally for simple PRs (most of them): ##### Ideally for simple PRs (most of them):
- Branch from `dev` - Branch from `master`
- One topic per PR - One topic per PR
- One commit per PR - One commit per PR
- If you have several commits on different topics, close the PR and create one PR per topic - If you have several commits on different topics, close the PR and create one PR per topic
@ -100,6 +100,7 @@ Those PRs are usually cherry-picked.
Squash only the commits with uninteresting changes like typos, syntax fixes, etc… and keep the important and isolated steps in different commits. Squash only the commits with uninteresting changes like typos, syntax fixes, etc… and keep the important and isolated steps in different commits.
Those PRs are merged and explicitly not fast-forwarded. Those PRs are merged and explicitly not fast-forwarded.
Commit messages Commit messages
Write commit messages according to adapted [Tim Popes guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html): Write commit messages according to adapted [Tim Popes guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html):

View File

@ -184,7 +184,7 @@ Community-driven configuration provides curated packages tuned by power users an
- **Lower the risk of RSI:** by heavily using the space bar instead of modifiers. - **Lower the risk of RSI:** by heavily using the space bar instead of modifiers.
- **Batteries included:** discover hundreds of ready-to-use packages nicely - **Batteries included:** discover hundreds of ready-to-use packages nicely
organised in configuration layers following a set of organised in configuration layers following a set of
[conventions](http://spacevim.org/development/). [conventions](http://spacevim.org/conventions/).
- **Neovim centric:** Dark powered mode of SpaceVim - **Neovim centric:** Dark powered mode of SpaceVim
## Screenshots ## Screenshots

View File

@ -20,6 +20,43 @@ $repo_url = "https://github.com/SpaceVim/SpaceVim.git"
$repo_name = "SpaceVim" $repo_name = "SpaceVim"
$repo_path = "$HOME\.SpaceVim" $repo_path = "$HOME\.SpaceVim"
echo "==> Starting Testing Procedure..."
echo ""
sleep 1
echo "==> Testing git"
git version
if (!(echo $?)) {
echo "[ERROR] Please install git or make your PATH correctly set! "
echo ">>> Ready to Exit......"
Pause
exit
} else {
echo "[OK] Test successfully. Moving to next..."
sleep 1
}
echo ""
echo "==> Testing vim"
gvim --version
if (!(echo $?)) {
echo "[WARNING] You didn't install gvim or vim. But intallation can still continue..."
echo ""
echo "[WARNING] Please install gvim later or make your PATH correctly set! "
Pause
} else {
echo ($(vim --version) -split '\n')[0]
echo "[OK] Test successfully. Moving to next..."
sleep 1
}
echo "<== Testing Procedure Completed. Moving to next..."
sleep 1
echo ""
echo ""
if (!(Test-Path "$HOME\.SpaceVim")) { if (!(Test-Path "$HOME\.SpaceVim")) {
echo "==> Trying to clone $app_name" echo "==> Trying to clone $app_name"
git clone $repo_url $repo_path git clone $repo_url $repo_path
@ -35,6 +72,7 @@ if (!(Test-Path "$HOME\vimfiles")) {
cmd /c mklink $HOME\vimfiles $repo_path cmd /c mklink $HOME\vimfiles $repo_path
} else { } else {
echo "[OK] vimfiles already exists" echo "[OK] vimfiles already exists"
sleep 1
} }
echo "" echo ""

46
docs/layers/lang/html.md Normal file
View File

@ -0,0 +1,46 @@
---
title: "SpaceVim lang#html layer"
description: "Edit html in SpaceVim, with this layer, this layer provides code completion, syntax checking and code formatting for html."
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#html
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Layer Installation](#layer-installation)
- [Language server](#language-server)
- [Features](#features)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer adds support for editing HTML and CSS.
## Layer Installation
To use this configuration layer, add `call SpaceVim#layers#load('lang#html')` to your custom configuration file.
### Language server
To install the language server, you need `npm` on your machine:
```bash
npm install --global vscode-html-languageserver-bin
```
## Features
- Generate HTML and CSS coding using [neosnippet](https://github.com/Shougo/neosnippet.vim/) and [emmet-vim](https://github.com/mattn/emmet-vim)
- Tags navigation on key % using matchit.vim
- auto-completion
- syntax checking
- language server protocol (need `lsp` layer)
## Key bindings
| key bindings | Description |
| ------------ | ------------ |
| `<C-e>` | emmet prefix |

View File

@ -91,6 +91,7 @@ default language server commands:
| `haskell` | `['hie', '--lsp']` | | `haskell` | `['hie', '--lsp']` |
| `c` | `['clangd']` | | `c` | `['clangd']` |
| `cpp` | `['clangd']` | | `cpp` | `['clangd']` |
| `html` | `['html-languageserver', '--stdio']` |
| `objc` | `['clangd']` | | `objc` | `['clangd']` |
| `objcpp` | `['clangd']` | | `objcpp` | `['clangd']` |
| `dart` | `['dart_language_server']` | | `dart` | `['dart_language_server']` |

View File

@ -1 +1 @@
See the [Roadmap](https://spacevim.org/roadmap/) and [<kbd>:help SpaceVim-features</kbd>](https://spacevim.org/doc/user/vim_diff.html#nvim-features). See the [Roadmap](https://spacevim.org/roadmap/) and <kbd>:help SpaceVim-features</kbd>.