├── .Xdefaults ├── .Xresources ├── .bashrc ├── .config ├── dunst │ └── dunstrc ├── i3 │ ├── config │ └── tabs_in_split.py ├── i3status │ └── config └── vifm │ ├── colors │ └── nojhan.vifm │ └── vifmrc ├── .gdbinit ├── .gitconfig ├── .gitignore ├── .gitmodules ├── .gvimrc ├── .notion ├── cfg_notion.lua ├── cfg_statusbar.lua ├── look_noj.lua ├── statusbar_workspace.lua ├── statusd_laptopstatus.lua └── statusd_vv.lua ├── .screenrc ├── .taskrc ├── .tmux.conf ├── .twdrc ├── .vim ├── .netrwhist ├── colors │ ├── base16-railscasts-noj.vim │ ├── inkpot.vim │ └── solarized.vim ├── spell │ ├── en.utf-8.add │ ├── en.utf-8.add.spl │ ├── fr.utf-8.add │ ├── fr.utf-8.add.spl │ └── fr.utf-8.spl └── syntax │ ├── Wikipedia.vim │ └── cpp.vim ├── .vimrc ├── .xmodmap.conf ├── README.md ├── demo_prompt_bash.png ├── ipython_config.py ├── kak ├── autoload │ └── cpp.kak ├── colors │ └── kalolo.kak └── kakrc ├── kak_ide_open.sh ├── kak_ide_open_at_line.sh ├── kak_ide_start.sh ├── lessfilter.sh ├── mtime.sh ├── repeat.sh ├── rsnapshot_anacron ├── daily │ └── rsnapshot_daily ├── hourly │ └── rsnapshot_hourly ├── install.sh ├── monthly │ └── rsnapshot_monthly ├── rsnapshot_common └── weekly │ └── rsnapshot_weekly └── xmonad.hs /.Xdefaults: -------------------------------------------------------------------------------- 1 | *customization: -color 2 | XTerm*termName: xterm-256color 3 | 4 | !! drop in Solarized colorscheme for Xresources/Xdefaults 5 | 6 | !!SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB 7 | !!--------- ------- ---- ------- ----------- ---------- ----------- ----------- 8 | !!base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21 9 | !!base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26 10 | !!base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46 11 | !!base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51 12 | !!base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59 13 | !!base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63 14 | !!base2 #eee8d5 7/7 white 254 #e4e4e4 92 -00 10 238 232 213 44 11 93 15 | !!base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99 16 | !!yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71 17 | !!orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80 18 | !!red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86 19 | !!magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83 20 | !!violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77 21 | !!blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82 22 | !!cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63 23 | !!green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60 24 | 25 | ! URxvt*font: *-fixed-*-*-*-18-* 26 | ! URxvt.font: xft:bitstream vera sans mono:size=10:antialias=true 27 | URxvt.font: xft:MesloLGS NF:style=Regular:size=10:antialias=true 28 | XTerm.font: xft:MesloLGS NF:style=Regular:size=10:antialias=true 29 | 30 | ! XTerm*background: Black 31 | XTerm*background: #000000 32 | XTerm*foreground: #93a1a1 33 | XTerm*color4: DodgerBlue 34 | XTerm*color12: DodgerBlue 35 | 36 | ! URxvt*background: #2b2b2b 37 | URxvt*background: #1c1c1c 38 | URxvt*foreground: #d4cfc9 39 | ! Black + DarkGrey 40 | ! URxvt*color0: #2b2b2b 41 | URxvt*color0: #000000 42 | URxvt*color8: #5a647e 43 | ! DarkRed + Red 44 | URxvt*color1: #c93828 45 | URxvt*color9: #da4939 46 | ! DarkGreen + Green 47 | URxvt*color2: #94b150 48 | URxvt*color10: #a5c261 49 | ! DarkYellow + Yellow 50 | URxvt*color3: #eeb55c 51 | URxvt*color11: #ffc66d 52 | ! DarkBlue + Blue 53 | URxvt*color4: #5c8bad 54 | URxvt*color12: #6d9cbe 55 | ! DarkMagenta + Magenta 56 | URxvt*color5: #b5a2da 57 | URxvt*color13: #b693eb 58 | !DarkCyan + Cyan 59 | URxvt*color6: #408e40 60 | URxvt*color14: #519f50 61 | ! LightGrey + White 62 | URxvt*color7: #dddddd 63 | URxvt*color15: #ffffff 64 | URxvt*cutchars: "\n\"'&()*,;<=>?@[]{|}:" 65 | !URxvt*transparent: true 66 | !URxvt*shading: 10 67 | 68 | URxvt*saveLines:10000 69 | 70 | URxvt.perl-ext-common: default,matcher 71 | URxvt.urlLauncher: gvim 72 | URxvt.matcher.button: 1 73 | URxvt.matcher.pattern.1: \\B(/\\S+?):(\\d+) 74 | URxvt.matcher.launcher.1:gvim --servername IDE --remote +$2 $1 75 | ! URxvt.matcher.launcher.1:gvim --servername IDE --remote +$2 $1 76 | URxvt.matcher.pattern.2: \\B(/\\S+?\\.py)\\S{2}\\sline\\s(\\d+) 77 | URxvt.matcher.launcher.2: gvim --servername IDE --remote +$2 $1 78 | URxvt.matcher.pattern.3: \\B(\\./\\S+?):(\\d+) 79 | URxvt.matcher.launcher.3:gvim --servername IDE --remote +$2 $1 80 | ! URxvt.matcher.launcher.3:gvim --servername IDE --remote +$2 $1 81 | 82 | Xft.lcdfilter: lcddefault 83 | Xft.hintstyle: hintslight 84 | 85 | *TkTheme: clearlooks 86 | 87 | -------------------------------------------------------------------------------- /.Xresources: -------------------------------------------------------------------------------- 1 | *customization: -color 2 | XTerm*termName: xterm-256color 3 | 4 | !! drop in Solarized colorscheme for Xresources/Xdefaults 5 | 6 | !!SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB 7 | !!--------- ------- ---- ------- ----------- ---------- ----------- ----------- 8 | !!base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21 9 | !!base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26 10 | !!base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46 11 | !!base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51 12 | !!base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59 13 | !!base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63 14 | !!base2 #eee8d5 7/7 white 254 #e4e4e4 92 -00 10 238 232 213 44 11 93 15 | !!base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99 16 | !!yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71 17 | !!orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80 18 | !!red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86 19 | !!magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83 20 | !!violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77 21 | !!blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82 22 | !!cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63 23 | !!green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60 24 | 25 | ! XTerm*background: #002b36 26 | ! XTerm*background: #4e4e4e 27 | ! XTerm*font: MesloLGLDZ Nerd Font Mono:regular:size=12:antialias=true 28 | XTerm*faceName: MesloLGLDZ Nerd Font Mono 29 | XTerm*background: #000000 30 | XTerm*foreground: #93a1a1 31 | XTerm*color4: DodgerBlue 32 | XTerm*color12: DodgerBlue 33 | XTerm*colorMode: on 34 | XTerm*dynamicColors: on 35 | 36 | 37 | ! URxvt*background: #002b36 38 | !URxvt*background: #4e4e4e 39 | !URxvt*foreground: #93a1a1 40 | !URxvt*color4: DodgerBlue 41 | !URxvt*color12: DodgerBlue 42 | URxvt.scrollBar: false 43 | 44 | Xft.lcdfilter: lcddefault 45 | Xft.hintstyle: hintslight 46 | 47 | *TkTheme: clearlooks 48 | 49 | -------------------------------------------------------------------------------- /.bashrc: -------------------------------------------------------------------------------- 1 | if [ -f /etc/bashrc ]; then 2 | . /etc/bashrc # --> Read /etc/bashrc, if present. 3 | fi 4 | # if [ -f /etc/bash_completion ]; then 5 | # . /etc/bash_completion 6 | # fi 7 | 8 | ############## 9 | # Networking # 10 | ############## 11 | 12 | function proxy() 13 | { 14 | proxy_url="$(~/proxy.sh)" 15 | IFS=' ' read -r -a proxies <<< "$proxy_url" 16 | export http_proxy="${proxies[0]}" 17 | export https_proxy="${proxies[1]}" 18 | export ftp_proxy="${proxies[0]}" 19 | echo ${proxies[@]} 20 | } 21 | 22 | function proxy_app() 23 | { 24 | proxy_url="$(~/proxy_app.sh)" 25 | IFS=' ' read -r -a proxies <<< "$proxy_url" 26 | export http_proxy="${proxies[0]}" 27 | export https_proxy="${proxies[1]}" 28 | export ftp_proxy="${proxies[0]}" 29 | echo ${proxies[@]} 30 | } 31 | 32 | function noproxy() 33 | { 34 | export http_proxy="" 35 | export https_proxy="" 36 | export ftp_proxy="" 37 | } 38 | 39 | # get the current IP adresses on eth0 40 | function myip() 41 | { 42 | MY_IP=$(/sbin/ifconfig eth0 | awk '/inet/ { print $2 } ' | sed -e s/adr:// | sed -e s/inet6://) 43 | echo $MY_IP 44 | } 45 | 46 | # copy a stream in the X clipboard, e.g. "cat file | xcopy" 47 | alias xcopy="xclip -i -selection clipboard" 48 | 49 | # baskcup shortcuts 50 | alias rcp='rsync -avz --ignore-existing --progress --rsh "ssh" ' 51 | alias rcp_443='rsync -avz --ignore-existing --progress --rsh "ssh -p 443" ' 52 | alias rcp_80='rsync -avz --ignore-existing --progress --rsh "ssh -p 80" ' 53 | 54 | 55 | ################### 56 | # File management # 57 | ################### 58 | 59 | # Find a file with a pattern in name from the current directory 60 | # ff name 61 | function ff() 62 | { find . -type f -iname "'*'$*'*'" -ls ; } 63 | 64 | # move to ~/.Trash instead of rm a file 65 | function del() 66 | { 67 | for i in $* ; do 68 | mv $i ~/.local/share/Trash/files/ 69 | done 70 | } 71 | 72 | # go up n directories 73 | up() 74 | { 75 | local str="" 76 | local count=0 77 | while [[ "$count" -lt "$1" ]] ; 78 | do 79 | str=$str"../" 80 | let count=count+1 81 | done 82 | cd $str 83 | } 84 | 85 | alias ..='cd ..' 86 | alias ...='cd ../../' 87 | 88 | # move backup files to trash 89 | clean() 90 | { 91 | local globs='*~ .*.swp *.cpp.o' 92 | 93 | while true; do 94 | read -p "Supprimer récursivement les fichiers '$globs' à partir de $(pwd) ?" yn 95 | case $yn in 96 | [YyOo]* ) break;; 97 | [Nn]* ) exit;; 98 | * ) echo "Répondez par oui ou par non";; 99 | esac 100 | done 101 | 102 | for g in $globs ; do 103 | echo -n "$g ..." 104 | find . -name "$g" -delete 105 | echo " done" 106 | done 107 | } 108 | 109 | # Prevents accidentally clobbering files. 110 | alias mv='mv -i' 111 | alias mkdir='mkdir -p' 112 | 113 | # The 'ls' family (this assumes you use the GNU ls)) 114 | # Mispelling on azerty keyboards 115 | alias lks='ls' 116 | # alias ks='ls' 117 | alias ms='ls' 118 | 119 | # alias ls='ls -hF --color' # add colors for filetype recognition 120 | # alias l='ls -1' 121 | # alias la='ls -Al' # show hidden files 122 | # alias lx='ls -lXB' # sort by extension 123 | # alias lk='ls -lSr' # sort by size 124 | # alias lc='ls -lcr' # sort by change time 125 | # alias lu='ls -lur' # sort by access time 126 | # alias lr='ls -lR' # recursive ls 127 | # alias lt='ls -ltr' # sort by date 128 | # alias lm='ls -al --color=none|less' # pipe through 'less' 129 | # alias ll='ls -l' 130 | # alias tree='tree -Csu' # nice alternative to 'ls' 131 | 132 | export PATH="$PATH:$HOME/.cargo/bin" 133 | exadef="--icons --modified " 134 | exal="--long --all --group --modified --header --level 2 --time-style=long-iso --binary" 135 | alias ls='exa ${exadef}' # add colors for filetype recognition 136 | alias l='exa ${exadef} -1 --no-icons' 137 | alias la='exa ${exadef} --all' # show hidden files 138 | alias lx='exa ${exadef} ${exal} --sort extension' # sort by extension 139 | alias lk='exa ${exadef} ${exal} --sort size --reverse' # sort by size 140 | alias lc='exa ${exadef} ${exal} --sort modified' # sort by change time 141 | alias lm='exa ${exadef} ${exal} --sort=modified --reverse' 142 | alias lu='exa ${exadef} ${exal} --sort accessed' # sort by access time 143 | alias lt='exa ${exadef} ${exal} --sort created' # sort by date 144 | alias lr='exa ${exadef} ${exal} --recurse' # recursive ls 145 | alias le='exa ${exadef} ${exal} | kak' # pipe through editor 146 | alias ll='exa ${exadef} ${exal}' 147 | alias tree='exa ${xadef} ${exal} --tree' # nice alternative to 'ls' 148 | 149 | # changes the default head/tail behaviour to output x lines, 150 | # where x is the number of lines currently displayed on your terminal 151 | alias head='head -n $((${LINES:-`tput lines 2>/dev/null||echo -n 12`} - 15))' 152 | alias tail='tail -n $((${LINES:-`tput lines 2>/dev/null||echo -n 12`} - 15))' 153 | 154 | # If the output is smaller than the screen height is smaller, 155 | # less will just cat it 156 | # + support ANSI colors 157 | export LESS="-FX -R" 158 | 159 | # Syntax coloring with pygments in less, when opening source files 160 | export LESSOPEN='|~/code/dotfiles/lessfilter.sh %s' 161 | 162 | # nautilus file manager in browser mode without destkop management 163 | alias Ex='nautilus --no-desktop --browser .' 164 | 165 | alias k="kanban" 166 | 167 | # Make a directory and move to it 168 | function md() { 169 | mkdir $1 170 | cd $1 171 | } 172 | 173 | 174 | # if in an interactive shell 175 | if [[ $- == *i* ]]; then 176 | # use up/down to search history, matching the current line start 177 | bind '"\e[A": history-search-backward' 178 | bind '"\e[B": history-search-forward' 179 | fi 180 | 181 | ############# 182 | # Processes # 183 | ############# 184 | 185 | function psg() { 186 | # do not show grep itself color matching string color the PID 187 | ps aux | grep -v grep | grep --ignore-case --color=always $1 | colout '^\S+\s+([0-9]+).*$' blue 188 | } 189 | 190 | function agc() { 191 | ag "$1" | colout "$1" 192 | } 193 | 194 | 195 | 196 | # Notify when a command is completed, with a visual warning. 197 | function notify() { 198 | cmd=$(echo "$1" | sed 's/&/&/g') 199 | if [[ "$1" != "" ]] ; then 200 | $@ 201 | fi 202 | if [[ $? ]] ; then 203 | msg="Your \"$cmd\" command is completed" 204 | else 205 | msg="There was an error in your \"$cmd\" command" 206 | fi 207 | zenity --info --text "$msg\nin $((e-s)) s\n$(date)" & 208 | } 209 | 210 | # Notify when a command is completed, with an audio and visual warning. 211 | function notice() { 212 | s=$SECONDS 213 | 214 | cmd=$(echo "$1" | sed 's/&/&/g') 215 | if [[ "$1" != "" ]] ; then 216 | $@ 217 | fi 218 | if [[ $? ]] ; then 219 | msg="Your \"$cmd\" command is completed" 220 | else 221 | msg="There was an error in your \"$cmd\" command" 222 | fi 223 | zenity --info --text "$msg\nin $((e-s)) s\n$(date)" & 224 | 225 | # if the command has run more than a minute 226 | # then say loudly that it ended 227 | e=$SECONDS 228 | if [[ $((e-s)) -ge 1 ]] ; then 229 | espeak -s 110 "$msg" 2>/dev/null >/dev/null 230 | fi 231 | } 232 | 233 | # Notify with a visual warning. 234 | function ended() { 235 | notify 236 | } 237 | 238 | function forever() { 239 | cmd="$1" 240 | while [[ 1 ]]; do 241 | echo "$cmd" 242 | $cmd 243 | if [[ $? > 128 ]]; then 244 | break; 245 | fi 246 | done 247 | } 248 | 249 | 250 | ########## 251 | # Coding # 252 | ########## 253 | 254 | #alias agrep="ag" 255 | #alias ag="~/apps/the_silver_searcher/ag" 256 | #alias kak="/home/nojhan/code/kakoune/src/kak" 257 | 258 | # repeat n times command 259 | # repeat 10 echo "ok" 260 | function repeat() 261 | { 262 | local i max 263 | max=$1; shift; 264 | for ((i=1; i <= max ; i++)); do # --> C-like syntax 265 | eval "$@"; 266 | done 267 | } 268 | 269 | # default editor 270 | export EDITOR='kak' 271 | 272 | # aliases to manage vim in server mode 273 | alias latexed="gvim --servername LATEX " 274 | # alias ide="gvim --servername IDE " 275 | alias ide="kak -s ide -e 'rename-client main'" 276 | 277 | # print a vim fortune at startup 278 | #/usr/games/fortune vimtips 279 | 280 | # ipython shell with correct default apps 281 | alias ipy='ipython -pylab -p scipy --editor="gvim"' 282 | 283 | # colored cmake/gcc output using the colout command 284 | # usage: cm ./build_script 285 | function cm() 286 | { 287 | set -o pipefail 288 | $@ 2>&1 | colout -t cmake | colout -t g++ | colout -t ctest 289 | #| less 290 | } 291 | 292 | function cpy() 293 | { 294 | set -o pipefail 295 | $@ 2>&1 | colout -t python 296 | } 297 | 298 | function ctex() 299 | { 300 | set -o pipefail 301 | $@ 2>&1 | colout -t latex 302 | } 303 | 304 | function m() 305 | { 306 | set -o pipefail 307 | cm cmake .. && cm make $@ && ./$@ 308 | } 309 | 310 | function ma() 311 | { 312 | set -o pipefail 313 | N=$(($(nproc)-1)) 314 | cm cmake .. && cm make -j $N $@ && cm ctest -j $N 315 | } 316 | 317 | 318 | # shortcut to display the url config of remote repo in a git root 319 | alias git_remotes="grep -A 2 \"\[remote\" .git/config|grep -v fetch|sed \"s/\[remote \\\"//\"|sed ':a;N;\$!ba;s/\"\]\n\s*url = /\t/g'" 320 | 321 | # Pretty git log 322 | alias git_log="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" 323 | 324 | # ignore all files that are not versioned in a git repository 325 | function git_ignore() 326 | { 327 | if [[ ! -f .gitignore ]] ; then 328 | echo ".gitignore" > .gitignore 329 | fi 330 | git ls-files --other --exclude-standard >> .gitignore 331 | } 332 | 333 | # Take a snapshot of the current git repository and zip it. 334 | # The archive file name has the current date in its name. 335 | function git_archive() 336 | { 337 | last_commit_date=$(git log -1 --format=%ci | awk '{print $1"_"$2;}' | sed "s/:/-/g") 338 | project=$(basename $(pwd)) 339 | branch=$(git rev-parse --abbrev-ref HEAD) 340 | name=${project}_${branch}_${last_commit_date} 341 | git config tar.tar.xz.command "xz -c" 342 | git archive --prefix=$name/ --format tar.xz ${branch} > $name.tar.xz 343 | echo $name.tar.xz 344 | } 345 | 346 | 347 | # Intuitive calculator on the command line 348 | # $ = 3 × 5.1 ÷ 2 349 | # 7,65 350 | calc() { 351 | calc="$@" 352 | # We can use the unicode signs × and ÷ 353 | calc="${calc//×/*}" 354 | calc="${calc//÷//}" 355 | echo -e "$calc\nquit" | gcalccmd | sed 's/^> //g' 356 | } 357 | 358 | 359 | ################# 360 | # Configuration # 361 | ################# 362 | 363 | # Note: purge-old-kernels is in the bikeshed package 364 | alias upgrade="sudo apt update && sudo apt dist-upgrade -y && sudo apt --purge autoremove -y && sudo apt autoclean -y && sudo apt clean" 365 | 366 | # alias I want to learn 367 | function h() 368 | { 369 | echo "la : show hidden files" 370 | echo "lx : sort by extension" 371 | echo "lk : sort by size" 372 | echo "lc : sort by change time" 373 | echo "lu : sort by access time" 374 | echo "lr : recursive ls" 375 | echo "lt : sort by date" 376 | echo "lm : pipe through 'less'" 377 | echo "md : mkdir, cd" 378 | echo "tree : nice alternative to 'ls'" 379 | echo "ff [pattern] : find a file with a pattern in name" 380 | echo "myip : show the IP address of eth0" 381 | echo "repeat [n] [command] : repeat n times command" 382 | echo "clean : remove backup files (*~)" 383 | echo "psg : ps aux | grep " 384 | echo "rcp : copy with rsync/ssh" 385 | } 386 | 387 | # do not permits to recall dangerous commands in bash history 388 | # export HISTIGNORE='&:[bf]g:exit:*>|*:*rm*-rf*' 389 | export HISTIGNORE='&:[bf]g:exit:*>|*' 390 | # append history rather than overwrite 391 | shopt -s histappend 392 | # one command per line 393 | shopt -s cmdhist 394 | unset HISTFILESIZE 395 | HISTSIZE=1000000 396 | # ignore commands that start with a space AND duplicate commands 397 | HISTCONTROL=ignoreboth 398 | # add the full date and time to lines 399 | HISTTIMEFORMAT='%F %T ' 400 | # store history immediately 401 | #; history -n' 402 | 403 | # Manually switch to the bépo keyboard layout 404 | alias bepo="setxkbmap -layout fr -variant bepo -option" 405 | 406 | # Import the correct alias for thefuck 407 | # eval $(thefuck --alias fuck) 408 | 409 | # Alias for forcing screen on/off. 410 | alias screenon="xset -display :0.0 dpms force on" 411 | alias screenoff="xset -display :0.0 dpms force off" 412 | # Lock the screens and turn them off. 413 | alias afk="cinnamon-screensaver & cinnamon-screensaver-command -l & xset -display :0.0 dpms force off" 414 | 415 | # Use liquidprompt only if in an interactive shell 416 | if [[ $- == *i* ]]; then 417 | # Super nice prompt 418 | source ~/.liquidprompt --no-activate 419 | lp_activate #--no-config 420 | JOLLY_SPACE_LINE="‎" # empty character 421 | JOLLY_ITEMS=("" "┃" "━") 422 | source ~/code/lp-jolly/presets/variant-chevron.conf 423 | source ~/code/lp-jolly/jolly.theme && lp_theme jolly 424 | fi 425 | 426 | if [[ $- == *i* ]] ; then 427 | for f in /etc/bash_completion.d/* ; do 428 | source "$f" 429 | done 430 | # for f in /usr/share/bash-completion/completions/*; do 431 | # source "$f" 432 | # done 433 | bcp="/usr/share/bash-completion/completions" 434 | enabled=("apt" "autossh" "c++" "chmod" "chown" "file-roller" "find" "g++" "git" "gitk" "htop" "inkscape" "iwconfig" "jq" "jsonschema" "kill" "killall" "lftp" "make" "man" "mktemp" "mount" "python" "python3" "pyvenv" "R" "rsync" "sh" "shellcheck" "ssh" "ssh-copy-id" "sudo" "su" "tar" "umount" "useradd" "usermod" "valgrind" "vifm" "wget" "wine") 435 | for f in $enabled; do 436 | source "$bcp/$f" 437 | done 438 | fi 439 | 440 | # Always connect to a tmux session when SSH. 441 | if [[ $- =~ i ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_TTY" ]]; then 442 | tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux 443 | fi 444 | # In case of problem, just connect with bash --norc: 445 | # ssh -t myname@myserver bash --norc 446 | 447 | 448 | export TCLLIBPATH="~/.local/share/tkthemes" 449 | 450 | # Add pip bin dir to path: 451 | export PATH="$PATH:$HOME/.local/bin/:$HOME/code/colout/colout/" 452 | export PATH="$PATH:/home/nojhan/.local/bin/:/home/nojhan/go/bin/" 453 | export PATH="$PATH:/home/nojhan/apps/csv-validator-distribution-1.3.0-bin/" 454 | 455 | alias colout="colout.py" 456 | 457 | # export PYTHONPATH="$PYTHONPATH:/home/nojhan/code/terminator/" 458 | export PYTHONPATH="$PYTHONPATH:/opt/pyAgrum/lib/python3.8/site-packages/" 459 | 460 | export LC_ALL=en_US.UTF-8 461 | export LANG=en_US.UTF-8 462 | 463 | # . "$HOME/.cargo/env" 464 | 465 | alias t="~/code/taskwarrior-deluxe/taskwarrior-deluxe.py" 466 | alias task="TASKDATA=.task task" 467 | 468 | # Add neo4j path 469 | export PATH="$PATH:/home/nojhan/apps/neo4j/packaging/standalone/target/neo4j-community-5.13.0-SNAPSHOT/bin/" 470 | export NEO4J_HOME="/home/nojhan/apps/neo4j/packaging/standalone/target/neo4j-community-5.13.0-SNAPSHOT/" 471 | 472 | export PATH="$PATH:/usr/local/bin/" 473 | 474 | # export PYTHONPATH="$PYTHONPATH:/home/nojhan/code/terminator/" 475 | export PYTHONPATH="$PYTHONPATH:/opt/pyAgrum/lib/python3.8/site-packages/:/home/nojhan/travail/code/biocypher:/home/nojhan/travail/code/ontoweaver/src/" 476 | 477 | # export TERMINAL="/usr/local/bin/terminator" 478 | export TERMINAL="terminator" 479 | 480 | eval "$(direnv hook bash)" 481 | 482 | if [[ $- == *i* ]] ; then 483 | # Use autojump only if in an interactive shell 484 | source /usr/share/autojump/autojump.bash 485 | fi 486 | 487 | 488 | export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring 489 | 490 | ulimit -n 40000 491 | 492 | export NVM_DIR="$HOME/.nvm" 493 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 494 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 495 | 496 | alias cat="/usr/bin/batcat" 497 | -------------------------------------------------------------------------------- /.config/i3/config: -------------------------------------------------------------------------------- 1 | # This file has been auto-generated by i3-config-wizard(1). 2 | # It will not be overwritten, so edit it as you like. 3 | # 4 | # Should you change your keyboard layout some time, delete 5 | # this file and re-run i3-config-wizard(1). 6 | # 7 | 8 | exec "setxkbmap -model pc105 -layout fr -variant bepo -options lv3:ralt_switch,compose:caps,terminate:ctrl_alt_bksp" 9 | 10 | # i3 config file (v4) 11 | # 12 | # Please see https://i3wm.org/docs/userguide.html for a complete reference! 13 | 14 | # Alt = Mod1, Win = Mod4 15 | set $mod Mod4 16 | 17 | # Font for window titles. Will also be used by the bar unless a different font 18 | # is used in the bar {} block below. 19 | font pango:monospace 8 20 | 21 | # This font is widely installed, provides lots of unicode glyphs, right-to-left 22 | # text rendering and scalability on retina/hidpi displays (thanks to pango). 23 | #font pango:DejaVu Sans Mono 8 24 | 25 | # Start XDG autostart .desktop files using dex. See also 26 | # https://wiki.archlinux.org/index.php/XDG_Autostart 27 | exec --no-startup-id dex --autostart --environment i3 28 | 29 | # The combination of xss-lock, nm-applet and pactl is a popular choice, so 30 | # they are included here as an example. Modify as you see fit. 31 | 32 | # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the 33 | # screen before suspend. Use loginctl lock-session to lock your screen. 34 | exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork --image=/home/nojhan/Images/Wood.png 35 | 36 | # NetworkManager is the most popular way to manage wireless networks on Linux, 37 | # and nm-applet is a desktop environment-independent system tray GUI for it. 38 | exec --no-startup-id nm-applet 39 | 40 | # Use pactl to adjust volume in PulseAudio. 41 | set $refresh_i3status killall -SIGUSR1 i3status 42 | bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status 43 | bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status 44 | bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status 45 | bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status 46 | 47 | # Use Mouse+$mod to drag floating windows to their wanted position 48 | floating_modifier $mod 49 | 50 | # start a terminal 51 | # i3-sensible-terminal 52 | bindsym $mod+F1 exec terminator 53 | bindsym $mod+t exec terminator 54 | bindsym $mod+F2 exec firefox 55 | bindsym $mod+n exec firefox 56 | bindsym $mod+F3 exec thunar 57 | bindsym $mod+h exec thunar 58 | 59 | # Lock screen 60 | bindsym $mod+l exec "cinnamon-screensaver & cinnamon-screensaver-command -l" 61 | # Lock and turn off screen 62 | bindsym $mod+Shift+l exec "cinnamon-screensaver & cinnamon-screensaver-command -l & xset -display :0.0 dpms force off" 63 | 64 | # kill focused window 65 | bindsym $mod+x kill 66 | 67 | # start dmenu (a program launcher) 68 | # bindsym $mod+d exec --no-startup-id dmenu_run 69 | # bindsym $mod+Return exec --no-startup-id dmenu_run 70 | # A more modern dmenu replacement is rofi: 71 | # bindcode $mod+40 exec "rofi -modi drun,run -show drun" 72 | # There also is i3-dmenu-desktop which only displays applications shipping a 73 | # .desktop file. It is a wrapper around dmenu, so you need that installed. 74 | # bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop 75 | # bindcode $mod+Return exec --no-startup-id j4-dmenu-desktop --dmenu="dmenu_run -i -l 10 -nb '#4f7dde' -nf '#f8f8f8' -sb '#cf8200' -sf '#f8f8f8'" 76 | # bindcode $mod+Shift+Return exec --no-startup-id dmenu_run 77 | bindsym $mod+Return exec "rofi -modi drun,run -show drun" 78 | # bindsym $mod+Shift+Return exec dmenu_run -i -l 10 -p '> ' -nb '#4f7dde' -nf '#f8f8f8' -sb '#cf8200' -sf '#f8f8f8' 79 | 80 | # alternatively, you can use the cursor keys: 81 | bindsym $mod+Left focus left 82 | bindsym $mod+Down focus down 83 | bindsym $mod+Up focus up 84 | bindsym $mod+Right focus right 85 | 86 | # alternatively, you can use the cursor keys: 87 | bindsym $mod+Shift+Left move left 88 | bindsym $mod+Shift+Down move down 89 | bindsym $mod+Shift+Up move up 90 | bindsym $mod+Shift+Right move right 91 | 92 | # Move focused workspace 93 | bindsym $mod+Ctrl+Shift+Left move workspace to output left 94 | bindsym $mod+Ctrl+Shift+Right move workspace to output right 95 | 96 | # split in horizontal orientation 97 | bindsym $mod+s split h 98 | 99 | # split in vertical orientation 100 | bindsym $mod+Shift+S split v 101 | 102 | # enter fullscreen mode for the focused container 103 | bindsym $mod+f fullscreen toggle 104 | 105 | # change container layout (stacked, tabbed, toggle split) 106 | # bindsym $mod+s layout stacking 107 | bindsym $mod+Shift+Tab layout tabbed 108 | bindsym $mod+b layout toggle split 109 | 110 | # Forgiving shortcut when in tab layout 111 | bindsym $mod+Tab focus left 112 | 113 | # toggle tiling / floating 114 | bindsym $mod+a floating toggle 115 | 116 | # change focus between tiling / floating windows 117 | bindsym $mod+u focus mode_toggle 118 | 119 | # focus on the parent container 120 | bindsym $mod+i focus parent 121 | 122 | # focus on the child (undo focusing on parent) 123 | bindsym $mod+Shift+i focus child 124 | 125 | # Make the currently focused window a scratchpad 126 | bindsym $mod+Shift+space move scratchpad 127 | 128 | # Show the first scratchpad window 129 | bindsym $mod+space scratchpad show 130 | 131 | # focus the child container 132 | #bindsym $mod+d focus child 133 | 134 | # Define names for default workspaces for which we configure key bindings later on. 135 | # We use variables to avoid repeating the names in multiple places. 136 | set $ws1 "1: comm" 137 | set $ws2 "2: music" 138 | set $ws3 "3: work" 139 | set $ws4 "4: dev" 140 | set $ws5 "5: misc" 141 | set $ws6 "6" 142 | set $ws7 "7" 143 | set $ws8 "8" 144 | set $ws9 "9" 145 | set $ws10 "10" 146 | 147 | # switch to workspace 148 | bindsym $mod+1 workspace number $ws1 149 | bindsym $mod+2 workspace number $ws2 150 | bindsym $mod+3 workspace number $ws3 151 | bindsym $mod+4 workspace number $ws4 152 | bindsym $mod+5 workspace number $ws5 153 | bindsym $mod+6 workspace number $ws6 154 | bindsym $mod+7 workspace number $ws7 155 | bindsym $mod+8 workspace number $ws8 156 | bindsym $mod+9 workspace number $ws9 157 | bindsym $mod+0 workspace number $ws10 158 | 159 | # move focused container to workspace and switch to workspace 160 | bindsym $mod+Shift+1 move container to workspace number $ws1 , workspace number $ws1 161 | bindsym $mod+Shift+2 move container to workspace number $ws2 , workspace number $ws2 162 | bindsym $mod+Shift+3 move container to workspace number $ws3 , workspace number $ws3 163 | bindsym $mod+Shift+4 move container to workspace number $ws4 , workspace number $ws4 164 | bindsym $mod+Shift+5 move container to workspace number $ws5 , workspace number $ws5 165 | bindsym $mod+Shift+6 move container to workspace number $ws6 , workspace number $ws6 166 | bindsym $mod+Shift+7 move container to workspace number $ws7 , workspace number $ws7 167 | bindsym $mod+Shift+8 move container to workspace number $ws8 , workspace number $ws8 168 | bindsym $mod+Shift+9 move container to workspace number $ws9 , workspace number $ws9 169 | bindsym $mod+Shift+0 move container to workspace number $ws10 , workspace number $ws10 170 | 171 | # move focused container to workspace 172 | bindsym $mod+Ctrl+Shift+1 move container to workspace number $ws1 173 | bindsym $mod+Ctrl+Shift+2 move container to workspace number $ws2 174 | bindsym $mod+Ctrl+Shift+3 move container to workspace number $ws3 175 | bindsym $mod+Ctrl+Shift+4 move container to workspace number $ws4 176 | bindsym $mod+Ctrl+Shift+5 move container to workspace number $ws5 177 | bindsym $mod+Ctrl+Shift+6 move container to workspace number $ws6 178 | bindsym $mod+Ctrl+Shift+7 move container to workspace number $ws7 179 | bindsym $mod+Ctrl+Shift+8 move container to workspace number $ws8 180 | bindsym $mod+Ctrl+Shift+9 move container to workspace number $ws9 181 | bindsym $mod+Ctrl+Shift+0 move container to workspace number $ws10 182 | 183 | # reload the configuration file 184 | bindsym $mod+Shift+C reload 185 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 186 | bindsym $mod+Shift+R restart 187 | # exit i3 (logs you out of your X session) 188 | bindsym $mod+Shift+E exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" 189 | 190 | # resize window (you can also use the mouse for that) 191 | mode "resize" { 192 | # These bindings trigger as soon as you enter the resize mode 193 | 194 | # Pressing left will shrink the window’s width. 195 | # Pressing right will grow the window’s width. 196 | # Pressing up will shrink the window’s height. 197 | # Pressing down will grow the window’s height. 198 | # bindsym j resize shrink width 10 px or 10 ppt 199 | # bindsym k resize grow height 10 px or 10 ppt 200 | # bindsym l resize shrink height 10 px or 10 ppt 201 | # bindsym semicolon resize grow width 10 px or 10 ppt 202 | 203 | # same bindings, but for the arrow keys 204 | bindsym Left resize shrink width 10 px or 10 ppt 205 | bindsym Down resize grow height 10 px or 10 ppt 206 | bindsym Up resize shrink height 10 px or 10 ppt 207 | bindsym Right resize grow width 10 px or 10 ppt 208 | 209 | # back to normal: Enter or Escape or $mod+r 210 | bindsym Return mode "default" 211 | bindsym Escape mode "default" 212 | bindsym $mod+r mode "default" 213 | } 214 | 215 | # Switch to resize mode. 216 | bindsym $mod+r mode "resize" 217 | 218 | # Set the focused window to be of a fixed size. 219 | bindsym $mod+v resize set 300 px 220 | bindsym $mod+Shift+v resize set 400 px 221 | 222 | # Start i3bar to display a workspace bar (plus the system information i3status 223 | # finds out, if available) 224 | bar { 225 | status_command i3status -c ~/.config/i3status/config 226 | workspace_buttons yes 227 | binding_mode_indicator yes 228 | tray_output primary 229 | font pango:monospace 10 230 | colors { 231 | # class border backgrd text 232 | focused_workspace #efcd45 #efcd45 #00000 233 | urgent_workspace #db4939 #cb3929 #ffffff 234 | } 235 | } 236 | # bar { 237 | # status_command "~/code/liquidprompt/contrib/status-bar/print-loop.sh default ~/code/liquidprompt/contrib/presets/misc/status-line.conf" 238 | # } 239 | 240 | # Liquidprompt as a status bar on top-left of the screen. 241 | exec --no-startup-id ~/code/liquidprompt/contrib/status-bar/i3-dock.sh 242 | 243 | # Allow to adjust border width 244 | default_border normal 3 245 | default_floating_border normal 3 246 | hide_edge_borders none 247 | 248 | # class border backgr. text indicator child_border 249 | client.focused #efcd45 #dfbd35 #000000 #cf8200 #f5db65 250 | client.urgent #db4939 #cb3929 #ffffff #ff5949 #ff5949 251 | 252 | # second press goes back to previous workspace 253 | workspace_auto_back_and_forth no 254 | 255 | # Laptop: eDP-1-1, side screen: HDMI-1-2 256 | #workspace $ws1 output eDP-1-1 257 | #workspace $ws2 output eDP-1-1 258 | #workspace $ws3 output HDMI-1-2 259 | #bindsym $mod+Shift+z move workspace to output eDP-1-1 260 | #bindsym $mod+Shift+w move workspace to output HDMI-1-2 261 | 262 | # assign [class="firefox"] $ws1 263 | assign [class="Pavucontrol"] $ws2 264 | assign [class="Blueman-manager"] $ws2 265 | assign [class="Terminator" window_role="btop"] $ws1 266 | assign [class="Terminator" window_role="boinc"] $ws1 267 | 268 | # Xscreensaver as background 269 | # exec --no-startup-id "/usr/libexec/xscreensaver/intermomentary -root -draw-delay 30000 -num-discs 150 -max-riders 50 -max-radius 5000" 270 | 271 | # Video as background 272 | # exec --no-startup-id "mpv --wid=0 --loop --no-terminal --speed=0.5 --video-align-x=0.5 --no-audio --video-sync=display-resample --interpolation --tscale=oversample ~/Vidéos/Blue_Turn_notitle.mp4" 273 | 274 | # Wallpaper as background 275 | exec --no-startup-id feh --bg-scale /home/nojhan/Images/Wood.png 276 | 277 | # Sound controller 278 | exec pavucontrol 279 | 280 | # Bluetooth controller 281 | exec blueman-manager 282 | 283 | # btop system monitor 284 | exec "terminator --profile 'small font' --role btop --command btop" 285 | 286 | # colored boinc client 287 | # exec "terminator --profile 'small font' --role boinc --command 'boinc | colout -t boinc'" 288 | 289 | for_window [window_role="scratchpad"] move window to scratchpad 290 | exec terminator --role scratchpad# 291 | 292 | bindsym $mod+m exec "i3_balance_workspace" 293 | -------------------------------------------------------------------------------- /.config/i3/tabs_in_split.py: -------------------------------------------------------------------------------- 1 | #/usr/bin/env python3 2 | import sys 3 | 4 | # From https://github.com/i3/i3/issues/4207#issuecomment-792874108 5 | # Manage windows as follows: 6 | # - the workspace occupies the full screen, a single container in tabbed mode holding all the current windows 7 | # - one can choose to split that area in half, horizontally or vertically, this creates two new tabbed containers, each occupying half of the screen; one gets the currently-focused window, IIRC, and the other gets the rest of the windows 8 | # - any new window created in any of these new containers ends up as a new tab of one of these containers; new windows don't change the screen layout 9 | # - this process can be repeated on each of these new halves if one so wishes 10 | # In this way, in ion3/notion, the window manager assists you in creating the layout you need, while giving you the possibility of keeping it independent of how many windows you have in a workspace. 11 | 12 | # i3ipc requires installation: 13 | sudo apt install python3-i3ipc 14 | # pip3 install i3ipc 15 | 16 | from i3ipc import Connection 17 | 18 | 19 | def tab_and_move_containers(con1, con2, other_cons): 20 | con1.command('split horizontal') # force creation of a new parent container for this one 21 | con1.command('layout tabbed') 22 | con2.command('split horizontal') # force creation of a new parent container for this one 23 | con2.command('layout tabbed') 24 | 25 | con2.command('mark target') 26 | [con.command('move window to mark target') for con in other_cons] 27 | con2.command('unmark target') 28 | 29 | 30 | def main(): 31 | direction = sys.argv[1] 32 | i3 = Connection() 33 | 34 | con1 = i3.get_tree().find_focused() 35 | cons = con1.parent.descendants() 36 | if len(cons) < 2: 37 | return 38 | 39 | other_cons = [con for con in cons if con.id != con1.id] 40 | con2 = other_cons.pop() 41 | 42 | # "bisect" the area of interest (split it horiz/vert) 43 | if direction == 'h': 44 | i3.command("layout splith") 45 | else: 46 | i3.command("layout splitv") 47 | 48 | # relocate containers so there are only two of them visible; 49 | # con1 will get a tabbed container all to itself, 50 | # con2 and other_cons will go in the other tabbed container 51 | # tab_and_move_containers(con1, con2, other_cons) 52 | tab_and_move_containers(con2, con1, other_cons) 53 | 54 | 55 | if __name__ == '__main__': 56 | main() 57 | 58 | -------------------------------------------------------------------------------- /.config/i3status/config: -------------------------------------------------------------------------------- 1 | # i3status configuration file. 2 | # see "man i3status" for documentation. 3 | 4 | # It is important that this file is edited as UTF-8. 5 | # The following line should contain a sharp s: 6 | # ß 7 | # If the above line is not correctly displayed, fix your editor first! 8 | 9 | general { 10 | colors = true 11 | color_good = "#6f9dfe" 12 | color_degraded = "#efcd45" 13 | color_bad = "#db4939" 14 | separator = " · " 15 | } 16 | 17 | # order += "ipv6" 18 | order += "wireless _first_" 19 | order += "ethernet _first_" 20 | order += "battery all" 21 | order += "disk /" 22 | order += "load" 23 | order += "memory" 24 | order += "tztime local" 25 | 26 | wireless _first_ { 27 | format_up = "wifi: %ip @ %essid (%quality)" 28 | format_down = "wifi: down" 29 | } 30 | 31 | ethernet _first_ { 32 | format_up = "eth: %ip (%speed)" 33 | format_down = "eth: down" 34 | } 35 | 36 | battery all { 37 | format = "batt: %status %percentage %remaining" 38 | } 39 | 40 | disk "/" { 41 | format = "/: %avail" 42 | } 43 | 44 | load { 45 | format = "load: %1min" 46 | } 47 | 48 | memory { 49 | format = "mem: %used/%available" 50 | threshold_degraded = "1G" 51 | format_degraded = "MEMORY < %available" 52 | } 53 | 54 | tztime local { 55 | format = "%Y-%m-%d %H:%M:%S" 56 | } 57 | -------------------------------------------------------------------------------- /.config/vifm/colors/nojhan.vifm: -------------------------------------------------------------------------------- 1 | " vim: filetype=vifm : 2 | 3 | " xterm color customization: 4 | " 5 | " ! regular (not bold) red 6 | " XTerm*color1: #ff3030 7 | " ! regular (not bold) green 8 | " XTerm*color2: #70dd70 9 | " ! regular (not bold) yellow 10 | " XTerm*color3: #f0f000 11 | " ! regular (not bold) blue 12 | " XTerm*color4: #6060dd 13 | " ! bold red 14 | " XTerm*color9: #ff8080 15 | " ! bold green 16 | " XTerm*color10: #20dd20 17 | " ! bold yellow 18 | " XTerm*color11: #e0e000 19 | " ! bold blue 20 | " XTerm*color12: #a8a8ff 21 | 22 | highlight clear 23 | highlight Win cterm=none ctermfg=white ctermbg=default 24 | highlight BrokenLink cterm=bold ctermfg=red ctermbg=default 25 | highlight Socket cterm=bold ctermfg=magenta ctermbg=default 26 | highlight Device cterm=bold,reverse ctermfg=red ctermbg=default 27 | highlight Fifo cterm=bold,reverse ctermfg=cyan ctermbg=default 28 | highlight CurrLine cterm=reverse,bold ctermfg=default ctermbg=default 29 | highlight TopLine cterm=none ctermfg=black ctermbg=white 30 | highlight TopLineSel cterm=underline ctermfg=black ctermbg=default 31 | highlight StatusLine cterm=none ctermfg=black ctermbg=white 32 | highlight WildMenu cterm=underline,bold,reverse ctermfg=yellow ctermbg=black 33 | highlight CmdLine cterm=bold ctermfg=white ctermbg=default 34 | highlight ErrorMsg cterm=bold ctermfg=white ctermbg=red 35 | highlight Border cterm=none ctermfg=white ctermbg=default 36 | highlight OtherLine cterm=reverse ctermfg=234 ctermbg=white 37 | highlight SuggestBox cterm=bold,reverse ctermfg=cyan ctermbg=default 38 | 39 | " no 256-color palette on Windows 40 | if $OS == 'Windows_NT' 41 | highlight Directory cterm=bold ctermfg=cyan ctermbg=default 42 | highlight Link cterm=bold ctermfg=yellow ctermbg=default 43 | highlight Executable cterm=bold ctermfg=default ctermbg=default 44 | highlight Selected cterm=bold ctermfg=magenta ctermbg=default 45 | highlight CmpMismatch cterm=bold ctermfg=white ctermbg=red 46 | finish 47 | endif 48 | 49 | highlight Directory cterm=bold ctermfg=123 ctermbg=default 50 | highlight Link cterm=bold ctermfg=229 ctermbg=default 51 | highlight Executable cterm=bold ctermfg=default ctermbg=default 52 | highlight Selected cterm=bold ctermfg=213 ctermbg=default 53 | highlight CmpMismatch cterm=bold ctermfg=white ctermbg=88 54 | 55 | " build system files 56 | highlight {Makefile,Makefile.am,Makefile.win,*.mak,*.mk, 57 | \CMakeLists.txt,configure,Doxyfile,Doxifile.in, 58 | \*.cmake,ForRelease,*.conf,*.ini,*.in,*.cfg} 59 | \ cterm=none ctermfg=160 ctermbg=default 60 | 61 | " software documentation 62 | highlight {*.md,*.asciidoc,*.txt,COPYRIGHT,COPYING*,BUGS,ChangeLog*,FAQ,INSTALL*,LICEN[CS]E,NEWS, 63 | \README*,AUTHORS,TODO,THANKS,CONTRIBUTING} 64 | \ cterm=none ctermfg=34 ctermbg=default 65 | 66 | " archives 67 | highlight {*.7z,*.ace,*.arj,*.bz2,*.cpio,*.deb,*.dz,*.gz,*.jar,*.lzh,*.lzma, 68 | \*.rar,*.rpm,*.rz,*.tar,*.taz,*.tb2,*.tbz,*.tbz2,*.tgz,*.tlz,*.trz, 69 | \*.txz,*.tz,*.tz2,*.xz,*.z,*.zip,*.zoo} 70 | \ cterm=none ctermfg=215 ctermbg=default 71 | 72 | " documents 73 | highlight {*.djvu,*.htm,*.html,*.shtml,*.css,*.markdown,*.md,*[^0-9].[1-9], 74 | \*.mkd,*.org,*.pandoc,*.pdc,*.pdf,*.epub,*.fb2,*.tex,*.txt,*.xhtml, 75 | \*.xml,*.pptx,*.ppt,*.doc,*.docx,*.xls,*.xls[mx],*.mobi} 76 | \ cterm=none ctermfg=217 ctermbg=default 77 | 78 | " media 79 | highlight {*.aac,*.anx,*.asf,*.au,*.avi,*.ts,*.axa,*.axv,*.divx,*.flac,*.m2a, 80 | \*.m2v,*.m4a,*.m4p,*.m4v,*.mid,*.midi,*.mka,*.mkv,*.mov,*.mp3,*.mp4, 81 | \*.flv,*.mp4v,*.mpc,*.mpeg,*.mpg,*.nuv,*.oga,*.ogg,*.ogv,*.ogx,*.pbm, 82 | \*.pgm,*.qt,*.ra,*.ram,*.rm,*.spx,*.vob,*.wav,*.wma,*.wmv,*.xvid, 83 | \*.ac3} 84 | \ cterm=none ctermfg=49 ctermbg=default 85 | 86 | " images 87 | highlight {*.bmp,*.gif,*.jpeg,*.jpg,*.ico,*.png,*.ppm,*.svg,*.svgz,*.tga,*.tif, 88 | \*.tiff,*.xbm,*.xcf,*.xpm,*.xspf,*.xwd} 89 | \ cterm=none ctermfg=117 ctermbg=default 90 | 91 | " executables 92 | highlight {*.sh,*.bash,*.bat,*.btm,*.cmd,*.com,*.dll,*.exe,*.run,*.msu,*.msi} 93 | \ cterm=none ctermfg=76 ctermbg=default 94 | 95 | " source code 96 | highlight {*.patch,*.diff} 97 | \ cterm=none ctermfg=193 ctermbg=default 98 | highlight {*.py,*.php} 99 | \ cterm=none ctermfg=220 ctermbg=default 100 | highlight {*.h,*.hh,*.hh} 101 | \ cterm=none ctermfg=141 ctermbg=default 102 | highlight {*.hpp,*.hht} 103 | \ cterm=none ctermfg=201 ctermbg=default 104 | highlight {*.c,*.cc,*.cpp} 105 | \ cterm=none ctermfg=196 ctermbg=default 106 | -------------------------------------------------------------------------------- /.config/vifm/vifmrc: -------------------------------------------------------------------------------- 1 | " vim: filetype=vifm : 2 | " Sample configuration file for vifm (last updated: 2 June, 2019) 3 | " You can edit this file by hand. 4 | " The " character at the beginning of a line comments out the line. 5 | " Blank lines are ignored. 6 | " The basic format for each item is shown with an example. 7 | 8 | " ------------------------------------------------------------------------------ 9 | 10 | " Command used to edit files in various contexts. The default is vim. 11 | " If you would like to use another vi clone such as Elvis or Vile 12 | " you will need to change this setting. 13 | 14 | set vicmd=kak 15 | " set vicmd=elvis\ -G\ termcap 16 | " set vicmd=vile 17 | 18 | " This makes vifm perform file operations on its own instead of relying on 19 | " standard utilities like `cp`. While using `cp` and alike is a more universal 20 | " solution, it's also much slower when processing large amounts of files and 21 | " doesn't support progress measuring. 22 | 23 | set syscalls 24 | 25 | " Trash Directory 26 | " The default is to move files that are deleted with dd or :d to 27 | " the trash directory. If you change this you will not be able to move 28 | " files by deleting them and then using p to put the file in the new location. 29 | " I recommend not changing this until you are familiar with vifm. 30 | " This probably shouldn't be an option. 31 | 32 | set trash 33 | 34 | " This is how many directories to store in the directory history. 35 | 36 | set history=100 37 | 38 | " Automatically resolve symbolic links on l or Enter. 39 | 40 | set nofollowlinks 41 | 42 | " With this option turned on you can run partially entered commands with 43 | " unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te). 44 | 45 | set fastrun 46 | 47 | " Natural sort of (version) numbers within text. 48 | 49 | set sortnumbers 50 | 51 | " Maximum number of changes that can be undone. 52 | 53 | set undolevels=100 54 | 55 | " Use Vim's format of help file (has highlighting and "hyperlinks"). 56 | " If you would rather use a plain text help file set novimhelp. 57 | 58 | set novimhelp 59 | 60 | " If you would like to run an executable file when you 61 | " press return on the file name set this. 62 | 63 | set norunexec 64 | 65 | " Selected color scheme 66 | 67 | colorscheme nojhan 68 | 69 | " Format for displaying time in file list. For example: 70 | " TIME_STAMP_FORMAT=%m/%d-%H:%M 71 | " See man date or man strftime for details. 72 | 73 | set timefmt=%m/%d\ %H:%M 74 | 75 | " Show list of matches on tab completion in command-line mode 76 | 77 | set wildmenu 78 | 79 | " Display completions in a form of popup with descriptions of the matches 80 | 81 | set wildstyle=popup 82 | 83 | " Display suggestions in normal, visual and view modes for keys, marks and 84 | " registers (at most 5 files). In other view, when available. 85 | 86 | set suggestoptions=normal,visual,view,otherpane,keys,marks,registers 87 | 88 | " Ignore case in search patterns unless it contains at least one uppercase 89 | " letter 90 | 91 | set ignorecase 92 | set smartcase 93 | 94 | " Don't highlight search results automatically 95 | 96 | set nohlsearch 97 | 98 | " Use increment searching (search while typing) 99 | set incsearch 100 | 101 | " Try to leave some space from cursor to upper/lower border in lists 102 | 103 | set scrolloff=4 104 | 105 | " Don't do too many requests to slow file systems 106 | 107 | if !has('win') 108 | set slowfs=curlftpfs 109 | endif 110 | 111 | " Set custom status line look 112 | 113 | set statusline=" Hint: %z%= %A %10u:%-7g %15s %20d " 114 | 115 | " ------------------------------------------------------------------------------ 116 | 117 | " :mark mark /full/directory/path [filename] 118 | 119 | mark b ~/bin/ 120 | mark h ~/ 121 | 122 | " ------------------------------------------------------------------------------ 123 | 124 | " :com[mand][!] command_name action 125 | " The following macros can be used in a command 126 | " %a is replaced with the user arguments. 127 | " %c the current file under the cursor. 128 | " %C the current file under the cursor in the other directory. 129 | " %f the current selected file, or files. 130 | " %F the current selected file, or files in the other directory. 131 | " %b same as %f %F. 132 | " %d the current directory name. 133 | " %D the other window directory name. 134 | " %m run the command in a menu window 135 | 136 | command! df df -h %m 2> /dev/null 137 | command! diff vim -d %f %F 138 | command! zip zip -r %f.zip %f 139 | command! run !! ./%f 140 | command! make !!make %a 141 | command! mkcd :mkdir %a | cd %a 142 | command! vgrep vim "+grep %a" 143 | command! reload :write | restart 144 | 145 | " ------------------------------------------------------------------------------ 146 | 147 | " The file type is for the default programs to be used with 148 | " a file extension. 149 | " :filetype pattern1,pattern2 defaultprogram,program2 150 | " :fileviewer pattern1,pattern2 consoleviewer 151 | " The other programs for the file type can be accessed with the :file command 152 | " The command macros %f, %F, %d, %F may be used in the commands. 153 | " The %a macro is ignored. To use a % you must put %%. 154 | 155 | " For automated FUSE mounts, you must register an extension with :file[x]type 156 | " in one of following formats: 157 | " 158 | " :filetype extensions FUSE_MOUNT|some_mount_command using %SOURCE_FILE and %DESTINATION_DIR variables 159 | " %SOURCE_FILE and %DESTINATION_DIR are filled in by vifm at runtime. 160 | " A sample line might look like this: 161 | " :filetype *.zip,*.jar,*.war,*.ear FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR 162 | " 163 | " :filetype extensions FUSE_MOUNT2|some_mount_command using %PARAM and %DESTINATION_DIR variables 164 | " %PARAM and %DESTINATION_DIR are filled in by vifm at runtime. 165 | " A sample line might look like this: 166 | " :filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR 167 | " %PARAM value is filled from the first line of file (whole line). 168 | " Example first line for SshMount filetype: root@127.0.0.1:/ 169 | " 170 | " You can also add %CLEAR if you want to clear screen before running FUSE 171 | " program. 172 | 173 | " Pdf 174 | filextype *.pdf zathura %c %i &, apvlv %c, xpdf %c 175 | fileviewer *.pdf pdftotext -nopgbrk %c - 176 | 177 | " PostScript 178 | filextype *.ps,*.eps,*.ps.gz 179 | \ {View in zathura} 180 | \ zathura %f, 181 | \ {View in gv} 182 | \ gv %c %i &, 183 | 184 | " Djvu 185 | filextype *.djvu 186 | \ {View in zathura} 187 | \ zathura %f, 188 | \ {View in apvlv} 189 | \ apvlv %f, 190 | 191 | " Audio 192 | filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus 193 | \ {Play using ffplay} 194 | \ ffplay -nodisp -autoexit %c, 195 | \ {Play using MPlayer} 196 | \ mplayer %f, 197 | fileviewer *.mp3 mp3info 198 | fileviewer *.flac soxi 199 | 200 | " Video 201 | filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, 202 | \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx, 203 | \*.as[fx] 204 | \ {View using ffplay} 205 | \ ffplay -fs -autoexit %f, 206 | \ {View using Dragon} 207 | \ dragon %f:p, 208 | \ {View using mplayer} 209 | \ mplayer %f, 210 | fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, 211 | \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx, 212 | \*.as[fx] 213 | \ ffprobe -pretty %c 2>&1 214 | 215 | " Web 216 | filextype *.html,*.htm 217 | \ {Open with dwb} 218 | \ dwb %f %i &, 219 | \ {Open with firefox} 220 | \ firefox %f &, 221 | \ {Open with uzbl} 222 | \ uzbl-browser %f %i &, 223 | filetype *.html,*.htm links, lynx 224 | 225 | " Object 226 | filetype *.o nm %f | less 227 | 228 | " Man page 229 | filetype *.[1-8] man ./%c 230 | fileviewer *.[1-8] man ./%c | col -b 231 | 232 | " Images 233 | filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm 234 | \ {View in sxiv} 235 | \ sxiv %f, 236 | \ {View in gpicview} 237 | \ gpicview %c, 238 | \ {View in shotwell} 239 | \ shotwell, 240 | fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm 241 | \ identify %f 242 | 243 | " OpenRaster 244 | filextype *.ora 245 | \ {Edit in MyPaint} 246 | \ mypaint %f, 247 | 248 | " Mindmap 249 | filextype *.vym 250 | \ {Open with VYM} 251 | \ vym %f &, 252 | 253 | " MD5 254 | filetype *.md5 255 | \ {Check MD5 hash sum} 256 | \ md5sum -c %f %S, 257 | 258 | " SHA1 259 | filetype *.sha1 260 | \ {Check SHA1 hash sum} 261 | \ sha1sum -c %f %S, 262 | 263 | " SHA256 264 | filetype *.sha256 265 | \ {Check SHA256 hash sum} 266 | \ sha256sum -c %f %S, 267 | 268 | " SHA512 269 | filetype *.sha512 270 | \ {Check SHA512 hash sum} 271 | \ sha512sum -c %f %S, 272 | 273 | " GPG signature 274 | filetype *.asc 275 | \ {Check signature} 276 | \ !!gpg --verify %c, 277 | 278 | " Torrent 279 | filetype *.torrent ktorrent %f & 280 | fileviewer *.torrent dumptorrent -v %c 281 | 282 | " FuseZipMount 283 | filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg 284 | \ {Mount with fuse-zip} 285 | \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR, 286 | \ {View contents} 287 | \ zip -sf %c | less, 288 | \ {Extract here} 289 | \ tar -xf %c, 290 | fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c 291 | 292 | " ArchiveMount 293 | filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz 294 | \ {Mount with archivemount} 295 | \ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR, 296 | fileviewer *.tgz,*.tar.gz tar -tzf %c 297 | fileviewer *.tar.bz2,*.tbz2 tar -tjf %c 298 | fileviewer *.tar.txz,*.txz xz --list %c 299 | fileviewer *.tar tar -tf %c 300 | 301 | " Rar2FsMount and rar archives 302 | filetype *.rar 303 | \ {Mount with rar2fs} 304 | \ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR, 305 | fileviewer *.rar unrar v %c 306 | 307 | " IsoMount 308 | filetype *.iso 309 | \ {Mount with fuseiso} 310 | \ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR, 311 | 312 | " SshMount 313 | filetype *.ssh 314 | \ {Mount with sshfs} 315 | \ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND, 316 | 317 | " FtpMount 318 | filetype *.ftp 319 | \ {Mount with curlftpfs} 320 | \ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND, 321 | 322 | " Fuse7z and 7z archives 323 | filetype *.7z 324 | \ {Mount with fuse-7z} 325 | \ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR, 326 | fileviewer *.7z 7z l %c 327 | 328 | " Office files 329 | filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f & 330 | fileviewer *.doc catdoc %c 331 | fileviewer *.docx docx2txt.pl %f - 332 | 333 | " TuDu files 334 | filetype *.tudu tudu -f %c 335 | 336 | " Qt projects 337 | filextype *.pro qtcreator %f & 338 | 339 | " Directories 340 | filextype */ 341 | \ {View in thunar} 342 | \ Thunar %f &, 343 | 344 | " Syntax highlighting in preview 345 | " 346 | " Explicitly set highlight type for some extensions 347 | " 348 | " 256-color terminal 349 | " fileviewer *.[ch],*.[ch]pp highlight -O xterm256 -s dante --syntax c %c 350 | " fileviewer Makefile,Makefile.* highlight -O xterm256 -s dante --syntax make %c 351 | " 352 | " 16-color terminal 353 | " fileviewer *.c,*.h highlight -O ansi -s dante %c 354 | " 355 | " Or leave it for automatic detection 356 | " 357 | " fileviewer *[^/] pygmentize -O style=monokai -f console256 -g 358 | 359 | " Displaying pictures in terminal 360 | " 361 | " fileviewer *.jpg,*.png shellpic %c 362 | 363 | " Open all other files with default system programs (you can also remove all 364 | " :file[x]type commands above to ensure they don't interfere with system-wide 365 | " settings). By default all unknown files are opened with 'vi[x]cmd' 366 | " uncommenting one of lines below will result in ignoring 'vi[x]cmd' option 367 | " for unknown file types. 368 | " For *nix: 369 | " filetype * xdg-open 370 | " For OS X: 371 | " filetype * open 372 | " For Windows: 373 | " filetype * start, explorer 374 | 375 | " ------------------------------------------------------------------------------ 376 | 377 | " What should be saved automatically between vifm sessions. Drop "savedirs" 378 | " value if you don't want vifm to remember last visited directories for you. 379 | set vifminfo=dhistory,savedirs,chistory,state,tui,shistory, 380 | \phistory,fhistory,dirstack,registers,bookmarks,bmarks 381 | 382 | " ------------------------------------------------------------------------------ 383 | 384 | " Examples of configuring both panels 385 | 386 | " Customize view columns a bit (enable ellipsis for truncated file names) 387 | " 388 | set viewcolumns=-{name}...,3{ext}. 389 | 390 | " Filter-out build and temporary files 391 | " 392 | " filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/ 393 | 394 | " ------------------------------------------------------------------------------ 395 | 396 | " Toggle tree view 397 | nnoremap t :tree! 398 | 399 | " Start shell in current directory 400 | nnoremap s :shell 401 | 402 | " Display sorting dialog 403 | nnoremap S :sort 404 | 405 | " Toggle visibility of preview window 406 | nnoremap w :view 407 | vnoremap w :viewgv 408 | 409 | " Open file in main window of the IDE session of kakoune 410 | nnoremap e :!echo "evaluate-commands -client main edit %f:p" | kak -p ide 411 | nnoremap :!echo "evaluate-commands -client main edit %f:p" | kak -p ide 412 | 413 | " Open file in a new session of kakoune 414 | nnoremap E :!kak %f:p 415 | 416 | " Open file in existing instance of gvim 417 | nnoremap o :!gvim --remote-tab-silent %f 418 | " Open file in new instance of gvim 419 | nnoremap O :!gvim %f 420 | 421 | " Open file in the background using its default program 422 | nnoremap gb :file &l 423 | 424 | " Interaction with system clipboard 425 | if has('win') 426 | " Yank current directory path to Windows clipboard with forward slashes 427 | nnoremap yp :!echo %"d:gs!\!/! %i | clip 428 | " Yank path to current file to Windows clipboard with forward slashes 429 | nnoremap yf :!echo %"c:gs!\!/! %i | clip 430 | elseif executable('xclip') 431 | " Yank current directory path into the clipboard 432 | nnoremap yd :!echo %d | xclip %i 433 | " Yank current file path into the clipboard 434 | nnoremap yf :!echo %c:p | xclip %i 435 | elseif executable('xsel') 436 | " Yank current directory path into primary and selection clipboards 437 | nnoremap yd :!echo -n %d | xsel --input --primary %i && 438 | \ echo -n %d | xsel --clipboard --input %i 439 | " Yank current file path into into primary and selection clipboards 440 | nnoremap yf :!echo -n %c:p | xsel --input --primary %i && 441 | \ echo -n %c:p | xsel --clipboard --input %i 442 | endif 443 | 444 | " Mappings for faster renaming 445 | nnoremap I cw 446 | nnoremap cc cw 447 | nnoremap A cw 448 | 449 | " Open console in current directory 450 | nnoremap ,t :!xterm & 451 | 452 | " Open editor to edit vifmrc and apply settings after returning to vifm 453 | nnoremap ,c :write | edit $MYVIFMRC | restart 454 | " Open gvim to edit vifmrc 455 | nnoremap ,C :!gvim --remote-tab-silent $MYVIFMRC & 456 | 457 | " Toggle wrap setting on ,w key 458 | nnoremap ,w :set wrap! 459 | 460 | " Example of standard two-panel file managers mappings 461 | nnoremap :!less %f 462 | nnoremap :edit 463 | nnoremap :copy 464 | nnoremap :move 465 | nnoremap :mkdir 466 | nnoremap :delete 467 | 468 | " ------------------------------------------------------------------------------ 469 | 470 | " Various customization examples 471 | 472 | " Use ag (the silver searcher) instead of grep 473 | " 474 | " set grepprg='ag --line-numbers %i %a %s' 475 | 476 | " Add additional place to look for executables 477 | " 478 | " let $PATH = $HOME.'/bin/fuse:'.$PATH 479 | 480 | " Block particular shortcut 481 | " 482 | " nnoremap 483 | 484 | " Export IPC name of current instance as environment variable and use it to 485 | " communicate with the instance later. 486 | " 487 | " It can be used in some shell script that gets run from inside vifm, for 488 | " example, like this: 489 | " vifm --server-name "$VIFM_SERVER_NAME" --remote +"cd '$PWD'" 490 | " 491 | " let $VIFM_SERVER_NAME = v:servername 492 | -------------------------------------------------------------------------------- /.gdbinit: -------------------------------------------------------------------------------- 1 | 2 | # STL pretty-printers 3 | # python 4 | # import sys 5 | #sys.path.insert(0, '/local/nojhan/CGAL-4.6-beta1/auxiliary/gdb/python/CGAL') 6 | #import printers #FIXME 7 | 8 | # sys.path.insert(0, '') 9 | # from libstdcxx.v6.printers import register_libstdcxx_printers 10 | # register_libstdcxx_printers(None) 11 | 12 | # sys.path.insert(0,'/home/nojhan/code/dotfiles/gdb/') 13 | # from nlohmannjson import register_json_printer 14 | # register_json_printer() 15 | # end 16 | 17 | set confirm off 18 | 19 | # Reversed yellow >>>, underlined green frame name, yellow »»» 20 | # set extended-prompt \[\e[7;33m\]>>>\[\e[0m\]\[\] \[\e[4;32m\]\f\[\e[0m\]\[\]\[\e[0;33m\] \n»»» \[\e[0m\] 21 | 22 | 23 | # Don't wrap line or the coloring regexp won't work. 24 | set width 0 25 | 26 | # Create a named pipe to get outputs from gdb 27 | shell test -e /tmp/coloutPipe && rm /tmp/coloutPipe 28 | shell mkfifo /tmp/coloutPipe 29 | 30 | define logging_on 31 | # Instead of printing on stdout only, log everything... 32 | set logging redirect on 33 | # ... in our named pipe. 34 | set logging file /tmp/coloutPipe 35 | set logging on 36 | end 37 | 38 | define logging_off 39 | set logging off 40 | set logging redirect off 41 | # Because both gdb and our commands are writing on the same pipe at the same 42 | # time, it is more than probable that gdb will end before our (higher level) 43 | # commands. The gdb prompt will thus render before the result of the command, 44 | # which is highly akward. To prevent this, we need to wait before displaying 45 | # the prompt again. The more your commands are complex, the higher you will 46 | # need to set this. 47 | shell sleep 0.4s 48 | end 49 | 50 | 51 | define hook-break 52 | # Don't forget to run the command in the background 53 | shell cat /tmp/coloutPipe | colout "(Breakpoint) ([0-9]+) at (0x\S+): file (.+/)([^/]+), line ([0-9]+)." blue,red,cyan,none,white,yellow normal,bold,normal,normal,bold,normal & 54 | # You should start to consume the pipe before actually redirecting the command output into it. 55 | logging_on 56 | end 57 | define hookpost-break 58 | logging_off 59 | end 60 | 61 | 62 | define hook-run 63 | shell cat /tmp/coloutPipe | colout "^(Program received signal )(.+), (.+).$" yellow,red,yellow normal,bold | colout "^(Breakpoint) ([0-9]+),*\s+(0x\S+ )*(in )*(\S+) (\(.*\)) at (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,none,green,cpp,none,white,white,yellow normal,bold,normal,normal,bold,normal,normal,bold,bold,bold | colout "^(Starting program): (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" green,none,white,white,yellow normal,normal,bold,bold,bold | colout "^[0-9]+\s+(.*)$" Cpp & 64 | logging_on 65 | end 66 | define hookpost-run 67 | logging_off 68 | end 69 | 70 | 71 | define hook-continue 72 | shell cat /tmp/coloutPipe | colout "^(Program received signal )(.*)(,.*)$" yellow,red,yellow bold | colout "^(Breakpoint) ([0-9]+),*\s+(0x\S+ )*(in )*(\S+) (\(.*\)) at (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,none,green,cpp,none,white,white,yellow normal,bold,normal,normal,bold,normal,normal,bold,bold,bold | colout "^[0-9]+\s+(.*)$" Cpp & 73 | logging_on 74 | end 75 | define hookpost-continue 76 | logging_off 77 | end 78 | 79 | 80 | # Full syntax highlighting for the `list` command. 81 | define hook-list 82 | #shell cat /tmp/coloutPipe | colout --all --source cpp & 83 | shell cat /tmp/coloutPipe | colout "^([0-9]+)\s*(.*)$" red,Cpp & 84 | logging_on 85 | end 86 | # Don't forget the hookpost- or next coloring commands will fail. 87 | define hookpost-list 88 | logging_off 89 | end 90 | 91 | 92 | define hook-backtrace 93 | # Note: match path = [path]file[.ext] = (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)) 94 | # This line color highlights: 95 | # – lines that link to source code, 96 | # – function call in green, 97 | # – arguments names in yellow, values in magenta, 98 | # — the parent directory in bold red (assuming that the debug session would be in a "project/build/" directory). 99 | shell cat /tmp/coloutPipe | colout "^(#)([0-9]+)\s+(0x\S+ )*(in )*(.*) (\(.*\)) (at) (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,red,green,magenta,red,none,white,white,yellow normal,bold,normal,normal,normal,normal,normal,bold,bold,bold | colout "([\w\s]*?)(=)([^,]*?)([,\)])" yellow,blue,magenta,blue normal | colout "/($(basename $(dirname $(pwd))))/" red bold & 100 | logging_on 101 | end 102 | define hookpost-backtrace 103 | logging_off 104 | end 105 | 106 | 107 | define info hook-breakpoints 108 | shell cat /tmp/coloutPipe | colout "^([0-9]+)" red bold | colout "\sy\s" green | colout "\sn\s" red | colout "breakpoint" green normal | colout "watchpoint" orange normal | colout "\s0x\S+\s" blue normal | colout "(.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)$" none,white,white,yellow normal,bold & 109 | logging_on 110 | end 111 | define info hookpost-breakpoints 112 | logging_off 113 | end 114 | 115 | 116 | define info hook-line 117 | shell cat /tmp/coloutPipe | colout "^Line ([0-9]+) of \"(.*/)?(?:$|(.+?)(?:(\.[^.]*)|))\"" yellow,none,white,white bold | colout "(0x\S+) <(\S+)\+([0-9]+)>" blue,green,blue normal & 118 | logging_on 119 | end 120 | define info hookpost-line 121 | logging_off 122 | end 123 | 124 | 125 | define hook-frame 126 | #shell cat /tmp/coloutPipe | colout "^(#)([0-9]+)\s+(0x\S+ )*(in )*(.*) (at) (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,red,green,red,magenta,none,white,white,yellow normal,bold,normal,normal,bold,normal,normal,bold,bold,bold | colout "^([0-9]+)\s+(.*)$" yellow,Cpp & 127 | shell cat /tmp/coloutPipe | colout "^(#)([0-9]+)\s+(0x\S+ )*(in )*(.*) (\(.*\)) (at) (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,red,green,magenta,red,none,white,white,yellow normal,bold,normal,normal,normal,normal,normal,bold,bold,bold | colout "([\w\s]*?)(=)([^,]*?)([,\)])" yellow,blue,magenta,blue normal & 128 | logging_on 129 | end 130 | define hookpost-frame 131 | logging_off 132 | end 133 | 134 | # Don't forget to clean the adhoc pipe. 135 | define hook-quit 136 | set confirm off 137 | shell rm -f /tmp/coloutPipe 138 | end 139 | 140 | define hook-display 141 | shell cat /tmp/coloutPipe | colout "^([0-9]+)(:) (.+?) (=) " red,blue,white,blue normal,normal,bold,normal | colout "(@)(0x\S+)(:)" red,blue,red normal & 142 | logging_on 143 | end 144 | define hookpost-display 145 | logging_off 146 | end 147 | 148 | 149 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = nojhan 3 | email = nojhan@nojhan.net 4 | [includeIf "gitdir:~/travail/**"] 5 | path = ~/travail/.gitconfig 6 | [credential] 7 | helper = store 8 | [commit] 9 | # Adds -v to commit by default 10 | verbose = true 11 | [alias] 12 | st = status 13 | ci = commit -v 14 | cb = checkout -b # create branch 15 | ca = commit -v -a 16 | co = checkout 17 | lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" 18 | up = pull origin 19 | di = diff 20 | br = branch 21 | sta = stash 22 | [color] 23 | ui = auto 24 | [push] 25 | default = simple 26 | # push new tags along with commits being pushed 27 | followtags = true 28 | [pull] 29 | rebase = true 30 | [rebase] 31 | instructionFormat = (%an <%ae>) %s 32 | # You commit it with git commit --fixup OLD_COMMIT_ID, 33 | # which gives the new commit the commit message fixup! add parsing code 34 | # Now, when you run git rebase --autosquash main, 35 | # it will automatically combine all the fixup! commits with their targets 36 | autosquash = true 37 | [diff "odf"] 38 | textconv=odt2txt 39 | [diff] 40 | algorithm = histogram 41 | # uses different colours to highlight lines in diffs that have been “moved” 42 | colorMoved = default 43 | [merge] 44 | # Adds a middle section in 3-ways conflict sections. 45 | conflictstyle = zdiff3 46 | tool = meld 47 | [init] 48 | defaultBranch = main 49 | [help] 50 | # run the spelling suggestions automatically, you can set: 51 | # - help.autocorrect to 1 (run after 0.1 seconds), 52 | # - 10 (run after 1 second), 53 | # - immediate (run immediately), 54 | # - or prompt (run after prompting) 55 | autocorrect = prompt 56 | [status] 57 | submoduleSummary = true 58 | [branch] 59 | # makes git branch sort by most recently used branches instead of alphabetical 60 | sort = committerdate 61 | [log] 62 | date = iso 63 | 64 | [core] 65 | # delta will used as the default pager for git 66 | # and ov as the default pager for delta 67 | # the pager will be overloaded via the [pager] section for a few commands 68 | pager = delta --pager='ov -F' 69 | 70 | [pager] 71 | # overload delta pager for some commands 72 | show = delta --pager='ov -F --header 3' 73 | 74 | # We are now overloading some commands via "delta features" 75 | # This allows us to use different pager per git command 76 | # It allows to maintain a simpler config file and avoid escaping quotes 77 | diff = delta --features ov-diff 78 | log = delta --features ov-log 79 | 80 | [delta] 81 | navigate = true 82 | side-by-side = true 83 | file-style = yellow 84 | 85 | # we define the delta feature "ov-diff" we are using for git diff 86 | [delta "ov-diff"] 87 | # the idea is to overload the pager used by delta when using git diff 88 | # we are using the same pattern used by delta when the default pager (less) is used 89 | # using ov section feature brings a better experience 90 | pager=ov -F --section-delimiter '^(commit|added:|removed:|renamed:|Δ)' --section-header --pattern '•' 91 | 92 | # we define the delta feature "ov-log" we are using for git log 93 | [delta "ov-log"] 94 | # the idea is to overload the pager used by delta when using git log 95 | # using ov section feature brings a better experience 96 | pager=ov -F --section-delimiter '^commit' --section-header-num 3 97 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule ".vim/bundle/vim-pathogen"] 2 | path = .vim/bundle/vim-pathogen 3 | url = http://github.com/tpope/vim-pathogen.git 4 | [submodule ".vim/bundle/nerdtree"] 5 | path = .vim/bundle/nerdtree 6 | url = http://github.com/scrooloose/nerdtree.git 7 | [submodule ".vim/bundle/vim-statline"] 8 | path = .vim/bundle/vim-statline 9 | url = http://github.com/millermedeiros/vim-statline.git 10 | [submodule ".vim/bundle/supertab"] 11 | path = .vim/bundle/supertab 12 | url = http://github.com/ervandew/supertab.git 13 | [submodule ".vim/bundle/tlib_vim"] 14 | path = .vim/bundle/tlib_vim 15 | url = http://github.com/tomtom/tlib_vim.git 16 | [submodule ".vim/bundle/tcomment_vim"] 17 | path = .vim/bundle/tcomment_vim 18 | url = http://github.com/tomtom/tcomment_vim.git 19 | [submodule ".vim/bundle/vim-eunuch"] 20 | path = .vim/bundle/vim-eunuch 21 | url = http://github.com/tpope/vim-eunuch.git 22 | [submodule ".vim/bundle/vim-surround"] 23 | path = .vim/bundle/vim-surround 24 | url = http://github.com/tpope/vim-surround.git 25 | [submodule ".vim/bundle/rainbow_parentheses.vim"] 26 | path = .vim/bundle/rainbow_parentheses.vim 27 | url = http://github.com/kien/rainbow_parentheses.vim.git 28 | [submodule ".vim/bundle/gundo"] 29 | path = .vim/bundle/gundo 30 | url = http://github.com/sjl/gundo.vim.git 31 | [submodule ".vim/bundle/minibufexpl"] 32 | path = .vim/bundle/minibufexpl 33 | url = http://github.com/fholgado/minibufexpl.vim.git 34 | [submodule ".vim/bundle/tagbar"] 35 | path = .vim/bundle/tagbar 36 | url = http://github.com/majutsushi/tagbar.git 37 | [submodule ".vim/bundle/vim-multiple-cursors"] 38 | path = .vim/bundle/vim-multiple-cursors 39 | url = http://github.com/terryma/vim-multiple-cursors.git 40 | [submodule ".vim/bundle/vim-gitgutter"] 41 | path = .vim/bundle/vim-gitgutter 42 | url = http://github.com/airblade/vim-gitgutter.git 43 | [submodule ".vim/bundle/vim-expand-region"] 44 | path = .vim/bundle/vim-expand-region 45 | url = http://github.com/terryma/vim-expand-region.git 46 | [submodule ".vim/bundle/quickfixsigns_vim"] 47 | path = .vim/bundle/quickfixsigns_vim 48 | url = http://github.com/tomtom/quickfixsigns_vim.git 49 | [submodule ".vim/bundle/TaskList.vim"] 50 | path = .vim/bundle/TaskList.vim 51 | url = http://github.com/vim-scripts/TaskList.vim.git 52 | [submodule ".vim/bundle/ctrlp.vim"] 53 | path = .vim/bundle/ctrlp.vim 54 | url = http://github.com/kien/ctrlp.vim.git 55 | [submodule ".vim/bundle/YouCompleteMe"] 56 | path = .vim/disabled/YouCompleteMe 57 | url = https://github.com/Valloric/YouCompleteMe.git 58 | [submodule ".vim/bundle/ultisnips"] 59 | path = .vim/bundle/ultisnips 60 | url = https://github.com/SirVer/ultisnips.git 61 | [submodule ".vim/bundle/vim-snippets"] 62 | path = .vim/bundle/vim-snippets 63 | url = https://github.com/honza/vim-snippets.git 64 | [submodule ".vim/bundle/color_coded"] 65 | path = .vim/bundle/color_coded 66 | url = https://github.com/jeaye/color_coded.git 67 | [submodule ".vim/bundle/vimtex"] 68 | path = .vim/bundle/vimtex 69 | url = https://github.com/lervag/vimtex 70 | [submodule ".vim/bundle/a.vim"] 71 | path = .vim/bundle/a.vim 72 | url = https://github.com/vim-scripts/a.vim.git 73 | -------------------------------------------------------------------------------- /.gvimrc: -------------------------------------------------------------------------------- 1 | set guioptions=Tmlrb "toolbar (T) + bar de menu (m) + ascenseur gauche (l) + ascenseur droit (r) + ascenseur bas (b) 2 | set lines=62 columns=117 " taille d'un demi-écran 3 | -------------------------------------------------------------------------------- /.notion/cfg_notion.lua: -------------------------------------------------------------------------------- 1 | 2 | dopath("cfg_defaults") 3 | 4 | dopath("mod_statusbar") 5 | 6 | -- Mod1 = Alt 7 | -- Mod2 = number lock 8 | -- Mod3 = caps lock 9 | -- Mod4 = super (aka windows) 10 | -- Mod5 = level 3 shift (aka AltGr, Opt) 11 | -- rajouter "+" après le code pour les concaténations suivantes 12 | ALTMETA="Mod5+" 13 | -- META="Mod1+" 14 | META="Mod4+" 15 | 16 | 17 | ioncore.set{ 18 | -- dessine les fenetres lors d'un redimensionnement 19 | opaque_resize=true, 20 | } 21 | 22 | defbindings("WMPlex.toplevel", { 23 | -- suppression des raccourcis directs sur les touches de fonctions 24 | kpress("F1", "nil"), 25 | kpress("F2", "nil"), 26 | kpress("F3", "nil"), 27 | kpress("F4", "nil"), 28 | kpress("F5", "nil"), 29 | kpress("F6", "nil"), 30 | kpress("F9", "nil"), 31 | kpress("F12", "nil"), 32 | 33 | -- lancement xterm 34 | -- kpress(META.."F1", "ioncore.exec_on(_, XTERM or 'urxvt')"), 35 | kpress(META.."F1", "ioncore.exec_on(_, XTERM or 'terminator --no-dbus')"), 36 | 37 | -- exec 38 | kpress(META.."F2", "mod_query.query_exec(_)"), 39 | 40 | -- nouveau bureau 41 | kpress(META.."F11", "mod_query.query_workspace(_)"), 42 | 43 | -- firefox 44 | kpress(META.."F4", "ioncore.exec_on(_, 'firefox')"), 45 | 46 | -- Nautilus 47 | kpress(META.."F5", "ioncore.exec_on(_, 'nautilus --no-desktop')"), 48 | 49 | -- kakoune 50 | kpress(META.."F6", "ioncore.exec_on(_, 'terminator -p kakoune -e /home/nojhan/.local/bin/ks')"), 51 | 52 | -- vifm 53 | kpress(META.."F7", "ioncore.exec_on(_, 'terminator -p kakoune -e vifm')"), 54 | 55 | -- kakoune 56 | kpress(META.."F8", "ioncore.exec_on(_, 'terminator -p kakoune -e /home/nojhan/.local/bin/ks')"), 57 | 58 | -- vifm 59 | kpress(META.."F9", "ioncore.exec_on(_, 'terminator -p kakoune -e vifm')"), 60 | 61 | -- Lock 62 | kpress(META.."l", "ioncore.exec_on(_, 'cinnamon-screensaver & cinnamon-screensaver-command -l')"), 63 | kpress(META.."Shift+l", "ioncore.exec_on(_, 'cinnamon-screensaver & cinnamon-screensaver-command -l & xset -display :0.0 dpms force off')"), 64 | 65 | -- menu général ion3 66 | kpress(META.."F12", "mod_query.query_menu(_, _sub, 'mainmenu', 'Main menu:')") 67 | }) 68 | 69 | 70 | defbindings("WMPlex", { 71 | bdoc("Close current object."), 72 | kpress_wait(META.."X", "WRegion.rqclose_propagate(_, _sub)"), 73 | }) 74 | 75 | defbindings("WScreen", { 76 | 77 | -- Aller à l'écran physique précédent/suivant 78 | kpress(META.."dollar", "ioncore.goto_prev_screen()"), 79 | kpress(META.."Next", "ioncore.goto_next_screen()"), 80 | 81 | -- aller au nième écran physique (attention, inversion pour 2e écran à gauche) 82 | kpress(META.."Shift+1", "ioncore.goto_nth_screen(0)"), 83 | kpress(META.."Shift+2", "ioncore.goto_nth_screen(1)"), 84 | 85 | -- Aller au cadre suivant/précédent 86 | kpress(META.."Right", "ioncore.goto_next(_chld, 'right')", "_chld:non-nil"), 87 | kpress(META.."Left", "ioncore.goto_next(_chld, 'left')", "_chld:non-nil"), 88 | 89 | -- Aller au bureau suivant/précédent 90 | kpress(META.."Page_Down", "WScreen.switch_next(_)"), 91 | kpress(META.."Page_Up", "WScreen.switch_prev(_)"), 92 | 93 | -- Aller au bureau n° 94 | kpress(META.."1", "WScreen.switch_nth(_, 0)"), 95 | kpress(META.."2", "WScreen.switch_nth(_, 1)"), 96 | kpress(META.."3", "WScreen.switch_nth(_, 2)"), 97 | kpress(META.."4", "WScreen.switch_nth(_, 3)"), 98 | kpress(META.."5", "WScreen.switch_nth(_, 4)"), 99 | kpress(META.."6", "WScreen.switch_nth(_, 5)"), 100 | kpress(META.."7", "WScreen.switch_nth(_, 6)"), 101 | kpress(META.."8", "WScreen.switch_nth(_, 7)"), 102 | kpress(META.."9", "WScreen.switch_nth(_, 8)"), 103 | kpress(META.."0", "WScreen.switch_nth(_, 9)"), 104 | 105 | kpress(META.."N", "ioncore.goto_nextact()"), 106 | 107 | bdoc("Create a new workspace of chosen default type."), 108 | kpress(META.."F9", "ioncore.create_ws(_)") 109 | }) 110 | 111 | defbindings("WTiling", { 112 | -- Aller au cadre supérieur/inférieur 113 | kpress(META.."Up", "ioncore.goto_next(_sub, 'up', {no_ascend=_})"), 114 | kpress(META.."Down", "ioncore.goto_next(_sub, 'down', {no_ascend=_})") 115 | }) 116 | 117 | defbindings("WFrame", { 118 | -- Aller à la fenetre suivante dans le cadre 119 | kpress(META.."Tab", "_:switch_prev()"), 120 | --kpress(ALTMETA.."Tab", "_:switch_next()") 121 | kpress(META.."B", "_:switch_next()") 122 | }) 123 | 124 | defbindings("WFrame.toplevel", { 125 | -- Attacher la fenetre marquée (avec META.."T" par défaut) 126 | kpress(META.."U", "WRegion.set_tagged(_sub, 'toggle')", "_sub:non-nil"), 127 | kpress(META.."A", "ioncore.tagged_attach(_)") 128 | }) 129 | 130 | defbindings("WTiling", { 131 | bdoc("Split current frame horizontally."), 132 | kpress(META.."S", "WTiling.split_at(_, _sub, 'right', true)"), 133 | 134 | bdoc("Split current frame vertically."), 135 | kpress(META.."Shift+S", "WTiling.split_at(_, _sub, 'bottom', true)"), 136 | 137 | bdoc("Unsplit (destroy) current frame."), 138 | kpress(META.."D", "WTiling.unsplit_at(_, _sub)"), 139 | }) 140 | 141 | defbindings("WScreen", { 142 | bdoc("Toggle scratchpad."), 143 | kpress(META.."space", "mod_sp.set_shown_on(_, 'toggle')"), 144 | 145 | -- A more ideal key for toggling the scratchpad would be the key left of 146 | -- the key for numeral 1. Unfortunately the symbols mapped to this key 147 | -- vary by the keyboard layout, and to be fully portable to different 148 | -- architechtures and fancy keyboards, we can't rely on keycodes either. 149 | -- However, on standard Finnish/Swedish (and other Nordic) keyboard 150 | -- layouts the following should work: 151 | --kpress(META.."section", "mod_sp.set_shown_on(_, 'toggle')"), 152 | -- and on UK and US layouts this should work: 153 | --kpress(META.."grave", "mod_sp.set_shown_on(_, 'toggle')"), 154 | }) 155 | 156 | -- pour mettre la stalonetray dans le dock 157 | -- defwinprop {class="stalonetray", statusbar="dock"} 158 | 159 | -- WFrame context bindings 160 | -- 161 | -- These bindings are common to all types of frames. Some additional 162 | -- frame bindings are found in some modules' configuration files. 163 | 164 | defbindings("WFrame", { 165 | submap(META.."K", { 166 | bdoc("Maximize the frame horizontally/vertically."), 167 | kpress("H", "WFrame.maximize_horiz(_)"), 168 | kpress("V", "WFrame.maximize_vert(_)"), 169 | }), 170 | 171 | bdoc("Display context menu."), 172 | mpress("Button3", "mod_menu.pmenu(_, _sub, 'ctxmenu')"), 173 | 174 | bdoc("Begin move/resize mode."), 175 | kpress(META.."R", "WFrame.begin_kbresize(_)"), 176 | 177 | bdoc("Switch the frame to display the object indicated by the tab."), 178 | mclick("Button1@tab", "WFrame.p_switch_tab(_)"), 179 | mclick("Button2@tab", "WFrame.p_switch_tab(_)"), 180 | 181 | bdoc("Resize the frame."), 182 | mdrag("Button1@border", "WFrame.p_resize(_)"), 183 | mdrag(META.."Button3", "WFrame.p_resize(_)"), 184 | 185 | bdoc("Move the frame."), 186 | mdrag(META.."Button1", "WFrame.p_move(_)"), 187 | 188 | bdoc("Move objects between frames by dragging and dropping the tab."), 189 | mdrag("Button1@tab", "WFrame.p_tabdrag(_)"), 190 | mdrag("Button2@tab", "WFrame.p_tabdrag(_)"), 191 | 192 | bdoc("Switch to next/previous object within the frame."), 193 | mclick(META.."Button4", "WFrame.switch_next(_)"), 194 | mclick(META.."Button5", "WFrame.switch_prev(_)"), 195 | }) 196 | 197 | 198 | -- WMoveresMode context bindings 199 | -- 200 | -- These bindings are available keyboard move/resize mode. The mode 201 | -- is activated on frames with the command begin_kbresize (bound to 202 | -- META.."R" above by default). 203 | 204 | defbindings("WMoveresMode", { 205 | bdoc("Cancel the resize mode."), 206 | kpress("AnyModifier+Escape","WMoveresMode.cancel(_)"), 207 | 208 | bdoc("End the resize mode."), 209 | kpress("AnyModifier+Return","WMoveresMode.finish(_)"), 210 | 211 | bdoc("Grow in specified direction."), 212 | kpress("Left", "WMoveresMode.resize(_, 1, 0, 0, 0)"), 213 | kpress("Right", "WMoveresMode.resize(_, 0, 1, 0, 0)"), 214 | kpress("Up", "WMoveresMode.resize(_, 0, 0, 1, 0)"), 215 | kpress("Down", "WMoveresMode.resize(_, 0, 0, 0, 1)"), 216 | 217 | bdoc("Shrink in specified direction."), 218 | kpress("Shift+Left", "WMoveresMode.resize(_,-1, 0, 0, 0)"), 219 | kpress("Shift+Right", "WMoveresMode.resize(_, 0,-1, 0, 0)"), 220 | kpress("Shift+Up", "WMoveresMode.resize(_, 0, 0,-1, 0)"), 221 | kpress("Shift+Down", "WMoveresMode.resize(_, 0, 0, 0,-1)"), 222 | 223 | bdoc("Move in specified direction."), 224 | kpress(META.."Left", "WMoveresMode.move(_,-1, 0)"), 225 | kpress(META.."Right", "WMoveresMode.move(_, 1, 0)"), 226 | kpress(META.."Up", "WMoveresMode.move(_, 0,-1)"), 227 | kpress(META.."Down", "WMoveresMode.move(_, 0, 1)"), 228 | }) 229 | 230 | 231 | -- Client window group bindings 232 | 233 | defbindings("WGroupCW", { 234 | bdoc("Toggle client window group full-screen mode"), 235 | kpress_wait(META.."Return", "WGroup.set_fullscreen(_, 'toggle')"), 236 | }) 237 | 238 | 239 | -------------------------------------------------------------------------------- /.notion/cfg_statusbar.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Ion statusbar module configuration file 3 | -- 4 | 5 | 6 | -- Create a statusbar 7 | mod_statusbar.create{ 8 | -- First screen, bottom left corner 9 | screen=0, 10 | pos='bl', 11 | -- Set this to true if you want a full-width statusbar 12 | fullsize=false, 13 | -- Swallow systray windows 14 | systray=true, 15 | 16 | -- Template. Tokens %string are replaced with the value of the 17 | -- corresponding meter. Currently supported meters are: 18 | -- date date 19 | -- load load average (1min, 5min, 15min) 20 | -- load_Nmin N minute load average (N=1, 5, 15) 21 | -- mail_new mail count (mbox format file $MAIL) 22 | -- mail_unread mail count 23 | -- mail_total mail count 24 | -- mail_*_new mail count (from an alternate mail folder, see below) 25 | -- mail_*_unread mail count 26 | -- mail_*_total mail count 27 | -- 28 | -- Space preceded by % adds stretchable space for alignment of variable 29 | -- meter value widths. > before meter name aligns right using this 30 | -- stretchable space , < left, and | centers. 31 | -- Meter values may be zero-padded to a width preceding the meter name. 32 | -- These alignment and padding specifiers and the meter name may be 33 | -- enclosed in braces {}. 34 | -- 35 | -- %filler causes things on the marker's sides to be aligned left and 36 | -- right, respectively, and %systray is a placeholder for system tray 37 | -- windows and icons. 38 | -- 39 | --template="[ %date || load:% %>load || mail:% %>mail_new/%>mail_total ] %filler%systray", 40 | --template=" %filler%systray [ load: % %>load || mail: %>mail_new/%>mail_total || %date ]", 41 | -- template="%date %systray_dock %systray %workspace_pager bat: %laptopstatus_batterypercent (%laptopstatus_batterytimeleft) %filler %vv_disk_ - %vv_disk_home", 42 | template="%date %systray_dock systray %workspace_pager %filler %vv_disk_ - %vv_disk_home", 43 | } 44 | 45 | 46 | -- Launch ion-statusd. This must be done after creating any statusbars 47 | -- for necessary statusd modules to be parsed from the templates. 48 | mod_statusbar.launch_statusd{ 49 | -- Date meter 50 | date={ 51 | -- ISO-8601 date format with additional abbreviated day name 52 | date_format='%a %Y-%m-%d %H:%M', 53 | -- Finnish etc. date format 54 | --date_format='%a %d.%m.%Y %H:%M', 55 | -- Locale date format (usually shows seconds, which would require 56 | -- updating rather often and can be distracting) 57 | --date_format='%c', 58 | 59 | -- Additional date formats. 60 | --[[ 61 | formats={ 62 | time = '%H:%M', -- %date_time 63 | } 64 | --]] 65 | }, 66 | 67 | -- Load meter 68 | load={ 69 | --update_interval=10*1000, 70 | --important_threshold=1.5, 71 | --critical_threshold=4.0, 72 | }, 73 | 74 | -- Mail meter 75 | -- 76 | -- To monitor more mbox files, add them to the files table. For 77 | -- example, add mail_work_new and mail_junk_new to the template 78 | -- above, and define them in the files table: 79 | -- 80 | -- files = { work = "/path/to/work_email", junk = "/path/to/junk" } 81 | -- 82 | -- Don't use the keyword 'spool' as it's reserved for mbox. 83 | mail={ 84 | --update_interval=60*1000, 85 | --mbox=os.getenv("MAIL"), 86 | --files={}, 87 | }, 88 | } 89 | 90 | -------------------------------------------------------------------------------- /.notion/look_noj.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nojhan/dotfiles/4e85e0c1caef3d2ab1de76cc5a698361085dde5b/.notion/look_noj.lua -------------------------------------------------------------------------------- /.notion/statusbar_workspace.lua: -------------------------------------------------------------------------------- 1 | -- statusbar_workspace.lua 2 | -- 3 | -- Show current workspace name or number in the statusbar. 4 | -- 5 | -- Put any of these in cfg_statusbar.lua's template-line: 6 | -- %workspace_name 7 | -- %workspace_frame 8 | -- %workspace_pager 9 | -- %workspace_name_pager 10 | -- %workspace_num_name_pager 11 | -- 12 | -- This is an internal statusbar monitor and does NOT require 13 | -- a dopath statement (effective after a 2006-02-12 build). 14 | -- 15 | -- version 1 16 | -- author: Rico Schiekel 17 | -- 18 | -- version 2 19 | -- added 2006-02-14 by Canaan Hadley-Voth: 20 | -- * %workspace_pager shows a list of workspace numbers 21 | -- with the current one indicated: 22 | -- 23 | -- 1i 2i [3f] 4p 5c 24 | -- 25 | -- i=WIonWS, f=WFloatWS, p=WPaneWS, c=WClientWin/other 26 | -- 27 | -- * %workspace_frame - name of the active frame. 28 | -- 29 | -- * Added statusbar_ to the filename (since it *is* 30 | -- an internal statusbar monitor) so that it works without 31 | -- a "dopath" call. 32 | -- 33 | -- * Removed timer. Only needs to run on hook. 34 | -- Much faster this way. 35 | -- 36 | -- version 3 37 | -- update for ion-3rc-20070506 on 2007-05-09 38 | -- by Kevin Granade 39 | -- 40 | -- Updated to use new wx_ api 41 | -- Replaced region_activated_hook with region_notify_hook 42 | -- Added %workspace_name_pager, which works similarly to %workspace_pager, 43 | -- but instead displays the name of each workspace 44 | -- Added display for WGroupWS to %workspace_pager, displayed as 'g' 45 | -- 46 | 47 | local function update_frame() 48 | local fr 49 | ioncore.defer( function() 50 | local cur=ioncore.current() 51 | if obj_is(cur, "WClientWin") and 52 | obj_is(cur:parent(), "WMPlex") then 53 | cur=cur:parent() 54 | end 55 | fr=cur:name() 56 | mod_statusbar.inform('workspace_frame', fr) 57 | mod_statusbar.update() 58 | end) 59 | end 60 | 61 | local function update_workspace() 62 | local scr=ioncore.find_screen_id(0) 63 | local curws = scr:mx_current() 64 | local wstype, c 65 | local pager="" 66 | local name_pager="" 67 | local name_pager_plus="" 68 | local curindex = scr:get_index(curws)+1 69 | n = scr:mx_count(1) 70 | for i=1,n do 71 | tmpws=scr:mx_nth(i-1) 72 | wstype=obj_typename(tmpws) 73 | if wstype=="WIonWS" then 74 | c="i" 75 | elseif wstype=="WFloatWS" then 76 | c="f" 77 | elseif wstype=="WPaneWS" then 78 | c="p" 79 | elseif wstype=="WGroupWS" then 80 | c="g" 81 | else 82 | c="c" 83 | end 84 | if i==curindex then 85 | name_pager_plus=name_pager_plus.."["..tmpws:name().."]" 86 | name_pager=name_pager.."["..tmpws:name().."]" 87 | pager=pager.."["..(i).."]" 88 | --pager=pager.." ["..(i)..c.."] " 89 | else 90 | name_pager_plus=name_pager_plus.." "..(i)..":"..tmpws:name() 91 | name_pager=name_pager.." "..tmpws:name() 92 | pager=pager.." "..(i).." " 93 | --pager=pager.." "..(i)..c.." " 94 | end 95 | end 96 | 97 | local fr,cur 98 | 99 | -- Older versions without an ioncore.current() should 100 | -- skip update_frame. 101 | update_frame() 102 | 103 | ioncore.defer( function() 104 | mod_statusbar.inform('workspace_pager', pager) 105 | mod_statusbar.inform('workspace_name', curws:name()) 106 | mod_statusbar.inform('workspace_name_pager', name_pager) 107 | mod_statusbar.inform('workspace_num_name_pager', name_pager_plus) 108 | mod_statusbar.update() 109 | end) 110 | end 111 | 112 | ioncore.get_hook("region_notify_hook"):add(update_workspace) 113 | -------------------------------------------------------------------------------- /.notion/statusd_laptopstatus.lua: -------------------------------------------------------------------------------- 1 | -- statusd_laptopstatus.lua v0.0.2 (last modified 2005-06-13) 2 | -- 3 | -- Copyright (C) 2005 Jari Eskelinen 4 | -- modified by René van Bevern for error handling 5 | -- 6 | -- Permission to copy, redistirbute, modify etc. is granted under the terms 7 | -- of GNU GENERAL PUBLIC LICENSE Version 2. 8 | -- 9 | -- This is script for displaying some interesting information about your 10 | -- laptops power saving in Ion's status monitor. Script is very Linux 11 | -- specific (uses /proc interface) and needs ACPI -support new enough (don't 12 | -- know exactly but 2.6.x kernels should be fine). Also if you have some 13 | -- kind of exotic hardware (multiple processors, multiple batteries etc.) 14 | -- this script probably will fail or show incorrect information. 15 | -- 16 | -- Just throw this script under ~/.ion3 and add following keywords to your 17 | -- cfg_statusbar.lua's template-line with your own taste: 18 | -- 19 | -- %laptopstatus_cpuspeed 20 | -- %laptopstatus_temperature 21 | -- %laptopstatus_batterypercent 22 | -- %laptopstatus_batterytimeleft 23 | -- %laptopstatus_batterydrain 24 | -- 25 | -- Template example: template="[ %date || load:% %>load || CPU: %laptopstatus_cpuspeed %laptopstatus_temperature || BATT: %laptopstatus_batterypercent %laptopstatus_batterytimeleft %laptopstatus_batterydrain ]" 26 | -- 27 | -- You can also run this script with lua interpreter and see if you get 28 | -- right values. 29 | -- 30 | -- NOTICE: This is my first ion/lua-script, so probably this can be done better. 31 | -- Feel free to improve this script. 32 | -- 33 | -- TODO: * Is it stupid to use file:read("*all"), can this cause infinite 34 | -- loops in some weird situations? 35 | -- * Do not poll for information not defined in template to be used 36 | -- * Auto-detect right acpi devices instead of hardcoded BATT0 etc. 37 | 38 | -- 39 | -- SETTINGS 40 | -- 41 | 42 | if not statusd_laptopstatus then 43 | statusd_laptopstatus = { 44 | interval = 10, -- Polling interval in seconds 45 | temperature_important = 66, -- Temperature which will cause important hint 46 | temperature_critical = 71, -- Temperature which will cause critical hint 47 | batterypercent_important = 10, -- Battery percent which will cause important hint 48 | batterypercent_critical = 5, -- Battery percent which will cause critical hint 49 | batterytimeleft_important = 600, -- Battery time left (in secs) which will cause important hint 50 | batterytimeleft_critical = 300, -- Battery time left (in secs) which will cause critical hint 51 | ac_state = {"/proc/acpi/ac_adapter/AC/state", 52 | "/proc/acpi/ac_adapter/ACAD/state", 53 | "/proc/acpi/ac_adapter/ADP0/state", 54 | "/proc/acpi/ac_adapter/ADP1/state"}, 55 | temp_info = {"/proc/acpi/thermal_zone/THRM/temperature", 56 | "/proc/acpi/thermal_zone/THM/temperature", 57 | "/proc/acpi/thermal_zone/THM0/temperature", 58 | "/proc/acpi/thermal_zone/THM1/temperature"}, 59 | bat_info = {"/proc/acpi/battery/BAT0/info", 60 | "/proc/acpi/battery/BAT1/info"}, 61 | bat_state = {"/proc/acpi/battery/BAT0/state", 62 | "/proc/acpi/battery/BAT1/state"} 63 | } 64 | end 65 | 66 | statusd_laptopstatus=table.join(statusd.get_config("laptopstatus"), statusd_laptopstatus) 67 | 68 | -- 69 | -- CODE 70 | -- 71 | local laptopstatus_timer 72 | 73 | function try_open(files, mode) 74 | for _, file in pairs(files) do 75 | local fd = io.open(file, mode) 76 | if fd then return fd, file end 77 | end 78 | end 79 | 80 | local function get_cpu() 81 | local mhz, hint 82 | if pcall(function () 83 | local status 84 | local file = io.open("/proc/cpuinfo", "r") 85 | status, _, mhz = string.find(file:read("*all"), 86 | "cpu MHz%s+: (%d+)") 87 | if not status then error("could not get MHz") end 88 | file:close() 89 | end) 90 | then return {speed=string.format("%4dMHz", math.ceil(mhz/5)*5), 91 | hint=hint} 92 | else return {speed="n/a", hint=hint} end 93 | end 94 | 95 | 96 | local function get_ac() 97 | local file = try_open(statusd_laptopstatus.ac_state, "r") 98 | if not string.find(file:read("*all"), "state:%s+on.line") then return 0 99 | else return 1 end 100 | file:close() 101 | end 102 | 103 | 104 | local function get_thermal() 105 | local temp, hint = nil, "normal" 106 | 107 | if pcall(function () 108 | local status 109 | local file=try_open(statusd_laptopstatus.temp_info, "r") 110 | status, _, temp = string.find(file:read("*all"), 111 | "temperature:%s+(%d+).*") 112 | if not status then error("could not get temperature") end 113 | temp = tonumber(temp) 114 | file:close(); 115 | end) 116 | then if temp >= statusd_laptopstatus.temperature_important then 117 | hint = "important" end 118 | if temp >= statusd_laptopstatus.temperature_critical then 119 | hint = "critical" end 120 | return {temperature=string.format("%02dC", temp), hint=hint} 121 | else return {temperature="n/a", hint = "hint"} end 122 | end 123 | 124 | 125 | local function get_battery() 126 | local percenthint = "normal" 127 | local timelefthint = "normal" 128 | local lastfull, rate, rateunit, remaining 129 | 130 | if pcall(function () 131 | local status 132 | local file=try_open(statusd_laptopstatus.bat_info, "r") 133 | local infocontents = file:read("*all") 134 | file:close(); 135 | 136 | local file=try_open(statusd_laptopstatus.bat_state, "r") 137 | local statecontents = file:read("*all") 138 | file:close(); 139 | 140 | status, _, lastfull = string.find(infocontents, "last full capacity:%s+(%d+).*") 141 | if not status then error("could not get full battery capacity") end 142 | lastfull = tonumber(lastfull) 143 | if string.find(statecontents, "present rate:%s+unknown.*") then 144 | rate = -1 145 | else 146 | status, _, rate, rateunit = string.find(statecontents, "present rate:%s+(%d+)(.*)") 147 | if not status then error("could not get battery draining-rate") end 148 | rate = tonumber(rate) 149 | end 150 | status, _, remaining = string.find(statecontents, "remaining capacity:%s+(%d+).*") 151 | if not status then error("could not get remaining capacity") end 152 | remaining = tonumber(remaining) 153 | end) then 154 | local percent = math.floor(remaining / lastfull * 100 + 5/10) 155 | local timeleft 156 | local hours, secs, mins 157 | if get_ac() == 1 then 158 | timeleft = " *AC*" 159 | elseif rate <= 0 then 160 | timeleft = "n/a" 161 | else 162 | secs = 3600 * (remaining / rate) 163 | mins = secs / 60 164 | hours = math.floor(mins / 60) 165 | mins = math.floor(mins - (hours * 60)) 166 | timeleft = string.format("%02d:%02d", hours, mins) 167 | end 168 | 169 | if secs ~= nil and secs <= statusd_laptopstatus.batterytimeleft_important then timelefthint = "important" end 170 | if secs ~= nil and secs <= statusd_laptopstatus.batterytimeleft_critical then timelefthint = "critical" end 171 | if percent <= statusd_laptopstatus.batterypercent_important then percenthint = "important" end 172 | if percent <= statusd_laptopstatus.batterypercent_critical then percenthint = "critical" end 173 | 174 | return { percent=string.format("%02d%%", percent), timeleft=timeleft, drain=tostring(rate)..rateunit, percenthint=percenthint, timelefthint=timelefthint} 175 | else return { percent="n/a", timeleft="n/a", drain="n/a", percenthint=percenthint, timelefthint=timelefthint} end 176 | end 177 | 178 | local last_timeleft = nil 179 | 180 | local function update_laptopstatus () 181 | cpu = get_cpu() 182 | thermal = get_thermal() 183 | battery = get_battery() 184 | 185 | -- Informing statusd OR printing to stdout if statusd not present 186 | if statusd ~= nil then 187 | statusd.inform("laptopstatus_cpuspeed", cpu.speed) 188 | statusd.inform("laptopstatus_cpuspeed_template", "xxxxMHz") 189 | statusd.inform("laptopstatus_cpuspeed_hint", cpu.hint) 190 | statusd.inform("laptopstatus_temperature", thermal.temperature) 191 | statusd.inform("laptopstatus_temperature_template", "xxxC") 192 | statusd.inform("laptopstatus_temperature_hint", thermal.hint) 193 | statusd.inform("laptopstatus_batterypercent", battery.percent) 194 | statusd.inform("laptopstatus_batterypercent_template", "xxx%") 195 | statusd.inform("laptopstatus_batterypercent_hint", battery.percenthint) 196 | if battery.timeleft ~= "n/a" or last_timeleft == " *AC*" then 197 | statusd.inform("laptopstatus_batterytimeleft", battery.timeleft) 198 | last_timeleft = battery.timeleft 199 | end 200 | statusd.inform("laptopstatus_batterytimeleft_template", "hh:mm") 201 | statusd.inform("laptopstatus_batterytimeleft_hint", battery.timelefthint) 202 | statusd.inform("laptopstatus_batterydrain", battery.drain) 203 | laptopstatus_timer:set(statusd_laptopstatus.interval*1000, update_laptopstatus) 204 | else 205 | io.stdout:write("CPU: "..cpu.speed.." "..thermal.temperature.." || BATT: "..battery.percent.." "..battery.timeleft.."\n") 206 | end 207 | end 208 | 209 | 210 | if statusd ~= nil then 211 | laptopstatus_timer = statusd.create_timer() 212 | end 213 | update_laptopstatus() 214 | -------------------------------------------------------------------------------- /.notion/statusd_vv.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nojhan/dotfiles/4e85e0c1caef3d2ab1de76cc5a698361085dde5b/.notion/statusd_vv.lua -------------------------------------------------------------------------------- /.screenrc: -------------------------------------------------------------------------------- 1 | 2 | term "screen-256color" 3 | 4 | # detach on hangup 5 | autodetach on 6 | 7 | # don't display the copyright page 8 | startup_message off 9 | 10 | # emulate .logout message 11 | pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended." 12 | 13 | defscrollback 3000 14 | 15 | # suppress bold text 16 | attrcolor b "-b" 17 | 18 | ## Explanation of hardstatus line ## 19 | 20 | # Ignore the ' marks if you use these examples for yourself 21 | 22 | # Note that if you want to use the color brown under konsole 23 | # You actually use bright yellow (%{Y}). 24 | 25 | # Note the embeded space after the colon, I feel 26 | # it just looks nicer with a blank between the 27 | # text and console edge: 28 | # '%{=b}%{G} Screen(s): ' 29 | 30 | # This prints the window listing in blue: 31 | # '%{b}%w' 32 | 33 | # This right-aligns what follows: 34 | # '%=' 35 | 36 | # This displays the time (hours and minutes) in 12hr format 37 | # and adds an AM/PM flag, in bold green: 38 | # '%{G}%C%A' 39 | 40 | # This displays the day of the week: 41 | # '%D' 42 | 43 | #This displays the date in Mon/day/year format: 44 | # and again I embeded a space to give me one space 45 | # between the text and console edge: 46 | # '%M/%d/%Y ' 47 | 48 | # The resulting command give you a status line that 49 | # looks like this: 50 | # | Screen(s): 0* bash 5:30PM Fri, Jun/25/2004 | 51 | # (The pipes indicate the edges of the xterm/console). 52 | 53 | # Green text, time, and date; windows in blue: 54 | #hardstatus alwayslastline "%{=b}%{g}%h %{r}<%w> %=%{y}%c:%s %Y-%m-%d (%D)" 55 | hardstatus alwayslastline "%{=b}%{g}%h %{r}<%w> %=%{y}%c %Y-%m-%d (%D)" 56 | 57 | 58 | # From http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html 59 | # Q: My xterm scrollbar does not work with screen. 60 | # A: The problem is that xterm will not allow scrolling if the alternate text buffer is selected. The standard definitions of the termcap initialize capabilities ti and te switch to and from the alternate text buffer. (The scrollbar also does not work when you start e.g. ‘vi’). You can tell screen not to use these initialisations by adding the line “termcapinfo xterm ti@:te@” to your ~/.screenrc file. 61 | termcapinfo xterm ti@:te@ 62 | 63 | # auto split 64 | bind s eval "split" "focus down" "screen" 65 | 66 | # kill the current region 67 | # usefull to remove a split 68 | bind X remove 69 | 70 | # launch a new window under root and change the title accordingly 71 | # note: the $ may be a # or something else, depending on your shell prompt 72 | bind u screen -t '$ |root' su 73 | 74 | # default windows title with the auto-title 75 | # needs to add the title-escape-sequence in ~/.bashrc 76 | # like: export PS1="$PS2\033k\033\134" 77 | # of one launch top, the title will be ":top" else ":" 78 | shelltitle '$ |:' 79 | -------------------------------------------------------------------------------- /.taskrc: -------------------------------------------------------------------------------- 1 | # [Created by task 2.6.2 8/5/2023 09:21:59] 2 | # Taskwarrior program configuration file. 3 | # For more documentation, see https://taskwarrior.org or try 'man task', 'man task-color', 4 | # 'man task-sync' or 'man taskrc' 5 | 6 | # Here is an example of entries that use the default, override and blank values 7 | # variable=foo -- By specifying a value, this overrides the default 8 | # variable= -- By specifying no value, this means no default 9 | # #variable=foo -- By commenting out the line, or deleting it, this uses the default 10 | 11 | # You can also refence environment variables: 12 | # variable=$HOME/task 13 | # variable=$VALUE 14 | 15 | # Use the command 'task show' to see all defaults and overrides 16 | 17 | # Files 18 | data.location=/Users/nojhan/.task 19 | 20 | # To use the default location of the XDG directories, 21 | # move this configuration file from ~/.taskrc to ~/.config/task/taskrc and uncomment below 22 | 23 | #data.location=~/.local/share/task 24 | #hooks.location=~/.config/task/hooks 25 | 26 | report.list.columns=id,priority,description,project,tags,due 27 | 28 | # Color theme (uncomment one to use) 29 | #include light-16.theme 30 | #include light-256.theme 31 | #include dark-16.theme 32 | #include dark-256.theme 33 | #include dark-red-256.theme 34 | #include dark-green-256.theme 35 | #include dark-blue-256.theme 36 | #include dark-violets-256.theme 37 | #include dark-yellow-green.theme 38 | #include dark-gray-256.theme 39 | #include dark-gray-blue-256.theme 40 | #include solarized-dark-256.theme 41 | #include solarized-light-256.theme 42 | #include no-color.theme 43 | 44 | confirmation=off 45 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | 2 | ################################################# 3 | # CONFIG 4 | ################################################# 5 | 6 | # Fix colors in ANSI-based text editors. 7 | set -g default-terminal "tmux-256color" 8 | set -ga terminal-overrides ",*col*:Tc" 9 | 10 | # Update the status bar every seconds (for the clock). 11 | set -g status-interval 1 12 | 13 | # Enable mouse control (clickable windows, panes, resizable panes) 14 | set -g mouse on 15 | 16 | 17 | ################################################# 18 | # SHORTCUTS 19 | ################################################# 20 | 21 | # Very short Escape key delay, to allow using modal editors. 22 | set -sg escape-time 20 23 | 24 | # Remap prefix from 'C-b' to 'C-a'. 25 | unbind C-b 26 | set-option -g prefix C-a 27 | bind-key C-a send-prefix 28 | 29 | # Split panes. 30 | bind s split-window -h 31 | bind S split-window -v 32 | unbind '"' 33 | unbind % 34 | 35 | # Windows switching. 36 | bind Tab next-window 37 | bind S-Tab previous-window 38 | bind C-a last-window 39 | 40 | # Reload config file. 41 | # NOTE: change file location to your the tmux.conf you want to use. 42 | bind r source-file ~/.tmux.conf 43 | 44 | 45 | ################################################# 46 | # THEME 47 | ################################################# 48 | 49 | # Design rationale: 50 | # - Basics: visible windows tabs, active one highlighted. 51 | # - This follows the look-n-feel of my generic theming (vim, kakoune, liquidprompt, etc.). 52 | # - Blue is "insert mode", i.e. what you type is typed. 53 | # - Yellow is "normal mode", i.e. the item is a (potential) target for a command. 54 | # - When entering prefix, the active window tab is in yellow. 55 | # - Tabs structure: () 56 | # - the activity marker is a ‼ if there is a bell alert, a ! if there is a silent notification, a ∘ else. 57 | # - the window position is a dark ⁚ for the active window, a ⁝ for the last window and a light ⁚ for others. 58 | # - When entering prefix, a yellow [A] is displayed and the active window tab is yellow, drawing attention to what you are doing next. 59 | # 60 | # NOTE: needs Powerline symbols (use a Nerd Font). 61 | 62 | # Just like a normal window title bar. 63 | set -g status-position top 64 | 65 | # Thick blue border. 66 | set -g pane-active-border-style bg='#6f9dfe',fg='#6f9dfe' 67 | 68 | # Default status style. 69 | set -g status-style bg='#2f5dbe',fg='#d3d0cc' 70 | 71 | # tmux-mode-indicator (mainly displays TMUX or WAIT), then prefix marker. 72 | set -g status-left '#{tmux_mode_indicator}#[bg=#3f6dce]#[fg=#d3d0cc]#{?client_prefix,#[bg=#cf8200]#[fg=#f8f8f8][A],[ ]}#{?client_prefix,#[fg=#cf8200],#[fg=#3f6dce]}#[bg=#2f5dbe]' 73 | 74 | # Active window tab. 75 | set-window-option -g window-status-current-format "#{?client_prefix,#[fg=#cf8200],#[fg=#6f9dfe]}#[bg=#2f5dbe] #{?client_prefix,#[bg=#cf8200],#[bg=#6f9dfe]}#[fg=#ffcc00]#I#[fg=#2f5dbe,none](∘#{?client_prefix,#[bg=#cf8200],#[bg=#6f9dfe]}#[fg=#f8f8f8]#{window_panes}#{?client_prefix,#[bg=#cf8200],#[bg=#6f9dfe]}#[fg=#2f5dbe])⁚ #[fg=#ffffff,bold]#W#[fg=#f8f8f8,none]#{?client_prefix,#[fg=#cf8200],#[fg=#6f9dfe]}#[bg=#2f5dbe] #[bg=#2f5dbe]" 76 | 77 | # Other windows tabs. 78 | set-window-option -g window-status-format "#[fg=#4f7dde]#[bg=#2f5dbe] #[bg=#4f7dde,noreverse,bold]#[fg=#cf8200]#I#[fg=#2f5dbe,none](#[fg=#d3d0cc]#{?window_bell_flag,#[bg=#ffcc00]#[fg=#db4939]‼,#{?window_silence_flag,#[bg=#ffcc00]#[fg=#db4939]!,#[fg=#2f5dbe]∘}}#[bg=#4f7dde]#[fg=#d3d0cc]#{window_panes}#[fg=#2f5dbe])#[fg=#d3d0cc]#{last_window}#{?window_last_flag,⁝,⁚} #[fg=#d3d0cc,bold]#W#[fg=#d3d0cc,none]#[fg=#4f7dde]#[bg=#2f5dbe] #[bg=#2f5dbe]" 79 | 80 | # Tabs separator. 81 | # set-window-option -g window-status-separator "#[fg=#2f5dbe]║" #⟭⟬" 82 | set-window-option -g window-status-separator "" #⟭⟬" 83 | 84 | # No reverse on notifications. 85 | set-window-option -g window-status-activity-style none 86 | 87 | # Larger right status section. 88 | set -g status-right-length 50 89 | 90 | # download session@host date(week) hour 91 | set -g status-right '↓#{download_speed}#[fg=#2f5dbe]║#[fg=#ffcc00]#S#[fg=#ffffff]@#[fg=#d3d0cc]#h#[fg=#2f5dbe]║#[fg=#d3d0cc]%Y-%m-%d#[fg=#9390bd](#[fg=#d3d0cc]%W#[fg=#9390bd])#[fg=#2f5dbe]║#[fg=#d3d0cc]%H:%M#[fg=#2f5dbe]' 92 | 93 | 94 | ################################################# 95 | # PLUGINS 96 | ################################################# 97 | 98 | # Plugins 99 | # C-a I to install. 100 | # C-a U to update. 101 | # C-a Alt-u to uninstall. 102 | set -g @plugin 'tmux-plugins/tpm' 103 | set -g @plugin 'tmux-plugins/tmux-sensible' 104 | # set -g @plugin 'thewtex/tmux-mem-cpu-load' # FIXME does not work 105 | # set -g @plugin 'imomaliev/tmux-keyboard-layout' # FIXME does not work 106 | set -g @plugin 'tmux-plugins/tmux-net-speed' 107 | set -g @plugin 'MunifTanjim/tmux-mode-indicator' 108 | # set -g @plugin 'ofirgall/tmux-window-name' 109 | 110 | # tmux-window-name config 111 | # Shell programs, will show dir instead of the program 112 | # set -g @tmux_window_name_shells "['zsh', 'bash', 'sh']" 113 | # Programs that will show the dir name along with the program name. 114 | # set -g @tmux_window_dir_programs "['kak', 'less', 'nvim', 'vim', 'vi', 'git']" 115 | 116 | # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) 117 | run '~/.tmux/plugins/tpm/tpm' 118 | -------------------------------------------------------------------------------- /.twdrc: -------------------------------------------------------------------------------- 1 | 2 | list.filtered=no 3 | 4 | layout.subsections = Vertical 5 | layout.subsections.group = priority 6 | layout.sections.group.show = H,M,L, 7 | 8 | layout.sections = Horizontal 9 | layout.sections.group = status 10 | layout.sections.group.show = pending,started 11 | 12 | layout.stack.sort=urgency 13 | 14 | include ~/code/taskwarrior-deluxe/presets/colors_nojhan.conf 15 | include ~/code/taskwarrior-deluxe/presets/icons_ascii.conf 16 | -------------------------------------------------------------------------------- /.vim/.netrwhist: -------------------------------------------------------------------------------- 1 | let g:netrw_dirhistmax =10 2 | let g:netrw_dirhistcnt =5 3 | let g:netrw_dirhist_5='/home/nojhan/code/paradiseo/mo/src/problems/eval' 4 | let g:netrw_dirhist_4='/home/nojhan/code/paradiseo/mo/src/problems' 5 | let g:netrw_dirhist_3='/home/nojhan/code/paradiseo/mo/src' 6 | let g:netrw_dirhist_2='/home/nojhan/code/paradiseo/mo/src/eval' 7 | let g:netrw_dirhist_1='/home/nojhan/code/paradiseo/mo/src' 8 | let g:netrw_dirhist_0='/home/nojhan/code/paradiseo/mo' 9 | let g:netrw_dirhist_9='/home/nojhan/code/paradiseo/mo/tutorial' 10 | let g:netrw_dirhist_8='/home/nojhan/code/paradiseo/mo/tutorial/Lesson1' 11 | let g:netrw_dirhist_7='/home/nojhan/code/paradiseo/mo/src/eval' 12 | let g:netrw_dirhist_6='/home/nojhan/code/paradiseo/mo/src' 13 | -------------------------------------------------------------------------------- /.vim/colors/base16-railscasts-noj.vim: -------------------------------------------------------------------------------- 1 | " Base16 Railscasts (https://github.com/chriskempson/base16) 2 | " Scheme: Ryan Bates (http://railscasts.com) 3 | 4 | " GUI color definitions 5 | let s:gui00 = "2b2b2b" 6 | let s:gui01 = "272935" 7 | let s:gui02 = "3a4055" 8 | " let s:gui03 = "5a647e" 9 | let s:gui03 = "6b758f" 10 | let s:gui04 = "d4cfc9" 11 | let s:gui05 = "e6e1dc" 12 | let s:gui06 = "f4f1ed" 13 | let s:gui07 = "f9f7f3" 14 | let s:gui08 = "da4939" 15 | " let s:gui09 = "cc7833" 16 | let s:gui09 = "cc7844" 17 | let s:gui0A = "ffc66d" 18 | let s:gui0B = "a5c261" 19 | let s:gui0C = "519f50" 20 | let s:gui0D = "6d9cbe" 21 | let s:gui0E = "b6b3eb" 22 | let s:gui0F = "bc9458" 23 | " let s:gui10 = "ccddff" 24 | let s:gui10 = "ffccbb" 25 | 26 | " Terminal color definitions 27 | let s:cterm00 = "00" 28 | let s:cterm03 = "08" 29 | let s:cterm05 = "07" 30 | let s:cterm07 = "15" 31 | let s:cterm08 = "01" 32 | let s:cterm0A = "03" 33 | let s:cterm0B = "02" 34 | let s:cterm0C = "06" 35 | let s:cterm0D = "04" 36 | let s:cterm0E = "05" 37 | if exists('base16colorspace') && base16colorspace == "256" 38 | let s:cterm01 = "18" 39 | let s:cterm02 = "19" 40 | let s:cterm04 = "20" 41 | let s:cterm06 = "21" 42 | let s:cterm09 = "16" 43 | let s:cterm0F = "17" 44 | else 45 | let s:cterm01 = "10" 46 | let s:cterm02 = "11" 47 | let s:cterm04 = "12" 48 | let s:cterm06 = "13" 49 | let s:cterm09 = "09" 50 | let s:cterm0F = "14" 51 | endif 52 | 53 | " Theme setup 54 | hi clear 55 | syntax reset 56 | let g:colors_name = "base16-railscasts-noj" 57 | 58 | " Highlighting function 59 | fun hi(group, guifg, guibg, ctermfg, ctermbg, attr) 60 | if a:guifg != "" 61 | exec "hi " . a:group . " guifg=#" . s:gui(a:guifg) 62 | endif 63 | if a:guibg != "" 64 | exec "hi " . a:group . " guibg=#" . s:gui(a:guibg) 65 | endif 66 | if a:ctermfg != "" 67 | exec "hi " . a:group . " ctermfg=" . s:cterm(a:ctermfg) 68 | endif 69 | if a:ctermbg != "" 70 | exec "hi " . a:group . " ctermbg=" . s:cterm(a:ctermbg) 71 | endif 72 | if a:attr != "" 73 | exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr 74 | endif 75 | endfun 76 | 77 | " Return GUI color for light/dark variants 78 | fun s:gui(color) 79 | if &background == "dark" 80 | return a:color 81 | endif 82 | 83 | if a:color == s:gui00 84 | return s:gui07 85 | elseif a:color == s:gui01 86 | return s:gui06 87 | elseif a:color == s:gui02 88 | return s:gui05 89 | elseif a:color == s:gui03 90 | return s:gui04 91 | elseif a:color == s:gui04 92 | return s:gui03 93 | elseif a:color == s:gui05 94 | return s:gui02 95 | elseif a:color == s:gui05 96 | return s:gui02 97 | elseif a:color == s:gui06 98 | return s:gui01 99 | elseif a:color == s:gui07 100 | return s:gui00 101 | endif 102 | 103 | return a:color 104 | endfun 105 | 106 | " Return terminal color for light/dark variants 107 | fun s:cterm(color) 108 | if &background == "dark" 109 | return a:color 110 | endif 111 | 112 | if a:color == s:cterm00 113 | return s:cterm07 114 | elseif a:color == s:cterm01 115 | return s:cterm06 116 | elseif a:color == s:cterm02 117 | return s:cterm05 118 | elseif a:color == s:cterm03 119 | return s:cterm04 120 | elseif a:color == s:cterm04 121 | return s:cterm03 122 | elseif a:color == s:cterm05 123 | return s:cterm02 124 | elseif a:color == s:cterm05 125 | return s:cterm02 126 | elseif a:color == s:cterm06 127 | return s:cterm01 128 | elseif a:color == s:cterm07 129 | return s:cterm00 130 | endif 131 | 132 | return a:color 133 | endfun 134 | 135 | " Vim editor colors 136 | call hi("Bold", "", "", "", "", "bold") 137 | call hi("Debug", s:gui08, "", s:cterm08, "", "") 138 | call hi("Directory", s:gui0D, "", s:cterm0D, "", "") 139 | call hi("ErrorMsg", s:gui08, s:gui00, s:cterm08, s:cterm00, "") 140 | call hi("Exception", s:gui08, "", s:cterm08, "", "") 141 | call hi("FoldColumn", "", s:gui01, "", s:cterm01, "") 142 | call hi("Folded", s:gui03, s:gui01, s:cterm03, s:cterm01, "") 143 | call hi("IncSearch", s:gui0A, "", s:cterm0A, "", "") 144 | call hi("Italic", "", "", "", "", "none") 145 | call hi("Macro", s:gui08, "", s:cterm08, "", "") 146 | call hi("MatchParen", s:gui03, s:gui00, s:cterm03, s:cterm00, "reverse") 147 | call hi("ModeMsg", s:gui0B, "", s:cterm0B, "", "") 148 | call hi("MoreMsg", s:gui0B, "", s:cterm0B, "", "") 149 | call hi("Question", s:gui0A, "", s:cterm0A, "", "") 150 | call hi("Search", s:gui0A, s:gui01, s:cterm0A, s:cterm01, "reverse") 151 | call hi("SpecialKey", s:gui03, "", s:cterm03, "", "") 152 | call hi("TooLong", s:gui08, "", s:cterm08, "", "") 153 | call hi("Underlined", s:gui08, "", s:cterm08, "", "") 154 | call hi("Visual", "", s:gui02, "", s:cterm02, "") 155 | call hi("VisualNOS", s:gui08, "", s:cterm08, "", "") 156 | call hi("WarningMsg", s:gui08, "", s:cterm08, "", "") 157 | call hi("WildMenu", s:gui08, "", s:cterm08, "", "") 158 | call hi("Title", s:gui0D, "", s:cterm0D, "", "none") 159 | call hi("Conceal", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "") 160 | call hi("Cursor", s:gui00, s:gui05, s:cterm00, s:cterm05, "") 161 | call hi("NonText", s:gui03, "", s:cterm03, "", "") 162 | " call hi("Normal", s:gui05, s:gui00, s:cterm05, s:cterm00, "") 163 | call hi("Normal", s:gui04, s:gui00, s:cterm04, s:cterm00, "") 164 | call hi("LineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "") 165 | call hi("SignColumn", s:gui03, s:gui01, s:cterm03, s:cterm01, "") 166 | call hi("SpecialKey", s:gui03, "", s:cterm03, "", "") 167 | call hi("StatusLine", s:gui04, s:gui02, s:cterm04, s:cterm02, "none") 168 | call hi("StatusLineNC", s:gui03, s:gui01, s:cterm03, s:cterm01, "none") 169 | call hi("VertSplit", s:gui02, s:gui02, s:cterm02, s:cterm02, "none") 170 | call hi("ColorColumn", "", s:gui02, "", s:cterm02, "none") 171 | call hi("CursorColumn", "", s:gui02, "", s:cterm02, "none") 172 | call hi("CursorLine", "", s:gui02, "", s:cterm02, "none") 173 | call hi("CursorLineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "") 174 | call hi("PMenu", s:gui04, s:gui01, s:cterm04, s:cterm01, "none") 175 | call hi("PMenuSel", s:gui04, s:gui01, s:cterm04, s:cterm01, "reverse") 176 | call hi("TabLine", s:gui03, s:gui01, s:cterm03, s:cterm01, "none") 177 | call hi("TabLineFill", s:gui03, s:gui01, s:cterm03, s:cterm01, "none") 178 | call hi("TabLineSel", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "none") 179 | 180 | " Standard syntax highlighting 181 | call hi("Boolean", s:gui0D, "", s:cterm0D, "", "") 182 | call hi("Character", s:gui08, "", s:cterm08, "", "") 183 | call hi("Comment", s:gui0B, "", s:cterm0B, "", "") 184 | call hi("Conditional", s:gui08, "", s:cterm08, "", "") 185 | call hi("Constant", s:gui0D, "", s:cterm0D, "", "") 186 | call hi("Define", s:gui0E, "", s:cterm0E, "", "none") 187 | call hi("Delimiter", s:gui0F, "", s:cterm0F, "", "") 188 | call hi("Float", s:gui0C, "", s:cterm0C, "", "") 189 | call hi("Function", s:gui0D, "", s:cterm0D, "", "") 190 | call hi("Identifier", s:gui07, "", s:cterm07, "", "none") 191 | call hi("Include", s:gui0D, "", s:cterm0D, "", "") 192 | call hi("Keyword", s:gui0E, "", s:cterm0E, "", "") 193 | call hi("Label", s:gui0A, "", s:cterm0A, "", "") 194 | call hi("Number", s:gui0C, "", s:cterm0C, "", "") 195 | call hi("Operator", s:gui0E, "", s:cterm0E, "", "none") 196 | call hi("PreProc", s:gui03, "", s:cterm03, "", "") 197 | call hi("Repeat", s:gui08, "", s:cterm08, "", "") 198 | call hi("Special", s:gui0C, "", s:cterm0C, "", "") 199 | call hi("SpecialChar", s:gui0F, "", s:cterm0F, "", "") 200 | call hi("Statement", s:gui08, "", s:cterm08, "", "") 201 | call hi("StorageClass", s:gui0A, "", s:cterm0A, "", "") 202 | call hi("String", s:gui09, s:gui01, s:cterm09, s:cterm01, "") 203 | call hi("Structure", s:gui0E, "", s:cterm0E, "", "") 204 | call hi("Tag", s:gui0A, "", s:cterm0A, "", "") 205 | call hi("Todo", s:gui07, s:gui08, s:cterm07, s:cterm08, "") 206 | call hi("Type", s:gui0D, "", s:cterm0D, "", "none") 207 | call hi("Typedef", s:gui0D, "", s:cterm0D, "", "") 208 | 209 | " nojhan's cpp 210 | call hi("cppOperator", s:gui0E, "", s:cterm0E, "", "none") 211 | call hi("cppSTL", s:gui06, "", s:cterm06, "", "none") 212 | call hi("cppBraces", s:gui0A, "", s:cterm0A, "", "none") 213 | call hi("cppStatement", s:gui0A, "", s:cterm0A, "", "none") 214 | call hi("cppStructure", s:gui0D, "", s:cterm0D, "", "none") 215 | call hi("cppEndline", s:gui03, "", s:cterm03, "", "none") 216 | call hi("cppTrailingSpace", s:gui08, s:gui04, s:cterm08, s:cterm04, "") 217 | call hi("cppMacro", s:gui03, "", s:cterm03, "", "none") 218 | " call hi("cppMember", s:gui10, "", s:cterm06, "", "none") 219 | call hi("cppMember", s:gui04, "", s:cterm06, "", "italic") 220 | 221 | " Spelling highlighting 222 | call hi("SpellBad", "", s:gui00, "", s:cterm00, "undercurl") 223 | call hi("SpellLocal", "", s:gui00, "", s:cterm00, "undercurl") 224 | call hi("SpellCap", "", s:gui00, "", s:cterm00, "undercurl") 225 | call hi("SpellRare", "", s:gui00, "", s:cterm00, "undercurl") 226 | 227 | " Additional diff highlighting 228 | call hi("DiffAdd", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "") 229 | call hi("DiffChange", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "") 230 | call hi("DiffDelete", s:gui08, s:gui00, s:cterm08, s:cterm00, "") 231 | call hi("DiffText", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "") 232 | call hi("DiffAdded", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "") 233 | call hi("DiffFile", s:gui08, s:gui00, s:cterm08, s:cterm00, "") 234 | call hi("DiffNewFile", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "") 235 | call hi("DiffLine", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "") 236 | call hi("DiffRemoved", s:gui08, s:gui00, s:cterm08, s:cterm00, "") 237 | 238 | " Ruby highlighting 239 | call hi("rubyAttribute", s:gui0D, "", s:cterm0D, "", "") 240 | call hi("rubyConstant", s:gui0A, "", s:cterm0A, "", "") 241 | call hi("rubyInterpolation", s:gui0B, "", s:cterm0B, "", "") 242 | call hi("rubyInterpolationDelimiter", s:gui0F, "", s:cterm0F, "", "") 243 | call hi("rubyRegexp", s:gui0C, "", s:cterm0C, "", "") 244 | call hi("rubySymbol", s:gui0B, "", s:cterm0B, "", "") 245 | call hi("rubyStringDelimiter", s:gui0B, "", s:cterm0B, "", "") 246 | 247 | " PHP highlighting 248 | call hi("phpMemberSelector", s:gui05, "", s:cterm05, "", "") 249 | call hi("phpComparison", s:gui05, "", s:cterm05, "", "") 250 | call hi("phpParent", s:gui05, "", s:cterm05, "", "") 251 | 252 | " HTML highlighting 253 | call hi("htmlBold", s:gui0A, "", s:cterm0A, "", "") 254 | call hi("htmlItalic", s:gui0E, "", s:cterm0E, "", "") 255 | call hi("htmlEndTag", s:gui05, "", s:cterm05, "", "") 256 | call hi("htmlTag", s:gui05, "", s:cterm05, "", "") 257 | 258 | " CSS highlighting 259 | call hi("cssBraces", s:gui05, "", s:cterm05, "", "") 260 | call hi("cssClassName", s:gui0E, "", s:cterm0E, "", "") 261 | call hi("cssColor", s:gui0C, "", s:cterm0C, "", "") 262 | 263 | " SASS highlighting 264 | call hi("sassidChar", s:gui08, "", s:cterm08, "", "") 265 | call hi("sassClassChar", s:gui09, "", s:cterm09, "", "") 266 | call hi("sassInclude", s:gui0E, "", s:cterm0E, "", "") 267 | call hi("sassMixing", s:gui0E, "", s:cterm0E, "", "") 268 | call hi("sassMixinName", s:gui0D, "", s:cterm0D, "", "") 269 | 270 | " JavaScript highlighting 271 | call hi("javaScript", s:gui05, "", s:cterm05, "", "") 272 | call hi("javaScriptBraces", s:gui05, "", s:cterm05, "", "") 273 | call hi("javaScriptNumber", s:gui09, "", s:cterm09, "", "") 274 | 275 | " Markdown highlighting 276 | call hi("markdownCode", s:gui0B, "", s:cterm0B, "", "") 277 | call hi("markdownCodeBlock", s:gui0B, "", s:cterm0B, "", "") 278 | call hi("markdownHeadingDelimiter", s:gui0D, "", s:cterm0D, "", "") 279 | 280 | " Git highlighting 281 | call hi("gitCommitOverflow", s:gui08, "", s:cterm08, "", "") 282 | call hi("gitCommitSummary", s:gui0B, "", s:cterm0B, "", "") 283 | 284 | " GitGutter highlighting 285 | call hi("GitGutterAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "") 286 | call hi("GitGutterChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "") 287 | call hi("GitGutterDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "") 288 | 289 | 290 | " GitGutter highlighting 291 | call hi("NERDTreeDirSlash", s:gui0D, "", s:cterm0D, "", "") 292 | call hi("NERDTreeExecFile", s:gui05, "", s:cterm05, "", "") 293 | 294 | " Remove functions 295 | delf hi 296 | delf gui 297 | delf cterm 298 | 299 | " Remove color variables 300 | unlet s:gui00 s:gui01 s:gui02 s:gui03 s:gui04 s:gui05 s:gui06 s:gui07 s:gui08 s:gui09 s:gui0A s:gui0B s:gui0C s:gui0D s:gui0E s:gui0F 301 | unlet s:cterm00 s:cterm01 s:cterm02 s:cterm03 s:cterm04 s:cterm05 s:cterm06 s:cterm07 s:cterm08 s:cterm09 s:cterm0A s:cterm0B s:cterm0C s:cterm0D s:cterm0E s:cterm0F 302 | -------------------------------------------------------------------------------- /.vim/colors/inkpot.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Name: inkpot.vim 3 | " Maintainer: Ciaran McCreesh 4 | " This should work in the GUI, rxvt-unicode (88 colour mode) and xterm (256 5 | " colour mode). It won't work in 8/16 colour terminals. 6 | 7 | set background=dark 8 | hi clear 9 | if exists("syntax_on") 10 | syntax reset 11 | endif 12 | 13 | let colors_name = "inkpot" 14 | 15 | " map a urxvt cube number to an xterm-256 cube number 16 | fun! M(a) 17 | return strpart("0135", a:a, 1) + 0 18 | endfun 19 | 20 | " map a urxvt colour to an xterm-256 colour 21 | fun! X(a) 22 | if &t_Co == 88 23 | return a:a 24 | else 25 | if a:a == 8 26 | return 237 27 | elseif a:a < 16 28 | return a:a 29 | elseif a:a > 79 30 | return 232 + (3 * (a:a - 80)) 31 | else 32 | let l:b = a:a - 16 33 | let l:x = l:b % 4 34 | let l:y = (l:b / 4) % 4 35 | let l:z = (l:b / 16) 36 | return 16 + M(l:x) + (6 * M(l:y)) + (36 * M(l:z)) 37 | endif 38 | endif 39 | endfun 40 | 41 | if has("gui_running") 42 | hi Normal gui=NONE guifg=#cfbfad guibg=#1e1e27 43 | hi IncSearch gui=BOLD guifg=#303030 guibg=#cd8b60 44 | hi Search gui=NONE guifg=#303030 guibg=#cd8b60 45 | hi ErrorMsg gui=BOLD guifg=#ffffff guibg=#ff3300 46 | hi WarningMsg gui=BOLD guifg=#ffffff guibg=#ff6600 47 | hi ModeMsg gui=BOLD guifg=#7e7eae guibg=NONE 48 | hi MoreMsg gui=BOLD guifg=#7e7eae guibg=NONE 49 | hi Question gui=BOLD guifg=#ffcd00 guibg=NONE 50 | hi StatusLine gui=BOLD guifg=#b9b9b9 guibg=#3e3e5e 51 | hi StatusLineNC gui=NONE guifg=#b9b9b9 guibg=#3e3e5e 52 | hi VertSplit gui=NONE guifg=#b9b9b9 guibg=#3e3e5e 53 | hi WildMenu gui=BOLD guifg=#ffcd00 guibg=#1e1e2e 54 | 55 | hi DiffText gui=NONE guifg=#ffffcd guibg=#00cd00 56 | hi DiffChange gui=NONE guifg=#ffffcd guibg=#008bff 57 | hi DiffDelete gui=NONE guifg=#ffffcd guibg=#cd0000 58 | hi DiffAdd gui=NONE guifg=#ffffcd guibg=#00cd00 59 | 60 | hi Cursor gui=NONE guifg=#404040 guibg=#8b8bff 61 | hi lCursor gui=NONE guifg=#404040 guibg=#8b8bff 62 | hi CursorIM gui=NONE guifg=#404040 guibg=#8b8bff 63 | 64 | hi Folded gui=NONE guifg=#cfcfcd guibg=#4b208f 65 | hi FoldColumn gui=NONE guifg=#8b8bcd guibg=#2e2e2e 66 | 67 | hi Directory gui=NONE guifg=#00ff8b guibg=NONE 68 | hi LineNr gui=NONE guifg=#8b8bcd guibg=#2e2e2e 69 | hi NonText gui=BOLD guifg=#8b8bcd guibg=NONE 70 | hi SpecialKey gui=BOLD guifg=#8b00cd guibg=NONE 71 | hi Title gui=BOLD guifg=#af4f4b guibg=#1e1e27 72 | hi Visual gui=NONE guifg=#603030 guibg=#edab60 73 | 74 | hi Comment gui=NONE guifg=#cd8b00 guibg=NONE 75 | hi Constant gui=NONE guifg=#ffcd8b guibg=NONE 76 | hi String gui=NONE guifg=#ffcd8b guibg=#404040 77 | hi Error gui=NONE guifg=#ffffff guibg=#ff0000 78 | hi Identifier gui=NONE guifg=#ff8bff guibg=NONE 79 | hi Ignore gui=NONE guifg=#8b8bcd guibg=NONE 80 | hi Number gui=NONE guifg=#506dbd guibg=NONE 81 | hi PreProc gui=NONE guifg=#409090 guibg=NONE 82 | hi Special gui=NONE guifg=#c080d0 guibg=NONE 83 | hi Statement gui=NONE guifg=#808bed guibg=NONE 84 | hi Todo gui=BOLD guifg=#303030 guibg=#c080d0 85 | hi Type gui=NONE guifg=#ff8bff guibg=NONE 86 | hi Underlined gui=BOLD guifg=#ffffcd guibg=NONE 87 | hi TaglistTagName gui=BOLD guifg=#808bed guibg=NONE 88 | hi Pmenu gui=NONE guifg=white guibg=black 89 | hi ColorColumn guibg=#1a1a22 90 | else 91 | exec "hi Normal cterm=NONE ctermfg=" . X("78") . " ctermbg=" . X(80) . "" 92 | exec "hi IncSearch cterm=BOLD ctermfg=" . X("80") . " ctermbg=" . X(73) . "" 93 | exec "hi Search cterm=NONE ctermfg=" . X("80") . " ctermbg=" . X(73) . "" 94 | exec "hi ErrorMsg cterm=BOLD ctermfg=" . X("79") . " ctermbg=" . X(64) . "" 95 | exec "hi WarningMsg cterm=BOLD ctermfg=" . X("79") . " ctermbg=" . X(68) . "" 96 | exec "hi ModeMsg cterm=BOLD ctermfg=" . X("39") . "" 97 | exec "hi MoreMsg cterm=BOLD ctermfg=" . X("39") . "" 98 | exec "hi Question cterm=BOLD ctermfg=" . X("72") . "" 99 | exec "hi StatusLine cterm=BOLD ctermfg=" . X("84") . " ctermbg=" . X(81) . "" 100 | exec "hi StatusLineNC cterm=NONE ctermfg=" . X("84") . " ctermbg=" . X(81) . "" 101 | exec "hi VertSplit cterm=NONE ctermfg=" . X("84") . " ctermbg=" . X(82) . "" 102 | exec "hi WildMenu cterm=BOLD ctermfg=" . X("72") . " ctermbg=" . X(80) . "" 103 | 104 | exec "hi DiffText cterm=NONE ctermfg=" . X("78") . " ctermbg=" . X(24) . "" 105 | exec "hi DiffChange cterm=NONE ctermfg=" . X("78") . " ctermbg=" . X(23) . "" 106 | exec "hi DiffDelete cterm=NONE ctermfg=" . X("78") . " ctermbg=" . X(48) . "" 107 | exec "hi DiffAdd cterm=NONE ctermfg=" . X("78") . " ctermbg=" . X(24) . "" 108 | 109 | exec "hi Cursor cterm=NONE ctermfg=" . X("8") . " ctermbg=" . X(39) . "" 110 | exec "hi lCursor cterm=NONE ctermfg=" . X("8") . " ctermbg=" . X(39) . "" 111 | exec "hi CursorIM cterm=NONE ctermfg=" . X("8") . " ctermbg=" . X(39) . "" 112 | 113 | exec "hi Folded cterm=NONE ctermfg=" . X("78") . " ctermbg=" . X(35) . "" 114 | exec "hi FoldColumn cterm=NONE ctermfg=" . X("38") . " ctermbg=" . X(80) . "" 115 | 116 | exec "hi Directory cterm=NONE ctermfg=" . X("29") . " ctermbg=NONE" 117 | exec "hi LineNr cterm=NONE ctermfg=" . X("38") . " ctermbg=" . X(80) . "" 118 | exec "hi NonText cterm=BOLD ctermfg=" . X("38") . " ctermbg=NONE" 119 | exec "hi SpecialKey cterm=BOLD ctermfg=" . X("34") . " ctermbg=NONE" 120 | exec "hi Title cterm=BOLD ctermfg=" . X("52") . " ctermbg=" . X(80) . "" 121 | exec "hi Visual cterm=NONE ctermfg=" . X("80") . " ctermbg=" . X(73) . "" 122 | 123 | exec "hi Comment cterm=NONE ctermfg=" . X("52") . " ctermbg=NONE" 124 | exec "hi Constant cterm=NONE ctermfg=" . X("73") . " ctermbg=NONE" 125 | exec "hi String cterm=NONE ctermfg=" . X("73") . " ctermbg=" . X(8) . "" 126 | exec "hi Error cterm=NONE ctermfg=" . X("79") . " ctermbg=" . X(64) . "" 127 | exec "hi Identifier cterm=NONE ctermfg=" . X("71") . " ctermbg=NONE" 128 | exec "hi Ignore cterm=NONE ctermfg=" . X("38") . " ctermbg=NONE" 129 | exec "hi Number cterm=NONE ctermfg=" . X("22") . " ctermbg=NONE" 130 | exec "hi PreProc cterm=NONE ctermfg=" . X("10") . " ctermbg=NONE" 131 | exec "hi Special cterm=NONE ctermfg=" . X("39") . " ctermbg=NONE" 132 | exec "hi Statement cterm=NONE ctermfg=" . X("26") . " ctermbg=NONE" 133 | exec "hi Todo cterm=BOLD ctermfg=" . X("08") . " ctermbg=" . X(39) . "" 134 | exec "hi Type cterm=NONE ctermfg=" . X("71") . " ctermbg=NONE" 135 | exec "hi Underlined cterm=BOLD ctermfg=" . X("78") . " ctermbg=NONE" 136 | exec "hi TaglistTagName cterm=BOLD ctermfg=" . X("26") . " ctermbg=NONE" 137 | endif 138 | 139 | " vim: set et : 140 | -------------------------------------------------------------------------------- /.vim/spell/en.utf-8.add: -------------------------------------------------------------------------------- 1 | french 2 | aircrafts 3 | uncrewed 4 | geolocated 5 | polytope 6 | eikonal 7 | Eulerian 8 | cartesian 9 | cardinality 10 | discretization 11 | algorithmics 12 | anisotropic 13 | -------------------------------------------------------------------------------- /.vim/spell/en.utf-8.add.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nojhan/dotfiles/4e85e0c1caef3d2ab1de76cc5a698361085dde5b/.vim/spell/en.utf-8.add.spl -------------------------------------------------------------------------------- /.vim/spell/fr.utf-8.add: -------------------------------------------------------------------------------- 1 | algorithmie 2 | anti 3 | Thales 4 | replanification 5 | middleware 6 | Petri 7 | → 8 | GPS 9 | multi 10 | CPU 11 | multi 12 | explicabilité 13 | solveurs 14 | IA 15 | métaheuristiques 16 | métaheuristique 17 | solveur 18 | frameworks 19 | œuvre 20 | -------------------------------------------------------------------------------- /.vim/spell/fr.utf-8.add.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nojhan/dotfiles/4e85e0c1caef3d2ab1de76cc5a698361085dde5b/.vim/spell/fr.utf-8.add.spl -------------------------------------------------------------------------------- /.vim/spell/fr.utf-8.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nojhan/dotfiles/4e85e0c1caef3d2ab1de76cc5a698361085dde5b/.vim/spell/fr.utf-8.spl -------------------------------------------------------------------------------- /.vim/syntax/Wikipedia.vim: -------------------------------------------------------------------------------- 1 | " Wikipedia syntax file for Vim 2 | " Published on Wikipedia in 2003-04 and declared authorless. 3 | " 4 | " Based on the HTML syntax file. Probably too closely based, in fact. There 5 | " may well be name collisions everywhere, but ignorance is bliss, so they say. 6 | " 7 | " To do: plug-in support for downloading and uploading to the server. 8 | 9 | if !exists("main_syntax") 10 | if version < 600 11 | syntax clear 12 | elseif exists("b:current_syntax") 13 | finish 14 | endif 15 | let main_syntax = 'html' 16 | endif 17 | 18 | if version < 508 19 | command! -nargs=+ HtmlHiLink hi link 20 | else 21 | command! -nargs=+ HtmlHiLink hi def link 22 | endif 23 | 24 | syn case ignore 25 | 26 | syn spell toplevel 27 | set spell 28 | 29 | " tags 30 | syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar 31 | syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar 32 | syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 33 | syn region htmlEndTag start=++ contains=htmlTagN 34 | 35 | "syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,@htmlArgCluster 36 | syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster 37 | 38 | syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster 39 | syn match htmlTagN contained +]<"ms=s+1 41 | 42 | " allowed tag names 43 | syn keyword htmlTagName contained b i u font big small sub sup 44 | syn keyword htmlTagName contained h1 h2 h3 h4 h5 h6 cite code em s strike strong tt var div center 45 | syn keyword htmlTagName contained blockquote ol ul dl table caption pre 46 | syn keyword htmlTagName contained ruby rt rb rp 47 | syn keyword htmlTagName contained br p hr li dt dd 48 | syn keyword htmlTagName contained table tr td th div blockquote ol ul 49 | syn keyword htmlTagName contained dl font big small sub sup 50 | syn keyword htmlTagName contained td th tr 51 | syn keyword htmlTagName contained nowiki math 52 | 53 | " allowed arg names 54 | syn keyword htmlArg contained title align lang dir width height 55 | syn keyword htmlArg contained bgcolor clear noshade 56 | syn keyword htmlArg contained cite size face color 57 | syn keyword htmlArg contained type start value compact 58 | syn keyword htmlArg contained summary width border frame rules 59 | syn keyword htmlArg contained cellspacing cellpadding valign char 60 | syn keyword htmlArg contained charoff colgroup col span abbr axis 61 | syn keyword htmlArg contained headers scope rowspan colspan 62 | syn keyword htmlArg contained id class name style 63 | 64 | " special characters 65 | syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" 66 | 67 | " comments 68 | syn region htmlComment start=++ contains=htmlCommentPart,htmlCommentError 69 | syn match htmlCommentError contained "[^>+ 72 | 73 | " HTML formatting 74 | syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlComment,htmlLink 75 | 76 | syn region htmlBold start="" end=""me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic 77 | syn region htmlBold start="" end=""me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic 78 | syn region htmlBoldUnderline contained start="" end=""me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic 79 | syn region htmlBoldItalic contained start="" end=""me=e-4 contains=@htmlTop,htmlBoldItalicUnderline 80 | syn region htmlBoldItalic contained start="" end=""me=e-5 contains=@htmlTop,htmlBoldItalicUnderline 81 | syn region htmlBoldUnderlineItalic contained start="" end=""me=e-4 contains=@htmlTop 82 | syn region htmlBoldUnderlineItalic contained start="" end=""me=e-5 contains=@htmlTop 83 | syn region htmlBoldItalicUnderline contained start="" end=""me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic 84 | 85 | syn region htmlUnderline start="" end=""me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic 86 | syn region htmlUnderlineBold contained start="" end=""me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic 87 | syn region htmlUnderlineBold contained start="" end=""me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic 88 | syn region htmlUnderlineItalic contained start="" end=""me=e-4 contains=@htmlTop,htmUnderlineItalicBold 89 | syn region htmlUnderlineItalic contained start="" end=""me=e-5 contains=@htmlTop,htmUnderlineItalicBold 90 | syn region htmlUnderlineItalicBold contained start="" end=""me=e-4 contains=@htmlTop 91 | syn region htmlUnderlineItalicBold contained start="" end=""me=e-9 contains=@htmlTop 92 | syn region htmlUnderlineBoldItalic contained start="" end=""me=e-4 contains=@htmlTop 93 | syn region htmlUnderlineBoldItalic contained start="" end=""me=e-5 contains=@htmlTop 94 | 95 | syn region htmlItalic start="" end=""me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline 96 | syn region htmlItalic start="" end=""me=e-5 contains=@htmlTop 97 | syn region htmlItalicBold contained start="" end=""me=e-4 contains=@htmlTop,htmlItalicBoldUnderline 98 | syn region htmlItalicBold contained start="" end=""me=e-9 contains=@htmlTop,htmlItalicBoldUnderline 99 | syn region htmlItalicBoldUnderline contained start="" end=""me=e-4 contains=@htmlTop 100 | syn region htmlItalicUnderline contained start="" end=""me=e-4 contains=@htmlTop,htmlItalicUnderlineBold 101 | syn region htmlItalicUnderlineBold contained start="" end=""me=e-4 contains=@htmlTop 102 | syn region htmlItalicUnderlineBold contained start="" end=""me=e-9 contains=@htmlTop 103 | 104 | syn region htmlH1 start="" end=""me=e-5 contains=@htmlTop 105 | syn region htmlH2 start="" end=""me=e-5 contains=@htmlTop 106 | syn region htmlH3 start="" end=""me=e-5 contains=@htmlTop 107 | syn region htmlH4 start="" end=""me=e-5 contains=@htmlTop 108 | syn region htmlH5 start="" end=""me=e-5 contains=@htmlTop 109 | syn region htmlH6 start="" end=""me=e-5 contains=@htmlTop 110 | syn region htmlHead start="" end=""me=e-7 end=""me=e-5 end=""me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,cssStyle 111 | syn region htmlTitle start="" end=""me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment 112 | 113 | " wiki formatting 114 | "syn region wikiItalic start="\([^']\|\_^\)''[^']"hs=s+1 end="[^']''\([^']\|\_$\)"he=e-1 skip=".*" contains=wikiLink,wikiItalicBold 115 | "syn region wikiBold start="\([^']\|\_^\)'''[^']" end="[^']'''\([^']\|\_$\)" skip=".*" contains=wikiLink,wikiBoldItalic 116 | 117 | "syn region wikiBoldItalic contained start="\([^']\|\_^\)''[^']" end="[^']''\([^']\|\_$\)" skip=".*" contains=wikiLink 118 | "syn region wikiItalicBold contained start="\([^']\|\_^\)'''[^']" end="[^']'''\([^']\|\_$\)" skip=".*" contains=wikiLink 119 | 120 | "syn region wikiBoldAndItalic start="'''''" end="'''''" skip=".*" contains=wikiLink 121 | 122 | syn region wikiItalic start=+'\@.*" oneline contains=@Spell,wikiLink 130 | syn region wikiH2 start="^==" end="==" skip=".*" oneline contains=@Spell,wikiLink 131 | syn region wikiH3 start="^===" end="===" skip=".*" oneline contains=@Spell,wikiLink 132 | syn region wikiH4 start="^====" end="====" skip=".*" oneline contains=@Spell,wikiLink 133 | syn region wikiH5 start="^=====" end="=====" skip=".*" oneline contains=@Spell,wikiLink 134 | syn region wikiH6 start="^======" end="======" skip=".*" oneline contains=@Spell,wikiLink 135 | syn region wikiLink start="\[\[" end="\]\]\(s\|'s\|es\|ing\|\)" skip=".*" oneline contains=wikiLink 136 | syn region wikiLink start="\[http:" end="\]" skip=".*" oneline 137 | syn region wikiLink start="\[https:" end="\]" skip=".*" oneline 138 | syn region wikiLink start="\[ftp:" end="\]" skip=".*" oneline 139 | syn region wikiLink start="\[gopher:" end="\]" skip=".*" oneline 140 | syn region wikiLink start="\[news:" end="\]" skip=".*" oneline 141 | syn region wikiLink start="\[mailto:" end="\]" skip=".*" oneline 142 | syn region wikiTemplate start="{{" end="}}" skip=".*" 143 | 144 | syn match wikiParaFormatChar /^[\:|\*|;|#]\+/ 145 | syn match wikiParaFormatChar /^-----*/ 146 | syn match wikiPre /^\ .*$/ 147 | 148 | syn include @TeX syntax/tex.vim 149 | syntax region wikiTeX matchgroup=htmlTag start="" end="" skip=".*" contains=@texMathZoneGroup 150 | syntax region wikiRef matchgroup=htmlTag start="" end="" skip=".*" 151 | 152 | 153 | " HTML highlighting 154 | 155 | HtmlHiLink htmlTag Function 156 | HtmlHiLink htmlEndTag Identifier 157 | HtmlHiLink htmlArg Type 158 | HtmlHiLink htmlTagName htmlStatement 159 | HtmlHiLink htmlSpecialTagName Exception 160 | HtmlHiLink htmlValue String 161 | HtmlHiLink htmlSpecialChar Special 162 | 163 | HtmlHiLink htmlH1 Title 164 | HtmlHiLink htmlH2 htmlH1 165 | HtmlHiLink htmlH3 htmlH2 166 | HtmlHiLink htmlH4 htmlH3 167 | HtmlHiLink htmlH5 htmlH4 168 | HtmlHiLink htmlH6 htmlH5 169 | HtmlHiLink htmlHead PreProc 170 | HtmlHiLink htmlTitle Title 171 | HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic 172 | HtmlHiLink htmlUnderlineBold htmlBoldUnderline 173 | HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic 174 | HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic 175 | HtmlHiLink htmlItalicUnderline htmlUnderlineItalic 176 | HtmlHiLink htmlItalicBold htmlBoldItalic 177 | HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic 178 | HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic 179 | 180 | HtmlHiLink htmlSpecial Special 181 | HtmlHiLink htmlSpecialChar Special 182 | HtmlHiLink htmlString String 183 | HtmlHiLink htmlStatement Statement 184 | HtmlHiLink htmlComment Comment 185 | HtmlHiLink htmlCommentPart Comment 186 | HtmlHiLink htmlValue String 187 | HtmlHiLink htmlCommentError htmlError 188 | HtmlHiLink htmlTagError htmlError 189 | HtmlHiLink htmlEvent javaScript 190 | HtmlHiLink htmlError Error 191 | 192 | HtmlHiLink htmlCssStyleComment Comment 193 | HtmlHiLink htmlCssDefinition Special 194 | 195 | " The default highlighting. 196 | if version >= 508 || !exists("did_html_syn_inits") 197 | if version < 508 198 | let did_html_syn_inits = 1 199 | endif 200 | HtmlHiLink htmlTag Function 201 | HtmlHiLink htmlEndTag Identifier 202 | HtmlHiLink htmlArg Type 203 | HtmlHiLink htmlTagName htmlStatement 204 | HtmlHiLink htmlSpecialTagName Exception 205 | HtmlHiLink htmlValue String 206 | HtmlHiLink htmlSpecialChar Special 207 | 208 | if !exists("html_no_rendering") 209 | HtmlHiLink htmlH1 Title 210 | HtmlHiLink htmlH2 htmlH1 211 | HtmlHiLink htmlH3 htmlH2 212 | HtmlHiLink htmlH4 htmlH3 213 | HtmlHiLink htmlH5 htmlH4 214 | HtmlHiLink htmlH6 htmlH5 215 | HtmlHiLink htmlHead PreProc 216 | HtmlHiLink htmlTitle Title 217 | HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic 218 | HtmlHiLink htmlUnderlineBold htmlBoldUnderline 219 | HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic 220 | HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic 221 | HtmlHiLink htmlItalicUnderline htmlUnderlineItalic 222 | HtmlHiLink htmlItalicBold htmlBoldItalic 223 | HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic 224 | HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic 225 | HtmlHiLink htmlLink Underlined 226 | if !exists("html_my_rendering") 227 | hi def htmlBold term=bold cterm=bold gui=bold 228 | hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline 229 | hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic 230 | hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline 231 | hi def htmlUnderline term=underline cterm=underline gui=underline 232 | hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline 233 | hi def htmlItalic term=italic cterm=italic gui=italic 234 | endif 235 | endif 236 | 237 | HtmlHiLink htmlPreStmt PreProc 238 | HtmlHiLink htmlPreError Error 239 | HtmlHiLink htmlPreProc PreProc 240 | HtmlHiLink htmlPreAttr String 241 | HtmlHiLink htmlPreProcAttrName PreProc 242 | HtmlHiLink htmlPreProcAttrError Error 243 | HtmlHiLink htmlSpecial Special 244 | HtmlHiLink htmlSpecialChar Special 245 | HtmlHiLink htmlString String 246 | HtmlHiLink htmlStatement Statement 247 | HtmlHiLink htmlComment Comment 248 | HtmlHiLink htmlCommentPart Comment 249 | HtmlHiLink htmlValue String 250 | HtmlHiLink htmlCommentError htmlError 251 | HtmlHiLink htmlTagError htmlError 252 | HtmlHiLink htmlEvent javaScript 253 | HtmlHiLink htmlError Error 254 | 255 | HtmlHiLink javaScript Special 256 | HtmlHiLink javaScriptExpression javaScript 257 | HtmlHiLink htmlCssStyleComment Comment 258 | HtmlHiLink htmlCssDefinition Special 259 | endif 260 | 261 | " wiki highlighting 262 | 263 | HtmlHiLink wikiItalic htmlItalic 264 | HtmlHiLink wikiBold htmlBold 265 | 266 | HtmlHiLink wikiBoldItalic htmlBoldItalic 267 | HtmlHiLink wikiItalicBold htmlBoldItalic 268 | 269 | HtmlHiLink wikiBoldAndItalic htmlBoldItalic 270 | 271 | HtmlHiLink wikiH1 htmlH1 272 | HtmlHiLink wikiH2 htmlH2 273 | HtmlHiLink wikiH3 htmlH3 274 | HtmlHiLink wikiH4 htmlH4 275 | HtmlHiLink wikiH5 htmlH5 276 | HtmlHiLink wikiH6 htmlH6 277 | HtmlHiLink wikiLink Underlined 278 | HtmlHiLink wikiTemplate Special 279 | HtmlHiLink wikiParaFormatChar Special 280 | HtmlHiLink wikiPre Constant 281 | HtmlHiLink wikiRef Comment 282 | 283 | 284 | let b:current_syntax = "html" 285 | 286 | delcommand HtmlHiLink 287 | 288 | if main_syntax == 'html' 289 | unlet main_syntax 290 | endif -------------------------------------------------------------------------------- /.vim/syntax/cpp.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: C++ special highlighting for STL classes and methods 3 | " Maintainer: Nathan Skvirsky 4 | " Last Change: 2006 Oct 22 5 | 6 | " For version 5.x: Clear all syntax items 7 | " For version 6.x: Quit when a syntax file was already loaded 8 | if version < 600 9 | syntax clear 10 | elseif exists("b:current_syntax") 11 | finish 12 | endif 13 | 14 | " Read the C syntax to start with 15 | if version < 600 16 | so :p:h/c.vim 17 | else 18 | runtime! syntax/c.vim 19 | unlet b:current_syntax 20 | endif 21 | 22 | " C++ extentions 23 | 24 | syn keyword cppSTL abort abs accumulate acos adjacent_difference adjacent_find adjacent_find_if any append asctime asin assign at atan atan2 atexit atof atoi atol auto_ptr back back_inserter bad bad_alloc bad_cast bad_exception bad_typeid badbit beg begin binary_compose binary_negate binary_search bind2nd binder1st binder2nd bitset bsearch c_str calloc capacity ceil cerr cin clear clearerr clock clog close compare compose1 compose2 const_iterator construct copy copy_backward copy_n cos cosh count count_if cout ctime data deque destroy difference_type difftime div divides domain_error empty end endl eof eofbit equal equal_range erase exception exit exp fabs fail failbit failure fclose feof ferror fflush fgetc fgetpos fgets fill fill_n find find_end find_first_not_of find_first_of find_if find_last_not_of find_last_of first flags flip floor flush fmod fopen for_each fprintf fputc fputs fread free freopen frexp front fscanf fseek fsetpos fstream ftell fwrite gcount generate generate_n get get_temporary_buffer getc getchar getenv getline gets gmtime good goodbit greater greater_equal hash_map hash_multimap hash_multiset hash_set ifstream ignore in includes inner_product inplace_merge insert inserter invalid_argument ios ios_base iostate iota is_heap is_open is_sorted isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace istream istream_iterator istringstream isupper isxdigit iter_swap iterator iterator_category key_comp ldiv length length_error less less_equal lexicographical_compare lexicographical_compare_3way list localtime log log10 logic_error logical_and logical_not logical_or longjmp lower_bound make_heap malloc map max max_element max_size mem_fun mem_fun1 mem_fun1_ref mem_fun_ref memchr memcpy memmove memset merge min min_element minus mismatch mktime modf modulus multimap multiplies multiset negate next_permutation npos nth_element numeric_limits ofstream open ostream ostream_iterator ostringstream out_of_range overflow_error pair make_pair partial_sort partial_sort_copy partial_sum partition peek perror plus pointer pointer_to_binary_function pointer_to_unary_function pop pop_back pop_front pop_heap pow power precision prev_permutation printf ptr_fun push push_back push_front push_heap put putback putc putchar puts qsort raise rand random_sample random_sample_n random_shuffle range_error rbegin rdbuf rdstate read realloc reference remove remove_copy remove_copy_if remove_if rename rend replace replace_copy replace_copy_if replace_if reserve reset resize return_temporary_buffer reverse reverse_copy reverse_iterator rewind rfind rotate rotate_copy runtime_error scanf search search_n second seekg seekp set set_difference set_intersection set_symmetric_difference set_union setbuf setf setjmp setlocale setvbuf signal sin sinh size size_t size_type sort sort_heap splice sprintf sqrt srand sscanf stable_partition stable_sort std str strcat strchr strcmp strcoll strcpy strcspn strerror strftime string strlen strncat strncmp strncpy strpbrk strrchr strspn strstr strtod strtok strtol strtoul strxfrm substr swap swap_ranges sync_with_stdio system tan tanh tellg tellp temporary_buffer test time time_t tmpfile tmpnam to_string to_ulong tolower top toupper transform unary_compose unary_negate underflow_error unget ungetc uninitialized_copy uninitialized_copy_n uninitialized_fill uninitialized_fill_n unique unique_copy unsetf upper_bound va_arg value_comp value_type vector vfprintf vprintf vsprintf width write round initializer_list function make_unique make_shared forward 25 | 26 | syn keyword cppStatement new delete this friend using 27 | syn keyword cppAccess public protected private 28 | syn keyword cppType inline virtual explicit export bool wchar_t size_t 29 | syn keyword cppExceptions throw try catch 30 | syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\>" 31 | syn keyword cppStorageClass mutable 32 | syn keyword cppStructure class typename template namespace 33 | syn keyword cppNumber NPOS 34 | syn keyword cppBoolean true false 35 | syn match cppBraces display '[{}()\[\]]' 36 | syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq 37 | syn keyword cppOperator operator typeid 38 | syn match cppOperator "+\|-\|\*\|:\|,\|<\|>\|&\||\|!\|\~\|%\|=\|\." " \* bug comments 39 | syn match cppEndline ";" 40 | 41 | " nojhan adhoc 42 | syn match cppTrailingSpace "\s*$" 43 | syn match cppMacro "\s*DBG[A-Z]*\s*(.*);$" 44 | syn keyword cppMacro assert 45 | syn match cppOperator "\<\(ITEMS\|VERTICES\|EDGES\|ALL\)\>" 46 | syn match cppOperator "\" 47 | syn keyword cppOperator IN ROC 48 | syn match cppMember "\<_[a-zA-Z_][a-zA-Z_0-9]*\>" 49 | syn keyword cppType auto 50 | " 51 | " Show trailing colon (instead of semi-colon) 52 | syn match cppEndingColon /\S:$/ 53 | 54 | " The minimum and maximum operators in GNU C++ 55 | syn match cppMinMax "[<>]?" 56 | 57 | " Default highlighting 58 | if version >= 508 || !exists("did_cpp_syntax_inits") 59 | if version < 508 60 | let did_cpp_syntax_inits = 1 61 | command -nargs=+ HiLink hi link 62 | else 63 | command -nargs=+ HiLink hi def link 64 | endif 65 | HiLink cppAccess cppStatement 66 | HiLink cppCast cppType 67 | HiLink cppExceptions Exception 68 | HiLink cppOperator Operator 69 | HiLink cppEndline Operator 70 | HiLink cppStatement Statement 71 | HiLink cppSTL Identifier 72 | HiLink cppNCBI Special 73 | HiLink cppType Type 74 | HiLink cppStorageClass StorageClass 75 | HiLink cppStructure Structure 76 | HiLink cppNumber Number 77 | HiLink cppBoolean Boolean 78 | HiLink cppMacro PreProc 79 | HiLink cppEndingColon Todo 80 | delcommand HiLink 81 | endif 82 | 83 | let b:current_syntax = "cpp" 84 | 85 | " vim: ts=8 86 | 87 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | set nocompatible " be iMproved, required 2 | filetype off " required 3 | 4 | " set the runtime path to include Vundle and initialize 5 | set rtp+=~/.vim/bundle/Vundle.vim 6 | call vundle#begin() 7 | " alternatively, pass a path where Vundle should install plugins 8 | "call vundle#begin('~/some/path/here') 9 | 10 | " let Vundle manage Vundle, required 11 | Plugin 'VundleVim/Vundle.vim' 12 | 13 | " Keep Plugin commands between vundle#begin/end. 14 | " plugin on GitHub repo 15 | Plugin 'scrooloose/nerdtree' " left panel with file explorer: F11 or ,b 16 | Plugin 'millermedeiros/vim-statline' " better buffer status line 17 | Plugin 'ervandew/supertab' " completion with in insert mode 18 | Plugin 'tomtom/tlib_vim' " utilities library for other plugins 19 | Plugin 'tomtom/tcomment_vim' " easy comments: gcc or gc 20 | Plugin 'tpope/vim-eunuch' " proxy to Linux commands, most notably :SudoWrite 21 | Plugin 'tpope/vim-surround' " new moves: i (inside) and a (around) 22 | Plugin 'oblitum/rainbow' " rainbow parentheses: ,r 23 | " Plugin 'kien/rainbow_parentheses' " superseeded by rainbow 24 | " Plugin 'sjl/gundo' " multiple path tree undo history 25 | Plugin 'fholgado/minibufexpl' " bottom « tabs » flat list of opened buffers 26 | Plugin 'majutsushi/tagbar' " right panel with functions/classes: ,é 27 | " Plugin 'terryma/vim-multiple-cursors' " Not enough vimesque, either `Ctrl-V` or `:%s` are sufficient. 28 | " Plugin 'airblade/vim-gitgutter' " Not enough useful compared to plain old `git diff`, at the end. 29 | Plugin 'terryma/vim-expand-region' " expand/shrink the current visual selection: + and - 30 | " Plugin 'tomtom/quickfixsigns_vim' " gutter with various symbols (too slow) 31 | " Plugin 'vim-scripts/TaskList' 32 | " Plugin 'kien/ctrlp' 33 | " Plugin 'Valloric/YouCompleteMe' 34 | " Plugin 'SirVer/ultisnips' 35 | " Plugin 'honza/vim-snippets' 36 | " Plugin 'jeaye/color_coded' 37 | Plugin 'lervag/vimtex' 38 | Plugin 'vim-scripts/a.vim' " alternate between header/code files: :A 39 | Plugin 'leafgarland/typescript-vim' 40 | 41 | " All of your Plugins must be added before the following line 42 | call vundle#end() " required 43 | filetype plugin indent on " required 44 | 45 | set nocompatible " do not try to be vi-compatible 46 | 47 | " call pathogen#infect() 48 | " set sessionoptions-=options " Because pathogen. 49 | 50 | set guifont=Deja\ Vu\ Sans\ Mono\ 10 51 | 52 | syntax on " syntax coloring by default 53 | 54 | let base16colorspace=256 55 | color base16-railscasts-noj 56 | set background=dark 57 | 58 | if &t_Co >= 256 && ! has("gui_running") 59 | " do not use solarized within term with 256 colors 60 | colorscheme inkpot 61 | endif 62 | 63 | 64 | set textwidth=120 65 | set wrap " auto wrap line view, but not text itself 66 | 67 | filetype indent on " activates indenting for files 68 | set softtabstop=4 " width of a tab 69 | set tabstop=4 70 | set shiftwidth=4 " width of the indentation 71 | set expandtab 72 | 73 | set ignorecase " case-insentive search by default 74 | set smartcase " search case-sensitive if there is an upper-case letter 75 | set gdefault " when replacing, use /g by default 76 | set showmatch " paren match highlighting 77 | set hlsearch " highlight what you search for 78 | set incsearch " type-ahead-find 79 | set wildmenu " command-line completion shows a list of matches 80 | set wildmode=longest,list:longest,full " Bash-vim completion behavior 81 | set autochdir " use current working directory of a file as base path 82 | 83 | set encoding=utf-8 84 | 85 | set nu " show line numbers 86 | set showmode " show the current mode on the last line 87 | set showcmd " show informations about selection while in visual mode 88 | 89 | set guioptions-=T "remove toolbar 90 | 91 | set colorcolumn=72,120 " highligth the 80th and 120th column 92 | 93 | hi CursorLine gui=underline term=underline guibg=NONE ctermbg=NONE 94 | " The `!` implements a toggle 95 | nnoremap l :set cursorline! 96 | 97 | " all operations such as yy, D, and P work with the clipboard. 98 | " No need to prefix them with "* or "+ 99 | set clipboard=unnamed 100 | 101 | " New split placed below 102 | set splitbelow 103 | " New vsplit placed right 104 | set splitright 105 | 106 | set foldmethod=syntax 107 | set foldlevelstart=20 " buffer are always loaded with opened folds 108 | 109 | " persistent undo across sessions 110 | set undofile 111 | set undodir=~/.vim/undodir 112 | 113 | " always keep lines around the cursor 114 | set scrolloff=5 115 | 116 | " Let cursor move past the last char in visual block mode 117 | set virtualedit=block 118 | 119 | " show more matching characters 120 | set matchpairs+=<:> 121 | 122 | let mapleader = "," " leader key is comma 123 | let maplocalleader = "\" 124 | 125 | " xx will delete the line without copying it into the default register 126 | nnoremap xx "_dd 127 | 128 | nnoremap t :set noexpandtab 129 | nnoremap T :set expandtab 130 | 131 | " Yank the line, comment it, paste it 132 | nmap g yygccp 133 | 134 | " When jumping to a given line, center the screen 135 | nnoremap G Gzz 136 | 137 | " ,v will reselect the text that was just pasted 138 | nnoremap v V`] 139 | 140 | " ,w will disable autowrap line break 141 | nnoremap w :set tw=0 142 | nnoremap W :set tw=80 143 | nnoremap x :set tw=120 144 | 145 | " ,s will split vertically and swith over the new panel 146 | nnoremap s vl:bn 147 | 148 | " ,S will split horizontally and swith over the new panel 149 | nnoremap S sl:bn 150 | 151 | nnoremap 152 | nnoremap 153 | 154 | " Wrap a paragraph and justify it 155 | :runtime macros/justify.vim 156 | nnoremap j gw}{V}:call Justify('tw',4) 157 | 158 | " activate rainbow parenthesis 159 | " nnoremap R :RainbowParenthesesToggle 160 | nnoremap r :RainbowToggle 161 | 162 | " activate gundo 163 | nnoremap u :GundoToggle 164 | 165 | " remove all C/C++ comments and blank lines 166 | " nnoremap c :%s/\/\*\_.*\*\/\n\{,1}\|^\s*\/\/.*\n\|\s*\/\/.*//:%s/^\s*\n// 167 | 168 | nnoremap c :close 169 | 170 | nnoremap n :noh 171 | 172 | " set a tiny guifont size 173 | nnoremap h :set guifont=Deja\ Vu\ Sans\ Mono\ 4 174 | 175 | " set a normal guifont size 176 | nnoremap f :set guifont=Deja\ Vu\ Sans\ Mono\ 12 177 | 178 | " set a big guifont size 179 | nnoremap ç :set guifont=Deja\ Vu\ Sans\ Mono\ 16 180 | 181 | " highligth git merge marks 182 | nnoremap m /[<=>]\{7\} 183 | 184 | " double percentage sign in command mode is expanded 185 | " to directory of current file - http://vimcasts.org/e/14 186 | cnoremap %% =expand('%:h').'/' 187 | 188 | " Put plugins and dictionaries in this dir (also on Windows) 189 | let vimDir = '$HOME/.vim' 190 | let &runtimepath.=','.vimDir 191 | 192 | " Keep undo history across sessions by storing it in a file 193 | if has('persistent_undo') 194 | let myUndoDir = expand(vimDir . '/undodir') 195 | " Create dirs 196 | call system('mkdir ' . vimDir) 197 | call system('mkdir ' . myUndoDir) 198 | let &undodir = myUndoDir 199 | set undofile 200 | endif 201 | 202 | " Ctrl-P config 203 | let g:ctrlp_working_path_mode = 'ra' " search for files from the nearest ancestor that contains a VCS 204 | let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files'] " list only files versionned within GIT 205 | map p :CtrlP 206 | 207 | " semantic selection expansion/shrink 208 | map + (expand_region_expand) 209 | map - (expand_region_shrink) 210 | 211 | " reload config after editing vimrc 212 | autocmd! BufWritePost .vimrc source $MYVIMRC 213 | 214 | " use shift-space as escape 215 | "inoremap 216 | 217 | " print tabs with a special character (add ",eol:·" for end of lines) 218 | " set listchars=trail:·,nbsp:·,tab:▸\ ,extends:»,precedes:«, 219 | set listchars=trail:·,nbsp:·,tab:˲\ ,extends:»,precedes:«, 220 | set list 221 | 222 | 223 | " au VimEnter * echomsg system('/usr/games/fortune vimtweets') 224 | 225 | "au FocusLost * :wa " save every opened buffer when the window lost focus 226 | 227 | 228 | set laststatus=2 " always show the statusline, even when there is only one file edited 229 | " if has("statusline") 230 | " "set statusline=\ %f%m%r\ [%{strlen(&ft)?&ft:'aucun'},%{strlen(&fenc)?&fenc:&enc},%{&fileformat},ts:%{&tabstop}]%{fugitive#statusline()}%=%l,%c%V\ %P 231 | " set statusline=\ %f%m%r\ [%{strlen(&ft)?&ft:'aucun'},%{strlen(&fenc)?&fenc:&enc},%{&fileformat},ts:%{&tabstop}]%=%l,%c%V\ %P 232 | " elseif has("cmdline_info") 233 | " set ruler " show current line and column number 234 | " endif 235 | 236 | " Style of the status line of the current window 237 | hi StatusLine ctermfg=15 ctermbg=239 cterm=bold guifg=#000000 guibg=#ffaa00 gui=bold 238 | 239 | " Style of the status line of the Non-Current window 240 | "hi StatusLineNC ctermfg=249 guifg=#b2b2b2 ctermbg=237 guibg=#3a3a3a cterm=none gui=none 241 | 242 | if has("fname_case") 243 | au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,*.L,.emacs,.sawfishrc,*.pddl setf lisp 244 | else 245 | au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,.emacs,.sawfishrc,*.pddl setf lisp 246 | endif 247 | 248 | au BufRead,BufNewFile *.thrift setfiletype thrift 249 | au BufRead,BufNewFile *.ts setfiletype typescript 250 | 251 | 252 | " move the current line up or down with the Ctrl-arrow keys 253 | nmap :move .+1 254 | nmap :move .-2 255 | imap :move .+1 256 | imap :move .-2 257 | vmap :move '>+1gv 258 | vmap :move '<-2gv 259 | 260 | " filetype plugin on 261 | " set ofu=syntaxcomplete#Complete 262 | 263 | au BufRead,BufNewFile *.mwiki setf Wikipedia 264 | au BufRead,BufNewFile *.wikipedia.org.* setf Wikipedia 265 | 266 | " autocomplétion with instead of , depending on the context 267 | " function! Smart_TabComplete() 268 | " let line = getline('.') " curline 269 | " let substr = strpart(line, -1, col('.')+1) " from start to cursor 270 | " let substr = matchstr(substr, "[^ \t]*$") " word till cursor 271 | " if (strlen(substr)==0) " nothing to match on empty string 272 | " return "\" 273 | " endif 274 | " let has_period = match(substr, '\.') != -1 " position of period, if any 275 | " let has_slash = match(substr, '\/') != -1 " position of slash, if any 276 | " if (!has_period && !has_slash) 277 | " return "\\" " existing text matching 278 | " elseif ( has_slash ) 279 | " return "\\" " file matching 280 | " else 281 | " return "\\" " plugin matching 282 | " endif 283 | " endfunction 284 | 285 | " inoremap =Smart_TabComplete() 286 | 287 | 288 | " Append modeline after last line in buffer. 289 | " Use substitute() instead of printf() to handle '%%s' modeline in LaTeX 290 | " files. 291 | function! AppendModeline() 292 | let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d :", 293 | \ &tabstop, &shiftwidth, &textwidth) 294 | let l:modeline = substitute(&commentstring, "%s", l:modeline, "") 295 | call append(line("$"), l:modeline) 296 | endfunction 297 | nnoremap ml :call AppendModeline() 298 | 299 | 300 | "switch spellcheck languages 301 | let g:myLang = 0 302 | let g:myLangList = [ "nospell", "fr_fr", "en_gb" ] 303 | function! MySpellLang() 304 | "loop through languages 305 | let g:myLang = g:myLang + 1 306 | if g:myLang >= len(g:myLangList) | let g:myLang = 0 | endif 307 | if g:myLang == 0 | set nospell | endif 308 | if g:myLang == 1 | setlocal spell spelllang=fr_fr | endif 309 | if g:myLang == 2 | setlocal spell spelllang=en_us | endif 310 | echo "language:" g:myLangList[g:myLang] 311 | endf 312 | map :call MySpellLang() 313 | imap :call MySpellLang() 314 | 315 | 316 | " search the file for FIXME, TODO and put them in a handy list 317 | map TaskList 318 | 319 | " side pane of class and functions 320 | "map :TlistToggle 321 | nmap :TagbarToggle 322 | nnoremap é :TagbarToggle 323 | 324 | " side pane of files 325 | map :NERDTreeToggle 326 | nnoremap b :NERDTreeToggle 327 | " nnoremap t :NERDTreeToggle 328 | " 329 | " let NERDTreeSortOrder=['\.h$','\.hpp$','\.cpp$'] 330 | 331 | " NERDTress File highlighting 332 | function! NERDTreeHighlightFile(extension, fg) 333 | let a_name = 'ndhf_' . substitute(a:extension, "\\.", "_", "") 334 | exec 'autocmd FileType nerdtree highlight '.a_name.' ctermbg='.'NONE'.' ctermfg='.a:fg.' guibg='.'NONE'.' guifg='.a:fg 335 | exec 'autocmd FileType nerdtree syn match '.a_name.' #^\s\+.*'.a:extension.'\W\**$#' 336 | exec 'autocmd FileType nerdtree syn match '.a_name.' #^\s\+.*'.a:extension.'$#' 337 | endfunction 338 | 339 | " doc 340 | call NERDTreeHighlightFile('README', 'green') 341 | call NERDTreeHighlightFile('md' , 'green') 342 | " source files 343 | call NERDTreeHighlightFile('c' , 'lightmagenta') 344 | call NERDTreeHighlightFile('cc' , 'lightmagenta') 345 | call NERDTreeHighlightFile('cpp', 'lightmagenta') 346 | call NERDTreeHighlightFile('mm' , 'lightmagenta') 347 | call NERDTreeHighlightFile('hpp', 'lightred') 348 | " headers 349 | call NERDTreeHighlightFile('h' , 'cyan') 350 | " shell scripts 351 | call NERDTreeHighlightFile('sh' , 'lightgreen') 352 | call NERDTreeHighlightFile('bash', 'lightgreen') 353 | " scripts 354 | call NERDTreeHighlightFile('py' , 'yellow') 355 | " makefiles 356 | call NERDTreeHighlightFile('CMakeLists.txt', 'red') 357 | call NERDTreeHighlightFile('Doxyfile.in', 'red') 358 | call NERDTreeHighlightFile('Doxyfile', 'lightred') 359 | call NERDTreeHighlightFile('makefile' , 'lightred') 360 | call NERDTreeHighlightFile('Makefile' , 'lightred') 361 | 362 | 363 | 364 | " go to definition and center screen (navigate forward in the tags stack) 365 | "nnoremap :YcmCompleter GoTozz 366 | " jump back from definition (navigate backward in the jumps stack) 367 | "nnoremap 368 | " open the definition in a vertical split and center screen 369 | "nnoremap :vsp :exec(":YcmCompleter GoTo")zz 370 | 371 | "nnoremap ? :YcmCompleter GetDoc 372 | 373 | " Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. 374 | let g:UltiSnipsExpandTrigger="" 375 | 376 | " configure tags - add additional tags here or comment out not-used ones 377 | " set tags+=./tags;$HOME 378 | " set tags+=~/code/paradiseo/tags 379 | " set tags+=~/.vim/tags/cpp 380 | 381 | " build tags of your own project with CTRL+F12 382 | map :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q . 383 | " go to definition and center screen (navigate forward in the tags stack) 384 | nnoremap zz 385 | " jump back from definition (navigate backward in the tags stack) 386 | nnoremap 387 | " open the definition in a vertical split and center screen 388 | nnoremap :vsp :exec("tag ".expand(""))zz 389 | 390 | " OmniCppComplete 391 | " let OmniCpp_NamespaceSearch = 1 392 | " let OmniCpp_GlobalScopeSearch = 1 393 | " let OmniCpp_ShowAccess = 1 394 | " let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters 395 | " let OmniCpp_MayCompleteDot = 1 " autocomplete after . 396 | " let OmniCpp_MayCompleteArrow = 1 " autocomplete after -> 397 | " let OmniCpp_MayCompleteScope = 1 " autocomplete after :: 398 | " let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"] 399 | 400 | " automatically open and close the popup menu / preview window 401 | " au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif 402 | " set completeopt=menuone,menu,longest,preview 403 | 404 | " close the buffer without deleting its window 405 | ":runtime bundle/bclose.vim 406 | " nmap :bc Kwbd 407 | " nmap d :b#bd# 408 | " nmap :bc :b#bd# 409 | 410 | let g:tex_flavor = 'latex' 411 | nmap lt (vimtex-toc-toggle) 412 | -------------------------------------------------------------------------------- /.xmodmap.conf: -------------------------------------------------------------------------------- 1 | ! Utiliser xev pour récupérer le keycode 2 | ! keycode X = Key Shift+Key mode_switch+Key mode_switch+Shift+Key AltGr+Key AltGr+Shift+Key 3 | 4 | ! Accès direct sur < et > 5 | ! bépo : inversion des guillemets à la française et des supérieurs/inférieurs 6 | keycode 11 = less 2 less 2 guillemotleft leftdoublequotemark guillemotleft 7 | keycode 12 = greater 3 greater 3 guillemotright rightdoublequotemark guillemotright 8 | 9 | ! Accès direct sur :, shift pour avoir le . 10 | ! bépo : inversion du : et du . 11 | keycode 55 = colon period colon period ellipsis periodcentered ellipsis 12 | 13 | ! Ajout apostrophe typographique en AltGr-? 14 | keycode 57 = apostrophe question apostrophe question U2019 questiondown U2019 15 | 16 | ! Espace insécable en AltGr-Shift-space 17 | ! ! bépo : suppression de l'espace insécable en Shift 18 | keycode 65 = space space space space underscore nobreakspace underscore 19 | 20 | ! Ajout flêches en AltGr sur la rangée du haut 21 | keycode 32 = l L l L leftarrow dead_stroke leftarrow 22 | keycode 33 = j J j J downarrow U0133 downarrow 23 | keycode 34 = z Z z Z uparrow schwa uparrow 24 | keycode 35 = w W w W rightarrow dead_breve rightarrow 25 | 26 | ! Ajout coeur sur Altgr-Shift-g 27 | keycode 59 = g G g G mu U2764 mu 28 | 29 | ! Presque égal sur AltGr-Shift-= 30 | ! bépo : remplacement de "minutes" par "presque égal" 31 | keycode 20 = equal degree equal degree notequal U2248 notequal 32 | 33 | ! exposant-chiffres en Altgr-Shift- 1 2 3 34 | ! bépo : remplacement des guillemets en exposant-chiffre 35 | keycode 10 = quotedbl 1 quotedbl 1 emdash U00B9 emdash 36 | keycode 11 = less 2 less 2 guillemotleft U00B2 guillemotleft 37 | keycode 12 = greater 3 greater 3 guillemotright U00B3 guillemotright 38 | 39 | ! Ajout checkmark sur le Altgr-ç 40 | keycode 51 = ccedilla Ccedilla ccedilla Ccedilla checkmark ballotcross 41 | 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | These are my current and past configuration files. 2 | 3 | If you are looking for the super useful bash prompt, it is now a separated project called *Liquid prompt*. 4 | You can find it at: https://github.com/nojhan/liquidprompt 5 | -------------------------------------------------------------------------------- /demo_prompt_bash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nojhan/dotfiles/4e85e0c1caef3d2ab1de76cc5a698361085dde5b/demo_prompt_bash.png -------------------------------------------------------------------------------- /ipython_config.py: -------------------------------------------------------------------------------- 1 | # Configuration file for ipython. 2 | 3 | c = get_config() 4 | 5 | #------------------------------------------------------------------------------ 6 | # InteractiveShellApp configuration 7 | #------------------------------------------------------------------------------ 8 | 9 | # A Mixin for applications that start InteractiveShell instances. 10 | # 11 | # Provides configurables for loading extensions and executing files as part of 12 | # configuring a Shell environment. 13 | # 14 | # Provides init_extensions() and init_code() methods, to be called after 15 | # init_shell(), which must be implemented by subclasses. 16 | 17 | # Execute the given command string. 18 | # c.InteractiveShellApp.code_to_run = '' 19 | 20 | # lines of code to run at IPython startup. 21 | # c.InteractiveShellApp.exec_lines = [] 22 | 23 | # If true, an 'import *' is done from numpy and pylab, when using pylab 24 | # c.InteractiveShellApp.pylab_import_all = True 25 | 26 | # A list of dotted module names of IPython extensions to load. 27 | # c.InteractiveShellApp.extensions = [] 28 | 29 | # dotted module name of an IPython extension to load. 30 | # c.InteractiveShellApp.extra_extension = '' 31 | 32 | # List of files to run at IPython startup. 33 | # c.InteractiveShellApp.exec_files = [] 34 | 35 | # A file to be run 36 | # c.InteractiveShellApp.file_to_run = '' 37 | 38 | #------------------------------------------------------------------------------ 39 | # TerminalIPythonApp configuration 40 | #------------------------------------------------------------------------------ 41 | 42 | # TerminalIPythonApp will inherit config from: BaseIPythonApplication, 43 | # Application, InteractiveShellApp 44 | 45 | # Execute the given command string. 46 | # c.TerminalIPythonApp.code_to_run = '' 47 | 48 | # The IPython profile to use. 49 | # c.TerminalIPythonApp.profile = u'default' 50 | 51 | # Set the log level by value or name. 52 | # c.TerminalIPythonApp.log_level = 30 53 | 54 | # lines of code to run at IPython startup. 55 | # c.TerminalIPythonApp.exec_lines = [] 56 | 57 | # Enable GUI event loop integration ('qt', 'wx', 'gtk', 'glut', 'pyglet'). 58 | # c.TerminalIPythonApp.gui = None 59 | 60 | # Pre-load matplotlib and numpy for interactive use, selecting a particular 61 | # matplotlib backend and loop integration. 62 | # c.TerminalIPythonApp.pylab = None 63 | 64 | # Suppress warning messages about legacy config files 65 | # c.TerminalIPythonApp.ignore_old_config = False 66 | 67 | # Create a massive crash report when IPython enconters what may be an internal 68 | # error. The default is to append a short message to the usual traceback 69 | # c.TerminalIPythonApp.verbose_crash = False 70 | 71 | # If a command or file is given via the command-line, e.g. 'ipython foo.py 72 | # c.TerminalIPythonApp.force_interact = False 73 | 74 | # If true, an 'import *' is done from numpy and pylab, when using pylab 75 | # c.TerminalIPythonApp.pylab_import_all = True 76 | 77 | # The name of the IPython directory. This directory is used for logging 78 | # configuration (through profiles), history storage, etc. The default is usually 79 | # $HOME/.ipython. This options can also be specified through the environment 80 | # variable IPYTHON_DIR. 81 | # c.TerminalIPythonApp.ipython_dir = u'/home/nojhan/.config/ipython' 82 | 83 | # Whether to display a banner upon starting IPython. 84 | # c.TerminalIPythonApp.display_banner = True 85 | 86 | # Start IPython quickly by skipping the loading of config files. 87 | # c.TerminalIPythonApp.quick = False 88 | 89 | # A list of dotted module names of IPython extensions to load. 90 | # c.TerminalIPythonApp.extensions = [] 91 | 92 | # Whether to install the default config files into the profile dir. If a new 93 | # profile is being created, and IPython contains config files for that profile, 94 | # then they will be staged into the new directory. Otherwise, default config 95 | # files will be automatically generated. 96 | # c.TerminalIPythonApp.copy_config_files = False 97 | 98 | # dotted module name of an IPython extension to load. 99 | # c.TerminalIPythonApp.extra_extension = '' 100 | 101 | # List of files to run at IPython startup. 102 | # c.TerminalIPythonApp.exec_files = [] 103 | 104 | # Whether to overwrite existing config files when copying 105 | # c.TerminalIPythonApp.overwrite = False 106 | 107 | # A file to be run 108 | # c.TerminalIPythonApp.file_to_run = '' 109 | 110 | #------------------------------------------------------------------------------ 111 | # TerminalInteractiveShell configuration 112 | #------------------------------------------------------------------------------ 113 | 114 | # TerminalInteractiveShell will inherit config from: InteractiveShell 115 | 116 | # auto editing of files with syntax errors. 117 | # c.TerminalInteractiveShell.autoedit_syntax = False 118 | 119 | # Use colors for displaying information about objects. Because this information 120 | # is passed through a pager (like 'less'), and some pagers get confused with 121 | # color codes, this capability can be turned off. 122 | # c.TerminalInteractiveShell.color_info = True 123 | 124 | # 125 | # c.TerminalInteractiveShell.history_length = 10000 126 | 127 | # Don't call post-execute functions that have failed in the past. 128 | # c.TerminalInteractiveShell.disable_failing_post_execute = False 129 | 130 | # Show rewritten input, e.g. for autocall. 131 | # c.TerminalInteractiveShell.show_rewritten_input = True 132 | 133 | # Set the color scheme (NoColor, Linux, or LightBG). 134 | # c.TerminalInteractiveShell.colors = 'LightBG' 135 | 136 | # Autoindent IPython code entered interactively. 137 | # c.TerminalInteractiveShell.autoindent = True 138 | 139 | # 140 | # c.TerminalInteractiveShell.separate_in = '\n' 141 | 142 | # Deprecated, use PromptManager.in2_template 143 | # c.TerminalInteractiveShell.prompt_in2 = ' .\\D.: ' 144 | 145 | # 146 | # c.TerminalInteractiveShell.separate_out = '' 147 | 148 | # Deprecated, use PromptManager.in_template 149 | # c.TerminalInteractiveShell.prompt_in1 = 'In [\\#]: ' 150 | 151 | # Enable deep (recursive) reloading by default. IPython can use the deep_reload 152 | # module which reloads changes in modules recursively (it replaces the reload() 153 | # function, so you don't need to change anything to use it). deep_reload() 154 | # forces a full reload of modules whose code may have changed, which the default 155 | # reload() function does not. When deep_reload is off, IPython will use the 156 | # normal reload(), but deep_reload will still be available as dreload(). 157 | # c.TerminalInteractiveShell.deep_reload = False 158 | 159 | # Make IPython automatically call any callable object even if you didn't type 160 | # explicit parentheses. For example, 'str 43' becomes 'str(43)' automatically. 161 | # The value can be '0' to disable the feature, '1' for 'smart' autocall, where 162 | # it is not applied if there are no more arguments on the line, and '2' for 163 | # 'full' autocall, where all callable objects are automatically called (even if 164 | # no arguments are present). 165 | # c.TerminalInteractiveShell.autocall = 0 166 | 167 | # Number of lines of your screen, used to control printing of very long strings. 168 | # Strings longer than this number of lines will be sent through a pager instead 169 | # of directly printed. The default value for this is 0, which means IPython 170 | # will auto-detect your screen size every time it needs to print certain 171 | # potentially long strings (this doesn't change the behavior of the 'print' 172 | # keyword, it's only triggered internally). If for some reason this isn't 173 | # working well (it needs curses support), specify it yourself. Otherwise don't 174 | # change the default. 175 | # c.TerminalInteractiveShell.screen_length = 0 176 | 177 | # Set the editor used by IPython (default to $EDITOR/vi/notepad). 178 | # c.TerminalInteractiveShell.editor = 'gvim' 179 | 180 | # Deprecated, use PromptManager.justify 181 | # c.TerminalInteractiveShell.prompts_pad_left = True 182 | 183 | # The part of the banner to be printed before the profile 184 | # c.TerminalInteractiveShell.banner1 = 'Python 2.7.3 (default, Aug 1 2012, 05:16:07) \nType "copyright", "credits" or "license" for more information.\n\nIPython 0.12.1 -- An enhanced Interactive Python.\n? -> Introduction and overview of IPython\'s features.\n%quickref -> Quick reference.\nhelp -> Python\'s own help system.\nobject? -> Details about \'object\', use \'object??\' for extra details.\n' 185 | 186 | # 187 | # c.TerminalInteractiveShell.readline_parse_and_bind = ['tab: complete', '"\\C-l": clear-screen', 'set show-all-if-ambiguous on', '"\\C-o": tab-insert', '"\\C-r": reverse-search-history', '"\\C-s": forward-search-history', '"\\C-p": history-search-backward', '"\\C-n": history-search-forward', '"\\e[A": history-search-backward', '"\\e[B": history-search-forward', '"\\C-k": kill-line', '"\\C-u": unix-line-discard'] 188 | 189 | # The part of the banner to be printed after the profile 190 | # c.TerminalInteractiveShell.banner2 = '' 191 | 192 | # 193 | # c.TerminalInteractiveShell.separate_out2 = '' 194 | 195 | # 196 | # c.TerminalInteractiveShell.wildcards_case_sensitive = True 197 | 198 | # 199 | # c.TerminalInteractiveShell.debug = False 200 | 201 | # Set to confirm when you try to exit IPython with an EOF (Control-D in Unix, 202 | # Control-Z/Enter in Windows). By typing 'exit' or 'quit', you can force a 203 | # direct exit without any confirmation. 204 | c.TerminalInteractiveShell.confirm_exit = False 205 | 206 | # 207 | # c.TerminalInteractiveShell.ipython_dir = '' 208 | 209 | # 210 | # c.TerminalInteractiveShell.readline_remove_delims = '-/~' 211 | 212 | # Start logging to the default log file. 213 | # c.TerminalInteractiveShell.logstart = False 214 | 215 | # The name of the logfile to use. 216 | # c.TerminalInteractiveShell.logfile = '' 217 | 218 | # The shell program to be used for paging. 219 | # c.TerminalInteractiveShell.pager = 'less' 220 | 221 | # Enable magic commands to be called without the leading %. 222 | # c.TerminalInteractiveShell.automagic = True 223 | 224 | # Save multi-line entries as one entry in readline history 225 | # c.TerminalInteractiveShell.multiline_history = True 226 | 227 | # 228 | # c.TerminalInteractiveShell.readline_use = True 229 | 230 | # Start logging to the given file in append mode. 231 | # c.TerminalInteractiveShell.logappend = '' 232 | 233 | # 234 | # c.TerminalInteractiveShell.xmode = 'Context' 235 | 236 | # 237 | # c.TerminalInteractiveShell.quiet = False 238 | 239 | # Enable auto setting the terminal title. 240 | # c.TerminalInteractiveShell.term_title = False 241 | 242 | # 243 | # c.TerminalInteractiveShell.object_info_string_level = 0 244 | 245 | # Deprecated, use PromptManager.out_template 246 | # c.TerminalInteractiveShell.prompt_out = 'Out[\\#]: ' 247 | 248 | # Set the size of the output cache. The default is 1000, you can change it 249 | # permanently in your config file. Setting it to 0 completely disables the 250 | # caching system, and the minimum value accepted is 20 (if you provide a value 251 | # less than 20, it is reset to 0 and a warning is issued). This limit is 252 | # defined because otherwise you'll spend more time re-flushing a too small cache 253 | # than working 254 | # c.TerminalInteractiveShell.cache_size = 1000 255 | 256 | # Automatically call the pdb debugger after every exception. 257 | # c.TerminalInteractiveShell.pdb = False 258 | 259 | #------------------------------------------------------------------------------ 260 | # PromptManager configuration 261 | #------------------------------------------------------------------------------ 262 | 263 | # This is the primary interface for producing IPython's prompts. 264 | 265 | # Output prompt. '\#' will be transformed to the prompt number 266 | c.PromptManager.out_template = '\\#{color.LightRed} <<< ' 267 | 268 | # Continuation prompt. 269 | # c.PromptManager.in2_template = ' .\\D.: ' 270 | 271 | # If True (default), each prompt will be right-aligned with the preceding one. 272 | c.PromptManager.justify = True 273 | 274 | # Input prompt. '\#' will be transformed to the prompt number 275 | # {color.Blue}\\T 276 | c.PromptManager.in_template = '{color.normal}[\\u{color.Brown}@{color.Blue}\\h{color.Green}:{color.White}{cwd_y[0]}{color.normal}] \\$\\n\\# {color.LightBlue}>>> ' 277 | 278 | # 279 | # c.PromptManager.color_scheme = 'Linux' 280 | 281 | #------------------------------------------------------------------------------ 282 | # ProfileDir configuration 283 | #------------------------------------------------------------------------------ 284 | 285 | # An object to manage the profile directory and its resources. 286 | # 287 | # The profile directory is used by all IPython applications, to manage 288 | # configuration, logging and security. 289 | # 290 | # This object knows how to find, create and manage these directories. This 291 | # should be used by any code that wants to handle profiles. 292 | 293 | # Set the profile location directly. This overrides the logic used by the 294 | # `profile` option. 295 | # c.ProfileDir.location = u'' 296 | 297 | #------------------------------------------------------------------------------ 298 | # PlainTextFormatter configuration 299 | #------------------------------------------------------------------------------ 300 | 301 | # The default pretty-printer. 302 | # 303 | # This uses :mod:`IPython.lib.pretty` to compute the format data of the object. 304 | # If the object cannot be pretty printed, :func:`repr` is used. See the 305 | # documentation of :mod:`IPython.lib.pretty` for details on how to write pretty 306 | # printers. Here is a simple example:: 307 | # 308 | # def dtype_pprinter(obj, p, cycle): 309 | # if cycle: 310 | # return p.text('dtype(...)') 311 | # if hasattr(obj, 'fields'): 312 | # if obj.fields is None: 313 | # p.text(repr(obj)) 314 | # else: 315 | # p.begin_group(7, 'dtype([') 316 | # for i, field in enumerate(obj.descr): 317 | # if i > 0: 318 | # p.text(',') 319 | # p.breakable() 320 | # p.pretty(field) 321 | # p.end_group(7, '])') 322 | 323 | # PlainTextFormatter will inherit config from: BaseFormatter 324 | 325 | # 326 | # c.PlainTextFormatter.type_printers = {} 327 | 328 | # 329 | # c.PlainTextFormatter.newline = '\n' 330 | 331 | # 332 | # c.PlainTextFormatter.float_precision = '' 333 | 334 | # 335 | # c.PlainTextFormatter.verbose = False 336 | 337 | # 338 | # c.PlainTextFormatter.deferred_printers = {} 339 | 340 | # 341 | # c.PlainTextFormatter.pprint = True 342 | 343 | # 344 | # c.PlainTextFormatter.max_width = 79 345 | 346 | # 347 | # c.PlainTextFormatter.singleton_printers = {} 348 | 349 | #------------------------------------------------------------------------------ 350 | # IPCompleter configuration 351 | #------------------------------------------------------------------------------ 352 | 353 | # Extension of the completer class with IPython-specific features 354 | 355 | # IPCompleter will inherit config from: Completer 356 | 357 | # Instruct the completer to omit private method names 358 | # 359 | # Specifically, when completing on ``object.``. 360 | # 361 | # When 2 [default]: all names that start with '_' will be excluded. 362 | # 363 | # When 1: all 'magic' names (``__foo__``) will be excluded. 364 | # 365 | # When 0: nothing will be excluded. 366 | # c.IPCompleter.omit__names = 2 367 | 368 | # Whether to merge completion results into a single list 369 | # 370 | # If False, only the completion results from the first non-empty completer will 371 | # be returned. 372 | # c.IPCompleter.merge_completions = True 373 | 374 | # Activate greedy completion 375 | # 376 | # This will enable completion on elements of lists, results of function calls, 377 | # etc., but can be unsafe because the code is actually evaluated on TAB. 378 | # c.IPCompleter.greedy = False 379 | -------------------------------------------------------------------------------- /kak/autoload/cpp.kak: -------------------------------------------------------------------------------- 1 | hook global WinSetOption filetype=(cpp) %[ 2 | require-module c-family 3 | evaluate-commands %sh{ 4 | # Grammar 5 | flow=' 6 | break case catch 7 | continue do 8 | else for goto if 9 | return switch 10 | throw try while 11 | assert static_assert ASSERT 12 | ' 13 | state=' 14 | alignas alignof asm compl const_cast decltype 15 | delete dynamic_cast export new operator reinterpret_cast 16 | sizeof static_cast typeid 17 | ' 18 | operators=' 19 | and and_eq bitand bitor not not_eq or or_eq xor xor_eq 20 | ' 21 | attributes=' 22 | audit axiom const consteval constexpr default explicit 23 | extern final friend inline mutable noexcept override private 24 | protected public register requires static thread_local typename 25 | virtual volatile 26 | ' 27 | entities='auto class concept enum namespace struct template union typedef using' 28 | types=' 29 | bool byte char char8_t char16_t char32_t double float int long 30 | max_align_t nullptr_t ptrdiff_t short signed size_t size_type unsigned void 31 | wchar_t uint32_t critical error warning progress note info debug xdebug 32 | ' 33 | values='NULL false nullptr this true CLUTCHLOG CLUTCHLOGD CLUTCHCODE CLUTCHFUNC' 34 | 35 | STL=' 36 | abort abs accumulate acos adjacent_difference adjacent_find adjacent_find_if any append 37 | asctime asin assign at atan atan2 atexit atof atoi atol auto_ptr back back_inserter bad bad_alloc 38 | bad_cast bad_exception bad_typeid badbit beg begin binary_compose binary_negate binary_search bind2nd 39 | binder1st binder2nd bitset bsearch c_str calloc capacity ceil cerr cin clear clearerr clock clog 40 | close compare compose1 compose2 const_iterator construct copy copy_backward copy_n cos cosh count 41 | count_if cout ctime data deque destroy difference_type difftime div divides domain_error empty end 42 | endl eof eofbit equal equal_range erase exception exit exp fabs fail failbit failure fclose feof 43 | ferror fflush fgetc fgetpos fgets fill fill_n find find_end find_first_not_of find_first_of find_if 44 | find_last_not_of find_last_of first flags flip floor flush fmod fopen for_each fprintf fputc fputs 45 | fread free freopen frexp front fscanf fseek fsetpos fstream ftell fwrite gcount generate generate_n 46 | get get_temporary_buffer getc getchar getenv getline gets gmtime good goodbit greater greater_equal 47 | hash_map hash_multimap hash_multiset hash_set ifstream ignore in includes inner_product inplace_merge 48 | insert inserter invalid_argument ios ios_base iostate iota is_heap is_open is_sorted isalnum isalpha 49 | iscntrl isdigit isgraph islower isprint ispunct isspace istream istream_iterator istringstream 50 | isupper isxdigit iter_swap iterator iterator_category key_comp ldiv length length_error less 51 | less_equal lexicographical_compare lexicographical_compare_3way list localtime log log10 logic_error 52 | logical_and logical_not logical_or longjmp lower_bound make_heap malloc map max max_element max_size 53 | mem_fun mem_fun1 mem_fun1_ref mem_fun_ref memchr memcpy memmove memset merge min min_element minus 54 | mismatch mktime modf modulus multimap multiplies multiset negate next_permutation npos nth_element 55 | numeric_limits ofstream open ostream ostream_iterator ostringstream out_of_range overflow_error 56 | pair make_pair partial_sort partial_sort_copy partial_sum partition peek perror plus pointer 57 | pointer_to_binary_function pointer_to_unary_function pop pop_back pop_front pop_heap pow power 58 | precision prev_permutation printf ptr_fun push push_back push_front push_heap put putback putc 59 | putchar puts qsort raise rand random_sample random_sample_n random_shuffle range_error rbegin 60 | rdbuf rdstate read realloc ref reference remove remove_copy remove_copy_if remove_if rename rend 61 | replace replace_copy replace_copy_if replace_if reserve reset resize return_temporary_buffer 62 | reverse reverse_copy reverse_iterator rewind rfind rotate rotate_copy runtime_error scanf search 63 | search_n second seekg seekp set set_difference set_intersection set_symmetric_difference set_union 64 | setbuf setf setjmp setlocale setvbuf shared_ptr signal sin sinh size sort sort_heap splice 65 | sprintf sqrt srand sscanf stable_partition stable_sort std str strcat strchr strcmp strcoll strcpy 66 | strcspn strerror strftime string strlen strncat strncmp strncpy strpbrk strrchr strspn strstr strtod 67 | strtok strtol strtoul strxfrm substr swap swap_ranges sync_with_stdio system tan tanh tellg tellp 68 | temporary_buffer test time time_t tmpfile tmpnam to_string to_ulong tolower top toupper transform 69 | unary_compose unary_negate underflow_error unget ungetc uninitialized_copy uninitialized_copy_n 70 | uninitialized_fill uninitialized_fill_n unique unique_ptr unique_copy unsetf upper_bound va_arg value_comp 71 | value_type vector vfprintf vprintf vsprintf width write round initializer_list function make_unique 72 | make_shared forward filesystem 73 | ' 74 | join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } 75 | 76 | # Add the language's grammar to the static completion list 77 | printf %s\\n "declare-option str-list cpp_static_words $(join "${flow} ${state} ${operators} ${attributes} ${entities} ${types} ${values} ${STL}" ' ')" 78 | 79 | # Highlight keywords 80 | printf %s " 81 | add-highlighter -override shared/cpp/code/flow regex \b($(join "${flow}" '|'))\b 0:flow 82 | add-highlighter -override shared/cpp/code/state regex \b($(join "${state}" '|'))\b 0:state 83 | add-highlighter -override shared/cpp/code/attributes regex \b($(join "${attributes}" '|'))\b 0:attribute 84 | add-highlighter -override shared/cpp/code/entities regex \b($(join "${entities}" '|'))\b 0:entity 85 | add-highlighter -override shared/cpp/code/types regex \b($(join "${types}" '|'))\b 0:type 86 | add-highlighter -override shared/cpp/code/values regex \b($(join "${values}" '|'))\b 0:value 87 | add-highlighter -override shared/cpp/code/STL regex \bstd::[\w:]*\b 0:builtin 88 | add-highlighter -override shared/cpp/code/operators1 regex \b($(join "${operators}" '|'))\b 0:operator 89 | add-highlighter -override shared/cpp/code/operators2 regex (\+|-|\*|&|=|\\|\?|%|\|-|!|\||->|\.|,|<|>|:|\^|/|~) 0:operator 90 | add-highlighter -override shared/cpp/code/delimiters regex (\(|\)|\[|\]|\{|\}|\;|') 0:delimiter 91 | " 92 | } 93 | ] 94 | -------------------------------------------------------------------------------- /kak/colors/kalolo.kak: -------------------------------------------------------------------------------- 1 | /home/nojhan/code/kalolo/kalolo.kak -------------------------------------------------------------------------------- /kak/kakrc: -------------------------------------------------------------------------------- 1 | ################################# 2 | # Convenience functions 3 | ################################# 4 | 5 | define-command filetype-hook -params 2 %{ 6 | hook global WinSetOption "filetype=(%arg{1})" "%arg(2)" 7 | } 8 | 9 | ################################# 10 | # Generic mappings 11 | ################################# 12 | 13 | # Comments 14 | map global normal '$' -docstring 'Comment the selected lines' ': comment-line' 15 | map global normal '' -docstring 'Comment the selected block with begin/end characters' ': comment-block' 16 | map global normal '#' -docstring 'duplicate and comment line' 'xyP: comment-linej' 17 | map global normal '–' -docstring 'comment selection with /*…*/' 'i/*a*/' 18 | 19 | map global normal '*' -docstring 'select all occurrences of the word under cursor' 'be*nvv' 20 | 21 | map global normal '=' -docstring 'indent like the line above' 'gijgi' 22 | 23 | map global normal '' -docstring 'move line down' 'xdkP' 24 | map global normal '' -docstring 'move line down' 'xdp' 25 | map global insert '' -docstring 'move line down' 'xdkPi' 26 | map global insert '' -docstring 'move line down' 'xdpi' 27 | 28 | map global insert '' -docstring 'one word right in insert mode' 'eli' 29 | map global insert '' -docstring 'one word left in insert mode' 'bi' 30 | map global insert '' -docstring 'kill line in insert mode' 'GIc' 31 | 32 | map global normal 'è' -docstring 'select the inner sequence enclosed by matching characters' 'mLH' 33 | 34 | alias global bd delete-buffer 35 | 36 | def -params 1 extend-line-up %{ 37 | exec "%arg{1}K" 38 | try %{ 39 | exec -draft ';\n' 40 | exec X 41 | } 42 | exec '' 43 | } 44 | map global normal Y -docstring 'Extend selection to the previous line' ':extend-line-up %val{count}' 45 | 46 | define-command cq -docstring 'Quit with an (arbitrary) error code' %{q! 666} 47 | 48 | # Use Tab and Shift-Tab to navigate completion in insert mode. 49 | hook global InsertCompletionShow .* %{ 50 | try %{ 51 | execute-keys -draft 'h\h' 52 | map window insert 53 | map window insert 54 | hook -once -always window InsertCompletionHide .* %{ 55 | map window insert 56 | map window insert 57 | } 58 | } 59 | } 60 | 61 | # Cursor switch. 62 | map global normal -docstring 'Swap selections cursor and anchor' '' 63 | map global normal -docstring 'Ensure selection cursor is after anchor' '' 64 | 65 | # Go to paragraph/indents. 66 | map global goto 'p' -docstring 'select to next paragraph' ']p' 67 | map global goto 'P' -docstring 'extend to next paragraph' '}p' 68 | map global goto 'o' -docstring 'select to prev paragraph' '[p' 69 | map global goto 'O' -docstring 'extend to prev paragraph' '{p' 70 | map global goto 't' -docstring 'select to indent end' ']i' 71 | map global goto 'T' -docstring 'select to indent beginning' '[i' 72 | 73 | # Paths. 74 | map global prompt -docstring 'Current buffer name' '%' 75 | map global prompt -docstring 'Current buffer directory' '%sh(dirname "$kak_bufname")/' 76 | 77 | ################################# 78 | # Generic config 79 | ################################# 80 | 81 | set-option -add global ui_options ncurses_assistant=none 82 | set-option -add global ui_options ncurses_set_title=yes 83 | set-option -add global ui_options ncurses_padding_fill=yes 84 | 85 | # Indent with 2 spaces and make tabs appear as 2 spaces. 86 | set-option global tabstop 4 87 | set-option global indentwidth 4 88 | 89 | # tabs to spaces 90 | hook global InsertChar \t %{ 91 | exec -draft h@ 92 | } 93 | 94 | # Keep space around cursor when scrolling. 95 | set-option global scrolloff 3,3 96 | 97 | # Add characters as matching pairs. 98 | set-option -add global matching_pairs ‹ › « » “ ” ‘ ’ 99 | 100 | hook global ModuleLoaded x11 %{ 101 | set global termcmd 'terminator -e ' 102 | alias global terminal x11-terminal 103 | } 104 | 105 | # Persistent history across sessions. 106 | hook global KakEnd .* %{ echo -to-file ~/.kak_history -quoting kakoune reg : %reg{:} } 107 | hook global KakBegin .* %{ try %{ source ~/.kak_history } } 108 | 109 | 110 | ################################# 111 | # Highlighting 112 | ################################# 113 | 114 | add-highlighter global/matching show-matching 115 | add-highlighter global/wrap wrap -word -indent -marker ⤷ 116 | add-highlighter global/suspicicous-whitespaces show-whitespaces -tab ⭲ -nbsp · -spc " " -lf " " 117 | #add-highlighter global/trailing-whitespaces regex '\h+$' 0:error 118 | 119 | define-command -hidden show-trailing-whitespaces %{ try %{ add-highlighter global/trailing-whitespaces regex '\h+$' 0:default,red } } 120 | define-command -hidden hide-trailing-whitespaces %{ try %{ remove-highlighter global/trailing-whitespaces } } 121 | hook global WinDisplay .* show-trailing-whitespaces 122 | hook global ModeChange 'insert:normal' show-trailing-whitespaces 123 | hook global ModeChange 'normal:insert' hide-trailing-whitespaces 124 | 125 | 126 | colorscheme kalolo 127 | 128 | # Highlight generic tags 129 | hook global WinSetOption comment_line=(.+) %{ 130 | add-highlighter -override window/here regex "\b(HERE)\b" 1:rgb:ffff00,rgb:ff0000+FB # WHERE 131 | add-highlighter -override window/fixme regex "\b(FIXME)\b" 1:rgb:ffff00,rgb:ff0000+Fb 132 | add-highlighter -override window/todo regex "\b(TODO)\b" 1:rgb:000000,rgb:ff00ff+Fb 133 | add-highlighter -override window/note regex "\b(NOTE)\b" 1:rgb:000000,rgb:a5c261+Fb 134 | } 135 | 136 | # Show line numbers (and highlight current cursor line) 137 | hook global WinCreate ^[^*]+$ %{ 138 | add-highlighter window/ number-lines -hlcursor -min-digits 3 139 | } 140 | 141 | 142 | ################################# 143 | # Language specifics 144 | ################################# 145 | 146 | filetype-hook makefile %{ 147 | set-option window indentwidth 0 148 | } 149 | 150 | filetype-hook latex %{ 151 | set-option buffer autowrap_column 160 152 | autowrap-enable 153 | addhl buffer/ column 160 white,black 154 | } 155 | 156 | filetype-hook markdown %{ 157 | # set-option buffer autowrap_column 80 158 | # autowrap-enable 159 | addhl buffer/ column 80 white,black 160 | } 161 | 162 | filetype-hook restructuredtext %{ 163 | # set-option buffer autowrap_column 80 164 | # autowrap-enable 165 | addhl buffer/ column 80 white,black 166 | } 167 | 168 | filetype-hook c|cpp %{ 169 | clang-enable-autocomplete 170 | clang-enable-diagnostics 171 | alias window lint clang-parse 172 | alias window lint-next-error clang-diagnostics-next 173 | set-option buffer formatcmd "clang-format -style='WebKit'" 174 | map global normal A ': c-family-alternative-file' 175 | } 176 | 177 | filetype-hook python %{ 178 | jedi-enable-autocomplete 179 | lint-enable 180 | set-option global lintcmd 'flake8' 181 | } 182 | 183 | 184 | ################################# 185 | # Plugins 186 | ################################# 187 | 188 | # Autoinstall plug.kak if necessary. 189 | evaluate-commands %sh{ 190 | plugins="$HOME/.config/kak/plugins" 191 | mkdir -p $plugins 192 | [ ! -e "$plugins/plug.kak" ] && \ 193 | git clone -q https://github.com/andreyorst/plug.kak "$plugins/plug.kak" 194 | printf "%s\n" "source '$plugins/plug.kak/rc/plug.kak'" 195 | } 196 | # Load the plugin manager. 197 | plug "andreyorst/plug.kak" noload 198 | 199 | # Buffers list. 200 | plug 'delapouite/kakoune-buffers' %{ 201 | hook global WinDisplay .* info-buffers 202 | map global normal à ': enter-buffers-mode' -docstring 'buffers' 203 | map global normal À ': enter-user-mode -lock buffers' -docstring 'buffers (lock)' 204 | } 205 | 206 | # Multi-select all identical characters in the column. 207 | plug 'occivink/kakoune-vertical-selection' %{ 208 | map global user -docstring "Select all identical characters in the column downward" ': vertical-selection-down' 209 | map global user -docstring "Select all identical characters in the column upward" ': vertical-selection-up' 210 | } 211 | 212 | # System clipboard integration. 213 | # FIXME bug: does not allow correct multi-cursors paste. 214 | #plug "lePerdu/kakboard" %{ 215 | # hook global WinCreate .* %{ kakboard-enable } 216 | #} 217 | # Keep the 1 register in sync with the system clipboard . 218 | # FIXME: does not work either. 219 | # hook global RegisterModified '1' %{ nop %sh{ 220 | # printf %s "$kak_main_reg_dquote" | xsel --input --clipboard 221 | # }} 222 | 223 | # Fuzzy search 224 | plug "andreyorst/fzf.kak" %{ 225 | map global normal ': fzf-mode' 226 | } 227 | 228 | plug "andreyorst/tagbar.kak" defer "tagbar" %{ 229 | set-option global tagbar_sort false 230 | set-option global tagbar_size 40 231 | set-option global tagbar_display_anon false 232 | set-option global tagbar_show_details false 233 | } config %{ 234 | # if you have wrap highlighter enamled in you configuration 235 | # files it's better to turn it off for tagbar, using this hook: 236 | hook global WinSetOption filetype=tagbar %{ 237 | remove-highlighter window/wrap 238 | # you can also disable rendering whitespaces here, line numbers, and 239 | # matching characters 240 | } 241 | # To see what filetypes are supported use `ctags --list-kinds | awk '/^\w+/' 242 | hook global WinSetOption filetype=(c|cpp|rust) %{ 243 | tagbar-enable 244 | } 245 | } 246 | 247 | #plug 'delapouite/kakoune-cd' %{ 248 | # # Suggested mapping 249 | # map global user c ': enter-user-mode cd' -docstring 'cd' 250 | # # Suggested aliases 251 | # alias global cdb change-directory-current-buffer 252 | # alias global cdr change-directory-project-root 253 | # alias global ecd edit-current-buffer-directory 254 | # alias global pwd print-working-directory 255 | #} 256 | # Automatically change working directory to be the buffer's one. 257 | #hook global WinDisplay .* %{ 258 | # # require delapouite/kakoune-cd 259 | # change-directory-current-buffer 260 | #} 261 | 262 | # Like alexherbo2/search-highlighter.kak, but which actually works. 263 | # face global Search white,yellow 264 | def search-highlight-enable %{ 265 | hook window -group search-highlight NormalKey [/?*nN]| %{ try %{ 266 | addhl window/search dynregex '%reg{/}' 0:Search 267 | }} 268 | hook window -group search-highlight NormalKey %{ rmhl window/search} 269 | } 270 | def search-highlight-disable %{ 271 | rmhl window/search 272 | rmhooks window search-highlight 273 | } 274 | # Always highlight search. 275 | hook global WinDisplay .* %{ 276 | search-highlight-enable 277 | } 278 | 279 | plug "kak-lsp/kak-lsp" do %{ 280 | cargo install --locked --force --path . 281 | } config %{ 282 | 283 | # uncomment to enable debugging 284 | # eval %sh{echo ${kak_opt_lsp_cmd} >> /tmp/kak-lsp.log} 285 | # set global lsp_cmd "kak-lsp -s %val{session} -vvv --log /tmp/kak-lsp.log" 286 | 287 | # ,l will display a specific menu for LSP 288 | map global user l %{: enter-user-mode lsp} -docstring "LSP mode" 289 | 290 | # lsp-enable 291 | set-option global lsp_server_configuration pyls.configurationSources=["flake8"] 292 | 293 | set global lsp_diagnostic_line_error_sign '║' 294 | set global lsp_diagnostic_line_warning_sign '┊' 295 | 296 | # define-command ne -docstring 'go to next error/warning from lsp' %{ lsp-find-error --include-warnings } 297 | # define-command pe -docstring 'go to previous error/warning from lsp' %{ lsp-find-error --previous --include-warnings } 298 | # define-command ee -docstring 'go to current error/warning from lsp' %{ lsp-find-error --include-warnings; lsp-find-error --previous --include-warnings } 299 | 300 | define-command lsp-restart -docstring 'restart lsp server' %{ lsp-stop; lsp-start } 301 | 302 | hook global WinSetOption filetype=(c|cpp|python) %{ 303 | # Show matching objects? 304 | set-option window lsp_auto_highlight_references false 305 | map global '' -docstring 'Highlight related references' ': lsp-highlight-references' 306 | 307 | # Hint window next to the cursor? 308 | set-option window lsp_hover_anchor false 309 | 310 | lsp-auto-hover-enable 311 | lsp-enable-window 312 | } 313 | 314 | hook global KakEnd .* lsp-exit 315 | } 316 | 317 | plug "dmerejkowsky/kak-spell" config %{ 318 | declare-user-mode kak-spell 319 | map global user s ': enter-user-mode -lock kak-spell' -docstring 'enter spell user mode' 320 | map global kak-spell a ': kak-spell-add' -docstring 'add the selection to the user dict' 321 | map global kak-spell d ': kak-spell-disable' -docstring 'clear spelling highlighters' 322 | map global kak-spell e ': kak-spell-enable en_US :kak-spell ' -docstring 'enable spell check in English' 323 | map global kak-spell f ': kak-spell-enable fr_FR :kak-spell ' -docstring 'run spell check in French' 324 | map global kak-spell l ': kak-spell-list ' -docstring 'list spelling errors in a buffer' 325 | map global kak-spell n ': kak-spell-next' -docstring 'go to next spell error' 326 | map global kak-spell p ': kak-spell-previous' -docstring 'go to next spell error' 327 | map global kak-spell r ': kak-spell-replace' -docstring 'suggest a list of replacements' 328 | map global kak-spell x ': kak-spell-remove' -docstring 'remove the selection from the user dict' 329 | } 330 | 331 | map global user g '/[=]{7}vv' -docstring 'Search for Git conflict markers' 332 | 333 | set-option -add global ui_options ncurses_padding_char=╱ # Examples: ▚ ╳ ╱ ┼ ╲ 334 | 335 | # add-highlighter global/ scrollbar 336 | # add-highlighter global/scrollbar/ scrollbar-indicator red,default lsp_error_lines 337 | # add-highlighter global/scrollbar/ scrollbar-indicator yellow,default lint_flags 338 | # # add-highlighter global/scrollbar/ scrollbar-indicator red,default git_diff_flags 339 | # # git show-diff 340 | 341 | 342 | # Force `liquidprompt` to be a shell filetype. 343 | hook global BufCreate (.*/)?liquidprompt %{ 344 | set buffer filetype sh 345 | } 346 | 347 | # Force liquidprompt's *.theme files to be a shell filetype. 348 | hook global BufCreate .*\.theme %{ 349 | set buffer filetype sh 350 | } 351 | hook global BufCreate .*\.conf %{ 352 | set buffer filetype sh 353 | } 354 | 355 | -------------------------------------------------------------------------------- /kak_ide_open.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Forget the Oth argument (name of the script). 4 | if [[ $# > 0 ]] ; then 5 | files="$@" 6 | else 7 | files="" 8 | while read line 9 | do 10 | files="$files $line" 11 | done < /dev/stdin 12 | fi 13 | 14 | if kak -l | grep -q "ide" ; then 15 | # Open files in the `main` window of the `ide` session of kakoune. 16 | for file in "${files}"; do 17 | echo "evaluate-commands -client main edit ${file}" | kak -p ide 18 | done 19 | else 20 | terminator -p kakoune -e kak -s ide ${files} 21 | fi 22 | 23 | -------------------------------------------------------------------------------- /kak_ide_open_at_line.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file="$1" 4 | line="$2" 5 | 6 | if kak -l | grep -q "ide" ; then 7 | # Open files in the `main` window of the `ide` session of kakoune. 8 | echo "evaluate-commands -client main edit ${file} ${line}" | kak -p ide 9 | else 10 | terminator -p kakoune -e kak -s ide +${line} ${file} 11 | fi 12 | -------------------------------------------------------------------------------- /kak_ide_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | kak -clear 4 | 5 | if kak -l | grep -q "ide" ; then 6 | kak -c ide 7 | else 8 | kak -s ide -e "rename-client main" 9 | fi 10 | 11 | -------------------------------------------------------------------------------- /lessfilter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Use Pygments to get syntax colorization in less 4 | # export LESS=" -R" 5 | # export LESSOPEN='|~/code/dotfiles/lessfilter %s' 6 | 7 | case "$1" in 8 | *.awk|*.groff|*.java|*.js|*.m4|*.php|*.pl|*.pm|*.pod|*.sh|\ 9 | *.ad[asb]|*.asm|*.inc|*.[ch]|*.[ch]pp|*.[ch]xx|*.cc|*.hh|\ 10 | *.lsp|*.l|*.pas|*.p|*.xml|*.xps|*.xsl|*.axp|*.ppd|*.pov|\ 11 | *.diff|*.patch|*.py|*.rb|*.sql|*.ebuild|*.eclass) 12 | pygmentize -f 256 "$1";; 13 | .bashrc|.bash_aliases|.bash_environment) 14 | pygmentize -f 256 -l sh "$1" 15 | ;; 16 | *) 17 | grep "#\!/bin/bash" "$1" > /dev/null 18 | if [[ "$?" -eq "0" ]]; then 19 | pygmentize -f 256 -l sh "$1" 20 | else 21 | exit 1 22 | fi 23 | esac 24 | 25 | exit 0 26 | 27 | -------------------------------------------------------------------------------- /mtime.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | max=$1 4 | while read -r line; do 5 | echo -ne $( (/usr/bin/time -f "%U+%S" ./repeat.sh $max $line ) 2>&1 | bc ) 6 | echo -e "\t$line" 7 | done 8 | 9 | -------------------------------------------------------------------------------- /repeat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | max=$1; shift; 3 | for ((i=1; i <= max ; i++)); do # --> C-like syntax 4 | eval "$@" &>/dev/null; 5 | done 6 | -------------------------------------------------------------------------------- /rsnapshot_anacron/daily/rsnapshot_daily: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /rsnapshot_common 4 | 5 | # 86400 seconds in a day, retry every 10 minutes for half a day 6 | backup "40000" "daily" 7 | 8 | -------------------------------------------------------------------------------- /rsnapshot_anacron/hourly/rsnapshot_hourly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /rsnapshot_common 4 | 5 | # 3600 seconds in an hour, retry every 10 minutes for half an hour 6 | backup "1800" "hourly" 7 | -------------------------------------------------------------------------------- /rsnapshot_anacron/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Immediately exit if any command has a non-zero exit. 4 | # A reference to any variable you haven't previously defined - with the exceptions of $* and $@ - is an error. 5 | # If any command in a pipeline fails, that return code will be used as the return code of the whole pipeline. 6 | set -euo pipefail 7 | 8 | user="$USER" 9 | 10 | mkdir -p $HOME/scripts 11 | cp -r ../rsnapshot_anacron $HOME/scripts/ 12 | cd $HOME/scripts/rsnapshot_anacron/ 13 | 14 | base="$(pwd)" 15 | 16 | # Check installed packages 17 | installed="$(dpkg -l rsnapshot)|grep '^ii\srsnapshot\s'" 18 | if [[ "$installed" == "" ]]; then 19 | echo "rsnapshot is not installed" 20 | echo "You should install it and edit /etc/rsnapshot.conf:" 21 | echo "sudo apt install rsnapshot anacron && sudo gvim /etc/rsnapshot.conf" 22 | exit 100 23 | fi 24 | sudo apt install anacron 25 | 26 | 27 | snapshot=$(grep "^snapshot_root.*$" /etc/rsnapshot.conf|cut -f 2) 28 | 29 | if [[ $? != 0 || "$snapshot" == "" ]] ; then 30 | echo "No snapshot_root in /etc/rsnapshot.conf" 31 | exit 101 32 | fi 33 | 34 | tag="=^=rsnapshot_anacron=^=" 35 | if [[ $(grep "$tag" /etc/anacrontab) == "" ]]; then 36 | echo " 37 | ########################################################## 38 | # $tag 39 | # périodicité (jours), 40 | # | délai (minutes), 41 | # | | nom de la tache, 42 | # | | | commandes 43 | ########################################################## 44 | @daily 10 backup.daily sudo -u $user run-parts $base/daily/ 45 | @weekly 10 backup.weekly sudo -u $user run-parts $base/weekly/ 46 | @monthly 10 backup.monthly sudo -u $user run-parts $base/monthly/ 47 | " | sudo tee -a /etc/anacrontab 48 | fi 49 | 50 | # Test if snapshot dir is set 51 | source $base/rsnapshot_common 52 | if [[ "$SNAPSHOT_ROOT" == "" ]] ; then 53 | sed -i "s,,${snapshot},g" rsnapshot_common 54 | else 55 | if [[ "$SNAPSHOT_ROOT" != "$snapshot" ]] ; then 56 | echo "snapshot_root in /etc/rsnapshot.conf is different than SNAPSHOT_ROOT in rsnapshot_common" 57 | exit 102 58 | fi 59 | fi 60 | 61 | # Configure absolute path in scripts 62 | sed -i "s,,$base,g" $base/hourly/rsnapshot_hourly 63 | sed -i "s,,$base,g" $base/daily/rsnapshot_daily 64 | sed -i "s,,$base,g" $base/weekly/rsnapshot_weekly 65 | sed -i "s,,$base,g" $base/monthly/rsnapshot_monthly 66 | 67 | echo "DONE" 68 | -------------------------------------------------------------------------------- /rsnapshot_anacron/monthly/rsnapshot_monthly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /rsnapshot_common 4 | 5 | # 2592000 seconds in a month, retry every 10 minutes for 8 days 6 | backup "691200" "monthly" 7 | 8 | -------------------------------------------------------------------------------- /rsnapshot_anacron/rsnapshot_common: -------------------------------------------------------------------------------- 1 | # Immediately exit if any command has a non-zero exit. 2 | # A reference to any variable you haven't previously defined - with the exceptions of $* and $@ - is an error. 3 | # If any command in a pipeline fails, that return code will be used as the return code of the whole pipeline. 4 | set -euo pipefail 5 | 6 | # There are already cron scripts installed to automatically run rsnapshot in 7 | # the background on a regular hourly/daily/weekly/monthly schedule. If this 8 | # is on a machine that is shutdown or goes to sleep often, then install 9 | # anacron. 10 | # 11 | ENABLE_CRON=no 12 | 13 | # Also run the hourly job in addition to the daily, weekly, and monthly 14 | #ENABLE_HOURLY=yes 15 | 16 | # Specify the disk where the backups are written to, this is the same place as 17 | # is specified in /etc/rsnapshot.conf as 'snapshot_root'. This is used to 18 | # detect if the disk is mounted or not when rsnapshot runs in a cron job. 19 | # 20 | SNAPSHOT_ROOT="" 21 | 22 | RSNAPSHOT="/usr/bin/rsnapshot" 23 | 24 | function backup() 25 | { 26 | wait="$1" # in seconds 27 | freq="$2" # hourly, daily, weekly or monthly 28 | 29 | #retry every 10 minutes 30 | every=600 31 | 32 | if [[ "$ENABLE_CRON" == "yes" ]] ; then 33 | exit 1000 34 | fi 35 | 36 | until=$(( $(date +%s) + $wait)) 37 | while [[ $(date +%s) < $until ]] ; do 38 | test -d "$SNAPSHOT_ROOT" && break 39 | sleep $every 40 | done 41 | 42 | # See ionice(1) 43 | if [ -x /usr/bin/ionice ] && 44 | /usr/bin/ionice -c3 true 2>/dev/null; then 45 | IONICE="/usr/bin/ionice -c3" 46 | fi 47 | 48 | test -d "$SNAPSHOT_ROOT" && \ 49 | nice -n 20 $IONICE $RSNAPSHOT $freq 50 | } 51 | -------------------------------------------------------------------------------- /rsnapshot_anacron/weekly/rsnapshot_weekly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /rsnapshot_common 4 | 5 | # 604800 seconds in a week, retry every 10 minutes for 4 days 6 | backup "345600" "weekly" 7 | 8 | -------------------------------------------------------------------------------- /xmonad.hs: -------------------------------------------------------------------------------- 1 | import XMonad 2 | import XMonad.Config.Gnome 3 | import XMonad.Config.Desktop 4 | import XMonad.Hooks.ManageHelpers (isFullscreen,doFullFloat,doCenterFloat,doRectFloat) 5 | import XMonad.Layout.Tabbed 6 | import XMonad.Util.EZConfig 7 | import XMonad.Actions.CycleWS 8 | import XMonad.Layout.ResizableTile 9 | import XMonad.Actions.WindowGo 10 | import XMonad.Util.Scratchpad (scratchpadSpawnAction, scratchpadSpawnActionTerminal, scratchpadManageHook, scratchpadFilterOutWorkspace) 11 | import XMonad.Layout.WindowNavigation 12 | import XMonad.Actions.FloatSnap 13 | import XMonad.Actions.PhysicalScreens 14 | import XMonad.Layout.BorderResize 15 | import XMonad.Layout.TwoPane 16 | import XMonad.Layout.Combo 17 | import XMonad.Layout.Grid 18 | import XMonad.Layout.IM 19 | import XMonad.Layout.ThreeColumns 20 | import Data.Ratio ((%)) 21 | import XMonad.Layout.PerWorkspace 22 | import XMonad.Layout.Maximize 23 | 24 | import qualified XMonad.Actions.FlexibleManipulate as Flex 25 | import qualified XMonad.StackSet as W 26 | import qualified Data.Map as M 27 | 28 | modm = mod1Mask 29 | 30 | myTerminal :: String 31 | -- myTerminal = "$XTERMCMD" 32 | myTerminal = "urxvt" 33 | myScratchPad = scratchpadSpawnActionTerminal myTerminal 34 | 35 | myDefaultLayoutHook = windowNavigation $ desktopLayoutModifiers $ maximize $ 36 | -- fullscreen with tabs 37 | simpleTabbedAlways 38 | -- Two panes, each one with its own tabs 39 | -- ||| combineTwo (TwoPane 0.03 0.5) simpleTabbed simpleTabbed 40 | -- 2/3 of the screen for a master window, other ones on the right 41 | ||| ResizableTall 1 (3/100) (2/3) [] 42 | ||| GridRatio (4/3) 43 | ||| ThreeCol 1 (3/100) (1/3) 44 | 45 | -- buddy lists on a small vertical pane at right, 46 | -- master windows on top of the remaining space, other ones below 47 | myIMLayoutHook = windowNavigation $ desktopLayoutModifiers $ 48 | withIM (10/100) -- keep a small column on the right… 49 | (Or (Or (Role "buddy_list") (Role "contact_list")) (ClassName "gimp-toolbox")) -- … for buddy lists 50 | (Mirror(ResizableTall 1 (3/100) (41/60) [0.75,1.25,1])) -- a large master on top, getting ~ two-third of the screen, the first slave on left being a bit larger than the others 51 | 52 | myLayoutHook = onWorkspace "1" myIMLayoutHook $ myDefaultLayoutHook 53 | 54 | main = xmonad $ gnomeConfig 55 | { 56 | terminal = myTerminal 57 | , XMonad.modMask = modm 58 | , focusedBorderColor = "#ffbb00" 59 | , borderWidth = 3 60 | -- Switch workspaces with default first azerty row instead of plain numbers 61 | , keys = \c -> bepoKeys c `M.union` keys gnomeConfig c 62 | , manageHook = manageHook gnomeConfig <+> manageScratchPad <+> composeAll 63 | [ 64 | className =? "Thunderbird" --> doShift "1", 65 | className =? "Xchat" --> doShift "1", 66 | className =? "Pidgin" --> doShift "1", 67 | className =? "XClock" --> doShift "1", 68 | className =? "Gimp" --> doFloat, 69 | appName =? "filechooserdialog" --> doRectFloat(W.RationalRect 0.25 0.25 0.5 0.5), --x y w h 70 | appName =? "thunderbird" --> doRectFloat(W.RationalRect 0.25 0.25 0.5 0.5), --x y w h 71 | appName =? "soffice" --> doRectFloat(W.RationalRect 0.25 0.25 0.5 0.5), --x y w h 72 | appName =? "inkscape" --> doRectFloat(W.RationalRect 0.1 0.1 0.8 0.8) --x y w h 73 | ] 74 | 75 | -- add a fullscreen tabbed layout that does not avoid covering 76 | -- up desktop panels before the desktop layouts 77 | -- desktopLayoutModifiers still allow toggling panel visibility 78 | , layoutHook = myLayoutHook 79 | } 80 | -- Simple notation ala emacs 81 | `removeKeysP` 82 | [ 83 | ("M-") 84 | , ("M-S-") 85 | ] 86 | `additionalKeysP` 87 | [ 88 | -- Quit session 89 | ("M-S-q", spawn "gnome-session-quit") 90 | -- Lock Screen 91 | , ("M-l", spawn "gnome-screensaver-command -l") 92 | -- Close focused window 93 | , ("M-c", kill ) 94 | , ("M-b d", kill ) 95 | , ("M-x", kill ) 96 | -- Got to workspaces 97 | , ("M-b p", prevWS ) 98 | , ("M-b n", nextWS ) 99 | , ("C-M-", prevWS ) 100 | , ("C-M-", nextWS ) 101 | -- Move windows among workspaces 102 | , ("M-u ", shiftToPrev ) 103 | , ("M-u ", shiftToNext ) 104 | -- Shrink the master area 105 | , ("M-S-r", sendMessage Shrink) 106 | -- Expand the master area 107 | , ("M-r", sendMessage Expand) 108 | -- Increment the number of windows in the master area 109 | , ("M-s", sendMessage (IncMasterN 1)) 110 | -- Deincrement the number of windows in the master area 111 | , ("M-S-s", sendMessage (IncMasterN (-1))) 112 | -- Cycle through the available layout algorithms 113 | , ("M-", sendMessage NextLayout) 114 | 115 | -- Move focus with arrows 116 | , ("M-", sendMessage $ Go R) 117 | , ("M-", sendMessage $ Go L) 118 | , ("M-", sendMessage $ Go U) 119 | , ("M-", sendMessage $ Go D) 120 | 121 | -- Swap windows with arrows 122 | , ("M-S-", sendMessage $ Swap R) 123 | , ("M-S-", sendMessage $ Swap L) 124 | , ("M-S-", sendMessage $ Swap U) 125 | , ("M-S-", sendMessage $ Swap D) 126 | 127 | -- Swap windows within tabbed two panes 128 | , ("M-S-", sendMessage $ Move L) 129 | , ("M-S-", sendMessage $ Move R) 130 | , ("M-S-", sendMessage $ Move U) 131 | , ("M-S-", sendMessage $ Move D) 132 | 133 | -- Swap the focused window and the master window 134 | , ("M-S-", windows W.swapMaster) 135 | 136 | -- Put the focused window (nearly) full screen 137 | , ("M-", withFocused (sendMessage . maximizeRestore)) 138 | 139 | -- Move focus to the master window 140 | , ("M-m", windows W.focusMaster ) 141 | -- Scratchpad 142 | , ("M-", myScratchPad ) 143 | , ("M-", myScratchPad ) 144 | 145 | -- Move focus to the next physical xinerama screen 146 | , ("M-$", onPrevNeighbour W.view) 147 | 148 | , ("", runOrRaise "firefox" (className =? "Firefox" <||> className =? "Firefox-bin")) 149 | , ("", spawn "thunderbird -remote \"xfeDoCommand(composeMessage)\"") 150 | ] 151 | -- Extended notation, for F keys (?) 152 | `additionalKeys` 153 | [ 154 | ((modm, xK_F1), spawn "gnome-terminal") 155 | , ((modm, xK_F2), spawn "gmrun") 156 | -- Launch firefox or raise its window if already running 157 | , ((modm, xK_F4), runOrRaise "firefox" (className =? "Firefox" <||> className =? "Firefox-bin")) 158 | -- Launch firefox or raise its window if already running 159 | , ((modm, xK_F5), spawn "nautilus --no-desktop") 160 | ] 161 | `additionalMouseBindings` 162 | [ 163 | -- Move window with M-mouse1 164 | ((modm, 1), (\w -> focus w >> windows W.shiftMaster >> Flex.mouseWindow Flex.position w >> snapMagicMove (Just 50) (Just 50) w)) 165 | -- Resize windows with M-mouse3 166 | , ((modm, 3), (\w -> focus w >> windows W.shiftMaster >> Flex.mouseWindow Flex.resize w >> snapMagicMouseResize 100 (Just 50) (Just 50) w)) 167 | ] 168 | 169 | 170 | -- Workspace switching using first row keycodes 171 | -- for keyboards that do not use numbers here 172 | 173 | -- bépo with «/» switched with 174 | numBepoNoj = [0x22,0x3c,0x3e,0x28,0x29,0x40,0x2b,0x2d,0x2f,0x2a] 175 | -- normal bépo 176 | numBepo = [0x22,0xab,0xbb,0x28,0x29,0x40,0x2b,0x2d,0x2f,0x2a] 177 | -- azerty 178 | numAzerty = [0x26,0xe9,0x22,0x27,0x28,0x2d,0xe8,0x5f,0xe7,0xe0] 179 | 180 | bepoConfig = gnomeConfig { keys = bepoKeys <+> keys gnomeConfig } 181 | bepoKeys conf@(XConfig {modMask = modm}) = M.fromList $ 182 | [((m .|. modm, k), windows $ f i) 183 | | (i, k) <- zip (workspaces conf) numBepoNoj, 184 | (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] 185 | 186 | manageScratchPad :: ManageHook 187 | manageScratchPad = scratchpadManageHook (W.RationalRect l t w h) 188 | where 189 | h = 0.5 -- terminal height, 10% 190 | w = 0.5 -- terminal width, 100% 191 | t = 0.25 -- distance from top edge, 90% 192 | l = 0.25 -- distance from left edge, 0% 193 | --------------------------------------------------------------------------------