spaces->tabs

master
an 2019-07-05 22:09:01 -04:00
parent 843f3ac18f
commit fd09841ac4
23 changed files with 252 additions and 267 deletions

View File

@ -1,16 +1,16 @@
if status is-interactive if status is-interactive
and not status is-login and not status is-login
and test -z "$TMUX" and test -z "$TMUX"
exec tmux new-session exec tmux new-session
end end
for f in ~/src/scripts/fish/* for f in ~/src/scripts/fish/*
source $f source $f
end end
if test -f ~/.cargo/env if test -f ~/.cargo/env
source ~/.cargo/env source ~/.cargo/env
end end
## EOF ## EOF

View File

@ -1,37 +1,37 @@
def_key "/" def_key "/"
find find
def_key "/" def_key "/"
find_item_forward find_item_forward
def_key "j" def_key "j"
scroll_down scroll_down
def_key "k" def_key "k"
scroll_up scroll_up
def_key "ctrl-b" def_key "ctrl-b"
page_up page_up
def_key "ctrl-f" def_key "ctrl-f"
page_down page_down
def_key "g" def_key "g"
move_home move_home
def_key "G" def_key "G"
move_end move_end
def_key "h" def_key "h"
previous_column previous_column
def_key "l" def_key "l"
next_column next_column
def_key "." def_key "."
show_lyrics show_lyrics
def_key "n" def_key "n"
next_found_item next_found_item
def_key "N" def_key "N"
previous_found_item previous_found_item
def_key "J" def_key "J"
move_sort_order_down move_sort_order_down
def_key "K" def_key "K"
move_sort_order_up move_sort_order_up

View File

@ -1,26 +1,26 @@
{ {
"DefaultFileUploader": "Greyserv", "DefaultFileUploader": "Greyserv",
"DefaultImageUploader": "Greyserv", "DefaultImageUploader": "Greyserv",
"DefaultUrlShortener": null, "DefaultUrlShortener": null,
"XineramaHead": 0, "XineramaHead": 0,
"NotificationTime": 30, "NotificationTime": 30,
"NotifyUploading": true, "NotifyUploading": true,
"NotifyCommand": "", "NotifyCommand": "",
"ClipboardTime": 1, "ClipboardTime": 1,
"SaveFolder": "/home/marrub/Pictures/ShareNix", "SaveFolder": "/home/marrub/Pictures/ShareNix",
"OrganizedFolders": false, "OrganizedFolders": false,
"Services": [ "Services": [
{ {
"Name": "Greyserv", "Name": "Greyserv",
"DestinationType": "None", "DestinationType": "None",
"RequestType": "POST", "RequestType": "POST",
"RequestURL": "https://fuck.greyserv.net/", "RequestURL": "https://fuck.greyserv.net/",
"FileFormName": "file_1", "FileFormName": "file_1",
"ResponseType": "Text", "ResponseType": "Text",
"URL": null, "URL": null,
"ThumbnailURL": null, "ThumbnailURL": null,
"DeletionURL": null "DeletionURL": null
} }
] ]
} }

View File

@ -1,5 +1,5 @@
[[ -o interactive && ! -o login && -z $TMUX ]] && [[ -o interactive && ! -o login && -z $TMUX ]] &&
exec tmux new-session exec tmux new-session
HISTFILE=~/.zsh/hist HISTFILE=~/.zsh/hist
HISTSIZE=100000 HISTSIZE=100000
@ -25,5 +25,5 @@ PROMPT='%#'
RPROMPT='%2~' RPROMPT='%2~'
[[ -n $TMUX ]] && [[ -n $TMUX ]] &&
echo "Word of the moment: $(shuf -n1 /usr/share/dict/words)" | echo "Word of the moment: $(shuf -n1 /usr/share/dict/words)" |
awk -f ~/src/scripts/mid.awk col=$COLUMNS awk -f ~/src/scripts/mid.awk col=$COLUMNS

View File

@ -1,6 +1,9 @@
/etc/fonts/conf.d/10-scale-bitmap-fonts.conf /etc/fonts/conf.d/10-scale-bitmap-fonts.conf
/etc/fonts/conf.d/10-sub-pixel-rgb.conf /etc/fonts/conf.d/10-sub-pixel-rgb.conf
/etc/fonts/conf.d/11-lcdfilter-default.conf /etc/fonts/conf.d/11-lcdfilter-default.conf
/etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf
/etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf
/etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf
/etc/fonts/conf.d/30-metric-aliases.conf /etc/fonts/conf.d/30-metric-aliases.conf
/etc/fonts/conf.d/30-win32-aliases.conf /etc/fonts/conf.d/30-win32-aliases.conf
/etc/fonts/conf.d/40-nonlatin.conf /etc/fonts/conf.d/40-nonlatin.conf
@ -10,6 +13,9 @@
/etc/fonts/conf.d/50-user.conf /etc/fonts/conf.d/50-user.conf
/etc/fonts/conf.d/51-local.conf /etc/fonts/conf.d/51-local.conf
/etc/fonts/conf.d/56-ttf-twemoji-color.conf /etc/fonts/conf.d/56-ttf-twemoji-color.conf
/etc/fonts/conf.d/57-dejavu-sans-mono.conf
/etc/fonts/conf.d/57-dejavu-sans.conf
/etc/fonts/conf.d/57-dejavu-serif.conf
/etc/fonts/conf.d/60-generic.conf /etc/fonts/conf.d/60-generic.conf
/etc/fonts/conf.d/60-latin.conf /etc/fonts/conf.d/60-latin.conf
/etc/fonts/conf.d/65-fonts-persian.conf /etc/fonts/conf.d/65-fonts-persian.conf

View File

@ -1,26 +0,0 @@
{
"DefaultFileUploader": "Greyserv",
"DefaultImageUploader": "Greyserv",
"DefaultUrlShortener": null,
"XineramaHead": 0,
"NotificationTime": 30,
"NotifyUploading": true,
"NotifyCommand": "",
"ClipboardTime": 1,
"SaveFolder": "/home/marrub/Pictures/ShareNix",
"OrganizedFolders": false,
"Services": [
{
"Name": "Greyserv",
"DestinationType": "None",
"RequestType": "POST",
"RequestURL": "https://fuck.greyserv.net/",
"FileFormName": "file_1",
"ResponseType": "Text",
"URL": null,
"ThumbnailURL": null,
"DeletionURL": null
}
]
}

View File

@ -1,14 +1,14 @@
#!/usr/bin/env fish #!/usr/bin/env fish
for f in (find . -type f) for f in (find . -type f)
set ftype (file -b --mime-type "$f") set ftype (file -b --mime-type "$f")
set basetype (string split "/" "$ftype") set basetype (string split "/" "$ftype")
if test "$basetype[1]" = "text" if test "$basetype[1]" = "text"
set tmp (mktemp) set tmp (mktemp)
mac2unix -n "$f" "$tmp" mac2unix -n "$f" "$tmp"
mv "$tmp" "$f" mv "$tmp" "$f"
end end
end end
## EOF ## EOF

View File

@ -3,15 +3,15 @@
set filter 'pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak' set filter 'pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak'
for f in $argv for f in $argv
set out (ffmpeg -nostdin -loglevel error -i "$f" -filter_complex "$filter" -t 0.00002 -f crc -) set out (ffmpeg -nostdin -loglevel error -i "$f" -filter_complex "$filter" -t 0.00002 -f crc -)
if test "$out" != 'CRC=0x00000001' if test "$out" != 'CRC=0x00000001'
set other /tmp/(basename "$f") set other /tmp/(basename "$f")
echo "$f is stereo, converting" echo "$f is stereo, converting"
ffmpeg -i "$f" -ac 1 "$other" && mv "$other" "$f" ffmpeg -i "$f" -ac 1 "$other" && mv "$other" "$f"
else else
echo "$f is mono" echo "$f is mono"
end end
end end
## EOF ## EOF

View File

@ -1,14 +1,14 @@
#!/usr/bin/env fish #!/usr/bin/env fish
function fail function fail
echo "failed to process $f, exiting" echo "failed to process $f, exiting"
exit 1 exit 1
end end
for f in ./*.flac for f in ./*.flac
ffmpeg -i "$f" -q:a 0 -vn (basename "$f" ".flac")".mp3" ffmpeg -i "$f" -q:a 0 -vn (basename "$f" ".flac")".mp3"
or fail or fail
echo "$f success" echo "$f success"
end end
read -P "success. delete files? [yn] " yn read -P "success. delete files? [yn] " yn

View File

@ -1,45 +1,45 @@
#!/usr/bin/env fish #!/usr/bin/env fish
function pull_plugins function pull_plugins
for plugin in ./* for plugin in ./*
cd $plugin cd $plugin
echo "Updating $plugin" echo "Updating $plugin"
git stash git stash
git pull -f git pull -f
set res $status set res $status
if test $res != 0; and test $res != 128 if test $res != 0; and test $res != 128
echo "error $res in $PWD" echo "error $res in $PWD"
exit 1 exit 1
end end
if test -d doc if test -d doc
echo "generating tags for $PWD" echo "generating tags for $PWD"
vim --cmd "helptags doc/" --cmd "q" vim --cmd "helptags doc/" --cmd "q"
end end
cd .. cd ..
end end
end end
function cd_and_pull function cd_and_pull
cd $argv[1] cd $argv[1]
pull_plugins pull_plugins
cd .. cd ..
end end
cd ~/.vim/pack cd ~/.vim/pack
for folder in ./* for folder in ./*
cd $folder cd $folder
test -d start; and cd_and_pull start test -d start; and cd_and_pull start
test -d opt; and cd_and_pull opt test -d opt; and cd_and_pull opt
cd .. cd ..
end end
## EOF ## EOF

View File

@ -1,5 +1,5 @@
#!/usr/bin/env fish #!/usr/bin/env fish
while true while true
x11vnc -forever -scale 0.25 x11vnc -forever -scale 0.25
end end

View File

@ -1,5 +1,5 @@
function cheat.sh -d 'Grabs a sheet from cheat.sh' -a arg function cheat.sh -d 'Grabs a sheet from cheat.sh' -a arg
curl cheat.sh/$arg curl cheat.sh/$arg
end end
complete -c cheat.sh -xa '(curl -s cheat.sh/:list)' complete -c cheat.sh -xa '(curl -s cheat.sh/:list)'

View File

@ -1,5 +1,5 @@
function megadl-all function megadl-all
megadl (cat ~/dl) megadl (cat ~/dl)
end end
## EOF ## EOF

View File

@ -1,13 +1,13 @@
switch (uname) switch (uname)
case Linux case Linux
set -gx CC clang set -gx CC clang
set -gx CXX clang++ set -gx CXX clang++
case Darwin case Darwin
set -gx CMAKE_PREFIX_PATH /usr/local/opt/qt/ set -gx CMAKE_PREFIX_PATH /usr/local/opt/qt/
set -gx DISTCC_HOSTS "192.168.1.2,cpp" set -gx DISTCC_HOSTS "192.168.1.2,cpp"
set -gx fish_user_paths "/usr/local/opt/ruby/bin" $fish_user_paths set -gx fish_user_paths "/usr/local/opt/ruby/bin" $fish_user_paths
set -gx LDFLAGS "-L/usr/local/opt/ruby/lib" set -gx LDFLAGS "-L/usr/local/opt/ruby/lib"
set -gx CPPFLAGS "-I/usr/local/opt/ruby/include" set -gx CPPFLAGS "-I/usr/local/opt/ruby/include"
end end
## EOF ## EOF

View File

@ -1,18 +1,18 @@
function fish_prompt function fish_prompt
echo (set_color c792ea)"$hostname% "(set_color normal) echo (set_color c792ea)"$hostname% "(set_color normal)
end end
function fish_right_prompt function fish_right_prompt
echo (set_color c3e88d)(pwd)(set_color normal) echo (set_color c3e88d)(pwd)(set_color normal)
end end
function fish_greeting function fish_greeting
set_color c50ed2 set_color c50ed2
echo "Word of the moment: "(shuf -n1 /usr/share/dict/words) | echo "Word of the moment: "(shuf -n1 /usr/share/dict/words) |
awk -f ~/src/scripts/text/mid.awk col=$COLUMNS awk -f ~/src/scripts/text/mid.awk col=$COLUMNS
set_color normal set_color normal
end end
## EOF ## EOF

View File

@ -1,30 +1,30 @@
function ql -d 'Changes directory to a quicklink' -a name function ql -d 'Changes directory to a quicklink' -a name
if not set -q quicklink_$name name if not set -q quicklink_$name name
echo (set_color red)"error: no quicklink named $name"(set_color normal) echo (set_color red)"error: no quicklink named $name"(set_color normal)
return return
end end
set name quicklink_$name set name quicklink_$name
cd $$name cd $$name
end end
function ql-r -w ql -d 'Removes a quicklink' -a name function ql-r -w ql -d 'Removes a quicklink' -a name
if not set -q name if not set -q name
echo (set_color red)"error: not enough arguments"(set_color normal) echo (set_color red)"error: not enough arguments"(set_color normal)
return return
end end
set -Ue quicklink_$name set -Ue quicklink_$name
end end
function ql-s -d 'Saves the working directory as a quicklink' -a name function ql-s -d 'Saves the working directory as a quicklink' -a name
if not set -q name if not set -q name
echo (set_color red)"error: not enough arguments"(set_color normal) echo (set_color red)"error: not enough arguments"(set_color normal)
return return
end end
set -U quicklink_$name $PWD set -U quicklink_$name $PWD
end end
complete -c ql -xa '(set -U | rg -or \'$1\' \'^quicklink_(.+) \')' complete -c ql -xa '(set -U | rg -or \'$1\' \'^quicklink_(.+) \')'

View File

@ -1,5 +1,5 @@
function rebuild function rebuild
$HOME/src/scripts/rebuild.rkt $argv $HOME/src/scripts/rebuild.rkt $argv
end end
## EOF ## EOF

View File

@ -1,22 +1,22 @@
#!/usr/bin/env fish #!/usr/bin/env fish
function notify function notify
notify-send -a sharenix -i dialog-information $argv notify-send -a sharenix -i dialog-information $argv
end end
function run_spectacle function run_spectacle
set f "$HOME/Pictures/"(date "+%y%m%d-%H%M%S")".png" set f "$HOME/Pictures/"(date "+%y%m%d-%H%M%S")".png"
spectacle -b $argv -n -o "$f" spectacle -b $argv -n -o "$f"
if test -f "$f" if test -f "$f"
notify -u low -c transfer "Uploading..." notify -u low -c transfer "Uploading..."
if sharenix -s Greyserv "$f" if sharenix -s Greyserv "$f"
notify -u low -c transfer.complete "Upload completed" notify -u low -c transfer.complete "Upload completed"
else else
notify -u normal -c transfer.error "Upload failed" notify -u normal -c transfer.error "Upload failed"
end end
end end
rm "$f" rm "$f"
end end

View File

@ -1,5 +1,6 @@
{ z = col - length {
y = int(z / 2) z = col - length
x = z - y y = int(z / 2)
printf "%*s%s%*s\n", x, "", $0, y, "" x = z - y
printf "%*s%s%*s\n", x, "", $0, y, ""
} }

View File

@ -1,22 +1,22 @@
1{ 1{
i\ i\
/* ---------------------------------------------------------------------------|\ /* ---------------------------------------------------------------------------|\
* *
} }
1,3{ 1,3{
s/\/\// */ s/\/\// */
} }
4{ 4{
c\ c\
*\ *\
* ---------------------------------------------------------------------------|\ * ---------------------------------------------------------------------------|\
* *
} }
5{ 5{
s/\/\/ \w\+\..: \(.\+\)/ * \1/ s/\/\/ \w\+\..: \(.\+\)/ * \1/
} }
6{ 6{
i\ i\
*\ *\
* ---------------------------------------------------------------------------|\ * ---------------------------------------------------------------------------|\
*/ */

View File

@ -1,13 +1,13 @@
1{ 1{
i\ i\
/* ---------------------------------------------------------------------------|\ /* ---------------------------------------------------------------------------|\
* *
} }
1,3{ 1,3{
s/\/\// */ s/\/\// */
} }
4{ 4{
c\ c\
*\ *\
* ---------------------------------------------------------------------------|\ * ---------------------------------------------------------------------------|\
*/\ */\

View File

@ -1,21 +1,25 @@
$! { N $! {
N N
s/\/\/-+\|\n// N
t m1 s/\/\/-+\|\n//
b mE t m1
:m1; s/ / MARKER/ b mE
h :m1
s/.+MARKER// s/ / MARKER/
s/ /-/g h
x s/.+MARKER//
s/MARKER.+// s/ /-/g
x x
H s/MARKER.+//
x x
s/ \n-/ --/ H
t m2 x
b mE s/ \n-/ --/
:m2; N t m2
N b mE
s/\/\/\n//g :m2
:mE; } N
N
s/\/\/\n//g
:mE
}

144
vim/vimrc
View File

@ -64,10 +64,10 @@ set incsearch
" tabulation (3 spaces, auto-indent when my muscle memory demands it) " tabulation (3 spaces, auto-indent when my muscle memory demands it)
set autoindent set autoindent
set expandtab set noexpandtab
set smarttab set smarttab
set shiftwidth=3 set shiftwidth=3
set softtabstop=-1 set tabstop=3
" limits, what/when/how to save and encodings " limits, what/when/how to save and encodings
set undolevels=10000 set undolevels=10000
@ -124,72 +124,72 @@ let g:polyglot_disabled=['c++11']
" gui and terminal specific settings " gui and terminal specific settings
if has('gui_running') if has('gui_running')
set guicursor+=i:hor10-Cursor set guicursor+=i:hor10-Cursor
set guicursor+=a:blinkon0 set guicursor+=a:blinkon0
set guioptions=agit set guioptions=agit
set lines=48 set lines=48
set columns=80 set columns=80
else else
" use 256-color terminal capabilities " use 256-color terminal capabilities
set t_Co=256 set t_Co=256
let base16colorspace=256 let base16colorspace=256
set termguicolors set termguicolors
endif endif
" GUI-specific settings " GUI-specific settings
if has('gui_running') if has('gui_running')
if has('gui_win32') if has('gui_win32')
set guifont=PxPlus_IBM_EGA8:h12:cDEFAULT:qDRAFT set guifont=PxPlus_IBM_EGA8:h12:cDEFAULT:qDRAFT
elseif has('gui_gtk') elseif has('gui_gtk')
set guifont=IBM\ Plex\ Mono\ weight=453\ 10 set guifont=IBM\ Plex\ Mono\ weight=453\ 10
set linespace=-2 set linespace=-2
elseif has('gui_macvim') elseif has('gui_macvim')
set guifont=IBMPlexMono-Text:h14 set guifont=IBMPlexMono-Text:h14
set linespace=-3 set linespace=-3
set blurradius=20 set blurradius=20
set macligatures set macligatures
set macmeta set macmeta
set transparency=10 set transparency=10
endif endif
endif endif
" OS-specific settings " OS-specific settings
if has('win32') if has('win32')
" windows sucks " windows sucks
let $PATH='G:\msys64\usr\bin;'.$PATH let $PATH='G:\msys64\usr\bin;'.$PATH
set shellslash set shellslash
" netrw " netrw
let key='G:/msys64/home/marrub/.ssh/id_rsa' let key='G:/msys64/home/marrub/.ssh/id_rsa'
let g:netrw_cygwin=0 let g:netrw_cygwin=0
let g:netrw_ignorenetrc=1 let g:netrw_ignorenetrc=1
let g:netrw_list_cmd="ssh -i " . key . " USEPORT HOSTNAME ls -Fa " let g:netrw_list_cmd="ssh -i " . key . " USEPORT HOSTNAME ls -Fa "
let g:netrw_ssh_cmd="ssh -i " . key let g:netrw_ssh_cmd="ssh -i " . key
let g:netrw_scp_cmd="scp -q -i " . key let g:netrw_scp_cmd="scp -q -i " . key
let g:netrw_sftp_cmd="sftp -i " . key let g:netrw_sftp_cmd="sftp -i " . key
let g:netrw_silent=1 let g:netrw_silent=1
" gutentags " gutentags
let g:gutentags_cache_dir=$VIM.'/vimtags/' let g:gutentags_cache_dir=$VIM.'/vimtags/'
" swap files " swap files
set directory=$VIM/vimtemp// set directory=$VIM/vimtemp//
else else
if has('mac') if has('mac')
set rubydll=/usr/local/opt/ruby/lib/libruby.dylib set rubydll=/usr/local/opt/ruby/lib/libruby.dylib
endif endif
" gutentags " gutentags
let g:gutentags_cache_dir=$HOME.'/.vim/tags/' let g:gutentags_cache_dir=$HOME.'/.vim/tags/'
" searching " searching
set grepprg=rg\ --vimgrep\ -n set grepprg=rg\ --vimgrep\ -n
" swap files " swap files
set directory=$HOME/.vim/temp// set directory=$HOME/.vim/temp//
endif endif
" set up colors and file types " set up colors and file types
@ -222,44 +222,44 @@ filetype indent on
" Automatic headers " Automatic headers
fu! <SID>FillLine() fu! <SID>FillLine()
ruby<< ruby<<
tw = VIM::evaluate("&tw").to_i tw = VIM::evaluate("&tw").to_i
tw = 80 if tw == 0 tw = 80 if tw == 0
lin = $curbuf.line lin = $curbuf.line
rep = tw - lin.length - 3 rep = tw - lin.length - 3
if rep > 0 if rep > 0
$curbuf.line += " " + "-" * rep + "|" $curbuf.line += " " + "-" * rep + "|"
end end
. .
endfu endfu
" File size " File size
fu! FileSize() fu! FileSize()
let fs=line2byte(line('$')+1)-1 let fs=line2byte(line('$')+1)-1
if fs < 0 if fs < 0
return "" return ""
else else
return fs return fs
endif endif
endfu endfu
" Strip whitespace on buffer write " Strip whitespace on buffer write
fu! s:StripWhite() fu! s:StripWhite()
ruby<< ruby<<
for ln in 1..$curbuf.length for ln in 1..$curbuf.length
rs = $curbuf[ln].rstrip rs = $curbuf[ln].rstrip
if $curbuf[ln] != rs if $curbuf[ln] != rs
$curbuf[ln] = rs $curbuf[ln] = rs
end end
end end
. .
endfu endfu
" Close empty buffers " Close empty buffers
fu! s:CloseEmptyBuffers() fu! s:CloseEmptyBuffers()
let bufs = filter(range(1, bufnr('$')), 'buflisted(v:val) && empty(bufname(v:val)) && bufwinnr(v:val) < 0 && !getbufvar(v:val, "&modified")') let bufs = filter(range(1, bufnr('$')), 'buflisted(v:val) && empty(bufname(v:val)) && bufwinnr(v:val) < 0 && !getbufvar(v:val, "&modified")')
if !empty(bufs) if !empty(bufs)
execute 'bdelete' join(bufs, ' ') execute 'bdelete' join(bufs, ' ')
endif endif
endfu endfu
" Commands -------------------------------------------------------------------| " Commands -------------------------------------------------------------------|