mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 02:50:03 +08:00
Merge branch 'dev'
This commit is contained in:
commit
30c220a4d7
@ -1,6 +1,11 @@
|
|||||||
language: python
|
language: python
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
slack:
|
||||||
|
on_success: never
|
||||||
|
on_failure: never
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
pip: true
|
pip: true
|
||||||
|
|
||||||
|
247
README.md
247
README.md
@ -4,16 +4,22 @@
|
|||||||
[Documentation](http://spacevim.org/documentation/) |
|
[Documentation](http://spacevim.org/documentation/) |
|
||||||
[Twitter](https://twitter.com/SpaceVim) |
|
[Twitter](https://twitter.com/SpaceVim) |
|
||||||
[Community](https://spacevim.org/community/) |
|
[Community](https://spacevim.org/community/) |
|
||||||
[Gitter **Chat**](https://gitter.im/SpaceVim/SpaceVim)
|
[Gitter **Chat**](https://gitter.im/SpaceVim/SpaceVim) |
|
||||||
|
[中文文档](http://spacevim.org/README_zh_cn/)
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
|
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
|
||||||
![Version](https://img.shields.io/badge/version-0.4.0--dev-FF00CC.svg)
|
![Version](https://img.shields.io/badge/version-0.5.0--dev-FF00CC.svg)
|
||||||
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
|
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
|
||||||
[![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg)](doc/SpaceVim.txt)
|
[![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg)](doc/SpaceVim.txt)
|
||||||
[![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")
|
[![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")
|
[![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.
|
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. 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.
|
||||||
|
|
||||||
|
![welcome-page](https://cloud.githubusercontent.com/assets/13142418/26402270/28ad72b8-40bc-11e7-945e-003f41e057be.png)
|
||||||
|
|
||||||
|
|
||||||
See the [documentation](https://spacevim.org/documentation) or [the list of layers](http://spacevim.org/layers/) for more information.
|
See the [documentation](https://spacevim.org/documentation) or [the list of layers](http://spacevim.org/layers/) for more information.
|
||||||
|
|
||||||
@ -21,108 +27,8 @@ Here is a throughput graph of the repository for the last few weeks:
|
|||||||
|
|
||||||
[![Throughput Graph](https://graphs.waffle.io/SpaceVim/SpaceVim/throughput.svg)](https://waffle.io/SpaceVim/SpaceVim/metrics/throughput)
|
[![Throughput Graph](https://graphs.waffle.io/SpaceVim/SpaceVim/throughput.svg)](https://waffle.io/SpaceVim/SpaceVim/metrics/throughput)
|
||||||
|
|
||||||
# Table of Contents
|
|
||||||
|
|
||||||
|
### Install
|
||||||
<!-- vim-markdown-toc GFM -->
|
|
||||||
* [Introduction](#introduction)
|
|
||||||
* [Features](#features)
|
|
||||||
* [Mnemonic key bindings](#mnemonic-key-bindings)
|
|
||||||
* [Unite work flow](#unite-work-flow)
|
|
||||||
* [module statusline](#module-statusline)
|
|
||||||
* [Install](#install)
|
|
||||||
* [1. Requirements](#1-requirements)
|
|
||||||
* [2. Install SpaceVim in Linux/Mac](#2-install-spacevim-in-linuxmac)
|
|
||||||
* [3. Install SpaceVim in windows](#3-install-spacevim-in-windows)
|
|
||||||
* [Update](#update)
|
|
||||||
* [Documentation](#documentation)
|
|
||||||
* [Quick start guide](#quick-start-guide)
|
|
||||||
* [Community](#community)
|
|
||||||
* [Support SpaceVim](#support-spacevim)
|
|
||||||
* [contribute to SpaceVim](#contribute-to-spacevim)
|
|
||||||
* [Write post about SpaceVim](#write-post-about-spacevim)
|
|
||||||
* [Credits & Thanks](#credits--thanks)
|
|
||||||
|
|
||||||
<!-- vim-markdown-toc -->
|
|
||||||
|
|
||||||
## Introduction
|
|
||||||
|
|
||||||
[SpaceVim](https://github.com/SpaceVim/SpaceVim) is a community-driven vim distribution with a bundle of modular configuration,
|
|
||||||
here we call these modules as 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.
|
|
||||||
|
|
||||||
![welcome-page](https://cloud.githubusercontent.com/assets/13142418/26402270/28ad72b8-40bc-11e7-945e-003f41e057be.png)
|
|
||||||
|
|
||||||
If you are new to vim, you should learn about Vim in general, read [vim-galore](https://github.com/mhinz/vim-galore).
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- **Great documentation:** access documentation in Vim with
|
|
||||||
<kbd>:h SpaceVim</kbd>.
|
|
||||||
- **Beautiful GUI:** you'll love the awesome UI and its useful features.
|
|
||||||
- **Mnemonic key bindings:** commands have mnemonic prefixes like
|
|
||||||
<kbd>[Window]</kbd> for all the window and buffer commands or <kbd>[Unite]</kbd> for the
|
|
||||||
unite work flow commands.
|
|
||||||
- **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
|
|
||||||
|
|
||||||
### Mnemonic key bindings
|
|
||||||
|
|
||||||
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).
|
|
||||||
|
|
||||||
for example, after pressing `<Space>` in normal mode, you will see :
|
|
||||||
|
|
||||||
![mapping-guide](https://cloud.githubusercontent.com/assets/13142418/25778673/ae8c3168-3337-11e7-8536-ee78d59e5a9c.png)
|
|
||||||
|
|
||||||
this guide show you all the available key bindings begin with `[SPC]`, you can type `b` for all the buffer mappings, `p` for project mappings, etc. after pressing `<C-h>` in guide buffer, you will get paging and help info in the statusline.
|
|
||||||
|
|
||||||
here is the guide for the default mappings in SpaceVim:
|
|
||||||
|
|
||||||
![spc](https://user-images.githubusercontent.com/13142418/27549426-8141bd86-5ace-11e7-9082-eb86b398acdc.png)
|
|
||||||
|
|
||||||
### Unite work flow
|
|
||||||
|
|
||||||
![unite](docs/img/unite_mappings.png)
|
|
||||||
|
|
||||||
### module statusline
|
|
||||||
|
|
||||||
The `core#statusline` layer provide a heavily customized powerline with the following capabilities:, It is inspired by spacemacs's mode-line. and this layer is loaded by default.
|
|
||||||
|
|
||||||
- show the window number
|
|
||||||
- color code for current state
|
|
||||||
- show the number of search results
|
|
||||||
- toggle syntax checking info
|
|
||||||
- toggle battery info
|
|
||||||
- toggle minor mode lighters
|
|
||||||
|
|
||||||
![search status](https://cloud.githubusercontent.com/assets/13142418/26313080/578cc68c-3f3c-11e7-9259-a27419d49572.png)
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
### 1. Requirements
|
|
||||||
|
|
||||||
**nerd fonts and true colors:**
|
|
||||||
|
|
||||||
SpaceVim provides basic and awesome mode, if you want to use awesome mode, you need to install the [nerd-fonts](https://github.com/ryanoasis/nerd-fonts) and make sure your terminal support [true colors](https://gist.github.com/XVilka/8346728).
|
|
||||||
|
|
||||||
**Vim 7.4 above or neovim:**
|
|
||||||
|
|
||||||
- [neovim installation](https://github.com/neovim/neovim/wiki/Installing-Neovim)
|
|
||||||
|
|
||||||
- [install vim with python, python3 and lua support](https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source)
|
|
||||||
|
|
||||||
**git:**
|
|
||||||
|
|
||||||
SpaceVim will download all plugins via git.
|
|
||||||
|
|
||||||
### 2. Install SpaceVim in Linux/Mac
|
|
||||||
|
|
||||||
Install SpaceVim with the command below:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -sLf https://spacevim.org/install.sh | bash
|
curl -sLf https://spacevim.org/install.sh | bash
|
||||||
@ -136,137 +42,24 @@ for more info about the install script, please check:
|
|||||||
curl -sLf https://spacevim.org/install.sh | bash -s -- -h
|
curl -sLf https://spacevim.org/install.sh | bash -s -- -h
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Install SpaceVim in windows
|
### Features
|
||||||
|
|
||||||
- For vim in windows, please just clone this repo as vimfiles in you Home directory.
|
- **Great documentation:** access documentation in Vim with
|
||||||
by default, when open a cmd, the current dir is your Home directory, run this command in cmd.
|
<kbd>:h SpaceVim</kbd>.
|
||||||
make sure you have a backup of your own vimfiles. also you need remove `~/_vimrc` in your home directory.
|
- **Beautiful GUI:** you'll love the awesome UI and its useful features.
|
||||||
|
- **Mnemonic key bindings:** all key bindings have mnemonic prefixes.
|
||||||
|
- **Lazy load plugins:** Lazy-load 90% of plugins with [dein.vim](https://github.com/Shougo/dein.vim)
|
||||||
|
- **Neovim centric:** Dark powered mode of SpaceVim
|
||||||
|
|
||||||
```sh
|
### Support SpaceVim
|
||||||
git clone https://github.com/SpaceVim/SpaceVim.git vimfiles
|
|
||||||
```
|
|
||||||
|
|
||||||
- For neovim in windows, please clone this repo as `AppData\Local\nvim` in your home directory.
|
|
||||||
for more info, please check out [neovim's wiki](https://github.com/neovim/neovim/wiki/Installing-Neovim).
|
|
||||||
by default, when open a cmd, the current dir is your Home directory, run this command in cmd.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/SpaceVim/SpaceVim.git AppData\Local\nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
## Update
|
|
||||||
|
|
||||||
you can update SpaceVim with the command below:
|
|
||||||
|
|
||||||
```viml
|
|
||||||
:SPUpdate SpaceVim
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
### Quick start guide
|
|
||||||
|
|
||||||
SpaceVim load custom configuration from `~/.SpaceVim.d/init.vim`,
|
|
||||||
|
|
||||||
:warning: It is not `~/.SpaceVim/init.vim`, user should not change anything in `~/.SpaceVim/`.
|
|
||||||
|
|
||||||
here is an example:
|
|
||||||
|
|
||||||
```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 = 'gruvbox'
|
|
||||||
|
|
||||||
" Set plugin manager, you want to use, default is dein.vim
|
|
||||||
let g:spacevim_plugin_manager = 'dein' " neobundle or dein or vim-plug
|
|
||||||
|
|
||||||
" 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'
|
|
||||||
|
|
||||||
" Set Denite work flow shortcut leader [Denite], default is `F`
|
|
||||||
let g:spacevim_denite_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 <kbd>:h SpaceVim</kbd>.
|
|
||||||
|
|
||||||
You can also check the [general documentation](http://spacevim.org/documentation/).
|
|
||||||
|
|
||||||
## Community
|
|
||||||
|
|
||||||
Try these SpaceVim hangouts for any questions, problems or comments.
|
|
||||||
- Chat
|
|
||||||
- [![Gitter](https://badges.gitter.im/SpaceVim/SpaceVim.svg)](https://gitter.im/SpaceVim/SpaceVim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
|
||||||
- [![QQ](https://img.shields.io/badge/QQ群-121056965-blue.svg)](https://jq.qq.com/?_wv=1027&k=43DB6SG)
|
|
||||||
- [![Facebook](https://img.shields.io/badge/FaceBook-SpaceVim-blue.svg)](https://www.facebook.com/SpaceVim)
|
|
||||||
- Ask
|
|
||||||
- [issue tracker](https://github.com/SpaceVim/SpaceVim/issues) for issue and feature requests
|
|
||||||
- vi StackExchange for "how to" & configuration questions
|
|
||||||
- [![Twitter Follow](https://img.shields.io/twitter/follow/SpaceVim.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/SpaceVim) for hugs & pithy comments
|
|
||||||
- Discuss
|
|
||||||
- [google mailing list](https://groups.google.com/forum/#!forum/spacevim)
|
|
||||||
|
|
||||||
|
|
||||||
## Support SpaceVim
|
|
||||||
|
|
||||||
The best way to support SpaceVim is to contribute to it either by reporting bugs, helping the community on the Gitter Chat or sending pull requests.
|
The best way to support SpaceVim is to contribute to it either by reporting bugs, helping the community on the Gitter Chat or sending pull requests.
|
||||||
|
|
||||||
If you want to show your support financially you can contribute to [Bountysource](https://www.bountysource.com/teams/spacevim) or buy a drink for the maintainer by clicking following icon.
|
If you want to show your support financially you can buy a drink for the maintainer by clicking following icon.
|
||||||
|
|
||||||
<a href='https://ko-fi.com/A538L6H' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi4.png?v=f' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
|
<a href='https://ko-fi.com/A538L6H' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi4.png?v=f' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
|
||||||
|
|
||||||
If you used SpaceVim in a project and you want to show that fact, you can use the SpaceVim badge:
|
### Credits & Thanks
|
||||||
|
|
||||||
[![](https://spacevim.org/img/build-with-SpaceVim.svg)](https://spacevim.org)
|
|
||||||
|
|
||||||
markdown
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
[![](https://spacevim.org/img/build-with-SpaceVim.svg)](https://spacevim.org)
|
|
||||||
```
|
|
||||||
|
|
||||||
### contribute to SpaceVim
|
|
||||||
|
|
||||||
Before contributing be sure to consult the [contribution guidelines](http://spacevim.org/development/#contribution-guidelines) and [conventions](http://spacevim.org/development/#conventions).
|
|
||||||
|
|
||||||
### Write post about SpaceVim
|
|
||||||
|
|
||||||
if you want to write something about SpaceVim, and want your post to be posted in [SpaceVim's blog page](https://spacevim.org/blog), please show us the link.
|
|
||||||
|
|
||||||
|
|
||||||
## Credits & Thanks
|
|
||||||
|
|
||||||
- [![GitHub contributors](https://img.shields.io/github/contributors/SpaceVim/SpaceVim.svg)](https://github.com/SpaceVim/SpaceVim/graphs/contributors)
|
- [![GitHub contributors](https://img.shields.io/github/contributors/SpaceVim/SpaceVim.svg)](https://github.com/SpaceVim/SpaceVim/graphs/contributors)
|
||||||
- [vimdoc](https://github.com/google/vimdoc) generate doc file for SpaceVim
|
- [vimdoc](https://github.com/google/vimdoc) generate doc file for SpaceVim
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
""
|
""
|
||||||
" Version of SpaceVim , this value can not be changed.
|
" Version of SpaceVim , this value can not be changed.
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
let g:spacevim_version = '0.4.0-dev'
|
let g:spacevim_version = '0.5.0-dev'
|
||||||
lockvar g:spacevim_version
|
lockvar g:spacevim_version
|
||||||
""
|
""
|
||||||
" Change the default indentation of SpaceVim. Default is 2.
|
" Change the default indentation of SpaceVim. Default is 2.
|
||||||
|
@ -12,9 +12,12 @@ function! SpaceVim#layers#load(layer, ...) abort
|
|||||||
endif
|
endif
|
||||||
if index(g:spacevim_plugin_groups, a:layer) == -1
|
if index(g:spacevim_plugin_groups, a:layer) == -1
|
||||||
call add(g:spacevim_plugin_groups, a:layer)
|
call add(g:spacevim_plugin_groups, a:layer)
|
||||||
if a:0 == 1 && type(a:1) == 4
|
endif
|
||||||
|
if a:0 == 1 && type(a:1) == 4
|
||||||
|
try
|
||||||
call SpaceVim#layers#{a:layer}#set_variable(a:1)
|
call SpaceVim#layers#{a:layer}#set_variable(a:1)
|
||||||
endif
|
catch /^Vim\%((\a\+)\)\=:E117/
|
||||||
|
endtry
|
||||||
endif
|
endif
|
||||||
if a:0 > 0 && type(a:1) == 1
|
if a:0 > 0 && type(a:1) == 1
|
||||||
for l in a:000
|
for l in a:000
|
||||||
|
@ -65,19 +65,36 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
function! SpaceVim#layers#autocomplete#config() abort
|
function! SpaceVim#layers#autocomplete#config() abort
|
||||||
let g:delimitMate_matchpairs = '[:],{:},<:>'
|
imap <expr>(
|
||||||
inoremap <silent><expr> ( complete_parameter#pre_complete("()")
|
\ pumvisible() ?
|
||||||
|
\ complete_parameter#pre_complete("()") :
|
||||||
|
\ (len(maparg('<Plug>delimitMate(', 'i')) == 0) ?
|
||||||
|
\ "\<Plug>delimitMate(" :
|
||||||
|
\ '('
|
||||||
|
|
||||||
"mapping
|
"mapping
|
||||||
imap <silent><expr><TAB> SpaceVim#mapping#tab()
|
if s:tab_key_behavior ==# 'smart'
|
||||||
imap <silent><expr><S-TAB> SpaceVim#mapping#shift_tab()
|
imap <silent><expr><TAB> SpaceVim#mapping#tab()
|
||||||
imap <silent><expr><CR> SpaceVim#mapping#enter()
|
smap <expr><TAB>
|
||||||
smap <expr><TAB>
|
\ neosnippet#expandable_or_jumpable() ?
|
||||||
\ neosnippet#expandable_or_jumpable() ?
|
\ "\<Plug>(neosnippet_expand_or_jump)" :
|
||||||
\ "\<Plug>(neosnippet_expand_or_jump)" :
|
\ (complete_parameter#jumpable(1) ?
|
||||||
\ (complete_parameter#jumpable(1) ?
|
\ "\<plug>(complete_parameter#goto_next_parameter)" :
|
||||||
\ "\<plug>(complete_parameter#goto_next_parameter)" :
|
\ "\<TAB>")
|
||||||
\ "\<TAB>")
|
imap <silent><expr><S-TAB> SpaceVim#mapping#shift_tab()
|
||||||
|
elseif s:tab_key_behavior ==# 'complete'
|
||||||
|
inoremap <expr> <Tab> pumvisible() ? "\<C-y>" : "\<C-n>"
|
||||||
|
elseif s:tab_key_behavior ==# 'cycle'
|
||||||
|
inoremap <expr> <Tab> pumvisible() ? "\<Down>" : "\<Tab>"
|
||||||
|
inoremap <expr> <S-Tab> pumvisible() ? "\<Up>" : ""
|
||||||
|
elseif s:tab_key_behavior ==# 'nil'
|
||||||
|
endif
|
||||||
|
if s:return_key_behavior ==# 'smart'
|
||||||
|
imap <silent><expr><CR> SpaceVim#mapping#enter()
|
||||||
|
elseif s:return_key_behavior ==# 'complete'
|
||||||
|
imap <silent><expr><CR> pumvisible() ? "\<C-y>" : "\<CR>"
|
||||||
|
elseif s:return_key_behavior ==# 'nil'
|
||||||
|
endif
|
||||||
|
|
||||||
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
|
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
|
||||||
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
|
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
|
||||||
@ -87,10 +104,15 @@ function! SpaceVim#layers#autocomplete#config() abort
|
|||||||
imap <expr> <M-/>
|
imap <expr> <M-/>
|
||||||
\ neosnippet#expandable() ?
|
\ neosnippet#expandable() ?
|
||||||
\ "\<Plug>(neosnippet_expand)" : ""
|
\ "\<Plug>(neosnippet_expand)" : ""
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['i', 's'], 'Unite neosnippet', 'insert sneppets', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['i', 's'], 'Unite neosnippet', 'insert sneppets', 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#autocomplete#set_variable(var)
|
let s:return_key_behavior = 'smart'
|
||||||
|
let s:tab_key_behavior = 'smart'
|
||||||
|
let s:key_sequence = 'nil'
|
||||||
|
let s:key_sequence_delay = 0.1
|
||||||
|
|
||||||
|
function! SpaceVim#layers#autocomplete#set_variable(var) abort
|
||||||
|
|
||||||
let s:return_key_behavior = get(a:var,
|
let s:return_key_behavior = get(a:var,
|
||||||
\ 'auto-completion-return-key-behavior',
|
\ 'auto-completion-return-key-behavior',
|
||||||
|
@ -18,413 +18,449 @@ let s:VIMCOMP = SpaceVim#api#import('vim#compatible')
|
|||||||
|
|
||||||
" init
|
" init
|
||||||
let s:separators = {
|
let s:separators = {
|
||||||
\ 'arrow' : ["\ue0b0", "\ue0b2"],
|
\ 'arrow' : ["\ue0b0", "\ue0b2"],
|
||||||
\ 'curve' : ["\ue0b4", "\ue0b6"],
|
\ 'curve' : ["\ue0b4", "\ue0b6"],
|
||||||
\ 'slant' : ["\ue0b8", "\ue0ba"],
|
\ 'slant' : ["\ue0b8", "\ue0ba"],
|
||||||
\ 'brace' : ["\ue0d2", "\ue0d4"],
|
\ 'brace' : ["\ue0d2", "\ue0d4"],
|
||||||
\ 'fire' : ["\ue0c0", "\ue0c2"],
|
\ 'fire' : ["\ue0c0", "\ue0c2"],
|
||||||
\ 'nil' : ['', ''],
|
\ 'nil' : ['', ''],
|
||||||
\ }
|
\ }
|
||||||
let s:i_separators = {
|
let s:i_separators = {
|
||||||
\ 'arrow' : ["\ue0b1", "\ue0b3"],
|
\ 'arrow' : ["\ue0b1", "\ue0b3"],
|
||||||
\ 'bar' : ["|", "|"],
|
\ 'bar' : ["|", "|"],
|
||||||
\ 'nil' : ['', ''],
|
\ 'nil' : ['', ''],
|
||||||
\ }
|
\ }
|
||||||
let s:loaded_modes = ['syntax-checking']
|
let s:loaded_modes = ['syntax-checking']
|
||||||
let s:modes = {
|
let s:modes = {
|
||||||
\ 'center-cursor': {
|
\ 'center-cursor': {
|
||||||
\ 'icon' : '⊝',
|
\ 'icon' : '⊝',
|
||||||
\ 'desc' : 'centered-cursor mode',
|
\ 'desc' : 'centered-cursor mode',
|
||||||
\ },
|
\ },
|
||||||
\ 'hi-characters-for-long-lines' :{
|
\ 'hi-characters-for-long-lines' :{
|
||||||
\ 'icon' : '⑧',
|
\ 'icon' : '⑧',
|
||||||
\ 'desc' : 'toggle highlight of characters for long lines',
|
\ 'desc' : 'toggle highlight of characters for long lines',
|
||||||
\ },
|
\ },
|
||||||
\ 'fill-column-indicator' :{
|
\ 'fill-column-indicator' :{
|
||||||
\ 'icon' : s:MESSLETTERS.circled_letter('f'),
|
\ 'icon' : s:MESSLETTERS.circled_letter('f'),
|
||||||
\ 'desc' : 'fill-column-indicator mode',
|
\ 'desc' : 'fill-column-indicator mode',
|
||||||
\ },
|
\ },
|
||||||
\ 'syntax-checking' :{
|
\ 'syntax-checking' :{
|
||||||
\ 'icon' : s:MESSLETTERS.circled_letter('s'),
|
\ 'icon' : s:MESSLETTERS.circled_letter('s'),
|
||||||
\ 'desc' : 'syntax-checking mode',
|
\ 'desc' : 'syntax-checking mode',
|
||||||
\ },
|
\ },
|
||||||
\ 'spell-checking' :{
|
\ 'spell-checking' :{
|
||||||
\ 'icon' : s:MESSLETTERS.circled_letter('S'),
|
\ 'icon' : s:MESSLETTERS.circled_letter('S'),
|
||||||
\ 'desc' : 'spell-checking mode',
|
\ 'desc' : 'spell-checking mode',
|
||||||
\ },
|
\ },
|
||||||
\ 'whitespace' :{
|
\ 'whitespace' :{
|
||||||
\ 'icon' : s:MESSLETTERS.circled_letter('w'),
|
\ 'icon' : s:MESSLETTERS.circled_letter('w'),
|
||||||
\ 'desc' : 'whitespace mode',
|
\ 'desc' : 'whitespace mode',
|
||||||
\ },
|
\ },
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
let s:loaded_sections = ['syntax checking', 'major mode', 'minor mode lighters', 'version control info', 'cursorpos']
|
let s:loaded_sections = ['syntax checking', 'major mode', 'minor mode lighters', 'version control info', 'cursorpos']
|
||||||
|
|
||||||
function! s:battery_status() abort
|
function! s:battery_status() abort
|
||||||
if executable('acpi')
|
if executable('acpi')
|
||||||
return ' ⚡' . substitute(split(system('acpi'))[-1], '%', '%%', 'g') . ' '
|
return ' ⚡' . substitute(split(system('acpi'))[-1], '%', '%%', 'g') . ' '
|
||||||
else
|
else
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:check_mode() abort
|
function! s:check_mode() abort
|
||||||
if mode() == 'n'
|
if mode() == 'n'
|
||||||
return 'n'
|
return 'n'
|
||||||
elseif mode() =='i'
|
elseif mode() =='i'
|
||||||
return 'i'
|
return 'i'
|
||||||
elseif mode() =~ 'v'
|
elseif mode() =~ 'v'
|
||||||
return 'v'
|
return 'v'
|
||||||
elseif mode() =~ 'R'
|
elseif mode() =~ 'R'
|
||||||
return 'R'
|
return 'R'
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:search_status() abort
|
function! s:search_status() abort
|
||||||
let ct = 0
|
let ct = 0
|
||||||
let tt = 0
|
let tt = 0
|
||||||
let ctl = split(s:VIMCOMP.execute('keeppatterns .,$s/' . @/ . '//gn', 'silent!'), "\n")
|
let ctl = split(s:VIMCOMP.execute('keeppatterns .,$s/' . @/ . '//gn', 'silent!'), "\n")
|
||||||
if !empty(ctl)
|
if !empty(ctl)
|
||||||
let ct = split(ctl[0])[0]
|
let ct = split(ctl[0])[0]
|
||||||
endif
|
endif
|
||||||
let ttl = split(s:VIMCOMP.execute('keeppatterns %s/' . @/ . '//gn', 'silent!'), "\n")
|
let ttl = split(s:VIMCOMP.execute('keeppatterns %s/' . @/ . '//gn', 'silent!'), "\n")
|
||||||
if !empty(ctl)
|
if !empty(ctl)
|
||||||
let tt = split(ttl[0])[0]
|
let tt = split(ttl[0])[0]
|
||||||
endif
|
endif
|
||||||
return ' ' . (str2nr(tt) - str2nr(ct) + 1) . '/' . tt . ' '
|
return ' ' . (str2nr(tt) - str2nr(ct) + 1) . '/' . tt . ' '
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:time() abort
|
function! s:time() abort
|
||||||
return ' ' . s:TIME.current_time() . ' '
|
return ' ' . s:TIME.current_time() . ' '
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if g:spacevim_enable_neomake
|
if g:spacevim_enable_neomake
|
||||||
function! s:syntax_checking()
|
function! s:syntax_checking()
|
||||||
if !exists('g:loaded_neomake')
|
if !exists('g:loaded_neomake')
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
let counts = neomake#statusline#LoclistCounts()
|
let counts = neomake#statusline#LoclistCounts()
|
||||||
let warnings = get(counts, 'W', 0)
|
let warnings = get(counts, 'W', 0)
|
||||||
let errors = get(counts, 'E', 0)
|
let errors = get(counts, 'E', 0)
|
||||||
let l = warnings ? ' %#SpaceVim_statusline_warn#●' . warnings . ' ' : ''
|
let l = warnings ? ' %#SpaceVim_statusline_warn#●' . warnings . ' ' : ''
|
||||||
let l .= errors ? (warnings ? '' : ' ') . '%#SpaceVim_statusline_error#●' . errors . ' ' : ''
|
let l .= errors ? (warnings ? '' : ' ') . '%#SpaceVim_statusline_error#●' . errors . ' ' : ''
|
||||||
return l
|
return l
|
||||||
endfunction
|
endfunction
|
||||||
else
|
else
|
||||||
function! s:syntax_checking()
|
function! s:syntax_checking()
|
||||||
if !exists(':SyntasticCheck')
|
if !exists(':SyntasticCheck')
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
let l = SyntasticStatuslineFlag()
|
let l = SyntasticStatuslineFlag()
|
||||||
if strlen(l) > 0
|
if strlen(l) > 0
|
||||||
return l
|
return l
|
||||||
else
|
else
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:winnr(...) abort
|
function! s:winnr(...) abort
|
||||||
if a:0 > 1
|
if a:0 > 1
|
||||||
return ' ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' '
|
return ' ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' '
|
||||||
else
|
else
|
||||||
return '%{SpaceVim#layers#core#statusline#mode(mode())} ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' '
|
return '%{SpaceVim#layers#core#statusline#mode(mode())} ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' '
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:filename() abort
|
function! s:filename() abort
|
||||||
let name = fnamemodify(bufname('%'), ':t')
|
let name = fnamemodify(bufname('%'), ':t')
|
||||||
if empty(name)
|
if empty(name)
|
||||||
let name = 'No Name'
|
let name = 'No Name'
|
||||||
endif
|
endif
|
||||||
return (&modified ? ' * ' : ' - ') . s:filesize() . name . ' '
|
return (&modified ? ' * ' : ' - ') . s:filesize() . name . ' '
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:git_branch() abort
|
function! s:git_branch() abort
|
||||||
if exists('g:loaded_fugitive')
|
if exists('g:loaded_fugitive')
|
||||||
let l:head = fugitive#head()
|
let l:head = fugitive#head()
|
||||||
if empty(l:head)
|
if empty(l:head)
|
||||||
call fugitive#detect(getcwd())
|
call fugitive#detect(getcwd())
|
||||||
let l:head = fugitive#head()
|
let l:head = fugitive#head()
|
||||||
endif
|
|
||||||
return empty(l:head) ? '' : ' '.l:head . ' '
|
|
||||||
endif
|
endif
|
||||||
return ''
|
return empty(l:head) ? '' : ' '.l:head . ' '
|
||||||
|
endif
|
||||||
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:whitespace() abort
|
function! s:whitespace() abort
|
||||||
let ln = search('\s\+$', 'n')
|
let ln = search('\s\+$', 'n')
|
||||||
if ln != 0
|
if ln != 0
|
||||||
return ' trailing[' . ln . '] '
|
return ' trailing[' . ln . '] '
|
||||||
else
|
else
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:cursorpos() abort
|
function! s:cursorpos() abort
|
||||||
return ' %l:%c '
|
return ' %l:%c '
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:modes() abort
|
function! s:modes() abort
|
||||||
let m = ' ❖ '
|
let m = ' ❖ '
|
||||||
for mode in s:loaded_modes
|
for mode in s:loaded_modes
|
||||||
let m .= s:modes[mode].icon . ' '
|
let m .= s:modes[mode].icon . ' '
|
||||||
endfor
|
endfor
|
||||||
return m . ' '
|
return m . ' '
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:filesize() abort
|
function! s:filesize() abort
|
||||||
let l:size = getfsize(bufname('%'))
|
let l:size = getfsize(bufname('%'))
|
||||||
if l:size == 0 || l:size == -1 || l:size == -2
|
if l:size == 0 || l:size == -1 || l:size == -2
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
if l:size < 1024
|
if l:size < 1024
|
||||||
return l:size.' bytes '
|
return l:size.' bytes '
|
||||||
elseif l:size < 1024*1024
|
elseif l:size < 1024*1024
|
||||||
return printf('%.1f', l:size/1024.0).'k '
|
return printf('%.1f', l:size/1024.0).'k '
|
||||||
elseif l:size < 1024*1024*1024
|
elseif l:size < 1024*1024*1024
|
||||||
return printf('%.1f', l:size/1024.0/1024.0) . 'm '
|
return printf('%.1f', l:size/1024.0/1024.0) . 'm '
|
||||||
else
|
else
|
||||||
return printf('%.1f', l:size/1024.0/1024.0/1024.0) . 'g '
|
return printf('%.1f', l:size/1024.0/1024.0/1024.0) . 'g '
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#get(...) abort
|
function! SpaceVim#layers#core#statusline#get(...) abort
|
||||||
if &filetype ==# 'vimfiler'
|
if &filetype ==# 'vimfiler'
|
||||||
return '%#SpaceVim_statusline_ia#' . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#' . s:lsep
|
return '%#SpaceVim_statusline_ia#' . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_b# vimfiler %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
\ . '%#SpaceVim_statusline_b# vimfiler %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
||||||
elseif &filetype ==# 'startify'
|
elseif &filetype ==# 'startify'
|
||||||
call fugitive#detect(getcwd())
|
call fugitive#detect(getcwd())
|
||||||
elseif &filetype ==# 'SpaceVimLayerManager'
|
elseif &filetype ==# 'SpaceVimLayerManager'
|
||||||
return '%#SpaceVim_statusline_a#' . s:winnr(1) . '%#SpaceVim_statusline_a_SpaceVim_statusline_b#' . s:lsep
|
return '%#SpaceVim_statusline_a#' . s:winnr(1) . '%#SpaceVim_statusline_a_SpaceVim_statusline_b#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_b# LayerManager %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
\ . '%#SpaceVim_statusline_b# LayerManager %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
||||||
elseif &filetype ==# 'SpaceVimPlugManager'
|
elseif &filetype ==# 'SpaceVimPlugManager'
|
||||||
return '%#SpaceVim_statusline_a#' . s:winnr(1) . '%#SpaceVim_statusline_a_SpaceVim_statusline_b#' . s:lsep
|
return '%#SpaceVim_statusline_a#' . s:winnr(1) . '%#SpaceVim_statusline_a_SpaceVim_statusline_b#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_b# PlugManager %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
\ . '%#SpaceVim_statusline_b# PlugManager %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
||||||
elseif &filetype ==# 'SpaceVimTabsManager'
|
elseif &filetype ==# 'SpaceVimTabsManager'
|
||||||
return '%#SpaceVim_statusline_a#' . s:winnr(1) . '%#SpaceVim_statusline_a_SpaceVim_statusline_b#' . s:lsep
|
return '%#SpaceVim_statusline_a#' . s:winnr(1) . '%#SpaceVim_statusline_a_SpaceVim_statusline_b#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_b# TabsManager %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
\ . '%#SpaceVim_statusline_b# TabsManager %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
||||||
elseif &filetype ==# 'denite'
|
elseif &filetype ==# 'denite'
|
||||||
return '%#SpaceVim_statusline_a_bold# %{SpaceVim#layers#core#statusline#denite_mode()} '
|
return '%#SpaceVim_statusline_a_bold# %{SpaceVim#layers#core#statusline#denite_mode()} '
|
||||||
\ . '%#SpaceVim_statusline_a_bold_SpaceVim_statusline_b#' . s:lsep . ' '
|
\ . '%#SpaceVim_statusline_a_bold_SpaceVim_statusline_b#' . s:lsep . ' '
|
||||||
\ . '%#SpaceVim_statusline_b#%{denite#get_status_sources()} %#SpaceVim_statusline_b_SpaceVim_statusline_z#' . s:lsep . ' '
|
\ . '%#SpaceVim_statusline_b#%{denite#get_status_sources()} %#SpaceVim_statusline_b_SpaceVim_statusline_z#' . s:lsep . ' '
|
||||||
\ . '%#SpaceVim_statusline_z#%=%#SpaceVim_statusline_c_SpaceVim_statusline_z#' . s:rsep
|
\ . '%#SpaceVim_statusline_z#%=%#SpaceVim_statusline_c_SpaceVim_statusline_z#' . s:rsep
|
||||||
\ . '%#SpaceVim_statusline_c# %{denite#get_status_path() . denite#get_status_linenr()}'
|
\ . '%#SpaceVim_statusline_c# %{denite#get_status_path() . denite#get_status_linenr()}'
|
||||||
elseif &filetype ==# 'unite'
|
elseif &filetype ==# 'unite'
|
||||||
return '%#SpaceVim_statusline_a_bold#%{SpaceVim#layers#core#statusline#unite_mode()} Unite '
|
return '%#SpaceVim_statusline_a_bold#%{SpaceVim#layers#core#statusline#unite_mode()} Unite '
|
||||||
\ . '%#SpaceVim_statusline_a_bold_SpaceVim_statusline_b#' . s:lsep . ' %{get(unite#get_context(), "buffer_name", "")} '
|
\ . '%#SpaceVim_statusline_a_bold_SpaceVim_statusline_b#' . s:lsep . ' %{get(unite#get_context(), "buffer_name", "")} '
|
||||||
\ . '%#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep . ' '
|
\ . '%#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep . ' '
|
||||||
\ . '%#SpaceVim_statusline_c# %{unite#get_status_string()} '
|
\ . '%#SpaceVim_statusline_c# %{unite#get_status_string()} '
|
||||||
elseif &filetype ==# 'SpaceVimFlyGrep'
|
elseif &filetype ==# 'SpaceVimFlyGrep'
|
||||||
return '%#SpaceVim_statusline_a# FlyGrep %#SpaceVim_statusline_a_SpaceVim_statusline_b#' . s:lsep
|
return '%#SpaceVim_statusline_a# FlyGrep %#SpaceVim_statusline_a_SpaceVim_statusline_b#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_b# %{getcwd()}%#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
\ . '%#SpaceVim_statusline_b# %{getcwd()}%#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_c# %{SpaceVim#plugins#flygrep#lineNr()}'
|
\ . '%#SpaceVim_statusline_c# %{SpaceVim#plugins#flygrep#lineNr()}'
|
||||||
elseif &filetype ==# 'TransientState'
|
elseif &filetype ==# 'TransientState'
|
||||||
return '%#SpaceVim_statusline_a# Transient State %#SpaceVim_statusline_a_SpaceVim_statusline_b#'
|
return '%#SpaceVim_statusline_a# Transient State %#SpaceVim_statusline_a_SpaceVim_statusline_b#'
|
||||||
elseif &filetype ==# 'HelpDescribe'
|
elseif &filetype ==# 'HelpDescribe'
|
||||||
return '%#SpaceVim_statusline_a# HelpDescribe %#SpaceVim_statusline_a_SpaceVim_statusline_b#'
|
return '%#SpaceVim_statusline_a# HelpDescribe %#SpaceVim_statusline_a_SpaceVim_statusline_b#'
|
||||||
endif
|
endif
|
||||||
if a:0 > 0
|
if a:0 > 0
|
||||||
return s:active()
|
return s:active()
|
||||||
else
|
else
|
||||||
return s:inactive()
|
return s:inactive()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:active() abort
|
function! s:active() abort
|
||||||
let lsec = [s:winnr(), s:filename()]
|
let lsec = [s:winnr(), s:filename()]
|
||||||
if index(s:loaded_sections, 'search status') != -1
|
if index(s:loaded_sections, 'search status') != -1
|
||||||
call add(lsec, s:search_status())
|
call add(lsec, s:search_status())
|
||||||
endif
|
endif
|
||||||
if index(s:loaded_sections, 'major mode') != -1 && !empty(&filetype)
|
if index(s:loaded_sections, 'major mode') != -1 && !empty(&filetype)
|
||||||
call add(lsec, ' ' . &filetype . ' ')
|
call add(lsec, ' ' . &filetype . ' ')
|
||||||
endif
|
endif
|
||||||
let rsec = []
|
let rsec = []
|
||||||
if index(s:loaded_sections, 'syntax checking') != -1 && s:syntax_checking() != ''
|
if index(s:loaded_sections, 'syntax checking') != -1 && s:syntax_checking() != ''
|
||||||
call add(lsec, s:syntax_checking())
|
call add(lsec, s:syntax_checking())
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if index(s:loaded_sections, 'minor mode lighters') != -1
|
if index(s:loaded_sections, 'minor mode lighters') != -1
|
||||||
call add(lsec, s:modes())
|
call add(lsec, s:modes())
|
||||||
endif
|
endif
|
||||||
if index(s:loaded_sections, 'version control info') != -1
|
if index(s:loaded_sections, 'version control info') != -1
|
||||||
call add(lsec, s:git_branch())
|
call add(lsec, s:git_branch())
|
||||||
endif
|
endif
|
||||||
call add(lsec, SpaceVim#plugins#searcher#count())
|
call add(lsec, SpaceVim#plugins#searcher#count())
|
||||||
if index(s:loaded_sections, 'battery status') != -1
|
if index(s:loaded_sections, 'battery status') != -1
|
||||||
call add(rsec, s:battery_status())
|
call add(rsec, s:battery_status())
|
||||||
endif
|
endif
|
||||||
call add(rsec, '%{" " . &ff . " | " . (&fenc!=""?&fenc:&enc) . " "}')
|
call add(rsec, '%{" " . &ff . " | " . (&fenc!=""?&fenc:&enc) . " "}')
|
||||||
if index(s:loaded_sections, 'cursorpos') != -1
|
if index(s:loaded_sections, 'cursorpos') != -1
|
||||||
call add(rsec, s:cursorpos())
|
call add(rsec, s:cursorpos())
|
||||||
endif
|
endif
|
||||||
call add(rsec, ' %P ')
|
call add(rsec, ' %P ')
|
||||||
if index(s:loaded_sections, 'time') != -1
|
if index(s:loaded_sections, 'time') != -1
|
||||||
call add(rsec, s:time())
|
call add(rsec, s:time())
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if index(s:loaded_sections, 'whitespace') != -1
|
if index(s:loaded_sections, 'whitespace') != -1
|
||||||
call add(rsec, s:whitespace())
|
call add(rsec, s:whitespace())
|
||||||
endif
|
endif
|
||||||
return s:STATUSLINE.build(lsec, rsec, s:lsep, s:rsep,
|
return s:STATUSLINE.build(lsec, rsec, s:lsep, s:rsep,
|
||||||
\ 'SpaceVim_statusline_a', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z')
|
\ 'SpaceVim_statusline_a', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:inactive() abort
|
function! s:inactive() abort
|
||||||
return '%#SpaceVim_statusline_ia#' . s:winnr() . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#' . s:lsep
|
return '%#SpaceVim_statusline_ia#' . s:winnr() . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_b#' . s:filename() . s:ilsep
|
\ . '%#SpaceVim_statusline_b#' . s:filename() . s:ilsep
|
||||||
\ . ' ' . &filetype . ' ' . s:ilsep
|
\ . ' ' . &filetype . ' ' . s:ilsep
|
||||||
\ . s:modes() . s:ilsep
|
\ . s:modes() . s:ilsep
|
||||||
\ . s:git_branch() . s:ilsep
|
\ . s:git_branch() . s:ilsep
|
||||||
\ . ' %='
|
\ . ' %='
|
||||||
\ . s:irsep . '%{" " . &ff . "|" . (&fenc!=""?&fenc:&enc) . " "}'
|
\ . s:irsep . '%{" " . &ff . "|" . (&fenc!=""?&fenc:&enc) . " "}'
|
||||||
\ . s:irsep . ' %P '
|
\ . s:irsep . ' %P '
|
||||||
endfunction
|
endfunction
|
||||||
function! s:gitgutter() abort
|
function! s:gitgutter() abort
|
||||||
if exists('b:gitgutter_summary')
|
if exists('b:gitgutter_summary')
|
||||||
let l:summary = get(b:, 'gitgutter_summary')
|
let l:summary = get(b:, 'gitgutter_summary')
|
||||||
if l:summary[0] != 0 || l:summary[1] != 0 || l:summary[2] != 0
|
if l:summary[0] != 0 || l:summary[1] != 0 || l:summary[2] != 0
|
||||||
return ' +'.l:summary[0].' ~'.l:summary[1].' -'.l:summary[2].' '
|
return ' +'.l:summary[0].' ~'.l:summary[1].' -'.l:summary[2].' '
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
return ''
|
endif
|
||||||
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#init() abort
|
function! SpaceVim#layers#core#statusline#init() abort
|
||||||
augroup SpaceVim_statusline
|
augroup SpaceVim_statusline
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWinEnter,WinEnter,FileType
|
autocmd BufWinEnter,WinEnter,FileType
|
||||||
\ * let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
\ * let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
||||||
autocmd BufWinLeave,WinLeave * let &l:statusline = SpaceVim#layers#core#statusline#get()
|
autocmd BufWinLeave,WinLeave * let &l:statusline = SpaceVim#layers#core#statusline#get()
|
||||||
autocmd ColorScheme * call SpaceVim#layers#core#statusline#def_colors()
|
autocmd ColorScheme * call SpaceVim#layers#core#statusline#def_colors()
|
||||||
augroup END
|
augroup END
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:colors_template = SpaceVim#mapping#guide#theme#gruvbox#palette()
|
let s:colors_template = SpaceVim#mapping#guide#theme#gruvbox#palette()
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#def_colors() abort
|
function! SpaceVim#layers#core#statusline#def_colors() abort
|
||||||
let name = get(g:, 'colors_name', 'gruvbox')
|
let name = get(g:, 'colors_name', 'gruvbox')
|
||||||
try
|
try
|
||||||
let t = SpaceVim#mapping#guide#theme#{name}#palette()
|
let t = SpaceVim#mapping#guide#theme#{name}#palette()
|
||||||
catch /^Vim\%((\a\+)\)\=:E117/
|
catch /^Vim\%((\a\+)\)\=:E117/
|
||||||
let t = SpaceVim#mapping#guide#theme#gruvbox#palette()
|
let t = SpaceVim#mapping#guide#theme#gruvbox#palette()
|
||||||
endtry
|
endtry
|
||||||
let s:colors_template = t
|
let s:colors_template = t
|
||||||
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
||||||
exe 'hi! SpaceVim_statusline_a_bold cterm=bold gui=bold ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
exe 'hi! SpaceVim_statusline_a_bold cterm=bold gui=bold ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
||||||
exe 'hi! SpaceVim_statusline_ia ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
exe 'hi! SpaceVim_statusline_ia ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
||||||
exe 'hi! SpaceVim_statusline_b ctermbg=' . t[1][2] . ' ctermfg=' . t[1][3] . ' guibg=' . t[1][1] . ' guifg=' . t[1][0]
|
exe 'hi! SpaceVim_statusline_b ctermbg=' . t[1][2] . ' ctermfg=' . t[1][3] . ' guibg=' . t[1][1] . ' guifg=' . t[1][0]
|
||||||
exe 'hi! SpaceVim_statusline_c ctermbg=' . t[2][2] . ' ctermfg=' . t[2][3] . ' guibg=' . t[2][1] . ' guifg=' . t[2][0]
|
exe 'hi! SpaceVim_statusline_c ctermbg=' . t[2][2] . ' ctermfg=' . t[2][3] . ' guibg=' . t[2][1] . ' guifg=' . t[2][0]
|
||||||
exe 'hi! SpaceVim_statusline_z ctermbg=' . t[3][1] . ' ctermfg=' . t[3][1] . ' guibg=' . t[3][0] . ' guifg=' . t[3][0]
|
exe 'hi! SpaceVim_statusline_z ctermbg=' . t[3][1] . ' ctermfg=' . t[3][1] . ' guibg=' . t[3][0] . ' guifg=' . t[3][0]
|
||||||
hi! SpaceVim_statusline_error ctermbg=003 ctermfg=Black guibg=#504945 guifg=#fb4934 gui=bold
|
hi! SpaceVim_statusline_error ctermbg=003 ctermfg=Black guibg=#504945 guifg=#fb4934 gui=bold
|
||||||
hi! SpaceVim_statusline_warn ctermbg=003 ctermfg=Black guibg=#504945 guifg=#fabd2f gui=bold
|
hi! SpaceVim_statusline_warn ctermbg=003 ctermfg=Black guibg=#504945 guifg=#fabd2f gui=bold
|
||||||
call s:HI.hi_separator('SpaceVim_statusline_a', 'SpaceVim_statusline_b')
|
call s:HI.hi_separator('SpaceVim_statusline_a', 'SpaceVim_statusline_b')
|
||||||
call s:HI.hi_separator('SpaceVim_statusline_a_bold', 'SpaceVim_statusline_b')
|
call s:HI.hi_separator('SpaceVim_statusline_a_bold', 'SpaceVim_statusline_b')
|
||||||
call s:HI.hi_separator('SpaceVim_statusline_ia', 'SpaceVim_statusline_b')
|
call s:HI.hi_separator('SpaceVim_statusline_ia', 'SpaceVim_statusline_b')
|
||||||
call s:HI.hi_separator('SpaceVim_statusline_b', 'SpaceVim_statusline_c')
|
call s:HI.hi_separator('SpaceVim_statusline_b', 'SpaceVim_statusline_c')
|
||||||
call s:HI.hi_separator('SpaceVim_statusline_b', 'SpaceVim_statusline_z')
|
call s:HI.hi_separator('SpaceVim_statusline_b', 'SpaceVim_statusline_z')
|
||||||
call s:HI.hi_separator('SpaceVim_statusline_c', 'SpaceVim_statusline_z')
|
call s:HI.hi_separator('SpaceVim_statusline_c', 'SpaceVim_statusline_z')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#toggle_mode(name) abort
|
function! SpaceVim#layers#core#statusline#toggle_mode(name) abort
|
||||||
if index(s:loaded_modes, a:name) != -1
|
if index(s:loaded_modes, a:name) != -1
|
||||||
call remove(s:loaded_modes, index(s:loaded_modes, a:name))
|
call remove(s:loaded_modes, index(s:loaded_modes, a:name))
|
||||||
else
|
else
|
||||||
call add(s:loaded_modes, a:name)
|
call add(s:loaded_modes, a:name)
|
||||||
endif
|
endif
|
||||||
let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#toggle_section(name) abort
|
function! SpaceVim#layers#core#statusline#toggle_section(name) abort
|
||||||
if index(s:loaded_sections, a:name) != -1
|
if index(s:loaded_sections, a:name) != -1
|
||||||
call remove(s:loaded_sections, index(s:loaded_sections, a:name))
|
call remove(s:loaded_sections, index(s:loaded_sections, a:name))
|
||||||
else
|
else
|
||||||
call add(s:loaded_sections, a:name)
|
call add(s:loaded_sections, a:name)
|
||||||
endif
|
endif
|
||||||
let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#rsep()
|
function! SpaceVim#layers#core#statusline#rsep()
|
||||||
return get(s:separators, g:spacevim_statusline_separator, s:separators['arrow'])
|
return get(s:separators, g:spacevim_statusline_separator, s:separators['arrow'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#config() abort
|
function! SpaceVim#layers#core#statusline#config() abort
|
||||||
let [s:lsep , s:rsep] = get(s:separators, g:spacevim_statusline_separator, s:separators['arrow'])
|
let [s:lsep , s:rsep] = get(s:separators, g:spacevim_statusline_separator, s:separators['arrow'])
|
||||||
let [s:ilsep , s:irsep] = get(s:i_separators, g:spacevim_statusline_inactive_separator, s:i_separators['arrow'])
|
let [s:ilsep , s:irsep] = get(s:i_separators, g:spacevim_statusline_inactive_separator, s:i_separators['arrow'])
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'm'], 'call SpaceVim#layers#core#statusline#toggle_section("minor mode lighters")',
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'm'], 'call SpaceVim#layers#core#statusline#toggle_section("minor mode lighters")',
|
||||||
\ 'toggle the minor mode lighters', 1)
|
\ 'toggle the minor mode lighters', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'v'], 'call SpaceVim#layers#core#statusline#toggle_section("version control info")',
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'v'], 'call SpaceVim#layers#core#statusline#toggle_section("version control info")',
|
||||||
\ 'version control info', 1)
|
\ 'version control info', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'M'], 'call SpaceVim#layers#core#statusline#toggle_section("major mode")',
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'M'], 'call SpaceVim#layers#core#statusline#toggle_section("major mode")',
|
||||||
\ 'toggle the major mode', 1)
|
\ 'toggle the major mode', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'b'], 'call SpaceVim#layers#core#statusline#toggle_section("battery status")',
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'b'], 'call SpaceVim#layers#core#statusline#toggle_section("battery status")',
|
||||||
\ 'toggle the battery status', 1)
|
\ 'toggle the battery status', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 't'], 'call SpaceVim#layers#core#statusline#toggle_section("time")',
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 't'], 'call SpaceVim#layers#core#statusline#toggle_section("time")',
|
||||||
\ 'toggle the time', 1)
|
\ 'toggle the time', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'p'], 'call SpaceVim#layers#core#statusline#toggle_section("cursorpos")',
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'p'], 'call SpaceVim#layers#core#statusline#toggle_section("cursorpos")',
|
||||||
\ 'toggle the cursor position', 1)
|
\ 'toggle the cursor position', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'T'], 'if &laststatus == 2 | let &laststatus = 0 | else | let &laststatus = 2 | endif',
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'T'], 'if &laststatus == 2 | let &laststatus = 0 | else | let &laststatus = 2 | endif',
|
||||||
\ 'toggle the statuline itself', 1)
|
\ 'toggle the statuline itself', 1)
|
||||||
function! TagbarStatusline(...) abort
|
function! TagbarStatusline(...) abort
|
||||||
let name = (strwidth(a:3) > (g:spacevim_sidebar_width - 15)) ? a:3[:g:spacevim_sidebar_width - 20] . '..' : a:3
|
let name = (strwidth(a:3) > (g:spacevim_sidebar_width - 15)) ? a:3[:g:spacevim_sidebar_width - 20] . '..' : a:3
|
||||||
return s:STATUSLINE.build([s:winnr(),' Tagbar ', ' ' . name . ' '], [], s:lsep, s:rsep,
|
return s:STATUSLINE.build([s:winnr(),' Tagbar ', ' ' . name . ' '], [], s:lsep, s:rsep,
|
||||||
\ 'SpaceVim_statusline_ia', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z')
|
\ 'SpaceVim_statusline_ia', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z')
|
||||||
endfunction
|
endfunction
|
||||||
let g:tagbar_status_func = 'TagbarStatusline'
|
let g:tagbar_status_func = 'TagbarStatusline'
|
||||||
let g:unite_force_overwrite_statusline = 0
|
let g:unite_force_overwrite_statusline = 0
|
||||||
|
let g:ctrlp_status_func = {
|
||||||
|
\ 'main': 'SpaceVim#layers#core#statusline#ctrlp',
|
||||||
|
\ 'prog': 'SpaceVim#layers#core#statusline#ctrlp_status',
|
||||||
|
\ }
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Arguments:
|
||||||
|
" |
|
||||||
|
" +- a:focus : The focus of the prompt: "prt" or "win".
|
||||||
|
" |
|
||||||
|
" +- a:byfname : In filename mode or in full path mode: "file" or "path".
|
||||||
|
" |
|
||||||
|
" +- a:regex : In regex mode: 1 or 0.
|
||||||
|
" |
|
||||||
|
" +- a:prev : The previous search mode.
|
||||||
|
" |
|
||||||
|
" +- a:item : The current search mode.
|
||||||
|
" |
|
||||||
|
" +- a:next : The next search mode.
|
||||||
|
" |
|
||||||
|
" +- a:marked : The number of marked files, or a comma separated list of
|
||||||
|
" the marked filenames.
|
||||||
|
function! SpaceVim#layers#core#statusline#ctrlp(focus, byfname, regex, prev, item, next, marked) abort
|
||||||
|
return s:STATUSLINE.build([' Ctrlp ', ' ' . a:prev . ' ', ' ' . a:item . ' ', ' ' . a:next . ' '],
|
||||||
|
\ [' ' . a:focus . ' ', ' ' . a:byfname . ' ', ' ' . getcwd() . ' '], s:lsep, s:rsep,
|
||||||
|
\ 'SpaceVim_statusline_a_bold', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" a:str : Either the number of files scanned so far, or a string indicating
|
||||||
|
" the current directory is being scanned with a user_command.
|
||||||
|
function! SpaceVim#layers#core#statusline#ctrlp_status(str) abort
|
||||||
|
return s:STATUSLINE.build([' Ctrlp ', ' ' . a:str . ' '],
|
||||||
|
\ [' ' . getcwd() . ' '], s:lsep, s:rsep,
|
||||||
|
\ 'SpaceVim_statusline_a', 'SpaceVim_statusline_b', 'SpaceVim_statusline_c', 'SpaceVim_statusline_z')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#jump(i) abort
|
function! SpaceVim#layers#core#statusline#jump(i) abort
|
||||||
if winnr('$') >= a:i
|
if winnr('$') >= a:i
|
||||||
exe a:i . 'wincmd w'
|
exe a:i . 'wincmd w'
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#mode(mode)
|
function! SpaceVim#layers#core#statusline#mode(mode)
|
||||||
let t = s:colors_template
|
let t = s:colors_template
|
||||||
if get(w:, 'spacevim_statusline_mode', '') != a:mode
|
if get(w:, 'spacevim_statusline_mode', '') != a:mode
|
||||||
if a:mode == 'n'
|
if a:mode == 'n'
|
||||||
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
||||||
elseif a:mode == 'i'
|
elseif a:mode == 'i'
|
||||||
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[4][3] . ' ctermfg=' . t[4][2] . ' guibg=' . t[4][1] . ' guifg=' . t[4][0]
|
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[4][3] . ' ctermfg=' . t[4][2] . ' guibg=' . t[4][1] . ' guifg=' . t[4][0]
|
||||||
elseif a:mode == 'R'
|
elseif a:mode == 'R'
|
||||||
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[6][3] . ' ctermfg=' . t[6][2] . ' guibg=' . t[6][1] . ' guifg=' . t[6][0]
|
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[6][3] . ' ctermfg=' . t[6][2] . ' guibg=' . t[6][1] . ' guifg=' . t[6][0]
|
||||||
elseif a:mode == 'v' || a:mode == 'V' || a:mode == '^V' || a:mode == 's' || a:mode == 'S' || a:mode == '^S'
|
elseif a:mode == 'v' || a:mode == 'V' || a:mode == '^V' || a:mode == 's' || a:mode == 'S' || a:mode == '^S'
|
||||||
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[5][3] . ' ctermfg=' . t[5][2] . ' guibg=' . t[5][1] . ' guifg=' . t[5][0]
|
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[5][3] . ' ctermfg=' . t[5][2] . ' guibg=' . t[5][1] . ' guifg=' . t[5][0]
|
||||||
endif
|
|
||||||
call s:HI.hi_separator('SpaceVim_statusline_a', 'SpaceVim_statusline_b')
|
|
||||||
let w:spacevim_statusline_mode = a:mode
|
|
||||||
endif
|
endif
|
||||||
return ''
|
call s:HI.hi_separator('SpaceVim_statusline_a', 'SpaceVim_statusline_b')
|
||||||
|
let w:spacevim_statusline_mode = a:mode
|
||||||
|
endif
|
||||||
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#denite_mode()
|
function! SpaceVim#layers#core#statusline#denite_mode()
|
||||||
let t = s:colors_template
|
let t = s:colors_template
|
||||||
let dmode = split(denite#get_status_mode())[1]
|
let dmode = split(denite#get_status_mode())[1]
|
||||||
if get(w:, 'spacevim_statusline_mode', '') != dmode
|
if get(w:, 'spacevim_statusline_mode', '') != dmode
|
||||||
if dmode == 'NORMAL'
|
if dmode == 'NORMAL'
|
||||||
exe 'hi! SpaceVim_statusline_a_bold cterm=bold gui=bold ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
exe 'hi! SpaceVim_statusline_a_bold cterm=bold gui=bold ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
||||||
elseif dmode == 'INSERT'
|
elseif dmode == 'INSERT'
|
||||||
exe 'hi! SpaceVim_statusline_a_bold cterm=bold gui=bold ctermbg=' . t[4][3] . ' ctermfg=' . t[4][2] . ' guibg=' . t[4][1] . ' guifg=' . t[4][0]
|
exe 'hi! SpaceVim_statusline_a_bold cterm=bold gui=bold ctermbg=' . t[4][3] . ' ctermfg=' . t[4][2] . ' guibg=' . t[4][1] . ' guifg=' . t[4][0]
|
||||||
endif
|
|
||||||
call s:HI.hi_separator('SpaceVim_statusline_a_bold', 'SpaceVim_statusline_b')
|
|
||||||
let w:spacevim_statusline_mode = dmode
|
|
||||||
endif
|
endif
|
||||||
return dmode
|
call s:HI.hi_separator('SpaceVim_statusline_a_bold', 'SpaceVim_statusline_b')
|
||||||
|
let w:spacevim_statusline_mode = dmode
|
||||||
|
endif
|
||||||
|
return dmode
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#unite_mode()
|
function! SpaceVim#layers#core#statusline#unite_mode()
|
||||||
let t = s:colors_template
|
let t = s:colors_template
|
||||||
let dmode = mode()
|
let dmode = mode()
|
||||||
if get(w:, 'spacevim_statusline_mode', '') != dmode
|
if get(w:, 'spacevim_statusline_mode', '') != dmode
|
||||||
if dmode == 'n'
|
if dmode == 'n'
|
||||||
exe 'hi! SpaceVim_statusline_a_bold cterm=bold gui=bold ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
exe 'hi! SpaceVim_statusline_a_bold cterm=bold gui=bold ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
||||||
elseif dmode == 'i'
|
elseif dmode == 'i'
|
||||||
exe 'hi! SpaceVim_statusline_a_bold cterm=bold gui=bold ctermbg=' . t[4][3] . ' ctermfg=' . t[4][2] . ' guibg=' . t[4][1] . ' guifg=' . t[4][0]
|
exe 'hi! SpaceVim_statusline_a_bold cterm=bold gui=bold ctermbg=' . t[4][3] . ' ctermfg=' . t[4][2] . ' guibg=' . t[4][1] . ' guifg=' . t[4][0]
|
||||||
endif
|
|
||||||
call s:HI.hi_separator('SpaceVim_statusline_a_bold', 'SpaceVim_statusline_b')
|
|
||||||
let w:spacevim_statusline_mode = dmode
|
|
||||||
endif
|
endif
|
||||||
return ''
|
call s:HI.hi_separator('SpaceVim_statusline_a_bold', 'SpaceVim_statusline_b')
|
||||||
|
let w:spacevim_statusline_mode = dmode
|
||||||
|
endif
|
||||||
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" vim:set et sw=2 cc=80:
|
||||||
|
@ -2,12 +2,15 @@
|
|||||||
" @section Default, default
|
" @section Default, default
|
||||||
" @parentsection layers
|
" @parentsection layers
|
||||||
|
|
||||||
|
let s:filename = expand('<sfile>:~')
|
||||||
|
|
||||||
function! SpaceVim#layers#default#plugins() abort
|
function! SpaceVim#layers#default#plugins() abort
|
||||||
let plugins = []
|
let plugins = []
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
let s:lnum = expand('<slnum>') + 3
|
||||||
function! SpaceVim#layers#default#config() abort
|
function! SpaceVim#layers#default#config() abort
|
||||||
" Unimpaired bindings
|
" Unimpaired bindings
|
||||||
" Quickly add empty lines
|
" Quickly add empty lines
|
||||||
@ -47,7 +50,27 @@ function! SpaceVim#layers#default#config() abort
|
|||||||
" Select last paste
|
" Select last paste
|
||||||
nnoremap <silent><expr> gp '`['.strpart(getregtype(), 0, 1).'`]'
|
nnoremap <silent><expr> gp '`['.strpart(getregtype(), 0, 1).'`]'
|
||||||
|
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['f', 'f'], "exe 'CtrlP ' . fnamemodify(bufname('%'), ':h')", 'Find files in the directory of the current buffer', 1)
|
let lnum = expand('<slnum>') + s:lnum - 1
|
||||||
|
if has('python3')
|
||||||
|
let cmd = 'DeniteBufferDir file_rec'
|
||||||
|
elseif has('python')
|
||||||
|
let cmd = "exe 'LeaderfFile ' . fnamemodify(bufname('%'), ':h')"
|
||||||
|
else
|
||||||
|
let cmd = "exe 'CtrlP ' . fnamemodify(bufname('%'), ':h')"
|
||||||
|
endif
|
||||||
|
call SpaceVim#mapping#space#def('nnoremap', ['f', 'f'],
|
||||||
|
\ cmd,
|
||||||
|
\ ['Find files in the directory of the current buffer',
|
||||||
|
\ [
|
||||||
|
\ '[SPC f f] is to find files in the directory of the current buffer',
|
||||||
|
\ 'vim with +python3 support will use denite',
|
||||||
|
\ 'vim with +python support will use leaderf',
|
||||||
|
\ 'otherwise will use ctrlp',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:filename . ':' . lnum,
|
||||||
|
\ ]
|
||||||
|
\ ]
|
||||||
|
\ , 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['f', 's'], 'write', 'save buffer', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['f', 's'], 'write', 'save buffer', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['f', 'S'], 'wall', 'save all buffer', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['f', 'S'], 'wall', 'save all buffer', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['f', 'W'], 'write !sudo tee % >/dev/null', 'save buffer with sudo', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['f', 'W'], 'write !sudo tee % >/dev/null', 'save buffer with sudo', 1)
|
||||||
@ -63,7 +86,7 @@ function! SpaceVim#layers#default#config() abort
|
|||||||
call SpaceVim#mapping#space#def('nnoremap', ['h', 'k'], 'LeaderGuide "[KEYs]"', 'show top-level bindings with mapping guide', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['h', 'k'], 'LeaderGuide "[KEYs]"', 'show top-level bindings with mapping guide', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['h', '[SPC]'], 'Unite help -input=SpaceVim', 'unite-SpaceVim-help', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['h', '[SPC]'], 'Unite help -input=SpaceVim', 'unite-SpaceVim-help', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['j', '0'], 'm`^', 'push mark and goto beginning of line', 0)
|
call SpaceVim#mapping#space#def('nnoremap', ['j', '0'], 'm`^', 'push mark and goto beginning of line', 0)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['j', '$'], 'm`g_', 'push mark and goto beginning of line', 0)
|
call SpaceVim#mapping#space#def('nnoremap', ['j', '$'], 'm`g_', 'push mark and goto end of line', 0)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['j', 'b'], '<C-o>', 'jump backward', 0)
|
call SpaceVim#mapping#space#def('nnoremap', ['j', 'b'], '<C-o>', 'jump backward', 0)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['j', 'f'], '<C-i>', 'jump forward', 0)
|
call SpaceVim#mapping#space#def('nnoremap', ['j', 'f'], '<C-i>', 'jump forward', 0)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['j', 'd'], 'VimFiler -no-split', 'Explore current directory', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['j', 'd'], 'VimFiler -no-split', 'Explore current directory', 1)
|
||||||
@ -317,102 +340,102 @@ function! s:buffer_transient_state() abort
|
|||||||
call state.set_title('Buffer Selection Transient State')
|
call state.set_title('Buffer Selection Transient State')
|
||||||
call state.defind_keys(
|
call state.defind_keys(
|
||||||
\ {
|
\ {
|
||||||
\ 'layout' : 'vertical split',
|
\ 'layout' : 'vertical split',
|
||||||
\ 'left' : [
|
\ 'left' : [
|
||||||
\ {
|
\ {
|
||||||
\ 'key' : {
|
\ 'key' : {
|
||||||
\ 'name' : 'C-1..C-9',
|
\ 'name' : 'C-1..C-9',
|
||||||
\ 'pos' : [[1,4], [6,9]],
|
\ 'pos' : [[1,4], [6,9]],
|
||||||
\ 'handles' : [
|
\ 'handles' : [
|
||||||
\ ["\<C-1>" , ''],
|
\ ["\<C-1>" , ''],
|
||||||
\ ["\<C-2>" , ''],
|
\ ["\<C-2>" , ''],
|
||||||
\ ["\<C-3>" , ''],
|
\ ["\<C-3>" , ''],
|
||||||
\ ["\<C-4>" , ''],
|
\ ["\<C-4>" , ''],
|
||||||
\ ["\<C-5>" , ''],
|
\ ["\<C-5>" , ''],
|
||||||
\ ["\<C-6>" , ''],
|
\ ["\<C-6>" , ''],
|
||||||
\ ["\<C-7>" , ''],
|
\ ["\<C-7>" , ''],
|
||||||
\ ["\<C-8>" , ''],
|
\ ["\<C-8>" , ''],
|
||||||
\ ["\<C-9>" , ''],
|
\ ["\<C-9>" , ''],
|
||||||
\ ],
|
\ ],
|
||||||
\ },
|
\ },
|
||||||
\ 'desc' : 'goto nth window',
|
\ 'desc' : 'goto nth window',
|
||||||
\ 'func' : '',
|
\ 'func' : '',
|
||||||
\ 'cmd' : '',
|
\ 'cmd' : '',
|
||||||
\ 'exit' : 0,
|
\ 'exit' : 0,
|
||||||
\ },
|
\ },
|
||||||
\ {
|
\ {
|
||||||
\ 'key' : {
|
\ 'key' : {
|
||||||
\ 'name' : '1..9',
|
\ 'name' : '1..9',
|
||||||
\ 'pos' : [[1,2], [4,5]],
|
\ 'pos' : [[1,2], [4,5]],
|
||||||
\ 'handles' : [
|
\ 'handles' : [
|
||||||
\ ['1' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [1])'],
|
\ ['1' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [1])'],
|
||||||
\ ['2' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [2])'],
|
\ ['2' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [2])'],
|
||||||
\ ['3' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [3])'],
|
\ ['3' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [3])'],
|
||||||
\ ['4' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [4])'],
|
\ ['4' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [4])'],
|
||||||
\ ['5' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [5])'],
|
\ ['5' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [5])'],
|
||||||
\ ['6' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [6])'],
|
\ ['6' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [6])'],
|
||||||
\ ['7' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [7])'],
|
\ ['7' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [7])'],
|
||||||
\ ['8' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [8])'],
|
\ ['8' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [8])'],
|
||||||
\ ['9' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [9])'],
|
\ ['9' , 'call call(' . string(s:_function('s:move_buffer_to_nth_win')) . ', [9])'],
|
||||||
\ ],
|
\ ],
|
||||||
\ },
|
\ },
|
||||||
\ 'desc' : 'move buffer to nth window',
|
\ 'desc' : 'move buffer to nth window',
|
||||||
\ 'func' : '',
|
\ 'func' : '',
|
||||||
\ 'cmd' : '',
|
\ 'cmd' : '',
|
||||||
\ 'exit' : 0,
|
\ 'exit' : 0,
|
||||||
\ },
|
\ },
|
||||||
\ {
|
\ {
|
||||||
\ 'key' : {
|
\ 'key' : {
|
||||||
\ 'name' : 'M-1..M-9',
|
\ 'name' : 'M-1..M-9',
|
||||||
\ 'pos' : [[1,4], [6,9]],
|
\ 'pos' : [[1,4], [6,9]],
|
||||||
\ 'handles' : [
|
\ 'handles' : [
|
||||||
\ ["\<M-1>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [1])'],
|
\ ["\<M-1>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [1])'],
|
||||||
\ ["\<M-2>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [2])'],
|
\ ["\<M-2>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [2])'],
|
||||||
\ ["\<M-3>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [3])'],
|
\ ["\<M-3>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [3])'],
|
||||||
\ ["\<M-4>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [4])'],
|
\ ["\<M-4>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [4])'],
|
||||||
\ ["\<M-5>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [5])'],
|
\ ["\<M-5>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [5])'],
|
||||||
\ ["\<M-6>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [6])'],
|
\ ["\<M-6>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [6])'],
|
||||||
\ ["\<M-7>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [7])'],
|
\ ["\<M-7>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [7])'],
|
||||||
\ ["\<M-8>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [8])'],
|
\ ["\<M-8>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [8])'],
|
||||||
\ ["\<M-9>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [9])'],
|
\ ["\<M-9>" , 'call call(' . string(s:_function('s:swap_buffer_with_nth_win')) . ', [9])'],
|
||||||
\ ],
|
\ ],
|
||||||
\ },
|
\ },
|
||||||
\ 'desc' : 'swap buffer with nth window',
|
\ 'desc' : 'swap buffer with nth window',
|
||||||
\ 'func' : '',
|
\ 'func' : '',
|
||||||
\ 'cmd' : '',
|
\ 'cmd' : '',
|
||||||
\ 'exit' : 0,
|
\ 'exit' : 0,
|
||||||
\ },
|
\ },
|
||||||
\ ],
|
\ ],
|
||||||
\ 'right' : [
|
\ 'right' : [
|
||||||
\ {
|
\ {
|
||||||
\ 'key' : 'n',
|
\ 'key' : 'n',
|
||||||
\ 'desc' : 'next buffer',
|
\ 'desc' : 'next buffer',
|
||||||
\ 'func' : '',
|
\ 'func' : '',
|
||||||
\ 'cmd' : 'bnext',
|
\ 'cmd' : 'bnext',
|
||||||
\ 'exit' : 0,
|
\ 'exit' : 0,
|
||||||
\ },
|
\ },
|
||||||
\ {
|
\ {
|
||||||
\ 'key' : ['N', 'p'],
|
\ 'key' : ['N', 'p'],
|
||||||
\ 'desc' : 'previous buffer',
|
\ 'desc' : 'previous buffer',
|
||||||
\ 'func' : '',
|
\ 'func' : '',
|
||||||
\ 'cmd' : 'bp',
|
\ 'cmd' : 'bp',
|
||||||
\ 'exit' : 0,
|
\ 'exit' : 0,
|
||||||
\ },
|
\ },
|
||||||
\ {
|
\ {
|
||||||
\ 'key' : 'd',
|
\ 'key' : 'd',
|
||||||
\ 'desc' : 'kill buffer',
|
\ 'desc' : 'kill buffer',
|
||||||
\ 'func' : '',
|
\ 'func' : '',
|
||||||
\ 'cmd' : 'call SpaceVim#mapping#close_current_buffer()',
|
\ 'cmd' : 'call SpaceVim#mapping#close_current_buffer()',
|
||||||
\ 'exit' : 0,
|
\ 'exit' : 0,
|
||||||
\ },
|
\ },
|
||||||
\ {
|
\ {
|
||||||
\ 'key' : 'q',
|
\ 'key' : 'q',
|
||||||
\ 'desc' : 'quit',
|
\ 'desc' : 'quit',
|
||||||
\ 'func' : '',
|
\ 'func' : '',
|
||||||
\ 'cmd' : '',
|
\ 'cmd' : '',
|
||||||
\ 'exit' : 1,
|
\ 'exit' : 1,
|
||||||
\ },
|
\ },
|
||||||
\ ],
|
\ ],
|
||||||
\ }
|
\ }
|
||||||
\ )
|
\ )
|
||||||
call state.open()
|
call state.open()
|
||||||
|
@ -6,6 +6,7 @@ let s:LIST = SpaceVim#api#import('data#list')
|
|||||||
function! SpaceVim#layers#edit#plugins() abort
|
function! SpaceVim#layers#edit#plugins() abort
|
||||||
let plugins = [
|
let plugins = [
|
||||||
\ ['tpope/vim-surround'],
|
\ ['tpope/vim-surround'],
|
||||||
|
\ ['tpope/vim-repeat'],
|
||||||
\ ['junegunn/vim-emoji'],
|
\ ['junegunn/vim-emoji'],
|
||||||
\ ['terryma/vim-multiple-cursors'],
|
\ ['terryma/vim-multiple-cursors'],
|
||||||
\ ['terryma/vim-expand-region', { 'loadconf' : 1}],
|
\ ['terryma/vim-expand-region', { 'loadconf' : 1}],
|
||||||
@ -49,7 +50,7 @@ function! SpaceVim#layers#edit#config() abort
|
|||||||
let g:_spacevim_mappings_space.x.i = {'name' : '+change symbol style'}
|
let g:_spacevim_mappings_space.x.i = {'name' : '+change symbol style'}
|
||||||
nnoremap <silent> <Plug>CountSelectionRegion :call <SID>count_selection_region()<Cr>
|
nnoremap <silent> <Plug>CountSelectionRegion :call <SID>count_selection_region()<Cr>
|
||||||
xnoremap <silent> <Plug>CountSelectionRegion :<C-u>call <SID>count_selection_region()<Cr>
|
xnoremap <silent> <Plug>CountSelectionRegion :<C-u>call <SID>count_selection_region()<Cr>
|
||||||
call SpaceVim#mapping#space#def('nmap', ['x', 'c'], '<Plug>CountSelectionRegion', 'cunt in the selection region', 0, 1)
|
call SpaceVim#mapping#space#def('nmap', ['x', 'c'], '<Plug>CountSelectionRegion', 'count in the selection region', 0, 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', '&'], 'Tabularize /&', 'align region at &', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', '&'], 'Tabularize /&', 'align region at &', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', '('], 'Tabularize /(', 'align region at (', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', '('], 'Tabularize /(', 'align region at (', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', ')'], 'Tabularize /)', 'align region at )', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', ')'], 'Tabularize /)', 'align region at )', 1)
|
||||||
|
@ -10,7 +10,7 @@ function! SpaceVim#layers#lang#plugins() abort
|
|||||||
\ ['juvenn/mustache.vim', { 'on_ft' : ['mustache']}],
|
\ ['juvenn/mustache.vim', { 'on_ft' : ['mustache']}],
|
||||||
\ ['leafgarland/typescript-vim', { 'on_ft' : ['typescript']}],
|
\ ['leafgarland/typescript-vim', { 'on_ft' : ['typescript']}],
|
||||||
\ ['kchmck/vim-coffee-script', { 'on_ft' : ['coffee']}],
|
\ ['kchmck/vim-coffee-script', { 'on_ft' : ['coffee']}],
|
||||||
\ ['leshill/vim-json', { 'on_ft' : ['javascript','json']}],
|
\ ['elzr/vim-json', { 'on_ft' : ['javascript','json']}],
|
||||||
\ ['elixir-lang/vim-elixir', { 'on_ft' : 'elixir'}],
|
\ ['elixir-lang/vim-elixir', { 'on_ft' : 'elixir'}],
|
||||||
\ ['PotatoesMaster/i3-vim-syntax', { 'on_ft' : 'i3'}],
|
\ ['PotatoesMaster/i3-vim-syntax', { 'on_ft' : 'i3'}],
|
||||||
\ ['isundil/vim-irssi-syntax', { 'on_ft' : 'irssi'}],
|
\ ['isundil/vim-irssi-syntax', { 'on_ft' : 'irssi'}],
|
||||||
|
32
autoload/SpaceVim/layers/lang/julia.vim
Normal file
32
autoload/SpaceVim/layers/lang/julia.vim
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
"=============================================================================
|
||||||
|
" julia.vim --- Julia Language configuration for SpaceVim
|
||||||
|
" Copyright (c) 2012-2016 Shidong Wang & Contributors
|
||||||
|
" Author: Jinxuan Zhu <zhujinxuan@gmail.com>
|
||||||
|
" URL: https://spacevim.org
|
||||||
|
" License: MIT license
|
||||||
|
"=============================================================================
|
||||||
|
""
|
||||||
|
" @section lang#julia, layer-lang-julia
|
||||||
|
" @parentsection layers
|
||||||
|
" The layer provides synatax highlight and linting for julia.
|
||||||
|
" The completeion only works in nvim with deoplete.
|
||||||
|
" However, the julia-vim could not be load on-demanding
|
||||||
|
" due to its LaTeXToUnicode feature.
|
||||||
|
"
|
||||||
|
|
||||||
|
function! SpaceVim#layers#lang#julia#plugins() abort
|
||||||
|
let plugins = []
|
||||||
|
call add(plugins, ['JuliaEditorSupport/julia-vim' ])
|
||||||
|
if (has('nvim'))
|
||||||
|
call add(plugins, ['JuliaEditorSupport/deoplete-julia', {'on_ft' : 'julia'}])
|
||||||
|
endif
|
||||||
|
call add(plugins, ['zyedidia/julialint.vim', {'on_ft' : 'julia'}])
|
||||||
|
return plugins
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! SpaceVim#layers#lang#julia#config() abort
|
||||||
|
let g:latex_to_unicode_tab = 0
|
||||||
|
au! BufNewFile,BufRead *.jl setf julia
|
||||||
|
au! BufNewFile,BufRead *.julia setf julia
|
||||||
|
endfunction
|
@ -49,7 +49,7 @@ function! SpaceVim#layers#unite#plugins() abort
|
|||||||
\ ['sgur/unite-everything'],
|
\ ['sgur/unite-everything'],
|
||||||
\ ['wsdjeg/unite-dwm'],
|
\ ['wsdjeg/unite-dwm'],
|
||||||
\ ['raw1z/unite-projects'],
|
\ ['raw1z/unite-projects'],
|
||||||
\ ['voi/unite-ctags'],
|
\ ['SpaceVim/unite-ctags'],
|
||||||
\ ['Shougo/unite-session'],
|
\ ['Shougo/unite-session'],
|
||||||
\ ['osyo-manga/unite-quickfix'],
|
\ ['osyo-manga/unite-quickfix'],
|
||||||
\ ['ujihisa/unite-colorscheme'],
|
\ ['ujihisa/unite-colorscheme'],
|
||||||
|
@ -68,6 +68,8 @@ function! SpaceVim#mapping#g#init() abort
|
|||||||
nnoremap gn gn
|
nnoremap gn gn
|
||||||
let g:_spacevim_mappings_g['Q'] = ['call feedkeys("gQ", "n")', 'switch to Ex mode']
|
let g:_spacevim_mappings_g['Q'] = ['call feedkeys("gQ", "n")', 'switch to Ex mode']
|
||||||
nnoremap gQ gQ
|
nnoremap gQ gQ
|
||||||
|
let g:_spacevim_mappings_g['q'] = ['call feedkeys("gq", "n")', 'format Nmove text']
|
||||||
|
nnoremap gq gq
|
||||||
let g:_spacevim_mappings_g['R'] = ['call feedkeys("gR", "n")', 'enter VREPLACE mode']
|
let g:_spacevim_mappings_g['R'] = ['call feedkeys("gR", "n")', 'enter VREPLACE mode']
|
||||||
nnoremap gR gR
|
nnoremap gR gR
|
||||||
let g:_spacevim_mappings_g['T'] = ['call feedkeys("gT", "n")', 'previous tag page']
|
let g:_spacevim_mappings_g['T'] = ['call feedkeys("gT", "n")', 'previous tag page']
|
||||||
@ -94,10 +96,8 @@ function! SpaceVim#mapping#g#init() abort
|
|||||||
nnoremap gs gs
|
nnoremap gs gs
|
||||||
let g:_spacevim_mappings_g['v'] = ['call feedkeys("gv", "n")', 'reselect the previous Visual area']
|
let g:_spacevim_mappings_g['v'] = ['call feedkeys("gv", "n")', 'reselect the previous Visual area']
|
||||||
nnoremap gv gv
|
nnoremap gv gv
|
||||||
|
let g:_spacevim_mappings_g['<C-]>'] = ['call feedkeys("g<c-]>", "n")', 'jump to tag under cursor']
|
||||||
|
nnoremap g<c-]> g<c-]>
|
||||||
|
|
||||||
|
|
||||||
let g:_spacevim_mappings_g['d'] = ['call SpaceVim#mapping#gd()', 'goto definition']
|
let g:_spacevim_mappings_g['d'] = ['call SpaceVim#mapping#gd()', 'goto definition']
|
||||||
call SpaceVim#mapping#def('nnoremap <silent>', 'gd', ':call SpaceVim#mapping#gd()<CR>', 'Goto declaration', '')
|
call SpaceVim#mapping#def('nnoremap <silent>', 'gd', ':call SpaceVim#mapping#gd()<CR>', 'Goto declaration', '')
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
let s:file = expand('<sfile>:~')
|
||||||
function! SpaceVim#mapping#space#init() abort
|
function! SpaceVim#mapping#space#init() abort
|
||||||
if s:has_map_to_spc()
|
if s:has_map_to_spc()
|
||||||
return
|
return
|
||||||
@ -63,19 +64,28 @@ function! SpaceVim#mapping#space#init() abort
|
|||||||
call SpaceVim#mapping#space#def('nnoremap', ['w', 'W'], 'ChooseWin', 'select window', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['w', 'W'], 'ChooseWin', 'select window', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['w', 'u'], 'call SpaceVim#plugins#windowsmanager#UndoQuitWin()', 'undo quieted window', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['w', 'u'], 'call SpaceVim#plugins#windowsmanager#UndoQuitWin()', 'undo quieted window', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['w', 'U'], 'call SpaceVim#plugins#windowsmanager#RedoQuitWin()', 'redo quieted window', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['w', 'U'], 'call SpaceVim#plugins#windowsmanager#RedoQuitWin()', 'redo quieted window', 1)
|
||||||
nnoremap <silent> [SPC]bn :bnext<CR>
|
let s:lnum = expand('<slnum>') + 3
|
||||||
let g:_spacevim_mappings_space.b.n = ['bnext', 'next buffer',
|
call SpaceVim#mapping#space#def('nnoremap', ['b', 'n'], 'bnext', ['next buffer',
|
||||||
\ [
|
\ [
|
||||||
\ 'SPC b n is running :bnext, jump to next buffer',
|
\ '[SPC b n] is running :bnext, jump to next buffer',
|
||||||
\ 'which is a vim build in command',
|
\ 'which is a vim build in command',
|
||||||
\ 'It is bound to SPC b n, ] b,',
|
\ 'It is bound to SPC b n, ] b,',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:file . ':' . s:lnum,
|
||||||
\ ]
|
\ ]
|
||||||
\ ]
|
\ ]
|
||||||
call SpaceVim#mapping#menu('Open next buffer', '[SPC]bn', 'bp')
|
\ , 1)
|
||||||
nnoremap <silent> [SPC]bp :bp<CR>
|
let s:lnum = expand('<slnum>') + 3
|
||||||
let g:_spacevim_mappings_space.b.p = ['bp', 'previous buffer']
|
call SpaceVim#mapping#space#def('nnoremap', ['b', 'p'], 'bp', ['previous buffer',
|
||||||
call SpaceVim#mapping#menu('Open previous buffer', '[SPC]bp', 'bp')
|
\ [
|
||||||
|
\ 'SPC b p is running :bp, jump to previous buffer',
|
||||||
|
\ 'which is a vim build in command',
|
||||||
|
\ 'It is bound to SPC b p, [ b,',
|
||||||
|
\ '',
|
||||||
|
\ 'Definition: ' . s:file . ':' . s:lnum,
|
||||||
|
\ ]
|
||||||
|
\ ]
|
||||||
|
\ , 1)
|
||||||
"
|
"
|
||||||
" Comments sections
|
" Comments sections
|
||||||
"
|
"
|
||||||
|
@ -208,7 +208,7 @@ function! SpaceVim#plugins#manager#update(...) abort
|
|||||||
elseif reponame ==# 'SpaceVim'
|
elseif reponame ==# 'SpaceVim'
|
||||||
let repo = {
|
let repo = {
|
||||||
\ 'name' : 'SpaceVim',
|
\ 'name' : 'SpaceVim',
|
||||||
\ 'path' : expand('~/.SpaceVim')
|
\ 'path' : fnamemodify(g:Config_Main_Home, ':h')
|
||||||
\ }
|
\ }
|
||||||
call s:pull(repo)
|
call s:pull(repo)
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
let g:Config_Main_Home = fnamemodify(expand('<sfile>'), ':p:h:gs?\\?'.((has('win16') || has('win32') || has('win64'))?'\':'/') . '?')
|
let g:Config_Main_Home = fnamemodify(expand('<sfile>'),
|
||||||
|
\ ':p:h:gs?\\?'.((has('win16') || has('win32')
|
||||||
|
\ || has('win64'))?'\':'/') . '?')
|
||||||
|
|
||||||
|
|
||||||
" [dir?, path]
|
" [dir?, path]
|
||||||
@ -58,3 +60,5 @@ endif
|
|||||||
call zvim#util#source_rc('commands.vim')
|
call zvim#util#source_rc('commands.vim')
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
syntax on
|
syntax on
|
||||||
|
|
||||||
|
" vim:set et sw=2 cc=80:
|
||||||
|
@ -20,7 +20,7 @@ if executable('rg') && !exists('g:ctrlp_user_command')
|
|||||||
let g:ctrlp_user_command = 'rg %s --no-ignore --hidden --files -g "" '
|
let g:ctrlp_user_command = 'rg %s --no-ignore --hidden --files -g "" '
|
||||||
\ . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'rg', 1))
|
\ . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'rg', 1))
|
||||||
elseif executable('ag') && !exists('g:ctrlp_user_command')
|
elseif executable('ag') && !exists('g:ctrlp_user_command')
|
||||||
let g:ctrlp_user_command = 'ag %s --hidden -i -g "" ' . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'ag'))
|
let g:ctrlp_user_command = 'ag --hidden -i -g "" ' . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'ag')) . ' %s'
|
||||||
endif
|
endif
|
||||||
if !exists('g:ctrlp_match_func') && (has('python') || has('python3'))
|
if !exists('g:ctrlp_match_func') && (has('python') || has('python3'))
|
||||||
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
|
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
|
||||||
|
@ -7,131 +7,131 @@ title: "Documentation"
|
|||||||
<!-- vim-markdown-toc GFM -->
|
<!-- vim-markdown-toc GFM -->
|
||||||
|
|
||||||
* [Core Pillars](#core-pillars)
|
* [Core Pillars](#core-pillars)
|
||||||
* [Mnemonic](#mnemonic)
|
* [Mnemonic](#mnemonic)
|
||||||
* [Discoverable](#discoverable)
|
* [Discoverable](#discoverable)
|
||||||
* [Consistent](#consistent)
|
* [Consistent](#consistent)
|
||||||
* [Crowd-Configured](#crowd-configured)
|
* [Crowd-Configured](#crowd-configured)
|
||||||
* [Highlighted features](#highlighted-features)
|
* [Highlighted features](#highlighted-features)
|
||||||
* [Screenshots](#screenshots)
|
* [Screenshots](#screenshots)
|
||||||
* [welcome page](#welcome-page)
|
* [welcome page](#welcome-page)
|
||||||
* [working flow](#working-flow)
|
* [working flow](#working-flow)
|
||||||
* [Who can benefit from this?](#who-can-benefit-from-this)
|
* [Who can benefit from this?](#who-can-benefit-from-this)
|
||||||
* [Update and Rollback](#update-and-rollback)
|
* [Update and Rollback](#update-and-rollback)
|
||||||
* [Update SpaceVim itself](#update-spacevim-itself)
|
* [Update SpaceVim itself](#update-spacevim-itself)
|
||||||
* [Automatic Updates](#automatic-updates)
|
* [Automatic Updates](#automatic-updates)
|
||||||
* [Updating from the SpaceVim Buffer](#updating-from-the-spacevim-buffer)
|
* [Updating from the SpaceVim Buffer](#updating-from-the-spacevim-buffer)
|
||||||
* [Updating Manually with git](#updating-manually-with-git)
|
* [Updating Manually with git](#updating-manually-with-git)
|
||||||
* [Update plugins](#update-plugins)
|
* [Update plugins](#update-plugins)
|
||||||
* [Configuration layers](#configuration-layers)
|
* [Configuration layers](#configuration-layers)
|
||||||
* [Custom Configuration](#custom-configuration)
|
* [Custom Configuration](#custom-configuration)
|
||||||
* [Automatic Generation](#automatic-generation)
|
* [Automatic Generation](#automatic-generation)
|
||||||
* [Alternative directory](#alternative-directory)
|
* [Alternative directory](#alternative-directory)
|
||||||
* [Concepts](#concepts)
|
* [Concepts](#concepts)
|
||||||
* [Transient-states](#transient-states)
|
* [Transient-states](#transient-states)
|
||||||
* [Awesome ui](#awesome-ui)
|
* [Awesome ui](#awesome-ui)
|
||||||
* [Colorschemes](#colorschemes)
|
* [Colorschemes](#colorschemes)
|
||||||
* [Font](#font)
|
* [Font](#font)
|
||||||
* [UI Toggles](#ui-toggles)
|
* [UI Toggles](#ui-toggles)
|
||||||
* [Statusline && tabline](#statusline--tabline)
|
* [Statusline && tabline](#statusline--tabline)
|
||||||
* [statusline](#statusline)
|
* [statusline](#statusline)
|
||||||
* [tabline](#tabline)
|
* [tabline](#tabline)
|
||||||
* [Manual](#manual)
|
* [Manual](#manual)
|
||||||
* [Completion](#completion)
|
* [Completion](#completion)
|
||||||
* [Unite/Denite](#unitedenite)
|
* [Unite/Denite](#unitedenite)
|
||||||
* [Mappings within unite/denite buffer](#mappings-within-unitedenite-buffer)
|
* [Mappings within unite/denite buffer](#mappings-within-unitedenite-buffer)
|
||||||
* [Discovering](#discovering)
|
* [Discovering](#discovering)
|
||||||
* [Mappings](#mappings)
|
* [Mappings](#mappings)
|
||||||
* [Mappings guide](#mappings-guide)
|
* [Mappings guide](#mappings-guide)
|
||||||
* [Unide/Denite describe key bindings](#unidedenite-describe-key-bindings)
|
* [Unide/Denite describe key bindings](#unidedenite-describe-key-bindings)
|
||||||
* [Getting help](#getting-help)
|
* [Getting help](#getting-help)
|
||||||
* [Available layers](#available-layers)
|
* [Available layers](#available-layers)
|
||||||
* [Available plugins in SpaceVim](#available-plugins-in-spacevim)
|
* [Available plugins in SpaceVim](#available-plugins-in-spacevim)
|
||||||
* [New packages from ELPA repositories](#new-packages-from-elpa-repositories)
|
* [New packages from ELPA repositories](#new-packages-from-elpa-repositories)
|
||||||
* [Toggles](#toggles)
|
* [Toggles](#toggles)
|
||||||
* [Navigating](#navigating)
|
* [Navigating](#navigating)
|
||||||
* [Point/Cursor](#pointcursor)
|
* [Point/Cursor](#pointcursor)
|
||||||
* [Vim motions with vim-easymotion](#vim-motions-with-vim-easymotion)
|
* [Vim motions with vim-easymotion](#vim-motions-with-vim-easymotion)
|
||||||
* [quick-jump-link mode (TODO)](#quick-jump-link-mode-todo)
|
* [quick-jump-link mode (TODO)](#quick-jump-link-mode-todo)
|
||||||
* [Unimpaired bindings](#unimpaired-bindings)
|
* [Unimpaired bindings](#unimpaired-bindings)
|
||||||
* [Jumping, Joining and Splitting](#jumping-joining-and-splitting)
|
* [Jumping, Joining and Splitting](#jumping-joining-and-splitting)
|
||||||
* [Jumping](#jumping)
|
* [Jumping](#jumping)
|
||||||
* [Joining and splitting](#joining-and-splitting)
|
* [Joining and splitting](#joining-and-splitting)
|
||||||
* [Window manipulation](#window-manipulation)
|
* [Window manipulation](#window-manipulation)
|
||||||
* [Window manipulation key bindings](#window-manipulation-key-bindings)
|
* [Window manipulation key bindings](#window-manipulation-key-bindings)
|
||||||
* [Buffers and Files](#buffers-and-files)
|
* [Buffers and Files](#buffers-and-files)
|
||||||
* [Buffers manipulation key bindings](#buffers-manipulation-key-bindings)
|
* [Buffers manipulation key bindings](#buffers-manipulation-key-bindings)
|
||||||
* [Create a new empty buffer](#create-a-new-empty-buffer)
|
* [Create a new empty buffer](#create-a-new-empty-buffer)
|
||||||
* [Special Buffers](#special-buffers)
|
* [Special Buffers](#special-buffers)
|
||||||
* [Files manipulations key bindings](#files-manipulations-key-bindings)
|
* [Files manipulations key bindings](#files-manipulations-key-bindings)
|
||||||
* [Vim and SpaceVim files](#vim-and-spacevim-files)
|
* [Vim and SpaceVim files](#vim-and-spacevim-files)
|
||||||
* [File tree](#file-tree)
|
* [File tree](#file-tree)
|
||||||
* [File tree navigation](#file-tree-navigation)
|
* [File tree navigation](#file-tree-navigation)
|
||||||
* [Open file with file tree.](#open-file-with-file-tree)
|
* [Open file with file tree.](#open-file-with-file-tree)
|
||||||
* [Commands starting with `g`](#commands-starting-with-g)
|
* [Commands starting with `g`](#commands-starting-with-g)
|
||||||
* [Commands starting with `z`](#commands-starting-with-z)
|
* [Commands starting with `z`](#commands-starting-with-z)
|
||||||
* [Auto-saving](#auto-saving)
|
* [Auto-saving](#auto-saving)
|
||||||
* [Searching](#searching)
|
* [Searching](#searching)
|
||||||
* [With an external tool](#with-an-external-tool)
|
* [With an external tool](#with-an-external-tool)
|
||||||
* [Useful key bindings](#useful-key-bindings)
|
* [Useful key bindings](#useful-key-bindings)
|
||||||
* [Searching in current file](#searching-in-current-file)
|
* [Searching in current file](#searching-in-current-file)
|
||||||
* [Searching in all loaded buffers](#searching-in-all-loaded-buffers)
|
* [Searching in all loaded buffers](#searching-in-all-loaded-buffers)
|
||||||
* [Searching in an arbitrary directory](#searching-in-an-arbitrary-directory)
|
* [Searching in an arbitrary directory](#searching-in-an-arbitrary-directory)
|
||||||
* [Searching in a project](#searching-in-a-project)
|
* [Searching in a project](#searching-in-a-project)
|
||||||
* [Background searching in a project](#background-searching-in-a-project)
|
* [Background searching in a project](#background-searching-in-a-project)
|
||||||
* [Searching the web](#searching-the-web)
|
* [Searching the web](#searching-the-web)
|
||||||
* [Searching on the fly](#searching-on-the-fly)
|
* [Searching on the fly](#searching-on-the-fly)
|
||||||
* [Persistent highlighting](#persistent-highlighting)
|
* [Persistent highlighting](#persistent-highlighting)
|
||||||
* [Editing](#editing)
|
* [Editing](#editing)
|
||||||
* [Paste text](#paste-text)
|
* [Paste text](#paste-text)
|
||||||
* [Auto-indent pasted text](#auto-indent-pasted-text)
|
* [Auto-indent pasted text](#auto-indent-pasted-text)
|
||||||
* [Text manipulation commands](#text-manipulation-commands)
|
* [Text manipulation commands](#text-manipulation-commands)
|
||||||
* [Text insertion commands](#text-insertion-commands)
|
* [Text insertion commands](#text-insertion-commands)
|
||||||
* [Commenting](#commenting)
|
* [Commenting](#commenting)
|
||||||
* [Multi-Encodings](#multi-encodings)
|
* [Multi-Encodings](#multi-encodings)
|
||||||
* [Errors handling](#errors-handling)
|
* [Errors handling](#errors-handling)
|
||||||
* [Managing projects](#managing-projects)
|
* [Managing projects](#managing-projects)
|
||||||
* [Achievements](#achievements)
|
* [Achievements](#achievements)
|
||||||
* [issues](#issues)
|
* [issues](#issues)
|
||||||
* [Stars, forks and watchers](#stars-forks-and-watchers)
|
* [Stars, forks and watchers](#stars-forks-and-watchers)
|
||||||
* [Features](#features)
|
* [Features](#features)
|
||||||
* [Awesome ui](#awesome-ui-1)
|
* [Awesome ui](#awesome-ui-1)
|
||||||
* [Mnemonic key bindings](#mnemonic-key-bindings)
|
* [Mnemonic key bindings](#mnemonic-key-bindings)
|
||||||
* [Language specific mode](#language-specific-mode)
|
* [Language specific mode](#language-specific-mode)
|
||||||
* [Key Mapping](#key-mapping)
|
* [Key Mapping](#key-mapping)
|
||||||
* [c/c++ support](#cc-support)
|
* [c/c++ support](#cc-support)
|
||||||
* [go support](#go-support)
|
* [go support](#go-support)
|
||||||
* [python support](#python-support)
|
* [python support](#python-support)
|
||||||
* [Neovim centric - Dark powered mode of SpaceVim.](#neovim-centric---dark-powered-mode-of-spacevim)
|
* [Neovim centric - Dark powered mode of SpaceVim.](#neovim-centric---dark-powered-mode-of-spacevim)
|
||||||
* [Modular configuration](#modular-configuration)
|
* [Modular configuration](#modular-configuration)
|
||||||
* [Multiple leader mode](#multiple-leader-mode)
|
* [Multiple leader mode](#multiple-leader-mode)
|
||||||
* [Global origin vim leader](#global-origin-vim-leader)
|
* [Global origin vim leader](#global-origin-vim-leader)
|
||||||
* [Local origin vim leader](#local-origin-vim-leader)
|
* [Local origin vim leader](#local-origin-vim-leader)
|
||||||
* [Windows function leader](#windows-function-leader)
|
* [Windows function leader](#windows-function-leader)
|
||||||
* [Unite work flow leader](#unite-work-flow-leader)
|
* [Unite work flow leader](#unite-work-flow-leader)
|
||||||
* [Unite centric work-flow](#unite-centric-work-flow)
|
* [Unite centric work-flow](#unite-centric-work-flow)
|
||||||
* [Plugin Highlights](#plugin-highlights)
|
* [Plugin Highlights](#plugin-highlights)
|
||||||
* [Non Lazy-Loaded Plugins](#non-lazy-loaded-plugins)
|
* [Non Lazy-Loaded Plugins](#non-lazy-loaded-plugins)
|
||||||
* [Lazy-Loaded Plugins](#lazy-loaded-plugins)
|
* [Lazy-Loaded Plugins](#lazy-loaded-plugins)
|
||||||
* [Language](#language)
|
* [Language](#language)
|
||||||
* [Commands](#commands)
|
* [Commands](#commands)
|
||||||
* [Commands](#commands-1)
|
* [Commands](#commands-1)
|
||||||
* [Completion](#completion-1)
|
* [Completion](#completion-1)
|
||||||
* [Unite](#unite)
|
* [Unite](#unite)
|
||||||
* [Operators & Text Objects](#operators--text-objects)
|
* [Operators & Text Objects](#operators--text-objects)
|
||||||
* [Custom Key bindings](#custom-key-bindings)
|
* [Custom Key bindings](#custom-key-bindings)
|
||||||
* [File Operations](#file-operations)
|
* [File Operations](#file-operations)
|
||||||
* [Editor UI](#editor-ui)
|
* [Editor UI](#editor-ui)
|
||||||
* [Window Management](#window-management)
|
* [Window Management](#window-management)
|
||||||
* [Native functions](#native-functions)
|
* [Native functions](#native-functions)
|
||||||
* [Plugin: Unite](#plugin-unite)
|
* [Plugin: Unite](#plugin-unite)
|
||||||
* [Plugin: neocomplete](#plugin-neocomplete)
|
* [Plugin: neocomplete](#plugin-neocomplete)
|
||||||
* [Plugin: NERD Commenter](#plugin-nerd-commenter)
|
* [Plugin: NERD Commenter](#plugin-nerd-commenter)
|
||||||
* [Plugin: Goyo and Limelight](#plugin-goyo-and-limelight)
|
* [Plugin: Goyo and Limelight](#plugin-goyo-and-limelight)
|
||||||
* [Plugin: ChooseWin](#plugin-choosewin)
|
* [Plugin: ChooseWin](#plugin-choosewin)
|
||||||
* [Plugin: Bookmarks](#plugin-bookmarks)
|
* [Plugin: Bookmarks](#plugin-bookmarks)
|
||||||
* [Plugin: Gina/Gita](#plugin-ginagita)
|
* [Plugin: Gina/Gita](#plugin-ginagita)
|
||||||
* [Plugin: vim-signify](#plugin-vim-signify)
|
* [Plugin: vim-signify](#plugin-vim-signify)
|
||||||
* [Misc Plugins](#misc-plugins)
|
* [Misc Plugins](#misc-plugins)
|
||||||
|
|
||||||
<!-- vim-markdown-toc -->
|
<!-- vim-markdown-toc -->
|
||||||
|
|
||||||
@ -848,7 +848,7 @@ SpaceVim use vimfiler as the default file tree, and the default key binding is `
|
|||||||
let g:spacevim_filemanager = 'nerdtree'
|
let g:spacevim_filemanager = 'nerdtree'
|
||||||
```
|
```
|
||||||
|
|
||||||
VCS integration is supported, there will be a colum status, this feature maybe make vimfiler slow, so it is not enabled by default. to enable this feature, add `let g:spacevim_enable_vimfiler_gitstatus = 1` to your custom config. here is any picture for this feature:
|
VCS integration is supported, there will be a column status, this feature maybe make vimfiler slow, so it is not enabled by default. to enable this feature, add `let g:spacevim_enable_vimfiler_gitstatus = 1` to your custom config. here is any picture for this feature:
|
||||||
|
|
||||||
![file-tree](https://user-images.githubusercontent.com/13142418/26881817-279225b2-4bcb-11e7-8872-7e4bd3d1c84e.png)
|
![file-tree](https://user-images.githubusercontent.com/13142418/26881817-279225b2-4bcb-11e7-8872-7e4bd3d1c84e.png)
|
||||||
|
|
||||||
@ -1196,7 +1196,7 @@ Text related commands (start with `x`):
|
|||||||
| `SPC x a L` | right-align with evil-lion (TODO) |
|
| `SPC x a L` | right-align with evil-lion (TODO) |
|
||||||
| `SPC x a r` | align region using user-specified regexp (TODO) |
|
| `SPC x a r` | align region using user-specified regexp (TODO) |
|
||||||
| `SPC x a m` | align region at arithmetic operators `(+-*/)` (TODO) |
|
| `SPC x a m` | align region at arithmetic operators `(+-*/)` (TODO) |
|
||||||
| `SPC x c` | cunt the number of chars/words/lines in the selection region |
|
| `SPC x c` | count the number of chars/words/lines in the selection region |
|
||||||
| `SPC x d w` | delete trailing whitespaces |
|
| `SPC x d w` | delete trailing whitespaces |
|
||||||
| `SPC x d SPC` | Delete all spaces and tabs around point, leaving one space |
|
| `SPC x d SPC` | Delete all spaces and tabs around point, leaving one space |
|
||||||
| `SPC x g l` | set lanuages used by translate commands (TODO) |
|
| `SPC x g l` | set lanuages used by translate commands (TODO) |
|
||||||
|
@ -5,7 +5,7 @@ title: "Home"
|
|||||||
# Introduction
|
# Introduction
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
|
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
|
||||||
![Version](https://img.shields.io/badge/version-0.4.0--dev-FF00CC.svg)
|
![Version](https://img.shields.io/badge/version-0.5.0--dev-FF00CC.svg)
|
||||||
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/SpaceVim/SpaceVim/dev/LICENSE)
|
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/SpaceVim/SpaceVim/dev/LICENSE)
|
||||||
[![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg?style=flat-square)](https://raw.githubusercontent.com/SpaceVim/SpaceVim/dev/doc/SpaceVim.txt)
|
[![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg?style=flat-square)](https://raw.githubusercontent.com/SpaceVim/SpaceVim/dev/doc/SpaceVim.txt)
|
||||||
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/SpaceVim/SpaceVim.svg)](http://isitmaintained.com/project/SpaceVim/SpaceVim "Average time to resolve an issue")
|
[![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")
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
# Reset
|
# Reset
|
||||||
Color_off='\033[0m' # Text Reset
|
Color_off='\033[0m' # Text Reset
|
||||||
Version='0.4.0-dev'
|
Version='0.5.0-dev'
|
||||||
|
|
||||||
# Regular Colors
|
# Regular Colors
|
||||||
Red='\033[0;31m'
|
Red='\033[0;31m'
|
||||||
|
@ -44,17 +44,18 @@ call SpaceVim#layers#load('autocomplete')
|
|||||||
|
|
||||||
You can customize the user experience of auto-completion with the following layer variables:
|
You can customize the user experience of auto-completion with the following layer variables:
|
||||||
|
|
||||||
1. `auto-completion-return-key-behavior` set the action to perform when the `RET` key is pressed, the possible values are:
|
1. `auto-completion-return-key-behavior` set the action to perform when the `Return`/`Enter` key is pressed, the possible values are:
|
||||||
|
|
||||||
- `complete` completes with the current selection
|
- `complete` completes with the current selection
|
||||||
- `nil` does nothing
|
- `smart` completes with current selection and expand snippet or argvs
|
||||||
|
- `nil`
|
||||||
|
|
||||||
2. `auto-completion-tab-key-behavior` set the action to perform when the `TAB` key is pressed, the possible values are:
|
2. `auto-completion-tab-key-behavior` set the action to perform when the `TAB` key is pressed, the possible values are:
|
||||||
|
|
||||||
- `smart` cycle candidates, expand snippets, jump parameters
|
- `smart` cycle candidates, expand snippets, jump parameters
|
||||||
- `complete` completes with the current selection
|
- `complete` completes with the current selection
|
||||||
- `cycle` completes the common prefix and cycle between candidates
|
- `cycle` completes the common prefix and cycle between candidates
|
||||||
- `nil` does nothing
|
- `nil` insert a carriage return
|
||||||
|
|
||||||
3. `auto-completion-complete-with-key-sequence` is a string of two characters denoting a key sequence that will perform a `complete` action if the sequence as been entered quickly enough. If its value is `nil` then the feature is disabled.
|
3. `auto-completion-complete-with-key-sequence` is a string of two characters denoting a key sequence that will perform a `complete` action if the sequence as been entered quickly enough. If its value is `nil` then the feature is disabled.
|
||||||
4. `auto-completion-complete-with-key-sequence-delay` is the number of seconds to wait for the auto-completion key sequence to be entered. The default value is 0.1 seconds.
|
4. `auto-completion-complete-with-key-sequence-delay` is the number of seconds to wait for the auto-completion key sequence to be entered. The default value is 0.1 seconds.
|
||||||
@ -98,13 +99,13 @@ call SpaceVim#layers#load('autocomplete', {
|
|||||||
|
|
||||||
### auto-complete
|
### auto-complete
|
||||||
|
|
||||||
| Key bindings | Description |
|
| Key bindings | Description |
|
||||||
| ------------ | -------------------------------------------------------------------- |
|
| ------------ | --------------------------------------------- |
|
||||||
| `<C-n>` | select next candidate |
|
| `<C-n>` | select next candidate |
|
||||||
| `<C-p>` | select previous candidate |
|
| `<C-p>` | select previous candidate |
|
||||||
| `<Tab>` | expand selection or select next candidate |
|
| `<Tab>` | base on `auto-completion-tab-key-behavior` |
|
||||||
| `<S-Tab>` | select previous candidate |
|
| `<S-Tab>` | select previous candidate |
|
||||||
| `<Return>` | complete word, if word is already completed insert a carriage return |
|
| `<Return>` | base on `auto-completion-return-key-behavior` |
|
||||||
|
|
||||||
### Neosnippet
|
### Neosnippet
|
||||||
|
|
||||||
@ -112,4 +113,3 @@ call SpaceVim#layers#load('autocomplete', {
|
|||||||
| ----------- | -------------------------------------------------------------- |
|
| ----------- | -------------------------------------------------------------- |
|
||||||
| `M-/` | Expand a snippet if text before point is a prefix of a snippet |
|
| `M-/` | Expand a snippet if text before point is a prefix of a snippet |
|
||||||
| `SPC i s` | List all current yasnippets for inserting |
|
| `SPC i s` | List all current yasnippets for inserting |
|
||||||
|
|
||||||
|
8
syntax/HelpDescribe.vim
Normal file
8
syntax/HelpDescribe.vim
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:current_syntax = "HelpDescribe"
|
||||||
|
syntax case ignore
|
||||||
|
syn match FileName /[^:]*:\d\+:/
|
||||||
|
|
||||||
|
hi def link FileName Comment
|
Loading…
Reference in New Issue
Block a user