SpaceVim -Like spacemacs, but for vim. 一个模块化载入的配置集合,目标是适合各种语言开发。

2016-12-30 19:58:54 +08:00
 wsdjeg

SpaceVim 项目 地址 https://github.com/SpaceVim/SpaceVim

Like spacemacs, but for vim.

Features

Structure

Installl

 mv ~/.vimrc ~/.vimrc_bak
 mv ~/.vim ~/.vim_bak
 git clone https://github.com/SpaceVim/SpaceVim.git ~/.vim
 git clone https://github.com/SpaceVim/SpaceVim.git ~/.config/nvim

Modular configuration

SpaceVim will load custom configuration from ~/.local.vim, here is an example:

" here are some basic customizations, please refer to the top of the vimrc file for all possible options
let g:settings.default_indent = 3
let g:settings.max_column     = 80
let g:settings.colorscheme    = 'my_awesome_colorscheme'
let g:settings.plugin_manager = 'dein'  " neobundle or dein or vim-plug

" change the default directory where all miscellaneous persistent files go
let g:settings.cache_dir = "/some/place/else"

" by default, language specific plugins are not loaded.  this can be changed with the following:
let g:settings.plugin_groups_exclude = ['ruby', 'python']

" if there are groups you want always loaded, you can use this:
let g:settings.plugin_groups_include = ['go']

" alternatively, you can set this variable to load exactly what you want
let g:settings.plugin_groups = ['core', 'web']

" if there is a particular plugin you don't like, you can define this variable to disable them entirely
let g:settings.disabled_plugins=['vim-foo', 'vim-bar']

" anything defined here are simply overrides
set wildignore+=\*/node_modules/\*
set guifont=Wingdings:h10

Unite centric work-flow

Plugin Highlights

Note that 90% of the plugins are [lazy-loaded]. [lazy-loaded]: ./config/plugins.vim

Non Lazy-Loaded Plugins

Name | Description -------------- | ---------------------- [dein.vim] | Dark powered Vim/Neovim plugin manager [vimproc] | Interactive command execution [colorschemes] | Awesome color-schemes [file-line] | Allow opening a file in a given line [neomru] | MRU source for Unite [cursorword] | Underlines word under cursor [gitbranch] | Lightweight git branch detection [gitgutter] | Shows git diffs in the gutter [tinyline] | Tiny great looking statusline [tagabana] | Central location for all tags [bookmarks] | Bookmarks, works independently from vim marks [tmux-navigator] | Seamless navigation between tmux panes and vim splits

Lazy-Loaded Plugins

Language

Name | Description -------------- | ---------------------- [html5] | HTML5 omnicomplete and syntax [mustache] | Mustache and handlebars syntax [markdown] | Markdown syntax highlighting [ansible-yaml] | Additional support for Ansible [jinja] | Jinja support in vim [less] | Syntax for LESS [css3-syntax] | CSS3 syntax support to vim's built-in syntax/css.vim [csv] | Handling column separated data [pep8-indent] | Nicer Python indentation [logstash] | Highlights logstash configuration files [tmux] | vim plugin for tmux.conf [json] | Better JSON support [toml] | Syntax for TOML [i3] | i3 window manager config syntax [Dockerfile] | syntax and snippets for Dockerfile [go] | Go development [jedi-vim] | Python jedi autocompletion library [ruby] | Ruby configuration files [portfile] | Macports portfile configuration files [javascript] | Enhanced Javascript syntax [javascript-indent] | Javascript indent script [tern] | Provides Tern-based JavaScript editing support [php] | Up-to-date PHP syntax file [phpfold] | PHP folding [phpcomplete] | Improved PHP omnicompletion [phpindent] | PHP official indenting [phpspec] | PhpSpec integration

Commands

