• Stars
    star
    109
  • Rank 317,184 (Top 7 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Spacemacs for Neovim—link to layers 👉

SpaceNeovim - Spacemacs for Neovim Build Status

SpaceNeovim is Spacemacs for Neovim. If you are unfamiliar with Spacemacs, you can read more about the motivation behind that on their website.

Screenshot of SpaceNeovim

Installation

Prerequisites:

  • git on your path (brew install git)
  • nvim on your path (brew install neovim/neovim --head)
  • Neovim python bindings (pip install neovim or pip3)

SpaceNeovim is a configurable distribution like Spacemacs.

To start using SpaceNeovim you can use the following oneliner,

sh -c "$(curl -fsSL https://raw.githubusercontent.com/tehnix/spaceneovim/master/install.sh)"

It will,

  • Backup existing Neovim configuration to .config/nvim.<date>.backup
  • Download a default init.vim
  • Download autoload/spaceneovim.vim
  • Set up vim-plug
  • Clone down the layers repository
  • Install default plugins

You can check out the process in the Asciicast below,

asciicast

Layers

Go to the layers repository for more information on the different layers.

To enable a layer, include it inside the Layers() function, by calling Layer '<layer name>'. A small example,

function! Layers()
  " Configuration Layers declaration.
  " Add layers with `Layer '+layername'` and add individual packages
  " with `ExtraPlugin 'githubUser/Repo'`.

  Layer '+core/behavior'
  Layer '+nav/buffers'
  Layer ...

  PrivateLayer '+lang/elm'

  ExtraPlugin 'liuchengxu/space-vim-dark'
  ExtraPlugin 'neovimhaskell/haskell-vim', { 'for': 'haskell' }
endfunction

The above also demonstrates ExtraPlugin, which will install plugins with vim-plug. The configuration is optional.

Private Layers

If you want to manage your own layers, you can put them into .config/nvim/spaceneovim-layers/private/ and load them like normal layers, except using PrivateLayer instead. E.g. PrivateLayer '+lang/elm'.

Configuration

To set configuration values before layers and plugins load, set them in your UserInit(),

function! UserInit()
  " This block is called at the very startup of Spaceneovim initialization
  " before layers configuration.

  " Overwrite the leader key,
  SetLeader '<Space>'
  " Overwrite the layers repository,
  SetLayerRepo '[email protected]:Tehnix/spaceneovim-layers.git'
endfunction

To set configuration values after layers and plugins load, set them in your UserConfig(),

function! UserConfig()
  " This block is called after Spaceneovim layers are configured.

  " This will set the background to 'dark', the theme to 'space-vim-dark' and the airline theme to 'violet' (airline argument is optional).
  SetThemeWithBg 'dark', 'space-vim-dark', 'violet'
  " Alternatively, if you don't want to set the background, use,
  SetTheme 'space-vim-dark', 'violet'
endfunction

The above SetTheme <background color> <theme name> <airline theme> is simply a convenience function. Similarly SetLeader allows you to set the key that activates vim-leader.

Developing

If you want to know what happens in autoload/spaceneovim.vim, check out the beginning of the file for a brief introduction into what is going on in the script.

To easily test your changes it is recommended to symlink the various files into your .config/nvim folder. The ones you want to replace are

  • .config/nvim/spaceneovim-layers to test layer changes
  • .config/nvim/autoload/spaceneovim.vim to test core changes
  • .config/nvim/init.vim to test changes to vimrc.sample.vim

Using your own layer repository

If you want to develop/test out your own layers, there are four ways to do it:

  1. Add your layer in .config/nvim/spaceneovim-layers/private/ and load them via PrivateLayer.
  2. Point to your own git repository with SetLayerRepo, e.g. SetLayerRepo '[email protected]:Tehnix/spaceneovim-layers.git'. This should be set in UserInit().
  3. Manage the spaceneovim-layers directory yourself - the bootstrap process basically just checks if the directory exists, and if not it clones it down. Symlinking or putting in your own directory here will also work.
  4. Add a layer from a specific folder on your computer with SourcedLayer, for example SourcedLayer '/Users/myuser/.config/mylayers' '+cool/layer'.

Enable Debugging

You can enable debugging output by calling EnableDebug (or EnableVerboseDebug) in your init.vim file. This should be set in UserInit().

Pre commit linting

It is recommended to add the following to .git/hooks/pre-commit,

# Get the current dir
startDir=$(pwd)
# Get the project root
rootDir=$(git rev-parse --show-toplevel)

cd $rootDir

# Run vint
vint vimrc.sample.vim autoload/*.vim

License

See LICENSE.

Troubleshooting

Can't see colors in tmux: This may be a problem with xterm-256 colors, as per issue #16 (thanks zacacollier) add the following your tmux.conf and restert your tmux with tmux kill-server,

set -g default-terminal "tmux-256color"
set -ga terminal-overrides ',xterm-256color:Tc'

LanguageClient:autocmd (and other Python related) errors

Example error: no notification handler registered for "/Users/ramanujam/.config/nvim/plugged/La nguageClient-neovim/rplugin/python3/LanguageClient:autocmd:CursorMoved:*"

Sometimes one of the plugins included might rely on updated Python bindings for Neovim, especially heavily updated, active plugins. Should you be getting Python errors even though you've installed the neovim bindings, update your bindings using:

pip install neovim
pip3 install neovim #python 2 is still default in some MacOS

More Repositories

1

miso-isomorphic-stack

An example of an "isomorphic" Miso server set up with stack
Haskell
44
star
2

spaceneovim-layers

Layers for usage in SpaceNeovim 👉
Vim Script
42
star
3

ide-haskell-hie

Atom LSP plugin for HIE (Haskell IDE Engine)
JavaScript
26
star
4

HsCMS

[UNMAINTAINED] A Yesod/Haskell based CMS
CSS
21
star
5

MobileHaskellFun

Project set up for playing around with mobile haskell
Shell
15
star
6

Cminusminus-compiler

[University] A small step-through debug interpreter for a subset of C
Haskell
9
star
7

atom-haskell

Curated set of Haskell packages for Atom
JavaScript
7
star
8

PyIRCParser

[UNMAINTAINED] A python module for parsing IRC output and returning it in a structured way.
Python
4
star
9

Advent-of-Code

Advent of Code
Haskell
4
star
10

master-thesis

[University] Master thesis "Exploring the use of purely functional programming languages for offloading of mobile computations"
TeX
3
star
11

ghcjs-docker

Docker images based on fpco/stack-build, for using GHCJS
Haskell
3
star
12

playground-spa-elm

Playing around with Elm SPAs and structuring them for larger scale applications
Elm
3
star
13

template-mobile-wasm

Template project for building a Rust application that can be run on Web, iOS and Android using Leptos, Capacitor and UniFFI.
Swift
3
star
14

playground-spa-rust

Playing around with Rust SPAs using Yew, and structuring them for larger scale applications
Rust
2
star
15

vscode-tidymarkdown

VS Code formatter using tidymarkdown
TypeScript
2
star
16

cred-web

[University] Web interface for cred-server application
JavaScript
2
star
17

cred-server

[University] Connected Reactive Electronic Devices
Python
2
star
18

Terminal.js

[UNMAINTAINED] A minimal javascript terminal emulator providing a limited subset of commands
JavaScript
2
star
19

PyIRCb

[UNMAINTAINED] A python based IRC bot
Python
2
star
20

hakyll-frontend

A CMS-like frontend to Hakyll
2
star
21

Heureka

[University] Heureka assignment for the course 02180 Introduction to Artificial Intelligence at DTU
Haskell
2
star
22

Tehnix

A personal "Hello World"!
2
star
23

MySSH

[UNMAINTAINED] MySSH (mssh) - An automated ssh login script in Expect (Tcl)
2
star
24

databaselayer

[UNMAINTAINED] A python database abstraction layer for simplifying working with multiple database types
Python
1
star
25

playground-ServHs

Fun with serverless-haskell!
Haskell
1
star
26

yesod-mailchimp-campaigns

UNMAINTAINED Generic site for mail signup campaigns
Haskell
1
star
27

SmartOrders

[University] KAIST CS442 Project
Java
1
star
28

HsIRCb

[UNMAINTAINED] Haskell IRC bot
Haskell
1
star
29

playground-haskell

Fun with various Haskell libraries and techniques
Haskell
1
star
30

template-simple-haskell

A template for a simple Haskell codebase, useful for getting started
Haskell
1
star
31

playground-spa-miso

Playing around with Miso SPAs and structuring them for larger scale applications
Haskell
1
star
32

copy-paste-llvm-pass

[University] Copy/Paste detection LLVM pass
C++
1
star
33

follow-write-you-a-haskell

Code from following http://dev.stephendiehl.com/fun/
Haskell
1
star
34

playground-graphql

Playground to play around with and show GraphQL usage
TypeScript
1
star
35

ProjectEuler

Collection of solved ProjectEuler.net problems
Haskell
1
star
36

HsIRCParser

Haskell IRC Parser
Haskell
1
star
37

CoursePlanner

[UNMAINTAINED] Quickly calculate your ECTS points when visiting the DTU course planner
JavaScript
1
star
38

TheCMS

[UNMAINTAINED] A PHP based CMS
PHP
1
star
39

wp-campusnet-authentication

[UNMAINTAINED] Wordpress Plugin for using Campusnet Authentication as user access restriction.
PHP
1
star