From f70d5dc9b1f546bcfae67f067fe2e3b67f94ca45 Mon Sep 17 00:00:00 2001 From: Miguel Date: Wed, 3 Nov 2021 19:59:44 +0100 Subject: improving dotfiles --- vim/vim-potion/autoload/potion/running.vim | 33 ---------- vim/vim-potion/doc/potion.txt | 99 ----------------------------- vim/vim-potion/ftdetect/potion.vim | 1 - vim/vim-potion/ftplugin/potion/folding.vim | 38 ----------- vim/vim-potion/ftplugin/potion/running.vim | 6 -- vim/vim-potion/ftplugin/potion/sections.vim | 47 -------------- vim/vim-potion/syntax/potion.vim | 37 ----------- vim/vim-potion/syntax/potionbytecode.vim | 18 ------ 8 files changed, 279 deletions(-) delete mode 100644 vim/vim-potion/autoload/potion/running.vim delete mode 100644 vim/vim-potion/doc/potion.txt delete mode 100644 vim/vim-potion/ftdetect/potion.vim delete mode 100644 vim/vim-potion/ftplugin/potion/folding.vim delete mode 100644 vim/vim-potion/ftplugin/potion/running.vim delete mode 100644 vim/vim-potion/ftplugin/potion/sections.vim delete mode 100644 vim/vim-potion/syntax/potion.vim delete mode 100644 vim/vim-potion/syntax/potionbytecode.vim (limited to 'vim/vim-potion') 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 - 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 r for running the currently opened potion file. -Press b for showing its compiled bytecode in a new window. - -Set your maplocalleader in your .vimrc like this: -> - let maplocalleader="\" -< - -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 = IndentLevel(a:lnum) - let next_indent = IndentLevel(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 r :call potion#running#PotionCompileAndRunFile() -nnoremap b :call potion#running#PotionShowBytecode() 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