Name | Description -------------- | ---------------------- [vimfiler] | Powerful file explorer [tinycomment] | Robust but light-weight commenting [vinarise] | Hex editor [syntastic] | Syntax checking hacks [gita] | An awesome git handling plugin [gista] | Manipulate gists in Vim [undotree] | Ultimate undo history visualizer [incsearch] | Improved incremental searching [expand-region] | Visually select increasingly larger regions of text [open-browser] | Open URI with your favorite browser [prettyprint] | Pretty-print vim variables [quickrun] | Run commands quickly [ref] | Integrated reference viewer [dictionary] | Dictionary.app interface [vimwiki] | Personal Wiki for Vim [thesaurus] | Look up words in an online thesaurus

Commands

Name | Description -------------- | ---------------------- [goyo] | Distraction-free writing [limelight] | Hyperfocus-writing [matchit] | Intelligent pair matching [indentline] | Display vertical indention lines [choosewin] | Choose window to use, like tmux's 'display-pane'

Completion

Name | Description -------------- | ---------------------- [delimitmate] | Insert mode auto-completion for quotes, parens, brackets [echodoc] | Print objects' documentation in echo area [deoplete] | Neovim: Dark powered asynchronous completion framework [neocomplete] | Next generation completion framework [neosnippet] | Contains neocomplete snippets source

Unite

Name | Description -------------- | ---------------------- [unite] | Unite and create user interfaces [unite-colorscheme] | Browse colorschemes [unite-filetype] | Select file type [unite-history] | Browse history of command/search [unite-build] | Build with Unite interface [unite-outline] | File "outline" source for unite [unite-tag] | Tags source for Unite [unite-quickfix] | Quickfix source for Unite [neossh] | SSH interface for plugins [unite-pull-request] | GitHub pull-request source for Unite [junkfile] | Create temporary files for memo and testing [unite-issue] | Issue manager for JIRA and GitHub

Operators & Text Objects

Name | Description -------------- | ---------------------- [operator-user] | Define your own operator easily [operator-replace] | Operator to replace text with register content [operator-surround] | Operator to enclose text objects [textobj-user] | Create your own text objects [textobj-multiblock] | Handle multiple brackets objects

Custom Key bindings

Key | Mode | Action ----- |:----:| ------------------ <leader>+y | Normal/visual | Copy selection to X11 clipboard ("+y) <leader>+p | Normal/visual | Paste selection from X11 clipboard ("+p) Ctrl+f | Normal | Smart page forward (C-f/C-d) Ctrl+b | Normal | Smart page backwards (C-b/C-u) Ctrl+e | Normal | Smart scroll down (3C-e/j) Ctrl+y | Normal | Smart scroll up (3C-y/k) Ctrl+q | Normal | Ctrl+w Ctrl+x | Normal | Switch buffer and placement Up,Down | Normal | Smart up and down } | Normal | After paragraph motion go to first non-blank char (}^) < | Visual/Normal | Indent to left and re-select > | Visual/Normal | Indent to right and re-select Tab | Visual | Indent to right and re-select Shift+Tab | Visual | Indent to left and re-select gp | Normal | Select last paste Q/gQ | Normal | Disable EX-mode (<nop>) Ctrl+a | Command | Navigation in command line Ctrl+b | Command | Move cursor backward in command line Ctrl+f | Command | Move cursor forward in command line

File Operations

Key | Mode | Action ----- |:----:| ------------------ <leader>+cd | Normal | Switch to the root directory(vim-rooter) <leader>+w | Normal/visual | Write (:w) Ctrl+s | All | Write (:w) W!! | Command | Write as root

Editor UI

Key | Mode | Action ----- |:----:| ------------------ F2 | All | Toggle tagbar F3 | All | Toggle Vimfiler <leader>+ts | Normal | Toggle spell-checker (:setlocal spell!) <leader>+tn | Normal | Toggle line numbers (:setlocal nonumber!) <leader>+tl | Normal | Toggle hidden characters (:setlocal nolist!) <leader>+th | Normal | Toggle highlighted search (:set hlsearch!) <leader>+tw | Normal | Toggle wrap (:setlocal wrap! breakindent!) g0 | Normal | Go to first tab (:tabfirst) g$ | Normal | Go to last tab (:tablast) gr | Normal | Go to preview tab (:tabprevious) Ctrl+<Dow> | Normal | Move to split below (<c-w>j) Ctrl+<Up> | Normal | Move to upper split (<c-w>k) Ctrl+<Left> | Normal | Move to left split (<c-w>h) Ctrl+<Right> | Normal | Move to right split (<c-w>l) * | Visual | Search selection forwards # | Visual | Search selection backwards ,+Space | Normal | Remove all spaces at EOL Ctrl+r | Visual | Replace selection <leader>+lj | Normal | Next on location list <leader>+lk | Normal | Previous on location list <leader>+S | Normal/visual | Source selection

