mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:40:06 +08:00
Could we add a lang#processing? (#2696)
* 🎁 Add first pass of lang#processing
* Add processing.md
This commit is contained in:
parent
bdb76f152a
commit
0271cd890a
49
autoload/SpaceVim/layers/lang/processing.vim
Normal file
49
autoload/SpaceVim/layers/lang/processing.vim
Normal file
@ -0,0 +1,49 @@
|
||||
"=============================================================================
|
||||
" processing.vim --- SpaceVim lang#processing layer
|
||||
" Copyright (c) 2016-2017 Wang Shidong & Contributors
|
||||
" Author: Russell Bentley < russell.w.bentley at icloud.com >
|
||||
" URL: https://spacevim.org
|
||||
" License: GPLv3
|
||||
"=============================================================================
|
||||
|
||||
""
|
||||
" @section lang#processing, layer-lang-processing
|
||||
" @parentsection layers
|
||||
" This layer is for Processing development:
|
||||
" https://processing.org
|
||||
"
|
||||
" This is based on the work from https://github.com/sophacles/vim-processing
|
||||
"
|
||||
" Requirements:
|
||||
"
|
||||
" 1. You will need a copy of processing-java. The best way to do this is to get a copy of the Processing IDE from https://processing.org/download/
|
||||
"
|
||||
" Once you have it, run it, and then select Tools -> install
|
||||
" "processing-java"
|
||||
"
|
||||
" @subsection Mappings
|
||||
" >
|
||||
" Mode Key Function
|
||||
" -----------------------------------------------
|
||||
" normal SPC l r execute current sketch
|
||||
" <
|
||||
|
||||
function! SpaceVim#layers#lang#processing#plugins() abort
|
||||
let plugins = [
|
||||
\ ['sophacles/vim-processing', { 'on_ft' : 'processing' }],
|
||||
\ ]
|
||||
return plugins
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#layers#lang#processing#config() abort
|
||||
let runner = 'processing-java --force --output=/tmp/vim-processing --sketch=$(pwd)/$(dirname %s) --run'
|
||||
call SpaceVim#plugins#runner#reg_runner('processing', runner)
|
||||
call SpaceVim#mapping#space#regesit_lang_mappings('processing',
|
||||
\ function('s:language_specified_mappings'))
|
||||
endfunction
|
||||
|
||||
function! s:language_specified_mappings() abort
|
||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'r'],
|
||||
\ 'call SpaceVim#plugins#runner#open()', 'execute current file', 1)
|
||||
endfunction
|
||||
|
54
docs/layers/lang/processing.md
Normal file
54
docs/layers/lang/processing.md
Normal file
@ -0,0 +1,54 @@
|
||||
---
|
||||
title: "SpaceVim lang#processing layer"
|
||||
description: "This layer is for working on Processing sketches. It provides sytnax checking and an app runner"
|
||||
---
|
||||
|
||||
# [Available Layers](../../) >> lang#processing
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
- [Description](#description)
|
||||
- [Features](#features)
|
||||
- [Install](#install)
|
||||
- [Layer](#layer)
|
||||
- [Key bindings](#key-bindings)
|
||||
- [Code runner](#code-runner)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
## Description
|
||||
|
||||
This layer is for working on Processing sketches.
|
||||
It builds on top of the existing vim plugin [sophacles/vim-processing](https://github.com/sophacles/vim-processing).
|
||||
|
||||
## Features
|
||||
|
||||
- Syntax highlighting and indent
|
||||
- Run sketches asynchonously
|
||||
|
||||
## Install
|
||||
|
||||
You will need to install the `processing-java` tool.
|
||||
This is best done via the Processing IDE which can be obtained from the [processing website](https://processing.org/download/).
|
||||
Once you have the IDE, you can select Tools -> install "processing-java".
|
||||
|
||||
### Layer
|
||||
|
||||
To use this configuration layer, update custom configuration file with:
|
||||
|
||||
```toml
|
||||
[[layers]]
|
||||
name = "lang#processing"
|
||||
```
|
||||
|
||||
## Key bindings
|
||||
|
||||
| Key bindings | Descriptions |
|
||||
| --------------- | -------------------------------- |
|
||||
| `SPC l r` | Run your sketch |
|
||||
|
||||
### Code runner
|
||||
|
||||
You can build and run your sketch with `SPC l r`.
|
||||
The sketch to run is decided based on the directory of you current buffer.
|
||||
Note that the sketch is run asynchonously, so you are free to continue editing while it is running.
|
Loading…
Reference in New Issue
Block a user