Compare commits
18 Commits
1c8133c827
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ff0adcbf3 | |||
| c6705a2229 | |||
| 41e9336603 | |||
| 93473be663 | |||
| 912afb5576 | |||
| 913de0fa24 | |||
| 1d1cabbd38 | |||
| 75b08a39f6 | |||
| af4e2d4364 | |||
| 5b12de7672 | |||
| 144ea8b936 | |||
| 6ec0d320c3 | |||
| f81face7de | |||
| 1fbd656840 | |||
| eabfa84c6a | |||
| 10ff2034bb | |||
| 04273c2422 | |||
| 522854ab3d |
101
.bashrc.kuba
101
.bashrc.kuba
@@ -35,110 +35,15 @@ complete -o bashdefault -o default -o nospace -F __git_wrap__git_main dotfiles
|
||||
# Define a OS X-like open command
|
||||
open() { command xdg-open "$@" > /dev/null 2>&1 & }
|
||||
|
||||
# Inspect .npz files
|
||||
npz_py_str="$(cat << EOM
|
||||
from sys import argv
|
||||
import numpy as np
|
||||
try:
|
||||
import matplotlib.pyplot as plt
|
||||
print('Imported matplotlib.pyplot as plt')
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
class Wrap:
|
||||
def __init__(self, fname):
|
||||
n = np.load(fname, allow_pickle=True)
|
||||
files = n.files
|
||||
globs = globals()
|
||||
print('Contains files', files)
|
||||
for f in files:
|
||||
setattr(self, f, n[f])
|
||||
globs[f] = n[f]
|
||||
|
||||
argv = argv[argv.index('--')+1:]
|
||||
archives = [Wrap(arg) for arg in argv[::-1]]
|
||||
archive = archives[0]
|
||||
print('Global namespace populated with "archive", "archives" and all files')
|
||||
EOM
|
||||
)"
|
||||
|
||||
npz_preview() {
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Please specify file to open as argument"
|
||||
return
|
||||
fi
|
||||
|
||||
python -ic "$npz_py_str" -- "$@"
|
||||
}
|
||||
|
||||
npz_previewi() {
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Please specify file to open as argument"
|
||||
return
|
||||
fi
|
||||
|
||||
ipython -i -c "$npz_py_str" -- "$@"
|
||||
}
|
||||
|
||||
rsync_wrap() {
|
||||
cmd="rsync -a -R -r --copy-links --exclude .git --exclude __pycache__ --progress"
|
||||
if [ $# == 0 ]; then
|
||||
echo "Usage rsync_wrap [...]
|
||||
|
||||
Useful for synchronizing repositories
|
||||
|
||||
Calls $cmd [...]"
|
||||
return
|
||||
fi
|
||||
$cmd $@
|
||||
}
|
||||
|
||||
rsync_wrap_huge() {
|
||||
cmd="rsync -a -R -r --copy-links --size-only --exclude .git --exclude __pycache__ --progress"
|
||||
if [ $# == 0 ]; then
|
||||
echo "Usage rsync_wrap_huge [...]
|
||||
|
||||
Useful for synchronizing repositories. Does not do checksum
|
||||
|
||||
Calls $cmd [...]"
|
||||
return
|
||||
fi
|
||||
$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_existing ~/scripts/git-prompt.sh
|
||||
source_existing ~/.bash_prompt.kuba
|
||||
|
||||
if command -v xclip &> /dev/null; then
|
||||
alias selc="xclip -sel primary -i"
|
||||
alias selv="xclip -sel primary -o"
|
||||
alias clipc="xclip -sel clip -i"
|
||||
alias clipv="xclip -sel clip -o"
|
||||
fi
|
||||
|
||||
# Activate python virtualenv
|
||||
source_existing ~/.python-venv.kuba/bin/activate
|
||||
|
||||
if command -v ipython &> /dev/null; then
|
||||
alias p=ipython
|
||||
alias p="ipython --pylab"
|
||||
elif command -v python &> /dev/null; then
|
||||
alias p=python
|
||||
fi
|
||||
@@ -153,5 +58,9 @@ if [ -z "$DONT_LOAD_LMOD" ]; then
|
||||
|
||||
module use "$HOME/.modules.kuba/"
|
||||
module use "$HOME/git/auto-venv-setup/lmod-modules/"
|
||||
module load tools
|
||||
else
|
||||
# lmod does not exist
|
||||
source $HOME/.modules.kuba/.tools.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
[$Version]
|
||||
update_info=okular.upd:annotation-toolbar,okular.upd:builtin-annotations
|
||||
|
||||
[Identity]
|
||||
IdentityAuthor=Jakub Fojt
|
||||
|
||||
[Main View]
|
||||
SplitterSizes=145,719
|
||||
|
||||
[Reviews]
|
||||
BuiltinAnnotationTools=<tool name="Yellow Highlighter" type="highlight" id="1"><engine type="TextSelector" color="#fff9f06b"><annotation type="Highlight" opacity="0.5" color="#fff9f06b"/></engine><shortcut>2</shortcut></tool>,<tool type="underline" id="2"><engine type="TextSelector" color="#ff0000"><annotation type="Underline" color="#ffff0000"/></engine></tool>,<tool type="squiggly" id="3"><engine type="TextSelector" color="#ff0000"><annotation type="Squiggly" color="#ffff0000"/></engine></tool>,<tool type="strikeout" id="4"><engine type="TextSelector" color="#ff0000"><annotation type="StrikeOut" color="#ffff0000"/></engine></tool>,<tool name="Totalpoäng" type="typewriter" id="5"><engine type="PickPoint" block="true"><annotation textColor="#1a5fb4" type="Typewriter" color="#00ffffff" width="0" font="Cantarell\\,26\\,-1\\,5\\,50\\,0\\,0\\,0\\,0\\,0"/></engine></tool>,<tool type="note-inline" id="6"><engine hoverIcon="tool-note-inline" type="PickPoint" block="true" color="#ffff00"><annotation textColor="#ff000000" type="FreeText" color="#ffffff00"/></engine></tool>,<tool name="Yellow popup note" type="note-linked" id="7"><engine hoverIcon="tool-note" type="PickPoint" color="#fff9f06b"><annotation icon="Comment" type="Text" color="#fff9f06b"/></engine><shortcut>8</shortcut></tool>,<tool type="ink" id="8"><engine type="SmoothLine" color="#00ff00"><annotation type="Ink" color="#ff00ff00" width="2"/></engine></tool>,<tool name="Arrow" type="straight-line" id="9"><engine type="PolyLine" color="#000000" points="2"><annotation type="Line" endStyle="3" color="#ff000000" width="2"/></engine></tool>,<tool type="straight-line" id="10"><engine type="PolyLine" color="#000000" points="2"><annotation type="Line" color="#ff000000" width="2"/></engine></tool>,<tool name="Yellow transparent fill" type="rectangle" id="11"><engine type="PickPoint" block="true" color="#fff9f06b"><annotation type="GeomSquare" opacity="0.5" color="#fff9f06b" innerColor="#f9f06b" width="5"/></engine><shortcut>5</shortcut></tool>,<tool name="Green transparent fill" type="ellipse" id="12"><engine type="PickPoint" block="true" color="#ff33d17a"><annotation type="GeomCircle" opacity="0.5" color="#ff33d17a" innerColor="#33d17a" width="5"/></engine><shortcut>6</shortcut></tool>,<tool type="polygon" id="13"><engine type="PolyLine" color="#007eee" points="-1"><annotation type="Line" color="#ff007eee" width="2"/></engine></tool>,<tool type="stamp" id="14"><engine hoverIcon="Sold" type="PickPoint" block="true" size="64"><annotation icon="Sold" type="Stamp"/></engine></tool>
|
||||
QuickAnnotationTools=<tool id="1" name="Red highlighter" type="highlight"><engine type="TextSelector" color="#fff66151"><annotation opacity="0.5" type="Highlight" color="#fff66151"/></engine><shortcut>1</shortcut></tool>,<tool id="2" name="Yellow Highlighter" type="highlight"><engine type="TextSelector" color="#fff9f06b"><annotation opacity="0.5" type="Highlight" color="#fff9f06b"/></engine><shortcut>2</shortcut></tool>,<tool id="3" name="Green Highlighter" type="highlight"><engine type="TextSelector" color="#ff8ff0a4"><annotation opacity="0.5" type="Highlight" color="#ff8ff0a4"/></engine><shortcut>3</shortcut></tool>,<tool id="4" name="Red transparent fill" type="rectangle"><engine block="true" type="PickPoint" color="#fff66151"><annotation width="5" innerColor="#f66151" opacity="0.5" type="GeomSquare" color="#fff66151"/></engine><shortcut>4</shortcut></tool>,<tool id="5" name="Yellow transparent fill" type="rectangle"><engine block="true" type="PickPoint" color="#fff9f06b"><annotation width="5" innerColor="#f9f06b" opacity="0.5" type="GeomSquare" color="#fff9f06b"/></engine><shortcut>5</shortcut></tool>,<tool id="6" name="Green transparent fill" type="rectangle"><engine block="true" type="PickPoint" color="#ff8ff0a4"><annotation width="5" innerColor="#8ff0a4" opacity="0.5" type="GeomSquare" color="#ff8ff0a4"/></engine><shortcut>6</shortcut></tool>,<tool id="7" name="Red popup note" type="note-linked"><engine hoverIcon="tool-note" type="PickPoint" color="#fff66151"><annotation icon="Comment" type="Text" color="#fff66151"/></engine><shortcut>7</shortcut></tool>,<tool id="8" name="Yellow popup note" type="note-linked"><engine hoverIcon="tool-note" type="PickPoint" color="#fff9f06b"><annotation icon="Comment" type="Text" color="#fff9f06b"/></engine><shortcut>8</shortcut></tool>,<tool id="9" name="Green pop-up note" type="note-linked"><engine hoverIcon="tool-note" type="PickPoint" color="#ff8ff0a4"><annotation icon="Comment" type="Text" color="#ff8ff0a4"/></engine><shortcut>9</shortcut></tool>,<tool id="10" type="note-inline"><engine hoverIcon="tool-note-inline" block="true" type="PickPoint" color="#ffff00"><annotation textColor="#ff000000" type="FreeText" color="#ffffff00"/></engine></tool>,<tool id="11" name="Insert Text" type="typewriter"><engine block="true" type="PickPoint"><annotation width="0" textColor="#000000" type="Typewriter" color="#00ffffff"/></engine></tool>,<tool id="12" name="Totalpoäng" type="typewriter"><engine block="true" type="PickPoint"><annotation width="0" textColor="#1a5fb4" type="Typewriter" font="Cantarell\\,26\\,-1\\,5\\,50\\,0\\,0\\,0\\,0\\,0" color="#00ffffff"/></engine></tool>,<tool id="13" type="underline"><engine type="TextSelector" color="#ff0000"><annotation type="Underline" color="#ffff0000"/></engine></tool>
|
||||
@@ -121,7 +121,12 @@ inactive-opacity-override = false;
|
||||
|
||||
# Specify a list of conditions of windows that should never be considered focused.
|
||||
# focus-exclude = []
|
||||
focus-exclude = [ "class_g = 'Cairo-clock'" ];
|
||||
focus-exclude = [ "class_g = 'Cairo-clock'",
|
||||
"class_g = 'firefox'",
|
||||
"class_g = 'zoom'",
|
||||
"class_g = 'Soffice'",
|
||||
"class_g = 'libreoffice-impress'"
|
||||
];
|
||||
|
||||
# Use fixed inactive dim value, instead of adjusting according to window opacity.
|
||||
# inactive-dim-fixed = 1.0
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
title_inactive_bg_color = "#4C566A"
|
||||
always_split_with_profile = True
|
||||
[keybindings]
|
||||
help = ""
|
||||
[profiles]
|
||||
[[default]]
|
||||
background_color = "#12204d"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
[credential]
|
||||
helper = cache --timeout=3600
|
||||
helper = libsecret
|
||||
[color]
|
||||
ui = auto
|
||||
[pull]
|
||||
|
||||
2
.i3
2
.i3
Submodule .i3 updated: 6c27c94e91...6f3a75a596
18
.i3initrc
18
.i3initrc
@@ -5,18 +5,18 @@
|
||||
i3config="/tmp/i3_${USER}_config"
|
||||
rm -f $i3config
|
||||
|
||||
if [ -f ~/.i3/base.config ]; then
|
||||
cat ~/.i3/base.config >> $i3config
|
||||
if [ -f "$HOME/.i3/base.config" ]; then
|
||||
cat "$HOME/.i3/base.config" >> $i3config
|
||||
fi
|
||||
|
||||
if [ "`hostname`" = "kubaArch-Laptop" ] && [ -f ~/.i3/home.config ]; then
|
||||
cat ~/.i3/home.config >> $i3config
|
||||
elif [ "`hostname`" = "kubaDesktop" ] && [ -f ~/.i3/home.config ]; then
|
||||
cat ~/.i3/home.config >> $i3config
|
||||
elif [ "`hostname`" = "JakubArch" ] && [ -f ~/.i3/work.config ]; then
|
||||
cat ~/.i3/work.config >> $i3config
|
||||
if [ "`hostname`" = "kubaArch-Laptop" ] && [ -f "$HOME/.i3/home.config" ]; then
|
||||
cat "$HOME/.i3/home.config" >> $i3config
|
||||
elif [ "`hostname`" = "kubaDesktop" ] && [ -f "$HOME/.i3/home.config" ]; then
|
||||
cat "$HOME/.i3/home.config" >> $i3config
|
||||
elif [ "`hostname`" = "JakubArch" ] && [ -f "$HOME/.i3/work.config" ]; then
|
||||
cat "$HOME/.i3/work.config" >> $i3config
|
||||
fi
|
||||
|
||||
#exec i3 -c $i3config -V >> ~/${WM}.log 2>&1
|
||||
sh ~/.i3/scripts/displays.sh auto
|
||||
sh "$HOME/.i3/scripts/displays.sh" auto
|
||||
exec i3 -c $i3config
|
||||
|
||||
33
.modules.kuba/.slurm-aliases.sh
Normal file
33
.modules.kuba/.slurm-aliases.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
qnode() {
|
||||
[ $# -lt 1 ] && echo "Usage qnode JOBID" && return 0
|
||||
squeue --noheader --jobs $1 -o %R
|
||||
}
|
||||
|
||||
qssh() {
|
||||
[ $# -lt 1 ] && echo "Usage qssh JOBID" && return 0
|
||||
ssh $(qnode $1)
|
||||
}
|
||||
|
||||
taillog() { [ $# -lt 1 ] && echo "Usage taillog LOGFILE [JOBIDs ..]" && return 0
|
||||
if [ $# -lt 2 ] ; then
|
||||
tail "$1"
|
||||
else
|
||||
tail "$1" "$1.$2"{.e,.o}
|
||||
fi
|
||||
}
|
||||
|
||||
catlog() { [ $# -lt 1 ] && echo "Usage catlog LOGFILE [JOBIDs ..]" && return 0
|
||||
if [ $# -lt 2 ] ; then
|
||||
cat "$1" | less
|
||||
else
|
||||
cat "$1" "$1.$2"{.e,.o} | less
|
||||
fi
|
||||
}
|
||||
|
||||
watchlog() { [ $# -lt 2 ] && echo "Usage watchlog INTERVAL LOGFILE [JOBIDs ..]" && return 0;
|
||||
if [ $# -lt 3 ] ; then
|
||||
watch -n $1 tail "$2"
|
||||
else
|
||||
watch -n $1 tail "$2" "$2.$3"{.e,.o}
|
||||
fi
|
||||
}
|
||||
131
.modules.kuba/.tools.sh
Normal file
131
.modules.kuba/.tools.sh
Normal file
@@ -0,0 +1,131 @@
|
||||
# Inspect .npz files
|
||||
npz_py_str="$(cat << EOM
|
||||
from sys import argv
|
||||
import numpy as np
|
||||
try:
|
||||
import matplotlib.pyplot as plt
|
||||
print('Imported matplotlib.pyplot as plt')
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
class Wrap:
|
||||
def __init__(self, fname):
|
||||
n = np.load(fname, allow_pickle=True)
|
||||
globs = globals()
|
||||
if isinstance(n, np.lib.npyio.NpzFile):
|
||||
files = n.files
|
||||
print('Contains files', files)
|
||||
for f in files:
|
||||
setattr(self, f, n[f])
|
||||
globs[f] = n[f]
|
||||
else:
|
||||
print('Loaded data of shape', n.shape)
|
||||
setattr(self, 'data', n)
|
||||
globs['data'] = n
|
||||
|
||||
|
||||
argv = argv[argv.index('--')+1:]
|
||||
archives = [Wrap(arg) for arg in argv]
|
||||
archive = archives[-1]
|
||||
print('Global namespace populated with "archive", "archives" and all files')
|
||||
for i, fname in enumerate(argv):
|
||||
print(f' {i:<3.0f}: {fname}')
|
||||
EOM
|
||||
)"
|
||||
|
||||
npz_preview() {
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Please specify file to open as argument"
|
||||
return
|
||||
fi
|
||||
|
||||
python -ic "$npz_py_str" -- "$@"
|
||||
}
|
||||
|
||||
npz_previewi() {
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Please specify file to open as argument"
|
||||
return
|
||||
fi
|
||||
|
||||
ipython -i -c "$npz_py_str" -- "$@"
|
||||
}
|
||||
|
||||
rsync_wrap() {
|
||||
cmd="rsync -a -R -r --copy-links --exclude .git --exclude __pycache__ --progress"
|
||||
if [ $# == 0 ]; then
|
||||
echo "Usage rsync_wrap [...]
|
||||
|
||||
Useful for synchronizing repositories
|
||||
|
||||
Calls $cmd [...]"
|
||||
return
|
||||
fi
|
||||
$cmd $@
|
||||
}
|
||||
|
||||
rsync_wrap_huge() {
|
||||
cmd="rsync -a -R -r --copy-links --size-only --exclude .git --exclude __pycache__ --progress"
|
||||
if [ $# == 0 ]; then
|
||||
echo "Usage rsync_wrap_huge [...]
|
||||
|
||||
Useful for synchronizing repositories. Does not do checksum
|
||||
|
||||
Calls $cmd [...]"
|
||||
return
|
||||
fi
|
||||
$cmd $@
|
||||
}
|
||||
|
||||
if command -v xclip &> /dev/null; then
|
||||
alias selc="xclip -sel primary -i"
|
||||
alias selv="xclip -sel primary -o"
|
||||
alias clipc="xclip -sel clip -i"
|
||||
alias clipv="xclip -sel clip -o"
|
||||
fi
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
pdftoclipboard() {
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage pdftoclipboard FILE [DPI]
|
||||
|
||||
Convert pdf file FILE to png and copy to clipboard. Default DPI is 600
|
||||
"
|
||||
return
|
||||
fi
|
||||
file="$1"
|
||||
dpi="${2:-600}"
|
||||
|
||||
pdftoppm -png -r "$dpi" "$file" | xclip -sel clip -t image/png -i
|
||||
}
|
||||
|
||||
gitgrepsed() {
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage gitgrepsed SEARCH REPLACE
|
||||
|
||||
Search and replace in git repository.
|
||||
Alias for git grep -l \$SEARCH | xargs sed -i "s/\$SEARCH/\$REPLACE/g"
|
||||
"
|
||||
return
|
||||
fi
|
||||
|
||||
search="$1"
|
||||
replace="$2"
|
||||
git grep -l "$search" | xargs sed -i "s/$search/$replace/g"
|
||||
}
|
||||
3
.modules.kuba/node.lua
Normal file
3
.modules.kuba/node.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
local home = os.getenv("HOME")
|
||||
local pkg = pathJoin(home, "node-v21.1.0-linux-x64")
|
||||
prepend_path("PATH", pathJoin(pkg, "bin"))
|
||||
@@ -3,28 +3,16 @@ Defines useful SLURM aliases
|
||||
]==])
|
||||
|
||||
set_alias("si", 'sinfo -e -o "%9P %4a %8s %.10l %11A %6z %.7m %40N"')
|
||||
set_alias("q", 'squeue -u $USER -o "%7A %56j %2t %16S %.10M %.10L %.2D %4N"')
|
||||
set_alias("q", 'squeue -u $USER -o "%8A %56j %2t %16S %.10M %.10L %.2D %4N"')
|
||||
set_alias("ql", 'squeue -u $USER -o "%8A %7K %56j %2t %3r %16S %.10M %.10L %.4D %8N %4f"')
|
||||
set_alias("qll", 'squeue -u $USER -o "%8A %7K %150j %2t %3r %16S %.10M %.10L %.4D %8N %4f"')
|
||||
set_alias("qa", 'squeue -o "%8A %10u %.6Q %24j %2t %3r %16S %.10M %.10L %.4D %16N" -S t,-p | less')
|
||||
set_alias("qq", 'squeue -u $USER -o "%8A %7K %76j %9F %2t %.10L"')
|
||||
set_alias("qid", 'squeue -h -u $USER -o "%A"')
|
||||
set_alias("scancelall", 'squeue -h -u $USER -o "%A" | xargs scancel')
|
||||
|
||||
execute{cmd='qnode() { [ $# -lt 1 ] && echo "Usage qnode JOBID" && return 0; '..
|
||||
'squeue --noheader --jobs $1 -o %R; '..
|
||||
'}', modeA={"load"}}
|
||||
execute{cmd='qssh() { [ $# -lt 1 ] && echo "Usage qssh JOBID" && return 0; '..
|
||||
'ssh $(qnode $1); '..
|
||||
'}', modeA={"load"}}
|
||||
execute{cmd='taillog() { [ $# -lt 1 ] && echo "Usage taillog LOGFILE [JOBIDs ..]" && return 0; '..
|
||||
'if [ $# -lt 2 ] ; then tail "$1" ; ' ..
|
||||
'else tail "$1" "$1.$2"{.e,.o} ;' ..
|
||||
'fi }', modeA={"load"}}
|
||||
execute{cmd='catlog() { [ $# -lt 1 ] && echo "Usage catlog LOGFILE [JOBIDs ..]" && return 0; '..
|
||||
'if [ $# -lt 2 ] ; then cat "$1" | less ; ' ..
|
||||
'else cat "$1" "$1.$2"{.e,.o} | less ;' ..
|
||||
'fi }', modeA={"load"}}
|
||||
execute{cmd='watchlog() { [ $# -lt 2 ] && echo "Usage watchlog INTERVAL LOGFILE [JOBIDs ..]" && return 0; '..
|
||||
'if [ $# -lt 3 ] ; then watch -n $1 tail "$2"; ' ..
|
||||
'else watch -n $1 tail "$2" "$2.$3"{.e,.o}; ' ..
|
||||
'fi }', modeA={"load"}}
|
||||
execute{cmd='unset -f qnode qssh watchlog catlog taillog', modeA={"unload"}}
|
||||
local path = splitFileName(myFileName());
|
||||
local loadscript = pathJoin(path, '.' .. myModuleName() .. '.sh');
|
||||
|
||||
execute{cmd='source ' .. loadscript, modeA={"load"}}
|
||||
execute{cmd='unset -f qnode qssh watchlog catlog taillog;', modeA={"unload"}}
|
||||
|
||||
12
.modules.kuba/tools.lua
Normal file
12
.modules.kuba/tools.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
whatis([==[
|
||||
Loads useful tools
|
||||
]==])
|
||||
|
||||
local path = splitFileName(myFileName());
|
||||
local loadscript = pathJoin(path, '.' .. myModuleName() .. '.sh');
|
||||
|
||||
execute{cmd='source ' .. loadscript, modeA={"load"}}
|
||||
execute{cmd='unset -f npz_preview npz_previewi ' ..
|
||||
'rsync_wrap rsync_wrap_huge selc selv cliipc clipv watch_modify pdftoclipboard gitgrepsed' ..
|
||||
'rsync_wrap rsync_wrap_huge selc selv cliipc clipv watch_modify' ..
|
||||
';', modeA={"unload"}}
|
||||
47
.ssh/config
47
.ssh/config
@@ -15,15 +15,15 @@ Host aino
|
||||
User jakub
|
||||
Port 22209
|
||||
|
||||
Host tahoe
|
||||
HostName tahoe.fy.chalmers.se
|
||||
Host puffinus
|
||||
HostName puffinus.fy.chalmers.se
|
||||
User jakub
|
||||
Port 22209
|
||||
|
||||
Host geym
|
||||
HostName geym.fy.chalmers.se
|
||||
User jakub
|
||||
Port 22209
|
||||
Host sharknado
|
||||
HostName 130.239.81.182
|
||||
User ubuntu
|
||||
IdentityFile ~/.ssh/jupyterhub_rsa
|
||||
|
||||
Host pi4
|
||||
HostName 192.168.0.200
|
||||
@@ -48,11 +48,7 @@ Host vera2
|
||||
User fojt
|
||||
|
||||
Host tetralith
|
||||
Hostname tetralith1.nsc.liu.se
|
||||
User x_jakfo
|
||||
|
||||
Host tetralith2
|
||||
Hostname tetralith2.nsc.liu.se
|
||||
Hostname tetralith.nsc.liu.se
|
||||
User x_jakfo
|
||||
|
||||
Host remote11
|
||||
@@ -66,34 +62,7 @@ Host remote11
|
||||
Host dardel
|
||||
Hostname dardel.pdc.kth.se
|
||||
User fojt
|
||||
GSSAPIAuthentication yes
|
||||
GSSAPIKeyExchange yes
|
||||
GSSAPIDelegateCredentials yes
|
||||
PreferredAuthentications gssapi-keyex,gssapi-with-mic
|
||||
|
||||
Host beskow
|
||||
Hostname beskow.pdc.kth.se
|
||||
User fojt
|
||||
GSSAPIAuthentication yes
|
||||
GSSAPIKeyExchange yes
|
||||
GSSAPIDelegateCredentials yes
|
||||
PreferredAuthentications gssapi-keyex,gssapi-with-mic
|
||||
|
||||
Host pdctransfer
|
||||
Hostname t04n27.pdc.kth.se
|
||||
User fojt
|
||||
GSSAPIAuthentication yes
|
||||
GSSAPIKeyExchange yes
|
||||
GSSAPIDelegateCredentials yes
|
||||
PreferredAuthentications gssapi-keyex,gssapi-with-mic
|
||||
|
||||
Host tegner
|
||||
Hostname tegner.pdc.kth.se
|
||||
User fojt
|
||||
GSSAPIAuthentication yes
|
||||
GSSAPIKeyExchange yes
|
||||
GSSAPIDelegateCredentials yes
|
||||
PreferredAuthentications gssapi-keyex,gssapi-with-mic
|
||||
IdentityFile ~/.ssh/id-ed25519-pdc
|
||||
|
||||
Host *
|
||||
ForwardAgent no
|
||||
|
||||
11
.tmux.conf
11
.tmux.conf
@@ -11,9 +11,14 @@ set -g default-terminal "screen-256color"
|
||||
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
|
||||
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
|
||||
|
||||
# ssh socket, important to create symlink in ~/.ssh/rc
|
||||
set -g update-environment -r
|
||||
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
|
||||
# Update the session environment upon attaching
|
||||
set-option -g update-environment 'SSH_AUTH_SOCK SSH_CONNECTION DISPLAY'
|
||||
set-hook -g client-attached 'run-shell /bin/update_display.sh'
|
||||
|
||||
# Rename the session to the path
|
||||
set-option -g status-interval 5
|
||||
set-option -g automatic-rename on
|
||||
set-option -g automatic-rename-format '#{pane_current_path}'
|
||||
|
||||
# Shorten delay for relaying Esc (to e.g. vim). Too short and PgUp will not work
|
||||
set -sg escape-time 20
|
||||
|
||||
105
.vimrc
105
.vimrc
@@ -2,46 +2,50 @@ let mapleader = ","
|
||||
set nocompatible " be iMproved, required
|
||||
filetype off " required
|
||||
|
||||
let vundle_dir="~/.vim/bundle/Vundle.vim"
|
||||
if filereadable(expand(vundle_dir) . "/README.md")
|
||||
" set the runtime path to include Vundle and initialize
|
||||
let &rtp .= "," . vundle_dir
|
||||
call vundle#begin()
|
||||
let plug_fpath="~/.vim/autoload/plug.vim"
|
||||
if filereadable(expand(plug_fpath))
|
||||
call plug#begin()
|
||||
|
||||
Plugin 'VundleVim/Vundle.vim' " let Vundle manage Vundle, required
|
||||
|
||||
Plugin 'scrooloose/nerdtree'
|
||||
Plugin 'c.vim'
|
||||
Plugin 'jeetsukumaran/vim-buffergator'
|
||||
Plugin 'ericcurtin/CurtineIncSw.vim'
|
||||
Plugin 'tpope/vim-fugitive'
|
||||
Plugin 'tpope/vim-surround'
|
||||
Plugin 'ctrlpvim/ctrlp.vim'
|
||||
Plugin 'rhysd/vim-clang-format'
|
||||
Plugin 'godlygeek/tabular'
|
||||
Plugin 'airblade/vim-gitgutter'
|
||||
Plugin 'jeetsukumaran/vim-pythonsense'
|
||||
Plugin 'easymotion/vim-easymotion'
|
||||
Plugin 'cpiger/NeoDebug'
|
||||
Plugin 'ivan-krukov/vim-snakemake'
|
||||
Plugin 'nvie/vim-flake8'
|
||||
Plugin 'ludovicchabant/vim-gutentags'
|
||||
Plugin 'junegunn/vim-peekaboo'
|
||||
if empty($VIM_DISABLE_YCM)
|
||||
Plugin 'ycm-core/YouCompleteMe'
|
||||
Plug 'scrooloose/nerdtree'
|
||||
Plug 'vim-scripts/c.vim'
|
||||
Plug 'jeetsukumaran/vim-buffergator'
|
||||
Plug 'ericcurtin/CurtineIncSw.vim'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'ctrlpvim/ctrlp.vim'
|
||||
Plug 'rhysd/vim-clang-format'
|
||||
Plug 'godlygeek/tabular'
|
||||
Plug 'airblade/vim-gitgutter'
|
||||
Plug 'jeetsukumaran/vim-pythonsense'
|
||||
Plug 'easymotion/vim-easymotion'
|
||||
Plug 'cpiger/NeoDebug'
|
||||
Plug 'ivan-krukov/vim-snakemake'
|
||||
Plug 'nvie/vim-flake8'
|
||||
Plug 'ludovicchabant/vim-gutentags'
|
||||
Plug 'junegunn/vim-peekaboo'
|
||||
if has('python3') && empty($VIM_DISABLE_YCM)
|
||||
Plug 'ycm-core/YouCompleteMe', { 'do': './install.py' }
|
||||
endif
|
||||
Plugin 'dense-analysis/ale'
|
||||
Plugin 'tpope/vim-unimpaired'
|
||||
Plugin 'JuliaEditorSupport/julia-vim'
|
||||
Plugin 'tell-k/vim-autopep8'
|
||||
Plug 'dense-analysis/ale'
|
||||
Plug 'tpope/vim-unimpaired'
|
||||
Plug 'JuliaEditorSupport/julia-vim'
|
||||
Plug 'tell-k/vim-autopep8'
|
||||
Plug 'tell-k/vim-autoflake'
|
||||
Plug 'jpalardy/vim-slime'
|
||||
Plug 'preservim/tagbar'
|
||||
Plug 'wellle/context.vim'
|
||||
|
||||
call vundle#end() " required
|
||||
call plug#end()
|
||||
else
|
||||
let vundle_repo="https://github.com/VundleVim/Vundle.vim.git"
|
||||
echo "Vundle not installed, type :CloneVundle to clone the vundle repo and install it"
|
||||
command! CloneVundle execute "!git clone " . vundle_repo . " " . vundle_dir | source $MYVIMRC | echo "Cloned Vundle. Do :PluginInstall"
|
||||
let plug_url="https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
|
||||
echo "Plug not installed, type :CurlPlug to download and install plug"
|
||||
command! CurlPlug execute "!curl -fLo " . plug_fpath . " --create-dirs " . plug_url | source $MYVIMRC | echo "Curled Plug. Do :PlugInstall"
|
||||
endif
|
||||
|
||||
set tabstop=4 " show existing tab with 4 spaces width
|
||||
set shiftwidth=4 " when indenting with '>', use 4 spaces width
|
||||
set expandtab " On pressing tab, insert 4 spaces
|
||||
|
||||
if !exists("vimrc_autocmds_loaded")
|
||||
let vimrc_autocmds_loaded = 1
|
||||
|
||||
@@ -57,6 +61,10 @@ if !exists("vimrc_autocmds_loaded")
|
||||
au BufRead,BufNewFile *.md setlocal textwidth=80 | setlocal colorcolumn=80
|
||||
au BufRead,BufNewFile *.py setlocal colorcolumn=100
|
||||
au FileType html setlocal shiftwidth=2 tabstop=2
|
||||
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2
|
||||
autocmd FileType javascriptreact setlocal shiftwidth=2 tabstop=2
|
||||
autocmd FileType typescript setlocal shiftwidth=2 tabstop=2
|
||||
autocmd FileType typescriptreact setlocal shiftwidth=2 tabstop=2
|
||||
|
||||
if exists(":NERDTree")
|
||||
" Open NERDTree if no file specified
|
||||
@@ -82,10 +90,6 @@ autocmd GUIEnter * set visualbell t_vb=
|
||||
vnoremap > ><CR>gv
|
||||
vnoremap < <<CR>gv
|
||||
|
||||
set tabstop=4 " show existing tab with 4 spaces width
|
||||
set shiftwidth=4 " when indenting with '>', use 4 spaces width
|
||||
set expandtab " On pressing tab, insert 4 spaces
|
||||
|
||||
set mouse=a
|
||||
set hlsearch
|
||||
set scrolloff=5 " Don't let cursor be within 5 lines from top or bottom
|
||||
@@ -127,10 +131,21 @@ noremap Y y$
|
||||
command! -bang -range=% -complete=file -nargs=* W <line1>,<line2>write<bang> <args>
|
||||
command! -bang Q quit<bang>
|
||||
|
||||
let g:ctrlp_map = '<c-p>'
|
||||
let g:ctrlp_cmd = 'CtrlPMixed'
|
||||
let g:ctrlp_working_path_mode = 'ra' " Look for .git .hg .svn .bzr _darcs
|
||||
let g:ctrlp_custom_ignore = {
|
||||
\ 'dir': '\v[\/]\.(git|hg|svn|data|logs)$',
|
||||
\ 'file': '\v\.(exe|so|dll)$',
|
||||
\ }
|
||||
|
||||
" Gutentags configuration
|
||||
if !executable('ctags')
|
||||
let g:gutentags_enabled = 0
|
||||
else
|
||||
nmap <F1> :CtrlPTag<CR>
|
||||
nmap <F4> :TagbarToggle<CR>
|
||||
|
||||
let g:gutentags_add_default_project_roots = 0
|
||||
let g:gutentags_project_root = ['.git']
|
||||
|
||||
@@ -208,6 +223,7 @@ let g:ale_linters = {
|
||||
\ 'python': ['flake8'],
|
||||
\ 'c': ['gcc']
|
||||
\}
|
||||
let g:ale_virtualtext_cursor = 'disable'
|
||||
let g:ale_set_highlights = 1
|
||||
let g:ale_sign_error = '>>'
|
||||
let g:ale_sign_warning = '--'
|
||||
@@ -325,12 +341,19 @@ nmap <F2> :NERDTreeToggle<CR>
|
||||
nmap <F3> :NERDTreeFind<CR>
|
||||
map <F5> :call CurtineIncSw()<CR>
|
||||
|
||||
let g:context_enabled = 0
|
||||
map <F6> :ContextToggle<CR>
|
||||
map cp :ContextPeek<CR>
|
||||
|
||||
" Julialang
|
||||
let g:latex_to_unicode_auto = 1
|
||||
|
||||
noremap <expr> <F7> LaTeXtoUnicode#Toggle()
|
||||
noremap! <expr> <F7> LaTeXtoUnicode#Toggle()
|
||||
autocmd FileType python noremap <buffer> <F8> :call Autopep8()<CR>
|
||||
autocmd FileType python noremap <buffer> :call Autoflake()<CR> :call Autopep8()<CR>
|
||||
|
||||
let g:slime_target = "tmux"
|
||||
let g:slime_default_config = {"socket_name": "default", "target_pane": "{last}"}
|
||||
|
||||
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
|
||||
@@ -374,3 +397,7 @@ nmap <Leader>p :set paste! <CR>
|
||||
map <Leader>n :noh<CR>
|
||||
vmap <Leader>T :'<,'> Tabularize /
|
||||
nnoremap <leader>c :execute "set colorcolumn=" . (&colorcolumn == "" ? "120" : "")<CR>
|
||||
|
||||
" Insert "Embed IPython" command
|
||||
:command InsIPython :normal oimport IPython<CR>IPython.embed()<ESC><up>^
|
||||
nmap <Leader>i :InsIPython <CR>
|
||||
|
||||
Reference in New Issue
Block a user