Window Management

Key | Mode | Action ----- |:----:| ------------------ q | Normal | Smart buffer close s+p | Normal | Split nicely s+v | Normal | :split s+g | Normal | :vsplit s+t | Normal | Open new tab (:tabnew) s+o | Normal | Close other windows (:only) s+x | Normal | Remove buffer, leave blank window s+q | Normal | Closes current buffer (:close) s+Q | Normal | Removes current buffer (:bdelete) Tab | Normal | Next window or tab Shift+Tab | Normal | Previous window or tab <leader>+sv | Normal | Split with previous buffer <leader>+sg | Normal | Vertical split with previous buffer

Plugin: Unite

Key | Mode | Action ----- |:----:| ------------------ ;+r | Normal | Resumes Unite window ;+f | Normal | Opens Unite file recursive search ;+i | Normal | Opens Unite git file search ;+g | Normal | Opens Unite grep with ag (the_silver_searcher) ;+u | Normal | Opens Unite source ;+t | Normal | Opens Unite tag ;+T | Normal | Opens Unite tag/include ;+l | Normal | Opens Unite location list ;+q | Normal | Opens Unite quick fix ;+e | Normal | Opens Unite register ;+j | Normal | Opens Unite jump, change ;+h | Normal | Opens Unite history/yank ;+s | Normal | Opens Unite session ;+o | Normal | Opens Unite outline ;+ma | Normal | Opens Unite mapping ;+me | Normal | Opens Unite output messages <leader>+b | Normal | Opens Unite buffers, mru, bookmark <leader>+ta | Normal | Opens Unite tab <leader>+gf | Normal | Opens Unite file with word at cursor <leader>+gt | Normal/visual | Opens Unite tag with word at cursor <leader>+gg | Visual | Opens Unite navigate with word at cursor | Within Unite buffers ||| Ctrl+h/k/l/r | Normal | Un-map Ctrl+r | Normal | Redraw Ctrl+j | Insert | Select next line Ctrl+k | Insert | Select previous line ' | Normal | Toggle mark current candidate, up e | Normal | Run default action Ctrl+v | Normal | Open in a split Ctrl+s | Normal | Open in a vertical split Ctrl+t | Normal | Open in a new tab Tab | Normal | Ctrl+w+w Escape | Normal | Exit unite jj | Insert | Leave Insert mode r | Normal | Replace ('search' profile) or rename Tab | Insert | Unite autocompletion Ctrl+z | Normal/insert | Toggle transpose window Ctrl+w | Insert | Delete backward path

Plugin: VimFiler

Key | Mode | Action ----- |:----:| ------------------ ;+e | Normal | Toggle file explorer ;+a | Normal | Toggle file explorer on current file | Within VimFiler buffers ||| Ctrl+j | Normal | Un-map Ctrl+l | Normal | Un-map E | Normal | Un-map sv | Normal | Split edit sg | Normal | Vertical split edit p | Normal | Preview i | Normal | Switch to directory history Ctrl+r | Normal | Redraw Ctrl+q | Normal | Quick look

Plugin: neocomplete

Key | Mode | Action ----- |:----:| ------------------ Enter | Insert | Smart snippet expansion Ctrl+space | Insert | Autocomplete with Unite Tab | Insert/select | Smart tab movement or completion Ctrl+j/k/f/b | Insert | Movement in popup Ctrl+g | Insert | Undo completion Ctrl+l | Insert | Complete common string Ctrl+o | Insert | Expand snippet Ctrl+y | Insert | Close pop-up Ctrl+e | Insert | Close pop-up Ctrl+l | Insert | Complete common string Ctrl+d | Insert | Scroll down Ctrl+u | Insert | Scroll up

