From d2447144f065f352d8d7ebfa5d3868581abc84b9 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 29 Apr 2017 20:58:57 +0800 Subject: [PATCH 01/34] Update pic in readme_zh_cn --- docs/README_zh_cn.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/README_zh_cn.md b/docs/README_zh_cn.md index bd2d85acf..1b713b41f 100644 --- a/docs/README_zh_cn.md +++ b/docs/README_zh_cn.md @@ -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) From 3f7aefc5be3eee48e11fa87650213ad517346ada Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 29 Apr 2017 21:30:31 +0800 Subject: [PATCH 02/34] Add chat layer doc --- docs/layers/chat.md | 22 ++++++++++++++++++++++ docs/layers/index.md | 1 + 2 files changed, 23 insertions(+) create mode 100644 docs/layers/chat.md diff --git a/docs/layers/chat.md b/docs/layers/chat.md new file mode 100644 index 000000000..c3fb4567b --- /dev/null +++ b/docs/layers/chat.md @@ -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 :h vim-chat. diff --git a/docs/layers/index.md b/docs/layers/index.md index aaee842ae..41a6dc409 100644 --- a/docs/layers/index.md +++ b/docs/layers/index.md @@ -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) From 936d7858048274c6b85618e3520fd8f43a5d0fd8 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 29 Apr 2017 21:49:49 +0800 Subject: [PATCH 03/34] Add autocomplete layer doc --- docs/layers/autocomplete.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/layers/autocomplete.md diff --git a/docs/layers/autocomplete.md b/docs/layers/autocomplete.md new file mode 100644 index 000000000..cf6d8b659 --- /dev/null +++ b/docs/layers/autocomplete.md @@ -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 From fa4c89f32609028cfd3346033d119f80e606de38 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 30 Apr 2017 12:14:08 +0800 Subject: [PATCH 04/34] Add core pillars --- docs/documentation.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/documentation.md b/docs/documentation.md index 1e2cf2d5f..0ca88f613 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -6,6 +6,11 @@ title: "Documentation" --- +- [Core Pillars](#core-pillars) + - [Mnemonic](#mnemonic) + - [Discoverable](#discoverable) + - [Consistent](#consistent) + - [Crowd-Configured](#crowd-configured) - Features - [Modular configuration](#modular-configuration) - [Awesome ui](#awesome-ui) @@ -18,6 +23,28 @@ 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. + # Features ## Awesome ui From 093be7fa3c27de2c1e8c47b322362897aa0d5395 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 30 Apr 2017 13:10:22 +0800 Subject: [PATCH 05/34] Add doc for update spacevim --- docs/documentation.md | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/docs/documentation.md b/docs/documentation.md index 0ca88f613..7d539c9b6 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -11,6 +11,15 @@ title: "Documentation" - [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) - Features - [Modular configuration](#modular-configuration) - [Awesome ui](#awesome-ui) @@ -45,6 +54,54 @@ Similar functionalities have the same key binding everywhere thanks to a clearly Community-driven configuration provides curated packages tuned by power users and bugs are fixed quickly. +## Highlighted features + +- **Great documentation:** access documentation in Vim with + :h SpaceVim. +- **Beautiful GUI:** you'll love the awesome UI and its useful features. +- **Mnemonic key bindings:** commands have mnemonic prefixes like + [Window] for all the window and buffer commands or [Unite] 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 + +## 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 + # Features ## Awesome ui From 5e4c34aedffe3937cc2469eb95d526880241eed4 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 30 Apr 2017 14:22:28 +0800 Subject: [PATCH 06/34] Add custom config doc --- docs/documentation.md | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/docs/documentation.md b/docs/documentation.md index 7d539c9b6..27ca0c65b 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -20,6 +20,20 @@ title: "Documentation" - [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 dotdirectory](#alternative-dotdirectory) + [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) + - Features - [Modular configuration](#modular-configuration) - [Awesome ui](#awesome-ui) @@ -102,6 +116,44 @@ To update manually close Vim and update the git repository: ### Update plugins +Use `:SPUpdate` command will update all the plugins and SpaceVim itself. after `:SPUpdate`, you can assign plugins need to be updated. Use Tab 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 dotdirectory + +### Synchronization of dotfile changes + +### Testing the dotfile + +### Dotfile Contents + +#### Configuration functions + +#### Custom variables + +### Declaring Configuration layers + +#### Setting configuration layers variables + +#### Disabling layer services in other layers + +#### Selecting/Ignoring packages of a layer + +#### Excluding packages + + + # Features ## Awesome ui From 669f9cba558e6257963f8f4b94b519d8508a0efa Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 30 Apr 2017 14:43:09 +0800 Subject: [PATCH 07/34] Update doc --- docs/documentation.md | 120 +++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 71 deletions(-) diff --git a/docs/documentation.md b/docs/documentation.md index 27ca0c65b..2a7dd4b5e 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -22,7 +22,7 @@ title: "Documentation" - [Update plugins](#update-plugins) - [Custom Configuration](#custom-configuration) [Automatic Generation](#automatic-generation) - [Alternative dotdirectory](#alternative-dotdirectory) + [Alternative directory](#alternative-directory) [Synchronization of dotfile changes](#synchronization-of-dotfile-changes) Testing the dotfile [Dotfile Contents](#dotfile-contents) @@ -130,29 +130,66 @@ User configuration can be stored in your ~/.SpaceVim.d directory. 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 dotdirectory +### Alternative directory -### Synchronization of dotfile changes +`~/.SpaceVim.d/` will be added to `&runtimepath` of vim. read :h rtp. -### Testing the dotfile +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. -### Dotfile Contents +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. -#### Configuration functions +here is an example config file for SpaceVim: -#### Custom variables +```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 -### Declaring Configuration layers +" Change the default directory where all miscellaneous persistent files go. +" By default it is ~/.cache/vimfiles. +let g:spacevim_plugin_bundle_dir = '~/.cache/vimfiles' -#### Setting configuration layers variables +" set SpaceVim colorscheme +let g:spacevim_colorscheme = 'jellybeans' -#### Disabling layer services in other layers +" Set plugin manager, you want to use, default is dein.vim +let g:spacevim_plugin_manager = 'dein' " neobundle or dein or vim-plug -#### Selecting/Ignoring packages of a layer +" use space as `` +let mapleader = "\" -#### Excluding packages +" 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 :h SpaceVim. # Features @@ -632,65 +669,6 @@ Key | Mode | Action ``+`W` | Normal | Wiki ``+`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 `` -let mapleader = "\" - -" 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 :h SpaceVim. [dein.vim]: https://github.com/Shougo/dein.vim From b81aaa048ecf45a341cfdf06160f04a3ec310c36 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 30 Apr 2017 14:49:09 +0800 Subject: [PATCH 08/34] Add screenshots --- docs/documentation.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/documentation.md b/docs/documentation.md index 2a7dd4b5e..140b7d5cd 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -84,6 +84,22 @@ Community-driven configuration provides curated packages tuned by power users an ## 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. From 9c438aca22f229c30279a12ece4b5672379282a7 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 30 Apr 2017 14:57:39 +0800 Subject: [PATCH 09/34] Fix menu --- docs/documentation.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/documentation.md b/docs/documentation.md index 140b7d5cd..13fff5729 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -21,18 +21,18 @@ title: "Documentation" - [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) + - [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) - Features - [Modular configuration](#modular-configuration) From 1cc31cdb5843b98c2f68722a7dbe407a5e8b2fa0 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 30 Apr 2017 15:34:09 +0800 Subject: [PATCH 10/34] Add doc for colorscheme --- autoload/SpaceVim.vim | 3 +++ autoload/SpaceVim/default.vim | 1 - doc/SpaceVim.txt | 3 +++ docs/documentation.md | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index cac45bef7..c356f75a1 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -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. diff --git a/autoload/SpaceVim/default.vim b/autoload/SpaceVim/default.vim index 1dd319690..cd4977238 100644 --- a/autoload/SpaceVim/default.vim +++ b/autoload/SpaceVim/default.vim @@ -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 diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 98518fb29..0addf457c 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -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 diff --git a/docs/documentation.md b/docs/documentation.md index 13fff5729..15a7234a7 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -207,6 +207,30 @@ let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11' Comprehensive documentation is available for each layer by :h SpaceVim. +## Awesome ui + +SpaceVim has a minimalistic and distraction free UI: + +- custom powerline mode-line with color feedback according to current Flycheck status +- Unicode symbols for minor mode lighters which appear in the mode-line +- custom fringe bitmaps and error feedbacks for Flycheck + +### 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 :h gruvbox. + +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' +``` + + + + + + # Features ## Awesome ui From 008c502b039129e4595182dd9deefb89a601062d Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 30 Apr 2017 15:35:48 +0800 Subject: [PATCH 11/34] Fix bg option --- config/general.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/general.vim b/config/general.vim index 1b9605e40..a2f87b7f9 100644 --- a/config/general.vim +++ b/config/general.vim @@ -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 From cdbaeeb7446faa1f4499b4b2d609cd2846a8a070 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 30 Apr 2017 15:53:59 +0800 Subject: [PATCH 12/34] Update colorscheme doc --- docs/documentation.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/documentation.md b/docs/documentation.md index 15a7234a7..5fbc77980 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -211,9 +211,8 @@ Comprehensive documentation is available for each layer by :h SpaceVimSPC T n | switch to next random colorscheme listed in colorscheme layer. +SPC T s | 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) # Features From 6b5f72a0e60a3ad9e35a2668e594092ad8e22a6e Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 30 Apr 2017 23:51:07 +0800 Subject: [PATCH 13/34] Update pic in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7cb373a5..0b81b5c71 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,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). From 6ca1495310bdf7caf5f3cd32a3ea32990f48e776 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 00:14:20 +0800 Subject: [PATCH 14/34] Add ui toggle mappings --- docs/documentation.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/docs/documentation.md b/docs/documentation.md index 5fbc77980..cc75e063a 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -33,6 +33,11 @@ title: "Documentation" - [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) @@ -236,6 +241,42 @@ all the included colorscheme can be found in [colorscheme layer](http://spacevim 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 l | toggle truncate lines +SPC t L | toggle visual lines +SPC t n | toggle line numbers +SPC t v | toggle smooth scrolling +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 M | toggle frame maximize +SPC T t | toggle tool bar +SPC T T | toggle frame transparency and enter transparency transient state # Features From eedcefacf7b381045f9a490ef79c5d84899637a1 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 13:32:42 +0800 Subject: [PATCH 15/34] Add toggle column mapping https://stackoverflow.com/questions/2447109/showing-a-different-background-colour-in-vim-past-80-characters --- autoload/SpaceVim/layers/ui.vim | 39 ++++++++++++++++++++++++++--- autoload/SpaceVim/mapping/space.vim | 1 + 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index ddb07ca4a..14bd3ebaf 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -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,8 +24,18 @@ function! SpaceVim#layers#ui#config() abort let g:signify_line_highlight = 0 noremap :TagbarToggle " Ui toggles - call SpaceVim#mapping#space#def('nnoremap', ['T', 'F'], '', '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', 'f'], 'call call(' + \ . string(s:_function('s:toggle_colorcolumn')) . ', [])', + \ 'toggle-colorcolume', 1) + + call SpaceVim#mapping#space#def('nnoremap', ['T', 'F'], '', + \ 'fullscreen-frame', 0) + call SpaceVim#mapping#space#def('nnoremap', ['T', 'm'], 'call call(' + \ . string(s:_function('s:toggle_menu_bar')) . ', [])', + \ 'menu-bar', 1) endfunction " function() wrapper if v:version > 703 || v:version == 703 && has('patch1170') @@ -50,3 +61,25 @@ function! s:toggle_menu_bar() abort let s:tmflag = 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:ccflag + let &colorcolumn=join(range(80,999),",") + let s:ccflag = 1 + else + let &colorcolumn= + let s:ccflag = 0 + endif +endfunction diff --git a/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index a1f51c4bd..930c1bac4 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -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'} From 721db59ccf1761bd36ee6374ef4ee0c5ee071ff9 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 13:44:43 +0800 Subject: [PATCH 16/34] Add mapping for toggle hi current line --- autoload/SpaceVim/layers/ui.vim | 4 +++- autoload/SpaceVim/mapping/space.vim | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 14bd3ebaf..e5ab11cd3 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -30,6 +30,8 @@ function! SpaceVim#layers#ui#config() abort 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', 'F'], '', \ 'fullscreen-frame', 0) @@ -79,7 +81,7 @@ function! s:toggle_fill_column() abort let &colorcolumn=join(range(80,999),",") let s:ccflag = 1 else - let &colorcolumn= + set cc= let s:ccflag = 0 endif endfunction diff --git a/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index 930c1bac4..f97a397b5 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -71,6 +71,8 @@ function! SpaceVim#mapping#space#def(m, keys, cmd, desc, is_cmd) abort exe a:m . ' [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 From f23447aad9dfbd98670aa3b0041c69b2ff3e8c4d Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 14:09:17 +0800 Subject: [PATCH 17/34] Add icon for issue status --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0b81b5c71..16b616174 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ ![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) +[![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. From 1eec47e595016ce57a4b0e35a8c346503092381f Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 14:23:15 +0800 Subject: [PATCH 18/34] Add mapping for toggle indent line --- autoload/SpaceVim/layers/ui.vim | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index e5ab11cd3..70ac1501b 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -32,6 +32,9 @@ function! SpaceVim#layers#ui#config() abort \ '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')) . ', [])', + \ 'menu-bar', 1) call SpaceVim#mapping#space#def('nnoremap', ['T', 'F'], '', \ 'fullscreen-frame', 0) @@ -77,11 +80,22 @@ endfunction let s:fcflag = 0 function! s:toggle_fill_column() abort - if !s:ccflag + if !s:fcflag let &colorcolumn=join(range(80,999),",") - let s:ccflag = 1 + let s:fcflag = 1 else set cc= - let s:ccflag = 0 + 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 From acca723ea97c22fe7ecd784a6a24d73692c6ba90 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 14:32:00 +0800 Subject: [PATCH 19/34] Add Mapping for toggle syntax hi --- autoload/SpaceVim/layers/ui.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 70ac1501b..5695a97af 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -35,6 +35,11 @@ function! SpaceVim#layers#ui#config() abort call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'i'], 'call call(' \ . string(s:_function('s:toggle_indentline')) . ', [])', \ 'menu-bar', 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'], '', \ 'fullscreen-frame', 0) @@ -99,3 +104,14 @@ function! s:toggle_indentline() abort 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 From 4101110193a4794de006ed4f86f2ba12fb5b64b7 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 20:00:43 +0800 Subject: [PATCH 20/34] Fix line number toggle --- autoload/SpaceVim/layers/ui.vim | 2 ++ autoload/SpaceVim/mapping/space.vim | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 5695a97af..b9be79cc2 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -27,6 +27,8 @@ function! SpaceVim#layers#ui#config() abort 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) diff --git a/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index f97a397b5..691f82f9d 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -47,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 [SPC]tn :set nu! - let g:_spacevim_mappings_space.t.n = ['set nu!', 'toggle line number'] + nnoremap [SPC]tn :setlocal nonumber! norelativenumber! + 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 From d2d7e8d3416de4c7872a663124858c38973ae4b4 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 20:17:02 +0800 Subject: [PATCH 21/34] Add mapping for toggle ~ end of buffer --- autoload/SpaceVim/layers/ui.vim | 42 +++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index b9be79cc2..57f1a0d56 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -48,20 +48,23 @@ function! SpaceVim#layers#ui#config() abort 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', '~'], 'call call(' + \ . string(s:_function('s:toggle_end_of_buffer')) . ', [])', + \ 'menu-bar', 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(''), '\zs\d\+\ze__SID$') - endfunction - let s:_s = '' . s:_SID() . '_' - function! s:_function(fstr) abort - return function(substitute(a:fstr, 's:', s:_s, 'g')) - endfunction + function! s:_SID() abort + return matchstr(expand(''), '\zs\d\+\ze__SID$') + endfunction + let s:_s = '' . 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 @@ -117,3 +120,22 @@ function! s:toggle_syntax_hi() abort let s:shflag = 0 endif endfunction + +let s:ebflag = 0 +function! s:toggle_end_of_buffer() abort + if !s:ebflag + if &background ==# 'dark' + hi EndOfBuffer guibg=#282828 + else + hi EndOfBuffer guibg=#fbf1c7 + endif + let s:ebflag = 1 + else + if &background ==# 'dark' + hi EndOfBuffer guibg=#282828 guifg=#282828 + else + hi EndOfBuffer guibg=#fbf1c7 guifg=#fbf1c7 + endif + let s:ebflag = 0 + endif +endfunction From d949f0a55404353f05a8630af439dee0331d902f Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 20:20:25 +0800 Subject: [PATCH 22/34] Type: wrong desc of SPC t h i --- autoload/SpaceVim/layers/ui.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 57f1a0d56..9833a7244 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -36,7 +36,7 @@ function! SpaceVim#layers#ui#config() abort \ 'toggle highlight of the current line', 1) call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'i'], 'call call(' \ . string(s:_function('s:toggle_indentline')) . ', [])', - \ 'menu-bar', 1) + \ '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(' From 713be470af83773e940dae5fd099af462fa3ca53 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 20:34:59 +0800 Subject: [PATCH 23/34] Fix toggle end of buffer --- autoload/SpaceVim/layers/ui.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 9833a7244..184902065 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -50,7 +50,7 @@ function! SpaceVim#layers#ui#config() abort \ 'menu-bar', 1) call SpaceVim#mapping#space#def('nnoremap', ['T', '~'], 'call call(' \ . string(s:_function('s:toggle_end_of_buffer')) . ', [])', - \ 'menu-bar', 1) + \ 'display ~ in the fringe on empty lines', 1) endfunction " function() wrapper if v:version > 703 || v:version == 703 && has('patch1170') @@ -125,9 +125,9 @@ let s:ebflag = 0 function! s:toggle_end_of_buffer() abort if !s:ebflag if &background ==# 'dark' - hi EndOfBuffer guibg=#282828 + hi EndOfBuffer guifg=white else - hi EndOfBuffer guibg=#fbf1c7 + hi EndOfBuffer guifg=gray endif let s:ebflag = 1 else From 4a6f11146dc1d1f25aec5ca13be33b2694a67024 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 20:36:41 +0800 Subject: [PATCH 24/34] Fix sytle --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 16b616174..574dc01f7 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ [![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") From 13b9bd1e40d5e409edc9d851aab713db995b9590 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 22:05:51 +0800 Subject: [PATCH 25/34] Add vim#highlight api --- autoload/SpaceVim/api/vim/highlight.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 autoload/SpaceVim/api/vim/highlight.vim diff --git a/autoload/SpaceVim/api/vim/highlight.vim b/autoload/SpaceVim/api/vim/highlight.vim new file mode 100644 index 000000000..2b0156342 --- /dev/null +++ b/autoload/SpaceVim/api/vim/highlight.vim @@ -0,0 +1,23 @@ +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! SpaceVim#api#vim#highlight#get() abort + return deepcopy(s:self) +endfunction From a2ab6a6cda47ce6c80ea7ab565a0b4ad87856f3b Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 22:54:09 +0800 Subject: [PATCH 26/34] Support other colorscheme --- autoload/SpaceVim/api/vim/highlight.vim | 40 +++++++++++++++++++++++++ autoload/SpaceVim/layers/ui.vim | 8 +++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/autoload/SpaceVim/api/vim/highlight.vim b/autoload/SpaceVim/api/vim/highlight.vim index 2b0156342..00cf16c51 100644 --- a/autoload/SpaceVim/api/vim/highlight.vim +++ b/autoload/SpaceVim/api/vim/highlight.vim @@ -18,6 +18,46 @@ function! s:self.group2dict(name) abort 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 + \ . ' ctermbg=' . a:info.ctermbg + \ . ' ctermfg=' . a:info.ctermfg + \ . ' guibg=' . a:info.guibg + \ . ' guifg=' . a:info.guifg + let style = [] + for sty in ['hold', 'italic', 'underline'] + if 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! SpaceVim#api#vim#highlight#get() abort return deepcopy(s:self) endfunction diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 184902065..8959bd7a9 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -122,6 +122,7 @@ function! s:toggle_syntax_hi() abort 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' @@ -131,11 +132,12 @@ function! s:toggle_end_of_buffer() abort endif let s:ebflag = 1 else - if &background ==# 'dark' - hi EndOfBuffer guibg=#282828 guifg=#282828 + if &termguicolors || has('gui_running') + let normalbg = s:HI.group2dict('Normal').guibg else - hi EndOfBuffer guibg=#fbf1c7 guifg=#fbf1c7 + let normalbg = s:HI.group2dict('Normal').ctermbg endif + exe 'hi! EndOfBuffer guifg=' . normalbg . ' guibg=' . normalbg let s:ebflag = 0 endif endfunction From 7cf034217f615498d9ac46b57d2588773a51d172 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 1 May 2017 23:18:53 +0800 Subject: [PATCH 27/34] Hide in normal --- autoload/SpaceVim/api/vim/highlight.vim | 37 ++++++++++++++++++++----- autoload/SpaceVim/autocmds.vim | 5 ++-- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/autoload/SpaceVim/api/vim/highlight.vim b/autoload/SpaceVim/api/vim/highlight.vim index 00cf16c51..9321d9850 100644 --- a/autoload/SpaceVim/api/vim/highlight.vim +++ b/autoload/SpaceVim/api/vim/highlight.vim @@ -36,26 +36,49 @@ function! s:self.hi(info) abort return endif let cmd = 'hi! ' . a:info.name - \ . ' ctermbg=' . a:info.ctermbg - \ . ' ctermfg=' . a:info.ctermfg - \ . ' guibg=' . a:info.guibg - \ . ' guifg=' . a:info.guifg + 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 a:info[sty] ==# '1' + 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 diff --git a/autoload/SpaceVim/autocmds.vim b/autoload/SpaceVim/autocmds.vim index 941ad02d8..92a3085e8 100644 --- a/autoload/SpaceVim/autocmds.vim +++ b/autoload/SpaceVim/autocmds.vim @@ -104,11 +104,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 From d8fab64e57c8dda697ec1a04f8005924ce480c02 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 2 May 2017 20:14:09 +0800 Subject: [PATCH 28/34] Fix neovim startup ref: https://github.com/SpaceVim/SpaceVim/issues/480#issuecomment-298476382 --- config/plugins/vimfiler.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/plugins/vimfiler.vim b/config/plugins/vimfiler.vim index 223d4b81d..a7a706df1 100644 --- a/config/plugins/vimfiler.vim +++ b/config/plugins/vimfiler.vim @@ -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() From 0d6aa65d0a9e7ddd3be7fadfba1546c0679a95f0 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 2 May 2017 20:38:52 +0800 Subject: [PATCH 29/34] Open welcome page when argv(0) is a dir --- autoload/SpaceVim.vim | 11 ++++++++++- autoload/SpaceVim/autocmds.vim | 12 +++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index c356f75a1..e7cd3647e 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -494,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 @@ -501,7 +508,9 @@ function! SpaceVim#welcome() abort \ && get(g:, '_spacevim_checking_flag', 0) == 0 if exists(':VimFiler') == 2 VimFiler - wincmd p + if empty(f) + wincmd p + endif elseif exists(':NERDTreeToggle') == 2 NERDTreeToggle wincmd p diff --git a/autoload/SpaceVim/autocmds.vim b/autoload/SpaceVim/autocmds.vim index 92a3085e8..ddedbba6b 100644 --- a/autoload/SpaceVim/autocmds.vim +++ b/autoload/SpaceVim/autocmds.vim @@ -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() From 42553721310f16414f30a4f2e78ad92e1c8d0f0d Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 2 May 2017 20:53:41 +0800 Subject: [PATCH 30/34] Add toggle tool bar mapping --- autoload/SpaceVim/layers/ui.vim | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 8959bd7a9..5c2983a67 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -47,7 +47,10 @@ function! SpaceVim#layers#ui#config() abort \ 'fullscreen-frame', 0) call SpaceVim#mapping#space#def('nnoremap', ['T', 'm'], 'call call(' \ . string(s:_function('s:toggle_menu_bar')) . ', [])', - \ 'menu-bar', 1) + \ 'toggle-menu-bar', 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) @@ -77,6 +80,17 @@ function! s:toggle_menu_bar() abort 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 From 5a5326b371b777488010ea1fb5d851379149fa70 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 2 May 2017 22:22:27 +0800 Subject: [PATCH 31/34] Fix Ui toggle --- autoload/SpaceVim/layers/ui.vim | 16 ++++++++++++++++ docs/documentation.md | 5 ----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 5c2983a67..0bc62032a 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -48,6 +48,9 @@ function! SpaceVim#layers#ui#config() abort 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) @@ -155,3 +158,16 @@ function! s:toggle_end_of_buffer() abort 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 diff --git a/docs/documentation.md b/docs/documentation.md index cc75e063a..e1f97375f 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -266,17 +266,12 @@ 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 l | toggle truncate lines -SPC t L | toggle visual lines SPC t n | toggle line numbers -SPC t v | toggle smooth scrolling 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 M | toggle frame maximize SPC T t | toggle tool bar -SPC T T | toggle frame transparency and enter transparency transient state # Features From a6551f60dd5ea42e3f8e7f67f0d0424915ae0b84 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 3 May 2017 20:05:33 +0800 Subject: [PATCH 32/34] DOC: statusline --- docs/documentation.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/documentation.md b/docs/documentation.md index e1f97375f..ec30c0f97 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -273,6 +273,21 @@ 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. + + # Features ## Awesome ui From b0170b790d89a0606846743e2f5384b5fcf9d6a7 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 3 May 2017 22:51:29 +0800 Subject: [PATCH 33/34] Add doc for mappings guide --- docs/documentation.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/documentation.md b/docs/documentation.md index ec30c0f97..9ee75ed6c 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -288,6 +288,25 @@ 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`, `` and `[unite]`. + +The default key of these prefix is: + +Prefix name | custom option and default value | description +----------- | ------------------------------- | ----------- +`[SPC]` | NONE / `` | 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 From 9a8996a85b162ff94d484338ad014da0960fc743 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Fri, 5 May 2017 20:29:09 +0800 Subject: [PATCH 34/34] Do not focus to vimfiler --- autoload/SpaceVim.vim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index e7cd3647e..9eca225ce 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -508,9 +508,7 @@ function! SpaceVim#welcome() abort \ && get(g:, '_spacevim_checking_flag', 0) == 0 if exists(':VimFiler') == 2 VimFiler - if empty(f) - wincmd p - endif + wincmd p elseif exists(':NERDTreeToggle') == 2 NERDTreeToggle wincmd p