initial set of scripts and configs
commit
bd9c6a66ea
|
@ -0,0 +1,74 @@
|
||||||
|
param([Parameter(Mandatory=$true)][string] $fname)
|
||||||
|
|
||||||
|
function make-ouf($ofn, $ofe)
|
||||||
|
{
|
||||||
|
new-object IO.FileInfo("output/$ofn.$ofe")
|
||||||
|
}
|
||||||
|
|
||||||
|
function log($text)
|
||||||
|
{
|
||||||
|
out-file -append log.txt -inputobject "$text`n" -encoding ascii -nonewline
|
||||||
|
echo "*** $text"
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(test-path output)) {
|
||||||
|
mkdir output
|
||||||
|
}
|
||||||
|
|
||||||
|
$uagent = "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0"
|
||||||
|
$progressPreference = "silentlyContinue"
|
||||||
|
$sums = @()
|
||||||
|
$numerrors = 0
|
||||||
|
$duplicates = 0
|
||||||
|
$newfiles = 0
|
||||||
|
|
||||||
|
if(test-path "hashes.txt") {
|
||||||
|
$sums = (get-content "hashes.txt") -split '\n'
|
||||||
|
} else {
|
||||||
|
log "WARNING: No hashes file. Duplicates will not be removed."
|
||||||
|
}
|
||||||
|
|
||||||
|
log "Started download at $(date)"
|
||||||
|
|
||||||
|
foreach($line in [IO.File]::ReadLines((resolve-path $fname))) {
|
||||||
|
$inf = $line.split('/')[-1].split(':')[0].split('.')
|
||||||
|
$ofn = $inf[0 .. ($inf.length - 2)] -join '.'
|
||||||
|
$ofe = $inf[-1]
|
||||||
|
$ouf = (make-ouf $ofn $ofe)
|
||||||
|
|
||||||
|
while($ouf.exists) {
|
||||||
|
$ofn += '_'
|
||||||
|
$ouf = (make-ouf $ofn $ofe)
|
||||||
|
}
|
||||||
|
|
||||||
|
echo ">>\ $line"
|
||||||
|
echo " | $ouf"
|
||||||
|
|
||||||
|
try {
|
||||||
|
$uri = [Uri]$line
|
||||||
|
$r = invoke-webrequest -useragent $uagent -header @{"Referer" = ('http://' + $uri.host) } -uri $line -sessionvariable ofp -erroraction stop -timeout 60 -outfile $ouf
|
||||||
|
$sum = ((xxhsum $ouf) -split " ")[0]
|
||||||
|
if($sums.contains($sum)) {
|
||||||
|
rm $ouf
|
||||||
|
$duplicates += 1
|
||||||
|
echo " / duplicate $sum"
|
||||||
|
} else {
|
||||||
|
$sums += $sum
|
||||||
|
$newfiles += 1
|
||||||
|
echo "<</ success $sum"
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
echo "!!! error: " $error[0]
|
||||||
|
log "Failed: $line"
|
||||||
|
$numerrors += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($numerrors) {log "$numerrors errors"} else {log "No errors"}
|
||||||
|
if($duplicates) {log "$duplicates duplicates removed"} else {log "No duplicates"}
|
||||||
|
if($newfiles) {log "$newfiles new files"} else {log "No new files"}
|
||||||
|
|
||||||
|
copy-item hashes.txt hashes.old.txt
|
||||||
|
set-content -path hashes.txt -value $sums
|
||||||
|
|
||||||
|
log "Done."
|
|
@ -0,0 +1,9 @@
|
||||||
|
while read t f;do
|
||||||
|
cp $(find $t) $f;done <<END
|
||||||
|
$HOME/bin/_scripts/* .
|
||||||
|
/mnt/d/w2/Output/_dlscr/bookmark_get.ps1 bookmark_get.ps1
|
||||||
|
$HOME/.vimrc vimrc
|
||||||
|
$HOME/.zshrc zshrc
|
||||||
|
$HOME/bin/mupen64plus-noncore-plugins-git/PKGBUILD m64p-plugins-pkgbuild
|
||||||
|
/usr/share/X11/xkb/symbols/progm progm.xkb
|
||||||
|
END
|
|
@ -0,0 +1,56 @@
|
||||||
|
pkgname=mupen64plus-noncore-plugins-git
|
||||||
|
pkgver=any
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="All non-core plugins for Mupen64Plus"
|
||||||
|
arch=('i686' 'x86_64')
|
||||||
|
url="https://www.mupen64plus.org/"
|
||||||
|
license=('GPL' 'custom:CC0')
|
||||||
|
depends=('mupen64plus')
|
||||||
|
makedepends=('git' 'mesa' 'glibc' 'cmake' 'boost')
|
||||||
|
source=('https://github.com/gonetz/GLideN64/archive/Public_Release_4_0.tar.gz'
|
||||||
|
"git+https://github.com/mupen64plus/mupen64plus-video-arachnoid"
|
||||||
|
"git+https://github.com/ata4/angrylion-rdp-plus"
|
||||||
|
"git+https://github.com/mupen64plus/mupen64plus-rsp-cxd4"
|
||||||
|
"git+https://github.com/mupen64plus/mupen64plus-rsp-z64")
|
||||||
|
sha256sums=('6b379cf109433527155b479d67a32c903bf074003907bea26de224a573501af6'
|
||||||
|
'SKIP'
|
||||||
|
'SKIP'
|
||||||
|
'SKIP'
|
||||||
|
'SKIP')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$srcdir/GLideN64-Public_Release_4_0/src"
|
||||||
|
echo "#define PLUGIN_REVISION \"4.0\"" > "Revision.h"
|
||||||
|
cmake -D MUPENPLUSAPI=On CMakeLists.txt
|
||||||
|
make
|
||||||
|
|
||||||
|
cd "$srcdir/mupen64plus-video-arachnoid/projects/unix"
|
||||||
|
make all PIC=1
|
||||||
|
|
||||||
|
cd "$srcdir/angrylion-rdp-plus"
|
||||||
|
cmake CMakeLists.txt
|
||||||
|
make
|
||||||
|
|
||||||
|
cd "$srcdir/mupen64plus-rsp-cxd4/projects/unix"
|
||||||
|
make all PIC=1
|
||||||
|
|
||||||
|
cd "$srcdir/mupen64plus-rsp-z64/projects/unix"
|
||||||
|
make all SSE=SSE3 PIC=1
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "$srcdir/GLideN64-Public_Release_4_0/src/plugin/Release"
|
||||||
|
install -Dm644 "mupen64plus-video-GLideN64.so" "$pkgdir/usr/lib/mupen64plus/mupen64plus-video-GLideN64.so"
|
||||||
|
|
||||||
|
cd "$srcdir/mupen64plus-video-arachnoid/projects/unix"
|
||||||
|
install -Dm644 "mupen64plus-video-arachnoid.so" "$pkgdir/usr/lib/mupen64plus/mupen64plus-video-arachnoid.so"
|
||||||
|
|
||||||
|
cd "$srcdir/angrylion-rdp-plus"
|
||||||
|
install -Dm644 "mupen64plus-video-angrylion-plus.so" "$pkgdir/usr/lib/mupen64plus/mupen64plus-video-angrylion-plus.so"
|
||||||
|
|
||||||
|
cd "$srcdir/mupen64plus-rsp-cxd4/projects/unix"
|
||||||
|
install -Dm644 "mupen64plus-rsp-cxd4-sse2.so" "$pkgdir/usr/lib/mupen64plus/mupen64plus-rsp-cxd4-sse2.so"
|
||||||
|
|
||||||
|
cd "$srcdir/mupen64plus-rsp-z64/projects/unix"
|
||||||
|
install -Dm644 "mupen64plus-rsp-z64.so" "$pkgdir/usr/lib/mupen64plus/mupen64plus-rsp-z64.so"
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
export PATH=$HOME/.local/bin:$PATH
|
||||||
|
export DOOMWADDIR=/mnt/d/Stuff/GamesPC/IWads
|
|
@ -0,0 +1,101 @@
|
||||||
|
styleset {
|
||||||
|
name = "porple";
|
||||||
|
|
||||||
|
default {
|
||||||
|
font = "Px437 IBM VGA8";
|
||||||
|
size = 12;
|
||||||
|
foreground = 216, 216, 216;
|
||||||
|
background = 41, 44, 54;
|
||||||
|
bold = 0;
|
||||||
|
italic = 0;
|
||||||
|
underlined = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
selection {
|
||||||
|
background = 71, 65, 96;
|
||||||
|
}
|
||||||
|
|
||||||
|
preprocessor {
|
||||||
|
foreground = 239, 161, 107;
|
||||||
|
}
|
||||||
|
|
||||||
|
comment {
|
||||||
|
foreground = 101, 86, 138;
|
||||||
|
}
|
||||||
|
|
||||||
|
comment_doc {
|
||||||
|
foreground = 100, 135, 143;
|
||||||
|
}
|
||||||
|
|
||||||
|
string {
|
||||||
|
foreground = 149, 199, 111;
|
||||||
|
}
|
||||||
|
|
||||||
|
character {
|
||||||
|
foreground = 248, 69, 71;
|
||||||
|
}
|
||||||
|
|
||||||
|
keyword {
|
||||||
|
foreground = 183, 73, 137;
|
||||||
|
}
|
||||||
|
|
||||||
|
constant {
|
||||||
|
foreground = 210, 142, 93;
|
||||||
|
}
|
||||||
|
|
||||||
|
type {
|
||||||
|
foreground = 239, 161, 107;
|
||||||
|
}
|
||||||
|
|
||||||
|
property {
|
||||||
|
foreground = 248, 69, 71;
|
||||||
|
}
|
||||||
|
|
||||||
|
function {
|
||||||
|
foreground = 132, 133, 206;
|
||||||
|
}
|
||||||
|
|
||||||
|
number {
|
||||||
|
foreground = 210, 142, 93;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator {
|
||||||
|
}
|
||||||
|
|
||||||
|
bracematch {
|
||||||
|
bold = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bracebad {
|
||||||
|
foreground = 41, 44, 54;
|
||||||
|
background = 248, 69, 71;
|
||||||
|
bold = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
linenum {
|
||||||
|
foreground = 101, 86, 138;
|
||||||
|
background = 51, 51, 68;
|
||||||
|
}
|
||||||
|
|
||||||
|
calltip {
|
||||||
|
}
|
||||||
|
|
||||||
|
calltip_hl {
|
||||||
|
}
|
||||||
|
|
||||||
|
foldmargin {
|
||||||
|
foreground = 101, 86, 138;
|
||||||
|
background = 51, 51, 68;
|
||||||
|
}
|
||||||
|
|
||||||
|
guides {
|
||||||
|
}
|
||||||
|
|
||||||
|
wordmatch {
|
||||||
|
}
|
||||||
|
|
||||||
|
current_line {
|
||||||
|
background = 51, 51, 68;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
partial
|
||||||
|
xkb_symbols "us-intl" {
|
||||||
|
name[Group1] = "English (US, Programmer, intl., with dead keys)";
|
||||||
|
include "us(intl)"
|
||||||
|
key <AB08> { [ comma, less ] }; // , <
|
||||||
|
key <AB09> { [ period, greater ] }; // . >
|
||||||
|
key <AB10> { [ slash, question ] }; // / ?
|
||||||
|
key <AC10> { [ semicolon, plus ] }; // ; +
|
||||||
|
key <AC11> { [ at, quoteleft ] }; // @ `
|
||||||
|
key <AD11> { [ bracketleft, braceleft ] }; // [ {
|
||||||
|
key <AD12> { [bracketright, braceright ] }; // ] }
|
||||||
|
key <AE01> { [ 1, exclam ] }; // 1 !
|
||||||
|
key <AE02> { [ 2, quotedbl ] }; // 2 "
|
||||||
|
key <AE03> { [ 3, numbersign ] }; // 3 #
|
||||||
|
key <AE04> { [ 4, dollar ] }; // 4 $
|
||||||
|
key <AE05> { [ 5, percent ] }; // 5 %
|
||||||
|
key <AE06> { [ 6, ampersand ] }; // 6 &
|
||||||
|
key <AE07> { [ 7, quoteright ] }; // 7 '
|
||||||
|
key <AE08> { [ 8, parenleft ] }; // 8 (
|
||||||
|
key <AE09> { [ 9, parenright ] }; // 9 )
|
||||||
|
key <AE10> { [ 0, minus ] }; // 0 -
|
||||||
|
key <AE11> { [ colon, asterisk ] }; // : *
|
||||||
|
key <AE12> { [ underbar, equal ] }; // _ =
|
||||||
|
key <BKSL> { [ backslash, bar ] }; // \ |
|
||||||
|
key <TLDE> { [ asciicircum, asciitilde ] }; // ^ ~
|
||||||
|
};
|
||||||
|
|
||||||
|
partial
|
||||||
|
xkb_symbols "us-workman-intl" {
|
||||||
|
name[Group1] = "English (Workman, Programmer, intl., with dead keys)";
|
||||||
|
include "us(workman-intl)"
|
||||||
|
key <AB08> { [ comma, less ] }; // , <
|
||||||
|
key <AB09> { [ period, greater ] }; // . >
|
||||||
|
key <AB10> { [ slash, question ] }; // / ?
|
||||||
|
key <AD10> { [ semicolon, plus ] }; // ; +
|
||||||
|
key <AC11> { [ at, quoteleft ] }; // @ `
|
||||||
|
key <AD11> { [ bracketleft, braceleft ] }; // [ {
|
||||||
|
key <AD12> { [bracketright, braceright ] }; // ] }
|
||||||
|
key <AE01> { [ 1, exclam ] }; // 1 !
|
||||||
|
key <AE02> { [ 2, quotedbl ] }; // 2 "
|
||||||
|
key <AE03> { [ 3, numbersign ] }; // 3 #
|
||||||
|
key <AE04> { [ 4, dollar ] }; // 4 $
|
||||||
|
key <AE05> { [ 5, percent ] }; // 5 %
|
||||||
|
key <AE06> { [ 6, ampersand ] }; // 6 &
|
||||||
|
key <AE07> { [ 7, quoteright ] }; // 7 '
|
||||||
|
key <AE08> { [ 8, parenleft ] }; // 8 (
|
||||||
|
key <AE09> { [ 9, parenright ] }; // 9 )
|
||||||
|
key <AE10> { [ 0, minus ] }; // 0 -
|
||||||
|
key <AE11> { [ colon, asterisk ] }; // : *
|
||||||
|
key <AE12> { [ underbar, equal ] }; // _ =
|
||||||
|
key <BKSL> { [ backslash, bar ] }; // \ |
|
||||||
|
key <TLDE> { [ asciicircum, asciitilde ] }; // ^ ~
|
||||||
|
key <CAPS> { [ Caps_Lock ] };
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
export spectacleargs=-a
|
||||||
|
|
||||||
|
. $HOME/bin/_scripts/sharenix.sh
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
export spectacleargs=-f
|
||||||
|
|
||||||
|
. $HOME/bin/_scripts/sharenix.sh
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
export spectacleargs=-r
|
||||||
|
|
||||||
|
. $HOME/bin/_scripts/sharenix.sh
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
f=$HOME/Pictures/$(date "+%y%m%d-%H%M%S").png
|
||||||
|
|
||||||
|
spectacle -b $spectacleargs -n -o $f
|
||||||
|
|
||||||
|
if [ -f $f ]
|
||||||
|
then
|
||||||
|
sharenix -n -s Greyserv $f
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm $f
|
|
@ -0,0 +1,404 @@
|
||||||
|
" Settings -------------------------------------------------------------------|
|
||||||
|
|
||||||
|
se lbr
|
||||||
|
se sbr=
|
||||||
|
se sm
|
||||||
|
se ve=onemore
|
||||||
|
se ttm=0
|
||||||
|
se hls
|
||||||
|
se scs
|
||||||
|
se ic
|
||||||
|
se is
|
||||||
|
se ai
|
||||||
|
se et
|
||||||
|
se sta
|
||||||
|
se sw=3
|
||||||
|
se sts=-1
|
||||||
|
se cf
|
||||||
|
se ru
|
||||||
|
se wmnu
|
||||||
|
se acd
|
||||||
|
se lz
|
||||||
|
se cole=1
|
||||||
|
se ul=1000
|
||||||
|
se ls=2
|
||||||
|
se tpm=1000
|
||||||
|
se enc=utf-8
|
||||||
|
se fencs=ucs_bom,utf_8,sjis
|
||||||
|
se bs=indent,eol,start
|
||||||
|
se vi='100,/50,<50,s10,h,%
|
||||||
|
se stl=[%{&syn}]\ %f
|
||||||
|
se stl+=%r
|
||||||
|
se stl+=%m
|
||||||
|
"se stl+=\ %{tagbar#currenttag('←\ %s\ ','','f')}
|
||||||
|
se stl+=\ %=
|
||||||
|
se stl+=\ %{MabFileSize()}
|
||||||
|
se stl+=\ %4l:%-3c
|
||||||
|
se stl+=\ %4L
|
||||||
|
se stl+=\ %3p%%
|
||||||
|
se bo=all
|
||||||
|
se cc=81
|
||||||
|
se nuw=4
|
||||||
|
se hid
|
||||||
|
se ffs=unix,dos,mac
|
||||||
|
se nojs
|
||||||
|
se ut=500
|
||||||
|
se fo=tcrqnolj
|
||||||
|
se com=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
|
||||||
|
se rnu
|
||||||
|
se nu
|
||||||
|
|
||||||
|
if has('gui_running')
|
||||||
|
se gcr+=i:hor10-Cursor
|
||||||
|
se gcr+=a:blinkon0
|
||||||
|
se go=agit
|
||||||
|
se lines=50
|
||||||
|
se co=90
|
||||||
|
se cul
|
||||||
|
el
|
||||||
|
se t_Co=256
|
||||||
|
let base16colorspace=256
|
||||||
|
se tgc
|
||||||
|
en
|
||||||
|
|
||||||
|
colo base16-porple
|
||||||
|
|
||||||
|
sy on
|
||||||
|
|
||||||
|
" 2019-02-25. I finally concede to turning all of these on...
|
||||||
|
" although my autocommands still turn off most of them. ;P
|
||||||
|
filet on
|
||||||
|
filet plugin on
|
||||||
|
filet indent on
|
||||||
|
|
||||||
|
" good fonts:
|
||||||
|
" =Lucida_Console:h10:cANSI:qDRAFT
|
||||||
|
" =Noto_Mono:h10:cANSI:qDRAFT
|
||||||
|
" =ばぐまるゴシック:h12:cSHIFTJIS:qDRAFT
|
||||||
|
" =Courier:h10:cANSI:qDRAFT
|
||||||
|
" =Px437_IBM_PS/2thin4:h12:cDEFAULT:qDRAFT
|
||||||
|
" =PxPlus_IBM_EGA8:h12:cDEFAULT:qDRAFT
|
||||||
|
" =PxPlus_IBM_VGA8:h12:cDEFAULT:qDRAFT
|
||||||
|
|
||||||
|
" good colors:
|
||||||
|
" base16-atelier-cave
|
||||||
|
" base16-atelier-sulphurpool
|
||||||
|
" base16-atelier-plateu-light
|
||||||
|
" base16-circus
|
||||||
|
" base16-material-palenight
|
||||||
|
" base16-porple
|
||||||
|
" base16-rebecca
|
||||||
|
" base16-unikitty-dark
|
||||||
|
" base16-xcode-dusk
|
||||||
|
" morning
|
||||||
|
" JSCZmgNell
|
||||||
|
|
||||||
|
" Global Config --------------------------------------------------------------|
|
||||||
|
|
||||||
|
" bufexplorer
|
||||||
|
let g:bufExplorerDisableDefaultKeyMapping=1
|
||||||
|
|
||||||
|
" Gutentags
|
||||||
|
let g:gutentags_project_root=['.git', 'Makefile']
|
||||||
|
|
||||||
|
" TwitVim
|
||||||
|
let twitvim_browser_cmd='palemoon'
|
||||||
|
|
||||||
|
" vim-markdown
|
||||||
|
let g:vim_markdown_folding_disabled=1
|
||||||
|
|
||||||
|
" rainbow
|
||||||
|
let g:rainbow_active=0
|
||||||
|
|
||||||
|
" netrw
|
||||||
|
let g:netrw_banner=0
|
||||||
|
let g:netrw_liststyle=3
|
||||||
|
let g:netrw_browse_split=4
|
||||||
|
let g:netrw_altv=1
|
||||||
|
let g:netrw_winsize=20
|
||||||
|
|
||||||
|
" buftabline
|
||||||
|
let g:buftabline_indicators=1
|
||||||
|
let g:buftabline_numbers=2
|
||||||
|
|
||||||
|
" vim
|
||||||
|
let mapleader="\<Tab>"
|
||||||
|
|
||||||
|
" TagBar
|
||||||
|
let g:tagbar_vertical=7
|
||||||
|
let g:tagbar_compact=1
|
||||||
|
let g:tagbar_show_linenumbers=1
|
||||||
|
let g:tagbar_iconchars=['»', '▼']
|
||||||
|
let g:tagbar_autoshowtag=1
|
||||||
|
|
||||||
|
" abolish
|
||||||
|
let g:abolish_no_mappings=1 " we set out own later
|
||||||
|
|
||||||
|
" OS-specific settings -------------------------------------------------------|
|
||||||
|
|
||||||
|
if has('gui_running')
|
||||||
|
if has('win32')
|
||||||
|
se gfn=PxPlus_IBM_EGA8:h12:cDEFAULT:qDRAFT
|
||||||
|
el
|
||||||
|
se gfn=PxPlus\ IBM\ EGA8\ 12
|
||||||
|
se lsp=-2
|
||||||
|
en
|
||||||
|
en
|
||||||
|
|
||||||
|
if has('win32')
|
||||||
|
let $PATH='G:\msys64\usr\bin;'.$PATH
|
||||||
|
se ssl
|
||||||
|
let key='G:/msys64/home/marrub/.ssh/id_rsa'
|
||||||
|
let g:netrw_cygwin=0
|
||||||
|
let g:netrw_ignorenetrc=1
|
||||||
|
let g:netrw_list_cmd="ssh -i " . key . " USEPORT HOSTNAME ls -Fa "
|
||||||
|
let g:netrw_ssh_cmd="ssh -i " . key
|
||||||
|
let g:netrw_scp_cmd="scp -q -i " . key
|
||||||
|
let g:netrw_sftp_cmd="sftp -i " . key
|
||||||
|
let g:netrw_silent=1
|
||||||
|
let g:gutentags_cache_dir=$VIM .'/vimtags/'
|
||||||
|
se dir=$VIM/vimtemp//
|
||||||
|
el
|
||||||
|
let g:gutentags_cache_dir=$HOME.'/.vim/tags/'
|
||||||
|
se gp=rg\ --vimgrep\ -n
|
||||||
|
se dir=$HOME/.vim/temp//
|
||||||
|
en
|
||||||
|
|
||||||
|
" Functions ------------------------------------------------------------------|
|
||||||
|
|
||||||
|
" Strip whitespace on buffer write
|
||||||
|
fu! <SID>StripWhite()
|
||||||
|
let l=line(".")
|
||||||
|
let c=col(".")
|
||||||
|
%s/\s\+$//e
|
||||||
|
cal cursor(l, c)
|
||||||
|
endf
|
||||||
|
|
||||||
|
" Automatic headers
|
||||||
|
fu! <SID>FillLine(str)
|
||||||
|
let tw=&textwidth
|
||||||
|
if tw == 0 | let tw=80 | en
|
||||||
|
.s/\s*$//
|
||||||
|
let rep = ((tw - col("$")) / len(a:str)) - 2
|
||||||
|
if rep > 0 | .s/$/\=(' '.repeat(a:str, rep))/ | en
|
||||||
|
endf
|
||||||
|
|
||||||
|
" File size
|
||||||
|
fu! MabFileSize()
|
||||||
|
let fs=line2byte(line('$')+1)-1
|
||||||
|
if fs < 0 | retu "" | else | retu fs | en
|
||||||
|
endf
|
||||||
|
|
||||||
|
" Close empty buffers
|
||||||
|
fu! <SID>CloseEmptyBuffers()
|
||||||
|
let bufs = filter(range(1, bufnr('$')), 'buflisted(v:val) && empty(bufname(v:val)) && bufwinnr(v:val) < 0 && !getbufvar(v:val, "&mod")')
|
||||||
|
if !empty(bufs)
|
||||||
|
exe 'bd' join(bufs, ' ')
|
||||||
|
en
|
||||||
|
endf
|
||||||
|
|
||||||
|
" Autocommands ---------------------------------------------------------------|
|
||||||
|
|
||||||
|
" Strip whitespace
|
||||||
|
au FileType c,cpp,cs,java,php,ruby,rust,python,go,zscript,markdown au BufWritePre <buffer> cal <SID>StripWhite()
|
||||||
|
|
||||||
|
" Enable rainbow braces
|
||||||
|
au FileType c,cpp,cs,java,php,ruby,rust,python,go,zscript,html,scheme,racket,lisp au BufEnter <buffer> RainbowToggleOn
|
||||||
|
|
||||||
|
" ASM options
|
||||||
|
au BufNewFile,BufRead *.s,*.inc setl sw=8 ft=asm_ca65
|
||||||
|
|
||||||
|
" close empty buffers automatically
|
||||||
|
au BufEnter * cal <SID>CloseEmptyBuffers()
|
||||||
|
|
||||||
|
" EDF → conf
|
||||||
|
au FileType edif se syn=conf
|
||||||
|
|
||||||
|
" disable most ftplugins
|
||||||
|
au BufReadPre * let b:did_ftplugin=1
|
||||||
|
|
||||||
|
" au VimEnter * nested :TagbarOpen
|
||||||
|
|
||||||
|
" rust.vim sets Cargo.toml to use filetype `cfg` even though it shouldn't, to
|
||||||
|
" fix this we simply do the same thing before it has a chance to
|
||||||
|
au BufRead,BufNewFile Cargo.toml if &filetype == "" | set filetype=toml | endif
|
||||||
|
|
||||||
|
"au VimEnter * vs
|
||||||
|
|
||||||
|
" Mapping --------------------------------------------------------------------|
|
||||||
|
|
||||||
|
" Alignment mode
|
||||||
|
nm ga <Plug>(EasyAlign)
|
||||||
|
xm ga <Plug>(EasyAlign)
|
||||||
|
|
||||||
|
nn <Leader>e :cal <SID>FillLine("-")<CR>A\|<ESC>
|
||||||
|
|
||||||
|
" TagBar
|
||||||
|
nm <F5> :TagbarToggle<CR>
|
||||||
|
|
||||||
|
" Copyright header
|
||||||
|
nn <Leader>C :0pu=strftime('// Copyright © %Y ')<CR>A
|
||||||
|
|
||||||
|
" Align text
|
||||||
|
nn <Leader>c :ce<CR>
|
||||||
|
nn <Leader>R :ri<CR>
|
||||||
|
|
||||||
|
" Faux asterism
|
||||||
|
nn <Leader>A o<ESC>A*<CR>* *<ESC><Up>2:ce<CR>
|
||||||
|
|
||||||
|
" Substitute word across file
|
||||||
|
nn <Leader>s :%s/\<<C-r><C-w>\>//g<Left><Left>
|
||||||
|
|
||||||
|
" Fuck off, highlighting
|
||||||
|
nn <silent> <Leader><Space> :noh<Bar>:ec<CR>
|
||||||
|
|
||||||
|
" Block comments
|
||||||
|
nn <Leader>r O//<CR>//<CR>//<Up><End> <ESC>A
|
||||||
|
|
||||||
|
" Preview tag
|
||||||
|
nn <Leader>t :pta <C-r><C-w><CR>
|
||||||
|
|
||||||
|
" Fold mark
|
||||||
|
nn <Leader>f zfa{
|
||||||
|
|
||||||
|
" Spellcheck toggle
|
||||||
|
nn <Leader>q :setl spell!<CR>
|
||||||
|
|
||||||
|
" Use ag
|
||||||
|
nn <Leader>a :Ack!
|
||||||
|
|
||||||
|
" Map emoji
|
||||||
|
nn <Leader>E :%s/:\([^:]\+\):/\=emoji#for(submatch(1), submatch(0))/g<CR>
|
||||||
|
|
||||||
|
" Sort
|
||||||
|
nn <Leader>S vip:sort<CR>
|
||||||
|
vn <Leader>S :sort<CR>
|
||||||
|
|
||||||
|
" Tmux-like bindings
|
||||||
|
nn <silent> <Leader>bw :let g:netrw_chgwin = winnr()<CR>
|
||||||
|
nn <silent> <Leader>b" :new<CR>:winc x<CR>:winc j<CR>
|
||||||
|
nn <silent> <Leader>b% :vne<CR>:winc x<CR>:winc l<CR>
|
||||||
|
|
||||||
|
" Buffer movement
|
||||||
|
nn <silent> <Leader>bn :bn<CR>
|
||||||
|
nn <silent> <Leader>bv :bp<CR>
|
||||||
|
nn <silent> <Leader>be :BufExplorer<CR>
|
||||||
|
nn <silent> <Leader>bd :bp\|bd #<CR>
|
||||||
|
nn <silent> <Leader>bq :bufdo bd<CR>
|
||||||
|
nn <silent> <Leader>bs :new\|BufExplorer<CR>
|
||||||
|
nn <silent> <Leader>br :bro ol<CR>
|
||||||
|
nn <silent> <Leader>bb b
|
||||||
|
nm <Leader>1 <Plug>BufTabLine.Go(1)
|
||||||
|
nm <Leader>2 <Plug>BufTabLine.Go(2)
|
||||||
|
nm <Leader>3 <Plug>BufTabLine.Go(3)
|
||||||
|
nm <Leader>4 <Plug>BufTabLine.Go(4)
|
||||||
|
nm <Leader>5 <Plug>BufTabLine.Go(5)
|
||||||
|
nm <Leader>6 <Plug>BufTabLine.Go(6)
|
||||||
|
nm <Leader>7 <Plug>BufTabLine.Go(7)
|
||||||
|
nm <Leader>8 <Plug>BufTabLine.Go(8)
|
||||||
|
nm <Leader>9 <Plug>BufTabLine.Go(9)
|
||||||
|
|
||||||
|
" Copy whole file
|
||||||
|
nn <silent> <Leader>x gg"+yG``
|
||||||
|
|
||||||
|
" Mirror
|
||||||
|
vn <Leader>v c<C-O>:se ri<CR><C-R>"<Esc>:se nori<CR>
|
||||||
|
|
||||||
|
" Fix syntax
|
||||||
|
nn <silent> <F11> :sy sync fromstart<CR>
|
||||||
|
nn <silent> <F12> :sy off\|sy on\|RainbowToggleOn<CR>
|
||||||
|
|
||||||
|
" Ctrl-Arrow movement
|
||||||
|
nn <silent> <C-k> <C-w>+
|
||||||
|
nn <silent> <C-j> <C-w>-
|
||||||
|
nn <silent> <C-h> b
|
||||||
|
nn <silent> <C-l> w
|
||||||
|
nn <silent> <C-Up> <C-w>+
|
||||||
|
nn <silent> <C-Down> <C-w>-
|
||||||
|
nn <silent> <C-Left> b
|
||||||
|
nn <silent> <C-Right> w
|
||||||
|
|
||||||
|
" Better movement
|
||||||
|
nn j gj
|
||||||
|
vn j gj
|
||||||
|
nn k gk
|
||||||
|
vn k gk
|
||||||
|
|
||||||
|
nn <S-j> j
|
||||||
|
vn <S-j> j
|
||||||
|
nn <S-k> k
|
||||||
|
vn <S-k> k
|
||||||
|
|
||||||
|
nn <Del> x
|
||||||
|
vn <Del> x
|
||||||
|
|
||||||
|
nn <Up> <Nop>
|
||||||
|
vn <Up> <Nop>
|
||||||
|
nn <Down> <Nop>
|
||||||
|
vn <Down> <Nop>
|
||||||
|
nn <Left> <Nop>
|
||||||
|
vn <Left> <Nop>
|
||||||
|
nn <Right> <Nop>
|
||||||
|
vn <Right> <Nop>
|
||||||
|
|
||||||
|
nn <End> <Nop>
|
||||||
|
vn <End> <Nop>
|
||||||
|
nn <Home> <Nop>
|
||||||
|
vn <Home> <Nop>
|
||||||
|
nn <PageDown> <Nop>
|
||||||
|
vn <PageDown> <Nop>
|
||||||
|
nn <PageUp> <Nop>
|
||||||
|
vn <PageUp> <Nop>
|
||||||
|
|
||||||
|
" abolish
|
||||||
|
nm cr <Plug>(abolish-coerce-word)
|
||||||
|
|
||||||
|
" find
|
||||||
|
com! -nargs=+ -complete=file -bar Gr sil! gr! "<Args>"|cw
|
||||||
|
nn KK :Gr \b<C-r><C-w>\b<CR>
|
||||||
|
nn Kk :Gr<Space>
|
||||||
|
|
||||||
|
" Rainbow Config -------------------------------------------------------------|
|
||||||
|
|
||||||
|
let g:rainbow_conf = {
|
||||||
|
\ 'guifgs': ['#ff533d', '#ff973d', '#ffe13d', '#91ff3d', '#3dffd8', '#3daeff', '#6a3dff', '#ee3dff'],
|
||||||
|
\ 'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'],
|
||||||
|
\ 'operators': '_,_',
|
||||||
|
\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'],
|
||||||
|
\ 'separately': {
|
||||||
|
\ '*': {},
|
||||||
|
\ 'haskell': {
|
||||||
|
\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/\v\{\ze[^-]/ end=/}/ fold'],
|
||||||
|
\ },
|
||||||
|
\ 'tex': {
|
||||||
|
\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/'],
|
||||||
|
\ },
|
||||||
|
\ 'vim': {
|
||||||
|
\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/\[/ end=/\]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'],
|
||||||
|
\ },
|
||||||
|
\ 'xml': {
|
||||||
|
\ 'syn_name_prefix': 'xmlRainbow',
|
||||||
|
\ 'parentheses': ['start=/\v\<\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'))?)*\>/ end=#</\z1># fold'],
|
||||||
|
\ },
|
||||||
|
\ 'xhtml': {
|
||||||
|
\ 'parentheses': ['start=/\v\<\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'))?)*\>/ end=#</\z1># fold'],
|
||||||
|
\ },
|
||||||
|
\ 'html': {
|
||||||
|
\ 'parentheses': ['start=/\v\<((script|style|area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=#</\z1># fold'],
|
||||||
|
\ },
|
||||||
|
\ 'perl': {
|
||||||
|
\ 'syn_name_prefix': 'perlBlockFoldRainbow',
|
||||||
|
\ },
|
||||||
|
\ 'php': {
|
||||||
|
\ 'syn_name_prefix': 'phpBlockRainbow',
|
||||||
|
\ 'parentheses': ['start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=#</\z1># fold', 'start=/(/ end=/)/ containedin=@htmlPreproc contains=@phpClTop', 'start=/\[/ end=/\]/ containedin=@htmlPreproc contains=@phpClTop', 'start=/{/ end=/}/ containedin=@htmlPreproc contains=@phpClTop'],
|
||||||
|
\ },
|
||||||
|
\ 'stylus': {
|
||||||
|
\ 'parentheses': ['start=/{/ end=/}/ fold contains=@colorableGroup'],
|
||||||
|
\ },
|
||||||
|
\ 'css': 0,
|
||||||
|
\ 'sh': 0,
|
||||||
|
\ }
|
||||||
|
\}
|
||||||
|
|
||||||
|
" EOF
|
|
@ -0,0 +1,14 @@
|
||||||
|
HISTFILE=~/.zsh/hist
|
||||||
|
HISTSIZE=100000
|
||||||
|
SAVEHIST=10000
|
||||||
|
|
||||||
|
setopt appendhistory extendedglob nomatch
|
||||||
|
unsetopt autocd beep
|
||||||
|
|
||||||
|
bindkey -e
|
||||||
|
bindkey "^[[H" beginning-of-line
|
||||||
|
bindkey "^[[F" end-of-line
|
||||||
|
|
||||||
|
zstyle :compinstall filename '/home/marrub/.zshrc'
|
||||||
|
autoload -Uz compinit
|
||||||
|
compinit
|
Loading…
Reference in New Issue