1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 03:00:04 +08:00

feat(layer): add julia code formattor

Problem: can not format julia.
Solution: add custom neoformat configuration for julia
This commit is contained in:
Shidong Wang 2021-10-04 18:49:52 +08:00
parent 2f4a805440
commit a45a8242ff
No known key found for this signature in database
GPG Key ID: 41BB7053E835C848
2 changed files with 13 additions and 2 deletions

View File

@ -32,7 +32,8 @@
" SPC l s l send current line
" SPC l s s send selection text
" <
"
" To format julia code, you need to install `JuliaFormatter`, and the key
" binding is `SPC b f`
function! SpaceVim#layers#lang#julia#plugins() abort
let plugins = []
@ -54,6 +55,15 @@ function! SpaceVim#layers#lang#julia#config() abort
" julia
let g:default_julia_version = '0.7'
" format code
" if you want to use mirror:
" let $JULIA_PKG_SERVER = 'https://mirrors.tuna.tsinghua.edu.cn/julia'
let g:neoformat_enabled_julia = ['juliafmt']
let g:neoformat_julia_juliafmt = {
\ 'exe': 'julia',
\ 'args': ['-e', '"using JuliaFormatter; print(format_text(read(stdin, String)))"'],
\ 'stdin': 1,
\ }
endfunction
function! s:language_specified_mappings() abort

View File

@ -2982,7 +2982,8 @@ This layer also provides REPL support for julia, the key bindings are:
SPC l s l send current line
SPC l s s send selection text
<
To format julia code, you need to install `JuliaFormatter`, and the key
binding is `SPC b f`
==============================================================================
LANG#KOTLIN *SpaceVim-layers-lang-kotlin*