uiua support + a bit

main
aprzn 1 year ago
parent acdc8578a3
commit 79d821b2f1

@ -1,3 +1,11 @@
{
"rust-analyzer.checkOnSave.command": "clippy"
"rust-analyzer.checkOnSave.command": "clippy",
"clangd.path": "~/.config/coc/extensions/coc-clangd-data/install/16.0.2/clangd_16.0.2/bin/clangd",
"languageserver": {
"uiua": {
"command": "uiua",
"args": ["lsp"],
"filetypes": ["uiua"]
}
}
}

@ -1,3 +1,6 @@
-- detect filetype
vim.filetype.add({extension = {ua = "uiua" }})
vim.api.nvim_create_augroup("aprzn", {clear = true})
vim.api.nvim_create_autocmd("BufWritePost", {
group = "aprzn",
@ -28,4 +31,11 @@ vim.api.nvim_create_autocmd("ColorScheme", {
end
}) -- save colorscheme
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*.ua",
callback = function(ev)
vim.cmd("silent !uiua fmt " .. vim.fn.expand("<amatch>"))
end,
}) -- format uiua on save
return false

@ -25,6 +25,9 @@ vim.o.foldlevelstart = 99
vim.o.foldenable = true
require('ufo').setup()
-- vimtex
vim.g.vimtex_view_general_viewer = 'evince'
-- autoclose
require('autoclose').setup({})

