├── .gitignore ├── .gitmodules ├── README.md ├── X ├── .Xresources ├── .xinitrc └── .xprofile ├── alacritty └── .config │ └── alacritty │ ├── alacritty.toml │ └── alacritty.yml ├── apy └── .config │ └── apy │ └── apy.json ├── bash ├── .bash_profile ├── .bashrc ├── .profile ├── .stow-local-ignore ├── auto_completions.sh └── common-functions.sh ├── bat └── .config │ └── bat │ └── config ├── conky └── .config │ └── conky │ ├── .luarc.json │ ├── .stylua.toml │ ├── conky.conf │ └── utils.lua ├── dunst └── .config │ └── dunst │ └── dunstrc ├── feh └── .config │ └── feh │ └── themes ├── flameshot └── .config │ └── flameshot │ └── flameshot.ini ├── fluxbox └── .fluxbox │ ├── apps │ ├── init │ ├── keys │ ├── menu │ ├── startup │ ├── style │ └── theme.cfg │ └── windowmenu ├── fzf ├── fzf-history-widget.zsh └── fzf-options.sh ├── gnome └── .gnome-keybidings ├── gpg └── .gnupg │ └── gpg-agent.conf ├── kitty └── .config │ └── kitty │ ├── kitty.conf │ └── theme.conf ├── latex ├── .chktexrc ├── .latexmkrc ├── .references-mine.bib ├── .references.bib └── .texmf │ └── tex │ └── latex │ └── beamerntnu │ ├── beamerthementnu.sty │ ├── bg-title-en.pdf │ └── bg.pdf ├── lisp ├── .clisprc.lisp ├── .lisp-common └── .sbclrc ├── lua └── .config │ └── stylua │ └── stylua.toml ├── mintty └── .minttyrc ├── misc ├── .ackrc ├── .asoundrc ├── .ctags ├── .ctags.d │ └── default.ctags ├── .cvimrc ├── .dircolors.ansi-dark ├── .gtkrc-2.0.mine ├── .inputrc ├── .irbrc ├── .mailrc ├── .pam_environment ├── .pdfpcrc ├── .tecplot.cfg ├── .toprc └── .vintrc.yaml ├── ncspot └── .config │ └── ncspot │ └── config.toml ├── openbox └── .config │ └── openbox │ ├── autostart │ ├── environment │ └── rc.xml ├── pg_format └── .pg_format ├── python ├── .pylintrc └── .pythonrc.py ├── screen └── .screenrc ├── sioyek └── .config │ └── sioyek │ ├── keys_user.config │ └── prefs_user.config ├── ssh └── .ssh │ └── config ├── starship └── .config │ └── starship.toml ├── systemd └── .config │ └── systemd │ └── user │ ├── check-battery.service │ ├── check-battery.timer │ └── insync.service ├── terminfo └── .terminfo │ ├── m │ └── mostlike │ ├── mostlike.txt │ └── tmux-256color-italics.ti ├── tmux ├── .config │ └── tmuxinator │ │ ├── advent.yml │ │ ├── apy.yml │ │ ├── journal.yml │ │ ├── lists.yml │ │ ├── nvim.yml │ │ ├── spotify.yml │ │ ├── vimtex.yml │ │ └── wiki.yml ├── .tmux.conf ├── cfg-bind-clear ├── cfg-bind-copy-mode ├── cfg-bind-prefix ├── cfg-bind-root ├── cfg-options └── cfg-statusline ├── tridactyl └── .config │ └── tridactyl │ └── tridactylrc ├── vcs ├── .cvsignore ├── .cvsrc ├── .gitconfig ├── .gitconfig-sikt ├── .gitconfig-usit ├── .gitignore ├── .hgk ├── .hgrc ├── .mrconfig └── .stow-local-ignore ├── vim └── .vim │ ├── autoload │ ├── personal.vim │ ├── personal │ │ ├── fold.vim │ │ ├── init.vim │ │ ├── qf.vim │ │ └── statusline.vim │ └── vimrc.vim │ ├── colors │ └── my_solarized.vim │ ├── plugin │ ├── open-in-browser.vim │ └── windows.vim │ └── vimrc ├── wezterm └── .config │ └── wezterm │ ├── .luarc.json │ ├── .stylua.toml │ └── wezterm.lua ├── xfce ├── .config │ └── xfce4 │ │ └── terminal │ │ └── terminalrc ├── .gmrunrc └── .terminalrc ├── zathura └── .config │ └── zathura │ └── zathurarc └── zsh ├── .stow-local-ignore ├── .zshenv ├── .zshrc └── zsh-functions ├── _insync ├── _mupdf ├── _pass ├── _pip └── pip.zsh /.gitignore: -------------------------------------------------------------------------------- 1 | fluxbox/.fluxbox/lastwallpaper 2 | fluxbox/.fluxbox/log 3 | fluxbox/.fluxbox/overlay 4 | fluxbox/.fluxbox/fbrun_history 5 | terminfo/.terminfo/t 6 | xfce/.config/xfce4/xfconf 7 | xfce/.config/xfce4/xfce4-screenshooter 8 | tmux/.config/tmuxinator/*.yml 9 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "zsh-completions"] 2 | path = zsh/zsh-completions 3 | url = https://github.com/zsh-users/zsh-completions.git 4 | 5 | [submodule "zsh-syntax-highlighting"] 6 | path = zsh/zsh-syntax-highlighting 7 | url = https://github.com/zsh-users/zsh-syntax-highlighting.git 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Personal dotfiles 2 | 3 | This repository simply contains my configurations and settings for personal 4 | conveniance. 5 | 6 | # Install 7 | 8 | Requires [GNU stow](https://www.gnu.org/software/stow/). 9 | 10 | ```sh 11 | # One at a time 12 | stow bash zsh tmux ... 13 | 14 | # Or all at once 15 | for f in *(/); stow $f 16 | ``` 17 | -------------------------------------------------------------------------------- /X/.Xresources: -------------------------------------------------------------------------------- 1 | ! Colors (solarized dark) 2 | #define S_yellow #b58900 3 | #define S_orange #cb4b16 4 | #define S_red #dc322f 5 | #define S_magenta #d33682 6 | #define S_violet #6c71c4 7 | #define S_blue #268bd2 8 | #define S_cyan #2aa198 9 | #define S_green #859900 10 | #define S_base03 #002b36 11 | #define S_base02 #073642 12 | #define S_base01 #586e75 13 | #define S_base00 #657b83 14 | #define S_base0 #839496 15 | #define S_base1 #93a1a1 16 | #define S_base2 #eee8d5 17 | #define S_base3 #fdf6e3 18 | 19 | ! General terminal colors 20 | *color0: S_base02 21 | *color1: S_red 22 | *color2: S_green 23 | *color3: S_yellow 24 | *color4: S_blue 25 | *color5: S_magenta 26 | *color6: S_cyan 27 | *color7: S_base2 28 | *color8: S_base03 29 | *color9: S_orange 30 | *color10: S_base01 31 | *color11: S_base00 32 | *color12: S_base0 33 | *color13: S_violet 34 | *color14: S_base1 35 | *color15: S_base3 36 | 37 | ! Font settings 38 | Xft.autohint: false 39 | Xft.antialias: true 40 | Xft.hinting: true 41 | Xft.hintstyle: hintslight 42 | Xft.rgba: rgb 43 | Xft.lcdfilter: lcddefault 44 | 45 | ! xterm settings 46 | xterm*background: S_base03 47 | xterm*foreground: S_base0 48 | xterm*faceName: xft:Inconsolata\\-g for Powerline:pixelsize=14,xft:Iosevka:style=light:pixelsize=16 49 | xterm*dynamicColors: true 50 | xterm*utf8: 2 51 | xterm*eightBitInput: true 52 | xterm*saveLines: 512 53 | 54 | ! urxvt settings 55 | URxvt.termName: rxvt-256color 56 | URxvt.saveLines: 65535 57 | URxvt.intensityStyles: false 58 | URxvt.internalBorder: 0 59 | URxvt.allow_bold: true 60 | URxvt.font: xft:Inconsolata\\-g for Powerline:pixelsize=14, \ 61 | xft:Iosevka:style=light:pixelsize=16 62 | URxvt*letterSpace: 0 63 | URxvt.scrollBar: false 64 | URxvt.perl-ext-common: default,matcher,resize-font,-confirm-paste 65 | URxvt.url-launcher: /usr/bin/firefox 66 | URxvt.matcher.button: 1 67 | URxvt.pointerBlank: true 68 | URxvt*scrollTtyOutput: false 69 | URxvt*scrollWithBuffer: true 70 | URxvt*scrollTtyKeypress: true 71 | URxvt.secondaryScreen: 1 72 | URxvt.secondaryScroll: 0 73 | URxvt*background: S_base03 74 | URxvt*foreground: S_base0 75 | URxvt*fading: 20 76 | URxvt*fadeColor: S_base03 77 | URxvt*cursorColor: S_base1 78 | URxvt.iso14755: false 79 | URxvt.iso14755_52: false 80 | 81 | ! Add keysyms for special keycodes 82 | ! See: https://unix.stackexchange.com/questions/631241/mapping-otherwise-conflicting-or-unmappable-keys-in-terminal-vim 83 | ! See also: 84 | ! * ~/.tmux.conf 85 | ! * ~/.inputrc 86 | URxvt*keysym.C-Tab: \033[9;5u 87 | URxvt*keysym.C-ISO_Left_Tab: \033[9;6u 88 | URxvt*keysym.S-Return: \033[13;2u 89 | URxvt*keysym.C-Return: \033[13;5u 90 | URxvt*keysym.C-S-Return: \033[13;6u 91 | URxvt.keysym.S-space: \033[32;2u 92 | URxvt*keysym.C-space: \033[32;5u 93 | URxvt*keysym.C-S-space: \033[32;6u 94 | URxvt*keysym.C-i: \033[105;5u 95 | URxvt*keysym.C-0: \033[48;5u 96 | URxvt*keysym.C-1: \033[49;5u 97 | URxvt*keysym.C-2: \033[50;5u 98 | URxvt*keysym.C-3: \033[51;5u 99 | URxvt*keysym.C-4: \033[52;5u 100 | URxvt*keysym.C-5: \033[53;5u 101 | URxvt*keysym.C-6: \033[54;5u 102 | URxvt*keysym.C-7: \033[55;5u 103 | URxvt*keysym.C-8: \033[56;5u 104 | URxvt*keysym.C-9: \033[57;5u 105 | URxvt*keysym.C-A: \033[65;5u 106 | URxvt*keysym.C-B: \033[66;5u 107 | URxvt*keysym.C-C: \033[67;5u 108 | URxvt*keysym.C-D: \033[68;5u 109 | URxvt*keysym.C-E: \033[69;5u 110 | URxvt*keysym.C-F: \033[70;5u 111 | URxvt*keysym.C-G: \033[71;5u 112 | URxvt*keysym.C-H: \033[72;5u 113 | ! NOT WORKING IN VIM 114 | URxvt*keysym.C-I: \033[73;5u 115 | ! NOT WORKING IN VIM 116 | URxvt*keysym.C-J: \033[74;5u 117 | URxvt*keysym.C-K: \033[75;5u 118 | URxvt*keysym.C-L: \033[76;5u 119 | URxvt*keysym.C-M: \033[77;5u 120 | URxvt*keysym.C-N: \033[78;5u 121 | URxvt*keysym.C-O: \033[79;5u 122 | URxvt*keysym.C-P: \033[80;5u 123 | URxvt*keysym.C-Q: \033[81;5u 124 | URxvt*keysym.C-R: \033[82;5u 125 | URxvt*keysym.C-S: \033[83;5u 126 | URxvt*keysym.C-T: \033[84;5u 127 | URxvt*keysym.C-U: \033[85;5u 128 | URxvt*keysym.C-V: \033[86;5u 129 | URxvt*keysym.C-W: \033[87;5u 130 | URxvt*keysym.C-X: \033[88;5u 131 | URxvt*keysym.C-Y: \033[89;5u 132 | URxvt*keysym.C-Z: \033[90;5u 133 | URxvt*keysym.S-F1: \033[1;2P 134 | URxvt*keysym.S-F2: \033[1;2Q 135 | URxvt*keysym.S-F3: \033[1;2R 136 | URxvt*keysym.S-F4: \033[1;2S 137 | URxvt*keysym.S-F5: \033[15;2~ 138 | URxvt*keysym.S-F6: \033[17;2~ 139 | URxvt*keysym.S-F7: \033[18;2~ 140 | URxvt*keysym.S-F8: \033[19;2~ 141 | URxvt*keysym.S-F9: \033[20;2~ 142 | URxvt*keysym.S-F10: \033[21;2~ 143 | URxvt*keysym.S-F11: \033[23;2~ 144 | URxvt*keysym.S-F12: \033[24;2~ 145 | URxvt*keysym.C-F1: \033[1;5P 146 | URxvt*keysym.C-F2: \033[1;5Q 147 | URxvt*keysym.C-F3: \033[1;5R 148 | URxvt*keysym.C-F4: \033[1;5S 149 | URxvt*keysym.C-F5: \033[15;5~ 150 | URxvt*keysym.C-F6: \033[17;5~ 151 | URxvt*keysym.C-F7: \033[18;5~ 152 | URxvt*keysym.C-F8: \033[19;5~ 153 | URxvt*keysym.C-F9: \033[20;5~ 154 | URxvt*keysym.C-F10: \033[21;5~ 155 | URxvt*keysym.C-F11: \033[23;5~ 156 | URxvt*keysym.C-F12: \033[24;5~ 157 | URxvt*keysym.C-S-F1: \033[1;6P 158 | URxvt*keysym.C-S-F2: \033[1;6Q 159 | URxvt*keysym.C-S-F3: \033[1;6R 160 | URxvt*keysym.C-S-F4: \033[1;6S 161 | URxvt*keysym.C-S-F5: \033[15;6~ 162 | URxvt*keysym.C-S-F6: \033[17;6~ 163 | URxvt*keysym.C-S-F7: \033[18;6~ 164 | URxvt*keysym.C-S-F8: \033[19;6~ 165 | URxvt*keysym.C-S-F9: \033[20;6~ 166 | URxvt*keysym.C-S-F10: \033[21;6~ 167 | URxvt*keysym.C-S-F11: \033[23;6~ 168 | URxvt*keysym.C-S-F12: \033[24;6~ 169 | 170 | ! Load local settings 171 | #include ".Xlocal" 172 | -------------------------------------------------------------------------------- /X/.xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [[ -f ~/.Xresources ]] && xrdb -I"$HOME" -merge ~/.Xresources 4 | 5 | # Start screensaver after some time 6 | ( ( sleep 9 \ 7 | && /usr/bin/xscreensaver -display :0.0 &> ~/.cache/xscreensaver.log ) & ) 8 | 9 | exec startfluxbox 10 | -------------------------------------------------------------------------------- /X/.xprofile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export PATH=$PATH:$HOME/scripts/bin 4 | 5 | [[ -f ~/.Xresources ]] && xrdb -I$HOME -merge ~/.Xresources 6 | 7 | # Start screensaver after some time 8 | ( ( sleep 10 && /usr/bin/xscreensaver -no-splash -display :0.0 ) & ) 9 | -------------------------------------------------------------------------------- /alacritty/.config/alacritty/alacritty.toml: -------------------------------------------------------------------------------- 1 | [colors.bright] 2 | black = "0x002b36" 3 | blue = "0x839496" 4 | cyan = "0x93a1a1" 5 | green = "0x586e75" 6 | magenta = "0x6c71c4" 7 | red = "0xcb4b16" 8 | white = "0xfdf6e3" 9 | yellow = "0x657b83" 10 | 11 | [colors.cursor] 12 | cursor = "0x839496" 13 | text = "0x002b36" 14 | 15 | [colors.normal] 16 | black = "0x073642" 17 | blue = "0x268bd2" 18 | cyan = "0x2aa198" 19 | green = "0x859900" 20 | magenta = "0xd33682" 21 | red = "0xdc322f" 22 | white = "0xeee8d5" 23 | yellow = "0xb58900" 24 | 25 | [colors.primary] 26 | background = "0x002b36" 27 | foreground = "0x839496" 28 | 29 | [font] 30 | size = 13 31 | 32 | [font.italic] 33 | family = "JuliaMono" 34 | style = "RegularItalic" 35 | 36 | [font.normal] 37 | family = "JuliaMono" 38 | style = "Regular" 39 | 40 | [scrolling] 41 | history = 100000 42 | multiplier = 3 43 | 44 | [selection] 45 | save_to_clipboard = true 46 | 47 | [window] 48 | decorations = "none" 49 | dynamic_padding = true 50 | 51 | [window.dimensions] 52 | columns = 82 53 | lines = 51 54 | 55 | [window.padding] 56 | x = 0 57 | y = 0 58 | -------------------------------------------------------------------------------- /alacritty/.config/alacritty/alacritty.yml: -------------------------------------------------------------------------------- 1 | window: 2 | padding: 3 | x: 0 4 | y: 0 5 | dynamic_padding: true 6 | decorations: none 7 | dimensions: 8 | columns: 82 9 | lines: 51 10 | 11 | scrolling: 12 | history: 100000 13 | multiplier: 3 14 | 15 | font: 16 | size: 8 17 | # normal: 18 | # family: Iosevka 19 | # style: Regular 20 | # bold: 21 | # family: Iosevka 22 | # italic: 23 | # family: Iosevka 24 | # style: Oblique 25 | # bold_italic: 26 | # family: Iosevka 27 | # style: Bold Oblique 28 | # offset: 29 | # x: 0 30 | # y: 0 31 | # glyph_offset: 32 | # x: 0 33 | # y: -2 34 | # normal: 35 | # family: Inconsolata-g for Powerline 36 | # style: Regular 37 | # bold: 38 | # family: Inconsolata-g for Powerline 39 | # italic: 40 | # family: Inconsolata-g for Powerline 41 | # style: Italized 42 | # offset: 43 | # x: -1 44 | # y: -3 45 | normal: 46 | family: FiraCode Nerd Font Mono 47 | style: Regular 48 | # bold: 49 | # family: Fira Code Bold 50 | italic: 51 | family: FiraCode Nerd Font 52 | style: Regular 53 | # bold_italic: 54 | # family: Fira Code Bold Italic 55 | # offset: 56 | # x: 0 57 | # y: 0 58 | 59 | selection: 60 | save_to_clipboard: true 61 | 62 | schemes: 63 | solarized_light: &light 64 | primary: 65 | background: '0xfdf6e3' # base3 66 | foreground: '0x657b83' # base00 67 | 68 | cursor: 69 | text: '0xfdf6e3' # base3 70 | cursor: '0x657b83' # base00 71 | 72 | normal: 73 | black: '0x073642' # base02 74 | red: '0xdc322f' # red 75 | green: '0x859900' # green 76 | yellow: '0xb58900' # yellow 77 | blue: '0x268bd2' # blue 78 | magenta: '0xd33682' # magenta 79 | cyan: '0x2aa198' # cyan 80 | white: '0xeee8d5' # base2 81 | 82 | bright: 83 | black: '0x002b36' # base03 84 | red: '0xcb4b16' # orange 85 | green: '0x586e75' # base01 86 | yellow: '0x657b83' # base00 87 | blue: '0x839496' # base0 88 | magenta: '0x6c71c4' # violet 89 | cyan: '0x93a1a1' # base1 90 | white: '0xfdf6e3' # base3 91 | 92 | solarized_dark: &dark 93 | primary: 94 | background: '0x002b36' # base03 95 | foreground: '0x839496' # base0 96 | 97 | cursor: 98 | text: '0x002b36' # base03 99 | cursor: '0x839496' # base0 100 | 101 | normal: 102 | black: '0x073642' # base02 103 | red: '0xdc322f' # red 104 | green: '0x859900' # green 105 | yellow: '0xb58900' # yellow 106 | blue: '0x268bd2' # blue 107 | magenta: '0xd33682' # magenta 108 | cyan: '0x2aa198' # cyan 109 | white: '0xeee8d5' # base2 110 | 111 | bright: 112 | black: '0x002b36' # base03 113 | red: '0xcb4b16' # orange 114 | green: '0x586e75' # base01 115 | yellow: '0x657b83' # base00 116 | blue: '0x839496' # base0 117 | magenta: '0x6c71c4' # violet 118 | cyan: '0x93a1a1' # base1 119 | white: '0xfdf6e3' # base3 120 | 121 | colors: *dark 122 | -------------------------------------------------------------------------------- /apy/.config/apy/apy.json: -------------------------------------------------------------------------------- 1 | { 2 | "query": "tag:marked OR -flag:0 OR tag:leech", 3 | "base_path": "/home/lervag/documents/anki", 4 | "pngCommands": [ 5 | ["latex", "-interaction=nonstopmode", "tmp.tex"], 6 | ["dvipng", "-D", "150", "-T", "tight", "-bg", "Transparent", 7 | "tmp.dvi", "-o", "tmp.png"] 8 | ], 9 | "svgCommands": [ 10 | ["lualatex", "-interaction=nonstopmode", "tmp.tex"], 11 | ["pdfcrop", "tmp.pdf", "tmp.pdf"], 12 | ["pdf2svg", "tmp.pdf", "tmp.svg"], 13 | ["sed", "-i", "-E", "1,5s/ (width|height)=\"[0-9.]+/&pt/g", "tmp.svg"] 14 | ], 15 | "review_show_cards": true 16 | } 17 | -------------------------------------------------------------------------------- /bash/.bash_profile: -------------------------------------------------------------------------------- 1 | [ -f ~/.bashrc ] && source ~/.bashrc 2 | -------------------------------------------------------------------------------- /bash/.bashrc: -------------------------------------------------------------------------------- 1 | # Check if already sourced 2 | [ "$already_sourced" ] && return 0 3 | already_sourced=1 4 | 5 | source $HOME/.profile 6 | 7 | # Set environmental variables 8 | export HISTFILESIZE=200000 9 | export HISTIGNORE="&:exit" 10 | export HISTSIZE=200000 11 | 12 | # Enable vi mode 13 | set -o vi 14 | bind -m vi-insert "\C-l":clear-screen 15 | bind -m vi-insert "\C-p":previous-history 16 | bind -m vi-insert "\C-n":next-history 17 | bind -m vi-insert "\C-a":beginning-of-line 18 | bind -m vi-insert "\C-e":end-of-line 19 | 20 | # Set some bash options (ignore errors) 21 | shopt -s globstar 2>/dev/null 22 | shopt -s extglob 23 | 24 | # Enable bash completion in interactive shells 25 | if [ -f /etc/bash_completion ]; then 26 | source /etc/bash_completion 27 | fi 28 | 29 | source $DOTFILES/bash/auto_completions.sh 30 | 31 | umask 022 # Default file permissions 32 | ulimit -s unlimited # Set unlimited stack size 33 | 34 | # Define some aliases 35 | alias rm="rm -v" 36 | alias mv="mv -i" 37 | alias cp="cp -i" 38 | alias du="du -c" 39 | alias grep="grep -i" 40 | alias l='ls' 41 | alias ls='ls --color=auto --group-directories-first' 42 | alias ll='ls -lh' 43 | alias lsa='ls -A' 44 | alias dato='date +"Uke %V, %A %d. %B, %Y -- %T"' 45 | alias ..='cd ..' 46 | alias ...='cd ../..' 47 | alias cd..='cd ..' 48 | alias make='make --no-print-directory' 49 | 50 | # Load common functions and local settings 51 | funcs=$DOTFILES/bash/common-functions.sh 52 | [ -f $funcs ] && . $funcs 53 | [ -f $HOME/.bashrc.local ] && . $HOME/.bashrc.local 54 | 55 | # Set command prompt and remove CTRL-s and CTRL-q possibility 56 | if [ -t 0 ] && [ -t 1 ]; then 57 | export PS1='\[\e[1m\]\u@\h:\[\e[34m\]\[\e[1m\]\w\[\e[0m\]> ' 58 | stty stop undef 59 | stty start undef 60 | fi 61 | 62 | # vim: fdm=marker 63 | -------------------------------------------------------------------------------- /bash/.profile: -------------------------------------------------------------------------------- 1 | export BIBINPUTS=.:~/: 2 | export CVS_RSH=ssh 3 | export DOTFILES=$HOME/.dotfiles 4 | export EDITOR="nvim" 5 | export GOPATH="$HOME/.cache/go" 6 | export HGENCODING="utf-8" 7 | export HOSTNAME=$HOST 8 | export LANG=en_US.UTF-8 9 | export LANGUAGE=en_US.UTF-8 10 | export LC_ALL=en_US.UTF-8 11 | export LC_NUMERIC=en_US.UTF-8 12 | export LESS="-eFRX" 13 | export NVIM_LOG_FILE="$HOME/.cache/nvim/log" 14 | export PAGER='less' 15 | export PATH=$HOME/.local/bin:$PATH 16 | export PATH=$HOME/scripts/bin:$PATH 17 | export PYTHONDONTWRITEBYTECODE=1 18 | export PYTHONPATH=$HOME/scripts/lib 19 | export RUBYLIB=$RUBYLIB:$HOME/scripts/lib 20 | export SAVEHIST=200000 21 | export SHELLCHECK_OPTS="-e SC2034 -e SC1090" 22 | export TEXMFHOME=$HOME/.texmf 23 | export XEDITOR="vim +%l %f" 24 | export GPG_TTY=$(tty) 25 | 26 | source "$DOTFILES/fzf/fzf-options.sh" 27 | [ -r "$HOME/.profile.local" ] && source "$HOME/.profile.local" 28 | 29 | stty -ixon 30 | 31 | # vim: ft=sh 32 | -------------------------------------------------------------------------------- /bash/.stow-local-ignore: -------------------------------------------------------------------------------- 1 | auto_completions.sh 2 | common-functions.sh 3 | -------------------------------------------------------------------------------- /bash/auto_completions.sh: -------------------------------------------------------------------------------- 1 | # Check if we use the bash shell 2 | [ ! "$SHELL" = "BASH" ] && return 3 | 4 | # Complete functions 5 | _makefile() 6 | { 7 | COMREPLY=() 8 | local cur="${COMP_WORDS[COMP_CWORD]}" 9 | local prev="${COMP_WORDS[COMP_CWORD-1]}" 10 | local opts=$(make -qsp 2>/dev/null | \ 11 | egrep -o "^[a-z][^[:space:]]*::?" | \ 12 | sed 's/::\?//') 13 | local opts=${opts//"makefile"} 14 | if [[ ${cur} == * ]]; then 15 | COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) 16 | return 0 17 | fi 18 | } 19 | _pip_completion() 20 | { 21 | COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \ 22 | COMP_CWORD=$COMP_CWORD \ 23 | PIP_AUTO_COMPLETE=1 $1 ) ) 24 | } 25 | 26 | # Set up complete commands 27 | complete -o default -F _pip_completion pip 28 | complete -F _makefile make 29 | complete -W "$(echo $(grep '^ssh ' ~/.bash_history | \ 30 | sort -u | \ 31 | sed 's/^ssh //' | \ 32 | sed 's/-. //' | \ 33 | sed 's/[0-9]* //'))" ssh 34 | -------------------------------------------------------------------------------- /bash/common-functions.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # This is a list of common initialization functions 5 | # 6 | 7 | # Define utility functions 8 | function load_compiler_pgf { 9 | # Path to compiler is parameter 1 10 | PGI=$1 11 | if [ -d "$PGI" ]; then 12 | # Version is parameter 2 13 | pgi=$PGI/linux86/$2 14 | pgi_64=$PGI/linux86-64/$2 15 | if [ -d "$pgi" ] || [ -d "$pgi_64" ]; then 16 | export PGI 17 | export LM_LICENSE_FILE=$LM_LICENSE_FILE:$PGI/license.dat 18 | if [ -d "$pgi_64" ]; then 19 | MANPATH=$pgi_64/man:$MANPATH 20 | PATH=$pgi_64/bin:$PATH 21 | else 22 | MANPATH=$pgi/man:$MANPATH 23 | PATH=$pgi/bin:$PATH 24 | fi 25 | export MANPATH 26 | export PATH 27 | else 28 | echo "Error! Could not either of:" 29 | echo "* $pgi" 30 | echo "* $pgi_64" 31 | fi 32 | else 33 | echo "Error! Could not find: $PGI" 34 | fi 35 | } 36 | function load_compiler_gfortran { 37 | export G95_FPU_INVALID=T 38 | export G95_FPU_OVERFLOW=T 39 | export G95_FPU_ZERODIV=T 40 | } 41 | function load_plot_on_runtime { 42 | qwtpath=$1 43 | if [ -d "$qwtpath" ]; then 44 | export CMAKE_LIBRARY_PATH=$CMAKE_LIBRARY_PATH:$qwtpath/lib 45 | export CMAKE_INCLUDE_PATH=$CMAKE_INCLUDE_PATH:$qwtpath/include 46 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$qwtpath/lib 47 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/koder/plot_on_runtime/lib 48 | else 49 | echo "Error: Could not find qwt!" 50 | fi 51 | } 52 | function load_pencil { 53 | if [ -d "$1" ]; then 54 | export PENCIL_HOME=$1 55 | _sourceme_quiet=1 source "$PENCIL_HOME/sourceme.sh" 56 | fi 57 | } 58 | function load_tecplot { 59 | tecplot=$1 60 | mesa=$2 61 | if [ -d "$tecplot" ]; then 62 | export TEC360HOME=$tecplot 63 | export PATH=$PATH:$TEC360HOME/bin 64 | export TECPHYFILE=$HOME/.tecplot.phy 65 | unset TECADDONFILE 66 | alias rlmstat='rlmutil rlmstat -c $TEC360HOME/tecplotlm.lic -a|grep "handle"' 67 | [ "$mesa" ] && alias tecplot="tec360 -mesa" 68 | fi 69 | } 70 | function load_zsh_highlighting { 71 | [ -z "$ZSH_NAME" ] && return 72 | source "$DOTFILES/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" 73 | ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern) 74 | ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red') 75 | ZSH_HIGHLIGHT_STYLES[alias]='fg=green,underline' 76 | } 77 | 78 | function display_colors() { 79 | for fgbg in 38 48; do 80 | for color in {0..255}; do 81 | printf "\\e[${fgbg};5;${color}m %03d\\e[0m" $color 82 | [ $(((color + 1) % 16)) == 0 ] && echo 83 | done 84 | done 85 | } 86 | -------------------------------------------------------------------------------- /bat/.config/bat/config: -------------------------------------------------------------------------------- 1 | --style="changes,header" 2 | 3 | # ft=sh 4 | -------------------------------------------------------------------------------- /conky/.config/conky/.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", 3 | "runtime": { 4 | "version": "LuaJIT" 5 | }, 6 | "workspace": { 7 | "library": [], 8 | "checkThirdParty": false 9 | }, 10 | "diagnostics.globals": [ 11 | "conky", 12 | "conky_parse", 13 | "conky_workspace" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /conky/.config/conky/.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 80 2 | indent_type = "Spaces" 3 | indent_width = 2 4 | quote_style = "AutoPreferDouble" 5 | call_parentheses = "None" 6 | -------------------------------------------------------------------------------- /conky/.config/conky/conky.conf: -------------------------------------------------------------------------------- 1 | conky.config = { 2 | background = true, 3 | double_buffer = true, 4 | border_inner_margin = 0, 5 | border_outer_margin = 0, 6 | own_window = true, 7 | own_window_transparent = true, 8 | own_window_type = "desktop", 9 | own_window_argb_visual = true, 10 | own_window_hints = "undecorated,below,sticky,skip_taskbar,skip_pager", 11 | update_interval = 0.5, 12 | total_run_times = 0, 13 | alignment = "top_right", 14 | minimum_width = 380, 15 | minimum_height = 900, 16 | maximum_width = 380, 17 | gap_x = 10, 18 | gap_y = 10, 19 | use_xft = true, 20 | font = "JuliaMono:size=11", 21 | font1 = "JuliaMono:bold:size=11", 22 | font2 = "JuliaMono:bold:size=25", 23 | xftalpha = 0.1, 24 | draw_outline = false, 25 | draw_shades = false, 26 | draw_borders = false, 27 | draw_graph_borders = false, 28 | default_color = "DimGray", 29 | default_shade_color = "red", 30 | default_outline_color = "green", 31 | default_bar_width = 380, 32 | default_bar_height = 7, 33 | no_buffers = true, 34 | net_avg_samples = 2, 35 | use_spacer = "right", 36 | if_up_strictness = "address", 37 | color1 = "Tan1", 38 | color2 = "DarkSlateGray", 39 | template0 = [[$font1${color1}\1 ${color2}${hr 2}${color}$font]], 40 | lua_load = "/home/lervag/.config/conky/utils.lua", 41 | } 42 | 43 | conky.text = [[ 44 | ${lua workspace} 45 | 46 | ${template0 SYSTEM} 47 | Kernel $alignr$kernel 48 | Processor speed $alignr${freq_g cpu0} Ghz 49 | Processor temperature $alignr\ 50 | ${if_match "${hwmon 1 temp 1}">="60"}${color red}$endif${hwmon 1 temp 1}°C$color 51 | Uptime $alignr$uptime 52 | System load $alignr\ 53 | ${if_match "${loadavg 1}">="4.00"}${color red}$endif${loadavg 1}$color 54 | Volume $alignr ${execi 1 volume-control} 55 | ${if_empty "${execi 1 light}"}${else}\ 56 | Brightness $alignr ${execi 1 brightness-control} 57 | ${endif}\ 58 | 59 | ${template0 NETWORK} 60 | ${execpi 12 status-network} 61 | ${if_existing /sys/class/power_supply/BAT0}\ 62 | 63 | ${template0 BATTERY} 64 | Status $alignr ${execi 10 status-battery} 65 | Remaining time $alignr ${execi 10 status-battery -r} 66 | ${execibar 10 status-battery -p} 67 | ${endif}\ 68 | 69 | ${template0 FILESYSTEM} 70 | /home$alignc${fs_used /home} / ${fs_size /home}\ 71 | $alignr${fs_used_perc /home}% 72 | ${fs_bar /home} 73 | ${execpi 4 status-syncthing.py} 74 | ]] 75 | 76 | -- vim: ft=lua 77 | -------------------------------------------------------------------------------- /conky/.config/conky/utils.lua: -------------------------------------------------------------------------------- 1 | function conky_workspace() 2 | local w = { 3 | "⚫ ", 4 | "⚫ ", 5 | "⚫ ", 6 | "⚫", 7 | } 8 | 9 | local desktop = tonumber(conky_parse "$desktop") 10 | if desktop ~= nil and desktop >= 1 and desktop <= 4 then 11 | w[desktop] = "${color1}" .. w[desktop] .. "${color}" 12 | end 13 | 14 | return conky_parse("$font2$alignr" .. table.concat(w) .. "$font") 15 | end 16 | -------------------------------------------------------------------------------- /dunst/.config/dunst/dunstrc: -------------------------------------------------------------------------------- 1 | [global] 2 | monitor = 0 3 | follow = keyboard 4 | width = 450 5 | origin = top-right 6 | offset = 20x20 7 | indicate_hidden = true 8 | transparency = 10 9 | separator_height = 0 10 | padding = 10 11 | horizontal_padding = 5 12 | frame_width = 2 13 | frame_color = "#aaaaaa" 14 | separator_color = "#aaaaaa" 15 | sort = yes 16 | idle_threshold = 120 17 | font = "Julia Mono 12" 18 | markup = full 19 | format = "%s\n%b" 20 | alignment = left 21 | word_wrap = true 22 | sticky_history = false 23 | browser = xdg-open 24 | corner_radius = 8 25 | max_icon_size = 64 26 | icon_path = /usr/share/icons/gnome/32x32/status/:/usr/share/icons/gnome/32x32/devices/ 27 | 28 | [urgency_low] 29 | background = "#111111" 30 | foreground = "#dddddd" 31 | timeout = 3 32 | 33 | [urgency_normal] 34 | background = "#222222" 35 | foreground = "#dddddd" 36 | timeout = 5 37 | 38 | [urgency_critical] 39 | background = "#993333" 40 | foreground = "#dddddd" 41 | timeout = 0 42 | 43 | # vim: ft=cfg 44 | -------------------------------------------------------------------------------- /feh/.config/feh/themes: -------------------------------------------------------------------------------- 1 | feh --scale-down -B checks 2 | -------------------------------------------------------------------------------- /flameshot/.config/flameshot/flameshot.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | checkForUpdates=false 3 | contrastOpacity=188 4 | disabledTrayIcon=true 5 | drawColor=#000980 6 | drawThickness=40 7 | filenamePattern=screenshot_%F_%T 8 | savePath=/home/lervag 9 | savePathFixed=true 10 | showHelp=false 11 | showStartupLaunchMessage=true 12 | startupLaunch=true 13 | 14 | [Shortcuts] 15 | TYPE_ACCEPT=Return 16 | TYPE_ARROW=A 17 | TYPE_CIRCLE=C 18 | TYPE_CIRCLECOUNT= 19 | TYPE_COMMIT_CURRENT_TOOL=Ctrl+Return 20 | TYPE_COPY=Ctrl+C 21 | TYPE_DRAWER=D 22 | TYPE_EXIT=Ctrl+Q 23 | TYPE_IMAGEUPLOADER= 24 | TYPE_MARKER=M 25 | TYPE_MOVESELECTION=Ctrl+M 26 | TYPE_MOVE_DOWN=Down 27 | TYPE_MOVE_LEFT=Left 28 | TYPE_MOVE_RIGHT=Right 29 | TYPE_MOVE_UP=Up 30 | TYPE_OPEN_APP=Ctrl+O 31 | TYPE_PENCIL=P 32 | TYPE_PIN= 33 | TYPE_PIXELATE=B 34 | TYPE_RECTANGLE=R 35 | TYPE_REDO=Ctrl+Shift+Z 36 | TYPE_RESIZE_DOWN=Shift+Down 37 | TYPE_RESIZE_LEFT=Shift+Left 38 | TYPE_RESIZE_RIGHT=Shift+Right 39 | TYPE_RESIZE_UP=Shift+Up 40 | TYPE_SAVE=Ctrl+S 41 | TYPE_SELECTION=S 42 | TYPE_SELECTIONINDICATOR= 43 | TYPE_SELECT_ALL=Ctrl+A 44 | TYPE_TEXT=T 45 | TYPE_TOGGLE_PANEL=Space 46 | TYPE_UNDO=Ctrl+Z 47 | -------------------------------------------------------------------------------- /fluxbox/.fluxbox/apps: -------------------------------------------------------------------------------- 1 | [app] (name=fbrun) 2 | [Position] (CENTER) {0 0} 3 | [Layer] {2} 4 | [end] 5 | 6 | [app] (name=.*zathura|mupdf) 7 | [Dimensions] {1024 1200} 8 | [Maximized] {vert} 9 | [Position] (Center) {0 0} 10 | [end] 11 | 12 | [app] (name=sioyek) 13 | [Dimensions] {1200 100%} 14 | [Maximized] {no} 15 | [end] 16 | 17 | [app] (name=google-chrome.*) (role!=pop-up) 18 | [Maximized] {yes} 19 | [Workspace] {0} 20 | [Jump] {yes} 21 | [end] 22 | 23 | [app] (class=Zotero) (role!=pop-up) 24 | [Workspace] {2} 25 | [Jump] {no} 26 | [end] 27 | 28 | [app] (class=firefox) (role!=pop-up) 29 | [Workspace] {0} 30 | [Jump] {no} 31 | [end] 32 | 33 | [app] (name=urxvt) 34 | [Position] (Center) {0 0} 35 | [end] 36 | 37 | [app] (name=kitty) 38 | [Position] (Center) {0 0} 39 | [end] 40 | 41 | [app] (name=org.wezfurlong.wezterm) 42 | [Position] (Center) {0 0} 43 | [end] 44 | 45 | [app] (name=anki) 46 | [Position] (Center) {0 0} 47 | [end] 48 | 49 | [app] (name=feh) 50 | [Position] (Center) {0 0} 51 | [end] 52 | 53 | [app] (name=display) 54 | [Position] (Center) {0 0} 55 | [end] 56 | 57 | [app] (title=Microsoft Teams Notification) 58 | [FocusNewWindow] {no} 59 | [end] 60 | 61 | [app] (name=gcr-prompter) 62 | [Position] (Center) {0 0} 63 | [end] 64 | -------------------------------------------------------------------------------- /fluxbox/.fluxbox/init: -------------------------------------------------------------------------------- 1 | session.configVersion: 13 2 | session.styleFile: ~/.fluxbox/style 3 | session.screen0.defaultDeco: NONE 4 | session.screen0.showwindowposition: True 5 | session.screen0.toolbar.visible: False 6 | session.screen0.workspaceNames: 1,2,3,4 7 | session.screen0.workspacewarping: False 8 | session.screen0.allowRemoteActions: true 9 | -------------------------------------------------------------------------------- /fluxbox/.fluxbox/keys: -------------------------------------------------------------------------------- 1 | # Mouse shortcuts 2 | OnDesktop Mouse1 :HideMenus 3 | OnDesktop Mouse2 :WorkspaceMenu 4 | OnDesktop Mouse3 :RootMenu 5 | OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving} 6 | OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestEdge} 7 | OnWindowBorder Move1 :StartMoving 8 | 9 | # System control 10 | XF86AudioRaiseVolume :Exec volume-control -n up 11 | XF86AudioLowerVolume :Exec volume-control -n down 12 | XF86AudioMute :Exec volume-control -n mute 13 | XF86MonBrightnessUp :Exec brightness-control -n up 14 | XF86MonBrightnessDown :Exec brightness-control -n down 15 | XF86AudioPlay :Exec playerctl play 16 | XF86AudioPause :Exec playerctl pause 17 | XF86AudioNext :Exec playerctl next 18 | XF86AudioPrev :Exec playerctl previous 19 | XF86Display :Exec dock 20 | Mod4 F10 :CommandDialog 21 | Mod4 F11 :Reconfigure 22 | Mod4 F12 :Restart 23 | Mod4 Control s :Exec systemctl suspend 24 | Mod4 Control l :Exec xscreensaver-command -lock 25 | Mod4 Control Delete :Exit 26 | Mod4 Escape :ClientMenu 27 | Mod4 Control Escape :RootMenu 28 | 29 | # Control windows 30 | Mod1 Tab :NextGroup (workspace=[current]) 31 | Mod1 Shift Tab :PrevGroup (workspace=[current]) 32 | Mod1 F4 :Close 33 | Mod1 1 :Workspace 1 34 | Mod1 2 :Workspace 2 35 | Mod1 3 :Workspace 3 36 | Mod1 4 :Workspace 4 37 | Mod1 Control 1 :TakeToWorkspace 1 38 | Mod1 Control 2 :TakeToWorkspace 2 39 | Mod1 Control 3 :TakeToWorkspace 3 40 | Mod1 Control 4 :TakeToWorkspace 4 41 | Mod1 Shift 1 :SendToWorkspace 1 42 | Mod1 Shift 2 :SendToWorkspace 2 43 | Mod1 Shift 3 :SendToWorkspace 3 44 | Mod1 Shift 4 :SendToWorkspace 4 45 | Mod4 space :WindowMenu 46 | Mod4 t :MacroCmd {SetLayer Top} {ToggleCmd {SetLayer Top} {SetLayer Normal}} 47 | Mod4 f :Maximize 48 | Mod4 Shift f :Fullscreen 49 | Mod4 v :MaximizeVertical 50 | Mod4 Shift d :MaximizeHorizontal 51 | Mod4 Shift v :ArrangeWindowsVertical 52 | Mod4 c :MoveTo 0 0 Center 53 | Mod4 a :MacroCmd {MoveTo 0% 0%} {ResizeTo 50% 100%} 54 | Mod4 d :MacroCmd {MoveTo 50% 0%} {ResizeTo 50% 100%} 55 | Mod4 w :MacroCmd {MoveTo 0% 0%} {ResizeTo 100% 50%} 56 | Mod4 s :MacroCmd {MoveTo 0% 50%} {ResizeTo 100% 50%} 57 | Mod4 k :MoveTo * 0% Top 58 | Mod4 j :MoveTo * 0% Bottom 59 | Mod4 h :MoveTo 0% * Left 60 | Mod4 l :MoveTo 0% * Right 61 | Mod4 Mod1 k :Move 0 -5 62 | Mod4 Mod1 j :Move 0 +5 63 | Mod4 Mod1 h :Move -5 0 64 | Mod4 Mod1 l :Move +5 0 65 | Mod4 Shift k :ResizeVertical -5% 66 | Mod4 Shift j :ResizeVertical +5% 67 | Mod4 Shift h :ResizeHorizontal -5% 68 | Mod4 Shift l :ResizeHorizontal +5% 69 | 70 | # Application shortcuts 71 | Print :Exec flameshot gui 72 | Mod1 x :Exec wezterm-gui start 73 | Mod1 v :Exec wezterm-gui start -- nvim 74 | Mod1 n :Exec wezterm-gui start -- nvim +WikiIndex 75 | Mod1 j :Exec wezterm-gui start -- tmuxinator start journal 76 | Mod1 e :Exec _fluxbox_paste.sh -e 77 | Mod1 r :Exec _fluxbox_paste.sh -er 78 | Mod1 y :Exec _fluxbox_paste.sh 79 | Mod1 c :Exec showtime.sh 80 | Mod1 g :Exec firefox 81 | Mod1 F2 :Exec dmenu_run_history -p "program:" 82 | Mod1 F3 :Exec passmenu --typepass --hitreturn 83 | Mod1 k :Exec ocrmyscreen 84 | Mod4 n :Exec dunstctl close 85 | Mod4 Mod1 n :Exec dunstctl history-pop 86 | -------------------------------------------------------------------------------- /fluxbox/.fluxbox/menu: -------------------------------------------------------------------------------- 1 | # Generated by fluxbox-generate_menu 2 | # 3 | # If you read this it means you want to edit this file manually, so here 4 | # are some useful tips: 5 | # 6 | # - You can add your own menu-entries to ~/.fluxbox/usermenu 7 | # 8 | # - If you miss apps please let me know and I will add them for the next 9 | # release. 10 | # 11 | # - The -r option prevents removing of empty menu entries and lines which 12 | # makes things much more readable. 13 | # 14 | # - To prevent any other app from overwriting your menu 15 | # you can change the menu name in ~/.fluxbox/init to: 16 | # session.menuFile: ~/.fluxbox/my-menu 17 | [begin] (Fluxbox-1.3.7) 18 | [encoding] {UTF-8} 19 | [exec] (xterm) {xterm} 20 | [exec] (firefox) {} 21 | [submenu] (Fluxbox menu) 22 | [config] (Configure) 23 | [submenu] (System Styles) {Choose a style...} 24 | [stylesdir] (/usr/share/fluxbox/styles) 25 | [end] 26 | [submenu] (User Styles) {Choose a style...} 27 | [stylesdir] (~/.fluxbox/styles) 28 | [end] 29 | [workspaces] (Workspace List) 30 | [commanddialog] (Fluxbox Command) 31 | [reconfig] (Reload config) 32 | [restart] (Restart) 33 | [exec] (About) {(fluxbox -v; fluxbox -info | sed 1d) | xmessage -file - -center} 34 | [separator] 35 | [exit] (Exit) 36 | [end] 37 | [endencoding] 38 | [end] 39 | -------------------------------------------------------------------------------- /fluxbox/.fluxbox/startup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | xcompmgr & 4 | dunst &>/tmp/dunst.log & 5 | 6 | # Source environment variables 7 | source /home/lervag/.profile 8 | 9 | exec fluxbox \ 10 | -no-slit -no-toolbar \ 11 | -log "/home/lervag/.fluxbox/log" & 12 | fbpid=$! 13 | 14 | sleep 0.5 15 | 16 | # Source local init file, if any 17 | local=/home/lervag/.fluxbox.startup.local 18 | [ -f "$local" ] && source "$local" 19 | 20 | conky & 21 | 22 | wait $fbpid 23 | -------------------------------------------------------------------------------- /fluxbox/.fluxbox/style/theme.cfg: -------------------------------------------------------------------------------- 1 | *.font: tahoma-12:bold 2 | 3 | background: solid 4 | background.color: #333333 5 | 6 | menu.bevelWidth: 0 7 | menu.borderWidth: 0 8 | menu.bullet.position: Left 9 | menu.bullet: square 10 | menu.title: flat 11 | menu.title.justify: center 12 | menu.title.color: #888888 13 | menu.title.textColor: #dddddd 14 | menu.frame: flat 15 | menu.frame.justify: left 16 | menu.frame.color: #dddddd 17 | menu.frame.colorTo: #dddddd 18 | menu.frame.textColor: #888888 19 | menu.frame.disableColor: #cccccc 20 | menu.hilite: flat 21 | menu.hilite.color: #aaaaaa 22 | menu.hilite.textColor: #000000 23 | -------------------------------------------------------------------------------- /fluxbox/.fluxbox/windowmenu: -------------------------------------------------------------------------------- 1 | [begin] 2 | [shade] 3 | [stick] 4 | [maximize] 5 | [iconify] 6 | [raise] 7 | [lower] 8 | [settitledialog] 9 | [sendto] 10 | [layer] 11 | [alpha] 12 | [extramenus] 13 | [separator] 14 | [close] 15 | [end] 16 | -------------------------------------------------------------------------------- /fzf/fzf-history-widget.zsh: -------------------------------------------------------------------------------- 1 | fzf-history-widget() { 2 | local selected num 3 | setopt localoptions noglobsubst noposixbuiltins pipefail 2> /dev/null 4 | selected=( $(fc -rl 1 \ 5 | | awk '!v[substr($0, 8)]++' \ 6 | | FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \ 7 | +m +s \ 8 | -n2..,.. \ 9 | --tiebreak=index \ 10 | --inline-info \ 11 | --bind 'ctrl-c:accept' \ 12 | --bind 'ctrl-g:accept' \ 13 | --bind 'ctrl-q:accept' \ 14 | --bind 'esc:accept' \ 15 | --bind 'enter:execute(touch /tmp/ctrlr_mark_1)+accept' \ 16 | --bind 'ctrl-o:execute(touch /tmp/ctrlr_mark_2)+accept' \ 17 | --exact \ 18 | --query=${(qqq)LBUFFER}" \ 19 | $(__fzfcmd)) ) 20 | if [ -n "$selected" ]; then 21 | num=$selected[1] 22 | if [ -n "$num" ]; then 23 | zle vi-fetch-history -n $num 24 | fi 25 | fi 26 | zle reset-prompt 27 | if [ -e /tmp/ctrlr_mark_1 ]; then 28 | zle accept-line 29 | elif [ -e /tmp/ctrlr_mark_2 ]; then 30 | zle accept-line-and-down-history 31 | fi 32 | rm -f /tmp/ctrlr_mark_{1..2} &>/dev/null 33 | } 34 | -------------------------------------------------------------------------------- /fzf/fzf-options.sh: -------------------------------------------------------------------------------- 1 | _gen_fzf_default_opts() { 2 | local base03="234" 3 | local base02="235" 4 | local base01="240" 5 | local base00="241" 6 | local base0="244" 7 | local base1="245" 8 | local base2="254" 9 | local base3="230" 10 | local yellow="136" 11 | local orange="166" 12 | local red="160" 13 | local magenta="125" 14 | local violet="61" 15 | local blue="33" 16 | local cyan="37" 17 | local green="64" 18 | 19 | # Solarized Dark color scheme for fzf 20 | # export FZF_DEFAULT_OPTS=" 21 | # --color fg:-1,bg:-1,hl:$blue,fg+:$base2,bg+:$base02,hl+:$blue 22 | # --color info:$yellow,prompt:$yellow,pointer:$base3,marker:$base3,spinner:$yellow 23 | # " 24 | # Solarized Light color scheme for fzf 25 | export FZF_DEFAULT_OPTS=" 26 | --color fg:-1,bg:-1,hl:$blue,fg+:$base02,bg+:$base2,hl+:$blue 27 | --color info:$yellow,prompt:$yellow,pointer:$base03,marker:$base03,spinner:$yellow 28 | " 29 | } 30 | _gen_fzf_default_opts 31 | 32 | if command -v fd >/dev/null; then 33 | export FZF_DEFAULT_COMMAND="fd -I -L -E tags --type f" 34 | fi 35 | FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --height 90% --reverse --info=inline" 36 | FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --exact --tiebreak=length,end" 37 | FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --bind=tab:down,btab:up" 38 | export FZF_DEFAULT_OPTS 39 | -------------------------------------------------------------------------------- /gnome/.gnome-keybidings: -------------------------------------------------------------------------------- 1 | 2 | dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-1 "['1']" 3 | dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-2 "['2']" 4 | dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-3 "['3']" 5 | dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-4 "['4']" 6 | dconf write /org/gnome/desktop/wm/keybindings/toggle-above "['t']" 7 | dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-1 "['1']" 8 | dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-2 "['2']" 9 | dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-3 "['3']" 10 | dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-4 "['4']" 11 | -------------------------------------------------------------------------------- /gpg/.gnupg/gpg-agent.conf: -------------------------------------------------------------------------------- 1 | # Caching av passord (sekund) 2 | max-cache-ttl 7200 3 | default-cache-ttl 7200 4 | enable-ssh-support 5 | -------------------------------------------------------------------------------- /kitty/.config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # Referanser 2 | # * man://kitty.conf 3 | # * ~/.local/wiki/Kitty.wiki 4 | 5 | font_family JuliaMono Regular 6 | italic_font JuliaMono RegularItalic 7 | bold_font JuliaMono ExtraBold 8 | bold_italic_font JuliaMono ExtraBoldItalic 9 | #font_family Fira Code Retina Light 10 | #italic_font Fira Code Italic 11 | #bold_font Fira Code Bold 12 | #bold_italic_font Fira Code Bold Italic 13 | font_size 14.0 14 | 15 | click_interval 0.2 16 | cursor_blink_interval 0.0 17 | cursor_shape block 18 | enable_audio_bell no 19 | initial_window_height 60c 20 | initial_window_width 82c 21 | open_url_with default 22 | placement_strategy top-left 23 | remember_window_size no 24 | scrollback_lines 100000 25 | # scrollback_pager vipe 26 | url_style curly 27 | update_check_interval 0 28 | resize_in_steps yes 29 | allow_remote_control yes 30 | listen_on unix:@mykitty 31 | 32 | clear_all_shortcuts yes 33 | map ctrl+0 restore_font_size 34 | map ctrl+minus decrease_font_size 35 | map ctrl+plus increase_font_size 36 | map kitty_mod+e kitten hints 37 | map kitty_mod+h show_scrollback 38 | map kitty_mod+k scroll_line_up 39 | map kitty_mod+j scroll_line_down 40 | map kitty_mod+page_up scroll_page_up 41 | map kitty_mod+page_down scroll_page_down 42 | map kitty_mod+f2 edit_config_file 43 | map kitty_mod+f3 load_config_file 44 | 45 | include theme.conf 46 | include $HOME/.kitty-local 47 | 48 | # vim: ft=conf 49 | -------------------------------------------------------------------------------- /kitty/.config/kitty/theme.conf: -------------------------------------------------------------------------------- 1 | cursor #93a1a1 2 | foreground #839496 3 | background #002b36 4 | selection_foreground #002b36 5 | selection_background #586e75 6 | url_color #0087BD 7 | 8 | color0 #073642 9 | color1 #dc322f 10 | color2 #859900 11 | color3 #b58900 12 | color4 #268bd2 13 | color5 #d33682 14 | color6 #2aa198 15 | color7 #eee8d5 16 | color8 #002b36 17 | color9 #cb4b16 18 | color10 #586e75 19 | color11 #657b83 20 | color12 #839496 21 | color13 #6c71c4 22 | color14 #93a1a1 23 | color15 #fdf6e3 24 | 25 | # vim: ft=conf 26 | -------------------------------------------------------------------------------- /latex/.chktexrc: -------------------------------------------------------------------------------- 1 | ## 2 | ## ChkTeX, example resource file for ChkTeX. 3 | ## Copyright (C) 1995-96 Jens T. Berger Thielemann 4 | ## 5 | ## This program is free software; you can redistribute it and/or modify 6 | ## it under the terms of the GNU General Public License as published by 7 | ## the Free Software Foundation; either version 2 of the License, or 8 | ## (at your option) any later version. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU General Public License 16 | ## along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | ## 19 | ## Contact the author at: 20 | ## Jens Berger 21 | ## Spektrumvn. 4 22 | ## N-0666 Oslo 23 | ## Norway 24 | ## E-mail: 25 | ## 26 | 27 | ##################################################################### 28 | # 29 | # Note: The format has changed slightly (again). The { ... } 30 | # syntax does now mean case-sensitive comparing, while [ ... ] means 31 | # case-insensitive comparing of the keywords. Case-insensitive 32 | # comparing of the keywords is only supported on a few of the 33 | # keywords (it's not meaningful in all contexts, and it slows ChkTeX 34 | # down). Keywords supporting this are marked throughout the file. 35 | # 36 | # You may also reset a list by saying "KEYWORD = { ... }"; it will 37 | # then be set equal to the contents of the list you specify. 38 | # 39 | # Comments begin with `#', and continues for the rest of the line. 40 | # Blank lines plus leading and trailing spaces are of course ignored. 41 | # 42 | # The general format of this file is the following: 43 | # 44 | # KEYWORD { item item ...} [ item item ... ] /* Adds items */ 45 | # 46 | # KEYWORD [ item item ...] { item item ... } /* Adds items */ 47 | # 48 | # KEYWORD = item 49 | # 50 | # KEYWORD = { item item ... } /* Clears list before adding */ 51 | # 52 | # KEYWORD = [ item item ... ] /* Clears list before adding */ 53 | # 54 | # This does _not_ mean that you may alternate the forms; certain 55 | # keywords demands a list, other a single value. You thus have to 56 | # look at the examples of their use. 57 | # 58 | # Please also note that if you specify a list-keyword twice, we'll 59 | # concatenate the lists. If you specify a item-keyword twice, we'll 60 | # kill the previous value. 61 | # 62 | # We are slightly context-sensitive when detecting tokens like "}" 63 | # and "]"; they have to be preceded by a space. This generally makes 64 | # life easier. 65 | # 66 | # Items are separated by spaces. Newlines are considered as spaces, 67 | # but can't be escaped. You may surround items with quotes (`"') to 68 | # easily put spaces into them. 69 | # 70 | # Escape sequences available: 71 | # 72 | # Sequence Resulting character 73 | # ! A space (type `! ', not just a exclamation mark) 74 | # !" " 75 | # !# # 76 | # !! ! 77 | # !{ { 78 | # !} } 79 | # ![ [ 80 | # !] ] 81 | # != = 82 | # !b Backspace 83 | # !n New line 84 | # !r Carriage return 85 | # !t Tab 86 | # !f Form feed 87 | # !xNN NN must be a hexadecimal number (00 - ff), 88 | # _both_ characters must be included. 89 | # !dNNN DDD must be a decimal number (000 - 255), all 90 | # three characters must be included. Unspecified 91 | # results if DDD > 255. 92 | # !NNN DDD must be a octal number (000 - 377), all 93 | # three characters must be included. Unspecified 94 | # results if DDD > 377. 95 | # 96 | # Minor note: As you can see, most of these escape sequences are 97 | # equal to those in C (with some extensions); however, we use ! 98 | # instead of \ as escape character for obvious reasons. 99 | # 100 | # 101 | # Quick summary of keywords follows. Keywords marked with a * accept 102 | # keywords accepting case-insensitive lists. 103 | # 104 | # Abbrev* - A list of abbreviations not automatically caught. 105 | # CenterDots - Commands/characters which should have \cdots in 106 | # between. 107 | # CmdLine - Default commandline options. These will be 108 | # processed before the ones you give on the command 109 | # line. 110 | # HyphDash \ 111 | # NumDash - Number of dashes allowed in different contexts. 112 | # WordDash / 113 | # IJAccent - Commands which puts an accent _over_ their 114 | # argument. 115 | # Italic - Commands immediately turning on italic mode. 116 | # ItalCmd - Commands putting their argument into italic. 117 | # Linker - Commands which should have a non-breaking space in 118 | # front. 119 | # LowDots - Commands/characters which should have \ldots in 120 | # between. 121 | # MathEnvir - Environments which turn on math mode. 122 | # MathCmd - Commands which turn on math mode. 123 | # TextCmd - Commands which turn off math mode. 124 | # MathRoman - Mathematical operators with LaTeX replacement 125 | # defined. 126 | # NoCharNext - Insists on that certain commands aren't followed by 127 | # certain characters. 128 | # NonItalic - Commands immediately turning off italic mode. 129 | # NotPreSpaced- Commands which should not have a space in front of 130 | # them. 131 | # Primitives - Primitive TeX commands. 132 | # PostLink - Commands which generates a page reference. 133 | # OutFormat - Formats to use for output. See the -f & -v switch 134 | # in the main doc. 135 | # QuoteStyle - Either "Traditional" or "Logical". See main doc, 136 | # warning 38. 137 | # Silent - These commands do not produce any textual output; 138 | # and are thus allowed to have a space after them. 139 | # TabSize - Tab size you are using. 140 | # TeXInputs - Paths to search \input and \include files for. 141 | # UserWarn* - These strings will be searched for throughout the 142 | # text. 143 | # VerbEnvir - Environments which contents should be ignored. 144 | # VerbClear - String we will overwrite unwanted data with. 145 | # WipeArg - Commands (with arguments) which should be ignored 146 | # in the checking. 147 | # 148 | 149 | 150 | ##################################################################### 151 | # 152 | # Enter which type of quote-style you are using here. Currently, we 153 | # support the following styles: 154 | # 155 | # Style Example of use 156 | # Traditional "An example," he said, "would be great." 157 | # Logical "An example", he said, "would be great". 158 | # 159 | 160 | QuoteStyle = Logical 161 | 162 | ##################################################################### 163 | # 164 | # Enter here what interval you have between your tabs. Only regular 165 | # intervals are supported. 166 | # 167 | 168 | TabSize = 4 169 | 170 | ##################################################################### 171 | # 172 | # Here, you can put default commandline options; most users would for 173 | # instance like to put -v2 here. 174 | # 175 | 176 | CmdLine 177 | { 178 | -n1 179 | } 180 | 181 | ##################################################################### 182 | # 183 | # These patterns will be searched for through the text; no matter 184 | # whether they appear as normal text, commands or whatever. 185 | # Currently case-sensitive. They are not found in comments. 186 | # 187 | # I usually define a special command like this: 188 | # 189 | # \def\unknown{\large\bf??} 190 | # 191 | # which I use whenever there is some information I don't have at the 192 | # moment of writing. Thus, it makes sense to search for it. 193 | # 194 | # You should be able to develop your own uses for this. 195 | # 196 | 197 | UserWarn 198 | { 199 | 200 | \unknown 201 | ### 202 | # 203 | # Another example; one should write \chktex or Chk\TeX - never ChkTeX. 204 | # 205 | ### 206 | 207 | ChkTeX 208 | } 209 | [ 210 | 211 | ### 212 | # 213 | # You may put case-insensitive patterns here. 214 | # 215 | ### 216 | 217 | ] 218 | 219 | 220 | ### 221 | # 222 | # These patterns will be searched for, no matter whether they appear 223 | # as normal text, commands or arguments. However, they will _not_ 224 | # match in verbatim environments. 225 | # 226 | # Remember that you have to escape (with a !) the following 227 | # characters: "#!= as well as spaces and {}[] if they are proceeded by 228 | # a space. 229 | # 230 | # Since these are PCRE regular expressions, you can use (?i) to make 231 | # the expression case insensitive. See the man pages (man pcresyntax) 232 | # or the nicely formatted http://perldoc.perl.org/perlre.html for 233 | # documentation on the regular expression syntax. Note however that 234 | # some the features of perl regular expression are not available such 235 | # as running code (callouts), and replacing. 236 | # 237 | # An initial PCRE comment (?# ... ) can be used change what is 238 | # displayed, thereby reminding yourself how to fix the problem. 239 | # 240 | ### 241 | UserWarnRegex 242 | { 243 | 244 | (?!#Always! use! \nmid)\\not! *(\||\\mid) 245 | 246 | # capitalize section when saying Section 6. 247 | (?!#-1:Capitalize! before! references)PCRE:\b(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref 248 | (?!#1:Capitalize! before! references)POSIX:([^[:alnum:]]|^)(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref 249 | 250 | # spell it out. 251 | PCRE:(?i)\bintro\b(?!#Spell! it! out.! This! comment! is! not! used.) 252 | POSIX:([^[:alnum:]]|^)intro([^[:alnum:]]|$) 253 | 254 | # Pretty tables--see http://texdoc.net/texmf-dist/doc/latex/booktabs/booktabs.pdf 255 | (?!#-2:Use! \toprule,! midrule,! or! \bottomrule! from! booktabs)\\hline 256 | # This relies on it being on a single line, and not having anything 257 | # else on that line. With PCRE we could match balanced [] and {}, 258 | # but I wonder if it's worth the complexity... 259 | (?!#-2:Vertical! rules! in! tables! are! ugly)\\begin\{(array|tabularx?\*?)\}(\[.*\])?\{.*\|.*\} 260 | 261 | } 262 | 263 | 264 | ##################################################################### 265 | # 266 | # Here you can list the path of where ChkTeX should look for files it 267 | # \inputs. The // postfix is now supported; if you append a double 268 | # path-separator we'll recursively search that directory directories. 269 | # MS-DOS users must append \\ instead, e.g. "C:\EMTEX\\". 270 | # 271 | # If you under either MS-DOS or UNIX wish to search an entire 272 | # partition or the complete directory tree, you must use *three* 273 | # slashes, e.g. "c:\\\" or "///". This may be considered to be a bug. 274 | # 275 | # By default, we'll search the current directory (not recursively, 276 | # put "//" in the list for this); any paths specified below will be 277 | # searched in addition to this. 278 | # 279 | 280 | TeXInputs 281 | { 282 | 283 | } 284 | 285 | ##################################################################### 286 | # 287 | # Here you may specify more output formats for use with the -v option, 288 | # it simply indexes into this list. Remember to use ! instead of \, 289 | # though. 290 | # 291 | # For explanation of how % fields expand; look at ChkTeX.{dvi,ps,pdf}. 292 | # 293 | # We will by default select entry number _two_ in this list (we count 294 | # from 0), and -v without any parameter selects entry number _three_. 295 | # 296 | 297 | OutFormat 298 | { 299 | 300 | # -v0; silent mode 301 | %f%b%l%b%c%b%n%b%m!n 302 | 303 | # -v1; normal mode 304 | "%k %n in %f line %l: %m!n%r%s%t!n%u!n" 305 | 306 | # -v2; fancy mode 307 | "%k %n in %f line %l: %m!n%r%i%s%I%t!n!n" 308 | 309 | # -v3; lacheck mode 310 | "!"%f!", line %l: %m!n" 311 | 312 | # -v4; verbose lacheck mode 313 | "!"%f!", line %l: %m!n%r%s%t!n%u!n" 314 | 315 | # -v5; no line number, ease auto-test 316 | "%k %n in %f: %m!n%r%s%t!n%u!n" 317 | 318 | # -v6; emacs compilation mode 319 | "!"%f!", line %l.%c:(#%n) %m!n" 320 | 321 | } 322 | 323 | 324 | 325 | ##################################################################### 326 | # 327 | # These commands should be ignored when detecting whether a command 328 | # is ended by a space. You can specify regular expressions in the [] 329 | # section in case you have many custom macros that can be safely 330 | # terminated with a space. 331 | # 332 | 333 | Silent 334 | { 335 | \rm \em \bf \it \sl \sf \sc \tt \selectfont 336 | \rmfamily \sffamily \ttfamily \mdseries \bfseries 337 | \slshape \scshape \relax 338 | \vskip \pagebreak \nopagebreak 339 | 340 | \textrm \textem \textbf \textit \textsl \textsf \textsc \texttt 341 | 342 | \clearpage \ddots \dotfill \flushbottom \fussy \indent \linebreak 343 | \onecolumn \pagebreak \pushtabs \poptabs \scriptsize \sloppy 344 | \twocolumn \vdots 345 | \today \kill \newline \thicklines \thinlines 346 | 347 | \columnsep \space \item \tiny \footnotesize \small \normalsize 348 | \normal \large \Large \LARGE \huge \Huge \printindex 349 | 350 | \newpage \listoffigures \listoftables \tableofcontents 351 | \maketitle \makeindex 352 | 353 | \hline \hrule \vrule 354 | 355 | \centering 356 | 357 | \bigskip \medskip \smallskip 358 | 359 | \noindent \expandafter 360 | 361 | \makeatletter \makeatother 362 | 363 | \columnseprule 364 | 365 | \textwidth \textheight \hsize \vsize 366 | 367 | \if \fi \else 368 | 369 | \csname \endcsname 370 | 371 | \z@ \p@ \@warning \typeout 372 | 373 | \dots \ldots \input \endinput \nextline \leavevmode \cdots 374 | \appendix \listfiles \and \quad 375 | \hskip \vfill \vfil \hfill \hfil \topmargin \oddsidemargin 376 | \frenchspacing \nonfrenchspacing 377 | \begingroup \endgroup \par 378 | 379 | \vrefwarning \upshape \headheight \headsep \hoffset \voffset 380 | \cdot \qquad 381 | \left \right 382 | \qedhere 383 | 384 | \xspace 385 | 386 | \addlinespace \cr \fill \frontmatter 387 | \toprule \midrule \bottomrule 388 | 389 | }[ 390 | # Here you can put regular expressions to match Silent macros. It was 391 | # designed for the case where you have many custom macros sharing a 392 | # common prefix, but can of course be used for other things. 393 | 394 | # \\my.* 395 | ] 396 | 397 | ##################################################################### 398 | # 399 | # Here, you can specify the length of various dashes. We sort the 400 | # dash according to which type of characters that are on the left and 401 | # right of it. We are only conclusive if they are the same. 402 | # 403 | # We associate as follows: 404 | # 405 | # Name Type of character on each side 406 | # HyphDash Alphabetic (foo-bar) 407 | # NumDash Numeric (2--3) 408 | # WordDash Space (like this --- see?) 409 | # 410 | # Below you specify how many dashes which are legal in each case. We 411 | # define 0 as a magic constant which always generates an error. You 412 | # may specify more than one legal dash-length. 413 | # 414 | # Let's look at an example. You use the following dash-syntax: 415 | # 416 | # foo-bar 417 | # 2--3 418 | # like this---see? 419 | # 420 | # 421 | # HYPHDASH { 1 3 } # Either a hyphen, or inter-word 422 | # NUMDASH { 2 } # Between words 423 | # WORDDASH { 0 } # We never use this 424 | # 425 | 426 | HyphDash 427 | { 428 | 1 3 429 | } 430 | 431 | NumDash 432 | { 433 | 2 434 | } 435 | 436 | WordDash 437 | { 438 | 3 439 | } 440 | 441 | ##################################################################### 442 | # 443 | # This keyword indicates commands whose argument isn't LaTeX code, 444 | # and thus should be ignored. 445 | # 446 | # After the command, you may place arguments that you wish that 447 | # should be wiped in the process; use [] for optional arguments, {} 448 | # for required ones and * if the command supports an alternative 449 | # variant. These should be separated from the command with a colon. 450 | # Some commands (e.g. \cmidrule) use () to delimit and optional 451 | # argument and so this syntax is supported as well. 452 | # 453 | # For instance, if you would like to wipe the \newcommand command, 454 | # you would declare it as \newcommand:*[][]{} 455 | # 456 | # These commands may be "executed" before they're wiped, so you will 457 | # typically also wish to list filehandling commands and similar here. 458 | # 459 | 460 | WipeArg 461 | { 462 | \label:{} \ref:{} \eqref:{} \vref:{} \pageref:{} \index:[]{} 463 | \cite:[]{} \nocite:{} 464 | \input:{} \verbatiminput:[]{} \listinginput:[]{}{} 465 | \verbatimtabinput:[]{} \include:{} \includeonly:{} 466 | \bibitem:[]{} 467 | \cline:{} \cmidrule:[](){} 468 | \href:{}{} 469 | # Cleveref -- there are many others that could be here as well... 470 | \cref:*{} \cpageref:*{} \crefrange:*{}{} \cpagerefrange:*{}{} 471 | \Cref:*{} \Cpageref:*{} \Crefrange:*{}{} \Cpagerefrange:*{}{} 472 | # natbib 473 | \citet:*[][]{} \citep:*[][]{} \citealt:*{} \citealp:*[]{} \citeauthor:*{} 474 | \Citet:*[][]{} \Citep:*[][]{} \Citealt:*{} \Citealp:*[]{} \Citeauthor:{} 475 | \citetext:{} \citeyear:*{} \citeyearpar:{} 476 | \url:{} \http:{} 477 | } 478 | 479 | ##################################################################### 480 | # 481 | # These environments contain material which will be typeset as 482 | # mathematics by LaTeX. This turns on/off some warnings. 483 | # 484 | # We will automagically append a * to each keyword. 485 | # 486 | 487 | MathEnvir 488 | { 489 | displaymath math eqnarray array equation 490 | align alignat gather flalign multline 491 | } 492 | 493 | ##################################################################### 494 | # 495 | # These commands contain material which will be typeset as mathematics 496 | # by LaTeX. The commands are assumed to have one mandatory argument 497 | # which is in math mode. This turns on/off some warnings. 498 | # 499 | 500 | MathCmd 501 | { 502 | \ensuremath 503 | } 504 | 505 | ##################################################################### 506 | # 507 | # These commands contain material which will _not_ be typeset as 508 | # mathematics by LaTeX even if it would otherwise be in mathmode. The 509 | # commands are assumed to have one mandatory argument which is in text 510 | # mode. This turns on/off some warnings. 511 | # 512 | 513 | TextCmd 514 | { 515 | \text \intertext \shortintertext \mbox 516 | } 517 | 518 | ##################################################################### 519 | # 520 | # These environments contains material which contents should be 521 | # ignored. 522 | # 523 | # We will automagically append a * to each keyword. 524 | # 525 | 526 | VerbEnvir 527 | { 528 | verbatim comment listing verbatimtab rawhtml errexam picture texdraw 529 | filecontents pgfpicture tikzpicture minted 530 | } 531 | 532 | ##################################################################### 533 | # 534 | # ChkTeX does automagically catch most abbreviations; the ones we 535 | # need to list here, are those which are most likely to be followed 536 | # by a word with an upper-case letter (that is not the beginning of a 537 | # new sentence). 538 | # 539 | # The case-insensitive abbreviations are not really case-insensitive, 540 | # it seems to be more practical to only let the first character be 541 | # case-insensitive, while the remaining are case-sensitive. 542 | # 543 | # To speed up the searching process somewhat, we require that these 544 | # end in a `.', this should not be a problem. 545 | # 546 | # Much of this work (both the abbreviations below, and the regexps 547 | # necessary to catch the remaining automatically) have been provided 548 | # by Russ Bubley, . 549 | # 550 | 551 | Abbrev 552 | { 553 | # Ordinals 554 | 1st. 2nd. 3rd. 4th. 555 | # Titles 556 | Mr. Mrs. Miss. Ms. Dr. Prof. St. 557 | 558 | # 559 | # Days 560 | # Mon. Tue. Wed. Thu. Fri. Sat. Sun. 561 | # 562 | # Months 563 | # Jan. Feb. Mar. Apr. May. Jun. Jul. Aug. Sep. Oct. Nov. Dec. 564 | # 565 | # Letters 566 | # Kt. Jr. 567 | # 568 | # Corporate 569 | # Co. Ltd. 570 | # 571 | # Addresses 572 | # Rd. Dr. St. Ave. Cres. Gdns. Sq. Circ. Terr. Pl. Arc. La. Clo. Ho. Est. Gn. 573 | # 574 | # Misc. 575 | # oe. pbab. ps. rsvp. Tx. 576 | } 577 | [ 578 | ### 579 | # 580 | # The first letter is case-insensitive in the abbrevs in this 581 | # list. Due to the nature of the checking algorithm used for 582 | # this, entries consisting of only one character will be 583 | # silently ignored. 584 | # 585 | ## 586 | 587 | # Latin 588 | # cf. "et al." etc. qed. qv. viz. 589 | # 590 | # Corporate 591 | # inc. plc. 592 | # 593 | # Misc 594 | # fax. pcs. qty. tel. misc. 595 | ] 596 | 597 | ##################################################################### 598 | # 599 | # Commands which accent characters, meaning that \i or \j (\imath and 600 | # \jmath in mathmode) should be used instead of `i' and `j' 601 | # 602 | 603 | IJAccent 604 | { 605 | \hat \check \breve \acute \grave \tilde \bar \vec \dot \ddot 606 | 607 | \' \` \^ \" \~ \= \. \u \v \H \t 608 | 609 | ### 610 | # 611 | # The remaining accent commands (\c,\d,\b) put their accent _under_ 612 | # the character, not above, and should thus be used with normal i's 613 | # and j's. 614 | # 615 | ### 616 | 617 | } 618 | 619 | ##################################################################### 620 | # 621 | # Commands which, when the group is terminated, needs italic 622 | # correction. 623 | # 624 | 625 | Italic 626 | { 627 | \it \em \sl 628 | \itshape \slshape 629 | } 630 | 631 | ##################################################################### 632 | # 633 | # Commands which makes the font non-italic. 634 | # 635 | 636 | NonItalic 637 | { 638 | \bf \rm \sf \tt \sc 639 | \upshape 640 | } 641 | 642 | ##################################################################### 643 | # 644 | # Commands which put their argument into italic (and thus possibly 645 | # needs italic correction in the end). 646 | # 647 | # This is currently empty, since \textit, \textsl and \emph do that 648 | # automatically. 649 | # 650 | 651 | ItalCmd 652 | { 653 | } 654 | 655 | ##################################################################### 656 | # 657 | # These commands all have in common that a pagebreak right in front 658 | # of them is highly undesirable; thus there should be no space in 659 | # front of them. 660 | # 661 | 662 | PostLink = 663 | { 664 | \index 665 | } 666 | 667 | ##################################################################### 668 | # 669 | # These commands should not have a space in front of them for various 670 | # reasons. I.e. much the same as POSTLINK, but produces another 671 | # warning. 672 | # 673 | 674 | NotPreSpaced 675 | { 676 | \footnote \footnotemark \/ 677 | } 678 | 679 | ##################################################################### 680 | # 681 | # The commands listed here, should be prepended with a `~', as in 682 | # "look in table~\ref{foo}", to avoid the references being split 683 | # across lines. 684 | # 685 | 686 | Linker 687 | { 688 | \ref \vref \pageref \eqref \cite 689 | } 690 | 691 | ##################################################################### 692 | # 693 | # Commands/characters which should have \cdots in between, e.g. 694 | # $1+2+3+\cdots+n$. 695 | # 696 | 697 | CenterDots 698 | { 699 | = + - \cdot \div & \times \geq \leq < > 700 | } 701 | 702 | ##################################################################### 703 | # 704 | # Commands/characters which should have \ldots in between, e.g. 705 | # $1,2,3,\ldots,n$. 706 | # 707 | 708 | LowDots 709 | { 710 | . , ; 711 | } 712 | 713 | ##################################################################### 714 | # 715 | # In maths mode, there are certain aliases for mathematical operators 716 | # like sin, cos, etc. Ignore the leading backslash in the commands, 717 | # and so forth. You should list these below. 718 | # 719 | 720 | MathRoman 721 | { 722 | log lg ln lim limsup liminf sin arcsin sinh cos arccos cosh tan 723 | arctan tanh cot coth sec csc max min sup inf arg ker dim hom det 724 | exp Pr gcd deg bmod pmod mod 725 | } 726 | 727 | ##################################################################### 728 | # 729 | # These TeX commands have become unnecessary, as there are LaTeX 730 | # commands that does the same. Purists should thus avoid these in 731 | # their code. 732 | # 733 | # (These are a spell-corrected version of those lacheck uses). 734 | # 735 | 736 | Primitives 737 | { 738 | \above \advance \catcode \chardef \closein \closeout \copy \count 739 | \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide 740 | \expandafter \font \hskip \vskip \openout 741 | } 742 | 743 | ##################################################################### 744 | # 745 | # Format: \command:characters 746 | # 747 | # We'll emit a warning if any of characters are found after the 748 | # command. 749 | # 750 | 751 | NoCharNext 752 | { 753 | \left:{}$ \right:{}$ 754 | } 755 | 756 | ##################################################################### 757 | # 758 | # We're killing \verb@...@ commands and the arguments of the commands 759 | # listed above in WipeArg by overwriting them with a string or a 760 | # single character. 761 | # 762 | # This should not contain an alphabetic character (in case the user 763 | # writes (\foo\verb@bar@), neither should it contain be one of 764 | # LaTeX's reserved characters (`#$%&~_^\{}'), or any parenthesis 765 | # character ('()[]{}'). If possible, don't use a punctuation 766 | # character, either, or any spacing character. 767 | # 768 | # The asterisk is also unsuitable, as some commands behave in another 769 | # way if they are appended with an asterisk. Which more or less 770 | # leaves us with the pipe. 771 | # 772 | # Please note that this may also be a _string_, which will be 773 | # repeated until the proper length is reached. 774 | # 775 | 776 | VerbClear = "|" 777 | 778 | # 779 | # All for now - have fun. 780 | # 781 | ##################################################################### 782 | -------------------------------------------------------------------------------- /latex/.latexmkrc: -------------------------------------------------------------------------------- 1 | $pdf_mode = 1; 2 | $bibtex_use = 1.5; 3 | $latex = 'latex --src-specials %O %S'; 4 | $show_time = 1; 5 | set_tex_cmds('-synctex=1 -interaction=nonstopmode --shell-escape %O %S'); 6 | 7 | # This ensures buffer flushing, which makes output better in vimtex 8 | STDOUT->autoflush; 9 | STDERR->autoflush; 10 | 11 | push @generated_exts, "cb"; 12 | push @generated_exts, "cb2"; 13 | push @generated_exts, "spl"; 14 | push @generated_exts, "nav"; 15 | push @generated_exts, "snm"; 16 | push @generated_exts, "tdo"; 17 | push @generated_exts, "nmo"; 18 | push @generated_exts, "brf"; 19 | push @generated_exts, "nlg"; 20 | push @generated_exts, "nlo"; 21 | push @generated_exts, "nls"; 22 | push @generated_exts, "auxlock"; 23 | push @generated_exts, "synctex.gz"; 24 | push @generated_exts, "synctex(busy)"; 25 | push @generated_exts, "pgf-plot.*"; 26 | push @generated_exts, "run.xml"; 27 | 28 | add_cus_dep('nlo', 'nls', 0, 'nlo2nls'); 29 | sub nlo2nls { 30 | system("makeindex $_[0].nlo -s nomencl.ist -o $_[0].nls -t $_[0].nlg" ); 31 | } 32 | 33 | add_cus_dep('pytxcode', 'tex', 0, 'pythontex'); 34 | sub pythontex { return system("pythontex \"$_[0]\""); } 35 | 36 | # Add support for pythontex 37 | # $clean_ext .= " pythontex-files-%R/*"; 38 | # push @generated_exts, 'pytxcode'; 39 | # $pythontex = 'pythontex %O %S'; 40 | # foreach my $cmd ('latex', 'lualatex', 'pdflatex', 'xelatex' ) { 41 | # ${$cmd} = "internal latex_python %R %Y $cmd %O %S"; 42 | # } 43 | # sub latex_python { 44 | # # Run *latex, then set pythontex rule if needed. 45 | # # Arguments: Root name, directory for aux files (with terminator), 46 | # # latex program to run, arguments for latex. 47 | 48 | # my $root = shift; 49 | # my $dir_string = shift; 50 | # my $pytx_code = "$dir_string$root.pytxcode"; 51 | # my $result_dir = $dir_string."pythontex-files-$root"; 52 | # my $pytx_out_file = "$result_dir/$root.pytxmcr"; 53 | # my $pytx_rule_name = "pythontex $root"; 54 | # my $ret = system @_; 55 | # if ( test_gen_file( $pytx_code ) ) { 56 | # print "=== Pythontex being used\n"; 57 | # if (! rdb_rule_exists( $pytx_rule_name ) ) { 58 | # print "=== Creating rule '$pytx_rule_name'\n"; 59 | # rdb_create_rule( $pytx_rule_name, 'external', $pythontex, '', 1, 60 | # $pytx_code, $pytx_out_file, $root, 1 ); 61 | # system "echo No file \"$pytx_out_file\". >> \"$dir_string$root.log\""; 62 | # } 63 | # } 64 | # return $ret; 65 | # } 66 | 67 | # vim: ft=perl 68 | -------------------------------------------------------------------------------- /latex/.references-mine.bib: -------------------------------------------------------------------------------- 1 | @MastersThesis{Lervag08, 2 | author = {Karl Yngve Lervåg}, 3 | title = {Simulation of two-phase flow with varying surface tension}, 4 | year = {2008}, 5 | month = {June}, 6 | school = {Norwegian University of Science and Technology, Department of 7 | Mathematical Sciences}, 8 | address = {Trondheim}, 9 | doi = {10.13140/RG.2.1.4397.4569}, 10 | } 11 | @PhdThesis{Lervag13PhD, 12 | author = {Karl Yngve Lervåg}, 13 | title = {Calculation of interface curvatures with the level-set method for 14 | two-phase flow simulations and a second-order diffuse-domain 15 | method for elliptic problems in complex geometries}, 16 | school = {Norwegian University of Science and Technology, Department of 17 | Energy and Process Engineering}, 18 | year = {2013}, 19 | month = {July}, 20 | type = {Doctoral thesis}, 21 | address = {Trondheim}, 22 | note = {ISBN: 978-82-471-4545-6}, 23 | doi = {10.13140/RG.2.1.4528.5283}, 24 | } 25 | @Article{Lervag13, 26 | author = {Karl Yngve Lervåg and Bernhard Müller and Svend Tollak Munkejord}, 27 | title = {Calculation of the interface curvature and normal vector with the 28 | level-set method}, 29 | journal = {Computers \& Fluids}, 30 | volume = {84}, 31 | pages = {218--230}, 32 | month = {September}, 33 | year = {2013}, 34 | doi = {10.1016/j.compfluid.2013.06.004}, 35 | } 36 | @Article{Ervik14, 37 | author = {Åsmund Ervik and Karl Yngve Lervåg and Svend Tollak Munkejord}, 38 | title = {A robust method for calculating interface curvature and normal 39 | vectors using an extracted local level set}, 40 | journal = {Journal of Computational Physics}, 41 | doi = {10.1016/j.jcp.2013.09.053}, 42 | volume = {257, Part A}, 43 | pages = {259--277}, 44 | month = {January}, 45 | year = {2014}, 46 | } 47 | @Article{Lervag15, 48 | author = {Karl Yngve Lervåg and John Lowengrub}, 49 | title = {Analysis of the diffuse-domain method for solving PDEs in complex 50 | geometries}, 51 | journal = {Communications in Mathematical Sciences}, 52 | volume = {13}, 53 | number = {6}, 54 | year = {2015}, 55 | doi = {10.4310/CMS.2015.v13.n6.a6}, 56 | } 57 | @Article{Aursand16a, 58 | author = {Eskil Aursand and Magnus Aashammer Gjennestad and Karl Yngve 59 | Lervåg and Halvor Lund}, 60 | title = {A multi-phase ferrofluid flow model with equation of state for 61 | thermomagnetic pumping and heat transfer}, 62 | journal = {Journal of Magnetism and Magnetic Materials}, 63 | volume = {402}, 64 | month = {March}, 65 | year = {2016}, 66 | pages = {8--19}, 67 | doi = {10.1016/j.jmmm.2015.11.042}, 68 | } 69 | @Article{Aursand16b, 70 | author = {Eskil Aursand and Magnus Aashammer Gjennestad and Karl Yngve 71 | Lervåg and Halvor Lund}, 72 | title = {Potential of enhancing a natural convection loop with 73 | a thermomagnetically pumped ferrofluid}, 74 | journal = {Journal of Magnetism and Magnetic Materials}, 75 | volume = {417}, 76 | month = {November}, 77 | year = {2016}, 78 | pages = {148--159}, 79 | doi = {10.1016/j.jmmm.2016.05.029}, 80 | } 81 | @Article{Gjennestad17, 82 | author = {Magnus Aa. Gjennestad and Andrea Gruber and Karl Yngve Lervåg and Øyvind Johansen and Åsmund Ervik and Morten Hammer and Svend Tollak Munkejord}, 83 | title = {Computation of three-dimensional three-phase flow of carbon 84 | dioxide using a high-order WENO scheme}, 85 | journal = {Journal of Computational Physics}, 86 | volume = {348}, 87 | month = {November}, 88 | year = {2017}, 89 | pages = {1--22}, 90 | doi = {10.1016/j.jcp.2017.07.016}, 91 | url = {https://arxiv.org/abs/1707.09772}, 92 | } 93 | @Article{Fyhn19, 94 | author = {Eirik Holm Fyhn and Karl Yngve Lervåg and Åsmund Ervik and Øivind 95 | Wilhelmsen}, 96 | title = {A consistent reduction of the two-layer shallow-water equations to 97 | an accurate one-layer spreading model}, 98 | journal = {Physics of Fluids}, 99 | year = {2019}, 100 | volume = {31}, 101 | issue = {12}, 102 | month = {December}, 103 | doi = {10.1063/1.5126168}, 104 | } 105 | @Inproceedings{Teigen10, 106 | author = {Knut Erik Teigen and Karl Yngve Lervåg and Svend Tollak 107 | Munkejord}, 108 | title = {Sharp interface simulations of surfactant-covered drops in 109 | electric fields}, 110 | booktitle = {Fifth European Conference on Computational Fluid Dynamics, 111 | ECCOMAS CFD 2010}, 112 | month = {June}, 113 | year = {2010}, 114 | address = {Lisbon, Portugal}, 115 | note = {\href{https://www.researchgate.net/publication/228427723_SHARP_INTERFACE_SIMULATIONS_OF_SURFACTANT-COVERED_DROPS_IN_ELECTRIC_FIELDS}{Preprint}}, 116 | isbn = {978-989-96778-1-4}, 117 | keywords = {Fluid dynamics, multiphase flow, surfactant, level-set method, 118 | sharp interface, ghost-fluid method, Marangoni force}, 119 | comment = {Simulations with the levelZ code for coalescence with 120 | surfactants and electric fields.}, 121 | } 122 | @Inproceedings{Lervag11, 123 | author = {Karl Yngve Lervåg}, 124 | title = {Calculation of interface curvature with the level-set method}, 125 | year = {2011}, 126 | day = {23-24}, 127 | month = {May}, 128 | isbn = {978-82-519-2798-7}, 129 | booktitle = {Sixth National Conference on Computational Mechanics MekIT'11}, 130 | address = {Trondheim, Norway}, 131 | doi = {10.13140/RG.2.1.3334.5766}, 132 | } 133 | @Inproceedings{Lervag13b, 134 | author = {Karl Yngve Lervåg and Åsmund Ervik}, 135 | title = {Curvature calculations for the level-set method}, 136 | year = {2013}, 137 | isbn = {978-3642331336}, 138 | doi = {10.1007/978-3-642-33134-3_23}, 139 | booktitle = {Numerical Mathematics and Advanced Applications 2011}, 140 | publisher = {Springer}, 141 | } 142 | @Inproceedings{Hammer14, 143 | author = {Hammer, Morten and Wahl, Per Eilif and Anantharaman, Rahul and 144 | Berstad, David and Lerv{\aa}g, Karl Yngve}, 145 | title = {CO2 Capture from Off-shore Gas Turbines Using Supersonic Gas 146 | Separation}, 147 | year = {2014}, 148 | journal = {Energy Procedia}, 149 | volume = {63}, 150 | pages = {243--252}, 151 | publisher = {Elsevier}, 152 | doi = {10.1016/j.egypro.2014.11.026} 153 | } 154 | @Inproceedings{Lovseth15, 155 | author = {L{\o}vseth, Sigurd Weidemann and Snustad, Ingrid and Brunsvold, 156 | Amy Leigh and Skaugen, Geir and Wahl, Per Eilif and Lerv{\aa}g, 157 | Karl Yngve}, 158 | title = {From Droplets to Process: Multilevel Research Approach to Reduce 159 | Emissions from LNG Processes}, 160 | year = {2015}, 161 | journal = {Energy Procedia}, 162 | volume = {64}, 163 | pages = {3--12}, 164 | publisher = {Elsevier}, 165 | doi = {10.1016/j.egypro.2015.01.003} 166 | } 167 | @Misc{Lervag11-plan, 168 | author = {Karl Yngve Lerv{\aa}g}, 169 | title = {PhD Project Description}, 170 | type = {Document}, 171 | url = {http://folk.ntnu.no/lervag/files/project_description.pdf}, 172 | publisher = {Norwegian University of Science and Technology}, 173 | year = {2011}, 174 | month = {May}, 175 | } 176 | @Misc{memoLervag08-01, 177 | author = {Karl Yngve Lervåg}, 178 | title = {A plan for further work with the particle-fluid code}, 179 | type = {Memo}, 180 | year = {2008}, 181 | publisher = {SINTEF Energy Research}, 182 | } 183 | @Misc{memoLervag10_setsdc, 184 | author = {Karl Yngve Lervåg}, 185 | title = {Modification of the special-cell data-structure in 186 | \textsc{SpiderII}}, 187 | type = {Memo}, 188 | year = {2010}, 189 | publisher = {SINTEF Energy Research}, 190 | } 191 | @Misc{memoLervag10_spider, 192 | author = {Karl Yngve Lervåg}, 193 | title = {Framtida til \textsc{SpiderII} som simuleringskode ved 194 | SINTEF Energi AS}, 195 | type = {Memo}, 196 | year = {2010}, 197 | publisher = {SINTEF Energy Research}, 198 | } 199 | @Misc{memoMelheim10, 200 | author = {Jens Andreas Melheim and Karl Yngve Lervåg}, 201 | title = {Implementation of particle-fluid forces in SpiderII}, 202 | type = {Memo}, 203 | year = {2010}, 204 | publisher = {SINTEF Energy Research}, 205 | } 206 | @Misc{noteDDAderivations12, 207 | author = {Karl Yngve {Lerv\aa g}}, 208 | title = {Diffuse Domain Approach --- Derivation of second-order order DDA 209 | equations}, 210 | type = {Note}, 211 | year = {2012}, 212 | } 213 | @Misc{noteDDAnumdetails12, 214 | author = {Karl Yngve {Lerv\aa g}}, 215 | title = {Diffuse Domain Approach --- Discretization, numerical 216 | implementation, and verification}, 217 | type = {Note}, 218 | year = {2012}, 219 | } 220 | @Misc{noteDDAresults12, 221 | author = {Karl Yngve {Lerv\aa g}}, 222 | title = {Diffuse Domain Approach --- Simulation results}, 223 | type = {Note}, 224 | year = {2012}, 225 | } 226 | 227 | % vim: ft=bib fdm=syntax 228 | -------------------------------------------------------------------------------- /latex/.texmf/tex/latex/beamerntnu/beamerthementnu.sty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lervag/dotfiles/32c190eea08590f65f304ea656f7258983cde6fb/latex/.texmf/tex/latex/beamerntnu/beamerthementnu.sty -------------------------------------------------------------------------------- /latex/.texmf/tex/latex/beamerntnu/bg-title-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lervag/dotfiles/32c190eea08590f65f304ea656f7258983cde6fb/latex/.texmf/tex/latex/beamerntnu/bg-title-en.pdf -------------------------------------------------------------------------------- /latex/.texmf/tex/latex/beamerntnu/bg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lervag/dotfiles/32c190eea08590f65f304ea656f7258983cde6fb/latex/.texmf/tex/latex/beamerntnu/bg.pdf -------------------------------------------------------------------------------- /lisp/.clisprc.lisp: -------------------------------------------------------------------------------- 1 | ;;; To make it easy to run scripts 2 | ;(defvar *script-exit-hooks* ()) 3 | 4 | ;;; The following lines added by ql:add-to-init-file: 5 | #-quicklisp 6 | (let ((quicklisp-init (merge-pathnames ".quicklisp/setup.lisp" 7 | (user-homedir-pathname)))) 8 | (when (probe-file quicklisp-init) 9 | (load quicklisp-init))) 10 | 11 | ;;; 12 | ;;; Load utility file 13 | ;;; 14 | (load (merge-pathnames ".lisp-common" (user-homedir-pathname))) 15 | -------------------------------------------------------------------------------- /lisp/.lisp-common: -------------------------------------------------------------------------------- 1 | ;;; 2 | ;;; A set of utility functions given by Graham in "On Lisp" 3 | ;;; 4 | (defun flatten (x) 5 | (labels ((rec (x acc) 6 | (cond ((null x) acc) 7 | ((atom x) (cons x acc)) 8 | (t (rec 9 | (car x) 10 | (rec (cdr x) acc)))))) 11 | (rec x nil))) 12 | 13 | (defun group (source n) 14 | (if (zerop n) (error "zero length")) 15 | (labels ((rec (source acc) 16 | (let ((rest (nthcdr n source))) 17 | (if (consp rest) 18 | (rec rest (cons (subseq source 0 n) acc)) 19 | (nreverse (cons source acc)))))) 20 | (if source (rec source nil) nil))) 21 | 22 | 23 | (defun mkstr (&rest args) 24 | (with-output-to-string (s) 25 | (dolist (a args) (princ a s)))) 26 | 27 | (defun symb (&rest args) 28 | (values (intern (apply #'mkstr args)))) 29 | 30 | ;;; 31 | ;;; Define some utility macros for writing macros (taken from Let over Lambda) 32 | ;;; 33 | (defun g!-symbol-p (s) 34 | (and (symbolp s) 35 | (> (length (symbol-name s)) 2) 36 | (string= (symbol-name s) 37 | "G!" 38 | :start1 0 39 | :end1 2))) 40 | 41 | (defun o!-symbol-p (s) 42 | (and (symbolp s) 43 | (> (length (symbol-name s)) 2) 44 | (string= (symbol-name s) 45 | "O!" 46 | :start1 0 47 | :end1 2))) 48 | 49 | (defun o!-symbol-to-g!-symbol (s) 50 | (symb "G!" 51 | (subseq (symbol-name s) 2))) 52 | 53 | (defmacro defmacro/g! (name args &rest body) 54 | (let ((syms (remove-duplicates 55 | (remove-if-not #'g!-symbol-p 56 | (flatten body))))) 57 | `(defmacro ,name ,args 58 | (let ,(mapcar 59 | (lambda (s) 60 | `(,s (gensym ,(subseq 61 | (symbol-name s) 62 | 2)))) 63 | syms) 64 | ,@body)))) 65 | 66 | (defmacro defmacro! (name args &rest body) 67 | (let* ((os (remove-if-not #'o!-symbol-p args)) 68 | (gs (mapcar #'o!-symbol-to-g!-symbol os))) 69 | `(defmacro/g! ,name ,args 70 | `(let ,(mapcar #'list (list ,@gs) (list ,@os)) 71 | ,(progn ,@body))))) 72 | 73 | ;;; 74 | ;;; dlambda 75 | ;;; 76 | (defmacro! dlambda (&rest ds) 77 | `(lambda (&rest ,g!args) 78 | (case (car ,g!args) 79 | ,@(mapcar 80 | (lambda (d) 81 | `(,(if (eq t (car d)) 82 | t 83 | (list (car d))) 84 | (apply (lambda ,@(cdr d)) 85 | ,(if (eq t (car d)) 86 | g!args 87 | `(cdr ,g!args))))) 88 | ds)))) 89 | 90 | ;;; 91 | ;;; alambda 92 | ;;; 93 | (defmacro alambda (parms &body body) 94 | `(labels ((self ,parms ,@body)) 95 | #'self)) 96 | 97 | ;;; 98 | ;;; aif 99 | ;;; 100 | (defmacro aif (test then &optional else) 101 | `(let ((it ,test)) 102 | (if it ,then ,else))) 103 | 104 | ;;; 105 | ;;; Sharp backquote 106 | ;;; 107 | (defun |#`-reader| (stream sub-char numarg) 108 | (declare (ignore sub-char)) 109 | (unless numarg (setq numarg 1)) 110 | `(lambda ,(loop for i from 1 to numarg 111 | collect (symb 'a i)) 112 | ,(funcall 113 | (get-macro-character #\`) stream nil))) 114 | (set-dispatch-macro-character #\# #\` #'|#`-reader|) 115 | 116 | ;;; 117 | ;;; alet (with extras) 118 | ;;; 119 | (defmacro alet (letargs &rest body) 120 | `(let ((this) ,@letargs) 121 | (setq this ,@(last body)) 122 | ,@(butlast body) 123 | (lambda (&rest params) 124 | (apply this params)))) 125 | 126 | (defmacro alet-fsm (&rest states) 127 | `(macrolet ((state (s) `(setq this #',s))) 128 | (labels (,@states) #',(caar states)))) 129 | 130 | (defmacro! ichain-before (&rest body) 131 | `(let ((,g!indir-env this)) 132 | (setq this 133 | (lambda (&rest ,g!temp-args) 134 | ,@body 135 | (apply ,g!indir-env 136 | ,g!temp-args))))) 137 | 138 | (defmacro! ichain-after (&rest body) 139 | `(let ((,g!indir-env this)) 140 | (setq this 141 | (lambda (&rest ,g!temp-args) 142 | (prog1 143 | (apply ,g!indir-env 144 | ,g!temp-args) 145 | ,@body))))) 146 | 147 | (defmacro! ichain-intercept (&rest body) 148 | `(let ((,g!indir-env this)) 149 | (setq this 150 | (lambda (&rest ,g!temp-args) 151 | (block ,g!intercept 152 | (macrolet ((intercept (v) 153 | `(return-from ,',g!intercept ,v))) 154 | (prog1 155 | (apply ,g!indir-env 156 | ,g!temp-args) 157 | ,@body))))))) 158 | 159 | (defmacro let-hotpatch (letargs &rest body) 160 | `(let ((,g!this) ,@letargs) 161 | (setq ,g!this ,@(last body)) 162 | ,@(butlast body) 163 | (dlambda 164 | (:hotpatch (closure) (setq ,g!this closure)) 165 | (t (&rest args) (apply ,g!this args))))) 166 | 167 | ; 168 | ; vim: ft=lisp 169 | ; 170 | -------------------------------------------------------------------------------- /lisp/.sbclrc: -------------------------------------------------------------------------------- 1 | ;;; The following lines added by ql:add-to-init-file: 2 | #-quicklisp 3 | (let ((quicklisp-init (merge-pathnames ".quicklisp/setup.lisp" 4 | (user-homedir-pathname)))) 5 | (when (probe-file quicklisp-init) 6 | (load quicklisp-init))) 7 | 8 | ;;; 9 | ;;; Check for --no-linedit command-line option. 10 | ;;; 11 | (if (member "--no-linedit" sb-ext:*posix-argv* :test 'equal) 12 | (setf sb-ext:*posix-argv* 13 | (remove "--no-linedit" sb-ext:*posix-argv* :test 'equal)) 14 | (when (interactive-stream-p *terminal-io*) 15 | (ql:quickload :sb-aclrepl) 16 | (ql:quickload :linedit) 17 | (funcall (intern "INSTALL-REPL" :linedit) 18 | :eof-quits t 19 | :wrap-current t))) 20 | 21 | ;;; 22 | ;;; Load utility file 23 | ;;; 24 | ; (load (merge-pathnames ".lisp-common" (user-homedir-pathname))) 25 | -------------------------------------------------------------------------------- /lua/.config/stylua/stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 80 2 | indent_type = "Spaces" 3 | indent_width = 2 4 | -------------------------------------------------------------------------------- /mintty/.minttyrc: -------------------------------------------------------------------------------- 1 | OpaqueWhenFocused=yes 2 | Transparency=Medium 3 | CursorType=Block 4 | CursorBlink=no 5 | FontHeight=10 6 | Font=Lucida Sans Typewriter 7 | Rows=60 8 | ScrollbackLines=99999 9 | Scrollbar=None 10 | 11 | ForegroundColour=101, 123, 131 12 | BackgroundColour=253, 246, 227 13 | CursorColour= 220, 50, 47 14 | 15 | Black= 7, 54, 66 16 | BoldBlack= 0, 43, 54 17 | Red= 220, 50, 47 18 | BoldRed= 203, 75, 22 19 | Green= 133, 153, 0 20 | BoldGreen= 88, 110, 117 21 | Yellow= 181, 137, 0 22 | BoldYellow= 101, 123, 131 23 | Blue= 38, 139, 210 24 | BoldBlue= 131, 148, 150 25 | Magenta= 211, 54, 130 26 | BoldMagenta= 108, 113, 196 27 | Cyan= 42, 161, 152 28 | BoldCyan= 147, 161, 161 29 | White= 238, 232, 213 30 | BoldWhite= 253, 246, 227 31 | -------------------------------------------------------------------------------- /misc/.ackrc: -------------------------------------------------------------------------------- 1 | --sort-files 2 | --type-add=wiki=.wiki 3 | --ignore-case 4 | -------------------------------------------------------------------------------- /misc/.asoundrc: -------------------------------------------------------------------------------- 1 | pcm.!default { 2 | type bluetooth 3 | device 48:C1:AC:4A:67:1E 4 | profile "auto" 5 | bitpool "31" 6 | } 7 | 8 | pcm.btheadset { 9 | type plug 10 | slave { 11 | pcm { 12 | type bluetooth 13 | device 48:C1:AC:4A:67:1E 14 | #device 00:18:09:1C:B7:80 15 | profile "auto" 16 | bitpool "31" 17 | } 18 | } 19 | hint { 20 | show on 21 | description "BT Headset" 22 | } 23 | } 24 | 25 | ctl.btheadset { 26 | type bluetooth 27 | } 28 | -------------------------------------------------------------------------------- /misc/.ctags: -------------------------------------------------------------------------------- 1 | .ctags.d/default.ctags -------------------------------------------------------------------------------- /misc/.ctags.d/default.ctags: -------------------------------------------------------------------------------- 1 | --langdef=tex2 2 | --langmap=tex2:.tex 3 | --regex-tex2=/\\label[ \t]*\*?\{[ \t]*([^}]*)\}/\1/l,label/ 4 | 5 | --langdef=bib 6 | --langmap=bib:.bib 7 | --regex-bib=/^@article\{([^,]*)/\1/a,article/i 8 | --regex-bib=/^@book\{([^,]*)/\1/b,book/i 9 | --regex-bib=/^@booklet\{([^,]*)/\1/L,booklet/i 10 | --regex-bib=/^@conference\{([^,]*)/\1/c,conference/i 11 | --regex-bib=/^@inbook\{([^,]*)/\1/B,inbook/i 12 | --regex-bib=/^@incollection\{([^,]*)/\1/C,incollection/i 13 | --regex-bib=/^@inproceedings\{([^,]*)/\1/P,inproceedings/i 14 | --regex-bib=/^@manual\{([^,]*)/\1/m,manual/i 15 | --regex-bib=/^@mastersthesis\{([^,]*)/\1/T,mastersthesis/i 16 | --regex-bib=/^@misc\{([^,]*)/\1/M,misc/i 17 | --regex-bib=/^@phdthesis\{([^,]*)/\1/t,phdthesis/i 18 | --regex-bib=/^@proceedings\{([^,]*)/\1/p,proceedings/i 19 | --regex-bib=/^@string\{([^ "#%')(,=}{]+)/\1/s,string/i 20 | --regex-bib=/^@techreport\{([^,]*)/\1/r,techreport/i 21 | --regex-bib=/^@unpublished\{([^,]*)/\1/u,unpublished/i 22 | -------------------------------------------------------------------------------- /misc/.cvimrc: -------------------------------------------------------------------------------- 1 | set localconfig 2 | set numerichints 3 | set typelinkhints 4 | 5 | let barposition = "bottom" 6 | let configpath = '/home/lervag/.cvimrc' 7 | let scrollstep = 200 8 | let fullpagescrollpercent = 90 9 | let searchalias g = "google" 10 | let blacklists = [ 11 | \ "*://feedly.com/*", 12 | \ "*://maconomy.sintef.no/*", 13 | \ "https://outlook.office.com/*", 14 | \ "https://mail.google.com/*", 15 | \ "https://inbox.google.com/*", 16 | \ "https://plus.google.com/*", 17 | \ "https://jira.code.sintef.no/*" 18 | \] 19 | 20 | get_ip() -> {{ 21 | httpRequest({url: 'http://api.ipify.org/?format=json', json: true}, 22 | function(res) { Status.setMessage('IP: ' + res.ip); }); 23 | }} 24 | 25 | map x :restore 26 | map gb :buffer 27 | map X :execute gTx 28 | map u lastClosedTab 29 | map a goToInput 30 | unmap gR 31 | map R reloadTabUncached 32 | map ci :call get_ip 33 | map 34 | 35 | site '*://play.spotify.com/*' { 36 | call :pintab 37 | } 38 | 39 | site 'https://play.google.com/music/*' { 40 | call :pintab 41 | } 42 | -------------------------------------------------------------------------------- /misc/.dircolors.ansi-dark: -------------------------------------------------------------------------------- 1 | # Exact Solarized color theme for the color GNU ls utility. 2 | # Designed for dircolors (GNU coreutils) 5.97 3 | # 4 | # This simple theme was simultaneously designed for these terminal color schemes: 5 | # - Solarized dark (best) 6 | # - Solarized light (best) 7 | # - default dark 8 | # - default light 9 | # 10 | # How the colors were selected: 11 | # - Terminal emulators often have an option typically enabled by default that makes 12 | # bold a different color. It is important to leave this option enabled so that 13 | # you can access the entire 16-color Solarized palette, and not just 8 colors. 14 | # - We favor universality over a greater number of colors. So we limit the number 15 | # of colors so that this theme will work out of the box in all terminals, 16 | # Solarized or not, dark or light. 17 | # - We choose to have the following category of files: 18 | # NORMAL & FILE, DIR, LINK, EXEC and 19 | # editable text including source, unimportant text, binary docs & multimedia source 20 | # files, viewable multimedia, archived/compressed, and unimportant non-text 21 | # - For uniqueness, we stay away from the Solarized foreground colors are -- either 22 | # base00 (brightyellow) or base0 (brightblue). However, they can be used if 23 | # you know what the bg/fg colors of your terminal are, in order to optimize the display. 24 | # - 3 different options are provided: universal, solarized dark, and solarized light. 25 | # The only difference between the universal scheme and one that's optimized for 26 | # dark/light is the color of "unimportant" files, which should blend more with the 27 | # background 28 | # - We note that blue is the hardest color to see on dark bg and yellow is the hardest 29 | # color to see on light bg (with blue being particularly bad). So we choose yellow 30 | # for multimedia files which are usually accessed in a GUI folder browser anyway. 31 | # And blue is kept for custom use of this scheme's user. 32 | # - See table below to see the assignments. 33 | 34 | 35 | # Installation instructions: 36 | # This file goes in the /etc directory, and must be world readable. 37 | # You can copy this file to .dir_colors in your $HOME directory to override 38 | # the system defaults. 39 | 40 | # COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not 41 | # pipes. 'all' adds color characters to all output. 'none' shuts colorization 42 | # off. 43 | COLOR tty 44 | 45 | # Below, there should be one TERM entry for each termtype that is colorizable 46 | TERM ansi 47 | TERM color_xterm 48 | TERM color-xterm 49 | TERM con132x25 50 | TERM con132x30 51 | TERM con132x43 52 | TERM con132x60 53 | TERM con80x25 54 | TERM con80x28 55 | TERM con80x30 56 | TERM con80x43 57 | TERM con80x50 58 | TERM con80x60 59 | TERM cons25 60 | TERM console 61 | TERM cygwin 62 | TERM dtterm 63 | TERM dvtm 64 | TERM dvtm-256color 65 | TERM Eterm 66 | TERM eterm-color 67 | TERM fbterm 68 | TERM gnome 69 | TERM gnome-256color 70 | TERM jfbterm 71 | TERM konsole 72 | TERM konsole-256color 73 | TERM kterm 74 | TERM linux 75 | TERM linux-c 76 | TERM mach-color 77 | TERM mlterm 78 | TERM nxterm 79 | TERM putty 80 | TERM putty-256color 81 | TERM rxvt 82 | TERM rxvt-256color 83 | TERM rxvt-cygwin 84 | TERM rxvt-cygwin-native 85 | TERM rxvt-unicode 86 | TERM rxvt-unicode256 87 | TERM rxvt-unicode-256color 88 | TERM screen 89 | TERM screen-16color 90 | TERM screen-16color-bce 91 | TERM screen-16color-s 92 | TERM screen-16color-bce-s 93 | TERM screen-256color 94 | TERM screen-256color-bce 95 | TERM screen-256color-s 96 | TERM screen-256color-bce-s 97 | TERM screen-256color-italic 98 | TERM screen-bce 99 | TERM screen-w 100 | TERM screen.xterm-256color 101 | TERM screen.linux 102 | TERM screen.xterm-new 103 | TERM st 104 | TERM st-meta 105 | TERM st-256color 106 | TERM st-meta-256color 107 | TERM tmux 108 | TERM tmux-256color 109 | TERM tmux-256color-italic 110 | TERM vt100 111 | TERM xterm 112 | TERM xterm-new 113 | TERM xterm-16color 114 | TERM xterm-256color 115 | TERM xterm-256color-italic 116 | TERM xterm-88color 117 | TERM xterm-color 118 | TERM xterm-debian 119 | TERM xterm-termite 120 | TERM xterm-kitty 121 | 122 | # EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output) 123 | EIGHTBIT 1 124 | 125 | ############################################################################# 126 | # Below are the color init strings for the basic file types. A color init 127 | # string consists of one or more of the following numeric codes: 128 | # 129 | # Attribute codes: 130 | # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed 131 | # Text color codes: 132 | # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white 133 | # Background color codes: 134 | # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white 135 | # 136 | # NOTES: 137 | # - See http://www.oreilly.com/catalog/wdnut/excerpt/color_names.html 138 | # - Color combinations 139 | # ANSI Color code Solarized Notes Universal SolDark SolLight 140 | # ~~~~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~ ~~~~~~~~~ ~~~~~~~ ~~~~~~~~ 141 | # 00 none NORMAL, FILE 142 | # 30 black base02 143 | # 01;30 bright black base03 bg of SolDark 144 | # 31 red red docs & mm src 145 | # 01;31 bright red orange EXEC 146 | # 32 green green editable text 147 | # 01;32 bright green base01 unimportant text 148 | # 33 yellow yellow unclear in light bg multimedia 149 | # 01;33 bright yellow base00 fg of SolLight unimportant non-text 150 | # 34 blue blue unclear in dark bg user customized 151 | # 01;34 bright blue base0 fg in SolDark unimportant text 152 | # 35 magenta magenta LINK 153 | # 01;35 bright magenta violet archive/compressed 154 | # 36 cyan cyan DIR 155 | # 01;36 bright cyan base1 unimportant non-text 156 | # 37 white base2 157 | # 01;37 bright white base3 bg in SolLight 158 | # 05;37;41 unclear in Putty dark 159 | 160 | 161 | ### By file type 162 | 163 | # global default 164 | NORMAL 00 165 | # normal file 166 | FILE 00 167 | # directory 168 | DIR 36 169 | # symbolic link 170 | LINK 35 171 | 172 | # pipe, socket, block device, character device (blue bg) 173 | FIFO 30;44 174 | SOCK 35;44 175 | DOOR 35;44 # Solaris 2.5 and later 176 | BLK 33;44 177 | CHR 37;44 178 | 179 | 180 | ############################################################################# 181 | ### By file attributes 182 | 183 | # Orphaned symlinks (blinking white on red) 184 | # Blink may or may not work (works on iTerm dark or light, and Putty dark) 185 | ORPHAN 05;37;41 186 | # ... and the files that orphaned symlinks point to (blinking white on red) 187 | MISSING 05;37;41 188 | 189 | # files with execute permission 190 | EXEC 01;31 # Unix 191 | .cmd 01;31 # Win 192 | .exe 01;31 # Win 193 | .com 01;31 # Win 194 | .bat 01;31 # Win 195 | .reg 01;31 # Win 196 | .app 01;31 # OSX 197 | 198 | ############################################################################# 199 | ### By extension 200 | 201 | # List any file extensions like '.gz' or '.tar' that you would like ls 202 | # to colorize below. Put the extension, a space, and the color init string. 203 | # (and any comments you want to add after a '#') 204 | 205 | ### Text formats 206 | 207 | # Text that we can edit with a regular editor 208 | .txt 32 209 | .org 32 210 | .md 32 211 | .mkd 32 212 | 213 | # Source text 214 | .h 32 215 | .hpp 32 216 | .c 32 217 | .C 32 218 | .cc 32 219 | .cpp 32 220 | .cxx 32 221 | .objc 32 222 | .cl 32 223 | .sh 32 224 | .bash 32 225 | .csh 32 226 | .zsh 32 227 | .el 32 228 | .vim 32 229 | .java 32 230 | .pl 32 231 | .pm 32 232 | .py 32 233 | .rb 32 234 | .hs 32 235 | .php 32 236 | .htm 32 237 | .html 32 238 | .shtml 32 239 | .erb 32 240 | .haml 32 241 | .xml 32 242 | .rdf 32 243 | .css 32 244 | .sass 32 245 | .scss 32 246 | .less 32 247 | .js 32 248 | .coffee 32 249 | .man 32 250 | .0 32 251 | .1 32 252 | .2 32 253 | .3 32 254 | .4 32 255 | .5 32 256 | .6 32 257 | .7 32 258 | .8 32 259 | .9 32 260 | .l 32 261 | .n 32 262 | .p 32 263 | .pod 32 264 | .tex 32 265 | .go 32 266 | .sql 32 267 | .csv 32 268 | .sv 32 269 | .svh 32 270 | .v 32 271 | .vh 32 272 | .vhd 32 273 | 274 | ### Multimedia formats 275 | 276 | # Image 277 | .bmp 33 278 | .cgm 33 279 | .dl 33 280 | .dvi 33 281 | .emf 33 282 | .eps 33 283 | .gif 33 284 | .jpeg 33 285 | .jpg 33 286 | .JPG 33 287 | .mng 33 288 | .pbm 33 289 | .pcx 33 290 | .pdf 33 291 | .pgm 33 292 | .png 33 293 | .PNG 33 294 | .ppm 33 295 | .pps 33 296 | .ppsx 33 297 | .ps 33 298 | .svg 33 299 | .svgz 33 300 | .tga 33 301 | .tif 33 302 | .tiff 33 303 | .xbm 33 304 | .xcf 33 305 | .xpm 33 306 | .xwd 33 307 | .xwd 33 308 | .yuv 33 309 | 310 | # Audio 311 | .aac 33 312 | .au 33 313 | .flac 33 314 | .m4a 33 315 | .mid 33 316 | .midi 33 317 | .mka 33 318 | .mp3 33 319 | .mpa 33 320 | .mpeg 33 321 | .mpg 33 322 | .ogg 33 323 | .opus 33 324 | .ra 33 325 | .wav 33 326 | 327 | # Video 328 | .anx 33 329 | .asf 33 330 | .avi 33 331 | .axv 33 332 | .flc 33 333 | .fli 33 334 | .flv 33 335 | .gl 33 336 | .m2v 33 337 | .m4v 33 338 | .mkv 33 339 | .mov 33 340 | .MOV 33 341 | .mp4 33 342 | .mp4v 33 343 | .mpeg 33 344 | .mpg 33 345 | .nuv 33 346 | .ogm 33 347 | .ogv 33 348 | .ogx 33 349 | .qt 33 350 | .rm 33 351 | .rmvb 33 352 | .swf 33 353 | .vob 33 354 | .webm 33 355 | .wmv 33 356 | 357 | ### Misc 358 | 359 | # Binary document formats and multimedia source 360 | .doc 31 361 | .docx 31 362 | .rtf 31 363 | .odt 31 364 | .dot 31 365 | .dotx 31 366 | .ott 31 367 | .xls 31 368 | .xlsx 31 369 | .ods 31 370 | .ots 31 371 | .ppt 31 372 | .pptx 31 373 | .odp 31 374 | .otp 31 375 | .fla 31 376 | .psd 31 377 | 378 | # Archives, compressed 379 | .7z 1;35 380 | .apk 1;35 381 | .arj 1;35 382 | .bin 1;35 383 | .bz 1;35 384 | .bz2 1;35 385 | .cab 1;35 # Win 386 | .deb 1;35 387 | .dmg 1;35 # OSX 388 | .gem 1;35 389 | .gz 1;35 390 | .iso 1;35 391 | .jar 1;35 392 | .msi 1;35 # Win 393 | .rar 1;35 394 | .rpm 1;35 395 | .tar 1;35 396 | .tbz 1;35 397 | .tbz2 1;35 398 | .tgz 1;35 399 | .tx 1;35 400 | .war 1;35 401 | .xpi 1;35 402 | .xz 1;35 403 | .z 1;35 404 | .Z 1;35 405 | .zip 1;35 406 | 407 | # For testing 408 | .ANSI-30-black 30 409 | .ANSI-01;30-brblack 01;30 410 | .ANSI-31-red 31 411 | .ANSI-01;31-brred 01;31 412 | .ANSI-32-green 32 413 | .ANSI-01;32-brgreen 01;32 414 | .ANSI-33-yellow 33 415 | .ANSI-01;33-bryellow 01;33 416 | .ANSI-34-blue 34 417 | .ANSI-01;34-brblue 01;34 418 | .ANSI-35-magenta 35 419 | .ANSI-01;35-brmagenta 01;35 420 | .ANSI-36-cyan 36 421 | .ANSI-01;36-brcyan 01;36 422 | .ANSI-37-white 37 423 | .ANSI-01;37-brwhite 01;37 424 | 425 | ############################################################################# 426 | # Your customizations 427 | 428 | # Unimportant text files 429 | # For universal scheme, use brightgreen 01;32 430 | # For optimal on light bg (but too prominent on dark bg), use white 01;34 431 | .log 01;32 432 | *~ 01;32 433 | *# 01;32 434 | #.log 01;34 435 | #*~ 01;34 436 | #*# 01;34 437 | 438 | # Unimportant non-text files 439 | # For universal scheme, use brightcyan 01;36 440 | # For optimal on dark bg (but too prominent on light bg), change to 01;33 441 | .bak 01;36 442 | .BAK 01;36 443 | .old 01;36 444 | .OLD 01;36 445 | .org_archive 01;36 446 | .off 01;36 447 | .OFF 01;36 448 | .dist 01;36 449 | .DIST 01;36 450 | .orig 01;36 451 | .ORIG 01;36 452 | .swp 01;36 453 | .swo 01;36 454 | *,v 01;36 455 | #.bak 01;33 456 | #.BAK 01;33 457 | #.old 01;33 458 | #.OLD 01;33 459 | #.org_archive 01;33 460 | #.off 01;33 461 | #.OFF 01;33 462 | #.dist 01;33 463 | #.DIST 01;33 464 | #.orig 01;33 465 | #.ORIG 01;33 466 | #.swp 01;33 467 | #.swo 01;33 468 | #*,v 01;33 469 | 470 | # The brightmagenta (Solarized: purple) color is free for you to use for your 471 | # custom file type 472 | .gpg 34 473 | .gpg 34 474 | .pgp 34 475 | .asc 34 476 | .3des 34 477 | .aes 34 478 | .enc 34 479 | .sqlite 34 480 | -------------------------------------------------------------------------------- /misc/.gtkrc-2.0.mine: -------------------------------------------------------------------------------- 1 | style "vimfix" { 2 | bg[NORMAL] = "#fdf6e3" 3 | } 4 | widget "vim-main-window.*GtkForm" style "vimfix" 5 | -------------------------------------------------------------------------------- /misc/.inputrc: -------------------------------------------------------------------------------- 1 | # Documentation: 2 | # * https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html 3 | 4 | set visible-stats on 5 | set editing-mode vi 6 | set keymap vi 7 | set show-all-if-ambiguous on 8 | set mark-symlinked-directories on 9 | 10 | # Handle some special keycodes 11 | # See also ~/.Xresources 12 | # Note: This is not good enough yet, but perhaps better than nothing? 13 | "\e[32;2u": " " 14 | "\e[32;5u": " " 15 | "\e[32;6u": " " 16 | "\e[9;5u": "\t" 17 | "\e[9;6u": "\t" 18 | "\e[13;2u": accept-line 19 | "\e[13;5u": accept-line 20 | "\e[13;6u": accept-line 21 | -------------------------------------------------------------------------------- /misc/.irbrc: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'interactive_editor' 3 | require 'irb/completion' 4 | ARGV.concat [ "--readline", "--promt-mode", "simple" ] 5 | 6 | # Improve the history log file 7 | module Readline 8 | module History 9 | LOG = "#{ENV['HOME']}/.irb-history" 10 | 11 | def self.write_log(line) 12 | File.open(LOG, 'ab') {|f| f << "#{line}\n"} 13 | end 14 | 15 | def self.start_session_log 16 | write_log("# " + "-"*70) 17 | write_log("# Session start: #{Time.now}") 18 | write_log("# " + "-"*70) 19 | at_exit do 20 | write_log("# " + "-"*70) 21 | write_log("# Session stop: #{Time.now}") 22 | write_log("# " + "-"*70) 23 | end 24 | end 25 | end 26 | 27 | alias :old_readline :readline 28 | def readline(*args) 29 | ln = old_readline(*args) 30 | begin 31 | History.write_log(ln) 32 | rescue 33 | end 34 | ln 35 | end 36 | end 37 | Readline::History.start_session_log 38 | 39 | # vim: ft=ruby 40 | -------------------------------------------------------------------------------- /misc/.mailrc: -------------------------------------------------------------------------------- 1 | set from="Karl Yngve Lervåg " 2 | -------------------------------------------------------------------------------- /misc/.pam_environment: -------------------------------------------------------------------------------- 1 | BIBINPUTS=.:~/: 2 | -------------------------------------------------------------------------------- /misc/.pdfpcrc: -------------------------------------------------------------------------------- 1 | bind j next 2 | bind k prev 3 | bind C+f next10 4 | bind C+b prev10 5 | bind h gotoFirst 6 | bind l gotoLast 7 | bind o overview 8 | -------------------------------------------------------------------------------- /misc/.tecplot.cfg: -------------------------------------------------------------------------------- 1 | #!MC 1120 2 | 3 | # 1D plots 4 | $!XYLINEAXIS XDETAIL 1 { 5 | TITLE {SHOWONAXISLINE = NO} 6 | TICKLABEL { 7 | TEXTSHAPE {HEIGHT = 4} 8 | NUMFORMAT {FORMATTING = RANGEBESTFLOAT} } } 9 | $!XYLINEAXIS YDETAIL 1 { 10 | TITLE {SHOWONAXISLINE = NO} 11 | TICKLABEL { 12 | TEXTSHAPE {HEIGHT = 4} 13 | NUMFORMAT {FORMATTING = RANGEBESTFLOAT} } } 14 | 15 | # 2D plots 16 | $!TWODAXIS XDETAIL { 17 | TITLE {SHOWONAXISLINE = NO} 18 | TICKLABEL { 19 | SHOWATAXISINTERSECTION = NO 20 | ERASEBEHINDLABELS = NO 21 | TEXTSHAPE {HEIGHT = 4} 22 | NUMFORMAT {FORMATTING = RANGEBESTFLOAT} } } 23 | $!TWODAXIS YDETAIL { 24 | TITLE {SHOWONAXISLINE = NO} 25 | TICKLABEL { 26 | SHOWATAXISINTERSECTION = NO 27 | ERASEBEHINDLABELS = NO 28 | TEXTSHAPE {HEIGHT = 4} 29 | NUMFORMAT {FORMATTING = RANGEBESTFLOAT} } } 30 | $!FIELDMAP CONTOUR {CONTOURTYPE = LINES} 31 | 32 | # Turn off borders on frames 33 | $!FRAMELAYOUT SHOWBORDER = NO 34 | 35 | # Change default inputdatafile name 36 | $!FILECONFIG FNAMEFILTER { INPUTDATAFILE = "*.[pt][el][ct]" } 37 | 38 | # Change some basic sizes 39 | $!BASICSIZE 40 | LINETHICKNESSES { 41 | MEDIUM = 0.25 42 | LARGE = 0.4 43 | HUGE = 1 } 44 | LINEPATLENGTHS { 45 | SMALL = 1 46 | MEDIUM = 2.5 47 | LARGE = 4 } 48 | 49 | # Turn on old text formatting 50 | $!COMPATIBILITY ALLOWOLDTEXTFORMATTING = YES 51 | 52 | # Some interface options 53 | $!INTERFACE 54 | NUMPTSALLOWEDBEFOREAPPROX = 500000 55 | PERCENTAGEOFPOINTSTOKEEP = 10 56 | BEEPONFRAMEINTERRUPT = NO 57 | SHOWFRAMEBORDERSWHENOFF = NO 58 | USESTROKEFONTSONSCREEN = YES 59 | DATA { VARIABLEDERIVATIONMETHOD = FAST } 60 | OPENGLCONFIG { ALLOWHWACCELERATION = YES } 61 | -------------------------------------------------------------------------------- /misc/.toprc: -------------------------------------------------------------------------------- 1 | RCfile for "top with windows" # shameless braggin' 2 | Id:a, Mode_altscr=0, Mode_irixps=1, Delay_time=3.000, Curwin=0 3 | Def fieldscur=AEHIWKNLMXoqtbcdfgjprsuvyz 4 | winflags=65336, sortindx=10, maxtasks=0 5 | summclr=1, msgsclr=1, headclr=3, taskclr=1 6 | Job fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX 7 | winflags=64825, sortindx=0, maxtasks=0 8 | summclr=6, msgsclr=6, headclr=7, taskclr=6 9 | Mem fieldscur=ANOPQRSTUVbcdefgjlmyzWHIKX 10 | winflags=64825, sortindx=13, maxtasks=0 11 | summclr=5, msgsclr=5, headclr=4, taskclr=5 12 | Usr fieldscur=ABDECGfhijlopqrstuvyzMKNWX 13 | winflags=64825, sortindx=4, maxtasks=0 14 | summclr=3, msgsclr=3, headclr=2, taskclr=3 15 | -------------------------------------------------------------------------------- /misc/.vintrc.yaml: -------------------------------------------------------------------------------- 1 | cmdargs: 2 | severity: style_problem 3 | color: true 4 | env: 5 | neovim: true 6 | 7 | policies: 8 | ProhibitMissingScriptEncoding: 9 | enabled: false 10 | ProhibitUsingUndeclaredVariable: 11 | enabled: false 12 | ProhibitSetNoCompatible: 13 | enabled: false 14 | ProhibitImplicitScopeVariable: 15 | enabled: false 16 | 17 | -------------------------------------------------------------------------------- /ncspot/.config/ncspot/config.toml: -------------------------------------------------------------------------------- 1 | [general] 2 | use_nerdfont = true 3 | notify = true 4 | gapless = true 5 | volnorm = true 6 | volnorm_pregain = -3 7 | 8 | [saved_state] 9 | volume = 100 10 | 11 | [keybindings] 12 | "p" = "playpause" 13 | "1" = "focus queue" 14 | "2" = "focus library" 15 | "3" = "focus search" 16 | "R" = "reload" 17 | 18 | [theme] 19 | background = "#282828" 20 | primary = "#fbf1c7" 21 | secondary = "#584945" 22 | title = "#d65d0e" 23 | playing = "#98971a" 24 | playing_selected = "#689d6a" 25 | playing_bg = "#282828" 26 | highlight = "#fbf1c7" 27 | highlight_bg = "#928374" 28 | error = "#fbf1c7" 29 | error_bg = "#cc241d" 30 | statusbar = "#1d2021" 31 | statusbar_progress = "#b8bb26" 32 | statusbar_bg = "#98971a" 33 | cmdline = "#fbf1c7" 34 | cmdline_bg = "#1d2021" 35 | search_match = "#fb4934" 36 | -------------------------------------------------------------------------------- /openbox/.config/openbox/autostart: -------------------------------------------------------------------------------- 1 | 2 | conky -c /home/lervag/.dotfiles/conky_workspaces & 3 | conky -c /home/lervag/.dotfiles/conky_system & 4 | dropbox & 5 | dunst & 6 | xfce4-power-manager & 7 | google-chrome https://wiki.archlinux.org/index.php/Openbox & 8 | google-chrome http://openbox.org/wiki/Help:Bindings & 9 | 10 | -------------------------------------------------------------------------------- /openbox/.config/openbox/environment: -------------------------------------------------------------------------------- 1 | setxkbmap -layout no -variant nodeadkeys -model pc105 -option compose:caps 2 | -------------------------------------------------------------------------------- /openbox/.config/openbox/rc.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Clearlooks 8 | no 9 | 10 | 11 | 12 | 4 13 | 1 14 | 15 | 1 16 | 2 17 | 3 18 | 4 19 | 20 | 0 21 | 22 | 23 | 24 | yes 25 | Nonpixel 26 | Center 27 | 28 | 29 | 30 | 0 31 | 0 32 | 0 33 | 0 34 | 35 | 36 | 37 | Smart 38 |
no
39 |
40 | 41 | 42 | C-g 43 | 44 | 45 | 1 46 | 2 47 | 3 48 | 4 49 | 1 50 | 2 51 | 3 52 | 4 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | west 81 | east 82 | north 83 | south 84 | 85 | 86 | center 87 | center 88 | 89 | 90 | -10 91 | 10 92 | -10 93 | 10 94 | 95 | 96 | 97 | 98 | xfce4-screenshooter 99 | systemctl suspend 100 | 101 | 102 | volume-control -n up 103 | 104 | 105 | 106 | 107 | volume-control -n down 108 | 109 | 110 | 111 | 112 | volume-control -n mute 113 | 114 | 115 | 116 | 117 | brightness-control -n up 118 | 119 | 120 | 121 | 122 | brightness-control -n down 123 | 124 | 125 | 126 | 127 | playerctl play 128 | 129 | 130 | 131 | 132 | playerctl pause 133 | 134 | 135 | 136 | 137 | playerctl next 138 | 139 | 140 | 141 | 142 | playerctl previous 143 | 144 | 145 | 146 | 147 | xfce4-terminal 148 | gvim 149 | gvim +VimwikiMakeDiaryNote 150 | gvim +VimwikiIndex 151 | showtime.sh 152 | anki -b documents/anki 153 | google-chrome 154 | xfce4-appfinder -c --disable-server 155 | openbox --reconfigure 156 | 157 | 158 | 159 | 1 160 | 500 161 | 400 162 | false 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | no 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | yes 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | client-menu 230 | 231 | 232 | 233 | 234 | 235 | top 236 | 237 | 238 | 239 | 240 | 241 | left 242 | 243 | 244 | 245 | 246 | 247 | right 248 | 249 | 250 | 251 | 252 | 253 | bottom 254 | 255 | 256 | 257 | 258 | 259 | client-menu 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | client-menu 295 | 296 | 297 | 298 | 299 | client-menu 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | vertical 355 | 356 | 357 | horizontal 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | client-list-combined-menu 387 | 388 | 389 | root-menu 390 | 391 | 392 | 393 | 394 | 395 | 396 | yes 397 | no 398 | 399 | 400 | 401 | 402 | center 403 | center 404 | 405 | 406 | 407 | 408 | true 409 | yes 410 | 4 411 | 412 | 413 |
414 | -------------------------------------------------------------------------------- /pg_format/.pg_format: -------------------------------------------------------------------------------- 1 | keyword-case=1 2 | function-case=1 3 | -------------------------------------------------------------------------------- /python/.pylintrc: -------------------------------------------------------------------------------- 1 | [messages control] 2 | disable=invalid-name 3 | -------------------------------------------------------------------------------- /python/.pythonrc.py: -------------------------------------------------------------------------------- 1 | from rich import inspect, pretty 2 | pretty.install() 3 | -------------------------------------------------------------------------------- /screen/.screenrc: -------------------------------------------------------------------------------- 1 | # Screen setup 2 | # Karl Yngve Lervåg - 2013 3 | 4 | # No annoying audible bell, please 5 | vbell on 6 | vbell_msg "Hey - something's ringing on %t (%n)" 7 | activity "Hey - something's moving in %t(%n)" 8 | 9 | # Start with screen number 1 10 | bind c screen 1 11 | bind  screen 1 12 | bind 0 select 10 13 | screen 1 14 | 15 | # Don't display the copyright page 16 | startup_message off 17 | 18 | # Detach on hangup 19 | autodetach on 20 | 21 | # Number of lines in buffer and buffer scroll 22 | scrollback 20000 23 | termcapinfo xterm|xterms|xs|rxvt ti@:te@ 24 | 25 | # Clear screen after text editing 26 | altscreen on 27 | 28 | # If a window goes unresponsive, don't block the whole session waiting for it. 29 | nonblock on 30 | 31 | # The status line 32 | caption always '%{k} %-w%{+b w}%n %t%{-}%+w' 33 | 34 | # New keybindings 35 | bindkey -k k5 prev 36 | bindkey -k k6 next 37 | 38 | # Reduce ESC delay 39 | maptimeout 10 40 | -------------------------------------------------------------------------------- /sioyek/.config/sioyek/keys_user.config: -------------------------------------------------------------------------------- 1 | # See also /etc/sioyek/keys.config 2 | 3 | goto_beginning;goto_top_of_page gg 4 | goto_end;goto_bottom_of_page G 5 | 6 | # synctex_under_cursor A 7 | 8 | next_page;goto_top_of_page J 9 | previous_page;goto_top_of_page K 10 | 11 | move_down j 12 | move_up k 13 | 14 | #overview_definition L 15 | keyboard_overview L 16 | 17 | prev_state 18 | next_state 19 | 20 | fit_to_page_height 21 | fit_to_page_height_smart 22 | 23 | toggle_dark_mode d 24 | 25 | add_highlight H 26 | delete_highlight 27 | -------------------------------------------------------------------------------- /sioyek/.config/sioyek/prefs_user.config: -------------------------------------------------------------------------------- 1 | # See also /etc/sioyek/prefs.config 2 | 3 | dark_mode_contrast 0.7 4 | text_highlight_color 0.1 0.1 0.6 5 | search_highlight_color 0.6 0.4 0.1 6 | link_highlight_color 0.0 0.0 1.0 7 | synctex_highlight_color 0.1 0.6 0.4 8 | 9 | vertical_move_amount 3.0 10 | horizontal_move_amount 3.0 11 | #move_screen_percentage 0.5 12 | 13 | inverse_search_command nvim --headless -c "VimtexInverseSearch %2 '%1'" 14 | 15 | hover_overview 1 16 | should_warn_about_user_key_override 0 17 | super_fast_search 1 18 | 19 | shared_database_path /home/lervag/documents/aux/sioyek-shared.db 20 | -------------------------------------------------------------------------------- /ssh/.ssh/config: -------------------------------------------------------------------------------- 1 | Host drop-storage 2 | HostName 161.35.221.4 3 | 4 | Host home 5 | HostName 188.113.123.181 6 | User pi 7 | 8 | Host uio 9 | HostName login.uio.no 10 | User karlyl 11 | ControlMaster auto 12 | ControlPath ~/.ssh/ssh-2-%r@%h:%p 13 | ControlPersist yes 14 | 15 | Host soprod 16 | HostName so-prod14.uio.no 17 | User karlyl 18 | ProxyJump uio 19 | 20 | Host w3demo 21 | HostName w3demo-jb-fs01.uio.no 22 | User karlyl 23 | ProxyJump uio 24 | 25 | Host w3utv-so 26 | HostName w3utv-so03.uio.no 27 | User karlyl 28 | ProxyJump uio 29 | ServerAliveInterval 300 30 | ServerAliveCountMax 2 31 | # SODB UTV 32 | LocalForward 5433 dbpg-so-utv.uio.no:5432 33 | # SODB TEST/STAGE 34 | LocalForward 5434 dbpg-so-test.uio.no:5432 35 | 36 | Host fspatch 37 | HostName fs-patch.uio.no 38 | User karlyl 39 | ProxyJump uio 40 | ServerAliveInterval 300 41 | ServerAliveCountMax 2 42 | # FSUTV 43 | LocalForward 1527 dbora-utv03.uio.no:1527 44 | # FSSBKURS (den er vår) 45 | LocalForward 1555 dbora-utv03.uio.no:1555 46 | # FSAUTH (KID-database i utv-miljø?) 47 | LocalForward 1559 dbora-ext-utv01.uio.no:1559 48 | # FSDEMO 49 | LocalForward 1531 dbora-uio-test01.uio.no:1531 50 | # FS01DMO 51 | LocalForward 1566 dbora-fssek-test01.uio.no:1566 52 | # FS02DMO 53 | LocalForward 1568 dbora-fssek-test02.uio.no:1568 54 | 55 | Host * 56 | ServerAliveInterval 15 57 | 58 | Include config_local 59 | -------------------------------------------------------------------------------- /starship/.config/starship.toml: -------------------------------------------------------------------------------- 1 | right_format = "$custom" 2 | 3 | [battery] 4 | format = "[$symbol$percentage]($style) " 5 | discharging_symbol = "⚡️" 6 | charging_symbol = "🔌" 7 | unknown_symbol = "🔌" 8 | full_symbol = "" 9 | empty_symbol = "⚡️" 10 | 11 | [[battery.display]] 12 | threshold = 15 13 | 14 | [character] 15 | success_symbol = "[❯](bold fg:#e0dac9)" 16 | vicmd_symbol = "[▪](bold fg:#b58900)" 17 | error_symbol = "[✖](bold red)" 18 | 19 | [directory] 20 | style = "bold fg:#e0dac9" 21 | 22 | [hostname] 23 | ssh_only = false 24 | format = "@[$hostname]($style): " 25 | style = "fg:#e0dac9" 26 | 27 | [username] 28 | show_always = true 29 | format = "[$user](fg:#e0dac9)" 30 | 31 | [git_status] 32 | disabled = true 33 | 34 | [python] 35 | format = '(in [$virtualenv]($style))' 36 | 37 | [scala] 38 | disabled = true 39 | 40 | [package] 41 | disabled = true 42 | 43 | [aws] 44 | disabled = true 45 | 46 | [custom.upterm] 47 | command = 'true' 48 | when = 'test $UPTERM_ADMIN_SOCKET' 49 | description = 'Upterm indicator' 50 | format = 'upterm [ ](fg:#e0dac9)' 51 | -------------------------------------------------------------------------------- /systemd/.config/systemd/user/check-battery.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Notify on low battery 3 | 4 | [Service] 5 | ExecStart=/home/lervag/scripts/bin/check-battery.sh 6 | -------------------------------------------------------------------------------- /systemd/.config/systemd/user/check-battery.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Timer to run battery notifier 3 | 4 | [Timer] 5 | OnUnitActiveSec=5min 6 | OnBootSec=5min 7 | 8 | [Install] 9 | WantedBy=timers.target 10 | -------------------------------------------------------------------------------- /systemd/.config/systemd/user/insync.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Insync 3 | After=local-fs.target network.target 4 | 5 | [Service] 6 | Type=oneshot 7 | RemainAfterExit=yes 8 | ExecStart=/usr/bin/insync-headless start 9 | ExecStop=/usr/bin/insync-headless quit 10 | 11 | [Install] 12 | WantedBy=default.target 13 | 14 | -------------------------------------------------------------------------------- /terminfo/.terminfo/m/mostlike: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lervag/dotfiles/32c190eea08590f65f304ea656f7258983cde6fb/terminfo/.terminfo/m/mostlike -------------------------------------------------------------------------------- /terminfo/.terminfo/mostlike.txt: -------------------------------------------------------------------------------- 1 | # Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-pcolor 2 | mostlike|manpages with color looking like most, 3 | am, hs, km, mir, msgr, xenl, 4 | cols#80, it#8, lines#24, wsl#40, 5 | acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, 6 | bel=^G, bold=\E[1m\E[31m, clear=\E[H\E[2J, cr=^M, 7 | csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, 8 | cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, 9 | cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, 10 | dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, 11 | dsl=\E]0;\007, ed=\E[J, el=\E[K, enacs=\E)0, fsl=^G, 12 | home=\E[H, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L, ind=^J, 13 | is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, kbs=^H, 14 | kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, 15 | kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~, 16 | kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, 17 | kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, 18 | kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~, 19 | kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, 20 | kfnd=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, 21 | kslt=\E[4~, rc=\E8, rev=\E[7m\E[34m, ri=\EM, rmacs=^O, 22 | rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>, 23 | rmso=\E[m, rmul=\E[m, 24 | rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, sc=\E7, 25 | sgr0=\E[m, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h, 26 | smkx=\E[?1h\E=, smso=\E[1;30m\E[47m, smul=\E[32m, 27 | tbc=\E[3g, tsl=\E]0;, u6=\E[%i%d;%dR, u7=\E[6n, 28 | u8=\E[?1;2c, u9=\E[c, 29 | -------------------------------------------------------------------------------- /terminfo/.terminfo/tmux-256color-italics.ti: -------------------------------------------------------------------------------- 1 | tmux-256color-italic|tmux with 256 colors and italics, 2 | ritm=\E[23m, rmso=\E[27m, sitm=\E[3m, smso=\E[7m, kbs=\\177, 3 | use=screen-256color, 4 | -------------------------------------------------------------------------------- /tmux/.config/tmuxinator/advent.yml: -------------------------------------------------------------------------------- 1 | name: advent 2 | root: ~/workdir/advent-of-code/ 3 | 4 | on_project_start: 5 | - xdotool key --window $(xdotool getactivewindow) "super+d" 6 | 7 | windows: 8 | - dev: 9 | - nvim src/main/scala/Main.scala 10 | -------------------------------------------------------------------------------- /tmux/.config/tmuxinator/apy.yml: -------------------------------------------------------------------------------- 1 | name: apy 2 | root: ~/workdir/apy 3 | 4 | on_project_start: 5 | - xdotool windowsize --usehints $(xdotool getactivewindow) 165 100% 6 | - xdotool key --window $(xdotool getactivewindow) "super+c" 7 | 8 | on_project_exit: 9 | - xdotool windowsize --usehints $(xdotool getactivewindow) 82 100% 10 | 11 | windows: 12 | - dev: 13 | layout: even-horizontal 14 | panes: 15 | - editor: 16 | - nvim +"VimuxOpenRunner" 17 | - tests: 18 | -------------------------------------------------------------------------------- /tmux/.config/tmuxinator/journal.yml: -------------------------------------------------------------------------------- 1 | name: journal 2 | root: ~/ 3 | 4 | windows: 5 | - journal: nvim +WikiJournal 6 | -------------------------------------------------------------------------------- /tmux/.config/tmuxinator/lists.yml: -------------------------------------------------------------------------------- 1 | name: lists-dev 2 | root: ~/.local/plugged/lists.vim/ 3 | 4 | on_project_start: 5 | - xdotool windowsize --usehints $(xdotool getactivewindow) 165 100% 6 | - xdotool key --window $(xdotool getactivewindow) "super+c" 7 | 8 | on_project_exit: 9 | - xdotool windowsize --usehints $(xdotool getactivewindow) 82 100% 10 | 11 | windows: 12 | - dev: 13 | layout: even-horizontal 14 | panes: 15 | - editor: 16 | - sleep 0.1 17 | - clear 18 | - nvim +"VimuxOpenRunner" 19 | - tests: 20 | - cd test 21 | - clear 22 | -------------------------------------------------------------------------------- /tmux/.config/tmuxinator/nvim.yml: -------------------------------------------------------------------------------- 1 | name: nvim 2 | root: ~/.config/nvim/ 3 | 4 | on_project_start: 5 | - xdotool windowsize --usehints $(xdotool getactivewindow) 165 100% 6 | - xdotool key --window $(xdotool getactivewindow) "super+c" 7 | 8 | on_project_exit: 9 | - xdotool windowsize --usehints $(xdotool getactivewindow) 82 100% 10 | 11 | windows: 12 | - dev: 13 | layout: even-horizontal 14 | panes: 15 | - editor: 16 | - sleep 0.1 17 | - clear 18 | - nvim +"VimuxOpenRunner" lua/lervag/init/packages.lua 19 | - tests: 20 | - clear 21 | -------------------------------------------------------------------------------- /tmux/.config/tmuxinator/spotify.yml: -------------------------------------------------------------------------------- 1 | name: spotify 2 | root: ~/ 3 | 4 | windows: 5 | - ncspot: ncspot 6 | -------------------------------------------------------------------------------- /tmux/.config/tmuxinator/vimtex.yml: -------------------------------------------------------------------------------- 1 | name: vimtex 2 | root: ~/.local/plugged/vimtex/ 3 | 4 | on_project_start: 5 | - xdotool windowsize --usehints $(xdotool getactivewindow) 165 100% 6 | - xdotool key --window $(xdotool getactivewindow) "super+c" 7 | 8 | on_project_exit: 9 | - xdotool windowsize --usehints $(xdotool getactivewindow) 82 100% 10 | 11 | windows: 12 | - dev: 13 | layout: even-horizontal 14 | panes: 15 | - editor: 16 | - sleep 0.1 17 | - clear 18 | - nvim +"VimuxOpenRunner" 19 | - tests: 20 | - cd test 21 | - clear 22 | -------------------------------------------------------------------------------- /tmux/.config/tmuxinator/wiki.yml: -------------------------------------------------------------------------------- 1 | name: wiki-dev 2 | root: ~/.local/plugged/wiki.vim 3 | 4 | on_project_start: 5 | - xdotool windowsize --usehints $(xdotool getactivewindow) 165 100% 6 | - xdotool key --window $(xdotool getactivewindow) "super+c" 7 | 8 | on_project_exit: 9 | - xdotool windowsize --usehints $(xdotool getactivewindow) 82 100% 10 | 11 | windows: 12 | - dev: 13 | layout: even-horizontal 14 | panes: 15 | - editor: 16 | - sleep 0.1 17 | - clear 18 | - nvim +"VimuxOpenRunner" 19 | - tests: 20 | - cd test 21 | - clear 22 | -------------------------------------------------------------------------------- /tmux/.tmux.conf: -------------------------------------------------------------------------------- 1 | source-file ~/.dotfiles/tmux/cfg-options 2 | source-file ~/.dotfiles/tmux/cfg-statusline 3 | source-file ~/.dotfiles/tmux/cfg-bind-clear 4 | source-file ~/.dotfiles/tmux/cfg-bind-root 5 | source-file ~/.dotfiles/tmux/cfg-bind-prefix 6 | source-file ~/.dotfiles/tmux/cfg-bind-copy-mode 7 | -------------------------------------------------------------------------------- /tmux/cfg-bind-clear: -------------------------------------------------------------------------------- 1 | unbind -a -Tprefix 2 | unbind -a -Troot 3 | unbind -a -Tcopy-mode 4 | unbind -a -Tcopy-mode-vi 5 | -------------------------------------------------------------------------------- /tmux/cfg-bind-copy-mode: -------------------------------------------------------------------------------- 1 | bind -Tcopy-mode-vi Escape send -X cancel 2 | bind -Tcopy-mode-vi C-c send -X cancel 3 | bind -Tcopy-mode-vi q send -X cancel 4 | 5 | bind -Tcopy-mode-vi v if -F "#{selection_present}" { send -X clear-selection } { send -X begin-selection } 6 | bind -Tcopy-mode-vi V if -F "#{selection_present}" { send -X clear-selection } { send -X select-line } 7 | bind -Tcopy-mode-vi C-v send -X rectangle-toggle 8 | bind -Tcopy-mode-vi o send -X other-end 9 | bind -Tcopy-mode-vi y send -X copy-pipe-and-cancel 10 | bind -Tcopy-mode-vi Y send -X copy-pipe-no-clear 11 | 12 | bind -Tcopy-mode-vi : command-prompt -p "Go to line:" { send -X goto-line "%%" } 13 | bind -Tcopy-mode-vi / command-prompt -T search -p "Search:" { send -X search-forward "%%" } 14 | bind -Tcopy-mode-vi ? command-prompt -T search -p "Search (backward):" { send -X search-backward "%%" } 15 | bind -Tcopy-mode-vi * send -FX search-forward "#{copy_cursor_word}" 16 | bind -Tcopy-mode-vi \# send -FX search-backward "#{copy_cursor_word}" 17 | bind -Tcopy-mode-vi n send -X search-again 18 | bind -Tcopy-mode-vi N send -X search-reverse 19 | 20 | bind -Tcopy-mode-vi f command-prompt -1 -p "Jump:" { send -X jump-forward "%%" } 21 | bind -Tcopy-mode-vi F command-prompt -1 -p "Jump (backward):" { send -X jump-backward "%%" } 22 | bind -Tcopy-mode-vi t command-prompt -1 -p "Jump to:" { send -X jump-to-forward "%%" } 23 | bind -Tcopy-mode-vi T command-prompt -1 -p "Jump to (backward):" { send -X jump-to-backward "%%" } 24 | bind -Tcopy-mode-vi , send -X jump-reverse 25 | bind -Tcopy-mode-vi \; send -X jump-again 26 | 27 | bind -Tcopy-mode-vi h send -X cursor-left 28 | bind -Tcopy-mode-vi j send -X cursor-down 29 | bind -Tcopy-mode-vi k send -X cursor-up 30 | bind -Tcopy-mode-vi l send -X cursor-right 31 | bind -Tcopy-mode-vi w send -X next-word 32 | bind -Tcopy-mode-vi W send -X next-space 33 | bind -Tcopy-mode-vi e send -X next-word-end 34 | bind -Tcopy-mode-vi E send -X next-space-end 35 | bind -Tcopy-mode-vi b send -X previous-word 36 | bind -Tcopy-mode-vi B send -X previous-space 37 | bind -Tcopy-mode-vi g send -X history-top 38 | bind -Tcopy-mode-vi G send -X history-bottom 39 | bind -Tcopy-mode-vi C-b send -X page-up 40 | bind -Tcopy-mode-vi C-f send -X page-down 41 | bind -Tcopy-mode-vi 0 send -X start-of-line 42 | bind -Tcopy-mode-vi ^ send -X back-to-indentation 43 | bind -Tcopy-mode-vi \$ send -X end-of-line 44 | bind -Tcopy-mode-vi \% send -X next-matching-bracket 45 | bind -Tcopy-mode-vi \{ send -X previous-paragraph 46 | bind -Tcopy-mode-vi \} send -X next-paragraph 47 | 48 | bind -Tcopy-mode-vi H send -X top-line 49 | bind -Tcopy-mode-vi L send -X bottom-line 50 | bind -Tcopy-mode-vi M send -X middle-line 51 | bind -Tcopy-mode-vi z send -X scroll-middle 52 | 53 | bind -Tcopy-mode-vi C-h select-pane -L 54 | bind -Tcopy-mode-vi C-j select-pane -D 55 | bind -Tcopy-mode-vi C-k select-pane -U 56 | bind -Tcopy-mode-vi C-l select-pane -R 57 | 58 | bind -Tcopy-mode-vi MouseDown1Pane select-pane 59 | bind -Tcopy-mode-vi MouseDrag1Pane { select-pane ; send -X begin-selection } 60 | bind -Tcopy-mode-vi WheelUpPane { select-pane ; send -X -N 5 scroll-up } 61 | bind -Tcopy-mode-vi WheelDownPane { select-pane ; send -X -N 5 scroll-down } 62 | bind -Tcopy-mode-vi DoubleClick1Pane { select-pane ; send -X select-word } 63 | bind -Tcopy-mode-vi TripleClick1Pane { select-pane ; send -X select-line } 64 | 65 | # vim: filetype=tmux 66 | -------------------------------------------------------------------------------- /tmux/cfg-bind-prefix: -------------------------------------------------------------------------------- 1 | bind C-p send-prefix 2 | 3 | bind C-h list-keys 4 | bind c new-window 5 | bind d detach-client 6 | bind : command-prompt 7 | bind g attach -c "#{pane_current_path}" 8 | bind C-r { source-file ~/.tmux.conf ; display "Config reloaded!" } 9 | 10 | # Sjå wiki:tmux for scriptet 11 | bind C-e run _tmux-edit-scrollback 12 | 13 | bind \$ command-prompt -p "Rename session:" -I "#S" { rename-session "%%" } 14 | bind , command-prompt -p "Rename window:" -I "#W" { rename-window "%%" } 15 | 16 | bind | split-window -h -c "#{pane_current_path}" 17 | bind - split-window -v -c "#{pane_current_path}" 18 | bind ! break-pane 19 | bind @ command-prompt -p "Fetch pane from [session:]window[.pane]:" { join-pane -s "%%" } 20 | 21 | bind v copy-mode 22 | bind p { run "xclip -o | tmux load-buffer -" ; paste-buffer } 23 | 24 | bind C-q if "test #{window_panes} -eq 1" last-window last-pane 25 | bind n select-pane -t :.+ 26 | bind \{ swap-pane -U 27 | bind \} swap-pane -D 28 | bind z resize-pane -Z 29 | bind F2 resize-pane -x 82 30 | 31 | bind C-l if "test #{session_windows} -eq 1" last-pane last-window 32 | bind N next-window 33 | bind 0 select-window -t :=0 34 | bind 1 select-window -t :=1 35 | bind 2 select-window -t :=2 36 | bind 3 select-window -t :=3 37 | bind 4 select-window -t :=4 38 | bind 5 select-window -t :=5 39 | bind 6 select-window -t :=6 40 | bind 7 select-window -t :=7 41 | bind 8 select-window -t :=8 42 | bind 9 select-window -t :=9 43 | 44 | bind Space next-layout 45 | 46 | bind ( switch-client -p 47 | bind ) switch-client -n 48 | 49 | # vim: filetype=tmux 50 | -------------------------------------------------------------------------------- /tmux/cfg-bind-root: -------------------------------------------------------------------------------- 1 | # Handle some special keycodes 2 | # See also ~/.Xresources 3 | bind -n C-S-Space send "\e[32;6u" 4 | bind -n C-6 send "\e[54;5u" 5 | 6 | # Smart pane switching with awareness of Vim splits. 7 | # https://github.com/christoomey/vim-tmux-navigator 8 | %hidden CONTEXT="ps -o state= -o comm= -t '#{pane_tty}' | grep -qE '^[^TXZ ]+ (vd|fzf|n?vim?)'" 9 | bind -n C-h if $CONTEXT { send C-h } { select-pane -L } 10 | bind -n C-l if $CONTEXT { send C-l } { select-pane -R } 11 | bind -n C-j if $CONTEXT { send C-j } { select-pane -D } 12 | bind -n C-k if $CONTEXT { send C-k } { select-pane -U } 13 | 14 | bind -n MouseDrag1Border resize-pane -M 15 | bind -n MouseDown2Pane if -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send -M } { run "xclip -o | tmux load-buffer -" ; paste-buffer } 16 | bind -n MouseDrag1Pane if -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send -M } { copy-mode } 17 | bind -n WheelUpPane if -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send -M } { copy-mode -e } 18 | bind -n DoubleClick1Pane select-pane -t = \; if -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send -M } { copy-mode ; send -X select-word } 19 | bind -n TripleClick1Pane select-pane -t = \; if -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send -M } { copy-mode ; send -X select-line } 20 | 21 | %hidden SHELL_CONTEXT="ps -o state= -o comm= -t '#{pane_tty}' | tail -n 1 | grep -q '^S zsh'" 22 | bind -n S-Up if $SHELL_CONTEXT { 23 | copy-mode 24 | send -X -N 2 search-backward "^lervag@.*:" 25 | send -X cursor-down 26 | send -X cursor-right 27 | send -X stop-selection 28 | } { send S-Up } 29 | 30 | bind -n S-Down if $SHELL_CONTEXT { 31 | copy-mode 32 | send -X search-forward "^lervag@.*:" 33 | send -X cursor-down 34 | send -X cursor-right 35 | send -X stop-selection 36 | } { send S-Down } 37 | 38 | # vim: filetype=tmux 39 | -------------------------------------------------------------------------------- /tmux/cfg-options: -------------------------------------------------------------------------------- 1 | set -g prefix C-q 2 | set -g history-limit 50000 3 | set -g base-index 1 4 | set -g pane-base-index 1 5 | set -g status-keys vi 6 | set -g focus-events on 7 | set -g set-clipboard on 8 | set -g escape-time 10 9 | set -g mode-keys vi 10 | set -g main-pane-width 82 11 | set -g mouse on 12 | set -g default-terminal "tmux-256color" 13 | set -g copy-command "xclip -f -sel p | xclip -sel c" 14 | set -ga terminal-overrides ",rxvt-256color:Tc" 15 | set -ga terminal-overrides ',rxvt-256color:sitm=\E[3m' 16 | set -ga terminal-overrides ",xterm-256color:Tc" 17 | set -ga terminal-overrides ',xterm-256color:sitm=\E[3m' 18 | 19 | # vim: filetype=tmux 20 | -------------------------------------------------------------------------------- /tmux/cfg-statusline: -------------------------------------------------------------------------------- 1 | set -g status-left " " 2 | set -g status-right "#[fg=colour15] #S " 3 | set -g status-right-length 40 4 | set -g status-style "fg=colour14,bg=colour00" 5 | set -g message-style "fg=colour15,bg=colour00" 6 | set -g pane-border-style "fg=colour12" 7 | set -g pane-active-border-style "fg=colour12" 8 | set -g window-status-current-style "fg=colour15" 9 | 10 | # vim: filetype=tmux 11 | -------------------------------------------------------------------------------- /tridactyl/.config/tridactyl/tridactylrc: -------------------------------------------------------------------------------- 1 | set theme dark 2 | 3 | set configversion 2.0 4 | 5 | blacklistadd https://mail.google.com 6 | blacklistadd https://outlook.office.com 7 | blacklistadd https://feedly.com 8 | blacklistadd https://unit.atlassian.net 9 | 10 | seturl ^https://teams.microsoft.com superignore true 11 | 12 | unbind --mode=insert 13 | 14 | unbind 15 | bind --mode=browser tab # 16 | 17 | unbind 18 | bind / fillcmdline find 19 | bind ? fillcmdline find -? 20 | 21 | bind n findnext 1 22 | bind N findnext -1 23 | 24 | bind yt tabduplicate 25 | bind yT tabdetach 26 | 27 | bind ,r source 28 | 29 | " vim: set filetype=tridactyl 30 | -------------------------------------------------------------------------------- /vcs/.cvsignore: -------------------------------------------------------------------------------- 1 | .hg 2 | .hgignore 3 | .git 4 | .gitignore 5 | objects 6 | plot_on_runtime 7 | bin 8 | supertest* 9 | *.pyc 10 | *.tec 11 | *.dat 12 | *.inp 13 | -------------------------------------------------------------------------------- /vcs/.cvsrc: -------------------------------------------------------------------------------- 1 | cvs -q 2 | diff -u 3 | -------------------------------------------------------------------------------- /vcs/.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Karl Yngve Lervåg 3 | email = karl.yngve+git@gmail.com 4 | 5 | [init] 6 | defaultBranch = main 7 | 8 | [core] 9 | pager = delta 10 | excludesfile = ~/.gitignore 11 | quotepath = off 12 | 13 | [branch] 14 | sort = -committerdate 15 | 16 | [delta] 17 | file-style = bold yellow 18 | file-decoration-style = bold yellow ul 19 | hunk-header-style = bold blue 20 | hunk-header-decoration-style = omit 21 | syntax-theme = Solarized (dark) 22 | 23 | [color] 24 | ui = auto 25 | branch = auto 26 | diff = auto 27 | interactive = auto 28 | status = auto 29 | 30 | [color "status"] 31 | added = green 32 | changed = yellow bold 33 | untracked = red bold 34 | 35 | [commit] 36 | verbose = true 37 | 38 | [log] 39 | date = iso 40 | 41 | [diff] 42 | algorithm = histogram 43 | indentHeuristic = true 44 | colorMoved = default 45 | 46 | [difftool] 47 | prompt = false 48 | 49 | [merge] 50 | tool = mydiff 51 | conflictStyle = zdiff3 52 | log = true 53 | ff = false 54 | 55 | [mergetool] 56 | keepBackup = false 57 | prompt = false 58 | 59 | [mergetool "mydiff"] 60 | cmd = echo "NO! Please use this instead: git mt" && exit 1 61 | trustExitCode = true 62 | 63 | [push] 64 | default = current 65 | autoSetupRemote = true 66 | followtags = true 67 | 68 | [pull] 69 | ff = only 70 | 71 | [grep] 72 | extendedRegexp = true 73 | 74 | [rerere] 75 | enabled = true 76 | autoUpdate = true 77 | 78 | [fetch] 79 | prune = true 80 | prunetags = true 81 | 82 | [alias] 83 | mt = "!nvim +DiffviewOpen +tabonly +'let g:mergemode=1'" 84 | ci = commit 85 | co = checkout 86 | st = status 87 | lg = log --decorate --graph --date=short --format=format:'%Cblue%h%Creset %Cgreen%ad (%ar)%C(bold yellow)%d%Creset%n %C(white)%s%Creset%n %an' 88 | lga = log --all --decorate --graph --date=short --format=format:'%Cblue%h%Creset %Cgreen%ad (%ar)%C(bold yellow)%d%Creset%n %C(white)%s%Creset%n %an' 89 | changelog = log --first-parent --decorate --date=short --format=format:'%C(bold white)%s %Cblue%h%C(yellow)%d%Creset%n%b' 90 | list-local-branches = "!git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}'" 91 | rv-st = "!git diff --stat $(git merge-base HEAD \"${REVIEW_BASE:-master}\")" 92 | rv-all = "!git rv-one $(git rv-files)" 93 | rv-files = "!git diff --name-only $(git merge-base HEAD \"${REVIEW_BASE:-master}\")" 94 | rv-one = "!$EDITOR -p +\"tabdo silent Gdiffsplit ${REVIEW_BASE:-master} | wincmd H\" +WinResize" 95 | 96 | [include] 97 | path = .gitconfig-local 98 | 99 | [includeIf "hasconfig:remote.*.url:git@gitlab.sikt.no:*/**"] 100 | path = .gitconfig-sikt 101 | 102 | [includeIf "hasconfig:remote.*.url:git@bitbucket.org:unit-norge-team/**"] 103 | path = .gitconfig-sikt 104 | 105 | [includeIf "hasconfig:remote.*.url:git@github.com:sun-opsys/**"] 106 | path = .gitconfig-sikt 107 | 108 | [includeIf "hasconfig:remote.*.url:git@github.uio.no:*/**"] 109 | path = .gitconfig-usit 110 | -------------------------------------------------------------------------------- /vcs/.gitconfig-sikt: -------------------------------------------------------------------------------- 1 | [user] 2 | email = karl.yngve.lervag@sikt.no 3 | 4 | ; vim: ft=gitconfig 5 | -------------------------------------------------------------------------------- /vcs/.gitconfig-usit: -------------------------------------------------------------------------------- 1 | [user] 2 | email = karl.yngve.lervag@sikt.no 3 | signingkey = 3788D158E5C9D014 4 | 5 | [commit] 6 | gpgsign = true 7 | 8 | ; vim: ft=gitconfig 9 | -------------------------------------------------------------------------------- /vcs/.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | .tags 3 | .pytest_cache 4 | .omnipytent* 5 | .envrc 6 | .tool-versions 7 | .luarc.json 8 | .tmuxinator.yml 9 | .tmuxinator.yaml 10 | .git 11 | -------------------------------------------------------------------------------- /vcs/.hgk: -------------------------------------------------------------------------------- 1 | set mainfont {Helvetica 9} 2 | set curidfont {Helvetica 9 bold italic underline} 3 | set textfont {Courier 9} 4 | set findmergefiles 0 5 | set gaudydiff 0 6 | set maxgraphpct 50 7 | set maxwidth 16 8 | set geometry(width) 935 9 | set geometry(height) 888 10 | set geometry(canv1) 450 11 | set geometry(canv2) 300 12 | set geometry(canv3) 156 13 | set geometry(canvh) 404 14 | set geometry(ctextw) 76 15 | set geometry(cflistw) 43 16 | # 17 | # authorcolors format: 18 | # 19 | # zero or more sublists of 20 | # 21 | # { regex color } 22 | # 23 | # followed by a list of colors 24 | # 25 | # If the commit author matches a regex in a sublist, 26 | # the commit will be colored by that color 27 | # otherwise the next unused entry from the list of colors 28 | # will be assigned to this commit and also all other commits 29 | # of the same author. When the list of colors is exhausted, 30 | # the last entry will be reused. 31 | # 32 | set authorcolors { 33 | black blue deeppink mediumorchid blue burlywood4 goldenrod slateblue red2 navy dimgrey 34 | } 35 | # 36 | # The background color in the text windows 37 | set bgcolor white 38 | # 39 | # The text color used in the diff and file list view 40 | set fgcolor black 41 | # 42 | # Color to display + lines in diffs 43 | set diffaddcolor #00a000 44 | # 45 | # Color to display - lines in diffs 46 | set diffremcolor red 47 | # 48 | # Merge diffs: Color to signal lines from first parent 49 | set diffmerge1color red 50 | # 51 | # Merge diffs: Color to signal lines from second parent 52 | set diffmerge2color blue 53 | # 54 | # Hunkseparator (@@ -lineno,lines +lineno,lines @@) color 55 | set hunksepcolor blue 56 | -------------------------------------------------------------------------------- /vcs/.hgrc: -------------------------------------------------------------------------------- 1 | [ui] 2 | username = Karl Yngve Lervåg 3 | ssh = ssh -C 4 | commitsubrepos = False 5 | fallbackencoding = utf-8 6 | 7 | [extensions] 8 | extdiff = 9 | pager = 10 | color = 11 | hgk = 12 | progress = 13 | rebase = 14 | transplant = 15 | record = 16 | bookmarks = 17 | shelve = 18 | histedit = 19 | hgext.convert = 20 | churn = 21 | strip = 22 | 23 | [pager] 24 | pager = LESS='FSRX' less 25 | attend = annotate, cat, diff, export, lg, log, qdiff, in, out, shelve 26 | 27 | [progress] 28 | delay = 1.0 29 | 30 | [hgk] 31 | path=~/scripts/bin/hgk 32 | 33 | [color] 34 | status.modified = cyan 35 | status.added = green 36 | status.removed = red 37 | status.deleted = yellow bold underline 38 | status.unknown = magenta bold underline 39 | status.ignored = black bold 40 | status.clean = black bold 41 | diff.diffline = none 42 | diff.extended = cyan 43 | diff.file_a = red 44 | diff.file_b = green 45 | diff.hunk = yellow bold 46 | diff.deleted = red 47 | diff.inserted = green 48 | diff.changed = white 49 | diff.trailingwhitespace = white_background 50 | desc.here = bold blue_background 51 | log.branch = cyan 52 | log.node = blue 53 | log.summary = white 54 | log.date = green 55 | log.description = white 56 | log.tag = blue 57 | log.bookmark = green 58 | log.activebookmark = green bold underline 59 | 60 | [merge-tools] 61 | vim.executable = $EDITOR 62 | vim.args = -f -d "$local" "$output" "$other" +MergeMode 63 | vim.premerge = keep-merge3 64 | vim.priority = 1 65 | 66 | [diff] 67 | git = True 68 | 69 | [hostsecurity] 70 | bitbucket.org:fingerprints=sha256:32:12:90:9a:70:64:82:1c:5b:52:cc:c3:0a:d0:79:db:e1:a8:62:1b:9a:9a:4c:f4:72:40:1c:a7:3a:d3:0a:8c 71 | 72 | [alias] 73 | show = log --color=always --stat -r 74 | lg = log -G --style compact 75 | inout = summary --remote 76 | ? = summary 77 | blame = annotate --user -c 78 | tickets = !trac-ticket 79 | 80 | %include ~/.hgrc.local 81 | -------------------------------------------------------------------------------- /vcs/.mrconfig: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | jobs = 4 3 | 4 | [scripts] 5 | checkout = git clone 'git@github.com:lervag/scripts.git' 'scripts' 6 | 7 | [.dotfiles] 8 | checkout = git clone 'git@github.com:lervag/dotfiles.git' '.dotfiles' 9 | 10 | [.config/nvim] 11 | checkout = git clone 'git@github.com:lervag/dotnvim.git' '.config/nvim' 12 | skip = lazy 13 | 14 | [.local/plugged/vimtex] 15 | checkout = git clone 'git@github.com:lervag/vimtex' 'vimtex' 16 | skip = lazy 17 | 18 | [.local/plugged/wiki.vim] 19 | checkout = git clone 'git@github.com:lervag/wiki.vim' 'wiki.vim' 20 | skip = lazy 21 | 22 | [.local/plugged/wiki-ft.vim] 23 | checkout = git clone 'git@github.com:lervag/wiki-ft.vim' 'wiki-ft.vim' 24 | skip = lazy 25 | 26 | [.local/plugged/vim-sintef] 27 | checkout = git clone 'git@github.com:lervag/vim-sintef' 'sintef' 28 | skip = lazy 29 | 30 | [.password-store] 31 | checkout = git clone 'git@github.com:lervag/pass' '.password-store' 32 | skip = lazy 33 | -------------------------------------------------------------------------------- /vcs/.stow-local-ignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lervag/dotfiles/32c190eea08590f65f304ea656f7258983cde6fb/vcs/.stow-local-ignore -------------------------------------------------------------------------------- /vim/.vim/autoload/personal.vim: -------------------------------------------------------------------------------- 1 | " 2 | " Various personal stuff 3 | " 4 | 5 | function! personal#print_file(fname) 6 | let l:pdf = a:fname . '.pdf' 7 | call system(printf('ps2pdf %s %s', a:fname, l:pdf)) 8 | 9 | echohl ModeMsg 10 | let l:reply = input('View file before printing [y/N]? ') 11 | echohl None 12 | echon "\n" 13 | if l:reply =~# '^y' 14 | call system('mupdf ' . l:pdf) 15 | endif 16 | 17 | echohl ModeMsg 18 | let l:reply = input('Save file to $HOME [Y/n]? ') 19 | echohl None 20 | echon "\n" 21 | if empty(l:reply) || l:reply =~# '^n' 22 | call system(printf('cp %s ~/vim-hardcopy.pdf', l:pdf)) 23 | endif 24 | 25 | echohl ModeMsg 26 | let l:reply = input('Send file to printer [y/N]? ') 27 | echohl None 28 | echon "\n" 29 | if l:reply =~# '^y' 30 | call system('lp ' . l:pdf) 31 | let l:error = v:shell_error 32 | else 33 | let l:error = 1 34 | endif 35 | 36 | call delete(a:fname) 37 | call delete(l:pdf) 38 | return l:error 39 | endfunction 40 | -------------------------------------------------------------------------------- /vim/.vim/autoload/personal/fold.vim: -------------------------------------------------------------------------------- 1 | function! personal#fold#foldtext() abort " {{{1 2 | let level = repeat('-', min([v:foldlevel-1,3])) . '+' 3 | let title = substitute(getline(v:foldstart), '{\{3}\d\?\s*', '', '') 4 | let title = substitute(title, '^["#! ]\+', '', '') 5 | return printf('%-4s %-s', level, title) 6 | endfunction 7 | 8 | " }}}1 9 | -------------------------------------------------------------------------------- /vim/.vim/autoload/personal/init.vim: -------------------------------------------------------------------------------- 1 | function! personal#init#cursor() abort " {{{1 2 | " Set terminal cursor 3 | if exists('$TMUX') 4 | let &t_SI = "\Ptmux;\\e[6 q\\e]12;3\x7\\\" 5 | let &t_EI = "\Ptmux;\\e[2 q\\e]12;14\x7\\\" 6 | else 7 | let &t_SI = "\e[6 q\e]12;3\x7" 8 | let &t_EI = "\e[2 q\e]12;14\x7" 9 | silent !echo -ne "\e[2 q\e]12;14\x7" 10 | autocmd vimrc_autocommands VimLeave * 11 | \ silent !echo -ne "\e[2 q\e]112\x7" 12 | endif 13 | 14 | " Set gui cursor 15 | set guicursor=a:block 16 | set guicursor+=n:Cursor 17 | set guicursor+=o-c:iCursor 18 | set guicursor+=v:vCursor 19 | set guicursor+=i-ci-sm:ver30-iCursor 20 | set guicursor+=r-cr:hor20-rCursor 21 | set guicursor+=a:blinkon0 22 | endfunction 23 | 24 | " }}}1 25 | function! personal#init#statusline() abort " {{{1 26 | augroup statusline 27 | autocmd! 28 | autocmd VimEnter,WinEnter,BufWinEnter * call personal#statusline#refresh() 29 | autocmd FileType,VimResized * call personal#statusline#refresh() 30 | autocmd BufHidden,BufWinLeave,BufUnload * call personal#statusline#refresh() 31 | augroup END 32 | endfunction 33 | 34 | " }}}1 35 | 36 | function! personal#init#go_to_last_known_position() abort " {{{1 37 | if line("'\"") <= 0 || line("'\"") > line('$') 38 | return 39 | endif 40 | 41 | normal! g`" 42 | if &foldlevel == 0 43 | normal! zMzvzz 44 | endif 45 | endfunction 46 | 47 | " }}}1 48 | function! personal#init#toggle_diff() abort " {{{1 49 | if v:option_new 50 | set nocursorline 51 | else 52 | set cursorline 53 | endif 54 | endfunction 55 | 56 | " }}}1 57 | -------------------------------------------------------------------------------- /vim/.vim/autoload/personal/qf.vim: -------------------------------------------------------------------------------- 1 | function! personal#qf#adjust_height() abort " {{{1 2 | execute max([2, min([line('$') + 1, &lines/2])]) . 'wincmd _' 3 | endfunction 4 | 5 | " }}}1 6 | function! personal#qf#delete_line(...) abort " {{{1 7 | if a:0 == 1 && type(a:1) == type('') 8 | " called from g@ 9 | let [l1, l2] = [line("'["), line("']")] 10 | elseif a:0 == 2 11 | " called from cmdline 12 | let [l1, l2] = [a:1, a:2] 13 | else 14 | echom 'Argument error (kickfix#QDeleteLine)' 15 | return 16 | endif 17 | 18 | let curline = line('.') 19 | 20 | if personal#qf#is_loc() 21 | let l:oldqf = getloclist(0) 22 | else 23 | let l:oldqf = getqflist() 24 | endif 25 | 26 | let nqf = copy(l:oldqf) 27 | call remove(nqf, l1 - 1, l2 - 1) 28 | 29 | if personal#qf#is_loc() 30 | call setloclist(0, nqf, 'r') 31 | else 32 | call setqflist(nqf, 'r') 33 | endif 34 | 35 | call cursor(curline, 0) 36 | endfunction 37 | 38 | " }}}1 39 | function! personal#qf#filter(include) abort " {{{1 40 | let l:rx = input(a:include ? 'Filter (include): ' : 'Filter (remove): ') 41 | let l:oldqf = getqflist({'all': 1}) 42 | 43 | let l:new = [] 44 | for l:entry in l:oldqf.items 45 | let l:string = bufname(l:entry.bufnr) . ' | ' . l:entry.text 46 | if (a:include && match(l:string, l:rx) >= 0) 47 | \ || (!a:include && match(l:string, l:rx) < 0) 48 | call add(l:new, copy(l:entry)) 49 | endif 50 | endfor 51 | 52 | call setqflist(l:new, 'r') 53 | call setqflist([], 'r', {'title': l:oldqf.title}) 54 | endfunction 55 | 56 | " }}}1 57 | function! personal#qf#older() abort " {{{1 58 | return s:history(0) 59 | endfunction 60 | 61 | " }}}1 62 | function! personal#qf#newer() abort " {{{1 63 | return s:history(1) 64 | endfunction 65 | 66 | " }}}1 67 | function! personal#qf#is_loc(...) abort " {{{1 68 | let l:winnr = a:0 > 0 ? a:1 : winnr() 69 | let l:wininfo = filter(getwininfo(), {i,v -> v.winnr == l:winnr})[0] 70 | return l:wininfo.loclist 71 | endfunction 72 | 73 | " }}}1isLast 74 | function! personal#qf#get_prop(cfg) abort " {{{1 75 | let l:cfg = extend({ 76 | \ 'winnr': winnr(), 77 | \ 'val': 0, 78 | \}, a:cfg) 79 | 80 | let l:what = {l:cfg.key : l:cfg.val} 81 | 82 | let l:listdict = personal#qf#is_loc(l:cfg.winnr) 83 | \ ? getloclist(l:cfg.winnr, l:what) : getqflist(l:what) 84 | return get(l:listdict, l:cfg.key) 85 | endfunction 86 | 87 | " }}}1 88 | function! personal#qf#length(...) abort " {{{1 89 | let l:winnr = a:0 > 0 ? a:1 : winnr() 90 | 91 | if empty(getqflist({'size':0})) 92 | return len(personal#qf#is_loc(l:winnr) ? getloclist(l:winnr) : getqflist()) 93 | else 94 | return personal#qf#get_prop({'winnr': l:winnr, 'key': 'size'}) 95 | endif 96 | endfunction 97 | 98 | " }}}1 99 | 100 | function! s:history(forward) abort " {{{1 101 | let l:cmd = (personal#qf#is_loc() ? 'l' : 'c') 102 | \ . (a:forward ? 'newer' : 'older') 103 | 104 | while 1 105 | if (a:forward && s:is_last()) || (!a:forward && s:is_first()) | break | endif 106 | silent execute cmd 107 | if personal#qf#length() | break | endif 108 | endwhile 109 | 110 | call personal#qf#adjust_height() 111 | endfunction 112 | 113 | " }}}1 114 | function! s:is_first() abort " {{{1 115 | return personal#qf#get_prop('nr') <= 1 116 | endfunction 117 | 118 | " }}}1 119 | function! s:is_last() abort " {{{1 120 | return personal#qf#get_prop('nr') == personal#qf#get_prop('nr', '$') 121 | endfunction 122 | 123 | " }}}1 124 | -------------------------------------------------------------------------------- /vim/.vim/autoload/personal/statusline.vim: -------------------------------------------------------------------------------- 1 | " Statusline functions 2 | " 3 | " Inspiration: 4 | " - https://github.com/blaenk/dots/blob/master/vim/.vimrc 5 | " - http://www.blaenkdenum.com/posts/a-simpler-vim-statusline/ 6 | 7 | function! personal#statusline#refresh() " {{{1 8 | for nr in range(1, winnr('$')) 9 | if !s:ignored(nr) 10 | call setwinvar(nr, '&statusline', '%!personal#statusline#main(' . nr . ')') 11 | endif 12 | endfor 13 | endfunction 14 | 15 | "}}}1 16 | function! personal#statusline#main(winnr) " {{{1 17 | let l:winnr = winbufnr(a:winnr) == -1 ? 1 : a:winnr 18 | let l:active = l:winnr == winnr() 19 | let l:bufnr = winbufnr(l:winnr) 20 | let l:buftype = getbufvar(l:bufnr, '&buftype') 21 | let l:filetype = getbufvar(l:bufnr, '&filetype') 22 | 23 | try 24 | return s:bt_{l:buftype}(l:bufnr, l:active, l:winnr) 25 | catch /E117: Unknown function/ 26 | endtry 27 | 28 | return s:main(l:bufnr, l:active, l:winnr) 29 | endfunction 30 | 31 | " }}}1 32 | 33 | function! s:main(bufnr, active, winnr) " {{{1 34 | let stat = s:color(' %<%f', 'SLHighlight', a:active) 35 | let stat .= getbufvar(a:bufnr, '&modifiable') 36 | \ ? '' : s:color(' [Locked]', 'SLAlert', a:active) 37 | let stat .= getbufvar(a:bufnr, '&readonly') 38 | \ ? s:color(' [‼]', 'SLAlert', a:active) : '' 39 | let stat .= getbufvar(a:bufnr, '&modified') 40 | \ ? s:color(' [+]', 'SLAlert', a:active) : '' 41 | 42 | " Change to right-hand side 43 | let stat .= '%=' 44 | 45 | " Previewwindows don't need more details 46 | if getwinvar(a:winnr, '&previewwindow') 47 | let stat .= s:color(' [preview]', 'SLAlert', a:active) . ' ' 48 | return stat 49 | endif 50 | 51 | " Add column number if above textwidth 52 | let cn = virtcol('$') - 1 53 | if &textwidth > 0 && cn > &textwidth 54 | let stat .= s:color( 55 | \ printf('[%s > %s &tw] ', cn, &textwidth), 'SLAlert', a:active) 56 | endif 57 | 58 | return s:color( ' VIM', 'SLAlert', a:active) . stat 59 | endfunction 60 | 61 | " }}}1 62 | 63 | " Buffer type functions 64 | function! s:bt_help(bufnr, active, winnr) " {{{1 65 | return s:color( 66 | \ ' vimdoc: ' . fnamemodify(bufname(a:bufnr), ':t:r'), 67 | \ 'SLInfo', a:active) 68 | endfunction 69 | 70 | " }}}1 71 | function! s:bt_quickfix(bufnr, active, winnr) " {{{1 72 | let l:nr = personal#qf#get_prop({ 73 | \ 'winnr': a:winnr, 74 | \ 'key': 'nr', 75 | \}) 76 | let l:last = personal#qf#get_prop({ 77 | \ 'winnr': a:winnr, 78 | \ 'key': 'nr', 79 | \ 'val': '$', 80 | \}) 81 | 82 | let text = ' [' 83 | let text .= personal#qf#is_loc(a:winnr) ? 'Loclist' : 'Quickfix' 84 | if l:last > 1 85 | let text .= ' ' . l:nr . '/' . l:last 86 | endif 87 | 88 | let text .= '] (' . personal#qf#length(a:winnr) . ') ' 89 | 90 | let text .= personal#qf#get_prop({ 91 | \ 'winnr': a:winnr, 92 | \ 'key': 'title', 93 | \}) 94 | let stat = s:color(text, 'SLHighlight', a:active) 95 | 96 | return stat 97 | endfunction 98 | 99 | " }}}1 100 | 101 | " Utilities 102 | function! s:color(content, group, active) " {{{1 103 | if a:active 104 | return '%#' . a:group . '#' . a:content . '%*' 105 | else 106 | return a:content 107 | endif 108 | endfunction 109 | 110 | " }}}1 111 | function! s:ignored(winnr) " {{{1 112 | let l:name = bufname(winbufnr(a:winnr)) 113 | 114 | if l:name =~# '^\%(undotree\|diffpanel\)' 115 | return 1 116 | endif 117 | 118 | return 0 119 | endfunction 120 | 121 | " }}}1 122 | -------------------------------------------------------------------------------- /vim/.vim/autoload/vimrc.vim: -------------------------------------------------------------------------------- 1 | " 2 | " Vimrc helper functions 3 | " 4 | 5 | function! vimrc#init() abort " {{{1 6 | " Use space as leader key 7 | nnoremap 8 | let g:mapleader = "\" 9 | 10 | " Set vim-plug settings 11 | " - Set this here because they might be needed before the vimrc file 12 | " is fully parsed 13 | let g:plug_window = 'new|wincmd o' 14 | nnoremap pd :PlugDiff 15 | nnoremap pi :PlugInstall 16 | nnoremap pu :PlugUpdate 17 | nnoremap ps :PlugStatus 18 | nnoremap pc :PlugClean 19 | 20 | " Add personal files to runtimepath 21 | let &runtimepath = vimrc#path('personal') . ',' . &runtimepath 22 | let &runtimepath .= ',' . vimrc#path('personal/after') 23 | 24 | " Get some system information and define some paths/urls 25 | let g:vimrc#bootstrap = !filereadable(vimrc#path('autoload/plug.vim')) 26 | let g:vimrc#is_devhost = index([ 27 | \ 'lotti', 28 | \ 'allegri', 29 | \ 'vsl142', 30 | \ 'unity.sintef.no', 31 | \], hostname()) >= 0 32 | 33 | let g:vimrc#path_bundles = '~/.vim/bundle' 34 | let g:vimrc#path_lervag = g:vimrc#is_devhost 35 | \ ? 'git@github.com:lervag/' 36 | \ : 'lervag/' 37 | 38 | " If plug.vim is not available, then we source the init script and install 39 | " plugins 40 | if g:vimrc#bootstrap 41 | execute 'silent !source' vimrc#path('init.sh') 42 | 43 | " vint: -ProhibitAutocmdWithNoGroup 44 | autocmd VimEnter * nested PlugInstall --sync | source $MYVIMRC 45 | " vint: +ProhibitAutocmdWithNoGroup 46 | endif 47 | endfunction 48 | 49 | " }}}1 50 | function! vimrc#path(name) abort " {{{1 51 | return s:path . '/' . a:name 52 | endfunction 53 | 54 | " }}}1 55 | 56 | let s:path = fnamemodify(expand(''), ':p:h:h') 57 | -------------------------------------------------------------------------------- /vim/.vim/plugin/open-in-browser.vim: -------------------------------------------------------------------------------- 1 | if exists('g:loaded_openinbrowser') && g:loaded_openinbrowser 2 | finish 3 | endif 4 | let g:loaded_openinbrowser = 1 5 | let s:save_cpo = &cpo 6 | set cpo&vim 7 | 8 | function! OpenInBrowser() 9 | let url = expand('') 10 | 11 | " Remove surrounding delimiters 12 | let url = substitute(url, '^[''"\[({<]\+\(.\{-}\)[''",.\])}>]\+$', '\1', '') 13 | 14 | " Parse bundle urls 15 | if url =~# '^[a-zA-Z][a-zA-Z0-9_.-]*\/[a-zA-Z][a-zA-Z0-9_.-]*$' 16 | let url = 'https://github.com/' . url 17 | endif 18 | 19 | " Check if url is valid 20 | if url =~# '\(\(https\?\|ftp\|git\)://\)\?' 21 | \ . '[a-zA-Z0-9][a-zA-Z0-9_-]*' 22 | \ . '\(\.[a-zA-Z0-9][a-zA-Z0-9_-]*\)\+\(:\d\+\)\?' 23 | \ . '\(/[a-zA-Z0-9_/.+%#?&=;@$,!''*~-]*\)\?' 24 | silent execute '!xdg-open ' . shellescape(url,1) . '&' 25 | endif 26 | endfunction 27 | 28 | nnoremap gx :call OpenInBrowser() 29 | 30 | let &cpo = s:save_cpo 31 | -------------------------------------------------------------------------------- /vim/.vim/plugin/windows.vim: -------------------------------------------------------------------------------- 1 | if exists('g:windows_loaded') 2 | finish 3 | endif 4 | let g:windows_loaded = 1 5 | 6 | let s:save_cpoptions = &cpoptions 7 | set cpoptions&vim 8 | 9 | " Commands 10 | command! WinOnly 11 | \ call s:remove_all_but_current() 12 | command! WinResize 13 | \ call s:resize_windows() 14 | command! -bang -complete=buffer -nargs=? WinBufDelete 15 | \ call s:buf_delete(, ) 16 | 17 | " Mappings 18 | nnoremap :WinOnly 19 | nnoremap :WinBufDelete 20 | nnoremap q :WinResize 21 | 22 | " Main functions 23 | function! s:remove_all_but_current() " {{{1 24 | silent! wincmd o 25 | 26 | for bfr in getbufinfo() 27 | if bfr.hidden && !bfr.changed 28 | execute 'bwipeout' bfr.bufnr 29 | endif 30 | endfor 31 | endfunction 32 | 33 | " }}}1 34 | function! s:resize_windows() " {{{1 35 | let l:width = s:get_target_width() 36 | if l:width == &columns | return | endif 37 | 38 | if has('gui') || empty($TMUX . $STY) 39 | let &columns = l:width 40 | else 41 | let l:winid = systemlist('xdotool getactivewindow')[0] 42 | call system(printf('xdotool windowsize --usehints %s %d %d', 43 | \ l:winid, l:width, &lines+1)) 44 | sleep 50m 45 | endif 46 | 47 | wincmd = 48 | redraw! 49 | endfunction 50 | 51 | " }}}1 52 | function! s:buf_delete(bang, buffer_name) " {{{1 53 | let buffer = s:str2bufnr(a:buffer_name) 54 | let w:bdelete_back = 1 55 | 56 | if buffer < 0 57 | echoerr 'E516: No buffers were deleted. No match for' a:buffer_name 58 | endif 59 | 60 | if getbufvar(buffer, '&modified') && empty(a:bang) 61 | echoerr 'E89: No write since last change for buffer' buffer 62 | \ '(add ! to override)' 63 | endif 64 | 65 | " If the buffer is set to delete and it contains changes, we can't switch 66 | " away from it. Hide it before eventual deleting: 67 | if getbufvar(buffer, '&modified') && !empty(a:bang) 68 | call setbufvar(buffer, '&bufhidden', 'hide') 69 | endif 70 | 71 | " For cases where adding buffers causes new windows to appear or hiding some 72 | " causes windows to disappear and thereby decrement, loop backwards. 73 | for window in reverse(range(1, winnr('$'))) 74 | " For invalid window numbers, winbufnr returns -1. 75 | if winbufnr(window) != buffer | continue | endif 76 | execute window . 'wincmd w' 77 | 78 | " bprevious also wraps around the buffer list, if necessary: 79 | try 80 | execute bufnr('#') > 0 && buflisted(bufnr('#')) 81 | \ ? 'buffer #' 82 | \ : 'bprevious' 83 | catch /^Vim([^)]*):E85:/ 84 | " E85: There is no listed buffer 85 | endtry 86 | 87 | " If no new buffer, then create new empty buffer 88 | if bufnr('%') == buffer 89 | call s:new(a:bang) 90 | endif 91 | endfor 92 | 93 | " Because tabbars and other appearing/disappearing windows change 94 | " the window numbers, find where we were manually: 95 | let back = filter(range(1, winnr('$')), "getwinvar(v:val, 'bdelete_back')")[0] 96 | if back | execute back . 'wincmd w' | unlet w:bdelete_back | endif 97 | 98 | " If it hasn't been already deleted by &bufhidden, end its pains now. 99 | " Unless it previously was an unnamed buffer and :enew returned it again. 100 | if bufexists(buffer) && buffer != bufnr('%') 101 | try 102 | execute 'bdelete' . a:bang . ' ' . buffer 103 | catch /E516/ 104 | " E516: No buffers were deleted. No match for buffer 105 | endtry 106 | endif 107 | endfunction 108 | 109 | " }}}1 110 | 111 | " Utility functions 112 | function! s:get_target_width() " {{{1 113 | let l:heights = map(filter(split(winrestcmd(), '|'), 114 | \ {_, x -> x =~# '^:\?\d'}), 115 | \ {_, x -> matchstr(x, '\d\+$')}) 116 | 117 | let l:total_height = 0 118 | for l:h in l:heights 119 | let l:total_height += l:h 120 | endfor 121 | 122 | let l:count = float2nr(ceil(l:total_height/(1.0*&lines))) 123 | return l:count*82 + l:count - 1 124 | endfunction 125 | 126 | " }}}1 127 | function! s:str2bufnr(buffer) " {{{1 128 | if empty(a:buffer) 129 | return bufnr('%') 130 | elseif a:buffer =~# '^\d\+$' 131 | return bufnr(str2nr(a:buffer)) 132 | else 133 | return bufnr(a:buffer) 134 | endif 135 | endfunction 136 | 137 | " }}}1 138 | function! s:new(bang) " {{{1 139 | execute 'enew' . a:bang 140 | 141 | setlocal noswapfile 142 | 143 | " If empty and out of sight, delete it right away: 144 | setlocal bufhidden=wipe 145 | 146 | " Regular buftype warns people if they have unsaved text there. Wouldn't 147 | " want to lose someone's data: 148 | setlocal buftype= 149 | 150 | " Hide the buffer from buffer explorers and tabbars: 151 | setlocal nobuflisted 152 | endfunction 153 | 154 | " }}}1 155 | function! s:has_sign_cols() " {{{1 156 | return len(split(execute('sign place'), "\n")) > 1 157 | endfunction 158 | 159 | " }}}1 160 | 161 | let &cpoptions = s:save_cpoptions 162 | -------------------------------------------------------------------------------- /vim/.vim/vimrc: -------------------------------------------------------------------------------- 1 | " Use space as leader key 2 | nnoremap 3 | let g:mapleader = "\" 4 | 5 | " Add personal files to runtimepath 6 | set runtimepath^=~/.vim/personal 7 | 8 | " {{{1 Autocommands 9 | 10 | augroup vimrc_autocommands 11 | autocmd! 12 | 13 | " Only use cursorline for current window, except when in diff mode 14 | autocmd WinEnter,FocusGained * if !&diff | setlocal cursorline | endif 15 | autocmd WinLeave,FocusLost * if !&diff | setlocal nocursorline | endif 16 | autocmd OptionSet diff call personal#init#toggle_diff() 17 | 18 | " When editing a file, always jump to the last known cursor position. 19 | autocmd BufReadPost * call personal#init#go_to_last_known_position() 20 | 21 | " Set keymapping for command window 22 | autocmd CmdwinEnter * nnoremap q 23 | autocmd CmdwinEnter * nnoremap 24 | augroup END 25 | 26 | " {{{1 Options 27 | 28 | set history=10000 29 | set nrformats-=octal 30 | if has('patch-7.4.399') 31 | set cryptmethod=blowfish2 32 | else 33 | set cryptmethod=blowfish 34 | endif 35 | set autoread 36 | set backspace=indent,eol,start 37 | set wildmenu 38 | set laststatus=2 39 | set autoindent 40 | set incsearch 41 | set viminfo='300,<100,s300,h 42 | 43 | " Basic 44 | set tags=tags;~,.tags;~ 45 | set path=.,, 46 | if &modifiable 47 | set fileformat=unix 48 | endif 49 | set wildignore=*.o 50 | set wildignore+=*~ 51 | set wildignore+=*.pyc 52 | set wildignore+=.git/* 53 | set wildignore+=.hg/* 54 | set wildignore+=.svn/* 55 | set wildignore+=*.DS_Store 56 | set wildignore+=CVS/* 57 | set wildignore+=*.mod 58 | set diffopt=filler,vertical,foldcolumn:0,context:4 59 | silent! set diffopt+=indent-heuristic,algorithm:patience 60 | silent! set diffopt+=hiddenoff 61 | 62 | " Backup, swap and undofile 63 | set noswapfile 64 | set undofile 65 | set undodir=$HOME/.cache/vim/undo 66 | set backup 67 | set backupdir=$HOME/.cache/vim/backup 68 | if !isdirectory(&undodir) 69 | call mkdir(&undodir, 'p') 70 | endif 71 | if !isdirectory(&backupdir) 72 | call mkdir(&backupdir, 'p') 73 | endif 74 | 75 | " Behaviour 76 | set autochdir 77 | set lazyredraw 78 | set confirm 79 | set hidden 80 | set shortmess=aoOtT 81 | silent! set shortmess+=cI 82 | set textwidth=79 83 | set nowrap 84 | set linebreak 85 | set comments=n:> 86 | set nojoinspaces 87 | set formatoptions+=ronl1j 88 | set formatlistpat=^\\s*[-*]\\s\\+ 89 | set formatlistpat+=\\\|^\\s*(\\(\\d\\+\\\|[a-z]\\))\\s\\+ 90 | set formatlistpat+=\\\|^\\s*\\(\\d\\+\\\|[a-z]\\)[:).]\\s\\+ 91 | set winaltkeys=no 92 | set mouse= 93 | set gdefault 94 | set updatetime=500 95 | 96 | " Completion 97 | set wildmode=longest:full,full 98 | set wildcharm= 99 | set complete+=U,s,k,kspell,] 100 | set completeopt=menuone 101 | silent! set completeopt+=noinsert,noselect 102 | silent! set pumwidth=35 103 | 104 | " Presentation 105 | set list 106 | set listchars=tab:▸\ ,nbsp:␣,trail:\ ,extends:…,precedes:… 107 | set fillchars=vert:│,fold:\ ,diff:⣿ 108 | set matchtime=2 109 | set matchpairs+=<:> 110 | if !&diff 111 | set cursorline 112 | endif 113 | set scrolloff=5 114 | set splitbelow 115 | set splitright 116 | set previewheight=20 117 | set noshowmode 118 | 119 | if !has('gui_running') 120 | set visualbell 121 | set t_vb= 122 | endif 123 | 124 | " Folding 125 | set foldlevelstart=0 126 | set foldcolumn=0 127 | set foldtext=personal#fold#foldtext() 128 | 129 | " Indentation 130 | set softtabstop=-1 131 | set shiftwidth=2 132 | set expandtab 133 | set copyindent 134 | set preserveindent 135 | silent! set breakindent 136 | 137 | " Searching and movement 138 | set nostartofline 139 | set ignorecase 140 | set smartcase 141 | set infercase 142 | set showmatch 143 | set tagcase=match 144 | 145 | set display=lastline 146 | set virtualedit=block 147 | 148 | if executable('ag') 149 | set grepprg=ag\ --nogroup\ --nocolor 150 | elseif executable('ack-grep') 151 | set grepprg=ack-grep\ --nocolor 152 | endif 153 | 154 | " Printing 155 | set printexpr=personal#print_file(v:fname_in) 156 | 157 | " {{{1 Appearance and UI 158 | 159 | set winwidth=70 160 | if has('termguicolors') 161 | set termguicolors 162 | endif 163 | silent! colorscheme my_solarized 164 | 165 | call personal#init#cursor() 166 | call personal#init#statusline() 167 | 168 | " {{{1 Mappings 169 | 170 | " Disable some mappings 171 | noremap 172 | inoremap 173 | nnoremap Q 174 | 175 | " Some general/standard remappings 176 | inoremap jk 177 | nnoremap Y y$ 178 | nnoremap J mzJ`z 179 | nnoremap dp dp]c 180 | nnoremap do do]c 181 | nnoremap ' ` 182 | nnoremap 183 | nnoremap 184 | nnoremap j v:count ? 'j' : 'gj' 185 | nnoremap k v:count ? 'k' : 'gk' 186 | xnoremap j v:count ? 'j' : 'gj' 187 | xnoremap k v:count ? 'k' : 'gk' 188 | nnoremap gV `[V`] 189 | 190 | nnoremap - s 191 | nnoremap v 192 | 193 | " Buffer navigation 194 | nnoremap gb :bnext 195 | nnoremap gB :bprevious 196 | 197 | " Navigate folds 198 | nnoremap zv zMzvzz 199 | nnoremap zj zcjzOzz 200 | nnoremap zk zckzOzz 201 | 202 | " Backspace and return for improved navigation 203 | nnoremap zvzz 204 | 205 | " Shortcuts for some files 206 | nnoremap ev :execute 'edit' resolve($MYVIMRC) 207 | nnoremap xv :source $MYVIMRC 208 | nnoremap ez :edit ~/.zshrc 209 | 210 | nnoremap pp :hardcopy 211 | xnoremap pp :hardcopy 212 | 213 | " Terminal mappings 214 | tnoremap 215 | nnoremap :terminal 216 | 217 | " Utility maps for repeatable quickly change/delete current word 218 | nnoremap c* *``cgn 219 | nnoremap c# *``cgN 220 | nnoremap cg* g*``cgn 221 | nnoremap cg# g*``cgN 222 | nnoremap d* *``dgn 223 | nnoremap d# *``dgN 224 | nnoremap dg* g*``dgn 225 | nnoremap dg# g*``dgN 226 | 227 | " {{{1 Configure plugins 228 | 229 | filetype plugin indent on 230 | syntax enable 231 | 232 | " Disable a lot of unnecessary internal plugins 233 | let g:loaded_2html_plugin = 1 234 | let g:loaded_getscriptPlugin = 1 235 | let g:loaded_gzip = 1 236 | let g:loaded_logipat = 1 237 | let g:loaded_rrhelper = 1 238 | let g:loaded_spellfile_plugin = 1 239 | let g:loaded_tarPlugin = 1 240 | let g:loaded_vimballPlugin = 1 241 | let g:loaded_zipPlugin = 1 242 | 243 | " }}}1 244 | -------------------------------------------------------------------------------- /wezterm/.config/wezterm/.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", 3 | "Lua.runtime.version": "Lua 5.4", 4 | "workspace.checkThirdParty": false 5 | } 6 | -------------------------------------------------------------------------------- /wezterm/.config/wezterm/.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 80 2 | indent_type = "Spaces" 3 | indent_width = 2 4 | quote_style = "AutoPreferDouble" 5 | call_parentheses = "None" 6 | -------------------------------------------------------------------------------- /wezterm/.config/wezterm/wezterm.lua: -------------------------------------------------------------------------------- 1 | -- Referanser 2 | -- * ~/.local/wiki/wezterm.wiki 3 | -- * https://wezfurlong.org/wezterm/config/lua/config/index.html 4 | 5 | local wezterm = require "wezterm" 6 | local config = wezterm.config_builder() 7 | 8 | config.hide_tab_bar_if_only_one_tab = true 9 | config.font = wezterm.font "JuliaMono" 10 | config.font_size = 13.5 11 | config.initial_rows = 46 12 | config.initial_cols = 82 13 | config.window_padding = { 14 | left = 0, 15 | right = 0, 16 | top = 0, 17 | bottom = 0, 18 | } 19 | config.use_resize_increments = true 20 | config.max_fps = 120 21 | 22 | config.keys = { 23 | { 24 | key = "-", 25 | mods = "SUPER", 26 | action = wezterm.action.DisableDefaultAssignment, 27 | }, 28 | { 29 | key = "-", 30 | mods = "SHIFT|CTRL", 31 | action = wezterm.action.DisableDefaultAssignment, 32 | }, 33 | { 34 | key = "_", 35 | mods = "CTRL", 36 | action = wezterm.action.DisableDefaultAssignment, 37 | }, 38 | { 39 | key = "_", 40 | mods = "SHIFT|CTRL", 41 | action = wezterm.action.DisableDefaultAssignment, 42 | }, 43 | } 44 | 45 | config.colors = { 46 | foreground = "#839496", 47 | background = "#002b36", 48 | 49 | selection_fg = "#002b36", 50 | selection_bg = "#839496", 51 | 52 | cursor_fg = "#002b36", 53 | cursor_border = "#839496", 54 | cursor_bg = "#839496", 55 | 56 | ansi = { 57 | "#073642", 58 | "#dc322f", 59 | "#859900", 60 | "#b58900", 61 | "#268bd2", 62 | "#d33682", 63 | "#2aa198", 64 | "#eee8d5", 65 | }, 66 | brights = { 67 | "#002b36", 68 | "#cb4b16", 69 | "#586e75", 70 | "#657b83", 71 | "#839496", 72 | "#6c71c4", 73 | "#93a1a1", 74 | "#fdf6e3", 75 | }, 76 | } 77 | 78 | return config 79 | -------------------------------------------------------------------------------- /xfce/.config/xfce4/terminal/terminalrc: -------------------------------------------------------------------------------- 1 | [Configuration] 2 | BackgroundDarkness=1.000000 3 | BindingBackspace=TERMINAL_ERASE_BINDING_ASCII_DELETE 4 | ColorForeground=#FDFDF6F6E3E3 5 | ColorBackground=#00002B2B3636 6 | ColorCursor=#9393a1a1a1a1 7 | ColorPalette=#070736364242;#dcdc32322f2f;#858599990000;#b5b589890000;#26268ae0d2d2;#d3d336368282;#22aaaa119988;#58586e6e7575;#00002b2b3636;#cbcb4b4b1616;#2a2aa1a19898;#65657bfb8383;#838394949696;#6c6c7171c4c4;#9393a1a1a1a1;#fdfdf6f6e3e3 8 | FontName=Inconsolata-g Medium 10 9 | MiscAlwaysShowTabs=FALSE 10 | MiscBell=FALSE 11 | MiscBordersDefault=FALSE 12 | MiscCursorBlinks=FALSE 13 | MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK 14 | MiscDefaultGeometry=80x24 15 | MiscInheritGeometry=FALSE 16 | MiscMenubarDefault=FALSE 17 | MiscMouseAutohide=FALSE 18 | MiscToolbarDefault=FALSE 19 | MiscConfirmClose=TRUE 20 | MiscCycleTabs=TRUE 21 | MiscTabCloseButtons=TRUE 22 | MiscTabCloseMiddleClick=TRUE 23 | MiscTabPosition=GTK_POS_TOP 24 | MiscHighlightUrls=TRUE 25 | ScrollingBar=TERMINAL_SCROLLBAR_NONE 26 | ScrollingLines=100000 27 | ShortcutsNoMenukey=TRUE 28 | ShortcutsNoMnemonics=TRUE 29 | TitleMode=TERMINAL_TITLE_REPLACE 30 | ScrollingOnOutput=FALSE 31 | 32 | -------------------------------------------------------------------------------- /xfce/.gmrunrc: -------------------------------------------------------------------------------- 1 | Terminal = xfce4-terminal 2 | TermExec = ${Terminal} -e 3 | AlwaysInTerm = ssh vi vim man 4 | 5 | -------------------------------------------------------------------------------- /xfce/.terminalrc: -------------------------------------------------------------------------------- 1 | [Configuration] 2 | ColorCursor=#9393a1a1a1a1 3 | ColorForeground=#FDFDF6F6E3E3 4 | ColorBackground=#00002B2B3636 5 | ColorPalette1=#070736364242 6 | ColorPalette2=#dcdc32322f2f 7 | ColorPalette3=#858599990000 8 | ColorPalette4=#b5b589890000 9 | ColorPalette5=#26268ae0d2d2 10 | ColorPalette6=#d3d336368282 11 | ColorPalette7=#22aaaa119988 12 | ColorPalette8=#58586e6e7575 13 | ColorPalette9=#00002b2b3636 14 | ColorPalette10=#cbcb4b4b1616 15 | ColorPalette11=#2a2aa1a19898 16 | ColorPalette12=#65657bfb8383 17 | ColorPalette13=#838394949696 18 | ColorPalette14=#6c6c7171c4c4 19 | ColorPalette15=#9393a1a1a1a1 20 | ColorPalette16=#fdfdf6f6e3e3 21 | Term=xterm-color 22 | MiscAlwaysShowTabs=FALSE 23 | MiscBell=FALSE 24 | MiscBordersDefault=TRUE 25 | MiscCursorBlinks=FALSE 26 | MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK 27 | MiscDefaultGeometry=80x24 28 | MiscInheritGeometry=FALSE 29 | MiscMenubarDefault=FALSE 30 | MiscMouseAutohide=FALSE 31 | MiscToolbarsDefault=FALSE 32 | MiscConfirmClose=TRUE 33 | MiscCycleTabs=TRUE 34 | MiscTabCloseButtons=TRUE 35 | MiscTabCloseMiddleClick=TRUE 36 | MiscTabPosition=GTK_POS_TOP 37 | MiscHighlightUrls=TRUE 38 | TitleMode=TERMINAL_TITLE_REPLACE 39 | ScrollingBar=TERMINAL_SCROLLBAR_NONE 40 | ScrollingLines=100000 41 | BackgroundDarkness=1.000000 42 | FontName=Inconsolata-dz for Powerline Medium 9 43 | ShortcutsNoMenukey=TRUE 44 | ShortcutsNoMnemonics=TRUE 45 | AccelFullscreen= 46 | AccelSelectAll= 47 | AccelNewTab= 48 | AccelNewWindow= 49 | AccelDetachTab= 50 | AccelCloseWindow= 51 | AccelCloseTab= 52 | AccelContents= 53 | BindingBackspace=TERMINAL_ERASE_BINDING_ASCII_DELETE 54 | 55 | -------------------------------------------------------------------------------- /zathura/.config/zathura/zathurarc: -------------------------------------------------------------------------------- 1 | # Settings 2 | set guioptions '' 3 | set statusbar-v-padding 0 4 | set statusbar-h-padding 20 5 | set window-title-basename true 6 | set incremental-search false 7 | set synctex true 8 | set selection-notification false 9 | set sandbox none 10 | set vertical-center true 11 | 12 | # Colors 13 | set inputbar-bg "#fdf6e3" 14 | set inputbar-fg "#657b83" 15 | set statusbar-bg "#fdf6e3" 16 | set statusbar-fg "#657b83" 17 | set completion-bg "#fdf6e3" 18 | set completion-fg "#657b83" 19 | set index-fg "#657b83" 20 | set index-bg "#fdf6e3" 21 | set index-active-fg "#657b83" 22 | set highlight-active-color "#008800" 23 | set highlight-color "#007777" 24 | set highlight-transparency 0.15 25 | set completion-highlight-fg "#fdf6e3" 26 | set completion-highlight-bg "#657b83" 27 | set notification-bg "#fdf6e3" 28 | set notification-fg "#657b83" 29 | set notification-error-bg "#fdf6e3" 30 | set notification-error-fg "#657b83" 31 | set notification-warning-bg "#fdf6e3" 32 | set notification-warning-fg "#657b83" 33 | 34 | # Define normal mappings 35 | # map j scroll half-down 36 | # map k scroll half-up 37 | 38 | # Define mappings for fullscreen 39 | map [fullscreen] a adjust_window best-fit 40 | map [fullscreen] s adjust_window width 41 | map [fullscreen] f follow 42 | map [fullscreen] d toggle_page_mode 2 43 | map [fullscreen] toggle_index 44 | # map [fullscreen] j scroll half-down 45 | # map [fullscreen] k scroll half-up 46 | map [fullscreen] jumplist backward 47 | map [fullscreen] jumplist forward 48 | 49 | # Other 50 | map [index] q toggle_index 51 | -------------------------------------------------------------------------------- /zsh/.stow-local-ignore: -------------------------------------------------------------------------------- 1 | zsh-completions 2 | zsh-functions 3 | zsh-syntax-highlighting 4 | -------------------------------------------------------------------------------- /zsh/.zshenv: -------------------------------------------------------------------------------- 1 | export PATH=$PATH:/usr/local/bin 2 | -------------------------------------------------------------------------------- /zsh/.zshrc: -------------------------------------------------------------------------------- 1 | [ "$already_sourced" ] && return 0 2 | already_sourced=1 3 | 4 | # For profiling: 5 | # zmodload zsh/zprof # first 6 | # zprof > "$HOME/prof_$(date +%H_%M_%S).log" # put on last line 7 | 8 | #{{{1 Set environmental variables 9 | 10 | source $HOME/.profile 11 | 12 | export HISTFILE="$HOME/.zsh_history" 13 | export HISTSIZE=200000 14 | export KEYBOARD_HACK=\' 15 | 16 | # Ruby 17 | if [ -d ~/.gem/ruby ]; then 18 | local ruby 19 | for ruby in $(ls -d ~/.gem/ruby/* 2>/dev/null); do 20 | export PATH=$PATH:$ruby/bin 21 | done 22 | fi 23 | 24 | # Other 25 | eval `dircolors -b $HOME/.dircolors.ansi-dark` 26 | 27 | #{{{1 Aliases 28 | 29 | # General aliases 30 | alias rm="rm -v" 31 | alias mv="mv -i" 32 | alias cp="cp -i" 33 | alias du="du -c" 34 | alias l='ls' 35 | alias ls='ls --color=auto --group-directories-first' 36 | alias ll='ls -lh' 37 | alias ..='cd ..' 38 | alias ...='cd ../..' 39 | alias ....='cd ../../..' 40 | alias cd..='cd ..' 41 | alias anki='anki -b documents/anki' 42 | alias mupdf='mupdf -r 100' 43 | alias mux='tmuxinator' 44 | alias make='make --no-print-directory' 45 | alias xx='atool -x' 46 | alias diff='diff -W $(( $(tput cols) - 2 ))' 47 | alias sdiff='sdiff -w $(( $(tput cols) - 2 ))' 48 | 49 | if command -v nvim &>/dev/null; then 50 | export MANPAGER="nvim +Man!" 51 | else 52 | alias man="TERMINFO=~/.terminfo/ LESS=c TERM=mostlike PAGER=less man" 53 | fi 54 | 55 | # Extension based commands 56 | alias -s gz='tar -xzvf' 57 | alias -s tgz='tar -xzvf' 58 | alias -s bz2='tar -xjvf' 59 | alias -s txt=gvim 60 | alias -s tex=gvim 61 | alias -s pdf=zathura 62 | alias -s png=feh 63 | alias -s jpg=feh 64 | 65 | #{{{1 Utility functions 66 | 67 | take() { 68 | mkdir -p $@ && cd ${@:$#} 69 | } 70 | 71 | info() { 72 | nvim -c "Info "$@"" -c "wincmd o" 73 | } 74 | 75 | h() { 76 | history -n -i $* 1 | grep $(date +%F) | less 77 | } 78 | 79 | mount() { 80 | if [ "$1" = "" ]; then 81 | =findmnt -D 82 | else 83 | =mount $* 84 | fi 85 | } 86 | 87 | z() { 88 | pdf=$(fd -t f -e pdf . ~/.local/zotero | fzf -m -d '/' --with-nth=-1) 89 | if [ -f "$pdf" ]; then 90 | echo ${pdf#*zotero/storage/} 91 | zathura $pdf & 92 | fi 93 | } 94 | 95 | 96 | #{{{1 Options 97 | 98 | # Load some custom zsh functions, e.g. for completion 99 | fpath=($HOME/.local/zsh-functions $fpath) 100 | fpath=($DOTFILES/zsh/zsh-functions $fpath) 101 | fpath=($DOTFILES/zsh/zsh-completions/src $fpath) 102 | 103 | # Set default file permissions 104 | umask 022 105 | 106 | # Set stack size limit 107 | ulimit -s unlimited 108 | 109 | # Turn on/off some zsh options 110 | setopt always_to_end 111 | setopt auto_cd 112 | setopt auto_list 113 | setopt auto_pushd 114 | setopt auto_param_slash 115 | setopt auto_param_keys 116 | setopt bang_hist 117 | setopt clobber 118 | setopt complete_aliases 119 | setopt complete_in_word 120 | setopt extended_glob 121 | setopt glob_complete 122 | setopt extended_history 123 | setopt hist_expire_dups_first 124 | setopt hist_ignore_dups 125 | setopt hist_ignore_space 126 | setopt hist_reduce_blanks 127 | setopt interactive_comments 128 | setopt list_rows_first 129 | setopt long_list_jobs 130 | setopt no_case_glob 131 | setopt no_nomatch 132 | setopt nohup 133 | setopt notify 134 | setopt pushd_ignore_dups 135 | setopt pushd_to_home 136 | 137 | # Behave more like bash 138 | setopt magic_equal_subst 139 | setopt ksh_typeset 140 | 141 | # Autoload zsh modules when they are referenced 142 | zmodload zsh/stat 143 | zmodload zsh/mathfunc 144 | zmodload zsh/complist 145 | 146 | # Load completion module; ensure zcompdump is only flushed once a day 147 | autoload -Uz compinit 148 | if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then 149 | compinit 150 | touch ~/.zcompdump 151 | else 152 | compinit -C 153 | fi 154 | 155 | # Add plugins and stuff 156 | autoload -U zmv 157 | autoload -U zsh/terminfo 158 | autoload -U colors 159 | colors 160 | 161 | #{{{1 Completion styles 162 | 163 | # Set some commands to use other command completions 164 | compdef nman=man 165 | 166 | # General settings 167 | zstyle ':completion:*' use-cache on 168 | zstyle ':completion:*' cache-path ~/.zsh/cache 169 | zstyle ':completion:*' verbose yes 170 | zstyle ':completion:*' menu select=10 171 | zstyle ':completion:*' use-compctl false 172 | zstyle ':completion:*' squeeze-slashes true 173 | zstyle ':completion:*' special-dirs true 174 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 175 | zstyle ':completion:*' group-name '' 176 | zstyle ':completion:*' file-sort modification 177 | zstyle ':completion:*' auto-description 'specify: %d' 178 | zstyle ':completion:*' list-prompt \ 179 | '%SAt %p, %l: Hit TAB for more or anything else to continue.%s' 180 | zstyle ':completion:*:commands' rehash 1 181 | zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==02=01}:${(s.:.)LS_COLORS}")' 182 | 183 | # Define completers 184 | zstyle ':completion:*' completer _complete _match _approximate 185 | zstyle ':completion:*:match:*' original only 186 | zstyle -e ':completion:*:approximate:*' max-errors \ 187 | 'reply=$((($#PREFIX+$#SUFFIX)/2))' 188 | zstyle ':completion:*' matcher-list '' '+m:{a-z-}={A-Z_}' \ 189 | 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' 190 | 191 | # Change some formats 192 | zstyle ':completion:*:descriptions' format '%B%d%b' 193 | zstyle ':completion:*:messages' format '%d' 194 | zstyle ':completion:*:warnings' format 'No matches for: %B%d%b' 195 | zstyle ':completion:*:corrections' format '%d %B(errors: %e)%b' 196 | 197 | # Set tag order for subscripts 198 | zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters 199 | 200 | # Options for kill and other programs that uses the processes tag 201 | zstyle ':completion:*:processes' insert-ids single 202 | zstyle ':completion:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' 203 | zstyle ':completion:*:processes' command 'ps -Hu lervag -o pid,user,cmd' 204 | 205 | # Options for tecplot 206 | zstyle ':completion:*:*:tec360:*' file-sort time 207 | zstyle ':completion:*:*:tec360:*' file-patterns \ 208 | '*.{lay,plt,tec}::data\ files' \ 209 | '%p::other\ files' 210 | 211 | # Options for manuals 212 | zstyle ':completion:*:manuals' separate-sections true 213 | zstyle ':completion:*:manuals.*' insert-sections true 214 | 215 | # Some control of make completion 216 | zstyle ':completion:*:*:make:*' list-rows-first 217 | zstyle ':completion:*:*:make:*:variables' hidden all 218 | zstyle ':completion:*:*:make:*:targets' ignored-patterns '*.o' 219 | 220 | # Don't complete unavailable commands. 221 | zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))' 222 | 223 | # Define users and hosts for completion 224 | local _users _myhosts 225 | _users=(root $(ls $HOME/..)) 226 | _myhosts=(localhost) 227 | if [ -r ~/.ssh/known_hosts ]; then 228 | _myhosts=("$_myhosts[@]" 229 | ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*} 230 | ) 231 | fi 232 | if [ -r ~/.ssh/config ]; then 233 | _myhosts=("$_myhosts[@]" 234 | ${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*} 235 | ) 236 | fi 237 | zstyle ':completion:*:*:*' users $_users 238 | zstyle ':completion:*:*:*' hosts $_myhosts 239 | 240 | #{{{1 Set up vi mode and cursor 241 | 242 | bindkey -v 243 | 244 | export KEYTIMEOUT=15 245 | insertmode () { 246 | print -n '\e]12;#cccccc\a' 247 | print -n '\e[6 q' 248 | } 249 | normalmode () { 250 | print -n '\e]12;#b58900\a' 251 | print -n '\e[2 q' 252 | } 253 | 254 | # Update cursor when changing vi mode 255 | if [[ ! "$TERM" =~ 'linux' ]]; then 256 | function zle-line-init zle-keymap-select { 257 | case $KEYMAP in 258 | (vicmd) normalmode;; 259 | (viins|main) insertmode;; 260 | esac 261 | } 262 | zle -N zle-line-init 263 | zle -N zle-keymap-select 264 | fi 265 | 266 | #{{{1 Add some keybindings 267 | 268 | # Insert mode 269 | bindkey -r "\e" 270 | bindkey ' ' magic-space 271 | bindkey "^R" history-incremental-pattern-search-backward 272 | bindkey "^T" history-incremental-pattern-search-forward 273 | bindkey "^U" backward-kill-line 274 | bindkey "^K" kill-line 275 | bindkey "^F" vi-forward-char 276 | bindkey "^B" vi-backward-char 277 | bindkey "^A" beginning-of-line 278 | bindkey "^O" accept-line-and-down-history 279 | bindkey "^P" accept-and-hold 280 | bindkey "^W" end-of-line 281 | bindkey "^E" expand-word 282 | bindkey "^_" undo 283 | bindkey "jk" vi-cmd-mode 284 | bindkey "^?" backward-delete-char # Backspace 285 | bindkey "^X^X" execute-named-cmd 286 | bindkey "^X^W" where-is 287 | bindkey "^X^H" _complete_help 288 | bindkey "\eq" push-line-or-edit 289 | bindkey "\eOH" beginning-of-line # Home 290 | bindkey "\eOF" end-of-line # End 291 | bindkey "\e[5~" beginning-of-history # PageUp 292 | bindkey "\e[6~" end-of-history # PageDown 293 | bindkey "\e[2~" beginning-of-line # Ins 294 | bindkey "\e[3~" delete-char # Del 295 | bindkey "\e." insert-last-word # Alt+. 296 | bindkey "\e," copy-prev-shell-word # Alt+, 297 | 298 | # Normal mode 299 | bindkey -a "k" up-line-or-search 300 | bindkey -a "j" down-line-or-search 301 | 302 | # Handle some special keys 303 | # See also .Xresources for urxvt keysyms 304 | bindkey "\e[32;2u" magic-space 305 | bindkey "\e[32;5u" magic-space 306 | bindkey "\e[32;6u" magic-space 307 | bindkey "\e[Z" reverse-menu-complete 308 | bindkey "\e[9;5u" fzf-completion 309 | bindkey "\e[9;6u" reverse-menu-complete 310 | bindkey "\e[13;2u" accept-line 311 | bindkey "\e[13;5u" accept-line 312 | bindkey "\e[13;6u" accept-line 313 | 314 | # Edit line with vim 315 | autoload edit-command-line 316 | zle -N edit-command-line 317 | bindkey -M vicmd v edit-command-line 318 | 319 | # Paste from clipboard 320 | paste-from-clipboard () { LBUFFER=$LBUFFER$(xsel -o -p /dev/null; then 327 | eval "$(starship init zsh)" 328 | else 329 | function gray { echo "%{$fg[gray]%}$*%{$terminfo[sgr0]%}" } 330 | function magenta { echo "%{$fg[yellow]%}$*%{$terminfo[sgr0]%}" } 331 | function cyan { echo "%{$fg[cyan]%}$*%{$terminfo[sgr0]%}" } 332 | function green { echo "%{$fg[green]%}$*%{$terminfo[sgr0]%}" } 333 | PS1="$(magenta %n)$(gray @)$(magenta %m)$(gray :) $(cyan $l%~)$(green '❯') " 334 | fi 335 | 336 | #{{{1 Load system-specific settings 337 | 338 | sysfiles=( 339 | $DOTFILES/bash/common-functions.sh 340 | $HOME/.zshrc.local 341 | "/usr/share/fzf/key-bindings.zsh" 342 | "/usr/share/fzf/completion.zsh" 343 | $HOME/.dotfiles/fzf/fzf-history-widget.zsh 344 | ) 345 | 346 | for file in $sysfiles[@]; do 347 | [ -r $file ] && source $file 348 | done 349 | 350 | #}}}1 351 | 352 | # Welcome message for login shells 353 | if [[ $SHLVL -le 2 && -z "$TMUX" ]] ; then 354 | ls-sessions 355 | fi 356 | 357 | # vim: fdm=marker 358 | -------------------------------------------------------------------------------- /zsh/zsh-functions/_insync: -------------------------------------------------------------------------------- 1 | #compdef insync insync-headless 2 | 3 | if [[ $CURRENT == 2 ]] 4 | then 5 | _values 'commands' \ 6 | 'accept_all_new_shares[Accept all new shares file to given account]' \ 7 | 'accept_share[Accept shared file to given account]' \ 8 | 'add_account[Add account to Insync]' \ 9 | 'force_sync[Force sync item]' \ 10 | 'get_account_information[Show information for connected acounts]' \ 11 | 'get_actions_required[Show required actions]' \ 12 | 'get_domain_link[Get domain link for file]' \ 13 | 'get_errors[Show error messages]' \ 14 | 'get_file_status[Get syncing status of file]' \ 15 | 'get_link[Get link for file, anyone can access]' \ 16 | 'get_new_shares[Show new shares]' \ 17 | 'get_proxy[Show proxy configuration]' \ 18 | 'get_recent_changes[20 most recent changes]' \ 19 | 'get_root_drive_files[Get selective sync information for root Drive files and folders of account]' \ 20 | 'get_status[Show syncing status]' \ 21 | 'get_sync_progress[Show progress of files being downloaded/uploaded]' \ 22 | 'manage_ignore_list[Manage ignore list of account through a curses interface]' \ 23 | 'manage_selective_sync[Manage selective sync settings of account]' \ 24 | 'move_folder[Move folder to a new path]' \ 25 | 'open_in_gdrive[Open selected file in Google Drive web interface]' \ 26 | 'pause_syncing[Pause syncing]' \ 27 | 'quit[Quit]' \ 28 | 'reject_all_new_shares[Reject all new shares to given account]' \ 29 | 'reject_share[Reject shared file to given account]' \ 30 | 'remove_account[Remove account from Insync]' \ 31 | 'remove_from_insync[Remove linked file/folder from Insync]' \ 32 | 'resume_syncing[Resume syncing]' \ 33 | 'retry_errors[Retry all errors]' \ 34 | 'set_autostart[Set autostart preference (yes/no)]' \ 35 | 'set_export_option[Download Google Docs files as docs or links]' \ 36 | 'set_proxy[Set proxy config]' \ 37 | 'set_selective_sync[Set selective sync preference (yes/no) of file for given email]' \ 38 | 'share[Share selected file using Insync web interface]' \ 39 | 'start[Start Insync]' 40 | return 41 | fi 42 | 43 | # we are completing the second or a subsequent argument. 44 | 45 | local insync='insync' 46 | 47 | which $insync > /dev/null || insync='insync-headless' 48 | which $insync > /dev/null || insync='insync-portable' 49 | 50 | if ! which $insync > /dev/null 51 | then 52 | # Provide some kind of (possibly useless) default. 53 | _path_files 54 | return 55 | fi 56 | 57 | __insync_get_all_emails () 58 | { 59 | local -a accounts 60 | accounts=( $( $insync get_account_information 2> /dev/null | grep -E -o "\<[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\>" ) ) 61 | (( 0 < $#accounts )) && _values "accounts" $accounts 62 | } 63 | 64 | if (( 2 < $CURRENT )) 65 | then 66 | case $words[2] in 67 | 'get_root_drive_files' ) [[ $CURRENT == 3 ]] && __insync_get_all_emails ;; 68 | 'remove_account' ) [[ $CURRENT == 3 ]] && __insync_get_all_emails ;; 69 | 'manage_ignore_list' ) [[ $CURRENT == 3 ]] && __insync_get_all_emails ;; 70 | 'manage_selective_sync' ) [[ $CURRENT == 3 ]] && __insync_get_all_emails ;; 71 | 'accept_all_new_shares' ) [[ $CURRENT == 3 ]] && __insync_get_all_emails ;; 72 | 'reject_all_new_shares' ) [[ $CURRENT == 3 ]] && __insync_get_all_emails ;; 73 | 'accept_share' ) [[ $CURRENT == 4 ]] && __insync_get_all_emails ;; 74 | 'reject_share' ) [[ $CURRENT == 4 ]] && __insync_get_all_emails ;; 75 | 'add_account' ) [[ $CURRENT == 4 ]] && _path_files -/ ;; 76 | 'force_sync' ) [[ $CURRENT == 3 ]] && _path_files -/ ;; 77 | 'get_file_status' ) [[ $CURRENT == 3 ]] && _path_files ;; 78 | 'get_link' ) [[ $CURRENT == 3 ]] && _path_files -W ~/gdrive -P ~/gdrive/ ;; 79 | 'open_in_gdrive' ) [[ $CURRENT == 3 ]] && _path_files ;; 80 | 'share' ) [[ $CURRENT == 3 ]] && _path_files ;; 81 | 'remove_from_insync' ) [[ $CURRENT == 3 ]] && _path_files ;; 82 | 'get_domain_link' ) [[ $CURRENT == 3 ]] && _path_files ;; 83 | 'set_autostart' ) [[ $CURRENT == 3 ]] && _values "autostart" "yes" "no" ;; 84 | 85 | 'set_selective_sync' ) [[ $CURRENT == 3 ]] && __insync_get_all_emails 86 | [[ $CURRENT == 5 ]] && _values "selective sync" "yes" "no" ;; 87 | 88 | 'move_folder' ) [[ $CURRENT == 3 ]] && _path_files -/ 89 | [[ $CURRENT == 4 ]] && _path_files -/ ;; 90 | 91 | 'set_export_option' ) [[ $CURRENT == 3 ]] && __insync_get_all_emails 92 | [[ $CURRENT == 4 ]] && _values "document export format" "office" "link" ;; 93 | esac 94 | fi 95 | -------------------------------------------------------------------------------- /zsh/zsh-functions/_mupdf: -------------------------------------------------------------------------------- 1 | #compdef mupdf 2 | 3 | _arguments \ 4 | '-b[set anti-aliasing quality in bits (0=off, 8=best)]:anti-aliasing:' \ 5 | '-p[password]:password:' \ 6 | '-r[resolution]:resolution:' \ 7 | ':pdf: _files -X "pdf files" -J "pdfs" -g "*.pdf"' \ 8 | ':page:' 9 | -------------------------------------------------------------------------------- /zsh/zsh-functions/_pass: -------------------------------------------------------------------------------- 1 | #compdef pass 2 | #autoload 3 | 4 | # Copyright (C) 2012 - 2014: 5 | # Johan Venant 6 | # Brian Mattern 7 | # Jason A. Donenfeld . 8 | # All Rights Reserved. 9 | # This file is licensed under the GPLv2+. Please see COPYING for more information. 10 | 11 | 12 | # If you use multiple repositories, you can configure completion like this: 13 | # 14 | # compdef _pass workpass 15 | # zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass" 16 | # workpass() { 17 | # PASSWORD_STORE_DIR=$HOME/work/pass pass $@ 18 | # } 19 | 20 | 21 | _pass () { 22 | local cmd 23 | if (( CURRENT > 2)); then 24 | cmd=${words[2]} 25 | # Set the context for the subcommand. 26 | curcontext="${curcontext%:*:*}:pass-$cmd" 27 | # Narrow the range of words we are looking at to exclude `pass' 28 | (( CURRENT-- )) 29 | shift words 30 | # Run the completion for the subcommand 31 | case "${cmd}" in 32 | init) 33 | _arguments : \ 34 | "-p[gpg-id will only be applied to this subfolder]" \ 35 | "--path[gpg-id will only be applied to this subfolder]" 36 | _pass_complete_keys 37 | ;; 38 | ls|list|edit) 39 | _pass_complete_entries_with_subdirs 40 | ;; 41 | insert) 42 | _arguments : \ 43 | "-e[echo password to console]" \ 44 | "--echo[echo password to console]" \ 45 | "-m[multiline]" \ 46 | "--multiline[multiline]" 47 | _pass_complete_entries_with_subdirs 48 | ;; 49 | generate) 50 | _arguments : \ 51 | "-n[don't include symbols in password]" \ 52 | "--no-symbols[don't include symbols in password]" \ 53 | "-c[copy password to the clipboard]" \ 54 | "--clip[copy password to the clipboard]" \ 55 | "-f[force overwrite]" \ 56 | "--force[force overwrite]" \ 57 | "-i[replace first line]" \ 58 | "--in-place[replace first line]" 59 | _pass_complete_entries_with_subdirs 60 | ;; 61 | cp|copy|mv|rename) 62 | _arguments : \ 63 | "-f[force rename]" \ 64 | "--force[force rename]" 65 | _pass_complete_entries_with_subdirs 66 | ;; 67 | rm) 68 | _arguments : \ 69 | "-f[force deletion]" \ 70 | "--force[force deletion]" \ 71 | "-r[recursively delete]" \ 72 | "--recursive[recursively delete]" 73 | _pass_complete_entries_with_subdirs 74 | ;; 75 | git) 76 | local -a subcommands 77 | subcommands=( 78 | "init:Initialize git repository" 79 | "push:Push to remote repository" 80 | "pull:Pull from remote repository" 81 | "config:Show git config" 82 | "log:Show git log" 83 | "reflog:Show git reflog" 84 | ) 85 | _describe -t commands 'pass git' subcommands 86 | ;; 87 | show|*) 88 | _pass_cmd_show 89 | ;; 90 | esac 91 | else 92 | local -a subcommands 93 | subcommands=( 94 | "init:Initialize new password storage" 95 | "ls:List passwords" 96 | "find:Find password files or directories based on pattern" 97 | "grep:Search inside decrypted password files for matching pattern" 98 | "show:Decrypt and print a password" 99 | "insert:Insert a new password" 100 | "generate:Generate a new password using pwgen" 101 | "edit:Edit a password with \$EDITOR" 102 | "mv:Rename the password" 103 | "cp:Copy the password" 104 | "rm:Remove the password" 105 | "git:Call git on the password store" 106 | "version:Output version information" 107 | "help:Output help message" 108 | ) 109 | _describe -t commands 'pass' subcommands 110 | _arguments : \ 111 | "--version[Output version information]" \ 112 | "--help[Output help message]" 113 | _pass_cmd_show 114 | fi 115 | } 116 | 117 | _pass_cmd_show () { 118 | _arguments : \ 119 | "-c[put it on the clipboard]" \ 120 | "--clip[put it on the clipboard]" 121 | _pass_complete_entries 122 | } 123 | _pass_complete_entries_helper () { 124 | local IFS=$'\n' 125 | local prefix 126 | zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" 127 | _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#' | sort):-""} 128 | } 129 | 130 | _pass_complete_entries_with_subdirs () { 131 | _pass_complete_entries_helper 132 | } 133 | 134 | _pass_complete_entries () { 135 | _pass_complete_entries_helper -type f 136 | } 137 | 138 | _pass_complete_keys () { 139 | local IFS=$'\n' 140 | # Extract names and email addresses from gpg --list-keys 141 | _values 'gpg keys' $(gpg2 --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d') 142 | } 143 | 144 | _pass 145 | -------------------------------------------------------------------------------- /zsh/zsh-functions/_pip: -------------------------------------------------------------------------------- 1 | #compdef pip pip2 pip-2.7 pip3 pip-3.2 pip-3.3 pip-3.4 2 | #autoload 3 | 4 | # pip zsh completion, based on homebrew completion 5 | 6 | _pip_all() { 7 | # we cache the list of packages (originally from the macports plugin) 8 | if (( ! $+piplist )); then 9 | zsh-pip-cache-packages 10 | piplist=($(cat $ZSH_PIP_CACHE_FILE)) 11 | fi 12 | } 13 | 14 | _pip_installed() { 15 | installed_pkgs=(`pip freeze | cut -d '=' -f 1`) 16 | } 17 | 18 | local -a _1st_arguments 19 | _1st_arguments=( 20 | 'bundle:create pybundles (archives containing multiple packages)' 21 | 'freeze:output all currently installed packages (exact versions) to stdout' 22 | 'help:show available commands' 23 | 'show:show information about installed packages' 24 | 'install:install packages' 25 | 'search:search PyPI' 26 | 'uninstall:uninstall packages' 27 | 'unzip:unzip individual packages' 28 | 'zip:zip individual packages' 29 | ) 30 | 31 | local expl 32 | local -a all_pkgs installed_pkgs 33 | 34 | _arguments \ 35 | '(--version)--version[show version number of program and exit]' \ 36 | '(-h --help)'{-h,--help}'[show help]' \ 37 | '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in]' \ 38 | '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv]' \ 39 | '(-v --verbose)'{-v,--verbose}'[give more output]' \ 40 | '(-q --quiet)'{-q,--quiet}'[give less output]' \ 41 | '(--log)--log[log file location]' \ 42 | '(--proxy)--proxy[proxy in form user:passwd@proxy.server:port]' \ 43 | '(--timeout)--timeout[socket timeout (default 15s)]' \ 44 | '*:: :->subcmds' && return 0 45 | 46 | if (( CURRENT == 1 )); then 47 | _describe -t commands "pip subcommand" _1st_arguments 48 | return 49 | fi 50 | 51 | case "$words[1]" in 52 | search) 53 | _arguments \ 54 | '(--index)--index[base URL of Python Package Index]' ;; 55 | freeze) 56 | _arguments \ 57 | '(-l --local)'{-l,--local}'[report only virtualenv packages]' ;; 58 | install) 59 | _arguments \ 60 | '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \ 61 | '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \ 62 | '(-r --requirement)'{-r,--requirement}'[Requirements file for packages to install]:File:_files' \ 63 | '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \ 64 | '(--no-install)--no-install[only download packages]' \ 65 | '(--no-download)--no-download[only install downloaded packages]' \ 66 | '(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \ 67 | '(--single-version-externally-managed)--single-version-externally-managed[do not download/install dependencies. requires --record or --root]'\ 68 | '(--root)--root[treat this path as a fake chroot, installing into it. implies --single-version-externally-managed]'\ 69 | '(--record)--record[file to record all installed files to.]'\ 70 | '(-r --requirement)'{-r,--requirement}'[requirements file]: :_files'\ 71 | '(-e --editable)'{-e,--editable}'[path of or url to source to link to instead of installing.]: :_files -/'\ 72 | '1: :->packages' && return 0 73 | 74 | if [[ "$state" == packages ]]; then 75 | _pip_all 76 | _wanted piplist expl 'packages' compadd -a piplist 77 | fi ;; 78 | uninstall) 79 | _pip_installed 80 | _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;; 81 | show) 82 | _pip_installed 83 | _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;; 84 | esac 85 | -------------------------------------------------------------------------------- /zsh/zsh-functions/pip.zsh: -------------------------------------------------------------------------------- 1 | # Usage: 2 | # Just add pip to your installed plugins. 3 | 4 | # If you would like to change the cheeseshops used for autocomplete set 5 | # ZSH_PIP_INDEXES in your zshrc. If one of your indexes are bogus you won't get 6 | # any kind of error message, pip will just not autocomplete from them. Double 7 | # check! 8 | # 9 | # If you would like to clear your cache, go ahead and do a 10 | # "zsh-pip-clear-cache". 11 | 12 | ZSH_PIP_CACHE_FILE=~/.pip/zsh-cache 13 | ZSH_PIP_INDEXES=(https://pypi.python.org/simple/) 14 | 15 | zsh-pip-clear-cache() { 16 | rm $ZSH_PIP_CACHE_FILE 17 | unset piplist 18 | } 19 | 20 | zsh-pip-clean-packages() { 21 | sed -n '/\([^<]\{1,\}\).*/\1/p' 22 | } 23 | 24 | zsh-pip-cache-packages() { 25 | if [[ ! -d ${ZSH_PIP_CACHE_FILE:h} ]]; then 26 | mkdir -p ${ZSH_PIP_CACHE_FILE:h} 27 | fi 28 | 29 | if [[ ! -f $ZSH_PIP_CACHE_FILE ]]; then 30 | echo -n "(...caching package index...)" 31 | tmp_cache=/tmp/zsh_tmp_cache 32 | for index in $ZSH_PIP_INDEXES ; do 33 | # well... I've already got two problems 34 | curl $index 2>/dev/null | \ 35 | zsh-pip-clean-packages \ 36 | >> $tmp_cache 37 | done 38 | sort $tmp_cache | uniq | tr '\n' ' ' > $ZSH_PIP_CACHE_FILE 39 | rm $tmp_cache 40 | fi 41 | } 42 | 43 | # A test function that validates the regex against known forms of the simple 44 | # index. If you modify the regex to make it work for you, you should add a test 45 | # case in here and make sure that your changes don't break things for someone 46 | # else. 47 | zsh-pip-test-clean-packages() { 48 | local expected 49 | local actual 50 | expected="0x10c-asm 51 | 1009558_nester" 52 | 53 | actual=$(echo -n "Simple Index 54 | 0x10c-asm
55 | 1009558_nester
56 | " | zsh-pip-clean-packages) 57 | 58 | if [[ $actual != $expected ]] ; then 59 | echo -e "python's simple index is broken:\n$actual\n !=\n$expected" 60 | else 61 | echo "python's simple index is fine" 62 | fi 63 | 64 | actual=$(echo -n ' 65 | 66 | Simple Package Index 67 | 68 | 69 | 0x10c-asm
70 | 1009558_nester
71 | ' | zsh-pip-clean-packages) 72 | 73 | if [[ $actual != $expected ]] ; then 74 | echo -e "the djangopypi2 index is broken:\n$actual\n !=\n$expected" 75 | else 76 | echo "the djangopypi2 index is fine" 77 | fi 78 | } 79 | --------------------------------------------------------------------------------