Compare commits

...

3 Commits

Author SHA1 Message Date
d933b8a830 .bashrc: Watch 2022-12-20 16:34:39 +01:00
34451575a9 vimrc: autopep8 2022-12-20 16:34:39 +01:00
2ba88ea838 Local settings on aino. DO NOT PUSH 2022-12-20 16:34:39 +01:00
7 changed files with 23 additions and 73 deletions

View File

@@ -106,6 +106,23 @@ Calls $cmd [...]"
$cmd $@ $cmd $@
} }
watch_modify() {
if [ $# -lt 2 ]; then
echo "Usage watch_modify FILE CMD ARGS...
Run CMD ARGS... when file FILE is updated
"
return
fi
file="$1"
base="$(basename "$file")"
dir="$(dirname "$file")"
inotifywait -r -m -e modify "$dir" | while read file_path file_event file_name; do
[ "$base" == "$file_name" ] && echo ${@:2} && ${@:2}
done
}
# Source git prompt # Source git prompt
source_existing ~/scripts/git-prompt.sh source_existing ~/scripts/git-prompt.sh
source_existing ~/.bash_prompt.kuba source_existing ~/.bash_prompt.kuba

View File

@@ -1,25 +0,0 @@
whatis([==[
Creates $USERAPPL environment variable and adds paths
]==])
local pyver = subprocess([[python --version 2>&1 | sed 's/.*\([23]\.[0-9]\).*/\1/']])
if pyver:sub(1, 1) == "2" then
LmodError("Must have Python 3 loaded")
end
local home = os.getenv("HOME")
local nobackup = pathJoin(home, "nobackup")
local userappl = pathJoin(nobackup, "appl")
local git = pathJoin(nobackup, "git")
local pythonp = pathJoin(userappl, "lib", "python" .. pyver, "site-packages")
local binp = pathJoin(userappl, "bin")
local libp = pathJoin(userappl, "lib")
setenv("MYNOBACKUP", nobackup)
setenv("USERAPPL", userappl)
prepend_path("PYTHONPATH", pythonp)
prepend_path("PYTHONPATH", ".")
prepend_path("PATH", binp)
prepend_path("LD_LIBRARY_PATH", libp)
execute {cmd='`snakemake --bash-completion`', modeA={"load"}}

View File

@@ -1,8 +1,10 @@
# Prefix
unbind C-b unbind C-b
set-option -g prefix C-a set-option -g prefix C-a
bind-key C-a send-prefix bind-key C-a send-prefix
set -g mouse on
# Mouse and colors
set -g mouse on
set -g default-terminal "screen-256color" set -g default-terminal "screen-256color"
# pane movement # pane movement

3
.vimrc
View File

@@ -33,6 +33,7 @@ if filereadable(expand(vundle_dir) . "/README.md")
Plugin 'dense-analysis/ale' Plugin 'dense-analysis/ale'
Plugin 'tpope/vim-unimpaired' Plugin 'tpope/vim-unimpaired'
Plugin 'JuliaEditorSupport/julia-vim' Plugin 'JuliaEditorSupport/julia-vim'
Plugin 'tell-k/vim-autopep8'
call vundle#end() " required call vundle#end() " required
else else
@@ -249,6 +250,7 @@ highlight GitGutterDelete ctermbg=NONE ctermfg=DarkRed
highlight Search ctermbg=Brown ctermfg=LightRed highlight Search ctermbg=Brown ctermfg=LightRed
highlight ColorColumn ctermbg=DarkBlue highlight ColorColumn ctermbg=DarkBlue
highlight Visual ctermbg=LightBlue highlight Visual ctermbg=LightBlue
highlight DiffChange ctermbg=black ctermfg=lightgreen
highlight ALEInfo ctermbg=DarkBlue ctermfg=White highlight ALEInfo ctermbg=DarkBlue ctermfg=White
highlight ALEWarning ctermbg=DarkBlue ctermfg=Black highlight ALEWarning ctermbg=DarkBlue ctermfg=Black
highlight ALEError ctermbg=DarkRed ctermfg=Black highlight ALEError ctermbg=DarkRed ctermfg=Black
@@ -328,6 +330,7 @@ let g:latex_to_unicode_auto = 1
noremap <expr> <F7> LaTeXtoUnicode#Toggle() noremap <expr> <F7> LaTeXtoUnicode#Toggle()
noremap! <expr> <F7> LaTeXtoUnicode#Toggle() noremap! <expr> <F7> LaTeXtoUnicode#Toggle()
autocmd FileType python noremap <buffer> <F8> :call Autopep8()<CR>
nmap <Leader>cf :cd %:p:h <CR> " Change dir to parent of current file nmap <Leader>cf :cd %:p:h <CR> " Change dir to parent of current file
nmap <Leader>cg :cd $git_root_location <CR> " Change dir to git root nmap <Leader>cg :cd $git_root_location <CR> " Change dir to git root

View File

@@ -1,33 +0,0 @@
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
WM=i3
if (( $# == 1 ))
then
WM=$1
fi
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
export EDITOR="vim"
export CUPS_GSSSERVICENAME=HTTP
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
rm -f "~/${WM}.log.old"
mv -f "~/${WM}.log" "~/${WM}.log.old"
rm -f "~/${WM}.log"
rm -f "~/${WM}.log"
if [ "$WM" = "i3" ]; then
. ~/.i3initrc
else
exec $WM >> "~/${WM}.log" 2>&1
fi

View File

@@ -1,3 +0,0 @@
if [ "$1" = "i3" ]; then
. ~/.i3initrc
fi

View File

@@ -1,11 +0,0 @@
#!/bin/bash
# To generate list of large packages
# pacman -Qi | grep 'Name\|Size\|Description' | cut -d: -f2 | paste - - - | awk -F'\t' 'BEGIN{ s["MiB"]=1024; s["KiB"]=1;} {split($3, a, " "); print a[1] * s[a[2]], "KiB", $1}' | sort -n
LARGE_PKGS='linux jdk10-openjdk jre8-openjdk-headless jre10-openjdk-headless gimp gcc-list webkit2gtk gcc python chromium dropbox spotify mono bazel valgrind texlive-core linux-firmware'
echo -n "==> Looking for old packages to prune"
paccache -rk1
echo -n "==> Looking for old large packages to prune"
paccache -rk0 $LARGE_PKGS