diff options
Diffstat (limited to 'env')
| -rwxr-xr-x | env/.config/lf/lfrc | 5 | ||||
| -rw-r--r-- | env/.config/vis/lexers/asciidoc.lua | 33 | ||||
| -rw-r--r-- | env/.config/vis/lexers/greyscript.lua | 33 | ||||
| -rw-r--r-- | env/.config/vis/plugins.lua | 27 | ||||
| -rw-r--r-- | env/.config/vis/visrc.lua | 1 | ||||
| -rwxr-xr-x | env/.zshrc | 8 |
6 files changed, 94 insertions, 13 deletions
diff --git a/env/.config/lf/lfrc b/env/.config/lf/lfrc index 7b399cc..1da2d74 100755 --- a/env/.config/lf/lfrc +++ b/env/.config/lf/lfrc @@ -130,6 +130,10 @@ cmd vim ${{ nvim $f }} +cmd vis ${{ + vis $f +}} + cmd Sxiv ${{ nohup nsxiv $f > /dev/null 2> /dev/null < /dev/null & disown }} @@ -172,6 +176,7 @@ cmd filebrowser ${{ map DD trash map DP delete map V vim +map <c-v> vis map S Sxiv map C clipf map <c-c> clip-path diff --git a/env/.config/vis/lexers/asciidoc.lua b/env/.config/vis/lexers/asciidoc.lua new file mode 100644 index 0000000..83d080b --- /dev/null +++ b/env/.config/vis/lexers/asciidoc.lua @@ -0,0 +1,33 @@ +local lexer = require('lexer') +local token, word_match = lexer.token, lexer.word_match +local P, S, B = lpeg.P, lpeg.S, lpeg.B + +local lex = lexer.new('asciidoc') + +-- AsciiDoc blocks: ==== and ---- +local adoc_block = lexer.range('====', '====', true, true, true) + lexer.range('----', '----', true, true, true) +lex:add_rule('block', token(lexer.PREPROCESSOR, lexer.range('====', '====', true, true, true) + lexer.range('----', '----', true, true, true))) +--lex:add_rule('block', token(lexer.EMPH, adoc_block)) + +-- Block: ---- must match full line +--lex:add_rule('block', token(lexer.EMPH, P('----') * P('\n') * (lexer.any - P('----'))^0 * P('----'))) + +-- Headers: Must be at start of line +lex:add_rule('header', token(lexer.KEYWORD, B('\n')^-1 * P('=')^1 * ' ' * lexer.nonnewline^1)) + +-- Bold: Prevent overlap with other syntax +lex:add_rule('bold', token(lexer.BOLD, P('*') * (lexer.any - S('*\n'))^1 * P('*'))) + +-- Italic +lex:add_rule('italic', token(lexer.ITALIC, P('_') * (lexer.any - S('_\n'))^1 * P('_'))) + +-- Links +lex:add_rule('link', token(lexer.CONSTANT, 'https?://' * lexer.nonnewline^1)) + +-- Comments +lex:add_rule('comment', token(lexer.COMMENT, P('//') * lexer.nonnewline^0)) + +-- Identifier (last) +lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word)) + +return lex diff --git a/env/.config/vis/lexers/greyscript.lua b/env/.config/vis/lexers/greyscript.lua new file mode 100644 index 0000000..93f8359 --- /dev/null +++ b/env/.config/vis/lexers/greyscript.lua @@ -0,0 +1,33 @@ +local lexer = require('lexer') +local token, word_match = lexer.token, lexer.word_match +local P, S = lpeg.P, lpeg.S + +-- Create the lexer object +local lex = lexer.new('greyscript') + +-- 1. Whitespace +lex:add_rule('whitespace', token(lexer.WHITESPACE, lexer.space^1)) + +-- 2. Keywords (Add your language keywords here) +lex:add_rule('keyword', token(lexer.KEYWORD, word_match[[ + if then else end function return local +]])) + +-- 3. Identifiers +lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word)) + +-- 4. Strings (Double and Single quoted) +local sq_str = lexer.range("'") +local dq_str = lexer.range('"') +lex:add_rule('string', token(lexer.STRING, sq_str + dq_str)) + +-- 5. Comments (Example: # style comments) +lex:add_rule('comment', token(lexer.COMMENT, lexer.to_eol('#'))) + +-- 6. Numbers +lex:add_rule('number', token(lexer.NUMBER, lexer.number)) + +-- 7. Operators +lex:add_rule('operator', token(lexer.OPERATOR, S('+-*/%^=<>,.{}[]()'))) + +return lex diff --git a/env/.config/vis/plugins.lua b/env/.config/vis/plugins.lua index 015a45c..2a0844b 100644 --- a/env/.config/vis/plugins.lua +++ b/env/.config/vis/plugins.lua @@ -1,20 +1,31 @@ -local _,autoclose = pcall(require,'plugins/vis-autoclose') +pcall(require,'plugins/vis-autoclose') -local cok,colorizer = pcall(require,'plugins/vis-colorizer') -if cok then +local color_ok,colorizer = pcall(require,'plugins/vis-colorizer') +if color_ok then colorizer.three = false colorizer.six = true end -local _,completefilename = pcall(require,'plugins/complete-filename') +pcall(require,'plugins/complete-filename') -local _,chain = pcall(require,'plugins/vis-chain') +pcall(require,'plugins/vis-chain') -local _,lsp = pcall(require,'plugins/vis-lspc') +local lsp_ok,lsp = pcall(require,'plugins/vis-lspc') +if lsp_ok then + lsp.ls_map.c.cmd = "clangd --fallback-style=webkit" + lsp.ls_map.cpp.cmd = "clangd --fallback-style=webkit" + lsp.ls_map.ansi_c.cmd = "clangd --fallback-style=webkit" + + lsp.ls_map.greyscript = { + name = 'greyscript', + cmd = '/bin/greybel-languageserver --stdio', + formatting_options = {tabSize = 4, insertSpaces = true}, + } +end -- https://git.symlinx.net/vis-modal/ -local Vok,modal = pcall(require,'plugins/vis-modal') -if Vok then +local modal_ok,modal = pcall(require,'plugins/vis-modal') +if modal_ok then modal.MODES = { [vis.modes.NORMAL] = ' NORMAL ', [vis.modes.INSERT] = ' INSERT ', diff --git a/env/.config/vis/visrc.lua b/env/.config/vis/visrc.lua index f518a2d..b11f0cb 100644 --- a/env/.config/vis/visrc.lua +++ b/env/.config/vis/visrc.lua @@ -27,3 +27,4 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) end, "") end) +vis.ftdetect.filetypes["greyscript"] = { ext = { "%.src$" } } @@ -9,7 +9,7 @@ SAVEHIST=1000 # End of lines configured by zsh-newuser-install PS1='%B%F{magenta}%n%B%F{yellow}@%B%F{magenta}%M %B%F{cyan}%1~ %B%F{default}∮ ' -#PS1='%B%F{white}[%B%F{red}Z%B%F{magenta}ARCH %B%F{cyan}%1~%B%F{white}]%B%F{default}$ ' +tty | grep -q pts && test "$USER" = "iceyrazor" && PS1='%B%F{magenta}アイシライゾ%B%F{yellow}@%B%F{magenta}%M %B%F{cyan}%1~ %B%F{default}∮ ' bindkey -v @@ -17,9 +17,9 @@ bindkey -v function vi-yank-clipboard { zle vi-yank if [ "$WAYLAND_DISPLAY" ]; then - printf "$CUTBUFFER" | wl-copy + printf -- "%s" "$CUTBUFFER" | wl-copy else - printf "$CUTBUFFER" | xclip -selection clipboard + printf -- "%s" "$CUTBUFFER" | xclip -selection clipboard fi } @@ -36,5 +36,3 @@ source ~/.config/.profile # bindkey -a i forward-char # bindkey -a n down-history # bindkey -a e up-history - -# eval "$(atuin init zsh)" |