Plugin: TinyComment

Key | Mode | Action ----- |:----:| ------------------ <leader>+v | Normal/visual | Toggle single-line comments <leader>+V | Normal/visual | Toggle comment block

Plugin: Goyo and Limelight

Key | Mode | Action ----- |:----:| ------------------ <leader>+G | Normal | Toggle distraction-free writing

Plugin: ChooseWin

Key | Mode | Action ----- |:----:| ------------------ - | Normal | Choose a window to edit <leader>+- | Normal | Switch editing window with selected

Plugin: Bookmarks

Key | Mode | Action ----- |:----:| ------------------ m+a | Normal | Show list of all bookmarks m+m | Normal | Toggle bookmark in current line m+n | Normal | Jump to next bookmark m+p | Normal | Jump to previous bookmark m+i | Normal | Annotate bookmark

Plugin: Gita

Key | Mode | Action ----- |:----:| ------------------ <leader>+gs | Normal | Git status <leader>+gd | Normal | Git diff <leader>+gc | Normal | Git commit <leader>+gb | Normal | Git blame <leader>+gB | Normal | Open in browser <leader>+gp | Normal | Git push

Plugin: GitGutter

Key | Mode | Action ----- |:----:| ------------------ <leader>+hj | Normal | Jump to next hunk <leader>+hk | Normal | Jump to previous hunk <leader>+hs | Normal | Stage hunk <leader>+hr | Normal | Revert hunk <leader>+hp | Normal | Preview hunk

Misc Plugins

Key | Mode | Action ----- |:----:| ------------------ <leader>+gu | Normal | Open undo tree <leader>+i | Normal | Toggle indentation lines <leader>+j | Normal | Start smalls <leader>+r | Normal | Quickrun <leader>+? | Normal | Dictionary <leader>+W | Normal | Wiki <leader>+K | Normal | Thesaurus

Enjoy!

2986 次点击
所在节点    Vim
2 条回复
ashfinal
2016-12-30 22:53:33 +08:00
还以为是那谁又发了一遍……

也发一下我的配置(万一有人看上我呢): https://github.com/ashfinal/vimrc-config
就一个 .vimrc 文件,主要特点是好看。其它自行去发现吧~

排版还是要兼顾一下啊,亲。
其实我觉得应该从用户使用场景角度写个文档,然而我自己都还没写……

| Key | Mode | Action |
|:--------------------|:--------------:|:----------------------------------------|
| `<BS>` | Normal | unhighlight the search result |
| `yo` | Normal | yankonce set paste option when done |
| `<Shift>` + `<Tab>` | Normal | switch to next buffer |
| `<Ctrl>` + `a` | Command/Insert | move the cursor to the begining of line |
| `<Ctrl>` + `e` | Command/Insert | move the cursor to the end of line |
| `<Ctrl>` + `h` | Command/Insert | move the cursor left by word |
| `<Ctrl>` + `l` | Command/Insert | move the cursor right by word |
| `<Ctrl>` + `b` | Insert | move the cursor left by char |
| `<Ctrl>` + `f` | Insert | move the cursor right by char |
| `<Ctrl>` + `j` | Insert | move the cursor down by line |
| `<Ctrl>` + `k` | Insert | move the cursor up by line |
| `<Ctrl>` + `j` | Visual | move the current line downward |
| `<Ctrl>` + `k` | Visual | move the current line upward |
| `<Ctrl>` + `h` | Normal | resize the current split window |
| `<Ctrl>` + `l` | Normal | resize the current split window |
| `<Ctrl>` + `j` | Normal | resize the current split window |
| `<Ctrl>` + `k` | Normal | resize the current split window |
ashfinal
2016-12-30 22:54:17 +08:00
看来表格果然会错乱掉 。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/331328

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX