Giter VIP home page Giter VIP logo

hack-spacevim's Introduction

Hack-SpaceVim - Guider for SpaceVim

image Build Status MIT License spacevim-version Average time to resolve an issue Percentage of issues still open


You may want to check issues for the most recent discussions.

1. Introduction

What can you get from Hack-SpaceVim
  • 🤘 Introductions about how to install SpaceVim with step by step

  • :trollface: Set up developing environments very fast

  • 😎 Become a developer very quickly

  • 💆‍♀️ Help you get acquainted with mountains of plugins

  • 💪 Make you a professional vimmer

  • 🌚 Let you hack this planet with SpaceVim

  • 😱 Tell you some facts somebody else won’t tell you

  • 😏 Tricks you will never know(contradictory statements)

3. FAQ

  1. init.toml or init.vim?

    TL;DR: Choose init.vim. Don’t use init.toml.
    Long answer: Here are several reasons for this:

    • SpaceVim doesn’t provide detailed documents of variable name you can use. Under this circumstance, it is not smart to use init.toml although SpaceVim recommand you to use toml-style config.

    • You need nobody to tell you what variable name you can use in your vim script, just by looking up the source code of SpaceVim.

    • For beginner: Toml-style of config won’t help you develop skills related with vim script.

    • In order to define your custom code/functions, you have to use bootstrap functions. You will then pollute SpaceVim’s source code.

  2. What does Hack-SpaceVim really do?

    Currently, it is trying to be something really useful to whom wants to master or use SpaceVim, including various aspects. Not just SpaceVim, but also vim/nvim.

4. Contributors

Made with contributors-img.

5. Reference

New to Vim: vim-galore

hack-spacevim's People

Contributors

de-sh avatar dev-itsheng avatar gabirel avatar jgogstad avatar mistatwista avatar myfairsyer avatar timlzh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hack-spacevim's Issues

[Question] How to change layer options using init.vim

I'm trying to configure my spacevim using init.vim instead of init.toml. I was wondering tho how can I set the layers options tho.

For example I wanted to change the shell position to be at the bottom instead at the top. With a little bit of digging into the source code of SpaceVim I tried the following:

call SpaceVim#layers#shell#set_variable(['terminal', 'bottom', 30, 1])

The above function is located at .SpaceVim/autoload/SpaceVim/layers/shell.vim at the line 138

That only resulted on opening the shell at the right side instead of the bottom.

Any ideas on how to change the my shell to open the way I intend it to and how can I set layer options on init.vim ?

Disable conceal/rendering in latex

Disable conceal in latex

You may see some rendering issues in your latex files or you just want to use the original plain "text", add the code below into your init.vim

" See: http://vimdoc.sourceforge.net/htmldoc/syntax.html#g:tex_conceal
" Disable all conceal
let g:tex_conceal = ""
" Only disable math and superscripts/subscripts
let g:tex_conceal = "adg"

Explanation:

a = accents/ligatures
d = delimiters
m = math symbols
g = Greek
s = superscripts/subscripts

Reference

Disable mouse-using in SpaceVim

Disable mouse-using in SpaceVim

Introduction

Some just doesn't like mouse-using in vim. But SpaceVim enables it by default.

You can see details in :h mouse

How to disable it?

set mouse=

BTW, you can enable it by set mouse=a or by deleting your config about mouse since SpaceVim has default value.

Possible best practice in LaTeX

This practice only represents my personal opinion when using SpaceVim.

Mechanism: Latex Support + SpaceVim + CoC + Layer Latex(inside SpaceVim, mainly vimtex) + coc-texlab + Texlab + PDF viewer

Overview

  • Installation
  • SpaceVim Settings
  • CoC Settings
  • Preview
  • Conceal
  • More settings for latex layer

Installation

SpaceVim Settings

In order to enable latex support, we should complete these steps:

  • let SpaceVim install coc for you
  • let coc install coc-texlab
  • enable latex layer

Add these configs into your ~/SpaceVim.d/init.vim to make the aforementioned steps to complete:

" Use coc to auto complete
let g:spacevim_autocomplete_method = 'coc'

" Enable layer: latex
call SpaceVim#layers#load('lang#latex')

" CoC Settings
" {{ coc {{
let g:coc_config_home = '~/.SpaceVim.d/'
let g:coc_global_extensions = [
      \ 'coc-dictionary',
      \ 'coc-word',
      \ 'coc-texlab',
      \ ]
" }} coc }}

If you need full init.vim, check dotfiles for more information.

CoC Settings

  • enable latex support
  • adjust texlab binary path
  • enable texlab to build for us automatically

Add these config into your ~/SpaceVim.d/coc-settings.json

{
  "languageserver": {
    "latex": {
      "command": "/usr/local/bin/texlab",  // put your texlab binary path here
      "filetypes": ["tex", "bib", "plaintex", "context"]
    }
  },
  "texlab.build.onSave": true,
}

Preview

For different PDF viewer, check texlab's previewing documentation for more information.

Personally, I use Skim to forward search on MacOS.
So my settings are updated like this:

{
  "languageserver": {
    "latex": {
      "command": "/usr/local/bin/texlab",
      "filetypes": ["tex", "bib", "plaintex", "context"]
    }
  },
  "coc.source.file.ignoreHidden": false,
  "texlab.build.onSave": true,
  "texlab.build.forwardSearchAfter": true,
  "texlab.forwardSearch.executable": "/Applications/Skim.app/Contents/SharedSupport/displayline",
  "texlab.forwardSearch.args": ["-g", "%l", "%p", "%f"]  //"-g" means I want Skim to stay in the background after executing the forward search
}

Conceal

I really don't like the concealing feature, which makes it hard to write latex.
So, I disable it completely. FYI, check issue-44 for more details.

TL;DR:

let g:vimtex_syntax_conceal_default = 0

More settings for latex layer

Explanation: Latex layer is mainly about vimtex.

  • Disable automatically view since I use texlab with Skim
  • use <leader>v to format paragraph for me
" {{ vimtex {{
" Special setting for latex files
" Use `gggqG` to format long lines in Latex
" Use `gq11j` to wrap the line you're on with the 11 below it
" Use `gqip` or `gqap` to wrap the paragraph
" gg(go to first line), gq(format) to G(the last line)
autocmd FileType tex setlocal colorcolumn=80 textwidth=79 tabstop=2 shiftwidth=2 expandtab
nnoremap <leader>v gqip
" See: http://vimdoc.sourceforge.net/htmldoc/syntax.html#g:tex_conceal
" let g:tex_conceal = "abdg"

" Disable all syntax conceal
let g:vimtex_syntax_conceal_default = 0
" Disable automatic view since I use texlab with skim to preview in background
" personally
let g:vimtex_view_enabled = 0
let g:vimtex_view_automatic = 0
" }} vimtex }}

Add key bindings

I think we must decide which keys to bind for language specified features, such like

  • Fix imports.
  • Show documentation.
  • Show variables usage (in file/in project).
  • Go to previous/next method
  • Go to implementation.
  • Go to type declaration.
  • Go to super class (or method).
  • Go to test class (or method).
  • Rename variable.
  • Fix linter errors.
  • Place breakpoint.
  • Start debugging.
  • Override interface methods.
  • Generate constructor/getter/setter/getter and setter/equals/test method

Once these key mappings are defined, contributors will be able to implement them easily.

Separate out FAQ

The document could become a huge. One Single FAQ will take a lot of pages.

I think it will better if I can separate them.

针对Neovim 使用Spacevim 的一些问题

由于本人刚使用Neovim,在 Neovim 安装SpaceVim遇到了一些问题,希望大神 解决。
1 对于新手 需要一篇详细的 Neovim安装SpaceVim的教程
2 我安装成功之后 无法使用自动补全。后来发现 是Neovim 不支持lua 也不支持python 不知道怎么解决

Linux: Instructions For Installing SpaceVim

We all know installing SpaceVim is very easy.

But some people just don't understand how to install it and what those commands means.

So, how to install Linux is a necessary for those who know nothing about Linux.

Instructions For Installing SpaceVim - OFFLINE

Some people maybe have no connection to the Internet.(Yeah, a lot of people)

So, they need a post to teach them how to install SpaceVim FASTER , SAFELY and OFFLINE, including on Windows and Linux.

vimproc.vim Building

gvim+win7+python3+lua
按照 hackspacevim 的教程安装的,改做的都做了,初次进入gvim,安装插件时,其他插件都是 installing done,但是 vimproc.vim 就显示 *vimproc.vim Building,一直都没有done。build vimproc.vim 还有其他环境要求,还是什么问题

How To Play games in SpaceVim

Preface

Now, SpaceVim only has vim2048 embedded.

You have to wait if you want to play more.

Instructions

  1. Add config into your ~/.SpaceVim.d/init.vim below:
call SpaceVim#layers#load('games')
  1. Open your vim/neovim
    You should see this:
    image

  2. Restart vim, and Press <Space> g 2:

image

image

  1. DONE!
    image

Discussions is OUT!!

For a long time ago, I've been looking forward to the discussions in GitHub. I believe that any documents about vim or SpaceVim is not enough for users to get what they want to know.

The best way for vim users is to use a "system" like StackOverflow. However, StackOverflow is too serious for this small document-like project. Therefore, Discussions can play an important role in this project.

Therefore, I recommend other users could also try to use Discussions in GitHub.

