vim stuff

This commit is contained in:
anon
2024-07-13 15:18:43 +02:00
parent 2f3fa84d10
commit 95647f6bbb
9 changed files with 1162 additions and 1 deletions

366
vim/.vim/autoload/vis.vim Normal file
View File

@ -0,0 +1,366 @@
" vis.vim: Perform an Ex command on a visual highlighted block (CTRL-V).
" Date: Sep 08, 2016 - Dec 08, 2021
" Version: 23a ASTRO-ONLY
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" GetLatestVimScripts: 1066 1 cecutil.vim
" GetLatestVimScripts: 1195 1 :AutoInstall: vis.vim
" Verse: For am I now seeking the favor of men, or of God? Or am I striving
" to please men? For if I were still pleasing men, I wouldn't be a servant
" of Christ. (Gal 1:10, WEB)
"
" Based on an idea of Stefan Roemer <roemer@informatik.tu-muenchen.de>
"
" ------------------------------------------------------------------------------
" Initialization: {{{1
" Exit quickly when <Vis.vim> has already been loaded or
" when 'compatible' is set
if &cp || exists("g:loaded_vis")
finish
endif
let s:keepcpo = &cpo
let g:loaded_vis = "v23a"
set cpo&vim
"DechoRemOn
" =====================================================================
" Support Functions: {{{1
" ---------------------------------------------------------------------
" vis#VisBlockCmd: {{{2
fun! vis#VisBlockCmd(cmd) range
" call Dfunc("vis#VisBlockCmd(cmd<".a:cmd.">")
" retain and re-use same visual mode
sil! keepj norm `<
let curposn = SaveWinPosn(0)
let vmode = visualmode()
" call Decho("vmode<".vmode.">")
call s:SaveUserSettings()
if vmode == 'V'
" call Decho("handling V mode")
" call Decho("cmd<".a:cmd.">")
exe "keepj '<,'>".a:cmd
else " handle v and ctrl-v
" call Decho("handling v or ctrl-v mode")
" Initialize so (begcol < endcol) for non-v modes
let begcol = s:VirtcolM1("<")
let endcol = s:VirtcolM1(">")
if vmode != 'v'
if begcol > endcol
let begcol = s:VirtcolM1(">")
let endcol = s:VirtcolM1("<")
endif
endif
" Initialize so that begline<endline
let begline = a:firstline
let endline = a:lastline
if begline > endline
let begline = a:lastline
let endline = a:firstline
endif
" call Decho('beg['.begline.','.begcol.'] end['.endline.','.endcol.']')
" =======================
" Modify Selected Region:
" =======================
" 1. delete selected region into register "a
" call Decho("1. delete selected region into register a")
sil! keepj norm! gv"ad
" call Decho("1. reg-A<".@a.">")
" call Decho("Step#1: deleted selected region into register")|redraw!|sleep 3 " Decho
" 2. put cut-out text at end-of-file
" call Decho("2. put cut-out text at end-of-file")
keepj $
keepj pu_
let lastline= line("$")
sil! keepj norm! "aP
" call Decho("2. reg-A<".@a.">")
" call Decho("Step#2: put text at end-of-file")|redraw!|sleep 3 " Decho
" 3. apply command to those lines
let curline = line(".")
ka
keepj $
" call Decho("3. apply command<".a:cmd."> to those lines (curline=".line(".").")")
exe "keepj ". curline.',$'.a:cmd
" call Decho("Step#3: apply command")|redraw!|sleep 3 " Decho
" 4. Prepend the "empty_chr" since "ad on empty lines inserts blanks
if exists("g:vis_empty_character")
let empty_chr= g:vis_empty_character
else
let empty_chr= (&enc == "euc-jp")? "\<Char-0x01>" : "\<Char-0xff>"
endif
" if the command removes the text, then don't do anything with the
" non-existent text (for example, :B !true under unix)
if curline <= line("$")
exe "keepj sil! ". curline.',$s/^/'.empty_chr.'/'
" call Decho("Step#3a: prepend empty-character")|redraw!|sleep 3 " Decho
" 5. visual-block select the modified text in those lines
" call Decho("5. visual-block select modified text at end-of-file")
exe "keepj ".lastline
exe 'keepj norm! 0'.vmode.'G$"ax'
if @a[strlen(@a)-1] == ' '
" nasty fix -- sometimes the 0G$"ax picks up the end-of-line as a space
let @a= strpart(@a,0,strlen(@a)-1)
endif
" call Decho("5. reg-A<".@a.">")
" call Decho("Step#5: select modified text")|redraw!|sleep 3 " Decho
" 6. delete excess lines
" call Decho("6. delete excess lines")
exe "sil! keepj ".lastline.',$d'
" call Decho("Step#6: delete excess lines")|redraw!|sleep 3 " Decho
" 7. put modified text back into file
" call Decho("7. put modifed text back into file (beginning=".begline.".".begcol.")")
exe "keepj ".begline
if begcol > 1
exe 'sil! keepj norm! '.begcol."\<bar>\"ap"
elseif begcol == 1
norm! 0"ap
else
norm! 0"aP
endif
" call Decho("Step#7: put modified text back")|redraw!|sleep 3 " Decho
endif
" 8. attempt to restore gv -- this is limited, it will
" select the same size region in the same place as before,
" not necessarily the changed region
" call Decho("8. restore gv")
let begcol= begcol+1
let endcol= endcol+1
exe "sil keepj ".begline
exe 'sil keepj norm! '.begcol."\<bar>".vmode
exe "sil keepj ".endline
exe 'sil keepj norm! '.endcol."\<bar>\<esc>"
exe "sil keepj ".begline
exe 'sil keepj norm! '.begcol."\<bar>"
" call Decho("Step#8: restore gv")|redraw!|sleep 3 " Decho
" 9. Remove empty-character from text
" call Decho("9. remove empty-character from lines ".begline." to ".endline)
exe "sil! keepj ".begline.','.endline.'s/'.empty_chr.'//e'
" call Decho("Step#9: remove empty-character")|redraw!|sleep 3 " Decho
endif
" restore a-priori condition
call s:RestoreUserSettings()
call RestoreWinPosn(curposn)
" call Decho("Step#10: done!")|redraw!|sleep 3 " Decho
" call Dret("vis#VisBlockCmd")
endfun
" ---------------------------------------------------------------------
" vis#VisBlockSearch: {{{2
fun! vis#VisBlockSearch(...) range
" call Dfunc("vis#VisBlockSearch() a:0=".a:0." lines[".a:firstline.",".a:lastline."]")
let keepic= &ic
set noic
if a:0 >= 1 && strlen(a:1) > 0
let pattern = a:1
let s:pattern = pattern
" call Decho("a:0=".a:0.": pattern<".pattern.">")
elseif exists("s:pattern")
let pattern= s:pattern
else
let pattern = @/
let s:pattern = pattern
endif
let vmode= visualmode()
" collect search restrictions
let firstline = line("'<")
let lastline = line("'>")
let firstcolm1 = s:VirtcolM1("<")
let lastcolm1 = s:VirtcolM1(">")
" call Decho("1: firstline=".firstline." lastline=".lastline." firstcolm1=".firstcolm1." lastcolm1=".lastcolm1)
if(firstline > lastline)
let firstline = line("'>")
let lastline = line("'<")
if a:0 >= 1
keepj norm! `>
endif
else
if a:0 >= 1
keepj norm! `<
endif
endif
" call Decho("2: firstline=".firstline." lastline=".lastline." firstcolm1=".firstcolm1." lastcolm1=".lastcolm1)
if vmode != 'v'
if firstcolm1 > lastcolm1
let tmp = firstcolm1
let firstcolm1 = lastcolm1
let lastcolm1 = tmp
endif
endif
" call Decho("3: firstline=".firstline." lastline=".lastline." firstcolm1=".firstcolm1." lastcolm1=".lastcolm1)
let firstlinem1 = firstline - 1
let lastlinep1 = lastline + 1
let firstcol = firstcolm1 + 1
let lastcol = lastcolm1 + 1
let lastcolp1 = lastcol + 1
" call Decho("4: firstline=".firstline." lastline=".lastline." firstcolm1=".firstcolm1." lastcolp1=".lastcolp1)
" construct search string
if vmode == 'V'
let srch= '\%(\%>'.firstlinem1.'l\%<'.lastlinep1.'l\)\&'
" call Decho("V srch: ".srch)
elseif vmode == 'v'
if firstline == lastline || firstline == lastlinep1
let srch= '\%(\%'.firstline.'l\%>'.firstcolm1.'v\%<'.lastcolp1.'v\)\&'
else
let srch= '\%(\%(\%'.firstline.'l\%>'.firstcolm1.'v\)\|\%(\%'.lastline.'l\%<'.lastcolp1.'v\)\|\%(\%>'.firstline.'l\%<'.lastline.'l\)\)\&'
endif
" call Decho("v srch: ".srch)
else
let srch= '\%(\%>'.firstlinem1.'l\%>'.firstcolm1.'v\%<'.lastlinep1.'l\%<'.lastcolp1.'v\)\&'
" call Decho("^v srch: ".srch)
endif
" perform search
if a:0 <= 1
" call Decho("Search forward: <".srch.pattern.">")
call search(srch.pattern)
let @/= srch.pattern
elseif a:0 == 2
" call Decho("Search backward: <".srch.pattern.">")
call search(srch.pattern,a:2)
let @/= srch.pattern
endif
" restore ignorecase
let &ic= keepic
" call Dret("vis#VisBlockSearch <".srch.">")
return srch
endfun
" ---------------------------------------------------------------------
" vis#VisFmt: {{{2
fun! vis#VisFmt() range
" call Dfunc("vis#VisFmt()")
if exists("g:vis_empty_character")
let empty_chr= g:vis_empty_character
else
let empty_chr= (&enc == "euc-jp")? "\<Char-0x01>" : "\<Char-0xff>"
endif
norm! gv
'<,'>call vis#VisBlockCmd('norm! gqip}}')
let lineno= line("'>")+1
exe lineno
while getline(".") =~ empty_chr
exe 's/'.empty_chr.'//'
norm! j
endwhile
" call Dret("vis#VisFmt")
endfun
" ---------------------------------------------------------------------
" s:VirtcolM1: usually a virtcol(mark)-1, but due to tabs this can {{{2
" be different
fun! s:VirtcolM1(mark)
" call Dfunc('s:VirtcolM1("'.a:mark.'")')
if virtcol("'".a:mark) <= 1
" call Dret("s:VirtcolM1 0")
return 0
endif
if &ve == "block"
" Works around a ve=all vs ve=block difference with virtcol().
" Since s:SaveUserSettings() changes ve to ve=all, this small
" ve override only affects vis#VisBlockSearch().
set ve=all
" call Decho("temporarily setting ve=all")
endif
" call Decho("exe norm! `".a:mark."h")
exe "keepj norm! `".a:mark."h"
let vekeep = &ve
let vc = virtcol(".")
let &ve = vekeep
" call Dret("s:VirtcolM1 ".vc)
return vc
endfun
" ---------------------------------------------------------------------
" s:SaveUserSettings: save options which otherwise may interfere {{{2
fun! s:SaveUserSettings()
" call Dfunc("s:SaveUserSettings()")
let s:keep_lz = &lz
let s:keep_fen = &fen
let s:keep_fo = &fo
let s:keep_ic = &ic
let s:keep_magic = &magic
let s:keep_sol = &sol
let s:keep_ve = &ve
let s:keep_ww = &ww
let s:keep_cedit = &cedit
set lz magic nofen noic nosol ww= fo=nroql2 cedit&
" determine whether or not "ragged right" is in effect for the selected region
let raggedright= 0
norm! `>
let rrcol = col(".")
while line(".") >= line("'<")
" call Decho(".line#".line(".").": col(.)=".col('.')." rrcol=".rrcol)
if col(".") != rrcol
let raggedright = 1
break
endif
if line(".") == 1
break
endif
norm! k
endwhile
if raggedright
" call Decho("ragged right: set ve=all")
set ve=all
else
" call Decho("smooth right: set ve=")
set ve=
endif
" Save any contents in register a
let s:rega= @a
" call Dret("s:SaveUserSettings")
endfun
" ---------------------------------------------------------------------
" s:RestoreUserSettings: restore register a and options {{{2
fun! s:RestoreUserSettings()
" call Dfunc("s:RestoreUserSettings()")
let @a = s:rega
let &cedit = s:keep_cedit
let &fen = s:keep_fen
let &fo = s:keep_fo
let &ic = s:keep_ic
let &lz = s:keep_lz
let &sol = s:keep_sol
let &ve = s:keep_ve
let &ww = s:keep_ww
" call Dret("s:RestoreUserSettings")
endfun
let &cpo= s:keepcpo
unlet s:keepcpo
" ------------------------------------------------------------------------------
" Modelines: {{{1
" vim: fdm=marker

253
vim/.vim/doc/vis.txt Normal file
View File

@ -0,0 +1,253 @@
*vis.txt* The Visual Block Tool Sep 07, 2016
Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
(remove NOSPAM from Campbell's email first)
Copyright: (c) 2004-2016 by Charles E. Campbell *vis-copyright*
The VIM LICENSE applies to vis.vim and vis.txt
(see |copyright|) except use "vis" instead of "Vim"
No warranty, express or implied. Use At-Your-Own-Risk.
==============================================================================
1. Contents *vis* *vis-contents* *vis.vim*
1. Contents......................: |vis-contents|
2. Visual Block Manual...........: |vis-manual|
3. Visual Block Search...........: |vis-srch|
4. Required......................: |vis-required|
5. Sorting Examples..............: |vis-sort|
6. History.......................: |vis-history|
==============================================================================
2. Visual Block Manual *visman* *vismanual* *vis-manual* *v_:B*
Performs an arbitrary Ex command on a visual highlighted block.
Mark visual block (CTRL-V) or visual character (v),
press ':B ' and enter an Ex command [cmd].
ex. Use ctrl-v to visually mark the block then use
:B cmd (will appear as :'<,'>B cmd )
ex. Use v to visually mark the block then use
:B cmd (will appear as :'<,'>B cmd )
Command-line completion is supported for Ex commands.
There must be a space before the '!' when invoking external shell
commands, eg. ':B !sort'. Otherwise an error is reported.
The script works by deleting the selected region into register "a.
The register "a itself is first saved and later restored. The text is
then put at the end-of-file, modified by the user command, and then
deleted back into register "a. Any excess lines are removed, and the
modified text is then put back into the text at its original
location.
Popular uses for this command include: >
:B s/pattern/output/
:B left
:B right
<
1: apply a substitute command to just the selected visual block,
2: left justify the selected block, and
3: right justify the selected block, respectively.
The concept for this plugin is originally Stefan Roemer's
<roemer@informatik.tu-muenchen.de>; however, both the implementation
and methods used internally have completely changed since Roemer's
version.
*g:vis_empty_character* : this character should not appear in your
text. By default: users of euc-jp will get a 0x01, otherwise
it wil be a 0xff. Used to prevent an empty result in the
moving back the modified text operation, which otherwise results
in an unwanted extra blank space being inserted.
==============================================================================
3. Visual Block Search *vis-search* *vis-srch* *vis-S*
Visual block search provides two ways to search a visual-selection.
Both these methods work well with :set hls and searching may be
repeated with the n or N commands.
Using // and ?? after a visual selection (the // is only available
if you have g:vis_WantSlashSlash=1 in your <.vimrc> file):
>
ex. select region via V, v, or ctrl-v
//pattern
<
You'll actually get a long leader string of commands to restrict
searches to the requested visual block first. You may then enter
the pattern afterwards. For example, using "v" to select this
paragraph, you'll see something like: >
/\%(\%(\%80l\%>12v\)\|\%(\%83l\%<53v\)\|\%(\%>80l\%<83l\)\)\&
<
You may enter whatever pattern you want after the \&, and the
pattern search will be restricted to the requested region.
The "S" command in visual mode:
>
ex. select region via V, v, or ctrl-v
:S pattern
<
The ":S pattern" will appear as ":'<,'>S pattern". This
command will move the cursor to the next instance of the
pattern, restricted to the visually selected block.
An "R" command was contemplated, but I currently see no way to
get it to continue to search backwards with n and N commands.
==============================================================================
4. Required *vis-required*
The latest <vis.vim> (v20f or later) now requires vim 7.0 (or later),
as it has been split into plugin/ and an autoload/ sections for
on-demand loading.
Starting with version 11, <vis.vim> required <cecutil.vim>. It uses
the SaveWinPosn() and RestoreWinPosn() functions therein. You may get
<cecutil.vim> from
http://www.drchip.org/astronaut/vim/index.html#CECUTIL
==============================================================================
5. Sorting Examples *vis-sort*
Assume we start with the following three lines: >
one two three
four five six
seven eight nine
<
Example 1: Use visual-block mode to select the center three
words: ctrl-v select two/five/eight, then :'<,'>sort: >
four five six
one two three
seven eight nine
<
Note that the visual-block is ignored, other than as a way to
select the three lines. The resulting sorting is done on the
three words "one/four/seven".
(this example presumed that you're using vim 7.0; if you're using
an earlier version vim, try :'<,\> !sort instead)
Example 2: Using vis.vim's B command:
Again, use visual-block mode to select the center
three words: ctrl-v select two/five/eight, then :'<,'>B sort: >
one eight three
four five six
seven two nine
<
This operation sorts the selected three words (two/five/eight),
leaving all characters outside the visual block alone.
(this example presumed that you're using vim 7.0; if you're using
an earlier version vim, try :'<,\> !sort instead)
Example 3: Using vissort.vim's Vissort() function
Use visual block mode to select the center three words;
ctrl-v select two/five/eight, then :'<,'>Vissort: >
seven eight nine
four five six
one two three
<
This time, the entire lines are sorted, but the sorting is done
based on the visual-block selected region (ie. two/five/eight).
==============================================================================
6. History *vis-history* {{{1
v22 : Dec 08, 2021 - while using mathify, I kept getting an unwanted
trailing space. I've tracked it down to Step#5
in vis#VisBlockCmd()'s exe 'keepj norm! 0'.vmode.'G$"ax'
For an unknown reason, that command sometimes, not
always, picks up the end-of-line as a space (even
with set ve=)
v21 : Apr 01, 2013 - visual block and ragged right detection; there was
a conflict between using ve= and ve=all
(internally); one was good for ragged right and
the other for smooth right visual block selections.
I found a way to detect ragged right vs smooth right
and so vis.vim now works properly in both
situations.
Apr 02, 2013 - The detection method above hung when on line 1.
Fixed.
Jan 15, 2015 - Small adjustment to prevent a leading space from
being inserted.
Feb 10, 2016 - (Stefan Siegal) provided a patch making
visPlugin.vim restore cpo
Sep 07, 2016 - addressed an empty-string bug : if the block
command causes an empty string to appear in the
modified text, vim would insert a blank rather than
do nothing. Fixed by prepending an
"empty-character" and then removing it
v20 : May 20, 2009 - cecutil bugfix
May 19, 2010 - split into plugin/ and autoload/ for faster
loading and on-demand loading.
Mar 18, 2013 - (Gary Johnson) pointed out that changing
cedit to <Esc> caused problems with visincr;
the cedit setting is now bypassed in vis, too.
Mar 29, 2013 - Fixed a problem with vis#VisBlockCmd() where it
missed substitutes due to a short last line.
s:SaveUserSettings() now makes ve=all instead of
ve= (see |'ve'|)
v19 : Jan 06, 2006 - small modification included to allow AlignMaps
maps to work (visual select, :B norm \somemap)
- cecutil updated to use keepjumps
Jan 24, 2006 - works around formatoption setting
Jan 25, 2006 - uses SaveWinPosn(0) to avoid SWP stack use
v18 : Jul 11, 2005 - vis.vim now works around a virtcol() behavior
difference between ve=all vs ve=block
v17 : Apr 25, 2005 - vis.vim now uses cecutil (SaveWinPosn, etc) so the
tarball now includes a copy of cecutil.vim
v16 : Feb 02, 2005 - fixed a bug with visual-block + S ; the first line
was being omitted in the search
Mar 01, 2005 - <q-args> used instead of '<args>'
Apr 13, 2005 - :'<,'>S plus v had a bug with one or two line
selections (tnx to Vigil for pointing this out)
Apr 14, 2005 - set ignorecase caused visual-block searching
to confuse visual modes "v" and "V"
v15 : Feb 01, 2005 - includes some additions to the help
v14 : Sep 28, 2004 - visual-block based searching now supported. One
do this either with :'<,'>S pattern or with a / or ?
Jan 31, 2005 - fixed help file
v13 : Jul 16, 2004 - folding commands added to source
- GetLatestVimScript hook added for automatic updating
v12 : Jun 14, 2004 - bugfix (folding interfered)
v11 : May 18, 2004 - Included calls to SaveWinPosn() and RestoreWinPosn()
to prevent unwanted movement of the cursor and window.
As a result, <vis.vim> now requires <cecutil.vim>
(see |vis-required|).
v10 : Feb 11, 2003 - bugfix (ignorecase option interfered with v)
v9 : Sep 10, 2002 - bugfix (left Decho on, now commented out)
v8 : Sep 09, 2002 - bugfix (first column problem)
v7 : Sep 05, 2002 - bugfix (was forcing begcol<endcol for "v" mode)
v6 : Jun 25, 2002 - bugfix (VirtcolM1 instead of virtcol()-1)
v5 : Jun 21, 2002 - now supports character-visual mode (v) and
linewise-visual mode (V)
v4 : Jun 20, 2002 - saves sol, sets nosol, restores sol
- bugfix: 0 inserted: 0\<c-v>G$\"ad
- Fixed double-loading (was commented
out for debugging purposes)
v3 : Jun 20, 2002 - saves ve, unsets ve, restores ve
v2 : June 19, 2002 - Charles Campbell's <vis.vim>
v? June 19, 2002 Complete rewrite - <vis.vim> is now immune to
the presence of tabs and is considerably faster.
v1 Epoch - Stefan Roemer <roemer@informatik.tu-muenchen.de>
wrote the original <vis.vim>.
==============================================================================
Modelines: {{{1
vim:tw=78:ts=8:ft=help:fdm=marker

View File

@ -0,0 +1 @@
autocmd BufNewFile,BufRead *.weechatlog set filetype=weechatlog

View File

@ -1 +0,0 @@

View File

@ -0,0 +1,61 @@
" visPlugin.vim: Perform an Ex command on a visual highlighted block (CTRL-V).
" Date: May 18, 2010 - Jan 07, 2020
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" Version: 22
" GetLatestVimScripts: 1066 1 cecutil.vim
" GetLatestVimScripts: 1195 1 :AutoInstall: vis.vim
" Verse: For am I now seeking the favor of men, or of God? Or am I striving
" to please men? For if I were still pleasing men, I wouldn't be a servant
" of Christ. (Gal 1:10, WEB)
" ---------------------------------------------------------------------
" Details: {{{1
" Requires: Requires 6.0 or later (this script is a plugin)
" Requires <cecutil.vim> (see :he vis-required)
"
" Usage: Mark visual block (CTRL-V) or visual character (v),
" press ':B ' and enter an Ex command [cmd].
"
" ex. Use ctrl-v to visually mark the block then use
" :B cmd (will appear as :'<,'>B cmd )
"
" ex. Use v to visually mark the block then use
" :B cmd (will appear as :'<,'>B cmd )
"
" Command-line completion is supported for Ex commands.
"
" Note: There must be a space before the '!' when invoking external shell
" commands, eg. ':B !sort'. Otherwise an error is reported.
"
" Author: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" Based on idea of Stefan Roemer <roemer@informatik.tu-muenchen.de>
"
" ------------------------------------------------------------------------------
" Initialization: {{{1
" Exit quickly when <Vis.vim> has already been loaded or
" when 'compatible' is set
if &cp
finish
endif
let s:keepcpo= &cpo
set cpo&vim
" ------------------------------------------------------------------------------
" Public Interface: {{{1
" -range : VisBlockCmd operates on the range itself
" -com=command : Ex command and arguments
" -nargs=+ : arguments may be supplied, up to any quantity
com! -range -nargs=+ -com=command B sil <line1>,<line2>call vis#VisBlockCmd(<q-args>)
com! -range -nargs=* -com=expression S sil <line1>,<line2>call vis#VisBlockSearch(<q-args>)
" Suggested by Hari --
if exists("g:vis_WantSlashSlash") && g:vis_WantSlashSlash
vn // <esc>/<c-r>=vis#VisBlockSearch()<cr>
endif
vn ?? <esc>?<c-r>=vis#VisBlockSearch()<cr>
let &cpo= s:keepcpo
unlet s:keepcpo
" ---------------------------------------------------------------------
" Modelines: {{{1
" vim: fdm=marker

View File

@ -0,0 +1,94 @@
SMT
DPLL
Normal
DNF
CNF
PNF
Ascii
multiline
facebook
eval
Javascript
Lua
webadmin
uint
ascii
colorscheme
wifi
descibing
forkbomb
ctrl
whitespace
outputed
enum
pajeet
fi
whitespaces
Megadeth
builtins
readonly
config
readline
suckless
init
btw
redpill
overlive
hardcoded
loglevel
filesystem
filesystems
childnodes
Pufka
unsatisfiable
subformula
subformulas
Tseitin
DIMACS
lim
func
foreach
reusability
webdev
wetdream
OOP
eachother
trackpoint
monoid
endofunctors
soydev
struct
backend
chan
mobo
mobos
virtualization
POSIX
virtualize
bool
jackshit
dir
tbh
bitmask
timestamp
commandline
throught
normie
iterable
len
dimentional
FAGMAN
stylesheet
shitshow
ANSII
footgun
Costlessly
terminality
ints
Zuse
hellscape
grayscale
Dataflow
feedforward
perceptron
compiletime

Binary file not shown.

View File

@ -0,0 +1,346 @@
" What: ls colors for vidir file listings
" Where: $VIMRUNTIME/syntax/vidir-ls.vim
" Author: Magnus Woldrich <m@japh.se>
" Update: 2012-07-01 22:07:28
" URL: https://github.com/trapd00r/vim-syntax-vidir-ls
" http://devel.japh.se/vim-syntax-vidir-ls/
" http://devel.japh.se/vidir
"
" This is supposed to be used with vidir [0]:
" export VIDIR_EDITOR_ARGS='-c :set nolist | :set ft=vidir-ls'
"
" The colors are generated from the LS_COLORS environment variable
" automatically. Please see the LS_COLORS repository [1] for a set of good
" colors.
"
" [0]: https://github.com/trapd00r/vidir
" [1]: https://github.com/trapd00r/LS_COLORS
if exists('b:current_syntax')
finish
endif
function! <SID>MakeStyle(ls_color_style)
let l:style_settings = split(a:ls_color_style, ';')
let l:style_string = ''
while len(l:style_settings) >= 3
let [l:where, l:flag, l:clr; l:style_settings] = l:style_settings
if l:flag == 5
if l:where == 38
let l:style_string .= ' ctermfg='.l:clr
\ .' guifg='.s:term2rgb[substitute(l:clr, '^0\+\ze\S', '', '')]
elseif l:where == 48
let l:style_string .= ' ctermbg='.l:clr
\ .' guibg='.s:term2rgb[substitute(l:clr, '^0\+\ze\S', '', '')]
endif
endif
endwhile
if len(l:style_settings) == 1
let l:style = l:style_settings[0]
if l:style == '0' || l:style == '00'
let l:style_string .= ' cterm=none'
elseif l:style == '1' || l:style == '01'
let l:style_string .= ' cterm=bold'
elseif l:style == '4' || l:style == '04'
let l:style_string .= ' cterm=underline'
elseif l:style == '7' || l:style == '07'
let l:style_string .= ' cterm=reverse'
endif
end
return l:style_string
endfunction
function! <SID>MakeSyntax(ls_color)
let [l:glob, l:colors] = split(a:ls_color, '=')
if l:glob =~ '^\*\..*'
let l:regex = '\v[/]\zs.+[.]'
let l:ext = substitute(l:glob, '^\*[.]', '', '')
let l:regex .= substitute(l:ext, '[.~]', '[&]', 'g') . '$'
let l:ext = substitute(l:ext, '[.~]', '_', 'g')
elseif l:glob == 'di'
let l:ext = 'DI'
let l:regex = '\v.+[/].+[/]$'
else
return
endif
execute 'silent! hi ls_' . l:ext . <SID>MakeStyle(l:colors)
execute 'silent! syn match ls_' . l:ext . ' display "' . l:regex . '"'
endfunction
" Colors from http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
let s:term2rgb = {
\ 0: "#000000",
\ 1: "#800000",
\ 2: "#008000",
\ 3: "#808000",
\ 4: "#000080",
\ 5: "#800080",
\ 6: "#008080",
\ 7: "#c0c0c0",
\ 8: "#808080",
\ 9: "#ff0000",
\ 10: "#00ff00",
\ 11: "#ffff00",
\ 12: "#0000ff",
\ 13: "#ff00ff",
\ 14: "#00ffff",
\ 15: "#ffffff",
\
\ 16: "#000000",
\ 17: "#00005f",
\ 18: "#000087",
\ 19: "#0000af",
\ 20: "#0000d7",
\ 21: "#0000ff",
\ 22: "#005f00",
\ 23: "#005f5f",
\ 24: "#005f87",
\ 25: "#005faf",
\ 26: "#005fd7",
\ 27: "#005fff",
\ 28: "#008700",
\ 29: "#00875f",
\ 30: "#008787",
\ 31: "#0087af",
\ 32: "#0087d7",
\ 33: "#0087ff",
\ 34: "#00af00",
\ 35: "#00af5f",
\ 36: "#00af87",
\ 37: "#00afaf",
\ 38: "#00afd7",
\ 39: "#00afff",
\ 40: "#00d700",
\ 41: "#00d75f",
\ 42: "#00d787",
\ 43: "#00d7af",
\ 44: "#00d7d7",
\ 45: "#00d7ff",
\ 46: "#00ff00",
\ 47: "#00ff5f",
\ 48: "#00ff87",
\ 49: "#00ffaf",
\ 50: "#00ffd7",
\ 51: "#00ffff",
\ 52: "#5f0000",
\ 53: "#5f005f",
\ 54: "#5f0087",
\ 55: "#5f00af",
\ 56: "#5f00d7",
\ 57: "#5f00ff",
\ 58: "#5f5f00",
\ 59: "#5f5f5f",
\ 60: "#5f5f87",
\ 61: "#5f5faf",
\ 62: "#5f5fd7",
\ 63: "#5f5fff",
\ 64: "#5f8700",
\ 65: "#5f875f",
\ 66: "#5f8787",
\ 67: "#5f87af",
\ 68: "#5f87d7",
\ 69: "#5f87ff",
\ 70: "#5faf00",
\ 71: "#5faf5f",
\ 72: "#5faf87",
\ 73: "#5fafaf",
\ 74: "#5fafd7",
\ 75: "#5fafff",
\ 76: "#5fd700",
\ 77: "#5fd75f",
\ 78: "#5fd787",
\ 79: "#5fd7af",
\ 80: "#5fd7d7",
\ 81: "#5fd7ff",
\ 82: "#5fff00",
\ 83: "#5fff5f",
\ 84: "#5fff87",
\ 85: "#5fffaf",
\ 86: "#5fffd7",
\ 87: "#5fffff",
\ 88: "#870000",
\ 89: "#87005f",
\ 90: "#870087",
\ 91: "#8700af",
\ 92: "#8700d7",
\ 93: "#8700ff",
\ 94: "#875f00",
\ 95: "#875f5f",
\ 96: "#875f87",
\ 97: "#875faf",
\ 98: "#875fd7",
\ 99: "#875fff",
\ 100: "#878700",
\ 101: "#87875f",
\ 102: "#878787",
\ 103: "#8787af",
\ 104: "#8787d7",
\ 105: "#8787ff",
\ 106: "#87af00",
\ 107: "#87af5f",
\ 108: "#87af87",
\ 109: "#87afaf",
\ 110: "#87afd7",
\ 111: "#87afff",
\ 112: "#87d700",
\ 113: "#87d75f",
\ 114: "#87d787",
\ 115: "#87d7af",
\ 116: "#87d7d7",
\ 117: "#87d7ff",
\ 118: "#87ff00",
\ 119: "#87ff5f",
\ 120: "#87ff87",
\ 121: "#87ffaf",
\ 122: "#87ffd7",
\ 123: "#87ffff",
\ 124: "#af0000",
\ 125: "#af005f",
\ 126: "#af0087",
\ 127: "#af00af",
\ 128: "#af00d7",
\ 129: "#af00ff",
\ 130: "#af5f00",
\ 131: "#af5f5f",
\ 132: "#af5f87",
\ 133: "#af5faf",
\ 134: "#af5fd7",
\ 135: "#af5fff",
\ 136: "#af8700",
\ 137: "#af875f",
\ 138: "#af8787",
\ 139: "#af87af",
\ 140: "#af87d7",
\ 141: "#af87ff",
\ 142: "#afaf00",
\ 143: "#afaf5f",
\ 144: "#afaf87",
\ 145: "#afafaf",
\ 146: "#afafd7",
\ 147: "#afafff",
\ 148: "#afd700",
\ 149: "#afd75f",
\ 150: "#afd787",
\ 151: "#afd7af",
\ 152: "#afd7d7",
\ 153: "#afd7ff",
\ 154: "#afff00",
\ 155: "#afff5f",
\ 156: "#afff87",
\ 157: "#afffaf",
\ 158: "#afffd7",
\ 159: "#afffff",
\ 160: "#d70000",
\ 161: "#d7005f",
\ 162: "#d70087",
\ 163: "#d700af",
\ 164: "#d700d7",
\ 165: "#d700ff",
\ 166: "#d75f00",
\ 167: "#d75f5f",
\ 168: "#d75f87",
\ 169: "#d75faf",
\ 170: "#d75fd7",
\ 171: "#d75fff",
\ 172: "#d78700",
\ 173: "#d7875f",
\ 174: "#d78787",
\ 175: "#d787af",
\ 176: "#d787d7",
\ 177: "#d787ff",
\ 178: "#d7af00",
\ 179: "#d7af5f",
\ 180: "#d7af87",
\ 181: "#d7afaf",
\ 182: "#d7afd7",
\ 183: "#d7afff",
\ 184: "#d7d700",
\ 185: "#d7d75f",
\ 186: "#d7d787",
\ 187: "#d7d7af",
\ 188: "#d7d7d7",
\ 189: "#d7d7ff",
\ 190: "#d7ff00",
\ 191: "#d7ff5f",
\ 192: "#d7ff87",
\ 193: "#d7ffaf",
\ 194: "#d7ffd7",
\ 195: "#d7ffff",
\ 196: "#ff0000",
\ 197: "#ff005f",
\ 198: "#ff0087",
\ 199: "#ff00af",
\ 200: "#ff00d7",
\ 201: "#ff00ff",
\ 202: "#ff5f00",
\ 203: "#ff5f5f",
\ 204: "#ff5f87",
\ 205: "#ff5faf",
\ 206: "#ff5fd7",
\ 207: "#ff5fff",
\ 208: "#ff8700",
\ 209: "#ff875f",
\ 210: "#ff8787",
\ 211: "#ff87af",
\ 212: "#ff87d7",
\ 213: "#ff87ff",
\ 214: "#ffaf00",
\ 215: "#ffaf5f",
\ 216: "#ffaf87",
\ 217: "#ffafaf",
\ 218: "#ffafd7",
\ 219: "#ffafff",
\ 220: "#ffd700",
\ 221: "#ffd75f",
\ 222: "#ffd787",
\ 223: "#ffd7af",
\ 224: "#ffd7d7",
\ 225: "#ffd7ff",
\ 226: "#ffff00",
\ 227: "#ffff5f",
\ 228: "#ffff87",
\ 229: "#ffffaf",
\ 230: "#ffffd7",
\ 231: "#ffffff",
\
\ 232: "#080808",
\ 233: "#121212",
\ 234: "#1c1c1c",
\ 235: "#262626",
\ 236: "#303030",
\ 237: "#3a3a3a",
\ 238: "#444444",
\ 239: "#4e4e4e",
\ 240: "#585858",
\ 241: "#606060",
\ 242: "#666666",
\ 243: "#767676",
\ 244: "#808080",
\ 245: "#8a8a8a",
\ 246: "#949494",
\ 247: "#9e9e9e",
\ 248: "#a8a8a8",
\ 249: "#b2b2b2",
\ 250: "#bcbcbc",
\ 251: "#c6c6c6",
\ 252: "#d0d0d0",
\ 253: "#dadada",
\ 254: "#e4e4e4",
\ 255: "#eeeeee",
\}
let s:ls_colors = split($LS_COLORS, ':')
let s:ls_colors = map(s:ls_colors, '<SID>MakeSyntax(v:val)')
let g:ls_colors = s:ls_colors
let b:current_syntax = 'vidir-ls'

View File

@ -0,0 +1,41 @@
if !exists("main_syntax")
if exists("b:current_syntax")
finish
endif
let main_syntax = 'weechatlog'
endif
syntax clear
syn match WeeChatNick '\t.*\t'
syn match WeeChatJoin '\t-->\t'
syn match WeeChatPart '\t<--\t'
syn region WeeChatChannelMsg start=/\t--\t/ end=/\n/ contains=WeeChatChannel
syn match WeeChatDate '\d\{4}-\d\{2}-\d\{2}'
syn match WeeChatTimestamp '\d\{2}:\d\{2}:\d\{2}'
syn match WeeChatChannel '#\S\+'
syn match WeeChatDomain '(\S*@\S*)'
syn match WeeChatTimeout '(Ping timeout: \d\+ seconds)'
syn match WeeChatPart '(Remote host closed the connection)'
syn match WeeChatPart2 '(Quit: .*)'
syn match WeeChatLink /[a-z]\+:\/\/[a-zA-z0-9./?=%]\+/
hi link WeeChatDate Number
hi link WeeChatTimestamp Number
hi link WeeChatChannel PreProc
hi link WeeChatChannelMsg Label
hi link WeeChatDomain Identifier
hi link WeeChatJoin Statement
hi link WeeChatPart Error
hi link WeeChatPart2 Error
hi link WeeChatTimeout WeeChatPart
hi link WeeChatNick String
hi link WeeChatLink Function