diff options
Diffstat (limited to 'example')
| -rw-r--r-- | example/index.lua | 29 | ||||
| -rw-r--r-- | example/index.luax | 11 | ||||
| -rw-r--r-- | example/reluax.luax (renamed from example/reluax.lua) | 14 | ||||
| -rw-r--r-- | example/test.lua | 25 | ||||
| -rw-r--r-- | example/test.luax | 70 |
5 files changed, 20 insertions, 129 deletions
diff --git a/example/index.lua b/example/index.lua deleted file mode 100644 index 76e1c0b..0000000 --- a/example/index.lua +++ /dev/null @@ -1,29 +0,0 @@ -return function() - return { - tag = "html", - children = { - { - tag = "head", - children = { - { - tag = "title", - children = { - "Hello World" - } - } - } - }, - { - tag = "body", - children = { - { - tag = "h1", - children = { - "Hello World" - } - } - } - } - } - } -end diff --git a/example/index.luax b/example/index.luax new file mode 100644 index 0000000..1c4b62c --- /dev/null +++ b/example/index.luax @@ -0,0 +1,11 @@ +return function() + return <html> + <head> + <title>Reluax</title> + </head> + <body> + <h1>Reluax Test</h1> + <p>Random number for you: {$ tostring(math.floor(math.random() * 100)) $}</p> + </body> + </html> +end diff --git a/example/reluax.lua b/example/reluax.luax index 0a5f2c7..a343826 100644 --- a/example/reluax.lua +++ b/example/reluax.luax @@ -5,13 +5,17 @@ math.randomseed(os.time()) local function route(path) if path == '/' then return index() - elseif path == '/goodbye' then - return "goodbye" - elseif path == '/random' then - return 'no more random' end - return nil + return <html> + <head> + <title>Error 404</title> + </head> + <body> + <h1>Error 404</h1> + <p>Page not found.</p> + </body> + </html> end return { diff --git a/example/test.lua b/example/test.lua deleted file mode 100644 index 04d5bd0..0000000 --- a/example/test.lua +++ /dev/null @@ -1,25 +0,0 @@ - local install_path = vim . fn . stdpath 'data' .. '/site/pack/packer/start/packer.nvim' local is_bootstrap = false if vim . fn . empty ( vim . fn . glob ( install_path ) ) > 0 then is_bootstrap = true vim . fn . execute ( '!git clone https://github.com/wbthomason/packer.nvim ' .. install_path ) vim . cmd [[packadd packer.nvim]] end vim . opt . number = true vim . opt . autoindent = true vim . opt . tabstop = 4 vim . opt . shiftwidth = 4 vim . opt . smarttab = true vim . opt . softtabstop = 4 vim . opt . mouse = "a" vim . opt . scl = "yes" vim . opt . guifont = "Hack:h10" vim . opt . expandtab = true vim . opt . list = true vim . opt . listchars = "tab:➜ ,lead:·,trail:·" vim . opt . termguicolors = true vim . o . background = "dark" vim . opt . clipboard = "unnamedplus" vim . opt . foldmethod = "expr" vim . opt . foldexpr = "nvim_treesitter#foldexpr()" vim . opt . foldlevel = 99 a = { 'dollar' } require ( "plugins" ) if is_bootstrap then print ( "Bootstrapping complete. Restart when plugins are installed." ) require ( "packer" ) . sync ( ) return end require ( "mappings" ) require ( "lsp" ) require ( "plugin-config" ) vim . cmd ( "colorscheme fenchurch" ) vim . cmd ( [[ - autocmd! BufNewFile,BufRead *.vs,*.fs set ft=glsl - autocmd! BufNewFile,BufRead *.gd setlocal noexpandtab - autocmd! BufNewFile,BufRead *.ts,*.tsx setlocal tabstop=2 shiftwidth=2 softtabstop=2 - autocmd! BufNewFile,BufRead *.js,*.jsx setlocal tabstop=2 shiftwidth=2 softtabstop=2 - autocmd! BufNewFile,BufRead *.html,*.css,*.scss,*.json,*.yml,*.yaml,*.md,*.markdown setlocal tabstop=2 shiftwidth=2 softtabstop=2 -]] ) vim . cmd ( [[ - function! ZenMode() - if !exists('g:zen_mode') - let g:zen_mode = 0 - endif - if g:zen_mode == 0 - setlocal nolist - setlocal nonumber - lua require('lualine').hide() - g:zen_mode = 1 - else - setlocal list - setlocal number - lua require('lualine').hide({unhide=true}) - g:zen_mode = 0 - endif - endfunction - command! ZenMode call ZenMode() -]] )
\ No newline at end of file diff --git a/example/test.luax b/example/test.luax deleted file mode 100644 index dfc9a3c..0000000 --- a/example/test.luax +++ /dev/null @@ -1,70 +0,0 @@ -local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim' -local is_bootstrap = false -if vim.fn.empty(vim.fn.glob(install_path)) > 0 then - is_bootstrap = true - vim.fn.execute('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path) - vim.cmd [[packadd packer.nvim]] -end - -vim.opt.number = true -vim.opt.autoindent = true -vim.opt.tabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.smarttab = true -vim.opt.softtabstop = 4 -vim.opt.mouse = "a" -vim.opt.scl = "yes" -vim.opt.guifont = "Hack:h10" -vim.opt.expandtab = true -vim.opt.list = true -vim.opt.listchars = "tab:➜ ,lead:·,trail:·" -vim.opt.termguicolors = true -vim.o.background = "dark" -vim.opt.clipboard = "unnamedplus" -vim.opt.foldmethod = "expr" -vim.opt.foldexpr = "nvim_treesitter#foldexpr()" -vim.opt.foldlevel = 99 - -require("plugins") - -if is_bootstrap then - print("Bootstrapping complete. Restart when plugins are installed.") - require("packer").sync() - - return -end - -require("mappings") -require("lsp") -require("plugin-config") - -vim.cmd("colorscheme fenchurch") - -vim.cmd([[ - autocmd! BufNewFile,BufRead *.vs,*.fs set ft=glsl - autocmd! BufNewFile,BufRead *.gd setlocal noexpandtab - autocmd! BufNewFile,BufRead *.ts,*.tsx setlocal tabstop=2 shiftwidth=2 softtabstop=2 - autocmd! BufNewFile,BufRead *.js,*.jsx setlocal tabstop=2 shiftwidth=2 softtabstop=2 - autocmd! BufNewFile,BufRead *.html,*.css,*.scss,*.json,*.yml,*.yaml,*.md,*.markdown setlocal tabstop=2 shiftwidth=2 softtabstop=2 -]]) - --- zen mode -vim.cmd([[ - function! ZenMode() - if !exists('g:zen_mode') - let g:zen_mode = 0 - endif - if g:zen_mode == 0 - setlocal nolist - setlocal nonumber - lua require('lualine').hide() - g:zen_mode = 1 - else - setlocal list - setlocal number - lua require('lualine').hide({unhide=true}) - g:zen_mode = 0 - endif - endfunction - command! ZenMode call ZenMode() -]]) |