I really want this project could help others learn how to use vim or SpaceVim efficiently and correctly, also, quickly as possible.

PS: I hope this project could accumulate the knowledge provided in Discussions from time to time if Discussions is welcome by others as well.

Good Directory Structure

I want this to have a very good, at least good, directory structure for the search or reference for users.

So, anybody could find what he wants without wasting too much time.

Template of SpaceVim's init.toml & init.vim

This issue is for future use.
location:

  • ~/.SpaceVim.d/init.toml
  • ~/.SpaceVim.d/init.vim(recommended for advanced users)
    NOTE: DO NOT make any changes in ~/.SpaceVim/init.toml or ~/.SpaceVim.d/init.vim.

init.toml could make the source code of SpaceVim dirty so that I personally do not recommend to use it. USE IT AT YOUR OWN RISK!

init.toml

See in: #10 (comment)

init.vim

See in: #10 (comment)

PS: You may want to check my own config file for your convenience: https://github.com/Gabirel/dotfiles/blob/master/.SpaceVim.d/init.vim

Convention For Hack-SpaceVim

  • Pictures will be hosting on Gist-Hack-SpaceVim instead of Hack-SpaceVim
  • Fixed spell: SpaceVim
  • DO NOT ADD / before folder when using relative path in TOC.
    • correct: installation/installation-for-windows.md
    • wrong: /installation/installation-for-windows.md
  • Markdown Lint Rule: Rules.md
  • The first word of English title should be capitalized.
  • Use Asciidoc to avoid wasting time to update TOC.
  • Hack-SpaceVim is where the knowledge aggregation belongs, originating from GitHub issue and GitHub discussion.

IDE for Elixir Developer

That would be super awesome to get process of setting up SpaceVim for Elixir development documented.

Windows: Instructions For Installing SpaceVim

Many people may confused about how to install SpaceVim on Windows.

So, I decide to write an instructions about how to install SpaceVIm on your Windows and make sure I can solve all the problems when installing.

Basic commands or tricks for SpaceVim

Everyone may lose his directions without basic instructions for SpaceVim has a very good UI, which is pretty good, and massive commands embedded. Everybody may get confused when using SpaceVim firstly. Or, you may forgot how to what kind of shortcuts to meet your work.

So, commonly used shortcuts have to get put out to let users know what kind of shortcuts they have to know.

Links before TOC

I just check the readme, the links before the toc makes me confused. the alt text is 中文文档 and English Document, but this link is not http://spacevim.org/documentation/ and http://spacevim.org/cn/documentation/

the resource of SpaceVim is:

  1. SpaceVim's github is for developers
  2. SpaceVim's website and documentation is for users
  3. Hack-SpaceVim's issue is for ask question about how to hack SpaceVim
  4. SpaceVim's issue is for bug report and feature requst

so how about:

SpaceVim | Hack-SpaceVim 中文版 | Ask question | Bug report & Feature request

Add key bindings

I think we must decide which keys to bind for language specified features, such like

  • Fix imports.
  • Show documentation.
  • Show variables usage (in file/in project).
  • Go to previous/next method
  • Go to implementation.
  • Go to type declaration.
  • Go to super class (or method).
  • Go to test class (or method).
  • Rename variable.
  • Fix linter errors.
  • Place breakpoint.
  • Start debugging.
  • Override interface methods.
  • Generate constructor/getter/setter/getter and setter/equals/test method

Once these key mappings are defined, contributors will be able to implement them easily.

Here is how I enable +python and +lua and +python3 in win7

SpaceVim Health checking :

SpaceVim clipboard support check report:
Checking +clipboard:
SUCCEED!
SpaceVim environment check report:
Current progpath: gvim.exe(C:\Program Files\vim80\gvim.exe)
version: 800
OS: Windows
[shell, shellcmdflag, shellslash]: ['C:\Windows\system32\cmd.exe', '/c', 0]
SpaceVim lua support check report:
Checking +lua:
SUCCEED!
SpaceVim python support check report:
Checking +python3:
SUCCEED!
Checking +python:
SUCCEED!

Current version do not support job feature

This is because your version of vim is lower than vim(v7.4.1325).
You have to upgrade your vim to higher version with +job feature.

vim with +job(Higher Version):
vim+job

vim with -job(Lower Version):
vim-job

Thanks @unixcx

Wrong command for installing tern in JS IDE section

In 'en_US/IDE/JavaScript.md' the bash command used to install tern server is pretty confusing as GitHub outputs the MarkDown using the quotation shortcodes:

> cd ~/.cache/vimfiles/repos/github.com/ternjs/tern_for_vim 
> npm install tern

in a single line, I have written a PR to make use of the GitHub version of MarkDown to make it more clear for everyone.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.