1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 01:10:05 +08:00

Merge branch 'dev' into shell-layer

This commit is contained in:
wsdjeg 2017-02-02 22:40:47 +08:00
commit 520f9effba
36 changed files with 555 additions and 196 deletions

View File

@ -1,19 +1,15 @@
### Expected behavior, english is recommend
## Expected behavior, english is recommend
### Environment Information
## Environment Information
- OS:
- vim version:
- neovim version:
### The reproduce ways from Vim starting (Required!)
## The reproduce ways from Vim starting (Required!)
### Output of the ":message" command, and ":echo SpaceVim#logger#viewLog()"
## Output of the ":message" command, and ":echo SpaceVim#logger#viewLog()"
```log
please post log here:
please post log below, if you want me reproduce your issue quickly, post your custom config here will be better.
```

227
README.md
View File

@ -1,4 +1,4 @@
<p align="center"><img src="logo.jpg" alt="SpaceVim"/></p>
<p align="center"><img src="https://github.com/SpaceVim/SpaceVim/raw/table/logo.jpg" alt="SpaceVim"/></p>
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
![Version 0.1.0-dev](https://img.shields.io/badge/version-0.1.0--dev-yellow.svg?style=flat-square)
@ -13,10 +13,44 @@
[![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-01-07_1363x723](https://cloud.githubusercontent.com/assets/13142418/21739011/6c38c14e-d4ca-11e6-8f3e-2c21dfc489c0.png)
![2017-02-01_1359x720](https://cloud.githubusercontent.com/assets/13142418/22506984/38c627ae-e8be-11e6-8f9c-37e260d069a7.png)
### Table of Contents
- [Introduction](#introduction)
- [Install](#install)
- [Linux/Mac](#linuxmac)
- [Windows support](#windows-support)
- [File Structure](#file-structure)
- Features
- [Awesome ui](#awesome-ui)
- [Language specific mode](#language-specific-mode)
- [c/c++ support](#cc-support)
- [python support](#python-support)
- [go support](#go-support)
- rust support
- php support
- perl support
- lua support
- [Unite centric work-flow](#unite-centric-work-flow)
- [Neovim centric - Dark powered mode](#neovim-centric---dark-powered-mode-of-spacevim)
- [multiple leader mode](#multiple-leader-mode)
- [Modular configuration](#modular-configuration)
- Lazy-load 90% of plugins with [dein.vim]
- Robust, yet light weight
- Extensive Neocomplete setup
- Central location for tags
- Lightweight simple status/tabline
- Premium color-schemes
- [Custom configuration](#custom-configuration)
- [Support SpaceVim](#support-spacevim)
- [Report bugs](#report-bugs)
- [contribute to SpaceVim](#contribute-to-spacevim)
- Write post about SpaceVim
#### Introduction
[SpaceVim](https://github.com/SpaceVim/SpaceVim) is a Modular configuration, a bundle of custom settings and plugins for Vim,
here we call them layers, each layer has different plugins and config, user just need
here we call them layers, each layer has different plugins and config, users just need
to select the layers they need. It got inspired by [spacemacs](https://github.com/syl20bnr/spacemacs). If you use SpaceVim,
please star it on github. It's a great way of getting feedback and gives me the kick to
put more time into development.
@ -30,12 +64,14 @@ For learning about Vim in general, read [vim-galore](https://github.com/mhinz/vi
#### Install
##### Linux/Mac
```sh
curl -sLf https://spacevim.org/install.sh | bash
```
before use SpaceVim, you should install the plugin by `call dein#install()`
installation of neovim/vim with python support:
Installation of neovim/vim with python support:
> [neovim installation](https://github.com/neovim/neovim/wiki/Installing-Neovim)
> [Building Vim from source](https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source)
@ -49,8 +85,8 @@ curl -sLf https://spacevim.org/install.sh | bash -s -- -h
##### windows support
- For vim in windows, please just clone this repo as vimfiles in you Home directory.
by defalut, when open a cmd, the current dir is your Home directory, run this command in cmd.
make sure you have backup your own vimfiles.
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
@ -58,28 +94,13 @@ 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 defalut, when open a cmd, the current dir is your Home directory, run this command in cmd.
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
```
#### Features
- Neovim-centric
- [Modular configuration](#modular-configuration)
- [multiple leader mode](#multiple-leader-mode)
- Lazy-load 90% of plugins with [dein.vim]
- Robust, yet light weight
- [Unite centric work-flow](#unite-centric-work-flow)
- [Awesome ui](#awesome-ui)
- [Language specific mode](#language-specific-mode)
- Extensive Neocomplete setup
- Central location for tags
- Lightweight simple status/tabline
- Premium color-schemes
#### Structure
#### File Structure
- [config](./config)/ - Configuration
- [plugins](./config/plugins)/ - Plugin configurations
- [mappings.vim](./config/mappings.vim) - Key mappings
@ -97,88 +118,112 @@ git clone https://github.com/SpaceVim/SpaceVim.git AppData\Local\nvim
- [init.vim](./init.vim) - Sources `config/main.vim`
- [vimrc](./vimrc) - Sources `config/main.vim`
#### Modular configuration
#### Features
##### Awesome ui
- outline + filemanager + checker
![2017-02-01_1360x721](https://cloud.githubusercontent.com/assets/13142418/22506638/84705532-e8bc-11e6-8b72-edbdaf08426b.png)
##### Language specific mode
###### c/c++ support
1. code completion: autocompletion and fuzzy match.
![2017-02-01_1359x720](https://cloud.githubusercontent.com/assets/13142418/22505960/df9068de-e8b8-11e6-943e-d79ceca095f1.png)
2. syntax check: Asynchronous linting and make framework.
![2017-02-01_1359x722](https://cloud.githubusercontent.com/assets/13142418/22506340/e28b4782-e8ba-11e6-974b-ca29574dcc1f.png)
###### go support
1. code completion:
![2017-02-01_1360x721](https://cloud.githubusercontent.com/assets/13142418/22508345/8215c5e4-e8c4-11e6-95ec-f2a6e1e2f4d2.png)
2. syntax check:
![2017-02-01_1359x720](https://cloud.githubusercontent.com/assets/13142418/22509944/108b6508-e8cb-11e6-8104-6310a29ae796.png)
###### python support
1. code completion:
![2017-02-02_1360x724](https://cloud.githubusercontent.com/assets/13142418/22537799/7d1d47fe-e948-11e6-8168-a82e3f688554.png)
2. syntax check:
![2017-02-02_1358x720](https://cloud.githubusercontent.com/assets/13142418/22537883/36de7b5e-e949-11e6-866f-73c48e8f59aa.png)
##### Neovim centric - Dark powered mode of SpaceVim.
By default, SpaceVim use these dark powered plugins:
1. [deoplete.nvim](https://github.com/Shougo/deoplete.nvim) - Dark powered asynchronous completion framework for neovim
2. [dein.vim](https://github.com/Shougo/dein.vim) - Dark powered Vim/Neovim plugin manager
TODO:
1. [defx.nvim](https://github.com/Shougo/defx.nvim) - Dark powered file explorer
2. [deoppet.nvim](https://github.com/Shougo/deoppet.nvim) - Dark powered snippet plugin
3. [denite.nvim](https://github.com/Shougo/denite.nvim) - Dark powered asynchronous unite all interfaces for Neovim/Vim8
##### Modular configuration
- SpaceVim will load custom configuration from `~/.local.vim` and `.local.vim` in current directory.
- SpaceVim support `~/.SpaceVim.d/init.vim` and `./SpaceVim.d/init.vim`.
here is an example:
Here is an example:
```viml
" here are some basic customizations, please refer to the top of the vimrc
" file for all possible options
" Here are some basic customizations, please refer to the top of the vimrc
" file for all possible options:
let g:spacevim_default_indent = 3
let g:spacevim_max_column = 80
let g:spacevim_colorscheme = 'my_awesome_colorscheme'
let g:spacevim_plugin_manager = 'dein' " neobundle or dein or vim-plug
" change the default directory where all miscellaneous persistent files go
" by default it is ~/.cache/vimfiles
" Change the default directory where all miscellaneous persistent files go.
" By default it is ~/.cache/vimfiles.
let g:spacevim_plugin_bundle_dir = "/some/place/else"
" by default, language specific plugins are not loaded. this can be changed
" By default, language specific plugins are not loaded. This can be changed
" with the following:
let g:spacevim_plugin_groups_exclude = ['ruby', 'python']
" if there are groups you want always loaded, you can use this:
" If there are groups you want always loaded, you can use this:
let g:spacevim_plugin_groups_include = ['go']
" alternatively, you can set this variable to load exactly what you want
" Alternatively, you can set this variable to load exactly what you want:
let g:spacevim_plugin_groups = ['core', 'web']
" if there is a particular plugin you don't like, you can define this
" variable to disable them entirely
" If there is a particular plugin you don't like, you can define this
" variable to disable them entirely:
let g:spacevim_disabled_plugins=['vim-foo', 'vim-bar']
" if you want to add some custom plugins, use this options.
" 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'],
\ ]
" anything defined here are simply overrides
" Anything defined here are simply overrides
set wildignore+=\*/node_modules/\*
set guifont=Wingdings:h10
```
#### multiple leader mode
##### global origin vim leader, default : `\`
vim's origin global leader can be used in all the mode.
##### local origin vim leader, default : `,`
vim's origin local leader can be used in all the mode.
##### windows function leader, default : `s`
windows function leader can only be used in normal mode.
for the list of mappings see the [link](#window-management)
##### unite work flow leader, default : `f`
unite work flow leader can only be used in normal mode. unite leader need unite groups.
#### Multiple leader mode
##### Global origin vim leader, default : `\`
Vim's origin global leader can be used in all modes.
##### Local origin vim leader, default : `,`
Vim's origin local leader can be used in all the mode.
##### Windows function leader, default : `s`
Windows function leader can only be used in normal mode.
For the list of mappings see the [link](#window-management)
##### Unite work flow leader, default : `f`
Unite work flow leader can only be used in normal mode. Unite leader need unite groups.
#### Unite centric work-flow
- List all the plugins has been installed, fuzzy find what you want,
default action is open the github website of current plugin. default key is `<leader>lp`
[layer name] [plugin name] [load type] [plugin options]
- List all the plugins has been installed, fuzzy find what you want, default action is open the github website of current plugin. default key is `<leader>lp`
![2017-01-21_1358x725](https://cloud.githubusercontent.com/assets/13142418/22175019/ce42d902-e027-11e6-89cd-4f44f70a10cd.png)
- List all the mappings and description: `f<space>`
![2016-12-29-22 35 29](https://cloud.githubusercontent.com/assets/13142418/21546066/4896c5e2-ce17-11e6-8246-945b924df9aa.png)
![2017-02-01_1359x723](https://cloud.githubusercontent.com/assets/13142418/22507351/24af0d74-e8c0-11e6-985e-4a1404b629ed.png)
- List all the starred repos in github.com, fuzzy find and open the website of the repo. default key is `<leader>ls`
![2016-12-29-22 38 52](https://cloud.githubusercontent.com/assets/13142418/21546148/c6836618-ce17-11e6-82a9-81e90017dbf1.png)
#### Awesome ui
- outline + filemanager + checker
![2017-01-03-21 26 03](https://cloud.githubusercontent.com/assets/13142418/21609104/74567ce4-d1fb-11e6-9495-16aa5ad2e42d.png)
#### Language specific mode
- java
- viml
- rust
- php
- c/c++
- js
- python
![2017-02-01_1359x722](https://cloud.githubusercontent.com/assets/13142418/22506915/deb99caa-e8bd-11e6-9b80-316281ddb48c.png)
#### Plugin Highlights
@ -282,7 +327,7 @@ Name | Description
Name | Description
-------------- | ----------------------
[delimitmate] | Insert mode auto-completion for quotes, parens, brackets
[delimitmate] | Insert mode auto-completion for quotes, parenthesis, brackets
[echodoc] | Print objects' documentation in echo area
[deoplete] | Neovim: Dark powered asynchronous completion framework
[neocomplete] | Next generation completion framework
@ -513,18 +558,16 @@ Key | Mode | Action
`<leader>`+`gd` | Normal | Git diff
`<leader>`+`gc` | Normal | Git commit
`<leader>`+`gb` | Normal | Git blame
`<leader>`+`gB` | Normal | Open in browser
`<leader>`+`gp` | Normal | Git push
##### Plugin: GitGutter
##### Plugin: vim-signify
Key | Mode | Action
----- |:----:| ------------------
`<leader>`+`hj` | Normal | Jump to next hunk
`<leader>`+`hk` | Normal | Jump to previous hunk
`<leader>`+`hs` | Normal | Stage hunk
`<leader>`+`hr` | Normal | Revert hunk
`<leader>`+`hp` | Normal | Preview hunk
`<leader>`+`hj` / `]c` | Normal | Jump to next hunk
`<leader>`+`hk` / `[c` | Normal | Jump to previous hunk
`<leader>`+`hJ` / `]C` | Normal | Jump to last hunk
`<leader>`+`hK` / `[C` | Normal | Jump to first hunk
##### Misc Plugins
@ -538,6 +581,40 @@ Key | Mode | Action
`<leader>`+`W` | Normal | Wiki
`<leader>`+`K` | Normal | Thesaurus
#### Custom configuration
SpaceVim use `~/.SpaceVim.d/init.vim` as default global init file. you can set
SpaceVim-options or config layers in it. SpaceVim also will add `~/.SpaceVim.d/`
into runtimepath. so you can write your own vim script in it.
SpaceVim also support local config file for project, the init file is `.SpaceVim.d/init.vim`
in the root of your project. `.SpaceVim.d/` will also be added into runtimepath.
here is an example config file for SpaceVim:
```viml
" set the options of SpaceVim
let g:spacevim_colorscheme = 'solarized'
" setting layers, load 'lang#java' layer.
call SpaceVim#layers#load('lang#java')
" add custom plugins.
let g:spacevim_custom_plugins = [
\ ['plasticboy/vim-markdown', {'on_ft' : 'markdown'}],
\ ['wsdjeg/GitHub.vim'],
\ ]
" custom mappings:
nnoremap <c-l> :Ydc<cr>
```
#### Support SpaceVim
##### report bugs
If you get any issues, please open an issue with the ISSUE_TEMPLATE. It is useful for me to debug for this issue.
##### contribute to SpaceVim
#### Enjoy!
#### Credits & Thanks

View File

@ -2,7 +2,7 @@
" @section Introduction, intro
" @stylized Maktaba
" @library
" @order intro version dicts functions exceptions layers autocomplete colorscheme layer_lang_java layer_lang_php layer_lang_c layer-lang-rust faq
" @order intro version dicts functions exceptions layers faq
" SpaceVim is a Modular configuration, a bundle of custom settings
" and plugins, for Vim. It got inspired by spacemacs.
"
@ -117,6 +117,13 @@ let g:spacevim_use_colorscheme = 1
" <
let g:spacevim_vim_help_language = 'en'
""
" Set the message language of vim. By default it is empty, and the language is
" en_US.UTF-8. example:
" >
" let g:spacevim_language = 'en_CA.utf8'
" <
let g:spacevim_language = ''
""
" The colorscheme of SpaceVim, if colorscheme groups are installed.
let g:spacevim_colorscheme = 'gruvbox'
""
@ -306,9 +313,11 @@ endfunction
function! SpaceVim#welcome() abort
VimFiler
wincmd p
Startify
if exists(':VimFiler') == 2 && exists(':Startify') == 2
VimFiler
wincmd p
Startify
endif
endfunction
""

View File

@ -27,6 +27,9 @@ function! SpaceVim#default#SetOptions() abort
set relativenumber
set number
" hide cmd
set noshowcmd
" indent
set autoindent
set smartindent
@ -44,6 +47,9 @@ function! SpaceVim#default#SetOptions() abort
set softtabstop=4
set shiftwidth=4
" autoread
set autoread
" backup
set backup
set undofile
@ -75,7 +81,6 @@ function! SpaceVim#default#SetOptions() abort
set nowritebackup
set matchtime=0
set ruler
set showcmd
set showmatch
set showmode
"menuone: show the pupmenu when only one match
@ -362,6 +367,7 @@ function! SpaceVim#default#SetMappings() abort
call SpaceVim#mapping#def('nnoremap <silent>', '<Leader>sg', ':vsplit<CR>:wincmd p<CR>:e#<CR>',
\'Open previous buffer in vsplit window' , 'vsplit|wincmd p|e#')
call SpaceVim#mapping#def('nnoremap <silent>', 'gf', ':call zvim#gf()<CR>', 'Jump to a file under cursor', '')
call SpaceVim#mapping#def('nnoremap <silent>', 'gd', ':call SpaceVim#mapping#gd()<CR>', 'Goto declaration', '')
endfunction
fu! s:tobur(num) abort

View File

@ -0,0 +1,18 @@
function! SpaceVim#health#report() abort
let items = map(SpaceVim#util#globpath(&rtp,'autoload/SpaceVim/health/*'), "fnamemodify(v:val,':t:r')")
let report = []
for item in items
try
let result = SpaceVim#health#{item}#check()
call extend(report,result)
catch /^Vim\%((\a\+)\)\=:E117/
call extend(report,[
\ '',
\ 'SpaceVim Health Error:',
\ ' There is no function: SpaceVim#health#' . item . '#check()',
\ '',
\ ])
endtry
endfor
return join(report, "\n")
endfunction

View File

View File

View File

@ -0,0 +1,41 @@
function! SpaceVim#health#python#check() abort
let result = ['SpaceVim python support check report:']
if has('nvim')
call add(result, 'Checking +python3:')
if has('python3')
call add(result, ' SUCCEED!')
else
call add(result, ' Failed : to support +python3, you need run `pip3 install neovim`')
endif
call add(result, 'Checking +python:')
if has('python')
call add(result, ' SUCCEED!')
else
call add(result, ' Failed : to support +python, you need run `pip2 install neovim`')
endif
else
call add(result, 'Checking +python3:')
if has('python3')
call add(result, ' SUCCEED!')
else
if !WINDOWS()
call add(result, ' Failed : to support +python3, Please install vim-gik, or build from sources.')
else
call add(result, ' Failed : to support +python3, install vim from https://github.com/vim/vim-win32-installer/releases')
call add(result, ' install python3, make sure you have `python` in your path.')
endif
endif
call add(result, 'Checking +python:')
if has('python')
call add(result, ' SUCCEED!')
else
if !WINDOWS()
call add(result, ' Failed : to support +python, Please install vim-gik, or build from sources.')
else
call add(result, ' Failed : to support +python3, install vim from https://github.com/vim/vim-win32-installer/releases')
call add(result, ' install python3, make sure you have `python` in your path.')
endif
endif
endif
return result
endfunction

View File

@ -1,5 +1,7 @@
""
" @section Autocomplete, autocomplete
" @section autocomplete, autocomplete
" @parentsection layers
" @subsection code completion
" SpaceVim use neocomplete as default completion engine for vim with lua
" support, if has no lua support neocomplcache will be the completion engine.
" SpaceVim use deoplete as default completion engine for nevoim. to make
@ -7,6 +9,11 @@
"
" SpaceVim include YouCompleteMe, but it is disabled by default, to enable
" ycm, see |g:spacevim_enable_ycm|.
"
" @subsection snippet
" SpaceVim use neosnippet as default snippet engine, and the default snippets
" is `Shougo/neosnippet-snippets`. for more information, please read
" |neosnippet|.
@ -15,7 +22,6 @@ function! SpaceVim#layers#autocomplete#plugins() abort
\ ['honza/vim-snippets', {'on_i' : 1, 'loadconf_before' : 1}],
\ ['Shougo/neco-syntax', { 'on_i' : 1}],
\ ['ujihisa/neco-look', { 'on_i' : 1}],
\ ['Shougo/neco-vim', { 'on_i' : 1, 'loadconf_before' : 1}],
\ ['Shougo/context_filetype.vim', { 'on_i' : 1}],
\ ['Shougo/neoinclude.vim', { 'on_i' : 1}],
\ ['Shougo/neosnippet-snippets', { 'merged' : 0}],

View File

@ -1,5 +1,6 @@
""
" @section Colorscheme, colorscheme
" @section colorscheme, colorscheme
" @parentsection layers
" SpaceVim default colorscheme is gruvbox, you can change it by set spacevim
" option. add this to your `~/.SpaceVim.d/init.vim`
" >

View File

@ -1,6 +1,7 @@
function! SpaceVim#layers#edit#plugins() abort
let plugins = [
\ ['tpope/vim-surround'],
\ ['junegunn/vim-emoji'],
\ ['terryma/vim-multiple-cursors'],
\ ['scrooloose/nerdcommenter'],
\ ['mattn/emmet-vim', { 'on_cmd' : 'EmmetInstall'}],

View File

@ -10,5 +10,17 @@ endfunction
function! SpaceVim#layers#git#config() abort
nnoremap <silent> <Leader>gs :Gita status<CR>
nnoremap <silent> <Leader>gd :Gita diff<CR>
nnoremap <silent> <Leader>gc :Gita commit<CR>
nnoremap <silent> <Leader>gb :Gita blame<CR>
nnoremap <silent> <Leader>gp :Gita push<CR>
nmap <leader>hj <plug>(signify-next-hunk)
nmap <leader>hk <plug>(signify-prev-hunk)
nmap <leader>hJ 9999<leader>gj
nmap <leader>hK 9999<leader>gk
augroup spacevim_layer_git
autocmd!
autocmd FileType diff nnoremap <buffer><silent> q :bd!<CR>
augroup END
endfunction

View File

@ -10,7 +10,6 @@ function! SpaceVim#layers#lang#plugins() abort
\ ['wavded/vim-stylus', { 'on_ft' : ['styl']}],
\ ['digitaltoad/vim-jade', { 'on_ft' : ['jade']}],
\ ['juvenn/mustache.vim', { 'on_ft' : ['mustache']}],
\ ['Valloric/MatchTagAlways', { 'on_ft' : ['html' , 'xhtml' , 'xml' , 'jinja']}],
\ ['leafgarland/typescript-vim', { 'on_ft' : ['typescript']}],
\ ['kchmck/vim-coffee-script', { 'on_ft' : ['coffee']}],
\ ['leshill/vim-json', { 'on_ft' : ['javascript','json']}],
@ -25,12 +24,6 @@ function! SpaceVim#layers#lang#plugins() abort
\ ['vimperator/vimperator.vim', { 'on_ft' : 'vimperator'}],
\ ['voxpupuli/vim-puppet', {'on_ft' : 'puppet'}],
\ ]
" python
if has('nvim')
call add(plugins, ['zchee/deoplete-jedi', { 'on_ft' : 'python'}])
else
call add(plugins, ['davidhalter/jedi-vim', { 'on_ft' : 'python'}])
endif
return plugins
endfunction

View File

@ -1,5 +1,6 @@
""
" @section Layer_lang_c
" @section lang#c, layer-lang-c
" @parentsection layers
" this layer provide c family language code completion and syntax chaeck.you
" need install clang.
"

View File

@ -1,3 +1,22 @@
""
" @section lang#go, layer-lang-go
" @parentsection layers
" This layer support go development, include code completion and syntax check.
" @subsection mappings
" >
" mode key function
" normal <leader>gi go implements
" normal <leader>gf go info
" normal <leader>ge go rename
" normal <leader>gr go run
" normal <leader>gb go build
" normal <leader>gt go test
" normal <leader>gd go doc
" normal <leader>gv go doc vertical
" normal <leader>gco go coverage
" <
function! SpaceVim#layers#lang#go#plugins() abort
let plugins = [['fatih/vim-go', { 'on_ft' : 'go', 'loadconf_before' : 1}]]
if has('nvim')
@ -16,18 +35,18 @@ function! SpaceVim#layers#lang#go#config() abort
let g:go_fmt_command = 'goimports'
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
let g:go_snippet_engine = "neosnippet"
let g:go_snippet_engine = 'neosnippet'
augroup SpaceVim_go
au!
au FileType go nmap <Buffer><Leader>s <Plug>(go-implements)
au FileType go nmap <Buffer><Leader>i <Plug>(go-info)
au FileType go nmap <Buffer><Leader>e <Plug>(go-rename)
au FileType go nmap <Buffer><Leader>r <Plug>(go-run)
au FileType go nmap <Buffer><Leader>b <Plug>(go-build)
au FileType go nmap <Buffer><Leader>t <Plug>(go-test)
au FileType go nmap <Buffer><Leader>gd <Plug>(go-doc)
au FileType go nmap <Buffer><Leader>gv <Plug>(go-doc-vertical)
au FileType go nmap <Buffer><Leader>co <Plug>(go-coverage)
au FileType go nmap <Buffer><silent><Leader>s <Plug>(go-implements)
au FileType go nmap <Buffer><silent><Leader>i <Plug>(go-info)
au FileType go nmap <Buffer><silent><Leader>e <Plug>(go-rename)
au FileType go nmap <Buffer><silent><Leader>r <Plug>(go-run)
au FileType go nmap <Buffer><silent><Leader>b <Plug>(go-build)
au FileType go nmap <Buffer><silent><Leader>t <Plug>(go-test)
au FileType go nmap <Buffer><silent><Leader>gd <Plug>(go-doc)
au FileType go nmap <Buffer><silent><Leader>gv <Plug>(go-doc-vertical)
au FileType go nmap <Buffer><silent><Leader>co <Plug>(go-coverage)
augroup END
endfunction

View File

@ -1,5 +1,6 @@
""
" @section Layer_lang_java, layer_lang_java
" @section lang#java, layer-lang-java
" @parentsection layers
" This layer is for java development.
" >
" import-mappings:

View File

@ -1,5 +1,6 @@
""
" @section Layer_lang_php
" @section lang#php, layer-lang-php
" @parentsection layers
" this layer is for php development, and it provide auto codo completion,
" and syntax check, and jump to the definition location.
"

View File

@ -0,0 +1,19 @@
""
" @section lang#python, layer-lang-python
" @parentsection layers
" To make this layer works well, you should install jedi.
" @subsection mappings
" >
" mode key function
" <
function! SpaceVim#layers#lang#python#plugins() abort
let plugins = []
" python
if has('nvim')
call add(plugins, ['zchee/deoplete-jedi', { 'on_ft' : 'python'}])
else
call add(plugins, ['davidhalter/jedi-vim', { 'on_ft' : 'python'}])
endif
return plugins
endfunction

View File

@ -1,5 +1,6 @@
""
" @section layer-lang-rust, layer-lang-rust
" @section lang#rust, layer-lang-rust
" @parentsection layers
" SpaceVim do not load this layer by default, if you are a rust developer, you
" should add `call SpaceVim#layers#load('lang#rust')` to your @section(config)
"

View File

@ -0,0 +1,12 @@
function! SpaceVim#layers#lang#vim#plugins() abort
let plugins = []
call add(plugins,['tweekmonster/exception.vim'])
call add(plugins,['mhinz/vim-lookup'])
call add(plugins,['Shougo/neco-vim', { 'on_i' : 1, 'loadconf_before' : 1}])
call add(plugins,['tweekmonster/helpful.vim', {'on_cmd': 'HelpfulVersion'}])
return plugins
endfunction
function! SpaceVim#layers#lang#vim#config() abort
call SpaceVim#mapping#gd#add('vim','lookup#lookup')
endfunction

View File

@ -0,0 +1,18 @@
""
" @section lang#xml, layer-lang-xml
" @parentsection layers
" when edite an xml file, the omni func is `xmlcomplete#CompleteTags`, you can
" read the document in `autoload/xmlcomplete.vim` in vim or neovim
" runtime directory.
function! SpaceVim#layers#lang#xml#plugins() abort
let plugins = []
call add(plugins,['Valloric/MatchTagAlways', { 'on_ft' : ['html' , 'xhtml' , 'xml' , 'jinja']}])
call add(plugins,['sukima/xmledit', { 'on_ft' : ['html' , 'xhtml' , 'xml' , 'jinja']}])
return plugins
endfunction
function! SpaceVim#layers#lang#xml#config() abort
endfunction

View File

@ -4,9 +4,10 @@ function! SpaceVim#layers#tools#plugins() abort
\ ['wsdjeg/vim-cheat', { 'on_cmd' : 'Cheat'}],
\ ['wsdjeg/SourceCounter.vim', { 'on_cmd' : 'SourceCounter'}],
\ ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', 'loadconf' : 1}],
\ ['junegunn/limelight.vim', { 'on_cmd' : 'Limelight'}],
\ ['Yggdroot/LeaderF', {'merged' : 0}],
\ ['MattesGroeger/vim-bookmarks', { 'on_map' : '<Plug>Bookmark', 'loadconf_before' : 1}],
\ ['google/vim-searchindex'],
\ ['tweekmonster/helpful.vim', {'on_cmd': 'HelpfulVersion'}],
\ ['simnalamburt/vim-mundo', { 'on_cmd' : 'MundoToggle'}],
\ ['wsdjeg/MarkDown.pl', { 'on_cmd' : 'MarkDownPreview'}],
\ ['mhinz/vim-grepper' , { 'on_cmd' : 'Grepper', 'loadconf' : 1} ],
@ -34,6 +35,11 @@ function! SpaceVim#layers#tools#plugins() abort
endfunction
function! SpaceVim#layers#tools#config() abort
nmap mm <Plug>BookmarkToggle
nmap mi <Plug>BookmarkAnnotate
nmap ma <Plug>BookmarkShowAll
nmap mn <Plug>BookmarkNext
nmap mp <Plug>BookmarkPrev
nnoremap <silent> <F7> :MundoToggle<CR>
augroup rainbow_lisp
autocmd!

View File

@ -4,6 +4,7 @@ function! SpaceVim#layers#ui#plugins() abort
\ ['Yggdroot/indentLine'],
\ ['mhinz/vim-signify'],
\ ['majutsushi/tagbar', {'loadconf' : 1}],
\ ['lvht/tagbar-markdown',{'merged' : 0}],
\ ['vim-airline/vim-airline', { 'merged' : 0, 'loadconf' : 1}],
\ ['vim-airline/vim-airline-themes', { 'merged' : 0}],
\ ['mhinz/vim-startify', {'loadconf' : 1}],

View File

@ -21,6 +21,7 @@ function! SpaceVim#layers#unite#plugins() abort
\ ['heavenshell/unite-zf'],
\ ['heavenshell/unite-sf2'],
\ ['osyo-manga/unite-vimpatches'],
\ ['rhysd/unite-emoji.vim'],
\ ['Shougo/unite-outline'],
\ ['hewes/unite-gtags' ,{'loadconf' : 1}],
\ ['rafi/vim-unite-issue'],

View File

@ -47,19 +47,29 @@ endfunction
function! SpaceVim#logger#viewLog(...) abort
let info = "SpaceVim Options :\n\n"
let info = "### SpaceVim Options :\n\n"
let info .= "```viml\n"
let info .= join(SpaceVim#options#list(), "\n")
let info .= "\n"
let info .= "\n```\n"
let info .= "\n\n"
let info .= "### SpaceVim Health checking :\n\n"
let info .= SpaceVim#health#report()
let info .= "\n\n"
let info .= "### SpaceVim runtime log :\n\n"
let info .= "```log\n"
let l = a:0 > 0 ? a:1 : 1
if filereadable(s:logger_file)
let logs = readfile(s:logger_file, '')
return info . join(filter(logs, "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \[" . s:levels[l] . "\]'"), "\n")
let info .= join(filter(logs, "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \[" . s:levels[l] . "\]'"), "\n")
else
let info .= '[ SpaceVim ] : logger file ' . s:logger_file . ' does not exists, only log for current process will be shown!'
let info .= join(filter(s:log_temp, "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \[" . s:levels[l] . "\]'"), "\n")
return info
endif
let info .= "\n```\n"
return info
endfunction
""

View File

@ -56,3 +56,11 @@ function! SpaceVim#mapping#enter() abort
return "\<Enter>"
endif
endfunction
function! SpaceVim#mapping#gd() abort
if !empty(SpaceVim#mapping#gd#get())
call call(SpaceVim#mapping#gd#get(), [])
else
normal! gd
endif
endfunction

View File

@ -0,0 +1,8 @@
let s:gd = {}
function! SpaceVim#mapping#gd#add(ft, func) abort
call extend(s:gd,{a:ft : a:func})
endfunction
function! SpaceVim#mapping#gd#get() abort
return get(s:gd, &filetype, '')
endfunction

View File

@ -1,11 +1,25 @@
function! SpaceVim#options#list() abort
let list = []
if has('patch-7.4.2010')
if has('patch-7.4.2010') && 0
for var in getcompletion('g:spacevim_','var')
call add(list, var . ' = ' . string(get(g:, var[2:] , '')))
endfor
else
call add(list, 'your vim is too old, getcompletion() need patch7-4-2010')
redraw
for var in filter(map(s:execute('let g:'), "matchstr(v:val, '\\S\\+')"), "v:val =~# '^spacevim_'")
call add(list,'g:' . var . ' = ' . string(get(g:, var , '')))
endfor
endif
return list
endfunction
function! s:execute(cmd) abort
if exists('*execute')
return split(execute(a:cmd), "\n")
endif
redir => output
execute a:cmd
redir END
return split(output, "\n")
endfunction

View File

@ -11,7 +11,6 @@ function! SpaceVim#plugins#load() abort
endfunction
function! s:load_plugins() abort
for group in g:spacevim_plugin_groups
let g:spacevim_plugin_layer = group
for plugin in s:getLayerPlugins(group)
if len(plugin) == 2
call zvim#plug#add(plugin[0], plugin[1])
@ -27,9 +26,6 @@ function! s:load_plugins() abort
endfor
call s:loadLayerConfig(group)
endfor
if exists('g:spacevim_plugin_layer')
unlet g:spacevim_plugin_layer
endif
for plugin in g:spacevim_custom_plugins
if len(plugin) == 2
call zvim#plug#add(plugin[0], plugin[1])

View File

@ -150,20 +150,24 @@ fu! s:parser(args)
endf
function! zvim#plug#add(repo,...) abort
let g:spacevim_plugin_name = ''
if g:spacevim_plugin_manager == 'neobundle'
exec 'NeoBundle "'.a:repo.'"'.','.join(a:000,',')
let g:spacevim_plugin_name = split(a:repo, '/')[-1]
elseif g:spacevim_plugin_manager == 'dein'
if len(a:000) > 0
call dein#add(a:repo,s:parser(a:000[0]))
else
call dein#add(a:repo)
endif
let g:spacevim_plugin_name = g:dein#name
elseif g:spacevim_plugin_manager == 'vim-plug'
if len(a:000) > 0
exec "Plug '".a:repo."', ".join(a:000,',')
else
exec "Plug '".a:repo."'"
endif
let g:spacevim_plugin_name = split(a:repo, '/')[-1]
endif
let str = get(g:,'spacevim_plugin_layer', 'custom plugin')
let str = '[' . str . ']'

View File

@ -28,6 +28,7 @@ let g:deoplete#ignore_sources.c = ['omni']
let g:deoplete#ignore_sources.rust = ['omni']
let g:deoplete#ignore_sources.perl = ['omni']
call deoplete#custom#set('go', 'mark', '')
call deoplete#custom#set('go', 'rank', 9999)
call deoplete#custom#set('clang2', 'mark', '')
call deoplete#custom#set('racer', 'mark', '')
if g:spacevim_enable_javacomplete2_py

View File

@ -1,18 +1,26 @@
let s:save_option = {}
function! s:goyo_enter()
silent !tmux set status off
let s:save_option['showmode'] = &showmode
let s:save_option['showcmd'] = &showcmd
let s:save_option['scrolloff'] = &scrolloff
set noshowmode
set noshowcmd
set scrolloff=999
Limelight
if exists(':Limelight') == 2
Limelight
let s:save_option['limelight'] = 1
endif
endfunction
function! s:goyo_leave()
silent !tmux set status on
set showmode
set showcmd
set scrolloff=5
let &showmode = s:save_option['showmode']
let &showcmd = s:save_option['showcmd']
let &scrolloff = s:save_option['scrolloff']
if get(s:save_option,'limelight', 0)
execute 'Limelight!'
endif
endfunction
augroup goyo_map
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
augroup END

View File

@ -1,2 +1,12 @@
let g:tagbar_width=30
let g:tagbar_left = 1
let g:tagbar_type_markdown = {
\ 'ctagstype' : 'markdown',
\ 'kinds' : [
\ 'h:headings',
\ ],
\ 'sort' : 0
\ }

View File

@ -1,8 +1,8 @@
nnoremap <leader>gd :execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.expand('<cword>')<CR>
nnoremap <leader>gc :execute 'Unite -auto-preview -start-insert -no-split gtags/context'<CR>
"nnoremap <leader>gd :execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.expand('<cword>')<CR>
"nnoremap <leader>gc :execute 'Unite -auto-preview -start-insert -no-split gtags/context'<CR>
nnoremap <leader>gr :execute 'Unite -auto-preview -start-insert -no-split gtags/ref'<CR>
nnoremap <leader>gg :execute 'Unite -auto-preview -start-insert -no-split gtags/grep'<CR>
nnoremap <leader>gp :execute 'Unite -auto-preview -start-insert -no-split gtags/completion'<CR>
"nnoremap <leader>gp :execute 'Unite -auto-preview -start-insert -no-split gtags/completion'<CR>
vnoremap <leader>gd <ESC>:execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.GetVisualSelection()<CR>
let g:unite_source_gtags_project_config = {
\ '_': { 'treelize': 0 }

View File

@ -0,0 +1,9 @@
nmap <Leader><Leader> <Plug>BookmarkToggle
nmap <Leader>i <Plug>BookmarkAnnotate
nmap <Leader>a <Plug>BookmarkShowAll
nmap <Leader>j <Plug>BookmarkNext
nmap <Leader>k <Plug>BookmarkPrev
nmap <Leader>c <Plug>BookmarkClear
nmap <Leader>x <Plug>BookmarkClearAll
nmap <Leader>kk <Plug>BookmarkMoveUp
nmap <Leader>jj <Plug>BookmarkMoveDown

View File

@ -7,13 +7,16 @@ CONTENTS *SpaceVim-contents*
2. CONFIGURATION...........................................|SpaceVim-config|
3. Functions............................................|SpaceVim-functions|
4. Layers..................................................|SpaceVim-layers|
5. Autocomplete......................................|SpaceVim-autocomplete|
6. Colorscheme........................................|SpaceVim-colorscheme|
7. Layer_lang_java................................|SpaceVim-layer_lang_java|
8. Layer_lang_php..................................|SpaceVim-layer_lang_php|
9. Layer_lang_c......................................|SpaceVim-layer_lang_c|
10. layer-lang-rust...............................|SpaceVim-layer-lang-rust|
11. FAQ.......................................................|SpaceVim-faq|
1. autocomplete..................................|SpaceVim-autocomplete|
2. colorscheme....................................|SpaceVim-colorscheme|
3. lang#c........................................|SpaceVim-layer-lang-c|
4. lang#go......................................|SpaceVim-layer-lang-go|
5. lang#java..................................|SpaceVim-layer-lang-java|
6. lang#php....................................|SpaceVim-layer-lang-php|
7. lang#python..............................|SpaceVim-layer-lang-python|
8. lang#rust..................................|SpaceVim-layer-lang-rust|
9. lang#xml....................................|SpaceVim-layer-lang-xml|
5. FAQ........................................................|SpaceVim-faq|
==============================================================================
INTRODUCTION *SpaceVim-intro*
@ -119,6 +122,13 @@ chinese.
let g:spacevim_vim_help_language = 'chinese'
<
*g:spacevim_language*
Set the message language of vim. By default it is empty, and the language is
en_US.UTF-8. example:
>
let g:spacevim_language = 'en_CA.utf8'
<
*g:spacevim_colorscheme*
The colorscheme of SpaceVim, if colorscheme groups are installed.
@ -237,6 +247,7 @@ LAYERS *SpaceVim-layers*
==============================================================================
AUTOCOMPLETE *SpaceVim-autocomplete*
CODE COMPLETION
SpaceVim use neocomplete as default completion engine for vim with lua
support, if has no lua support neocomplcache will be the completion engine.
SpaceVim use deoplete as default completion engine for nevoim. to make neovim
@ -245,6 +256,10 @@ support python, please read neovim's |provider-python|.
SpaceVim include YouCompleteMe, but it is disabled by default, to enable ycm,
see |g:spacevim_enable_ycm|.
SNIPPET
SpaceVim use neosnippet as default snippet engine, and the default snippets is
`Shougo/neosnippet-snippets`. for more information, please read |neosnippet|.
==============================================================================
COLORSCHEME *SpaceVim-colorscheme*
@ -377,58 +392,7 @@ colorschemes: if the colorscheme you want do not list below, PR welcome.
<
==============================================================================
LAYER_LANG_JAVA *SpaceVim-layer_lang_java*
This layer is for java development.
>
import-mappings:
mode key function
normal <F4> import class under corsor.
insert <F4> import class under corsor.
normal <leader>jI import missing classes.
normal <leader>jR remove unused imports.
normal <leader>ji smart import class under corsor.
normal <leader>jii same as <F4>
insert <c-j>I import missing imports.
insert <c-j>R remove unused imports.
insert <c-j>i smart import class under corsor.
insert <c-j>ii add import for class under corsor.
generate-mappings:
mode key function
normal <leader>jA generate accessors.
normal <leader>js generate setter accessor.
normal <leader>jg generate getter accessor.
normal <leader>ja generate setter and getter accessor.
normal <leader>jts generate toString function.
normal <leader>jeq generate equals and hashcode function.
normal <leader>jc generate constructor.
normal <leader>jcc generate default constructor.
insert <c-j>s generate setter accessor.
insert <c-j>g generate getter accessor.
insert <c-j>a generate getter and setter accessor.
visual <leader>js generate setter accessor.
visual <leader>jg generate getter accessor.
visual <leader>ja generate setter and getter acctssor.
<
==============================================================================
LAYER_LANG_PHP *SpaceVim-layer_lang_php*
this layer is for php development, and it provide auto codo completion, and
syntax check, and jump to the definition location.
requirement:
>
PHP 5.3+
PCNTL Extension
Msgpack 0.5.7+(for NeoVim) Extension or JSON(for Vim 7.4+) Extension
Composer Project
<
==============================================================================
LAYER_LANG_C *SpaceVim-layer_lang_c*
LANG#C *SpaceVim-layer-lang-c*
this layer provide c family language code completion and syntax chaeck.you
need install clang.
@ -465,7 +429,87 @@ setting it to 0 disables this feature.
==============================================================================
LAYER-LANG-RUST *SpaceVim-layer-lang-rust*
LANG#GO *SpaceVim-layer-lang-go*
This layer support go development, include code completion and syntax check.
MAPPINGS
>
mode key function
normal <leader>gi go implements
normal <leader>gf go info
normal <leader>ge go rename
normal <leader>gr go run
normal <leader>gb go build
normal <leader>gt go test
normal <leader>gd go doc
normal <leader>gv go doc vertical
normal <leader>gco go coverage
<
==============================================================================
LANG#JAVA *SpaceVim-layer-lang-java*
This layer is for java development.
>
import-mappings:
mode key function
normal <F4> import class under corsor.
insert <F4> import class under corsor.
normal <leader>jI import missing classes.
normal <leader>jR remove unused imports.
normal <leader>ji smart import class under corsor.
normal <leader>jii same as <F4>
insert <c-j>I import missing imports.
insert <c-j>R remove unused imports.
insert <c-j>i smart import class under corsor.
insert <c-j>ii add import for class under corsor.
generate-mappings:
mode key function
normal <leader>jA generate accessors.
normal <leader>js generate setter accessor.
normal <leader>jg generate getter accessor.
normal <leader>ja generate setter and getter accessor.
normal <leader>jts generate toString function.
normal <leader>jeq generate equals and hashcode function.
normal <leader>jc generate constructor.
normal <leader>jcc generate default constructor.
insert <c-j>s generate setter accessor.
insert <c-j>g generate getter accessor.
insert <c-j>a generate getter and setter accessor.
visual <leader>js generate setter accessor.
visual <leader>jg generate getter accessor.
visual <leader>ja generate setter and getter acctssor.
<
==============================================================================
LANG#PHP *SpaceVim-layer-lang-php*
this layer is for php development, and it provide auto codo completion, and
syntax check, and jump to the definition location.
requirement:
>
PHP 5.3+
PCNTL Extension
Msgpack 0.5.7+(for NeoVim) Extension or JSON(for Vim 7.4+) Extension
Composer Project
<
==============================================================================
LANG#PYTHON *SpaceVim-layer-lang-python*
To make this layer works well, you should install jedi.
MAPPINGS
>
mode key function
<
==============================================================================
LANG#RUST *SpaceVim-layer-lang-rust*
SpaceVim do not load this layer by default, if you are a rust developer, you
should add `call SpaceVim#layers#load('lang#rust')` to your |SpaceVim-config|
@ -491,6 +535,13 @@ mappings:
normal <leader>gd rust-doc
<
==============================================================================
LANG#XML *SpaceVim-layer-lang-xml*
when edite an xml file, the omni func is `xmlcomplete#CompleteTags`, you can
read the document in `autoload/xmlcomplete.vim` in vim or neovim runtime
directory.
==============================================================================
FAQ *SpaceVim-faq*