diff options
| author | Miguel <m.i@gmx.at> | 2021-11-03 19:59:44 +0100 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2021-11-03 19:59:44 +0100 |
| commit | f70d5dc9b1f546bcfae67f067fe2e3b67f94ca45 (patch) | |
| tree | 3bffaa05b78db0e393bc44eb273f771e08320154 /vim/vim-potion | |
| parent | e3fb79099e233185825b248a0b275173bd182239 (diff) | |
improving dotfiles
Diffstat (limited to 'vim/vim-potion')
| -rw-r--r-- | vim/vim-potion/autoload/potion/running.vim | 33 | ||||
| -rw-r--r-- | vim/vim-potion/doc/potion.txt | 99 | ||||
| -rw-r--r-- | vim/vim-potion/ftdetect/potion.vim | 1 | ||||
| -rw-r--r-- | vim/vim-potion/ftplugin/potion/folding.vim | 38 | ||||
| -rw-r--r-- | vim/vim-potion/ftplugin/potion/running.vim | 6 | ||||
| -rw-r--r-- | vim/vim-potion/ftplugin/potion/sections.vim | 47 | ||||
| -rw-r--r-- | vim/vim-potion/syntax/potion.vim | 37 | ||||
| -rw-r--r-- | vim/vim-potion/syntax/potionbytecode.vim | 18 |
8 files changed, 0 insertions, 279 deletions
diff --git a/vim/vim-potion/autoload/potion/running.vim b/vim/vim-potion/autoload/potion/running.vim deleted file mode 100644 index 562f713..0000000 --- a/vim/vim-potion/autoload/potion/running.vim +++ /dev/null @@ -1,33 +0,0 @@ -function! potion#running#PotionCompileAndRunFile() - write - silent !clear - execute "!" . g:potion_command . " " . bufname("%") -endfunction - -function! potion#running#PotionShowBytecode() - - write - - " Get the bytecode. - let bytecode = system(g:potion_command . " -c -V " . bufname("%") . " 2>&1") - - " Check returned string for errors. - if bytecode=~#"Syntax error" - let bytecode = "SYNTAX ERROR!! Check your potion." - endif - - " Open a new split and set it up or use existing one! - let potbufnr=bufwinnr('__Potion_Bytecode__') - if potbufnr==#-1 - vsplit __Potion_Bytecode__ - else - execute potbufnr.'wincmd w' - endif - normal! ggdG - setlocal filetype=potionbytecode - setlocal buftype=nofile - - " Insert the bytecode. - call append(0, split(bytecode, '\v\n')) - -endfunction diff --git a/vim/vim-potion/doc/potion.txt b/vim/vim-potion/doc/potion.txt deleted file mode 100644 index 4cd9191..0000000 --- a/vim/vim-potion/doc/potion.txt +++ /dev/null @@ -1,99 +0,0 @@ -*potion.txt* basic functionality for the potion programming language -======================================================================== -INTRO *PotionIntro* - - ___ _ _ ~ - / _ \___ | |_(_) ___ _ __ ~ - / /_)/ _ \| __| |/ _ \| '_ \ ~ - / ___/ (_) | |_| | (_) | | | | ~ - \/ \___/ \__|_|\___/|_| |_| ~ - - - Functionality for the Potion programming language. - Includes syntax highlighting, code folding, and more! - - Coded by Michal Idziorek <m.i@gmx.at> - along the "Learn Vimscript the Hard Way" tutorial: - http://learnvimscriptthehardway.stevelosh.com - - -======================================================================== -CONTENTS *PotionContents* - - 1. Usage .............. |PotionUsage| - 2. Installation ....... |PotionInstall| - 3. Files .............. |PotionFiles| - 4. Credits ............ |PotionCredits| - - -======================================================================== -USAGE *PotionUsage* - -This plugin will automatically provide syntax highlighting and folding -for potion files (files ending in .pn). - -It remaps the section movement commands, to provide easy navigation -through potion files: -> - [[ ]] [] ][ -< - -The plugin offers mappings for invoking the potion compiler as well: - -Press <localleader>r for running the currently opened potion file. -Press <localleader>b for showing its compiled bytecode in a new window. - -Set your maplocalleader in your .vimrc like this: -> - let maplocalleader="\<space>" -< - -You can set the path to the potion binary in your .vimrc too: -> - let g:potion_command = "/home/miguel/int/dev/potion/bin/potion" -< - -Otherwise the following default value will be used: -> - let g:potion_command = "potion" -< - -======================================================================== -INSTALLATION *PotionInstall* - -Use Tim Pope's marvellous 'pathogen.vim' to simply put the potion plugin -into its own private directory. You can get Pathogen on GitHub: -> - https://github.com/tpope/vim-pathogen -< - -Use git to clone the plugin directly into its target directory to keep -it up to date easily. -> - ~/.vim/bundle/potion/ -< - -======================================================================== -FILES *PotionFiles* - -The potion plugin ships with the following files: - -doc/potion.txt ................ Documentation (this file) -ftdetect/potion.vim ........... Detection of potion files by .pn ending -syntax/potion.vim ............. Syntax highlighting for .pn files -syntax/potionbytecode.vim ..... Syntax highlighting for bytecode -ftplugin/potion/folding.vim ... Folding functionality -ftplugin/potion/sections.vim .. Section movement via [[,]],[],][ -ftplugin/potion/running.vim ... Mappings for running the potion compiler -autoload/potion/running.vim ... Functions for running the compiler - - -======================================================================== -CREDITS *PotionCredits* - -This is my very first Vim plugin and it emerged during the course -of reading Steve Losh' wonderful Vimscript tutorial: -> - "Learn Vimscript the Hard Way". - http://learnvimscriptthehardway.stevelosh.com -< diff --git a/vim/vim-potion/ftdetect/potion.vim b/vim/vim-potion/ftdetect/potion.vim deleted file mode 100644 index a3a3170..0000000 --- a/vim/vim-potion/ftdetect/potion.vim +++ /dev/null @@ -1 +0,0 @@ -au BufNewFile,BufRead *.pn setfiletype potion diff --git a/vim/vim-potion/ftplugin/potion/folding.vim b/vim/vim-potion/ftplugin/potion/folding.vim deleted file mode 100644 index d4cb32b..0000000 --- a/vim/vim-potion/ftplugin/potion/folding.vim +++ /dev/null @@ -1,38 +0,0 @@ -setlocal foldmethod=expr -setlocal foldexpr=GetPotionFold(v:lnum) - -function! s:NextNonBlankLine(lnum) - let numlines = line('$') - let current = a:lnum + 1 - - while current <= numlines - if getline(current) =~? '\v\S' - return current - endif - - let current += 1 - endwhile - - return -2 -endfunction - -function! s:IndentLevel(lnum) - return indent(a:lnum) / &shiftwidth -endfunction - -function! GetPotionFold(lnum) - if getline(a:lnum) =~? '\v^\s*$' - return '-1' - endif - - let this_indent = <SID>IndentLevel(a:lnum) - let next_indent = <SID>IndentLevel(<SID>NextNonBlankLine(a:lnum)) - - if next_indent == this_indent - return this_indent - elseif next_indent < this_indent - return this_indent - elseif next_indent > this_indent - return '>' . next_indent - endif -endfunction diff --git a/vim/vim-potion/ftplugin/potion/running.vim b/vim/vim-potion/ftplugin/potion/running.vim deleted file mode 100644 index d70adc0..0000000 --- a/vim/vim-potion/ftplugin/potion/running.vim +++ /dev/null @@ -1,6 +0,0 @@ -if !exists("g:potion_command") - let g:potion_command = "potion" -endif - -nnoremap <buffer> <localleader>r :call potion#running#PotionCompileAndRunFile()<cr> -nnoremap <buffer> <localleader>b :call potion#running#PotionShowBytecode()<cr> diff --git a/vim/vim-potion/ftplugin/potion/sections.vim b/vim/vim-potion/ftplugin/potion/sections.vim deleted file mode 100644 index 200415c..0000000 --- a/vim/vim-potion/ftplugin/potion/sections.vim +++ /dev/null @@ -1,47 +0,0 @@ -function! s:NextSection(type, backwards, visual) - - if a:visual - normal! gv - endif - - if a:type == 1 - let pattern = '\v(\n\n^\S|%^)' - let flags = 'e' - elseif a:type == 2 - let pattern = '\v^\S.*\=.*:$' - let flags = '' - endif - - if a:backwards - let dir = '?' - else - let dir = '/' - endif - - execute 'silent normal! ' . dir . pattern . dir . flags . "\r" - -endfunction - -noremap <script> <buffer> <silent> ]] - \ :call <SID>NextSection(1, 0, 0)<cr> - -noremap <script> <buffer> <silent> [[ - \ :call <SID>NextSection(1, 1, 0)<cr> - -noremap <script> <buffer> <silent> ][ - \ :call <SID>NextSection(2, 0, 0)<cr> - -noremap <script> <buffer> <silent> [] - \ :call <SID>NextSection(2, 1, 0)<cr> - -vnoremap <script> <buffer> <silent> ]] - \ :<c-u>call <SID>NextSection(1, 0, 1)<cr> - -vnoremap <script> <buffer> <silent> [[ - \ :<c-u>call <SID>NextSection(1, 1, 1)<cr> - -vnoremap <script> <buffer> <silent> ][ - \ :<c-u>call <SID>NextSection(2, 0, 1)<cr> - -vnoremap <script> <buffer> <silent> [] - \ :<c-u>call <SID>NextSection(2, 1, 1)<cr> diff --git a/vim/vim-potion/syntax/potion.vim b/vim/vim-potion/syntax/potion.vim deleted file mode 100644 index 2ca9dbc..0000000 --- a/vim/vim-potion/syntax/potion.vim +++ /dev/null @@ -1,37 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -syntax keyword potionKeyword loop times to while -syntax keyword potionKeyword if elsif else -syntax keyword potionKeyword class return -syntax keyword potionFunction print join string - -syntax match potionOperator "\v\." -syntax match potionOperator "\v:" -syntax match potionOperator "\v\=" -syntax match potionOperator "\v\*" -syntax match potionOperator "\v/" -syntax match potionOperator "\v\+" -syntax match potionOperator "\v-" -syntax match potionOperator "\v\?" -syntax match potionOperator "\v\*\=" -syntax match potionOperator "\v/\=" -syntax match potionOperator "\v\+\=" -syntax match potionOperator "\v-\=" - -syntax match potionNumber "\v\d+" -syntax match potionNumber "\v0x\x+" - -syntax region potionString start=/\v"/ skip=/\v\\./ end=/\v"/ - -syntax match potionComment "\v#.*$" - -highlight link potionString String -highlight link potionOperator Operator -highlight link potionKeyword Keyword -highlight link potionFunction Function -highlight link potionComment Comment -highlight link potionNumber Number - -let b:current_syntax = "potion" diff --git a/vim/vim-potion/syntax/potionbytecode.vim b/vim/vim-potion/syntax/potionbytecode.vim deleted file mode 100644 index 24e2e44..0000000 --- a/vim/vim-potion/syntax/potionbytecode.vim +++ /dev/null @@ -1,18 +0,0 @@ -" minimalistic syntax highlighting for testing purposes - -if exists("b:current_syntax") - finish -endif - -syntax keyword potionKeyword code assign - - -syntax match potionNumber "\v\d+" -syntax region potionString start=/\v"/ skip=/\v\\./ end=/\v"/ - - -highlight link potionString String -highlight link potionKeyword Keyword -highlight link potionNumber Number - -let b:current_syntax = "potionbytecode" |
