aboutsummaryrefslogtreecommitdiff
path: root/files/vim
diff options
context:
space:
mode:
Diffstat (limited to 'files/vim')
-rw-r--r--files/vim/.vimrc255
-rw-r--r--files/vim/ftplugin/antlr/antlr3.vim91
-rw-r--r--files/vim/ftplugin/antlr/antlr4.vim76
-rw-r--r--files/vim/ftplugin/asciidoc/asciidoc.vim19
-rw-r--r--files/vim/ftplugin/cpp/cpp.vim28
-rw-r--r--files/vim/ftplugin/cpp/snips/template.txt6
-rw-r--r--files/vim/ftplugin/css/css.vim20
-rw-r--r--files/vim/ftplugin/html/html.vim78
-rw-r--r--files/vim/ftplugin/html/snips/template.txt12
-rw-r--r--files/vim/ftplugin/java/java.vim14
-rw-r--r--files/vim/ftplugin/javascript/javascript.vim38
-rw-r--r--files/vim/ftplugin/plantuml/plantuml.vim21
-rw-r--r--files/vim/ftplugin/plantuml/snips/template.txt9
-rw-r--r--files/vim/ftplugin/python/python.vim16
-rw-r--r--files/vim/ftplugin/sent/sent.vim9
-rw-r--r--files/vim/ftplugin/sh/sh.vim16
-rw-r--r--files/vim/ftplugin/sh/snippets/if.txt3
-rw-r--r--files/vim/ftplugin/tex/snips/template.txt30
-rw-r--r--files/vim/ftplugin/tex/tex.vim38
-rw-r--r--files/vim/ftplugin/text/text.vim18
-rw-r--r--files/vim/ftplugin/typescript/typescript.vim33
-rw-r--r--files/vim/ftplugin/vimwiki/snips/plantUml.txt5
-rw-r--r--files/vim/ftplugin/vimwiki/snips/template.txt15
-rw-r--r--files/vim/ftplugin/vimwiki/vimwiki.vim33
-rw-r--r--files/vim/plugin/SWTC.vim339
-rw-r--r--files/vim/plugin/dragvisuals.vim345
-rw-r--r--files/vim/plugin/rng.vim83
27 files changed, 0 insertions, 1650 deletions
diff --git a/files/vim/.vimrc b/files/vim/.vimrc
deleted file mode 100644
index 514ec6a..0000000
--- a/files/vim/.vimrc
+++ /dev/null
@@ -1,255 +0,0 @@
-" _
-" __ _(_)_ __ ___ _ __ ___
-" \ \ / / | '_ ` _ \| '__/ __|
-" \ V /| | | | | | | | | (__
-" \_/ |_|_| |_| |_|_| \___|
-"
-
-let mapleader = ","
-
-call plug#begin('~/.vim/plugged') "Update with PlugInstall
-Plug 'PotatoesMaster/i3-vim-syntax'
-Plug 'junegunn/goyo.vim'
-Plug 'junegunn/fzf.vim'
-Plug 'junegunn/limelight.vim'
-Plug 'tpope/vim-surround'
-Plug 'tpope/vim-repeat'
-Plug 'vimwiki/vimwiki'
-Plug 'vim-airline/vim-airline'
-"Plug 'vim-syntastic/syntastic'
-Plug 'dense-analysis/ale'
-"Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins' }
-"Plug 'Shougo/deoplete-clangx'
-"Plug 'neoclide/coc.nvim', {'branch': 'release'}
-Plug 'Valloric/YouCompleteMe'
-"Plug 'OmniSharp/omnisharp-vim'
-Plug 'dylanaraps/wal.vim'
-Plug 'ThePrimeagen/vim-be-good'
-call plug#end()
-
-" Basic settings
-set nocompatible
-set encoding=utf-8
-set number relativenumber
-set tabstop=4
-set shiftwidth=4
-set scrolloff=2
-set wildmode=longest,list,full
-set splitbelow
-set splitright
-set vb " No bell
-" Searching
-set ignorecase
-set wrapscan
-set incsearch
-set nohlsearch
-
-" Filetypes
-filetype indent plugin on
-au BufRead,BufNewFile *.pu set filetype=plantuml
-au BufRead,BufNewFile *.puml set filetype=plantuml
-au BufRead,BufNewFile *.g set filetype=antlr3
-au BufRead,BufNewFile *.g4 set filetype=antlr4
-
-" hlnext: Highlighting searches
-nnoremap <silent> n n:call HLNext(0.1)<CR>
-nnoremap <silent> N N:call HLNext(0.1)<CR>
-function! HLNext(blinktime)
- set invcursorline
- redraw
- exec 'sleep'.float2nr(a:blinktime*1000).'m'
- set invcursorline
- redraw
-endfunction
-
-" dragvisuals: dragging visual blocks
-vmap <expr> <LEFT> DVB_Drag('left')
-vmap <expr> <RIGHT> DVB_Drag('right')
-vmap <expr> <DOWN> DVB_Drag('down')
-vmap <expr> <UP> DVB_Drag('up')
-vmap <expr> D DVB_Duplicate()
-
-" Showing tabs
-"exec "set listchars=tab:\uBB\uBB,trail:\uB7,nbsp:~"
-exec "set listchars=tab:\uBB·,trail:\uB7,nbsp:~"
-nnoremap <leader>l :set list!<CR>
-
-" For deoplete
-
-"let g:deoplete#enable_at_startup = 1
-"
-"call deoplete#custom#option({
-"\ 'auto_complete': v:true,
-"\ 'auto_complete_delay': 0,
-"\ 'smart_case': v:true,
-"\ })
-"
-"call deoplete#custom#option('sources', {
-"\ '_': ['ale'],
-"\})
-
-" For CoC
-"inoremap <silent><expr> <c-space> coc#refresh()
-
-" For YouCompleteMe
-let g:ycm_auto_trigger = 1
-let g:ycm_autoclose_preview_window_after_insertion = 1
-
-" For syntastic
-"set statusline+=%#warningmsg#
-"set statusline+=%{SyntasticStatuslineFlag()}
-"set statusline+=%*
-"let g:syntastic_cs_checkers = ['code_checker']
-"let g:syntastic_enable_signs = 1
-"let g:syntastic_aggregate_errors = 1
-"let g:syntastic_always_populate_loc_list = 1
-"let g:syntastic_auto_loc_list = 2
-"let g:syntastic_check_on_open = 1
-"let g:syntastic_check_on_wq = 0
-
-" For omnisharp
-"let g:OmniSharp_server_stdio = 1
-"let g:OmniSharp_server_path = '/home/taamas/repos/omnisharp-roslyn/artifacts/scripts/OmniSharp.Stdio'
-"let g:OmniSharp_selector_ui = 'fzf'
-
-" For cursor shape with tmux
-if exists('$TMUX')
- let &t_SI = "\<Esc>Ptmux;\<Esc>\e[5 q\<Esc>\\"
- let &t_EI = "\<Esc>Ptmux;\<Esc>\e[2 q\<Esc>\\"
-else
- let &t_SI = "\e[5 q"
- let &t_EI = "\e[2 q"
-endif
-
-"if empty($TMUX)
-" let &t_SI = "\<Esc>]50;CursorShape=1\x7" " Vertical bar in insert mode
-" let &t_EI = "\<Esc>]50;CursorShape=0\x7" " Block in normal mode
-"else
-" let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
-" let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
-"endif
-
-"if &term =~ '^screen'
-" " tmux will send xterm-style keys when its xterm-keys option is on
-" execute "set <xUp>=\e[1;*A"
-" execute "set <xDown>=\e[1;*B"
-" execute "set <xRight>=\e[1;*C"
-" execute "set <xLeft>=\e[1;*D"
-"endif
-
-" For vim-airline
-if !exists('g:airline_symbols')
- let g:airline_symbols = {}
-endif
-let g:airline_left_sep=''
-let g:airline_right_sep=''
-let g:airline_symbols.linenr = '🔃'
-let g:airline_symbols.maxlinenr = '↩'
-
-" For vimwiki
-" filetype plugin on
-let g:vimwiki_ext2syntax = {'.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
-let g:vimwiki_list = [{'path': '~/docs/vimwiki/', 'syntax': 'markdown', 'ext': '.md'},
- \ {'path': '~/docs/notes/', 'syntax': 'markdown', 'ext': '.md'},
- \ {'path': '~/games/dungeonesYDragones/tarkba/vimwiki/', 'syntax': 'markdown', 'ext': '.md'},
- \ {'path': '~/games/dungeonesYDragones/creaciones/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}]
-
-" Vertical split character
-set fillchars+=vert:█
-
-" Shortcuts for split navigation
-map <C-h> <C-w>h
-map <C-j> <C-w>j
-map <C-k> <C-w>k
-map <C-l> <C-w>l
-map <A-h> <C-w><
-map <A-j> <C-w>+
-map <A-k> <C-w>-
-map <A-l> <C-w>>
-map <A-H> <C-w>10<
-map <A-J> <C-w>5+
-map <A-K> <C-w>5-
-map <A-L> <C-w>10>
-
-" Shortcuts for opening netrw
-nnoremap <leader>f :40Vexplore<CR>
-nnoremap <leader>F :40Lexplore<CR>
-
-" FZF
-nnoremap <C-p> :Files<CR>
-
-" Moving -here-
-nnoremap <leader>h :cd %:h<CR>
-
-nnoremap <C-n> :tabnew<CR>
-"nnoremap <Tab> gt "Can't be set without also remapping <C-i>
-"nnoremap <S-Tab> gT
-
-nnoremap <leader>vrc :80vsp ~/.vimrc<CR>
-nnoremap <leader>S :!tmux split-window -p 40<CR><CR>
-
-nnoremap <leader>/ /grtfjx<CR>
-"
-" Color
-syntax enable
-syntax on
-
-" Line size marking
-highlight ColorColumn ctermbg=darkblue ctermfg=black
-"Redjail Bomb (thx Damian Conway!)
-"highlight ColorColumn ctermbg=red ctermfg=blue
-"exec 'set colorcolumn='.join(range(2,80,3), ',')
-
-" Completion color
-highlight Pmenu ctermbg=blue ctermfg=black
-highlight PmenuSel ctermbg=darkblue ctermfg=white
-
-" Panel border color
-highlight VertSplit ctermbg=black ctermfg=darkblue
-
-" Symbol pairs match color
-highlight MatchParen ctermbg=cyan ctermfg=black
-
-" Errors colors
-highlight Error ctermbg=red ctermfg=black
-highlight SpellBad ctermbg=red ctermfg=black
-
-" Comments colors
-highlight Comment ctermfg=green
-
-"Clean trailing whitespaces on save
-autocmd BufWritePre * %s/\s\+$//e
-
-" Autoupdate ~/.Xresources
-autocmd BufWritePost ~/.Xresources !xrdb %
-
-" Generate ~/.mainpage/urls on ~/.config/qutebrowser save
-autocmd BufWritePost ~/.config/qutebrowser/config.py !grep -e \'.*\':\ \'.*{}.*\' "$HOME/.config/qutebrowser/config.py" | grep -v DEFAULT | sed 's/,//; s/^\ *//' > ~/.mainpage/urls
-
-""" Remaps """
-
-nnoremap Y y$
-nnoremap <leader>ss :set spell!<CR>
-nnoremap <leader>sl :set spelllang=
-nnoremap <leader>sL :setlocal spelllang=
-nnoremap <leader>e :Errors<Enter>
-nnoremap <leader>x :w<CR>:! ./%
-inoremap <leader>w <Esc>:w<Enter>
-inoremap <leader><leader> <Esc>/<++><Enter>cf>
-nnoremap <leader>p "+p
-nnoremap <leader>y "+yy
-vnoremap <leader>y "+y
-nnoremap <leader>d "+dd
-vnoremap <leader>d "+d
-
-nnoremap <leader>G :Goyo \| set linebreak<CR>:e<CR>
-
-" For LimeLight
-let g:limelight_conceal_ctermfg = 7
-
-"" git
-nnoremap <leader>gs :!git status<CR>
-"nnoremap <leader>gpull :!git pull<CR>
-nnoremap <leader>ga :!git add %<CR>
-nnoremap <leader>gp :!git push<CR>
-nnoremap <leader>gc :!git commit -m "
diff --git a/files/vim/ftplugin/antlr/antlr3.vim b/files/vim/ftplugin/antlr/antlr3.vim
deleted file mode 100644
index 10e24e5..0000000
--- a/files/vim/ftplugin/antlr/antlr3.vim
+++ /dev/null
@@ -1,91 +0,0 @@
-" vim: ts=8
-" Vim syntax file
-" Language: ANTLRv3
-" Maintainer: Jrn Horstmann (updated by Davyd Madeley)
-" Last Change: 2008-11-21
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-syn keyword antlrKeyword grammar lexer parser tree header members options fragment returns throws scope init
-
-syn match antlrCharacter '\\\(r\|n\|t\|f\|b\|"\|\'\|\\\|u\x\{4}\)' contained display
-
-syn match antlrToken "\<[A-Z_][a-zA-Z_0-9]\+\>"
-syn match antlrRule "[a-z][a-zA-Z_0-9]\+"
-syn match antlrScopeVariable '$\k\+::\k\+'
-
-syn match antlrOperator "[:;@.]"
-syn match antlrOperator "[()]"
-syn match antlrOperator "[?+*~|!]"
-syn match antlrOperator "[->=^]"
-
-syn match antlrBrace "[{}]"
-syn match antlrBrace "[\[\]]"
-syn region antlrAction matchgroup=antlrBrace start="[{\[]" end="[}\]]" contains=antlrVariable,antlrLiteral,antlrComment
-syn match antlrVariable contained "$[a-zA-Z][a-zA-Z_0-9]*"
-
-syn region antlrLiteral start=+'+ end=+'+ contains=antlrCharacter
-syn region antlrLiteral start=+"+ end=+"+ contains=antlrCharacter
-
-syn region antlrComment start="/\*" end="\*/"
-syn match antlrComment "//.*$"
-
-" Define the default highlighting.
-" For version 5.7 and earlier: only when not done already
-" For version 5.8 and later: only when an item doesn't have highlighting yet
-if version >= 508
- if version < 508
- let did_antlr_syntax_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink antlrLiteral String
- hi def antlrVariable term=bold cterm=bold gui=bold
- HiLink antlrBrace Operator
- HiLink antlrCharacter Special
- HiLink antlrComment Comment
- HiLink antlrOperator Operator
- HiLink antlrKeyword Keyword
- HiLink antlrToken PreProc
- HiLink antlrScopeVariable Identifier
- HiLink antlrRule Type
-
- delcommand HiLink
-endif
-
-" try to figure out the target language
-let target_languages = []
-" can we figure out from the file name
-let extensions = split(expand('%:t'), '\.')
-if len(extensions) >= 3
- " great.. the target language was provided via file name
- call add(target_languages, tolower(extensions[-2]))
-else
- " no multiple extensions... have to figure out from the content
- let buffer = join(getline(1, line('$')), "\n")
- let antlr_options = matchstr(buffer, '\m\(\_s\|;\)options\_s\+{\_.\{-\}}')
- call substitute(antlr_options, '\mlanguage\_s*=\_s*''\?\(.\{-\}\)''\?\_s*;', '\=add(target_languages, tolower(submatch(1)))', 'g')
-endif
-if exists('target_languages[-1]')
- " the last defined target language takes precendece
- let lang=target_languages[-1]
- let syntax_file = findfile('syntax/' . lang . '.vim', &rtp, 1)
- if syntax_file != ''
- " if a valid syntax file was found only
- let b:current_syntax = ''
- unlet b:current_syntax
- let region_name = '@' . lang . 'Language'
- exe 'syntax include ' . region_name . ' ' . syntax_file
- exe 'syntax region ' . lang . ' start="{" end="}" keepend contains=' . region_name
- endif
-endif
-
-let b:current_syntax = "antlr3"
diff --git a/files/vim/ftplugin/antlr/antlr4.vim b/files/vim/ftplugin/antlr/antlr4.vim
deleted file mode 100644
index 456076c..0000000
--- a/files/vim/ftplugin/antlr/antlr4.vim
+++ /dev/null
@@ -1,76 +0,0 @@
-" vim: ts=8
-" Vim syntax file
-" Language: ANTLRv4
-" Maintainer: Jrn Horstmann (updated by Dylon Edwards)
-" Last Change: 2015-12-15
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-syn keyword antlrKeyword import fragment lexer parser grammar returns locals throws catch finally mode options tokens header members init after channels mode protected public private
-
-syn keyword antlrReserved rule
-
-syn match antlrCharacter '\\\(r\|n\|t\|f\|b\|"\|\'\|\\\|u\x\{4}\)' contained display
-
-syn match antlrToken "\<[A-Z_][a-zA-Z_0-9]\+\>"
-syn match antlrRule "[a-z][a-zA-Z_0-9]\+"
-syn match antlrScopeVariable '$\k\+::\k\+'
-
-syn match antlrOperator "[:;@.]"
-syn match antlrOperator "[()]"
-syn match antlrOperator "[?+*~|!]"
-syn match antlrOperator "[->=^]"
-
-syn match antlrBlock "[{}]"
-syn region antlrAction matchgroup=antlrBlock start="{" end="}" contains=antlrVariable,antlrAction
-syn match antlrVariable contained "$[a-zA-Z][a-zA-Z_0-9]*"
-
-syn include @JAVA syntax/java.vim
-syn region ANTLR4EmbeddedJavaAction matchgroup=antlrBlock start="{" end="}" contains=@JAVA,antlrVariable containedin=antlrAction
-
-syn keyword antlrOperations pushMode popMode skip channel
-
-syn match antlrBrace "[\[\]]"
-syn region antlrCharClass matchgroup=antlrBrace start="\[" end="\]" contains=antlrCharacter
-
-syn region antlrLiteral start=+'+ end=+'+ contains=antlrCharacter
-syn region antlrLiteral start=+"+ end=+"+ contains=antlrCharacter
-
-syn region antlrComment start="/\*" end="\*/"
-syn match antlrComment "//.*$"
-
-" Define the default highlighting.
-" For version 5.7 and earlier: only when not done already
-" For version 5.8 and later: only when an item doesn't have highlighting yet
-if version >= 508
- if version < 508
- let did_antlr_syntax_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink antlrReserved Error
- HiLink antlrOperations Identifier
- HiLink antlrLiteral String
- hi def antlrVariable term=bold cterm=bold gui=bold
- HiLink antlrBrace Operator
- HiLink antlrBlock Operator
- HiLink antlrCharacter Special
- HiLink antlrComment Comment
- HiLink antlrOperator Operator
- HiLink antlrKeyword Keyword
- HiLink antlrToken PreProc
- HiLink antlrScopeVariable Identifier
- HiLink antlrRule Type
-
- delcommand HiLink
-endif
-
-let b:current_syntax = "antlr4"
diff --git a/files/vim/ftplugin/asciidoc/asciidoc.vim b/files/vim/ftplugin/asciidoc/asciidoc.vim
deleted file mode 100644
index b94b875..0000000
--- a/files/vim/ftplugin/asciidoc/asciidoc.vim
+++ /dev/null
@@ -1,19 +0,0 @@
-" ~/.vim/ftplugin/asciidoc/asciidoc.vim
-" asciidoc vim configuration
-"
-" Syntastic linter: proselint
-
-" Tabs hate: tabs are expanded to 2 spaces
-setlocal tabstop=2 shiftwidth=2 expandtab
-" Show existing tabs (they can be deleted with :retab)
-setlocal list
-
-" Column marker: 80 characters
-" call matchadd('ColorColumn', '\%81v', 100)
-setlocal textwidth=80
-
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/asciidoc/asciidoc.vim<CR>
-
-" Proselint is slow to act
-nnoremap <buffer> <leader>sp :SyntasticCheck proselint<CR>
-nnoremap <buffer> <leader>e :Errors<CR>
diff --git a/files/vim/ftplugin/cpp/cpp.vim b/files/vim/ftplugin/cpp/cpp.vim
deleted file mode 100644
index e2072c1..0000000
--- a/files/vim/ftplugin/cpp/cpp.vim
+++ /dev/null
@@ -1,28 +0,0 @@
-" ~/.vim/ftplugin/cpp/cpp.vim
-" C++-specific vim configuration
-
-let mapleader = " "
-
-" Column marker: 80 characters
-match ColorColumn /\%81v/
-setlocal textwidth=80
-
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/cpp/cpp.vim<CR>
-nnoremap <buffer> <leader>E :Errors<CR>
-
-nnoremap <buffer> <leader>c :w<CR>:!g++ "%"; ./a.out<Space>
-
-nnoremap <buffer> gd :YcmCompleter GoTo<CR>
-nnoremap <buffer> gr :YcmCompleter GoToReferences<CR>
-nnoremap <buffer> gh :YcmCompleter GetType<CR>
-nnoremap <buffer> gD :YcmCompleter GetDoc<CR>
-nnoremap <buffer> gR :YcmCompleter RefactorRename<Space>
-nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR>
-nnoremap <buffer> <leader>e :YcmDiags<CR>
-
-nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/cpp/snips/template.txt<CR>Gdd?<+++><CR>cf>
-
-let mapleader = ","
-
-inoremap <buffer> <leader>if if (<+++>) {<CR><++><CR>}?<+++><CR>cf>
-inoremap <buffer> <leader>for for (<+++>; <++>; <++>) {<CR><++><CR>}?<+++><CR>cf>
diff --git a/files/vim/ftplugin/cpp/snips/template.txt b/files/vim/ftplugin/cpp/snips/template.txt
deleted file mode 100644
index 90ef863..0000000
--- a/files/vim/ftplugin/cpp/snips/template.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <iostream>
-
-int main() {
- <+++>
- return 0;
-}
diff --git a/files/vim/ftplugin/css/css.vim b/files/vim/ftplugin/css/css.vim
deleted file mode 100644
index 695243c..0000000
--- a/files/vim/ftplugin/css/css.vim
+++ /dev/null
@@ -1,20 +0,0 @@
-" ~/.vim/ftplugin/css/css.vim
-" CSS-specific vim configuration
-"
-" Syntastic linters: csslint, prettycss, sstylelint
-
-"let g:syntastic_css_csslint_args = "--ignore=order-alphabetical,ids"
-
-setlocal textwidth=80
-call matchadd('ColorColumn', '\%81v', 100)
-
-" Tabs are expanded to 2 spaces
-setlocal tabstop=2 shiftwidth=2 expandtab
-" Don't show existing tabs
-setlocal nolist
-
-" Mappings
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/css/css.vim<CR>
-nnoremap <buffer> <leader>e :Errors<CR>
-nnoremap <buffer> <leader>s vi{!sort<CR>
-
diff --git a/files/vim/ftplugin/html/html.vim b/files/vim/ftplugin/html/html.vim
deleted file mode 100644
index 41890b4..0000000
--- a/files/vim/ftplugin/html/html.vim
+++ /dev/null
@@ -1,78 +0,0 @@
-" ~/.vim/ftplugin/html/html.vim
-" HTML-specific vim configuration
-"
-" Syntastic linter: tidy
-
-" Tabs are expanded to 2 spaces
-setlocal tabstop=2 shiftwidth=2 expandtab
-" Show existing tabs (they can be deleted with :retab)
-setlocal list
-
-" Column marker: 100 characters
-call matchadd('ColorColumn', '\%101v', 100)
-setlocal textwidth=100
-
-let mapleader = " "
-
-nnoremap <buffer> <leader>o :!$BROWSER % &<CR><CR>
-nnoremap <buffer> <leader>f :!firefox --new-window % &<CR><CR>
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/html/html.vim<CR>
-nnoremap <buffer> <leader>e :Errors<CR>
-
-nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/html/snips/template.txt<CR>Gdd?<+++><CR>cf>
-
-let mapleader = ","
-
-" Layout elements
-inoremap <buffer> <leader>hheader <header><Enter><Enter></header><Enter><++><Esc>kki
-inoremap <buffer> <leader>hnav <nav><Enter><Enter></nav><Enter><++><Esc>kki
-inoremap <buffer> <leader>hsection <section><Enter><Enter></section><Enter><++><Esc>kki
-inoremap <buffer> <leader>harticle <article><Enter><Enter></article><Enter><++><Esc>kki
-inoremap <buffer> <leader>hfooter <footer><Enter><Enter></footer><Enter><++><Esc>kki
-inoremap <buffer> <leader>haside <aside><Enter><Enter></aside><Enter><++><Esc>kki
-inoremap <buffer> <leader>hdiv <div class=""><Enter><++><Enter></div><Enter><++><Esc>?""<Enter>a
-
-" Headers and paragraphs
-inoremap <buffer> <leader>hh1 <h1></h1><Enter><++><Esc>?</h1><Enter>i
-inoremap <buffer> <leader>hh2 <h2></h2><Enter><++><Esc>?</h2><Enter>i
-inoremap <buffer> <leader>hh3 <h3></h3><Enter><++><Esc>?</h3><Enter>i
-inoremap <buffer> <leader>hh4 <h4></h4><Enter><++><Esc>?</h4><Enter>i
-inoremap <buffer> <leader>hh5 <h5></h5><Enter><++><Esc>?</h5><Enter>i
-inoremap <buffer> <leader>hh6 <h6></h6><Enter><++><Esc>?</h6><Enter>i
-inoremap <buffer> <leader>hp <p></p><Enter><++><Esc>?</p><Enter>i
-
-" Text formatting
-inoremap <buffer> <leader>hb <b></b><++><Esc>?</b><Enter>i
-inoremap <buffer> <leader>hi <i></i><++><Esc>?</i><Enter>i
-inoremap <buffer> <leader>hem <em></em><++><Esc>?</em><Enter>i
-inoremap <buffer> <leader>hcode <code></code><++><Esc>?</code><Enter>i
-inoremap <buffer> <leader>hsub <sub></sub><++><Esc>?</sub><Enter>i
-inoremap <buffer> <leader>hsup <sup></sup><++><Esc>?</sup><Enter>i
-inoremap <buffer> <leader>hcite <cite></cite><++><Esc>?</cite><Enter>i
-
-" Tables
-inoremap <buffer> <leader>htable <table border=""><Enter><caption><++></caption><Enter><thead><Enter><tr><Enter><++><Enter></tr><Enter></thead><Enter><tbody><Enter><++><Enter></tbody><Enter></table><Enter><++><Esc>?""<Enter>a
-inoremap <buffer> <leader>htr <tr><Enter><Enter></tr><Enter><++><Esc>kki
-inoremap <buffer> <leader>hth <th></th><Enter><++><Esc>?</<Enter>i
-inoremap <buffer> <leader>htd <td></td><Enter><++><Esc>?</<Enter>i
-
-" Lists
-inoremap <buffer> <leader>hul <ul><Enter><li></li><Enter><++><Enter></ul><Enter><++><Esc>?</l<Enter>i
-inoremap <buffer> <leader>hol <ol><Enter><li></li><Enter><++><Enter></ol><Enter><++><Esc>?</l<Enter>i
-inoremap <buffer> <leader>hli <li></li><Enter><++><Esc>?</<Enter>i
-
-" Forms
-inoremap <buffer> <leader>hform <form><Enter><fieldset><Enter><Enter></fieldset><Enter></form><Enter><++><Esc>3ki
-inoremap <buffer> <leader>hfs <fieldset><Enter><Enter></fieldset><Enter><++><Esc>kki
-inoremap <buffer> <leader>hlegend <legend></legend><Enter><++><Esc>?</<Enter>i
-inoremap <buffer> <leader>hlabel <label><input type="<++>"></label><Enter><++><Esc>?<i<Enter>i
-
-" Media
-inoremap <buffer> <leader>ha <a href=""><++></a><Enter><++><Esc>?""<Enter>a
-inoremap <buffer> <leader>himg <img src="" alt="<++>"><Enter><++><Esc>?""<Enter>a
-
-" Misc
-" Comment a line
-nnoremap <buffer> <leader>hc I<!-- <Esc>A --><Esc>0
-" Uncomment a line
-nnoremap <buffer> <leader>hC 05x/--><Enter>3x0
diff --git a/files/vim/ftplugin/html/snips/template.txt b/files/vim/ftplugin/html/snips/template.txt
deleted file mode 100644
index 38d9f26..0000000
--- a/files/vim/ftplugin/html/snips/template.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title><+++></title>
-</head>
-
-<body>
-
- <++>
-
-</body>
-</html>
diff --git a/files/vim/ftplugin/java/java.vim b/files/vim/ftplugin/java/java.vim
deleted file mode 100644
index 2595b32..0000000
--- a/files/vim/ftplugin/java/java.vim
+++ /dev/null
@@ -1,14 +0,0 @@
-" ~/.vim/ftplugin/java.vim
-" Java-specific vim configuration
-
-call matchadd('ColorColumn', '\%131v', 100)
-
-let g:syntastic_java_checkers = []
-
-nnoremap <buffer> <leader>gt :YcmCompleter GoTo<CR>
-nnoremap <buffer> <leader>gr :YcmCompleter GoToReferences<CR>
-nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR>
-nnoremap <buffer> <leader>rr :YcmCompleter RefactorRename<Space>
-nnoremap <buffer> <leader>e :YcmDiags<CR>
-nnoremap <buffer> <leader>R :!./run.sh<CR>
-
diff --git a/files/vim/ftplugin/javascript/javascript.vim b/files/vim/ftplugin/javascript/javascript.vim
deleted file mode 100644
index 4935410..0000000
--- a/files/vim/ftplugin/javascript/javascript.vim
+++ /dev/null
@@ -1,38 +0,0 @@
-" ~/.vim/ftplugin/javascript/javascript.vim
-" JavaScript-specific vim configuration
-"
-" Syntastic linters: jslint
-
-" JSLint arguments
-" let g:syntastic_javascript_jslint_args = "--browser --indent"
-
-" ALE
-let b:ale_linters = ['eslint']
-
-" Tabs are expanded to 4 spaces
-setlocal tabstop=4 shiftwidth=4 expandtab
-" Show existing tabs (they can be deleted with :retab)
-setlocal list
-
-" Column marker: 110 characters
-call matchadd('ColorColumn', '\%111v', 100)
-setlocal textwidth=110
-
-" Mappings
-
-let mapleader = " "
-
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/javascript/javascript.vim<CR>
-
-nnoremap <buffer> gd :YcmCompleter GoTo<CR>
-nnoremap <buffer> gr :YcmCompleter GoToReferences<CR>
-nnoremap <buffer> gh :YcmCompleter GetType<CR>
-nnoremap <buffer> gD :YcmCompleter GetDoc<CR>
-nnoremap <buffer> gR :YcmCompleter RefactorRename<Space>
-nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR>
-nnoremap <buffer> <leader>e :YcmDiags<CR>
-
-let mapleader = ","
-
-inoremap <buffer> <leader>if if (<+++>) {<CR><++><CR>} <++><Esc>?<+++><CR>cf>
-inoremap <buffer> <leader>else else {<CR><+++><CR>}<CR><++><Esc>?<+++><CR>cf>
diff --git a/files/vim/ftplugin/plantuml/plantuml.vim b/files/vim/ftplugin/plantuml/plantuml.vim
deleted file mode 100644
index e493e5b..0000000
--- a/files/vim/ftplugin/plantuml/plantuml.vim
+++ /dev/null
@@ -1,21 +0,0 @@
-" ~/.vim/ftplugin/plantuml/plantuml.vim
-" PlantUML-specific vim configuration
-
-" Tabs hate: tabs are expanded to 4 spaces
-setlocal tabstop=4 shiftwidth=4 expandtab
-" Show existing tabs (they can be deleted with :retab)
-setlocal list
-
-" Column marker: 80 characters
-call matchadd('ColorColumn', '\%81v', 100)
-setlocal textwidth=80
-
-let mapleader = " "
-
-nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/plantuml/snips/template.txt<CR>Gdd?<+++><CR>cf>
-
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/plantuml/plantuml.vim<CR>
-nnoremap <buffer> <leader>e :Errors<CR>
-
-nnoremap <buffer> <leader>c :w<CR>:!compilePlantUML.sh "%"<CR><CR>
-nnoremap <buffer> <leader>o :w<CR>:!compilePlantUML.sh -o "%"<CR><CR>
diff --git a/files/vim/ftplugin/plantuml/snips/template.txt b/files/vim/ftplugin/plantuml/snips/template.txt
deleted file mode 100644
index f649539..0000000
--- a/files/vim/ftplugin/plantuml/snips/template.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-@startuml
-
-class <+++> {
- <++>
-}
-
-<++>
-
-@enduml
diff --git a/files/vim/ftplugin/python/python.vim b/files/vim/ftplugin/python/python.vim
deleted file mode 100644
index 7246eed..0000000
--- a/files/vim/ftplugin/python/python.vim
+++ /dev/null
@@ -1,16 +0,0 @@
-" ~/.vim/ftplugin/python/python.vim
-" Python-specific vim configuration
-
-" Column marker: 80 characters
-call matchadd('ColorColumn', '\%81v', 100)
-"let b:syntastic_mode="passive"
-
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/python/python.vim<CR>
-nnoremap <buffer> <leader>E :Errors<CR>
-
-nnoremap <buffer> <leader>gt :YcmCompleter GoTo<CR>
-nnoremap <buffer> <leader>gr :YcmCompleter GoToReferences<CR>
-nnoremap <buffer> <leader>gd :YcmCompleter GetDoc<CR>
-nnoremap <buffer> <leader>gT :YcmCompleter GetType<CR>
-nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR>
-nnoremap <buffer> <leader>e :YcmDiags<CR>
diff --git a/files/vim/ftplugin/sent/sent.vim b/files/vim/ftplugin/sent/sent.vim
deleted file mode 100644
index c5813d5..0000000
--- a/files/vim/ftplugin/sent/sent.vim
+++ /dev/null
@@ -1,9 +0,0 @@
-" ~/.vim/ftplugin/sent/sent.vim
-" Vim configuration for writing sent presentations
-
-call matchadd('ColorColumn', '\%21v')
-setlocal textwidth=20
-
-setlocal spell
-
-nnoremap ,r :w<CR>:!sent % & <CR><CR>
diff --git a/files/vim/ftplugin/sh/sh.vim b/files/vim/ftplugin/sh/sh.vim
deleted file mode 100644
index 3eb4da5..0000000
--- a/files/vim/ftplugin/sh/sh.vim
+++ /dev/null
@@ -1,16 +0,0 @@
-" ~/.vim/ftplugin/sh.vim
-" Bourne shell scripts specific vim configuration
-"
-" Linters: sh, shellcheck
-
-call matchadd('ColorColumn', '\%111v', 100)
-setlocal textwidth=110
-
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/sh/sh.vim<CR>
-nnoremap <buffer> <leader>+x :!chmod 744 %<CR><CR>
-nnoremap <buffer> <leader>x :w<CR>:!./%<Space>
-nnoremap <buffer> <leader>e :Errors<CR>
-
-inoremap <buffer> <leader>sh #!/bin/sh
-inoremap <buffer> <leader>if if <+++>; then<CR><++><CR>fi<++><Esc>?<+++><CR>cf>
-"inoremap <buffer> <leader>if <Esc>:read ~/.vim/ftplugin/sh/snippets/if.txt<CR>kdd/<+++><CR>cf>
diff --git a/files/vim/ftplugin/sh/snippets/if.txt b/files/vim/ftplugin/sh/snippets/if.txt
deleted file mode 100644
index 9f6bb88..0000000
--- a/files/vim/ftplugin/sh/snippets/if.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-if <+++>; then
- <++>
-fi<++>
diff --git a/files/vim/ftplugin/tex/snips/template.txt b/files/vim/ftplugin/tex/snips/template.txt
deleted file mode 100644
index 1f4bd46..0000000
--- a/files/vim/ftplugin/tex/snips/template.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-\documentclass{article}
-
-\usepackage{geometry}
-\usepackage{graphicx}
-\usepackage{booktabs}
-
-\geometry{left=4.5cm,top=2cm,bottom=2cm,right=4.5cm}
-
-\renewcommand{\contentsname}{Contenidos}
-\renewcommand{\figurename}{Figura}
-
-\begin{document}
-
-\frenchspacing
-
-\title{<+++>}
-
-\author{<++>}
-
-\date{}
-
-\maketitle
-
-\tableofcontents
-
-\section{<++>}
-
-<++>
-
-\end{document}
diff --git a/files/vim/ftplugin/tex/tex.vim b/files/vim/ftplugin/tex/tex.vim
deleted file mode 100644
index e440561..0000000
--- a/files/vim/ftplugin/tex/tex.vim
+++ /dev/null
@@ -1,38 +0,0 @@
-" ~/.vim/ftplugin/tex.vim
-" LaTeX-specific vim configuration
-
-" Syntastic linters: chktex, lacheck, proselint
-
-call matchadd('ColorColumn', '\%91v', 100)
-setlocal textwidth=80
-
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/tex/tex.vim<CR>
-nnoremap <buffer> <leader>e :Errors<CR>
-" proselint not enabled by default (it's slow)
-"nnoremap <buffer> <leader>sp :SyntasticCheck proselint<CR>
-
-nnoremap <buffer> <leader>c :w<Enter>:! toPDF.sh %<CR>
-nnoremap <buffer> <leader>o :w<Enter>:! toPDF.sh -o %<CR><CR>
-
-nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/tex/snips/template.txt<CR>/<+++><CR>cf>
-
-inoremap <buffer> <leader>ldocclass \documentclass{}<Esc>o<++><Esc>k$i
-inoremap <buffer> <leader>lpckg \usepackage{}<Esc>o<++><Esc>k$i
-inoremap <buffer> <leader>lbdoc \begin{document}<Esc>o<Enter><Enter><Enter>\end{document}<Esc>kkI
-inoremap <buffer> <leader>lauthor \author{}<Esc>o<++><Esc>k$i
-inoremap <buffer> <leader>ltitle \title{}<Esc>o<++><Esc>k$i
-inoremap <buffer> <leader>lsection \section{}<Esc>o<++><Esc>k$i
-inoremap <buffer> <leader>lssection \subsection{}<Esc>o<++><Esc>k$i
-inoremap <buffer> <leader>lsssection \subsubsection{}<Esc>o<++><Esc>k$i
-inoremap <buffer> <leader>lssssection \paragraph{}<Esc>o<++><Esc>k$i
-inoremap <buffer> <leader>lsssssection \subparagraph{}<Esc>o<++><Esc>k$i
-inoremap <buffer> <leader>lb \textbf{}<++><Esc>F}i
-inoremap <buffer> <leader>li \textit{}<++><Esc>F}i
-inoremap <buffer> <leader>lemph \emph{}<++><Esc>F}i
-inoremap <buffer> <leader>llabel \label{}<++><Esc>F}i
-inoremap <buffer> <leader>lref ~\ref{}<++><Esc>F}i
-inoremap <buffer> <leader>lenumerate \begin{enumerate}<Esc>o<Enter><Enter><Enter>\end{enumerate}<Esc>kkI\item<Enter><Esc>I<Tab><++><Esc>k<<i<Tab><Esc>$a<Space>
-inoremap <buffer> <leader>litemize \begin{itemize}<Esc>o<Enter><Enter><Enter>\end{itemize}<Esc>kkI\item<Enter><Esc>I<Tab><++><Esc>k<<i<Tab><Esc>$a<Space>
-inoremap <buffer> <leader>litem \item<Enter><++><Esc>k$a<Space>
-inoremap <buffer> <leader>limage \begin{figure}[H]<Enter>\begin{center}<Enter>\includegraphics[width=\textwidth]{}<Enter>\caption{<++>}<Enter>\end{center}<Enter>\end{figure}<Enter><++><Esc>4k$i
-inoremap <buffer> <leader>ltable \begin{table}[H]<Enter>\makebox[\linewidth]{\centering<Enter>\centering<Enter>\begin{tabular}{c<Space>cxxx}<Enter>\toprule<Enter><++><Space>&<Space><++><Space>\\<Enter>\midrule<Enter><++><Space>&<Space><++><Space>\\<Enter>\bottomrule<Enter>\end{tabular}<Enter>}<Enter>\end{table}<Enter><++><Esc>?xxx<Enter>cw
diff --git a/files/vim/ftplugin/text/text.vim b/files/vim/ftplugin/text/text.vim
deleted file mode 100644
index 406c1e1..0000000
--- a/files/vim/ftplugin/text/text.vim
+++ /dev/null
@@ -1,18 +0,0 @@
-" ~/.vim/ftplugin/text/text.vim
-" Plain text files vim configuration
-"
-" Syntastic linter: proselint
-
-" Tabs hate: tabs are expanded to 2 spaces
-setlocal tabstop=2 shiftwidth=2 expandtab
-" Show existing tabs (they can be deleted with :retab)
-setlocal list
-
-call matchadd('ColorColumn', '\%101v', 100)
-setlocal textwidth=100
-
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/text/text.vim<CR>
-
-" Proselint is slow to act
-nnoremap <buffer> <leader>sp :SyntasticCheck proselint<CR>
-nnoremap <buffer> <leader>e :Errors<CR>
diff --git a/files/vim/ftplugin/typescript/typescript.vim b/files/vim/ftplugin/typescript/typescript.vim
deleted file mode 100644
index 7c91032..0000000
--- a/files/vim/ftplugin/typescript/typescript.vim
+++ /dev/null
@@ -1,33 +0,0 @@
-" ~/.vim/ftplugin/typescript/typescript.vim
-" TypeScript-specific vim configuration
-
-" ALE
-let b:ale_linters = ['eslint']
-
-" Tabs are expanded to 4 spaces
-setlocal tabstop=4 shiftwidth=4 expandtab
-" Show existing tabs (they can be deleted with :retab)
-setlocal list
-
-" Column marker: 110 characters
-call matchadd('ColorColumn', '\%111v', 100)
-setlocal textwidth=110
-
-" Mappings
-
-let mapleader = " "
-
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/typescript/typescript.vim<CR>
-
-nnoremap <buffer> gd :YcmCompleter GoTo<CR>
-nnoremap <buffer> gr :YcmCompleter GoToReferences<CR>
-nnoremap <buffer> gh :YcmCompleter GetType<CR>
-nnoremap <buffer> gD :YcmCompleter GetDoc<CR>
-nnoremap <buffer> gR :YcmCompleter RefactorRename<Space>
-nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR>
-nnoremap <buffer> <leader>e :YcmDiags<CR>
-
-let mapleader = ","
-
-inoremap <buffer> <leader>if if (<+++>) {<CR><++><CR>} <++><Esc>?<+++><CR>cf>
-inoremap <buffer> <leader>else else {<CR><+++><CR>}<CR><++><Esc>?<+++><CR>cf>
diff --git a/files/vim/ftplugin/vimwiki/snips/plantUml.txt b/files/vim/ftplugin/vimwiki/snips/plantUml.txt
deleted file mode 100644
index 4a016eb..0000000
--- a/files/vim/ftplugin/vimwiki/snips/plantUml.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-```{.plantuml caption="<+++>"}
-@startuml
-<++>
-@enduml
-```
diff --git a/files/vim/ftplugin/vimwiki/snips/template.txt b/files/vim/ftplugin/vimwiki/snips/template.txt
deleted file mode 100644
index f6b16a8..0000000
--- a/files/vim/ftplugin/vimwiki/snips/template.txt
+++ /dev/null
@@ -1,15 +0,0 @@
----
-header-includes:
- - \usepackage[margin=1.5in]{geometry}
-
-title: "Title"
-author:
-- Íñigo Gutiérrez Fernández
-
- \
-
- UO238186
-date: "10/04/2020"
----
-
-# Introducción
diff --git a/files/vim/ftplugin/vimwiki/vimwiki.vim b/files/vim/ftplugin/vimwiki/vimwiki.vim
deleted file mode 100644
index e8f7a18..0000000
--- a/files/vim/ftplugin/vimwiki/vimwiki.vim
+++ /dev/null
@@ -1,33 +0,0 @@
-" ~/.vim/ftplugin/vimwiki.vim
-" vimwiki-specific vim configuration
-"
-" Syntastic linter: mdl, proselint, textlint
-
-"let g:syntastic_vimwiki_checkers = ['markdown/mdl']
-
-" Tabs hate: tabs are expanded to 2 spaces
-setlocal tabstop=2 shiftwidth=2 expandtab
-" Show existing tabs (they can be deleted with :retab)
-setlocal list
-
-" Text width
-match ColorColumn /\%81v/
-setlocal textwidth=80
-setlocal linebreak
-
-" Syntax highlighting colors
-highlight Title ctermfg=blue
-highlight TitleHash ctermfg=cyan
-match TitleHash /^##*/
-
-nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/vimwiki/vimwiki.vim<CR>
-nnoremap <buffer> <leader>e :Errors<CR>
-
-nnoremap <buffer> <leader>tt :r ~/.vim/ftplugin/vimwiki/snips/template.txt<CR>
-nnoremap <buffer> <leader>tp :r ~/.vim/ftplugin/vimwiki/snips/plantUml.txt<CR>/<+++><CR>cf>
-
-nnoremap <buffer> <leader>c :w<CR>:!toPDF.sh "%"<CR><CR>
-nnoremap <buffer> <leader>o :w<CR>:!toPDF.sh -o "%"<CR><CR>
-
-inoremap <buffer> <leader>h <Esc><<A
-inoremap <buffer> <leader>l <Esc>>>A
diff --git a/files/vim/plugin/SWTC.vim b/files/vim/plugin/SWTC.vim
deleted file mode 100644
index 9459e92..0000000
--- a/files/vim/plugin/SWTC.vim
+++ /dev/null
@@ -1,339 +0,0 @@
-" Vim global plugin for Star Wars crawls
-" Maintainer: Damian Conway
-" License: This file is placed in the public domain.
-
-"######################################################################
-"## ##
-"## To use: ##
-"## ##
-"## :SWTC <filename> ##
-"## ##
-"## See file 'intro.swtc' for the crawl-specification syntax ##
-"## ##
-"######################################################################
-
-
-" If already loaded, we're done...
-if exists("loaded_SWcrawl")
- finish
-endif
-let loaded_SWcrawl = 1
-
-" Preserve external compatibility options, then enable full vim compatibility...
-let s:save_cpo = &cpo
-set cpo&vim
-
-" Set up the actual colon command...
-command! -nargs=1 -complete=file SWTC call SWcrawl(<f-args>)
-
-
-" Implementation....
-
-let s:CRAWL_SPEED = 1 "(lines per second)
-let s:STAR_DENSITY = 50 "(pixels per star, i.e. 1 star per STAR_DENSITY pixels)
-let s:STARFIELD_HEIGHT = 2 "(screens deep)
-
-let s:LOGO_LINE1 = '^\s*\[\zs.*\ze\]\s*$'
-let s:LOGO_LINE2 = '^\s*\[\[\zs.*\ze\]\]\s*$'
-let s:LOGO_LINE3 = '^\s*\[\[\[\zs.*\ze\]\]\]\s*$'
-let s:LOGO_LINE4 = '^\s*\[\[\[\[\zs.*\ze\]\]\]\]\s*$'
-let s:CENTRED_CRAWL_LINE = '^\s*[>]\s*\zs.\{-}\ze\s*[<]\s*$'
-let s:CRAWL_LINE = '^\s*[|]\s*\zs.\{-}\ze\s*[|]\s*$'
-let s:PREFACE_LINE = '^\s*\zs.\{-}\ze\s*$'
-
-highlight SWC_PREFACE ctermfg=cyan
-highlight SWC_FADE_LIGHT ctermfg=cyan
-highlight SWC_FADE_DARK ctermfg=blue
-highlight SWC_LOGO ctermfg=yellow cterm=bold
-highlight SWC_CRAWL ctermfg=yellow
-highlight SWC_STAR ctermfg=white
-highlight SWC_BLACK ctermfg=black ctermbg=black
-
-let s:PREFACE_POS = { 'x': 10, 'y': 5 }
-
-function! SWcrawl (textsource)
- " Load preface, logo, and text to be crawled...
- let preface = []
- let logo1 = []
- let logo2 = []
- let logo3 = []
- let logo4 = []
- let crawl = []
- let centred = []
- let max_crawl_width = 0
- for nextline in readfile(a:textsource)
- " Ignore blank lines...
- if nextline =~ '^\s*$'
- continue
-
- " Lines in [...] are logo components...
- elseif nextline =~ s:LOGO_LINE4
- let logo4 += [ matchstr(nextline, s:LOGO_LINE4) ]
- elseif nextline =~ s:LOGO_LINE3
- let logo3 += [ matchstr(nextline, s:LOGO_LINE3) ]
- elseif nextline =~ s:LOGO_LINE2
- let logo2 += [ matchstr(nextline, s:LOGO_LINE2) ]
- elseif nextline =~ s:LOGO_LINE1
- let logo1 += [ matchstr(nextline, s:LOGO_LINE1) ]
-
- " Lines in |...| are crawl components...
- elseif nextline =~ s:CRAWL_LINE
- let next_crawl = matchstr(nextline, s:CRAWL_LINE)
- if strlen(next_crawl) > max_crawl_width
- let max_crawl_width = strlen(substitute(next_crawl,'\s\+',' ','g'))
- endif
- let crawl += [ next_crawl ]
- let centred += [ 0 ]
-
- " Lines in >...< are centred crawl components...
- elseif nextline =~ s:CENTRED_CRAWL_LINE
- let next_crawl = matchstr(nextline, s:CENTRED_CRAWL_LINE)
- if strlen(next_crawl) > max_crawl_width
- let max_crawl_width = strlen(substitute(next_crawl,'\s\+',' ','g'))
- endif
- let crawl += [ next_crawl ]
- let centred += [ 1 ]
-
- " Anything else is preface...
- else
- let preface += [ substitute(matchstr(nextline, s:PREFACE_LINE), "^\s*", repeat(" ",s:PREFACE_POS.x), '') ]
-
- endif
- endfor
-
- " Ensure all logos available...
- let logo1 = len(logo1) ? logo1 : ["YOUR", "LOGO", "HERE"]
- let logo2 = len(logo2) ? logo2 : copy(logo1)
- let logo3 = len(logo3) ? logo3 : copy(logo2)
- let logo4 = len(logo4) ? logo4 : copy(logo3)
-
- " Save current buffer for final transition effect...
- let original_buffer = getline(1,'$')
-
- " Switch to a new buffer...
- let prev_matches = getmatches()
- enew!
- let b:WIN = { 'x' : winwidth(0), 'y' : winheight(0) }
- call setline(1, repeat([""], b:WIN.y + 1))
-
- " And hide annoyances...
- set lcs=
- let old_rulerformat = &rulerformat
- let &rulerformat="%#SWC_BLACK#%l"
- echo ""
-
- " Generate starfield...
- let stars = SWC_gen_stars()
-
- " Clear screen...
- call setline(1, repeat([""], s:STARFIELD_HEIGHT * b:WIN.y) + original_buffer)
- redraw
- sleep 2
-
- " Start with preface...
- call matchadd('SWC_PREFACE', '.', 100)
- call setline(s:PREFACE_POS.y, preface)
- echo ""
- redraw
- sleep 5
-
- " Clean up...
- call clearmatches()
- call setline(s:PREFACE_POS.y, repeat([""], len(preface)))
- echo ""
- redraw
- sleep 1
-
- " Then show logo receding at centre of screen...
- call clearmatches()
- call matchadd('SWC_BLACK', '*', 102)
- call matchadd('SWC_STAR', '\s\zs[.]\ze\s', 101)
- call matchadd('SWC_LOGO', '.', 100)
- call SWC_draw_logo(logo1)
- call SWC_paint_stars(stars)
- echo ""
- redraw
- sleep 3
-
- " Push it away...
- call setline(1, repeat([""], b:WIN.y))
- call SWC_draw_logo(logo2)
- call SWC_paint_stars(stars)
- echo ""
- redraw
- sleep 500m
-
- call setline(1, repeat([""], b:WIN.y))
- call SWC_draw_logo(logo3)
- call SWC_paint_stars(stars)
- echo ""
- redraw
- sleep 500m
-
- call setline(1, repeat([""], b:WIN.y))
- call SWC_draw_logo(logo4)
- call SWC_paint_stars(stars)
- echo ""
- redraw
- sleep 500m
-
-
- " Clean up...
- call clearmatches()
- call matchadd('SWC_STAR', '\s\zs[.]\ze\s', 101)
- call setline(1, repeat([""], b:WIN.y))
- call SWC_paint_stars(stars)
- echo ""
- redraw
- sleep 2
-
- " Run crawl...
- call clearmatches()
- call matchadd('SWC_CRAWL', '.', 100)
- call matchadd('SWC_STAR', '\s\zs[.]\ze\s', 101)
- for offset_from_bottom in range(1, len(crawl) + b:WIN.y)
- let crawl_line = offset_from_bottom < b:WIN.y ? 0 : offset_from_bottom - b:WIN.y + 1
- for screen_line in range(1, b:WIN.y)
- if screen_line >= b:WIN.y - offset_from_bottom && crawl_line < len(crawl)
- let padded_line = SWC_pad(crawl[crawl_line], screen_line, centred[crawl_line], max_crawl_width)
- call setline(screen_line, padded_line)
- let crawl_line += 1
- else
- call setline(screen_line, "")
- endif
- endfor
- call SWC_paint_stars(stars)
- echo ""
- redraw
- exec 'sleep ' . s:trunc(1000/s:CRAWL_SPEED) . 'm'
- if getchar(0) || offset_from_bottom > len(crawl) && padded_line !~ '\S'
- break
- endif
- endfor
-
- " Pan starfield down...
- call matchadd('SWC_FADE_DARK', '[^.]', 200)
- sleep 200m
- for offset_from_top in range(1, s:STARFIELD_HEIGHT * b:WIN.y)
- 1delete
- redraw
- exec 'sleep ' . (200 - 2 * offset_from_top) . 'm'
- endfor
- sleep 200m
-
-
- " Switch back to previous buffer and restore normal highlighting...
- edit! #
- call setmatches(prev_matches)
- let &rulerformat = old_rulerformat
- redraw
-
-endfunction
-
-function s:trunc (n)
- return str2nr(string( a:n ))
-endfunction
-
-function! SWC_draw_logo (logo)
- let logo = copy(a:logo)
-
- " Find centre for logo...
- let logo_width = 0
- for line in logo
- if strlen(line) > logo_width
- let logo_width = strlen(line)
- endif
- endfor
- let logo_pos_x = (b:WIN.x - logo_width) / 2
- let logo_pos_y = (b:WIN.y - len(logo)) / 2
-
- " Move logo to centre...
- call map(logo, "repeat(' ', logo_pos_x) . v:val")
-
- " Draw logo
- call setline(logo_pos_y, logo)
-
-endfunction
-
-function! SWC_pad (text, y_pos, centred, max_text_width)
-
- " Does this need padding???
- let words = split(a:text, '\s\+')
- if len(words) < 1
- return a:text
- endif
-
- " How many unpadded characters are there???
- let unpadded_width = 0
- for word in words
- let unpadded_width += strlen(word)
- endfor
-
- " How much padding is needed???
- let rel_y = (2.0 * a:y_pos / b:WIN.y) - 1.0
- let stretched_width = s:trunc( a:max_text_width + rel_y * (b:WIN.x - a:max_text_width) )
- let required_padding = max([ 0, stretched_width - unpadded_width ])
- let indent = (b:WIN.x - stretched_width) / 2
- let gap_count = len(words) - 1
-
- " Is this a last line???
- let tight = a:centred || strlen(a:text) < 0.9 * a:max_text_width
-
- " Insert padding...
- if a:y_pos >= b:WIN.y/2
- let min_padding_needed_for = gap_count
- if tight
- let min_pad_per_gap = max([ 1, s:trunc(rel_y * 6.0) ])
- else
- let min_pad_per_gap = max([ 1, required_padding / gap_count ])
- let leftover_padding = required_padding - gap_count * min_pad_per_gap
- let min_padding_needed_for = min([ gap_count, gap_count - leftover_padding ])
- endif
- let padded_text = join(words[0 : min_padding_needed_for], repeat(" ", min_pad_per_gap))
- \ . repeat(" ", min_pad_per_gap+1)
- \ . join(words[min_padding_needed_for+1 : -1], repeat(" ", min_pad_per_gap+1))
- let padded_text = substitute(padded_text, '\s*$', '', '')
-
- " Or remove chars (in the distance)...
- elseif a:text =~ '\S'
-" let delta = s:trunc( 8.0 * (b:WIN.y/2 - a:y_pos) )
-" let greeked_len = max([ 0, strlen(substitute(a:text, '^\s*\|\s*$', '', 'g')) - delta ])
- let greeked_len = tight ? stretched_width * (unpadded_width + gap_count) / a:max_text_width : stretched_width
- let padded_text = repeat('~', greeked_len)
-
- " Or ignore it...
- else
- let padded_text = ""
-
- endif
-
- " Indent to centre...
- let padded_text = substitute(padded_text, '\s*$', '', '')
- let max_ever_padding = b:WIN.x - a:max_text_width
- let indent = a:centred ? (b:WIN.x - strlen(padded_text))/2
- \ : indent
- return repeat(" ", indent) . padded_text
-endfunction
-
-function! SWC_gen_stars ()
- let star_count = b:WIN.x * s:STARFIELD_HEIGHT * b:WIN.y / s:STAR_DENSITY
- let stars = []
- for n in range(star_count)
- let x = RandomNumber(b:WIN.x) + 1
- let y = RandomNumber(s:STARFIELD_HEIGHT * b:WIN.y) + 1
- let stars += [{'y':y,'x':x}]
- endfor
- return stars
-endfunction
-
-function! SWC_paint_stars (stars)
- let max_x = b:WIN.x
- for star in a:stars
- let line = strpart(getline(star.y) . repeat(" ", max_x), 0, max_x)
- let line = substitute(line, '\s\zs\%'.(star.x-1).'c\s\ze\s', '.', '')
- call setline(star.y, line)
- endfor
-endfunction
-
-" Restore previous external compatibility options
-let &cpo = s:save_cpo
diff --git a/files/vim/plugin/dragvisuals.vim b/files/vim/plugin/dragvisuals.vim
deleted file mode 100644
index 12c4f5d..0000000
--- a/files/vim/plugin/dragvisuals.vim
+++ /dev/null
@@ -1,345 +0,0 @@
-" Vim global plugin for dragging virtual blocks
-" Last change: Tue Jul 24 07:19:35 EST 2012
-" Maintainer: Damian Conway
-" License: This file is placed in the public domain.
-
-"#########################################################################
-"## ##
-"## Add the following (uncommented) to your .vimrc... ##
-"## ##
-"## runtime plugin/dragvisuals.vim ##
-"## ##
-"## vmap <expr> <LEFT> DVB_Drag('left') ##
-"## vmap <expr> <RIGHT> DVB_Drag('right') ##
-"## vmap <expr> <DOWN> DVB_Drag('down') ##
-"## vmap <expr> <UP> DVB_Drag('up') ##
-"## vmap <expr> D DVB_Duplicate() ##
-"## ##
-"## " Remove any introduced trailing whitespace after moving... ##
-"## let g:DVB_TrimWS = 1 ##
-"## ##
-"## Or, if you use the arrow keys for normal motions, choose ##
-"## four other keys for block dragging. For example: ##
-"## ##
-"## vmap <expr> h DVB_Drag('left') ##
-"## vmap <expr> l DVB_Drag('right') ##
-"## vmap <expr> j DVB_Drag('down') ##
-"## vmap <expr> k DVB_Drag('up') ##
-"## ##
-"## Or: ##
-"## ##
-"## vmap <expr> <S-LEFT> DVB_Drag('left') ##
-"## vmap <expr> <S-RIGHT> DVB_Drag('right') ##
-"## vmap <expr> <S-DOWN> DVB_Drag('down') ##
-"## vmap <expr> <S-UP> DVB_Drag('up') ##
-"## ##
-"## Or even: ##
-"## ##
-"## vmap <expr> <LEFT><LEFT> DVB_Drag('left') ##
-"## vmap <expr> <RIGHT><RIGHT> DVB_Drag('right') ##
-"## vmap <expr> <DOWN><DOWN> DVB_Drag('down') ##
-"## vmap <expr> <UP><UP> DVB_Drag('up') ##
-"## ##
-"#########################################################################
-
-
-" If already loaded, we're done...
-if exists("loaded_dragvirtualblocks")
- finish
-endif
-let loaded_dragvirtualblocks = 1
-
-" Preserve external compatibility options, then enable full vim compatibility...
-let s:save_cpo = &cpo
-set cpo&vim
-
-"====[ Implementation ]====================================
-
-" Toggle this to stop trimming on drags...
-if !exists('g:DVB_TrimWS')
- let g:DVB_TrimWS = 1
-endif
-
-function! DVB_Drag (dir)
- " No-op in Visual mode...
- if mode() ==# 'v'
- return "\<ESC>gv"
-
- " Do Visual Line drag indirectly via temporary nmap
- " (to ensure we have access to block position data)...
- elseif mode() ==# 'V'
- " Set up a temporary convenience...
- exec "nnoremap <silent><expr><buffer> M \<SID>Drag_Lines('".a:dir."')"
-
- " Return instructions to implement the move and reset selection...
- return '"vyM'
-
- " Otherwise do Visual Block drag indirectly via temporary nmap
- " (to ensure we have access to block position data)...
- else
- " Set up a temporary convenience...
- exec "nnoremap <silent><expr><buffer> M \<SID>Drag_Block('".a:dir."')"
-
- " Return instructions to implement the move and reset selection...
- return '"vyM'
- endif
-endfunction
-
-" Duplicate selected block and place to the right...
-function! DVB_Duplicate ()
- exec "nnoremap <silent><expr><buffer> M \<SID>DuplicateBlock()"
- return '"vyM'
-endfunction
-
-function! s:DuplicateBlock ()
- nunmap <buffer> M
- " Locate block boundaries...
- let [buf_left, line_left, col_left, offset_left ] = getpos("'<")
- let [buf_right, line_right, col_right, offset_right] = getpos("'>")
-
- " Identify special '$' blocks...
- let dollar_block = 0
- let start_col = min([col_left+offset_left, col_right+offset_right])
- let end_col = max([col_left+offset_left, col_right+offset_right])
- let visual_width = end_col - start_col + 1
- for visual_line in split(getreg("v"),"\n")
- if strlen(visual_line) > visual_width
- let dollar_block = 1
- let visual_width = strlen(visual_line)
- endif
- endfor
- let square_up = (dollar_block ? (start_col+visual_width-2).'|' : '')
-
- set virtualedit=all
- return 'gv'.square_up.'yPgv'
- \. (visual_width-dollar_block) . 'lo' . (visual_width-dollar_block) . 'l'
- \. "y:set virtualedit=block\<CR>gv"
- \. (dollar_block ? 'o$' : '')
-endfunction
-
-
-" Kludge to hide change reporting inside implementation...
-let s:NO_REPORT = ":let b:DVB_report=&report\<CR>:let &report=1000000000\<CR>"
-let s:PREV_REPORT = ":let &report = b:DVB_report\<CR>"
-
-
-" Drag in specified direction in Visual Line mode...
-function! s:Drag_Lines (dir)
- " Clean up the temporary convenience...
- nunmap <buffer> M
-
- " Locate block being shifted...
- let [buf_left, line_left, col_left, offset_left ] = getpos("'<")
- let [buf_right, line_right, col_right, offset_right] = getpos("'>")
-
- " Drag entire lines left if possible...
- if a:dir == 'left'
- " Are all lines indented at least one space???
- let lines = getline(line_left, line_right)
- let all_indented = match(lines, '^[^ ]') == -1
- nohlsearch
-
- " If can't trim one space from start of each line, be a no-op...
- if !all_indented
- return 'gv'
-
- " Otherwise drag left by removing one space from start of each line...
- else
- return s:NO_REPORT
- \ . "gv:s/^ //\<CR>"
- \ . s:PREV_REPORT
- \ . "gv"
- endif
-
- " To drag entire lines right, add a space in column 1...
- elseif a:dir == 'right'
- return s:NO_REPORT
- \ . "gv:s/^/ /\<CR>:nohlsearch\<CR>"
- \ . s:PREV_REPORT
- \ . "gv"
-
- " To drag entire lines upwards...
- elseif a:dir == 'up'
- let EOF = line('$')
-
- " Can't drag up if at first line...
- if line_left == 1 || line_right == 1
- return 'gv'
-
- " Needs special handling at EOF (because cursor moves up on delete)...
- elseif line_left == EOF || line_right == EOF
- let height = line_right - line_left
- let select_extra = height ? height . 'j' : ""
- return s:NO_REPORT
- \ . 'gvxP'
- \ . s:PREV_REPORT
- \ . 'V' . select_extra
-
- " Otherwise just cut-move-paste-reselect...
- else
- let height = line_right - line_left
- let select_extra = height ? height . 'j' : ""
- return s:NO_REPORT
- \ . 'gvxkP'
- \ . s:PREV_REPORT
- \ . 'V' . select_extra
- endif
-
- " To drag entire lines downwards...
- elseif a:dir == 'down'
- let EOF = line('$')
-
- " This is how much extra we're going to have to reselect...
- let height = line_right - line_left
- let select_extra = height ? height . 'j' : ""
-
- " Needs special handling at EOF (to push selection down into new space)...
- if line_left == EOF || line_right == EOF
- return "O\<ESC>gv"
-
- " Otherwise, just cut-move-paste-reselect...
- else
- return s:NO_REPORT
- \ . 'gvxp'
- \ . s:PREV_REPORT
- \ . 'V' . select_extra
- endif
-
- endif
-endfunction
-
-" Drag in specified direction in Visual Block mode...
-function! s:Drag_Block (dir)
- " Clean up the temporary convenience...
- nunmap <buffer> M
-
- " Locate block being shifted...
- let [buf_left, line_left, col_left, offset_left ] = getpos("'<")
- let [buf_right, line_right, col_right, offset_right] = getpos("'>")
-
- " Identify special '$' blocks...
- let dollar_block = 0
- let start_col = min([col_left+offset_left, col_right+offset_right])
- let end_col = max([col_left+offset_left, col_right+offset_right])
- let visual_width = end_col - start_col + 1
- for visual_line in split(getreg("v"),"\n")
- if strlen(visual_line) > visual_width
- let dollar_block = 1
- let visual_width = strlen(visual_line)
- endif
- endfor
- let square_up = (dollar_block ? (start_col+visual_width-2).'|' : '')
-
- " Drag left...
- if a:dir == 'left'
- "Can't drag left at left margin...
- if col_left == 1 || col_right == 1
- return 'gv'
-
- " Otherwise reposition one column left (and optionally trim any whitespace)...
- elseif g:DVB_TrimWS
- " May need to be able to temporarily step past EOL...
- let prev_ve = &virtualedit
- set virtualedit=all
-
- " Are we moving past other text???
- let square_up_final = ""
- if dollar_block
- let lines = getline(line_left, line_right)
- if match(lines, '^.\{'.(start_col-2).'}\S') >= 0
- let dollar_block = 0
- let square_up_final = (start_col+visual_width-3).'|'
- endif
- endif
-
- let vcol = start_col - 2
- return 'gv'.square_up.'xhP'
- \ . s:NO_REPORT
- \ . "gvhoho:s/\\s*$//\<CR>gv\<ESC>"
- \ . ':set virtualedit=' . prev_ve . "\<CR>"
- \ . s:PREV_REPORT
- \ . ":nohlsearch\<CR>gv"
- \ . (dollar_block ? '$' : square_up_final )
- else
- return 'gv'.square_up.'xhPgvhoho'
- endif
-
- " Drag right...
- elseif a:dir == 'right'
- " May need to be able to temporarily step past EOL...
- let prev_ve = &virtualedit
- set virtualedit=all
-
- " Reposition block one column to the right...
- if g:DVB_TrimWS
- let vcol = start_col
- return 'gv'.square_up.'xp'
- \ . s:NO_REPORT
- \ . "gvlolo"
- \ . ":s/\\s*$//\<CR>gv\<ESC>"
- \ . ':set virtualedit=' . prev_ve . "\<CR>"
- \ . s:PREV_REPORT
- \ . (dollar_block ? 'gv$' : 'gv')
- else
- return 'gv'.square_up.'xp:set virtualedit=' . prev_ve . "\<CR>gvlolo"
- endif
-
- " Drag upwards...
- elseif a:dir == 'up'
- " Can't drag upwards at top margin...
- if line_left == 1 || line_right == 1
- return 'gv'
- endif
-
- " May need to be able to temporarily step past EOL...
- let prev_ve = &virtualedit
- set virtualedit=all
-
- " If trimming whitespace, jump to just below block to do it...
- if g:DVB_TrimWS
- let height = line_right - line_left + 1
- return 'gv'.square_up.'xkPgvkoko"vy'
- \ . height
- \ . 'j:s/\s*$//'
- \ . "\<CR>:nohlsearch\<CR>:set virtualedit="
- \ . prev_ve
- \ . "\<CR>gv"
- \ . (dollar_block ? '$' : '')
-
- " Otherwise just move and reselect...
- else
- return 'gv'.square_up.'xkPgvkoko"vy:set virtualedit='
- \ . prev_ve
- \ . "\<CR>gv"
- \ . (dollar_block ? '$' : '')
- endif
-
- " Drag downwards...
- elseif a:dir == 'down'
- " May need to be able to temporarily step past EOL...
- let prev_ve = &virtualedit
- set virtualedit=all
-
- " If trimming whitespace, move to just above block to do it...
- if g:DVB_TrimWS
- return 'gv'.square_up.'xjPgvjojo"vyk:s/\s*$//'
- \ . "\<CR>:nohlsearch\<CR>:set virtualedit="
- \ . prev_ve
- \ . "\<CR>gv"
- \ . (dollar_block ? '$' : '')
-
- " Otherwise just move and reselect...
- else
- return 'gv'.square_up.'xjPgvjojo"vy'
- \ . "\<CR>:set virtualedit="
- \ . prev_ve
- \ . "\<CR>gv"
- \ . (dollar_block ? '$' : '')
- endif
- endif
-endfunction
-
-
-" Restore previous external compatibility options
-let &cpo = s:save_cpo
-
diff --git a/files/vim/plugin/rng.vim b/files/vim/plugin/rng.vim
deleted file mode 100644
index 51c9991..0000000
--- a/files/vim/plugin/rng.vim
+++ /dev/null
@@ -1,83 +0,0 @@
-" George Marsaglia's Multiply-with-carry Random Number Generator {{{
-" Modified to work within Vim's semantics
-let s:m_w = 1 + getpid()
-let s:m_z = localtime()
-
-" not sure of the wisdom of generating a full 32-bit RN here
-" and then using abs() on the sucker. Feedback welcome.
-function! RandomNumber(...)
- if a:0 == 0
- let s:m_z = (36969 * and(s:m_z, 0xffff)) + (s:m_z / 65536)
- let s:m_w = (18000 * and(s:m_w, 0xffff)) + (s:m_w / 65536)
- return (s:m_z * 65536) + s:m_w " 32-bit result
- elseif a:0 == 1 " We return a number in [0, a:1] or [a:1, 0]
- return a:1 < 0 ? RandomNumber(a:1,0) : RandomNumber(0,a:1)
- else " if a:2 >= 2
- return abs(RandomNumber()) % (abs(a:2 - a:1) + 1) + a:1
- endif
-endfunction
-" end RNG }}}
-
-" RandomChar(base, cap)
-" base : the lowest char number desired
-" cap : the highest char number desired
-" Defaults to ASCII characters in the range
-" 33-126 (!-~)
-" But it's capable of much wider character tables
-function! RandomChar(...)
- let base = 33
- let cap = 126
- if a:0 > 0
- let base = a:1
- endif
- if a:0 > 1
- let cap = a:2
- endif
- return nr2char(RandomNumber(base, cap))
-endfunction
-
-function! RandomCharsInSet(length, set)
- let from = join(map(range(len(a:set)), 'nr2char(char2nr("a")+v:val)'), '')
- let to = join(a:set, '')
- return map(RandomChars(a:length, 97, 96+len(a:set)), 'tr(v:val, from, to)')
-endfunction
-
-function! RandomChars(length, ...)
- let args = []
- if a:0 > 0
- if type(a:1) == type([])
- let args = a:1
- else
- let args = a:000
- endif
- endif
- return map(repeat([0], a:length), 'call("RandomChar", args)')
-endfunction
-
-function! RandomString(length, ...)
- let args = []
- if a:0 > 0
- if type(a:1) == type([])
- let args = a:1
- else
- let args = a:000
- endif
- endif
- return join(call('RandomChars', [a:length, args]), '')
-endfunction
-
-let s:chars = '! " # $ % & '' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~'
-let s:charlist = split(s:chars, ' ')
-
-function! RandomCharFromRegex(regex, ...)
- let charlist = a:0 ? split(a:1, '\zs') : copy(s:charlist)
- call filter(charlist, 'v:val =~ a:regex')
- return charlist[RandomNumber(0, len(charlist) - 1)]
-endfunction
-
-function! RandomStringFromRegex(regex, lenght, ...)
- let charlist = a:0 ? split(a:1, '\zs') : copy(s:charlist)
- call filter(charlist, 'v:val =~ a:regex')
- let len = len(charlist) - 1
- return join(map(range(a:lenght), 'charlist[RandomNumber(0, len)]'), '')
-endfunction