@ -125,6 +125,11 @@ _G.packer_plugins = {
path = "/home/aprzn/.local/share/nvim/site/pack/packer/start/fzf.vim",
url = "https://github.com/junegunn/fzf.vim"
},
["goyo.vim"] = {
loaded = true,
path = "/home/aprzn/.local/share/nvim/site/pack/packer/start/goyo.vim",
url = "https://github.com/junegunn/goyo.vim"
},
gruvbox = {
loaded = true,
path = "/home/aprzn/.local/share/nvim/site/pack/packer/start/gruvbox",
@ -155,10 +160,10 @@ _G.packer_plugins = {
path = "/home/aprzn/.local/share/nvim/site/pack/packer/start/nvim-whichkey-setup.lua",
url = "https://github.com/AckslD/nvim-whichkey-setup.lua"
},
["onedark.nvim"] = {
["onedark.vim"] = {
loaded = true,
path = "/home/aprzn/.local/share/nvim/site/pack/packer/start/onedark.nvim",
url = "https://github.com/navarasu/onedark.nvim"
path = "/home/aprzn/.local/share/nvim/site/pack/packer/start/onedark.vim",
url = "https://github.com/joshdick/onedark.vim"
},
["packer.nvim"] = {
loaded = true,

@ -0,0 +1,104 @@
if exists("b:current_syntax")
finish
endif
let b:current_syntax = "uiua"
syn iskeyword a-z
syn keyword uiuaIdentifier e os family arch ExeExt DllExt sep
syn match uiuaIdentifier '[a-zA-Z]\+'
" {{{ functions and modifiers
" constants
syn keyword uiuaNoadic eta pi tau inf[inity] rand[om] tag now
syn match uiuaNoadic '[ηπ∞τ⚂]'
" monadic and dyadic pervasive functions
syn keyword uiuaPervasive not sig[n] abs[olute] sqr[t] sin[e] flo[or] cei[ling] rou[nd] add subtract multiply divide mod[ulus] pow[er] log[arithm] min[imum] max[imum] ata[ngent]
syn match uiuaPervasive '[¬±`¯⌵√○⌊⌈⁅]\|!=\|<=\|>=\|[=≠<≤>≥+\-×*÷%◿ⁿₙ↧↥∠]'
" monadic array functions
syn keyword uiuaMonadic len[gth] sha[pe] rang[e] fir[st] rev[erse] des[hape] bit[s] tra[nspose] ris[e] fal[e] whe[re] cla[ssify] ded[uplicate] box unb[ox] bre[ak] rec[ur] wait call parse gen type sig
syn match uiuaMonadic '[⧻△⇡⊢⇌♭⋯⍉⍏⍖⊚⊛⊝□⊔!⎋↬]'
" dyadic array functions
syn keyword uiuaDyadic joi[n] cou[ple] mat[ch] pic[k] sel[ect] resh[ape] tak[e] dro[p] rot[ate] win[dows] kee[p] fin[d] mem[ber] ind[exof] ass[ert] deal
syn match uiuaDyadic '[⊂⊟≅⊡⊏↯↙↘↻◫▽⌕∊⊗⍤]'
" monadic modifiers
syn keyword uiuaMonadicMod di[p] ga[p] eac[h] row[s] dis[tribute] tab[le] cro[ss] rep[eat] reduce fol[d] scan gro[up] par[tition] inv[ert] bot[h] spawn
syn match uiuaMonadicMod '[⊙⋅∵≡∺⊞⊠⍥/∧⊕⊜\\⍘∩]'
" dyadic and triadic modifiers
syn keyword uiuaOtherMod lev[el] und[er] fil[l] bind bra[cket] for[k] try if
syn match uiuaOtherMod /[⍚⍜⬚'⊓⊃⍣?]/
" }}}
" {{{ system functions
" defined in inverse order so precedence for e.g.
" &i and &ime, &s and &sc, etc. is correct
" modules
syn keyword uiuaModuleSF use
syn match uiuaModuleSF '&i'
syn match uiuaDyadicSF '\v\&(rs|rb|ru|w|fwa|ime|ae|tcpsrt|tcpswt|httpsw)'
syn match uiuaMonadicSF '\v\&(sl|s|pf|p|var|runi|runc|cd|cl|fo|fc|fe|fld|fif|fras|frab|fwa|imd|ims|gife|ad|ap|ast|tcpl|tcpa|tcpc|tcpsnb|tcpaddr)'
syn match uiuaNoadicSF '\v\&(sc|ts|args|asr)'
" }}}
" {{{ literals
" numeric literal
syn match uiuaNum '[¯`]\?\d\+\(\.\d\+\)\?\(e[¯`]\?\d\+\)\?'
" escape sequence and format placeholder
syn match uiuaEsc contained /\\[\\'"_0nrt]/
syn match uiuaFmt contained '_'
" character literal
syn match uiuaChar '@.' contains=uiuaEsc
" string literal (plain, format, and multiline)
syn region uiuaStr start='"' end='"' skip='\\"' contains=uiuaEsc
syn region uiuaStr start='\$"' end='"' skip='\\"' contains=uiuaEsc,uiuaFmt
syn region uiuaStr start='\$ ' end='$' contains=uiuaEsc,uiuaFmt
" }}}
" {{{ misc
" function signatures
syn match uiuaSignature '|\d\+\(\.\d\+\)\?'
" scopes, <- assignments, and stranded arrays
syn match uiuaFaded '^---$\|[←_]'
" debug functions
syn keyword uiuaDebug dump
syn match uiuaDebug '[~]'
" comments
syn match uiuaComment '#.*$'
" }}}
" {{{ highlight groups
hi def link uiuaNoadic Keyword
hi def link uiuaNoadicSF Keyword
hi def link uiuaPervasive Operator
hi def link uiuaMonadic Function
hi def link uiuaMonadicSF Function
hi def link uiuaDyadic Identifier
hi def link uiuaDyadicSF Identifier
hi def link uiuaMonadicMod Type
hi def link uiuaOtherMod Number
hi def link uiuaModuleSF Keyword
hi def link uiuaNum Number
hi def link uiuaEsc SpecialChar
hi def link uiuaChar String
hi def link uiuaFmt Operator
hi def link uiuaStr String
hi def link uiuaSignature Type
hi def link uiuaDebug Operator
hi def link uiuaFaded Comment
hi def link uiuaComment Comment
" }}}
Loading…
Cancel
Save