Compare commits
10 Commits
144ea8b936
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ff0adcbf3 | |||
| c6705a2229 | |||
| 41e9336603 | |||
| 93473be663 | |||
| 912afb5576 | |||
| 913de0fa24 | |||
| 1d1cabbd38 | |||
| 75b08a39f6 | |||
| af4e2d4364 | |||
| 5b12de7672 |
@@ -43,7 +43,7 @@ source_existing ~/.bash_prompt.kuba
|
||||
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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
[credential]
|
||||
helper = cache --timeout=3600
|
||||
helper = libsecret
|
||||
[color]
|
||||
ui = auto
|
||||
[pull]
|
||||
|
||||
@@ -11,12 +11,18 @@ except ImportError:
|
||||
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]
|
||||
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]
|
||||
@@ -108,3 +114,18 @@ pdftoclipboard() {
|
||||
|
||||
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,9 +3,11 @@ 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')
|
||||
|
||||
|
||||
@@ -7,5 +7,6 @@ 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' ..
|
||||
'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"}}
|
||||
|
||||
39
.ssh/config
39
.ssh/config
@@ -15,8 +15,8 @@ Host aino
|
||||
User jakub
|
||||
Port 22209
|
||||
|
||||
Host tahoe
|
||||
HostName tahoe.fy.chalmers.se
|
||||
Host puffinus
|
||||
HostName puffinus.fy.chalmers.se
|
||||
User jakub
|
||||
Port 22209
|
||||
|
||||
@@ -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
|
||||
|
||||
78
.vimrc
78
.vimrc
@@ -2,46 +2,44 @@ 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'
|
||||
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)
|
||||
Plugin 'ycm-core/YouCompleteMe'
|
||||
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'
|
||||
Plugin 'jpalardy/vim-slime'
|
||||
Plugin 'preservim/tagbar'
|
||||
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
|
||||
@@ -343,12 +341,16 @@ 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}"}
|
||||
@@ -395,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