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
and not status is-login
and test -z "$TMUX"
and not status is-login
and test -z "$TMUX"
exec tmux new-session
exec tmux new-session
end
for f in ~/src/scripts/fish/*
source $f
source $f
end
if test -f ~/.cargo/env
source ~/.cargo/env
source ~/.cargo/env
end
## EOF

View File

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

View File

@ -1,26 +1,26 @@
{
"DefaultFileUploader": "Greyserv",
"DefaultImageUploader": "Greyserv",
"DefaultUrlShortener": null,
"XineramaHead": 0,
"NotificationTime": 30,
"NotifyUploading": true,
"NotifyCommand": "",
"ClipboardTime": 1,
"SaveFolder": "/home/marrub/Pictures/ShareNix",
"OrganizedFolders": false,
"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
}
]
"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,5 +1,5 @@
[[ -o interactive && ! -o login && -z $TMUX ]] &&
exec tmux new-session
exec tmux new-session
HISTFILE=~/.zsh/hist
HISTSIZE=100000
@ -25,5 +25,5 @@ PROMPT='%#'
RPROMPT='%2~'
[[ -n $TMUX ]] &&
echo "Word of the moment: $(shuf -n1 /usr/share/dict/words)" |
awk -f ~/src/scripts/mid.awk col=$COLUMNS
echo "Word of the moment: $(shuf -n1 /usr/share/dict/words)" |
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-sub-pixel-rgb.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-win32-aliases.conf
/etc/fonts/conf.d/40-nonlatin.conf
@ -10,6 +13,9 @@
/etc/fonts/conf.d/50-user.conf
/etc/fonts/conf.d/51-local.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-latin.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
for f in (find . -type f)
set ftype (file -b --mime-type "$f")
set basetype (string split "/" "$ftype")
set ftype (file -b --mime-type "$f")
set basetype (string split "/" "$ftype")
if test "$basetype[1]" = "text"
set tmp (mktemp)
mac2unix -n "$f" "$tmp"
mv "$tmp" "$f"
end
if test "$basetype[1]" = "text"
set tmp (mktemp)
mac2unix -n "$f" "$tmp"
mv "$tmp" "$f"
end
end
## EOF

View File

@ -3,15 +3,15 @@
set filter 'pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak'
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'
set other /tmp/(basename "$f")
echo "$f is stereo, converting"
ffmpeg -i "$f" -ac 1 "$other" && mv "$other" "$f"
else
echo "$f is mono"
end
if test "$out" != 'CRC=0x00000001'
set other /tmp/(basename "$f")
echo "$f is stereo, converting"
ffmpeg -i "$f" -ac 1 "$other" && mv "$other" "$f"
else
echo "$f is mono"
end
end
## EOF

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,22 +1,22 @@
#!/usr/bin/env fish
function notify
notify-send -a sharenix -i dialog-information $argv
notify-send -a sharenix -i dialog-information $argv
end
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"
notify -u low -c transfer "Uploading..."
if sharenix -s Greyserv "$f"
notify -u low -c transfer.complete "Upload completed"
else
notify -u normal -c transfer.error "Upload failed"
end
end
if test -f "$f"
notify -u low -c transfer "Uploading..."
if sharenix -s Greyserv "$f"
notify -u low -c transfer.complete "Upload completed"
else
notify -u normal -c transfer.error "Upload failed"
end
end
rm "$f"
rm "$f"
end

View File

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

View File

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

View File

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

View File

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