├── .gitignore ├── Makefile ├── ag ├── deploy.zsh └── ignore ├── bash ├── bash_profile.bash ├── bashrc.bash └── deploy.zsh ├── boot ├── .gitignore ├── boot.zsh ├── emacs-deps.zsh ├── functions.zsh ├── guard.zsh ├── logboot.zsh ├── options.zsh ├── other-deps.zsh ├── readme.org ├── symlinks.zsh ├── vim-deps.zsh └── zsh-deps.zsh ├── config ├── deploy.zsh └── nvim ├── emacs ├── .gitignore ├── boot.org ├── deploy.zsh ├── emacs-customizations.el ├── eshell │ ├── .gitignore │ └── alias ├── init.el ├── readme.org └── snippets │ ├── emacs-lisp-mode │ └── .yas-parents │ ├── html-mode │ └── html5 │ ├── js-mode │ └── log │ ├── js2-mode │ └── .yas-parents │ ├── js3-mode │ └── .yas-parents │ ├── lisp-interaction-mode │ └── .yas-parents │ ├── lisp-mode │ ├── con.snippet │ ├── def.snippet │ ├── let.snippet │ ├── use-package.snippet │ └── zc.snippet │ ├── org-mode │ ├── el.snippet │ └── header.snippet │ ├── perl-mode │ └── perlbang.snippet │ ├── python-mode │ └── shebang.snippet │ ├── sh-mode │ ├── bang │ └── if │ ├── typescript-mode │ └── .yas-parents │ └── web-mode │ └── .yas-parents ├── git ├── deploy.zsh └── gitconfig ├── idea ├── actionlist.txt ├── deploy.zsh └── ideavimrc.vim ├── install.zsh ├── license.md ├── nvim ├── init.lua ├── lazy-lock.json └── lua │ ├── custom │ └── plugins │ │ └── init.lua │ ├── keys │ └── keybindings.lua │ └── kickstart │ ├── health.lua │ └── plugins │ ├── autopairs.lua │ ├── debug.lua │ ├── gitsigns.lua │ ├── indent_line.lua │ ├── lint.lua │ └── neo-tree.lua ├── options ├── .gitignore ├── arch │ ├── alias.zsh │ ├── arch.zsh │ ├── bspwm │ │ ├── bspwmrc │ │ └── makelink.zsh │ ├── chrome │ │ ├── chrome-flags.conf │ │ └── makelink.zsh │ ├── compton │ │ ├── compton.conf │ │ ├── makelink.zsh │ │ ├── other_shadow_compton.conf │ │ └── sumpwm_compton_conf.conf │ ├── environment.zsh │ ├── favorites.zsh │ ├── intellij │ │ ├── dont_makelink.zsh │ │ └── idea.sh │ ├── last_hook.zsh │ ├── polybar │ │ ├── gruvbox.conf │ │ ├── launch.sh │ │ ├── makelink.zsh │ │ └── scripts │ │ │ ├── spotify.sh │ │ │ └── thinkpad_battery_udev │ │ │ ├── 95-battery.rules │ │ │ ├── battery-combined-udev.sh │ │ │ └── readme.md │ ├── prompt.zsh │ ├── ranger │ │ ├── commands.py │ │ ├── makelink.zsh │ │ └── rc.conf │ ├── readme.org │ ├── redshift │ │ └── redshift.conf │ ├── refind │ │ ├── refind.conf │ │ └── refind_linux.conf │ ├── scripts │ │ ├── julicloud.sh │ │ ├── passmenu.sh │ │ ├── s8 │ │ │ ├── mount-galaxy.sh │ │ │ └── umount-galaxy.sh │ │ ├── terminal │ │ │ └── bssh.sh │ │ ├── thinkpad │ │ │ └── battery.sh │ │ └── vconsole │ │ │ └── fixfonts.sh │ ├── setup.zsh │ ├── sxhkd │ │ ├── makelink.zsh │ │ └── sxhkdrc │ ├── symlinks.zsh │ ├── systemd │ │ ├── lock_if_unlocked.sh │ │ └── suspend@ninrod.service │ ├── termite │ │ ├── config │ │ ├── makelink.zsh │ │ └── noctuid.config │ ├── vconsole │ │ ├── rebinds.map │ │ └── vconsole.conf │ ├── xchainkeys │ │ ├── makelink.zsh │ │ └── xchainkeys.conf │ ├── xfce4-terminal │ │ ├── accels.scm │ │ ├── colorschemes │ │ │ └── gruvbox-dark.theme │ │ ├── makelink.zsh │ │ └── terminalrc │ ├── xorg │ │ ├── 30-touchpad.conf │ │ ├── Xmodmap.xorg │ │ ├── Xresources.xorg │ │ ├── makelink.zsh │ │ ├── readme.org │ │ └── xinitrc.xorg │ └── yay │ │ ├── config.json │ │ ├── makelink.zsh │ │ └── yay_vcs.json ├── deploy.zsh ├── fedora │ ├── alias.zsh │ ├── environment.zsh │ ├── favorites.zsh │ ├── fedora.zsh │ ├── last_hook.zsh │ ├── prompt.zsh │ ├── setup.zsh │ ├── symlinks.zsh │ └── xfce4-terminal │ │ ├── accels.scm │ │ ├── colorschemes │ │ └── gruvbox-dark.theme │ │ ├── makelink.zsh │ │ └── terminalrc ├── osx │ ├── environment.zsh │ ├── favorites.zsh │ ├── last_hook.zsh │ ├── osx.zsh │ └── prompt.zsh ├── readme.org ├── shell-options.zsh ├── suse │ ├── alias.zsh │ ├── environment.zsh │ ├── favorites.zsh │ ├── last_hook.zsh │ ├── prompt.zsh │ ├── setup.zsh │ ├── suse.zsh │ ├── symlinks.zsh │ ├── xfce4-terminal │ │ ├── accels.scm │ │ ├── colorschemes │ │ │ └── gruvbox-dark.theme │ │ ├── makelink.zsh │ │ └── terminalrc │ └── xorg │ │ ├── Xmodmap.xorg │ │ ├── makelink.zsh │ │ └── readme.org ├── ubuntu │ ├── alias.zsh │ ├── chrome │ │ ├── chrome-flags.conf │ │ └── makelink.zsh │ ├── environment.zsh │ ├── favorites.zsh │ ├── last_hook.zsh │ ├── prompt.zsh │ ├── ranger │ │ ├── .gitignore │ │ ├── commands.py │ │ ├── makelink.zsh │ │ └── rc.conf │ ├── readme.org │ ├── scripts │ │ ├── julicloud.sh │ │ ├── passmenu.sh │ │ └── terminal │ │ │ └── bssh.sh │ ├── setup.zsh │ ├── sources │ │ └── sources.list │ ├── symlinks.zsh │ ├── systemd │ │ ├── lock_if_unlocked.sh │ │ └── suspend@ninrod.service │ ├── ubuntu.zsh │ ├── xfce4-terminal │ │ ├── accels.scm │ │ ├── colorschemes │ │ │ └── gruvbox-dark.theme │ │ ├── makelink.zsh │ │ └── terminalrc │ ├── xmodmap.zsh │ └── xorg │ │ └── xmodmap.xorg ├── user_last_hook.zsh └── wsl │ ├── alias.zsh │ ├── environment.zsh │ ├── favorites.zsh │ ├── last_hook.zsh │ ├── prompt.zsh │ ├── readme.org │ ├── scripts │ └── bssh.sh │ ├── setup.zsh │ ├── symlinks.zsh │ └── wsl.zsh ├── readme.org ├── scripts ├── brew-installs │ └── brew-apps.sh ├── emacs │ ├── background-connect-emacs-daemon.sh │ ├── background-emacs.sh │ ├── build-emacs.sh │ ├── connect-emacs-daemon.sh │ ├── is-emacs-daemon-up.sh │ ├── kill-emacs-server.sh │ ├── log │ │ └── .gitignore │ ├── restart-emacs-daemon.sh │ └── up-emacs-daemon.sh ├── git │ └── fetchall.sh ├── misc │ └── linecount.sh ├── terminal │ ├── bssh.sh │ └── truecolor.sh ├── tmux │ └── tmux-attach.sh ├── vim │ └── build-vim.zsh └── zsh │ ├── build-zsh.zsh │ └── fssh.zsh ├── tmux ├── deploy.zsh ├── keybinds.tmux ├── main.tmux ├── options.tmux ├── osx-hacks.tmux ├── theme.tmux ├── tmuxline │ ├── dracula.tmux │ ├── gruvbox.tmux │ ├── jellybeans.tmux │ ├── powerline.tmux │ ├── simpledark.tmux │ └── tomorrow-night-eighties.tmux └── truecolor-hacks.tmux ├── vim ├── .gitignore ├── autocommands.vim ├── cursorshape.vim ├── deploy.zsh ├── font.vim ├── hacks.vim ├── keybinds.vim ├── options.vim ├── plugins.vim ├── readme.org └── vimrc ├── vscode └── settings.json └── zsh ├── .gitignore ├── alias-docker.zsh ├── alias-emacs.zsh ├── alias-git.zsh ├── alias-rust.zsh ├── alias-vim.zsh ├── alias.zsh ├── call_user_last_hook.zsh ├── completions.zsh ├── constants.zsh ├── deploy.zsh ├── dir_tracker.zsh ├── envbootstrap.zsh ├── expand-alias.zsh ├── fixescapecodes.zsh ├── functions.zsh ├── fzf.zsh ├── main.zsh ├── nin-vi-mode.zsh ├── ninplug.zsh ├── options.zsh ├── pj.zsh ├── prompt.zsh ├── readme.org ├── termcolors.zsh ├── zleconfig.zsh └── zshenv.zsh /.gitignore: -------------------------------------------------------------------------------- 1 | deps/ 2 | games/ 3 | .#recentf 4 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | ./install.zsh 3 | 4 | update: 5 | ./install.zsh update 6 | 7 | -------------------------------------------------------------------------------- /ag/deploy.zsh: -------------------------------------------------------------------------------- 1 | verifylink ~/.ignore 2 | updatelinks ~/.ignore ag/ignore 3 | -------------------------------------------------------------------------------- /ag/ignore: -------------------------------------------------------------------------------- 1 | bower_components/ 2 | node_modules/ 3 | .git/ 4 | .local/ 5 | .npm/ 6 | .cache/ 7 | .rustup/ 8 | .backup/ 9 | .cargo/ 10 | .dropbox/ 11 | .vscode/ 12 | .dropbox-dist/ 13 | .node-gyp/ 14 | .java/ 15 | .config/ 16 | .IdeaIC2017.2/ 17 | .nvm/ 18 | .gimp-2.8/ 19 | .ssh/ 20 | .mozilla/ 21 | .gnome/ 22 | .vue-templates/ 23 | -------------------------------------------------------------------------------- /bash/bash_profile.bash: -------------------------------------------------------------------------------- 1 | # If .bash_profile exists, bash doesn't read .profile 2 | if [[ -f ~/.profile ]]; then 3 | . ~/.profile 4 | fi 5 | 6 | # If the shell is interactive and .bashrc exists, get the aliases and functions 7 | if [[ $- == *i* && -f ~/.bashrc ]]; then 8 | . ~/.bashrc 9 | fi 10 | . "$HOME/.cargo/env" 11 | -------------------------------------------------------------------------------- /bash/bashrc.bash: -------------------------------------------------------------------------------- 1 | # bash options {{{ 2 | 3 | set -o vi 4 | shopt -s autocd 5 | 6 | # dot not print meta chars, e.g. `ˆC` when is pressed to escape a command 7 | stty -echoctl 8 | 9 | # }}} 10 | # path {{{ 11 | 12 | PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" 13 | export PATH 14 | 15 | # }}} 16 | # plugins {{{ 17 | 18 | # colors for GNU ls (from coreutils) 19 | eval `dircolors ~/.lscolors` 20 | 21 | # }}} 22 | # terminal colors {{{ 23 | 24 | TC='\e[' 25 | Rst="${TC}0m" 26 | Black="${TC}30m"; 27 | Red="${TC}31m"; 28 | Green="${TC}32m"; 29 | Yellow="${TC}33m"; 30 | Blue="${TC}34m"; 31 | Purple="${TC}35m"; 32 | Cyan="${TC}36m"; 33 | White="${TC}37m"; 34 | 35 | # }}} 36 | # alias | binds {{{ 37 | 38 | alias ag='ag --hidden --path-to-agignore=~/.agignore' 39 | alias b='cd ..' 40 | alias c='clear' 41 | alias q='exit' 42 | 43 | alias l='ls -lh' 44 | alias la='l -A' 45 | alias ls='ls --color=auto --group-directories-first -X' 46 | 47 | alias dot='la `find ~ -maxdepth 1 -type l`' 48 | 49 | alias tarc='tar -zcvf file.tar.gz' 50 | alias tarx='tar -zxvf' 51 | 52 | alias v='vim' 53 | alias vi='vim -u NONE' 54 | alias vv='v ~/.vimrc' 55 | alias vz='v ~/.bashrc' 56 | 57 | alias w='echo -e "$Blue $PWD ${Red}at ${Cyan}$(whoami)${Red}@${Yellow}$(hostname -s)$Red in $Yellow${0}$Purple \$"' 58 | 59 | # git {{{ 60 | 61 | # check 62 | alias g='git status -sb' 63 | alias gi='builtin cd $(git rev-parse --show-toplevel)' 64 | # add 65 | alias gd='git diff' 66 | alias gds='git diff --staged' 67 | alias gal='git add -A' 68 | alias ga='git add' 69 | alias gc='git commit -m' 70 | # sync 71 | alias gf='git fetch' 72 | alias gp='git push' 73 | alias gm='git merge' 74 | alias gr='git rebase' 75 | # branch 76 | alias gg='git branch -vv' 77 | alias gb='git branch' 78 | alias gco='git checkout' 79 | # log 80 | alias git_log_custom='git log --pretty=format:"%C(yellow)%h%Creset %C(cyan)%>(14)%ad%Creset %C(magenta)%<(7)%an%Creset %C(blue)%d%Creset %C(white)%s%Creset" --abbrev=7 ' 81 | alias gld='git_log_custom --graph --date=format:"%Y-%m-%d %H:%M:%S"' 82 | alias gl='gld --date=relative' 83 | alias git_log_nocolor_custom='git log --no-color --pretty=format:"%h %d %ad %an %s" ' 84 | alias gldnc='git_log_nocolor_custom --graph' 85 | alias glnc='gldnc --date=relative' 86 | # ls-files 87 | alias glsu='git ls-files --others --exclude-standard' 88 | alias glsi='git ls-files -oiX .gitignore' 89 | 90 | # }}} 91 | 92 | # }}} 93 | # custom functions {{{ 94 | 95 | mdr () { 96 | mkdir -p $1 97 | cd $1 98 | } 99 | 100 | # }}} 101 | # prompt {{{ 102 | 103 | export PS1="${Blue}\w ${Red}\u${Cyan}@${Yellow}\h ${Purple}#${Rst} " 104 | 105 | # }}} 106 | # user last step {{{ 107 | 108 | LAST_STEP=~/.options/last-step.zsh 109 | [[ -e $LAST_STEP ]] && source $LAST_STEP 110 | 111 | # }}} 112 | 113 | [ -f ~/.fzf.bash ] && source ~/.fzf.bash 114 | . "$HOME/.cargo/env" 115 | -------------------------------------------------------------------------------- /bash/deploy.zsh: -------------------------------------------------------------------------------- 1 | verifylink ~/.bashrc 2 | updatelinks ~/.bashrc bash/bashrc.bash 3 | 4 | verifylink ~/.bash_profile 5 | updatelinks ~/.bash_profile bash/bash_profile.bash -------------------------------------------------------------------------------- /boot/.gitignore: -------------------------------------------------------------------------------- 1 | log/ 2 | -------------------------------------------------------------------------------- /boot/boot.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | source $GIT_ROOT/zsh/termcolors.zsh 8 | source $GIT_ROOT/zsh/constants.zsh 9 | 10 | source $GIT_ROOT/boot/guard.zsh 11 | source $GIT_ROOT/boot/functions.zsh $1 12 | 13 | source $GIT_ROOT/boot/symlinks.zsh 14 | 15 | source ~/.options/shell-options.zsh gitmask 16 | 17 | source $GIT_ROOT/boot/zsh-deps.zsh 18 | source $GIT_ROOT/boot/vim-deps.zsh 19 | source $GIT_ROOT/boot/emacs-deps.zsh 20 | source $GIT_ROOT/boot/other-deps.zsh 21 | 22 | source ~/.options/shell-options.zsh setup 23 | -------------------------------------------------------------------------------- /boot/emacs-deps.zsh: -------------------------------------------------------------------------------- 1 | mkdir -p $emacs_deps && cd $emacs_deps 2 | 3 | # my packages 4 | ningrab ninrod/gruvbox-theme 5 | ningrab ninrod/thin-melpa-mirror 6 | ningrab ninrod/evil-replace-with-char 7 | ningrab ninrod/evil-string-inflection 8 | 9 | # 3rd party 10 | ningrab noctuid/rect-ext.el 11 | -------------------------------------------------------------------------------- /boot/functions.zsh: -------------------------------------------------------------------------------- 1 | verifylink() { 2 | local symlink=${1:a} 3 | if [[ -e $symlink ]] && [[ ! -h $symlink ]]; then 4 | echo -e "${Yellow}$symlink${Rst} is a ${Red}regular${Rst} file on your system." 5 | echo -e "rename/backup the file ${Yellow}$symlink${Rst}, and run the script again." 6 | exit 1 7 | fi 8 | } 9 | 10 | updatelinks() { 11 | local symlink=${1:a} 12 | local symlink_old_target=${1:A} 13 | local symlink_new_target=${2:A} 14 | if [[ ! -h $symlink ]]; then 15 | echo -e "$symlink ${Green}->${Rst} $symlink_new_target" 16 | elif [[ $symlink_old_target != $symlink_new_target ]]; then 17 | rm $symlink 18 | echo -e "$1 ${Red}-${Black}X${Rst}->${Rst} $symlink ${Green}->${Rst} $symlink_new_target" 19 | else 20 | echo -e "$1 ${Green}ok.${Rst}" 21 | return 0 22 | fi 23 | ln -s $symlink_new_target $symlink 24 | } 25 | 26 | # ningrab function 27 | build_git_url() { 28 | local name="$1" 29 | local gitservermask='https://github.com/' 30 | if [[ -n ${GITMASK+X} ]]; then 31 | gitservermask=$GITMASK 32 | fi 33 | local url=${gitservermask}${name}.git 34 | echo $url 35 | } 36 | 37 | git_clone_error_msg() { 38 | if [[ ! $1 = 0 ]]; then 39 | echo -e "${Red}[ERROR]${Rst} git clone finished with return code: ${Red}${1}${Rst}. ${Yellow}aborting...${Rst}" 40 | echo -e "-------------------" 41 | return $1 42 | fi 43 | } 44 | 45 | # simplest dependency fetcher known to mankind 46 | if [[ "$1" == "update" ]]; then 47 | 48 | ningrab() { 49 | local name="$1" 50 | local cwd=$(readlink -f .) 51 | cd $name 52 | echo -e "-------------------" 53 | echo -e "${Yellow}Performing git status${Rst} on [${Green}${name}${Rst}]." 54 | 55 | git fetch -v 56 | 57 | # hack lifted from http://stackoverflow.com/a/3278427/4921402 58 | LOCAL=$(git rev-parse @) 59 | REMOTE=$(git rev-parse @{u}) 60 | BASE=$(git merge-base @ @{u}) 61 | if [[ $LOCAL = $REMOTE ]]; then 62 | echo "${Cyan}${name}${Rst} is already ${Blue}Up-to-date${Rst}." 63 | elif [[ $LOCAL = $BASE ]]; then 64 | echo "${Cyan}${name}${Rst} ${Yellow}needs a pull${Rst} Performing git pull..." 65 | git pull --rebase; rc=$? 66 | if [[ ! $rc = 0 ]]; then 67 | echo -e "${Red}[ERROR]${Rst} git pull returned code: ${Red}${rc}${Rst}. ${Yellow}aborting...${Rst}" 68 | echo -e "-------------------" 69 | return $rc 70 | fi 71 | echo -e "${Blue}[Success]${Rst} ${Green}$name${Rst} successfully ${Cyan}updated${Rst}." 72 | elif [[ $REMOTE = $BASE ]]; then 73 | echo "${name} needs to be ${Red}pushed${Rst}. Wait, What? You should not be commiting here. Or perhaps history was rewritten in upstream. You may have to issue a ${Yellow}git reset --hard origin/master.${Rst}" 74 | else 75 | echo "${name} needs to be ${Red}rebased and pushed${Rst}. Wait, What? You should not be commiting here." 76 | fi 77 | 78 | cd $cwd 79 | echo -e "-------------------" 80 | } 81 | 82 | else 83 | 84 | ningrab() { 85 | local name="$1" 86 | local url=$(build_git_url $name) 87 | local ref=$2 88 | echo "" && echo "-------------------" 89 | if [[ -d $name ]]; then 90 | echo -e "[${Green}${name}${Rst}] already cloned from ${Blue}${url}${Rst}" 91 | else 92 | echo -e "[${Red}${name}${Rst}] not cloned. cloning now from ${Blue}${url}${Rst}" 93 | if [[ -n ${2+x} ]]; then 94 | echo -e "the ref: ${Yellow}${ref}${Rst} was passed. Performing ${Blue}full${Rst} clone." 95 | 96 | git clone $url $name; rc=$?; git_clone_error_msg $rc 97 | if [[ ! $rc = 0 ]]; then 98 | return $rc 99 | fi 100 | 101 | local cwd=$(readlink -f .) 102 | cd $name 103 | git checkout --quiet $ref 104 | echo -e "[${Green}performing checkout${Rst}] ${Yellow}$(git branch --no-color --quiet --column=dense)${Rst}" 105 | cd $cwd 106 | else 107 | echo -e "no ref to checkout. ${Yellow}shallow${Rst} cloning." 108 | git clone --depth 1 $url $name; rc=$?; git_clone_error_msg $rc 109 | if [[ ! $rc = 0 ]]; then 110 | return $rc 111 | fi 112 | fi 113 | echo -e "[${Green}${name}${Rst}] sucessfully cloned." 114 | fi 115 | echo -e "-------------------" 116 | } 117 | fi 118 | -------------------------------------------------------------------------------- /boot/guard.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | MY_COMMAND=readlink 4 | 5 | if ! command -v $MY_COMMAND; then 6 | echo "$MY_COMMAND command not found. aborting." 7 | exit 1; 8 | else 9 | echo "$MY_COMMAND was found, continuing" 10 | fi -------------------------------------------------------------------------------- /boot/logboot.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | echo $PWD 8 | 9 | logdir=$GIT_ROOT/boot/log 10 | mkdir -p $logdir 11 | 12 | logfile=$logdir/boot.log 13 | 14 | ./boot.zsh $1 2>&1 | tee $logfile 15 | -------------------------------------------------------------------------------- /boot/options.zsh: -------------------------------------------------------------------------------- 1 | OPTIONS=$(cd $SCRIPTPATH; cd ../../; readlink -f options) 2 | LINK_OPTIONS=~/.options 3 | if [[ -e $OPTIONS ]]; then 4 | echo "removing $LINK_OPTIONS" 5 | [[ -d $LINK_OPTIONS ]] && rm -rf $LINK_OPTIONS 6 | [[ -e $LINK_OPTIONS ]] && rm -f $LINK_OPTIONS 7 | echo "symlinking options" 8 | echo "first arg: $OPTIONS" 9 | echo "second arg: $LINK_OPTIONS" 10 | ln -s $OPTIONS $LINK_OPTIONS 11 | fi 12 | source $SHELL_OPTIONS_FILE 13 | export DOTPATH 14 | -------------------------------------------------------------------------------- /boot/other-deps.zsh: -------------------------------------------------------------------------------- 1 | mkdir -p $other_deps && cd $other_deps 2 | 3 | # install seebi's dircolors-solarized 4 | ningrab seebi/dircolors-solarized 5 | verifylink ~/.lscolors 6 | updatelinks ~/.lscolors $other_deps/seebi/dircolors-solarized/dircolors.256dark -------------------------------------------------------------------------------- /boot/readme.org: -------------------------------------------------------------------------------- 1 | * Boot strategy 2 | - this is where I maintain my boot process strategy programs 3 | * Options 4 | - note: the user can opt for defining his own git url to assert from where he wants to grab his dependencies. 5 | - that's useful, for example, if you mantain your own private gitlab server or cgit. 6 | - you just have to create a file that populates a zsh associative array: 7 | 1. create a file called =~/.options/shell-options.zsh= 8 | 2. populate the file like this: 9 | 10 | #+BEGIN_SRC shell 11 | urlhash[awesome/dependency]=https://mycustom.gitlab.server.com/awesome/dendency.git 12 | urlhash[foo/bar]=https://foo.com/cgit/baz.git 13 | #+END_SRC 14 | 15 | - done. 16 | -------------------------------------------------------------------------------- /boot/symlinks.zsh: -------------------------------------------------------------------------------- 1 | # deploy symlinks 2 | 3 | cd $GIT_ROOT 4 | for file in ./**/deploy.zsh; do 5 | source $file 6 | done 7 | 8 | verifylink ~/.dotfiles 9 | updatelinks ~/.dotfiles . 10 | -------------------------------------------------------------------------------- /boot/vim-deps.zsh: -------------------------------------------------------------------------------- 1 | mkdir -p $vim_deps && cd $vim_deps 2 | 3 | # fetch core editing deps 4 | ningrab bronson/vim-visual-star-search 5 | ningrab vim-scripts/vis 6 | ningrab chaoren/vim-wordmotion 7 | ningrab ervandew/supertab 8 | ningrab junegunn/fzf.vim 9 | ningrab junegunn/vim-easy-align 10 | ningrab kana/vim-textobj-entire 11 | ningrab kana/vim-textobj-user 12 | ningrab ninrod/ninscratch-vim 13 | ningrab terryma/vim-multiple-cursors 14 | ningrab tommcdo/vim-exchange 15 | ningrab tpope/vim-commentary 16 | ningrab tpope/vim-pathogen 17 | ningrab tpope/vim-repeat 18 | ningrab tpope/vim-surround 19 | ningrab vim-scripts/ReplaceWithRegister 20 | ningrab wellle/targets.vim 21 | 22 | # fetch cosmetic deps 23 | ningrab itchyny/lightline.vim 24 | ningrab morhetz/gruvbox 25 | ningrab junegunn/rainbow_parentheses.vim 26 | 27 | # fetch buffer/file manipulation deps 28 | ningrab jlanzarotta/bufexplorer 29 | ningrab francoiscabrol/ranger.vim 30 | 31 | # filetypes 32 | ningrab chr4/nginx.vim 33 | 34 | # pathogen installation 35 | PATHOGEN_FILE=$vim_deps/tpope/vim-pathogen/autoload/pathogen.vim 36 | AUTOLOAD_DIR=~/.vim/autoload 37 | [[ ! -d $AUTOLOAD_DIR ]] && mkdir -p $AUTOLOAD_DIR 38 | cp $PATHOGEN_FILE ~/.vim/autoload 39 | 40 | -------------------------------------------------------------------------------- /boot/zsh-deps.zsh: -------------------------------------------------------------------------------- 1 | # fetch zsh deps 2 | mkdir -p $zsh_deps && cd $zsh_deps 3 | 4 | # functionality 5 | ningrab ninrod/zsh-bd 6 | ningrab ninrod/k 7 | 8 | # completions 9 | ningrab ninrod/docker-zsh-completion 10 | ningrab ninrod/docker-compose-zsh-completion 11 | ningrab zsh-users/zsh-completions 12 | ningrab ninrod/pass-zsh-completion 13 | ningrab ninrod/gradle-zsh-completion 14 | ningrab ninrod/exercism-zsh-completion 15 | 16 | 17 | # appearance 18 | ningrab zdharma/fast-syntax-highlighting 19 | ningrab so-fancy/diff-so-fancy 20 | -------------------------------------------------------------------------------- /config/deploy.zsh: -------------------------------------------------------------------------------- 1 | verifylink ~/.config 2 | updatelinks ~/.config config 3 | -------------------------------------------------------------------------------- /config/nvim: -------------------------------------------------------------------------------- 1 | ../nvim -------------------------------------------------------------------------------- /emacs/.gitignore: -------------------------------------------------------------------------------- 1 | .cache/ 2 | elpa/ 3 | auto-save-list/ 4 | backups/ 5 | lisp/ 6 | server/ 7 | var/ 8 | thin-elpa-mirror/ 9 | speed-type/ 10 | hacker-typer/ 11 | transient/ 12 | 13 | *.log 14 | *.dat 15 | *.cache 16 | 17 | .persistent-scratch 18 | 19 | keyfreq.el 20 | keyfreq.lock 21 | smex-items 22 | 23 | recentf* 24 | 25 | bookmarks 26 | history 27 | boot.el 28 | places 29 | tramp 30 | projectile-bookmarks.eld 31 | -------------------------------------------------------------------------------- /emacs/deploy.zsh: -------------------------------------------------------------------------------- 1 | verifylink ~/.emacs.d 2 | updatelinks ~/.emacs.d emacs -------------------------------------------------------------------------------- /emacs/emacs-customizations.el: -------------------------------------------------------------------------------- 1 | (custom-set-variables 2 | ;; custom-set-variables was added by Custom. 3 | ;; If you edit it by hand, you could mess it up, so be careful. 4 | ;; Your init file should contain only one such instance. 5 | ;; If there is more than one, they won't work right. 6 | '(delete-selection-mode nil) 7 | '(ediff-window-setup-function 'ediff-setup-windows-plain) 8 | '(evil-search-module 'evil-search) 9 | '(ibuffer-fontification-alist 10 | '((10 buffer-read-only font-lock-constant-face) 11 | (15 12 | (and buffer-file-name 13 | (string-match ibuffer-compressed-file-name-regexp buffer-file-name)) 14 | font-lock-doc-face) 15 | (20 16 | (string-match "^*" 17 | (buffer-name)) 18 | font-lock-comment-face) 19 | (25 20 | (and 21 | (string-match "^ " 22 | (buffer-name)) 23 | (null buffer-file-name)) 24 | italic) 25 | (30 26 | (memq major-mode ibuffer-help-buffer-modes) 27 | font-lock-comment-face) 28 | (35 29 | (eq major-mode 'dired-mode) 30 | font-lock-function-name-face) 31 | (1 32 | (or 33 | (eq major-mode 'emacs-lisp-mode) 34 | (eq major-mode 'lisp-mode)) 35 | highlight-numbers-number) 36 | (1 37 | (eq major-mode 'org-mode) 38 | org-level-1))) 39 | '(package-selected-packages 40 | '(rust-mode elpa-mirror rjsx-mode exec-path-from-shell nginx-mode ob-http racer dired-quick-sort systemd kotlin-mode circe pkgbuild-mode powershell flycheck-package pass docker general ivy-hydra which-key emmet-mode yasnippet smex groovy-mode feature-mode py-isort pyvenv yapfify company-anaconda anaconda-mode flycheck-rust cargo toml-mode go-guru go-eldoc go-mode yaml-mode dockerfile-mode gitattributes-mode gitignore-mode gitconfig-mode vimrc-mode json-mode json-reformat tide js2-mode web-mode markdown-mode f aggressive-indent helpful lispyville lispy worf neotree dired-sort counsel-projectile projectile vdiff-magit evil-magit magit git-gutter-fringe atomic-chrome disable-mouse ibuffer-vc editorconfig origami ag multi-term eyebrowse restart-emacs spaceline smartparens rainbow-mode rainbow-delimiters org-bullets lisp-extra-font-lock kurecolor info+ highlight-defined highlight-quoted highlight-parentheses highlight-numbers fic-mode autothemer all-the-icons evil-string-inflection evil-replace-with-char exato vdiff evil-ediff evil-lion evil-indent-plus evil-numbers evil-args evil-god-state evil-anzu evil-escape evil-visualstar evil-exchange evil-matchit evil-commentary evil-replace-with-register evil-surround evil-test-helpers org-plus-contrib diminish use-package)) 41 | '(safe-local-variable-values 42 | '((eval when 43 | (and 44 | (buffer-file-name) 45 | (file-regular-p 46 | (buffer-file-name)) 47 | (string-match-p "^[^.]" 48 | (buffer-file-name))) 49 | (unless 50 | (featurep 'package-build) 51 | (let 52 | ((load-path 53 | (cons "../package-build" load-path))) 54 | (require 'package-build))) 55 | (package-build-minor-mode) 56 | (set 57 | (make-local-variable 'package-build-working-dir) 58 | (expand-file-name "../working/")) 59 | (set 60 | (make-local-variable 'package-build-archive-dir) 61 | (expand-file-name "../packages/")) 62 | (set 63 | (make-local-variable 'package-build-recipes-dir) 64 | default-directory)) 65 | (eval when 66 | (fboundp 'rainbow-mode) 67 | (rainbow-mode 1)) 68 | (origami-fold-style . triple-braces)))) 69 | 70 | (custom-set-faces 71 | ;; custom-set-faces was added by Custom. 72 | ;; If you edit it by hand, you could mess it up, so be careful. 73 | ;; Your init file should contain only one such instance. 74 | ;; If there is more than one, they won't work right. 75 | '(trailing-whitespace ((t (:background "dark magenta" :foreground "#B3B3B3"))))) 76 | 77 | (put 'narrow-to-region 'disabled nil) 78 | -------------------------------------------------------------------------------- /emacs/eshell/.gitignore: -------------------------------------------------------------------------------- 1 | history 2 | lastdir 3 | -------------------------------------------------------------------------------- /emacs/eshell/alias: -------------------------------------------------------------------------------- 1 | alias la ls -la 2 | alias gl git log --graph --oneline --decorate 3 | alias gc git commit -m $1 4 | alias gal git add --all 5 | alias c clear 6 | alias gd git diff 7 | alias g git status -sb 8 | alias b cd .. 9 | alias e find-file $1 10 | alias l ls -l $* 11 | alias q exit 12 | -------------------------------------------------------------------------------- /emacs/init.el: -------------------------------------------------------------------------------- 1 | (let* ((gc-cons-threshold (* 25 1024 1024)) 2 | (local-elpa-mirror-base "~/.dotfiles/deps/emacs/ninrod") 3 | (local-elpa-mirror-thin (concat local-elpa-mirror-base "/thin-melpa-mirror")) 4 | (local-thin-installed (file-directory-p local-elpa-mirror-thin))) 5 | 6 | (require 'package) 7 | (setq package-enable-at-startup nil) 8 | (cond (local-thin-installed 9 | (message "local thin melpa found: installing...") 10 | (setq package-archives `(("melpa" . ,(concat local-elpa-mirror-thin)) 11 | ("gnu" . ,(concat local-elpa-mirror-thin))))) 12 | (t 13 | (message "there are no local elpa mirrors. going to the interwebz") 14 | (setq package-archives `(("melpa" . "https://melpa.org/packages/") 15 | ("gnu" . "https://elpa.gnu.org/packages/"))))) 16 | (package-initialize) 17 | (unless (package-installed-p 'use-package) 18 | (package-refresh-contents) 19 | (package-install 'use-package)) 20 | 21 | (setq vc-follow-symlinks "t") ; prevent prompt when loading org file 22 | (use-package diminish :ensure t) 23 | 24 | (use-package org 25 | :pin melpa 26 | :ensure org-plus-contrib 27 | :defer 7) ;; fetch latest version of `org-mode' 28 | 29 | (defun ninrod/load-secrets-file (secrets-file) 30 | (defun ninrod/parent-dir (dirname times) 31 | "get the parent dir of DIRNAME" 32 | (let* ((path (file-truename dirname))) 33 | (dotimes (number times path) 34 | (setq path (file-name-directory (directory-file-name path)))) 35 | path)) 36 | (let* ((nin-source-dir (ninrod/parent-dir user-emacs-directory 2)) 37 | (full-secrets-file (concat nin-source-dir secrets-file))) 38 | (cond ((file-exists-p full-secrets-file) 39 | (message "file `%s' EXISTS!!! loading..." full-secrets-file) 40 | (org-babel-load-file full-secrets-file)) 41 | (t 42 | (message "pre-secrets does NOT exist. nothing to do here."))))) 43 | 44 | (ninrod/load-secrets-file "secrets/emacs-pre.org") 45 | (org-babel-load-file (expand-file-name "boot.org" user-emacs-directory)) 46 | (ninrod/load-secrets-file "secrets/emacs-post.org") 47 | 48 | (garbage-collect)) 49 | -------------------------------------------------------------------------------- /emacs/readme.org: -------------------------------------------------------------------------------- 1 | * Emacs 2 | 3 | #+BEGIN_QUOTE 4 | "Emacs outshines all other editing software in approximately 5 | the same way that the noonday sun does the stars. It is not 6 | just bigger and brighter; it simply makes everything else 7 | vanish." 8 | (Neal Stephenson, "In the Beginning was the Command Line") 9 | #+END_QUOTE 10 | 11 | #+BEGIN_QUOTE 12 | "Show me your ~/.emacs and I will tell you who you are." 13 | (Bogdan Maryniuk) 14 | #+END_QUOTE 15 | 16 | #+BEGIN_QUOTE 17 | "Emacs is like a laser guided missile. It only has to be 18 | slightly mis-configured to ruin your whole day." 19 | (Sean McGrathi) 20 | #+END_QUOTE 21 | 22 | #+BEGIN_QUOTE 23 | "Lisp isn't a language, it's a building material." 24 | (Alan Kay) 25 | #+END_QUOTE 26 | 27 | #+BEGIN_QUOTE 28 | "Compared to Emacs Wizards, graphical-IDE users are the 29 | equivalent of amateur musicians, pawing at their instrument 30 | with a sort of desperation. An IDE has blinking lights and 31 | pretty dialogs that you can't interact with properly, and 32 | gives newbies a nice comfortable sense of control. But that 33 | control is extremely crude, and all serious programmers 34 | prefer something that gives them more power." 35 | (Steve Yegge) 36 | #+END_QUOTE 37 | 38 | #+BEGIN_QUOTE 39 | Saying that Emacs is just a text editor is like calling iPhone just a 40 | phone. 41 | ([[http://www.terminally-incoherent.com/blog/2007/12/13/emacs-with-auctex-as-a-latex-ide/][Luke - Terminally Incoherent]]) 42 | #+END_QUOTE 43 | 44 | #+BEGIN_QUOTE 45 | While any text editor can save your files, only Emacs can save your 46 | soul. 47 | (Per Abrahamsen) 48 | #+END_QUOTE 49 | 50 | #+BEGIN_QUOTE 51 | The reasonable man adapts himself to Emacs; the unreasonable one 52 | persists in trying to adapt Emacs to himself. Therefore all progress 53 | depends on the unreasonable man. 54 | (G.B. Shaw) 55 | #+END_QUOTE 56 | 57 | * Ninrod's Emacs configuration 58 | - use-package for managing dependencies 59 | - org-babel to keep the init.el organized as an org-mode file. 60 | - ivy instead of helm 61 | * List of minor emacs paint points comming from vim 62 | ** basic editing operations 63 | - [[https://bitbucket.org/lyro/evil/issues/726/vt-vf-vt-vf-vt-vf-vt-vf-do-not-work][`vt'` and `vt"` do not work with us-internationl keyboard deadkeys in osx gui mode.]] 64 | - no virtual columns 65 | - the star operator is broken when subword-mode is active. 66 | ** Completions 67 | - tab completion with dabbrev-expand ignores case. 68 | * package ideas 69 | - xml/html tag attribute text object. NOTE: [[https://github.com/ninrod/exato][implemented!]] 70 | - move horizontally in long lines like in vim's =zt=, =zb=, etc... 71 | - implement a new operator that performs r in visual mode (but in normal mode). useful for | | -> |------| in markdown mode. 72 | - alternatively: implement a function that substitutes all occurrences of | | -> |-----| 73 | 74 | 75 | -------------------------------------------------------------------------------- /emacs/snippets/emacs-lisp-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | lisp-mode 2 | -------------------------------------------------------------------------------- /emacs/snippets/html-mode/html5: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: html5-snippet 3 | # key: html5 4 | # -- 5 | 6 | 7 | 8 | 9 | 10 | 11 | an html page 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |

$0

20 | 21 | -------------------------------------------------------------------------------- /emacs/snippets/js-mode/log: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : console.log 3 | # -- 4 | console.log($0); -------------------------------------------------------------------------------- /emacs/snippets/js2-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | js-mode 2 | -------------------------------------------------------------------------------- /emacs/snippets/js3-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | js-mode 2 | -------------------------------------------------------------------------------- /emacs/snippets/lisp-interaction-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | lisp-mode 2 | -------------------------------------------------------------------------------- /emacs/snippets/lisp-mode/con.snippet: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: con 3 | # key: con 4 | # -- 5 | (cond (${1:condition} $0) 6 | (t nil)) 7 | -------------------------------------------------------------------------------- /emacs/snippets/lisp-mode/def.snippet: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: defun 3 | # key: def 4 | # -- 5 | (defun ${1:fun} (${2:args}) 6 | "${3:docstring}" 7 | ${4:(interactive${5: "${6:P}"})} 8 | $0) -------------------------------------------------------------------------------- /emacs/snippets/lisp-mode/let.snippet: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: let 3 | # key: let 4 | # -- 5 | 6 | (let ((${1:var1} ${2: value1})) 7 | $0) 8 | -------------------------------------------------------------------------------- /emacs/snippets/lisp-mode/use-package.snippet: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet; require-final-newline: nil -*- 2 | # name: use-package 3 | # key: use 4 | # -- 5 | (use-package $0 6 | :ensure t) -------------------------------------------------------------------------------- /emacs/snippets/lisp-mode/zc.snippet: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: zc 3 | # key: zc 4 | # -- 5 | ;; ${1:header} {{{ 6 | 7 | $0 8 | 9 | ;; }}} 10 | -------------------------------------------------------------------------------- /emacs/snippets/org-mode/el.snippet: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet; require-final-newline: nil -*- 2 | # name: org-elisp-code 3 | # key: el 4 | # -- 5 | #+BEGIN_SRC emacs-lisp 6 | $0 7 | #+END_SRC -------------------------------------------------------------------------------- /emacs/snippets/org-mode/header.snippet: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet; require-final-newline: nil -*- 2 | # name: org-header 3 | # key: header 4 | # -- 5 | #+STARTUP: indent 6 | #+STARTUP: overview -------------------------------------------------------------------------------- /emacs/snippets/perl-mode/perlbang.snippet: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: perlbang 3 | # key: ! 4 | # -- 5 | #!/usr/bin/env perl 6 | use v5.16; 7 | 8 | $0 -------------------------------------------------------------------------------- /emacs/snippets/python-mode/shebang.snippet: -------------------------------------------------------------------------------- 1 | * TODO # -*- mode: snippet -*- 2 | # name: pythonbang 3 | # key: ! 4 | # -- 5 | #!/usr/bin/env python 6 | 7 | $0 8 | -------------------------------------------------------------------------------- /emacs/snippets/sh-mode/bang: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: bang 3 | # key: ! 4 | # -- 5 | #!/usr/bin/env bash 6 | # author: Filipe Silva (ninrod) 7 | set -euo pipefail 8 | SCRIPTPATH=$(cd $(dirname \$0); pwd -P) && cd $SCRIPTPATH 9 | 10 | $0 -------------------------------------------------------------------------------- /emacs/snippets/sh-mode/if: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: if 3 | # key: if 4 | # -- 5 | if ${1:[ -f file]} 6 | then ${2:do} 7 | fi 8 | $0 -------------------------------------------------------------------------------- /emacs/snippets/typescript-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | js-mode 2 | -------------------------------------------------------------------------------- /emacs/snippets/web-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | html-mode 2 | -------------------------------------------------------------------------------- /git/deploy.zsh: -------------------------------------------------------------------------------- 1 | cp git/gitconfig ~/.gitconfig -------------------------------------------------------------------------------- /git/gitconfig: -------------------------------------------------------------------------------- 1 | [push] 2 | default = simple 3 | 4 | # Add the following to your .gitconfig file. 5 | [diff] 6 | tool = my_diff_meld 7 | [difftool] 8 | prompt = false 9 | [difftool "my_diff_meld"] 10 | cmd = meld "$LOCAL" "$REMOTE" 11 | 12 | # Add the following to your .gitconfig file. 13 | [merge] 14 | tool = my_merge_meld 15 | defaultToUpstream = true 16 | conflictstyle = diff3 17 | [mergetool] 18 | keepBackup = false 19 | [mergetool "my_merge_meld"] 20 | # Choose one of these 2 lines (not both!) explained below. 21 | # cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED" 22 | cmd = meld "$LOCAL" "$REMOTE" --diff "$BASE" "$LOCAL" --diff "$BASE" "$REMOTE" --diff "$LOCAL" "$MERGED" "$REMOTE" --diff "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED" 23 | 24 | [core] 25 | editor = vim 26 | autocrlf = input 27 | [color] 28 | ui = auto 29 | [color "diff"] 30 | meta = yellow 31 | commit = green 32 | frag = magenta 33 | old = red 34 | new = green 35 | whitespace = red reverse 36 | [color "diff-highlight"] 37 | oldNormal = red 38 | oldHighlight = "red 52" 39 | newNormal = "green" 40 | newHighlight = "green 22" 41 | [color "branch"] 42 | current = yellow reverse 43 | local = yellow 44 | remote = green 45 | [color "status"] 46 | untracked = cyan 47 | [pager] 48 | diff = diff-so-fancy | less --tabs=4 -RFX 49 | show = diff-so-fancy | less --tabs=4 -RFX 50 | [grep] 51 | lineNumber = true 52 | extendRegexp = true 53 | [credential] 54 | helper = store 55 | -------------------------------------------------------------------------------- /idea/deploy.zsh: -------------------------------------------------------------------------------- 1 | verifylink ~/.ideavimrc.vim 2 | updatelinks ~/.ideavimrc idea/ideavimrc.vim -------------------------------------------------------------------------------- /idea/ideavimrc.vim: -------------------------------------------------------------------------------- 1 | set hlsearch 2 | set ignorecase 3 | set smartcase 4 | set incsearch 5 | set showmode 6 | set clipboard+=unnamed 7 | set surround 8 | 9 | nnoremap - :noh 10 | nnoremap q ZQ 11 | nnoremap Q q 12 | nnoremap ( { 13 | nnoremap ) } 14 | nnoremap :w 15 | 16 | nnoremap s :action OptimizeImports 17 | 18 | map gl G 19 | map g; g_ 20 | nnoremap gq :action Exit 21 | nnoremap gr :action RenameElement 22 | nnoremap gh :action RecentFiles 23 | nnoremap gb :action ViewBreakpoints 24 | nnoremap gs :action FileStructurePopup 25 | nnoremap gf :action FindUsages 26 | nnoremap gt :action ActivateTerminalToolWindow 27 | nnoremap gv :action Refactorings.QuickListPopupAction 28 | 29 | " interesting actions 30 | " :action InspectCode 31 | " :action ChangeView 32 | " :action RenameFile 33 | -------------------------------------------------------------------------------- /install.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | ./boot/logboot.zsh $1 8 | -------------------------------------------------------------------------------- /nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, 3 | "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, 4 | "bufexplorer": { "branch": "master", "commit": "2308e87960c05bd8da7bbf62c903e1f42d6cc9b9" }, 5 | "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, 6 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 7 | "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, 8 | "conform.nvim": { "branch": "master", "commit": "797de8f79055334104cf77893cd93fe3fc2ac154" }, 9 | "fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" }, 10 | "gitsigns.nvim": { "branch": "main", "commit": "f4928ba14eb6c667786ac7d69927f6aee6719f1e" }, 11 | "lazy.nvim": { "branch": "main", "commit": "d5686efbd00942b3e38de7c08b8df69d961b02f0" }, 12 | "mason-lspconfig.nvim": { "branch": "main", "commit": "58bc9119ca273c0ce5a66fad1927ef0f617bd81b" }, 13 | "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, 14 | "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 15 | "mini.nvim": { "branch": "main", "commit": "657ef75b52a548090fb7906735517b7ddbf39e88" }, 16 | "neo-tree.nvim": { "branch": "main", "commit": "8c75e8a2949cd6cd35525799200a8d34471ee9eb" }, 17 | "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, 18 | "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, 19 | "nvim-autopairs": { "branch": "master", "commit": "e38c5d837e755ce186ae51d2c48e1b387c4425c6" }, 20 | "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, 21 | "nvim-lspconfig": { "branch": "master", "commit": "fa6c2a64100c6f692bbec29bbbc8ec2663c9e869" }, 22 | "nvim-treesitter": { "branch": "master", "commit": "9d252d00210ed8d43197ef048daa94e6dc821bd6" }, 23 | "nvim-web-devicons": { "branch": "master", "commit": "e612de3d3a41a6b7be47f51e956dddabcbf419d9" }, 24 | "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, 25 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, 26 | "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, 27 | "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, 28 | "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, 29 | "tokyonight.nvim": { "branch": "main", "commit": "6c30395146c246055ac3cea32d39d6b9876a1dcc" }, 30 | "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, 31 | "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, 32 | "which-key.nvim": { "branch": "main", "commit": "650f298f516018ad7ebce6d957e015d5db434f3c" } 33 | } 34 | -------------------------------------------------------------------------------- /nvim/lua/custom/plugins/init.lua: -------------------------------------------------------------------------------- 1 | -- You can add your own plugins here or in other files in this directory! 2 | -- I promise not to create any merge conflicts in this directory :) 3 | -- 4 | -- See the kickstart.nvim README for more information 5 | 6 | return {} 7 | -------------------------------------------------------------------------------- /nvim/lua/keys/keybindings.lua: -------------------------------------------------------------------------------- 1 | -- See `:help vim.keymap.set()` 2 | -- 3 | -- Set highlight on search, but clear on pressing in normal mode 4 | vim.opt.hlsearch = true 5 | vim.keymap.set({ "n", "v" }, "", "nohlsearch") 6 | 7 | vim.keymap.set("n", "", "w") 8 | vim.keymap.set("n", "q", "ZQ") 9 | vim.keymap.set("n", "Q", "q") 10 | 11 | vim.keymap.set({ "n", "o", "x" }, "(", "{") 12 | vim.keymap.set({ "n", "o", "x" }, ")", "}") 13 | 14 | vim.keymap.set({ "n", "v" }, "gl", "G") 15 | 16 | vim.keymap.set("n", "j", "") 17 | vim.keymap.set("n", "k", "") 18 | vim.keymap.set("n", "mk", "bd") 19 | 20 | -- Keybinds to make split navigation easier. 21 | -- Use CTRL+ to switch between windows 22 | -- 23 | -- See `:help wincmd` for a list of all window commands 24 | 25 | vim.keymap.set("n", "s", "", { desc = "do nothing" }) 26 | vim.keymap.set("n", "sh", "", { desc = "Move focus to the left window" }) 27 | vim.keymap.set("n", "sl", "", { desc = "Move focus to the right window" }) 28 | vim.keymap.set("n", "sj", "", { desc = "Move focus to the lower window" }) 29 | vim.keymap.set("n", "sk", "", { desc = "Move focus to the upper window" }) 30 | vim.keymap.set("n", "sx", "s", { desc = "create horizontal partition" }) 31 | vim.keymap.set("n", "sy", "v", { desc = "create vertical partition" }) 32 | 33 | vim.keymap.set("v", "", "") 34 | 35 | vim.keymap.set("n", "mi", "BufExplorer") 36 | 37 | -- Diagnostic keymaps 38 | vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous [D]iagnostic message" }) 39 | vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next [D]iagnostic message" }) 40 | vim.keymap.set("n", "e", vim.diagnostic.open_float, { desc = "Show diagnostic [E]rror messages" }) 41 | vim.keymap.set("n", "q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" }) 42 | 43 | -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier 44 | -- for people to discover. Otherwise, you normally need to press , which 45 | -- is not what someone will guess without a bit more experience. 46 | -- 47 | -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping 48 | -- or just use to exit terminal mode 49 | vim.keymap.set("t", "", "", { desc = "Exit terminal mode" }) 50 | 51 | -- TIP: Disable arrow keys in normal mode 52 | -- vim.keymap.set('n', '', 'echo "Use h to move!!"') 53 | -- vim.keymap.set('n', '', 'echo "Use l to move!!"') 54 | -- vim.keymap.set('n', '', 'echo "Use k to move!!"') 55 | -- vim.keymap.set('n', '', 'echo "Use j to move!!"') 56 | -------------------------------------------------------------------------------- /nvim/lua/kickstart/health.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- 3 | -- This file is not required for your own configuration, 4 | -- but helps people determine if their system is setup correctly. 5 | -- 6 | --]] 7 | 8 | local check_version = function() 9 | local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch) 10 | if not vim.version.cmp then 11 | vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) 12 | return 13 | end 14 | 15 | if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then 16 | vim.health.ok(string.format("Neovim version is: '%s'", verstr)) 17 | else 18 | vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) 19 | end 20 | end 21 | 22 | local check_external_reqs = function() 23 | -- Basic utils: `git`, `make`, `unzip` 24 | for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do 25 | local is_executable = vim.fn.executable(exe) == 1 26 | if is_executable then 27 | vim.health.ok(string.format("Found executable: '%s'", exe)) 28 | else 29 | vim.health.warn(string.format("Could not find executable: '%s'", exe)) 30 | end 31 | end 32 | 33 | return true 34 | end 35 | 36 | return { 37 | check = function() 38 | vim.health.start 'kickstart.nvim' 39 | 40 | vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth` 41 | 42 | Fix only warnings for plugins and languages you intend to use. 43 | Mason will give warnings for languages that are not installed. 44 | You do not need to install, unless you want to use those languages!]] 45 | 46 | local uv = vim.uv or vim.loop 47 | vim.health.info('System Information: ' .. vim.inspect(uv.os_uname())) 48 | 49 | check_version() 50 | check_external_reqs() 51 | end, 52 | } 53 | -------------------------------------------------------------------------------- /nvim/lua/kickstart/plugins/autopairs.lua: -------------------------------------------------------------------------------- 1 | -- autopairs 2 | -- https://github.com/windwp/nvim-autopairs 3 | 4 | return { 5 | 'windwp/nvim-autopairs', 6 | event = 'InsertEnter', 7 | -- Optional dependency 8 | dependencies = { 'hrsh7th/nvim-cmp' }, 9 | config = function() 10 | require('nvim-autopairs').setup {} 11 | -- If you want to automatically add `(` after selecting a function or method 12 | local cmp_autopairs = require 'nvim-autopairs.completion.cmp' 13 | local cmp = require 'cmp' 14 | cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) 15 | end, 16 | } 17 | -------------------------------------------------------------------------------- /nvim/lua/kickstart/plugins/debug.lua: -------------------------------------------------------------------------------- 1 | -- debug.lua 2 | -- 3 | -- Shows how to use the DAP plugin to debug your code. 4 | -- 5 | -- Primarily focused on configuring the debugger for Go, but can 6 | -- be extended to other languages as well. That's why it's called 7 | -- kickstart.nvim and not kitchen-sink.nvim ;) 8 | 9 | return { 10 | -- NOTE: Yes, you can install new plugins here! 11 | 'mfussenegger/nvim-dap', 12 | -- NOTE: And you can specify dependencies as well 13 | dependencies = { 14 | -- Creates a beautiful debugger UI 15 | 'rcarriga/nvim-dap-ui', 16 | 17 | -- Required dependency for nvim-dap-ui 18 | 'nvim-neotest/nvim-nio', 19 | 20 | -- Installs the debug adapters for you 21 | 'williamboman/mason.nvim', 22 | 'jay-babu/mason-nvim-dap.nvim', 23 | 24 | -- Add your own debuggers here 25 | 'leoluz/nvim-dap-go', 26 | }, 27 | config = function() 28 | local dap = require 'dap' 29 | local dapui = require 'dapui' 30 | 31 | require('mason-nvim-dap').setup { 32 | -- Makes a best effort to setup the various debuggers with 33 | -- reasonable debug configurations 34 | automatic_installation = true, 35 | 36 | -- You can provide additional configuration to the handlers, 37 | -- see mason-nvim-dap README for more information 38 | handlers = {}, 39 | 40 | -- You'll need to check that you have the required things installed 41 | -- online, please don't ask me how to install them :) 42 | ensure_installed = { 43 | -- Update this to ensure that you have the debuggers for the langs you want 44 | 'delve', 45 | }, 46 | } 47 | 48 | -- Basic debugging keymaps, feel free to change to your liking! 49 | vim.keymap.set('n', '', dap.continue, { desc = 'Debug: Start/Continue' }) 50 | vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) 51 | vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) 52 | vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) 53 | vim.keymap.set('n', 'b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) 54 | vim.keymap.set('n', 'B', function() 55 | dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') 56 | end, { desc = 'Debug: Set Breakpoint' }) 57 | 58 | -- Dap UI setup 59 | -- For more information, see |:help nvim-dap-ui| 60 | dapui.setup { 61 | -- Set icons to characters that are more likely to work in every terminal. 62 | -- Feel free to remove or use ones that you like more! :) 63 | -- Don't feel like these are good choices. 64 | icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, 65 | controls = { 66 | icons = { 67 | pause = '⏸', 68 | play = '▶', 69 | step_into = '⏎', 70 | step_over = '⏭', 71 | step_out = '⏮', 72 | step_back = 'b', 73 | run_last = '▶▶', 74 | terminate = '⏹', 75 | disconnect = '⏏', 76 | }, 77 | }, 78 | } 79 | 80 | -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. 81 | vim.keymap.set('n', '', dapui.toggle, { desc = 'Debug: See last session result.' }) 82 | 83 | dap.listeners.after.event_initialized['dapui_config'] = dapui.open 84 | dap.listeners.before.event_terminated['dapui_config'] = dapui.close 85 | dap.listeners.before.event_exited['dapui_config'] = dapui.close 86 | 87 | -- Install golang specific config 88 | require('dap-go').setup { 89 | delve = { 90 | -- On Windows delve must be run attached or it crashes. 91 | -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring 92 | detached = vim.fn.has 'win32' == 0, 93 | }, 94 | } 95 | end, 96 | } 97 | -------------------------------------------------------------------------------- /nvim/lua/kickstart/plugins/gitsigns.lua: -------------------------------------------------------------------------------- 1 | -- Adds git related signs to the gutter, as well as utilities for managing changes 2 | -- NOTE: gitsigns is already included in init.lua but contains only the base 3 | -- config. This will add also the recommended keymaps. 4 | 5 | return { 6 | { 7 | 'lewis6991/gitsigns.nvim', 8 | opts = { 9 | on_attach = function(bufnr) 10 | local gitsigns = require 'gitsigns' 11 | 12 | local function map(mode, l, r, opts) 13 | opts = opts or {} 14 | opts.buffer = bufnr 15 | vim.keymap.set(mode, l, r, opts) 16 | end 17 | 18 | -- Navigation 19 | map('n', ']c', function() 20 | if vim.wo.diff then 21 | vim.cmd.normal { ']c', bang = true } 22 | else 23 | gitsigns.nav_hunk 'next' 24 | end 25 | end, { desc = 'Jump to next git [c]hange' }) 26 | 27 | map('n', '[c', function() 28 | if vim.wo.diff then 29 | vim.cmd.normal { '[c', bang = true } 30 | else 31 | gitsigns.nav_hunk 'prev' 32 | end 33 | end, { desc = 'Jump to previous git [c]hange' }) 34 | 35 | -- Actions 36 | -- visual mode 37 | map('v', 'hs', function() 38 | gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } 39 | end, { desc = 'stage git hunk' }) 40 | map('v', 'hr', function() 41 | gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } 42 | end, { desc = 'reset git hunk' }) 43 | -- normal mode 44 | map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) 45 | map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) 46 | map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) 47 | map('n', 'hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' }) 48 | map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) 49 | map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) 50 | map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) 51 | map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) 52 | map('n', 'hD', function() 53 | gitsigns.diffthis '@' 54 | end, { desc = 'git [D]iff against last commit' }) 55 | -- Toggles 56 | map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) 57 | map('n', 'tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' }) 58 | end, 59 | }, 60 | }, 61 | } 62 | -------------------------------------------------------------------------------- /nvim/lua/kickstart/plugins/indent_line.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { -- Add indentation guides even on blank lines 3 | 'lukas-reineke/indent-blankline.nvim', 4 | -- Enable `lukas-reineke/indent-blankline.nvim` 5 | -- See `:help ibl` 6 | main = 'ibl', 7 | opts = {}, 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /nvim/lua/kickstart/plugins/lint.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 3 | { -- Linting 4 | 'mfussenegger/nvim-lint', 5 | event = { 'BufReadPre', 'BufNewFile' }, 6 | config = function() 7 | local lint = require 'lint' 8 | lint.linters_by_ft = { 9 | markdown = { 'markdownlint' }, 10 | } 11 | 12 | -- To allow other plugins to add linters to require('lint').linters_by_ft, 13 | -- instead set linters_by_ft like this: 14 | -- lint.linters_by_ft = lint.linters_by_ft or {} 15 | -- lint.linters_by_ft['markdown'] = { 'markdownlint' } 16 | -- 17 | -- However, note that this will enable a set of default linters, 18 | -- which will cause errors unless these tools are available: 19 | -- { 20 | -- clojure = { "clj-kondo" }, 21 | -- dockerfile = { "hadolint" }, 22 | -- inko = { "inko" }, 23 | -- janet = { "janet" }, 24 | -- json = { "jsonlint" }, 25 | -- markdown = { "vale" }, 26 | -- rst = { "vale" }, 27 | -- ruby = { "ruby" }, 28 | -- terraform = { "tflint" }, 29 | -- text = { "vale" } 30 | -- } 31 | -- 32 | -- You can disable the default linters by setting their filetypes to nil: 33 | -- lint.linters_by_ft['clojure'] = nil 34 | -- lint.linters_by_ft['dockerfile'] = nil 35 | -- lint.linters_by_ft['inko'] = nil 36 | -- lint.linters_by_ft['janet'] = nil 37 | -- lint.linters_by_ft['json'] = nil 38 | -- lint.linters_by_ft['markdown'] = nil 39 | -- lint.linters_by_ft['rst'] = nil 40 | -- lint.linters_by_ft['ruby'] = nil 41 | -- lint.linters_by_ft['terraform'] = nil 42 | -- lint.linters_by_ft['text'] = nil 43 | 44 | -- Create autocommand which carries out the actual linting 45 | -- on the specified events. 46 | local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) 47 | vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { 48 | group = lint_augroup, 49 | callback = function() 50 | require('lint').try_lint() 51 | end, 52 | }) 53 | end, 54 | }, 55 | } 56 | -------------------------------------------------------------------------------- /nvim/lua/kickstart/plugins/neo-tree.lua: -------------------------------------------------------------------------------- 1 | -- Neo-tree is a Neovim plugin to browse the file system 2 | -- https://github.com/nvim-neo-tree/neo-tree.nvim 3 | 4 | return { 5 | 'nvim-neo-tree/neo-tree.nvim', 6 | version = '*', 7 | dependencies = { 8 | 'nvim-lua/plenary.nvim', 9 | 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended 10 | 'MunifTanjim/nui.nvim', 11 | }, 12 | cmd = 'Neotree', 13 | keys = { 14 | { '\\', ':Neotree reveal', { desc = 'NeoTree reveal' } }, 15 | }, 16 | opts = { 17 | filesystem = { 18 | window = { 19 | mappings = { 20 | ['\\'] = 'close_window', 21 | }, 22 | }, 23 | }, 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /options/.gitignore: -------------------------------------------------------------------------------- 1 | local-settings 2 | -------------------------------------------------------------------------------- /options/arch/alias.zsh: -------------------------------------------------------------------------------- 1 | # pacman 2 | 3 | alias pmfs='pacman -Fs' # query file database for a command 4 | alias pmss='pacman -Ss' # search for packages 5 | alias pmqm='pacman -Qm' # list foreign, manually installed (often means aur packages) 6 | alias pmquent='pacman -Qent' # list all explicit installed packages 7 | alias pmqmdt='pacman -Qmdt' # foreign and orphans and installted as deps 8 | alias pms='sudo pacman -S' # install 9 | alias pmsyu='sudo pacman -Syu' # update 10 | alias pmr='sudo pacman -R' # remove 11 | alias pm='sudo pacman' # sudo pacman 12 | 13 | # conda 14 | alias sa='source activate' 15 | alias sd='source deactivate' 16 | 17 | # random 18 | alias xclip="xclip -selection c" 19 | alias bat="sudo tlp stat -b" 20 | alias pdf="evince" 21 | alias open=xdg-open 22 | alias mpdcli='ncmpcpp -b ~/.config/ncmpcpp/bindings.conf' 23 | 24 | # netctl 25 | alias nj='sudo netctl stop-all; sudo netctl start juliforever' 26 | alias ns='sudo netctl stop-all; sudo netctl start s8' 27 | alias nb='sudo netctl stop-all; sudo netctl start bcbWifi' 28 | 29 | 30 | # scripts 31 | alias bssh="~/.options/arch/scripts/terminal/bssh.sh" 32 | -------------------------------------------------------------------------------- /options/arch/arch.zsh: -------------------------------------------------------------------------------- 1 | source ~/.options/arch/environment.zsh 2 | source ~/.options/arch/favorites.zsh 3 | source ~/.options/arch/prompt.zsh 4 | source ~/.options/arch/alias.zsh 5 | # source ~/.options/arch/scripts/tmux-attach.sh 6 | -------------------------------------------------------------------------------- /options/arch/bspwm/bspwmrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | PURPLE="#5F00AF" 4 | DARK_ORANGE="#613620" 5 | ZERODARK_BLUEDARK="#1f5582" 6 | GREEN="#427b58" 7 | SECONDARY="#d3869b" 8 | ACCENT="#923D3D" 9 | 10 | # daemon config 11 | # bspc monitor -d I II III IV V VI VII VIII IX X 12 | bspc monitor -d 1 2 3 4 5 8 9 0 13 | 14 | bspc config window_gap 20 15 | bspc config border_width 2 16 | bspc config split_ratio 0.52 17 | 18 | # bspc config focused_border_color $ZERODARK_BLUEDARK 19 | bspc config focused_border_color $ACCENT 20 | bspc config normal_border_color $DARK_ORANGE 21 | 22 | bspc config borderless_monocle true 23 | bspc config gapless_monocle true 24 | 25 | bspc config focus_follows_pointer false 26 | bspc config click_to_focus true 27 | 28 | bspc config pointer_modifier mod4 # mod4 = super 29 | bspc config pointer_action1 move 30 | bspc config pointer_action2 resize_corner 31 | 32 | # rules 33 | bspc rule -a Emacs state=tiled 34 | bspc rule -a Gimp state=floating follow=on 35 | bspc rule -a Pqiv state=tiled 36 | bspc rule -a Tilda state=floating 37 | bspc rule -a Zathura state=tiled 38 | bspc rule -a Libreoffice state=tiled 39 | bspc rule -a libreoffice-calc state=tiled 40 | 41 | # xinitrc migration 42 | # arch specific stuff 43 | # see: https://www.reddit.com/r/archlinux/comments/6o2il3/script_in_xinitrcd_not_running_automatically/ 44 | if [[ -d /etc/X11/xinit/xinitrc.d ]]; then 45 | for f in /etc/X11/xinit/xinitrc.d/?*.sh; do 46 | [[ -x "$f" ]] && source "$f" 47 | done 48 | unset f 49 | fi 50 | 51 | # parcellite clipboard manager 52 | parcellite & 53 | 54 | # start emacs daemon 55 | kill_proc emacs 56 | ~/.dotfiles/scripts/emacs/up-emacs-daemon.sh & 57 | 58 | 59 | # network manager 60 | eval $(/usr/bin/gnome-keyring-daemon --start --components=gpg.pkcs11,secrets,ssh) 61 | export GNOME_KEYRING_CONTROL GNOME_KEYRING_PID GPG_AGENT SSH_AUTH_SOCK 62 | nm-applet & 63 | 64 | # heavy daemons 65 | # command -v udiskie > /dev/null 2>&1 && udiskie & 66 | command -v dropbox-cli > /dev/null 2>&1 && dropbox-cli start & 67 | 68 | # Xorg configurations 69 | XREC=~/.Xresources; [[ -f $XREC ]] && xrdb -merge $XREC 70 | MODMAP=~/.Xmodmap; [[ -f $MODMAP ]] && xmodmap $MODMAP 71 | 72 | # daemons 73 | sxhkd & 74 | # xchainkeys & 75 | # mpd & 76 | 77 | # tip from: https://darryldias.me/06/bspwm-on-debian/ 78 | xsetroot -cursor_name left_ptr & 79 | 80 | # visual effects 81 | 82 | # ------------------------------------ 83 | # daemon spawn section 84 | kill_proc() { 85 | pgrep -f $1 >/dev/null && pkill -9 -f $1 86 | } 87 | 88 | # launch polybar 89 | kill_proc polybar 90 | ~/.config/polybar/launch.sh & 91 | 92 | # start redshift 93 | kill_proc redshift 94 | # redshift -c ~/.options/arch/redshift/redshift.conf & 95 | redshift-gtk -c ~/.options/arch/redshift/redshift.conf & 96 | 97 | # wallpaper black 98 | # feh --bg-fill ~/Dropbox/pics/wall/falcon.jpg 99 | 100 | # wallpaper white 101 | # feh --bg-fill ~/Dropbox/pics/juli/DSCF0207.jpg 102 | # feh --bg-fill ~/Dropbox/pics/wall/tree-volcano.jpg 103 | # feh --bg-fill ~/Dropbox/pics/wall/house-inside-trees.jpg 104 | feh --bg-fill ~/Dropbox/pics/wall/helicopter.jpg 105 | # feh --bg-fill ~/Dropbox/pics/wall/ibm.png 106 | 107 | # java WM/bspwm specific nuisance 108 | wmname LG3D 109 | 110 | # compton 111 | compton --config ~/.options/arch/compton/compton.conf -b -------------------------------------------------------------------------------- /options/arch/bspwm/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config/bspwm 8 | FILE=bspwmrc 9 | 10 | FULL_FILE=$DIR/$FILE 11 | 12 | [[ -e $FULL_FILE ]] && exit 0 13 | 14 | if [[ ! -d $DIR ]]; then 15 | mkdir -p $DIR 16 | fi 17 | 18 | rm -f $FULL_FILE 19 | ln -s $(readlink -f $FILE) $(readlink -f $FULL_FILE) -------------------------------------------------------------------------------- /options/arch/chrome/chrome-flags.conf: -------------------------------------------------------------------------------- 1 | --force-device-scale-factor=1.4 2 | -------------------------------------------------------------------------------- /options/arch/chrome/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config 8 | FILE=chrome-flags.conf 9 | FULL_FILE=$DIR/$FILE 10 | 11 | [[ -e $FULL_FILE ]] && exit 0 12 | 13 | if [[ ! -d $DIR ]]; then 14 | mkdir -p $DIR 15 | fi 16 | rm -f $FULL_FILE 17 | ln -s $(readlink -f $FILE) $(readlink -f $FULL_FILE) 18 | -------------------------------------------------------------------------------- /options/arch/compton/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | FILE=compton.conf 8 | FULL_FILE=~/.${FILE} 9 | 10 | [[ -e $FULL_FILE ]] && exit 0 11 | 12 | rm -f $FULL_FILE 13 | 14 | ln -s $(readlink -f $FILE) $(readlink -f $FULL_FILE) 15 | 16 | -------------------------------------------------------------------------------- /options/arch/compton/other_shadow_compton.conf: -------------------------------------------------------------------------------- 1 | # Shadow 2 | shadow = true; 3 | no-dnd-shadow = true; 4 | no-dock-shadow = false; 5 | clear-shadow = true; 6 | shadow-radius = 7; 7 | shadow-offset-x = -7; 8 | shadow-offset-y = -7; 9 | shadow-opacity = 0.8; 10 | shadow-red = 0.0; 11 | shadow-green = 0.0; 12 | shadow-blue = 0.0; 13 | 14 | shadow-exclude = [ 15 | "class_g = 'Firefox' && argb", 16 | "class_i = 'Telegram' && argb" 17 | ]; 18 | 19 | # shadow-exclude = "n:e:Notification"; 20 | # shadow-exclude-reg = "x10+0+0"; 21 | # xinerama-shadow-crop = true; 22 | 23 | # Opacity 24 | menu-opacity = 0.9; 25 | #inactive-opacity = 0.8; 26 | #active-opacity = 0.8; 27 | #frame-opacity = 0.9; 28 | #inactive-opacity-override = false; 29 | #alpha-step = 0.06; 30 | # inactive-dim = 0.2; 31 | # inactive-dim-fixed = true; 32 | #blur-background = true; 33 | #blur-background-frame = true; 34 | #blur-kern = "3x3box" 35 | # blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1" 36 | # blur-background-fixed = true; 37 | #blur-background-exclude = [ 38 | # "window_type = 'dock'", 39 | # "window_type = 'desktop'", 40 | # "_GTK_FRAME_EXTENTS@:c" 41 | #]; 42 | # opacity-rule = [ 43 | # "93:class_g = 'URxvt'", 44 | # "93:class_g= 'Zathura'", 45 | # "93:class_g= 'qutebrowser'", 46 | # "93:class_g= 'Firefox'", 47 | # "93:class_g= 'Pcmanfm'" 48 | # ]; 49 | 50 | # Fading 51 | fading = true; 52 | # fade-delta = 30; 53 | fade-in-step = 0.03; 54 | fade-out-step = 0.03; 55 | # no-fading-openclose = true; 56 | # no-fading-destroyed-argb = true; 57 | fade-exclude = [ ]; 58 | 59 | # Other 60 | #backend = "xrender" 61 | #mark-wmwin-focused = true; 62 | #mark-ovredir-focused = true; 63 | # use-ewmh-active-win = true; 64 | detect-rounded-corners = true; 65 | detect-client-opacity = true; 66 | refresh-rate = 0; 67 | vsync = "none"; 68 | dbe = false; 69 | paint-on-overlay = true; 70 | # sw-opti = true; 71 | # unredir-if-possible = true; 72 | # unredir-if-possible-delay = 5000; 73 | # unredir-if-possible-exclude = [ ]; 74 | #focus-exclude = [ "class_g = 'Cairo-clock'" ]; 75 | #detect-transient = true; 76 | #detect-client-leader = true; 77 | #invert-color-include = [ ]; 78 | # resize-damage = 1; 79 | 80 | # GLX backend 81 | # glx-no-stencil = true; 82 | #glx-copy-from-front = false; 83 | # glx-use-copysubbuffermesa = true; 84 | # glx-no-rebind-pixmap = true; 85 | #glx-swap-method = "undefined"; 86 | # glx-use-gpushader4 = true; 87 | # xrender-sync = true; 88 | # xrender-sync-fence = true; 89 | 90 | # Window type settings 91 | #wintypes: 92 | #{ 93 | # tooltip = { fade = true; shadow = true; opacity = 0.90; focus = true; }; 94 | #}; 95 | -------------------------------------------------------------------------------- /options/arch/compton/sumpwm_compton_conf.conf: -------------------------------------------------------------------------------- 1 | # Shadow 2 | shadow = true; # Enable shadowing on windows 3 | no-dnd-shadow = true; # Don't draw shadows on DND windows 4 | no-dock-shadow = true; # Don't draw shadows on dock windows 5 | clear-shadow = true; # Zero the part of the shadow's mask behind the window 6 | shadow-radius = 8; # The radius of the shadow blur (default 15) 7 | shadow-offset-x = -8; # The x offset of the shadow blur (default -15) 8 | shadow-offset-y = -8; # The y offset of the shadow blur (default -15) 9 | # shadow-opacity = 0.9; # Opacity of the shadows (default .75) 10 | shadow-opacity = 0.6; # Opacity of the shadows (default .75) 11 | # shadow-exclude = [ "n:e:Notification" ]; # Exclude conditions for shadows 12 | shadow-ignore-shaped = true; 13 | 14 | # Opacity 15 | menu-opacity = 1.0; # Opacity for menus (default 1.0) 16 | inactive-opacity = 1.0; # Opacity for inactive windows (0.1 - 1.0) 17 | inactive-opacity-override = true; # Overrides overall opacity rules 18 | #opacity-rule = [ "99:class_g *= 'Emacs'", "99:class_g *= 'konsole'"]; 19 | opacity-rule = [ "80:class_g *= 'URxvt'", "95:class_g *= 'Emacs'"]; 20 | 21 | # Fading 22 | fading = false; # Fade windows during opacity changes 23 | fade-delta = 10; # The time between steps in milliseconds (default 30) 24 | fade-in-step = 0.1; # Opacity delta when fading in (default 0.028) 25 | fade-out-step = 0.1; # Opacity delta when fading out (default 0.03) 26 | no-fading-openclose = true; # Fade windows in/out when opening/closing 27 | 28 | # Other 29 | mark-wmwin-focused = true; # Tries to detect WM windows and mark as active 30 | mark-ovredir-focused = true; # Overrides focused windows as active 31 | detect-rounded-corners = true; # Tries to detect rounded cornered windows 32 | detect-client-opacity = false; # Detects if the window itself supports transparency 33 | # inactive-dim = 0.5; # Dims inactive windows (0.0 - 1.0, default 0.0) 34 | 35 | blur-background = true; # Blurs transparent background (default false) 36 | blur-background-frame = false; # Blurs transparent frame (default false) 37 | blur-kern = "7x7box" # Blur pattern 38 | 39 | detect-transient = true; 40 | # detect-client-leader = true; 41 | 42 | # GLX (backend) 43 | backend = "glx"; 44 | #vsync = "opengl"; 45 | # dbe = true; 46 | # glx-no-stencil = true; 47 | # glx-copy-from-front = false; 48 | # glx-use-copysubbuffermesa = true; 49 | # glx-no-rebind-pixmap = true; 50 | # glx-swap-method = "undefined"; 51 | # glx-use-gpushader4 = true; 52 | # xrender-sync = true; 53 | # xrender-sync-fence = true; 54 | 55 | # Window type settings 56 | wintypes: 57 | { 58 | tooltip = { fade = true; shadow = false; opacity = 0.90; }; 59 | }; 60 | -------------------------------------------------------------------------------- /options/arch/environment.zsh: -------------------------------------------------------------------------------- 1 | export XDG_CONFIG_HOME="$HOME/.config" 2 | export BSSH_SERVERS_FILE="$HOME/code/sources/secrets/bssh.servers" 3 | 4 | # setting up PATH 5 | CUSTOM_SCRIPTS=~/.dotfiles/scripts/emacs:~/.dotfiles/scripts/vim:~/.dotfiles/scripts/zsh 6 | LINUX_SCRIPTS=~/.options/arch/scripts 7 | CARGO_BIN=~/.cargo/bin 8 | GO_BIN=~/go/bin 9 | HOME_LOCAL_BIN=~/.local/bin 10 | PATH="$CUSTOM_SCRIPTS:$PATH" 11 | PATH="$LINUX_SCRIPTS:$PATH" 12 | PATH="$CARGO_BIN:$PATH" 13 | PATH="$GO_BIN:$PATH" 14 | PATH="$HOME_LOCAL_BIN:$PATH" 15 | export PATH 16 | 17 | # hack stolen from: https://github.com/rust-lang-nursery/rustfmt/issues/1687#issuecomment-308756211 18 | 19 | nvm_config() { 20 | cd $(readlink -f ~/.dotfiles) 21 | cd .. 22 | [[ ! -e secrets/nvm.zsh ]] && return 0 23 | source secrets/nvm.zsh 24 | if [[ -z ${USE_NVM+x} ]] || [[ $USE_NVM = 0 ]]; then 25 | return 0 26 | fi 27 | export NVM_DIR="$HOME/.nvm" 28 | [[ -e $NVM_DIR/nvm.sh ]] && source $NVM_DIR/nvm.sh 29 | } 30 | 31 | curdir=$(pwd -P) 32 | nvm_config 33 | cd $curdir 34 | -------------------------------------------------------------------------------- /options/arch/favorites.zsh: -------------------------------------------------------------------------------- 1 | PROJECT_PATHS=( \ 2 | ~/code/sources/ \ 3 | ~/code/sources/dotfiles \ 4 | ~/code/sources/options \ 5 | ~/code/sources/gtd \ 6 | ~/code/sources/logbook \ 7 | ~/go/src/github.com/ninrod \ 8 | ) 9 | -------------------------------------------------------------------------------- /options/arch/intellij/dont_makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | SYMLINK=/usr/local/bin/idea 8 | TARGET=./idea.sh 9 | 10 | if [[ -e $SYMLINK ]]; then 11 | rm $SYMLINK 12 | fi 13 | 14 | echo "criando $TARGET symlink $SYMLINK" 15 | sudo ln -s $(realpath $TARGET) $SYMLINK 16 | -------------------------------------------------------------------------------- /options/arch/intellij/idea.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | # nohup ~/apps/idea/bin/idea.sh > ~/.logs/idea.log 2>&1 & 5 | # SIGINT fix hack 6 | ( 7 | trap - SIGINT 8 | exec /bin/bash ~/apps/idea/bin/idea.sh 9 | ) & 10 | -------------------------------------------------------------------------------- /options/arch/last_hook.zsh: -------------------------------------------------------------------------------- 1 | # exercism 2 | exercism_completion_file=~/.config/exercism/exercism_completion.zsh 3 | if [ -f $exercism_completion_file ]; then 4 | source $exercism_completion_file 5 | fi 6 | 7 | #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! 8 | export SDKMAN_DIR="/home/ninrod/.sdkman" 9 | [[ -s "/home/ninrod/.sdkman/bin/sdkman-init.sh" ]] && source "/home/ninrod/.sdkman/bin/sdkman-init.sh" -------------------------------------------------------------------------------- /options/arch/polybar/launch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Terminate already running bar instances 4 | killall -q polybar 5 | 6 | # Wait until the processes have been shut down 7 | while pgrep -x polybar >/dev/null; do sleep 1; done 8 | 9 | # Launch bar1 and bar2 10 | polybar example &> /dev/null & 11 | -------------------------------------------------------------------------------- /options/arch/polybar/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config/polybar 8 | FILE=gruvbox.conf 9 | LAUNCHER=launch.sh 10 | SYMLINK=$DIR/config 11 | FULL_LAUNCHER=$DIR/$LAUNCHER 12 | 13 | rm -rf $DIR 14 | mkdir -p $DIR 15 | 16 | ln -sf $(readlink -f $FILE) $(readlink -f $SYMLINK) 17 | ln -sf $(readlink -f $LAUNCHER) $(readlink -f $FULL_LAUNCHER) 18 | 19 | thinkpad_battery_udev_rule() { 20 | local src_dir=$(readlink -f scripts/thinkpad_battery_udev) 21 | local dst_dir=/etc/udev/rules.d 22 | local filename=95-battery.rules 23 | local src_file=$src_dir/$filename 24 | local dst_file=$dst_dir/$filename 25 | if [[ -e $dst_file ]]; then 26 | sudo rm $dst_file 27 | fi 28 | sudo ln -s $src_file $dst_file 29 | } 30 | thinkpad_battery_udev_rule -------------------------------------------------------------------------------- /options/arch/polybar/scripts/spotify.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # lifted from vulgrim: https://github.com/vulgrim/dotfiles/blob/master/.config/polybar/spotify.sh 4 | 5 | prepend_zero () { 6 | seq -f "%02g" $1 $1 7 | } 8 | 9 | artist=$(echo -n $(playerctl metadata artist)) 10 | song=$(echo -n $(playerctl metadata title)) 11 | 12 | echo -n "$artist - $song" -------------------------------------------------------------------------------- /options/arch/polybar/scripts/thinkpad_battery_udev/95-battery.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", \ 2 | RUN+="/home/ninrod/.options/arch/polybar/scripts/thinkpad_battery_udev/battery-combined-udev.sh --update" 3 | SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", \ 4 | RUN+="/home/ninrod/.options/arch/polybar/scripts/thinkpad_battery_udev/battery-combined-udev.sh --update" 5 | -------------------------------------------------------------------------------- /options/arch/polybar/scripts/thinkpad_battery_udev/battery-combined-udev.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # main idea: all that you need to probe battery performance lie in this beautiful file: 4 | # $ cat /sys/class/power_supply/BAT0/uevent 5 | # additional helper files: $ ls /sys/class/power_supply/BAT0 6 | # tip: thinkpads also have BAT1 7 | 8 | format_minutes() { 9 | if (( $1 < 10 )); then 10 | echo "0"$1 11 | return 0 12 | fi 13 | echo $1 14 | } 15 | 16 | battery_print() { 17 | path_ac="/sys/class/power_supply/AC" 18 | path_battery_0="/sys/class/power_supply/BAT0" 19 | path_battery_1="/sys/class/power_supply/BAT1" 20 | 21 | ac=0 22 | battery_level_0=0 23 | battery_level_1=0 24 | battery_max_0=0 25 | battery_max_1=0 26 | 27 | if [ -f "$path_ac/online" ]; then 28 | ac=$(cat "$path_ac/online") 29 | fi 30 | 31 | if [ -f "$path_battery_0/energy_now" ]; then 32 | battery_level_0=$(cat "$path_battery_0/energy_now") 33 | fi 34 | 35 | if [ -f "$path_battery_0/energy_full" ]; then 36 | battery_max_0=$(cat "$path_battery_0/energy_full") 37 | fi 38 | 39 | if [ -f "$path_battery_1/energy_now" ]; then 40 | battery_level_1=$(cat "$path_battery_1/energy_now") 41 | fi 42 | 43 | if [ -f "$path_battery_1/energy_full" ]; then 44 | battery_max_1=$(cat "$path_battery_1/energy_full") 45 | fi 46 | 47 | battery_level=$(("$battery_level_0 + $battery_level_1")) 48 | battery_max=$(("$battery_max_0 + $battery_max_1")) 49 | 50 | battery_percent=$(("$battery_level * 100")) 51 | battery_percent=$(("$battery_percent / $battery_max")) 52 | battery_percent_float=$(bc -l <<< "($battery_level * 100) / $battery_max" | cut -c1-4) 53 | 54 | if [ "$ac" -eq 1 ]; then 55 | icon="" 56 | 57 | if [ "$battery_percent" -gt 97 ]; then 58 | echo "$icon" 59 | else 60 | echo "$icon ${battery_percent}%" 61 | fi 62 | else 63 | if [[ $(cat /sys/class/power_supply/BAT0/power_now) = 0 ]]; then 64 | power=$(cat /sys/class/power_supply/BAT1/power_now) 65 | else 66 | power=$(cat /sys/class/power_supply/BAT0/power_now) 67 | fi 68 | bat0_energy=$(cat /sys/class/power_supply/BAT0/energy_now) 69 | bat1_energy=$(cat /sys/class/power_supply/BAT1/energy_now) 70 | total_energy=$(bc -l <<< "$bat0_energy + $bat1_energy") 71 | hours=$(bc <<< "$total_energy/$power" | cut -c1-4)"hs" 72 | hours_discrete=$(bc <<< "$total_energy/$power") 73 | hours_float=$(bc -l <<< "$total_energy/$power") 74 | minutes=$(echo "scale=0; (($hours_float - $hours_discrete) * 60)/1" | bc) 75 | formatted_minutes=$(format_minutes $minutes) 76 | power_float=$(bc -l <<< "$power/1000000" | cut -c1-4) 77 | remaining=""${hours_discrete}:${formatted_minutes} 78 | 79 | if [ "$battery_percent" -gt 85 ]; then 80 | icon="" 81 | 82 | elif [ "$battery_percent" -gt 60 ]; then 83 | icon="" 84 | elif [ "$battery_percent" -gt 35 ]; then 85 | icon="" 86 | elif [ "$battery_percent" -gt 10 ]; then 87 | icon="" 88 | else 89 | icon="" 90 | fi 91 | echo "$icon ${battery_percent_float}% $remaining ${power_float}" 92 | fi 93 | } 94 | 95 | case "$1" in 96 | --update) 97 | pid=$(pgrep -xf "/bin/sh /home/ninrod/.options/arch/polybar/scripts/thinkpad_battery_udev/battery-combined-udev.sh") 98 | 99 | if [ "$pid" != "" ]; then 100 | kill -10 "$pid" 101 | fi 102 | ;; 103 | *) 104 | trap exit INT 105 | trap "echo" USR1 106 | 107 | while true; do 108 | battery_print 109 | 110 | sleep 3 & 111 | wait 112 | done 113 | ;; 114 | esac 115 | -------------------------------------------------------------------------------- /options/arch/polybar/scripts/thinkpad_battery_udev/readme.md: -------------------------------------------------------------------------------- 1 | # udev thinkpad battery hack 2 | 3 | hack obtained through 4 | [polybar-scripts](https://github.com/x70b1/polybar-scripts/tree/master/polybar-scripts/battery-combined-udev). -------------------------------------------------------------------------------- /options/arch/prompt.zsh: -------------------------------------------------------------------------------- 1 | # prompt config: nice unicode prompt chars: λ , › , ➤ , ∴ , → , ★ , ➜ , ❯, $ 2 | DOT_PROMPT_CHAR="➜" 3 | SHELL_PROMPT_INFO_LEVEL="0" 4 | -------------------------------------------------------------------------------- /options/arch/ranger/commands.py: -------------------------------------------------------------------------------- 1 | # default config: /usr/share/doc/ranger/config/commands.py 2 | import os 3 | 4 | from ranger.api.commands import * 5 | from ranger.core.loader import CommandLoader 6 | 7 | 8 | class fzf_locate(Command): 9 | def execute(self): 10 | import subprocess 11 | command = "locate '*' | fzf +m" 12 | fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) 13 | stdout, stderr = fzf.communicate() 14 | if fzf.returncode == 0: 15 | fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) 16 | if os.path.isdir(fzf_file): 17 | self.fm.cd(fzf_file) 18 | else: 19 | self.fm.select_file(fzf_file) 20 | 21 | 22 | # https://github.com/hut/ranger/wiki/Commands#fzf-integration 23 | class fzf_select(Command): 24 | """ 25 | :fzf_select 26 | Find a file using fzf. 27 | With a prefix argument select only directories. 28 | See: https://github.com/junegunn/fzf 29 | """ 30 | 31 | def execute(self): 32 | import subprocess 33 | if self.quantifier: 34 | # match only directories 35 | command = "find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ 36 | -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" 37 | 38 | else: 39 | # match files and directories 40 | command = "find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ 41 | -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" 42 | 43 | fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) 44 | stdout, stderr = fzf.communicate() 45 | if fzf.returncode == 0: 46 | fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) 47 | if os.path.isdir(fzf_file): 48 | self.fm.cd(fzf_file) 49 | else: 50 | self.fm.select_file(fzf_file) 51 | -------------------------------------------------------------------------------- /options/arch/ranger/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config/ranger 8 | TARGET=. 9 | 10 | if [[ -d $DIR ]]; then 11 | rm -rf $DIR 12 | else 13 | rm -f $DIR 14 | fi 15 | 16 | ln -s $(readlink -f $TARGET) $DIR 17 | -------------------------------------------------------------------------------- /options/arch/ranger/rc.conf: -------------------------------------------------------------------------------- 1 | # set show_hidden true (or just type zh) 2 | 3 | map bd console mkdir%space 4 | map bf console touch%space 5 | -------------------------------------------------------------------------------- /options/arch/readme.org: -------------------------------------------------------------------------------- 1 | * Arch setup ideas 2 | 3 | - write a custom script to show the 2 batteries in polybar through acpi 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /options/arch/redshift/redshift.conf: -------------------------------------------------------------------------------- 1 | ; Global settings for redshift 2 | [redshift] 3 | ; Set the day and night screen temperatures (Neutral is 6500K) 4 | temp-day=5700 5 | temp-night=3000 6 | 7 | ; Enable/Disable a smooth transition between day and night 8 | ; 0 will cause a direct change from day to night screen temperature. 9 | ; 1 will gradually increase or decrease the screen temperature. 10 | transition=0 11 | 12 | ; Set the screen brightness. Default is 1.0. 13 | ;brightness=0.9 14 | ; It is also possible to use different settings for day and night 15 | ; since version 1.8. 16 | ;brightness-day=0.7 17 | ;brightness-night=0.7 18 | ; Set the screen gamma (for all colors, or each color channel 19 | ; individually) 20 | ;gamma=0.8 21 | ;gamma=0.8:0.7:0.8 22 | ; This can also be set individually for day and night since 23 | ; version 1.10. 24 | gamma-day=0.8:0.7:0.8 25 | gamma-night=0.7 26 | 27 | ; Set the location-provider: 'geoclue2' or 'manual' 28 | ; type 'redshift -l list' to see possible values. 29 | ; The location provider settings are in a different section. 30 | ; location-provider=geoclue2 31 | location-provider=manual 32 | 33 | ; Set the adjustment-method: 'randr', 'vidmode' 34 | ; type 'redshift -m list' to see all possible values. 35 | ; 'randr' is the preferred method, 'vidmode' is an older API. 36 | ; but works in some cases when 'randr' does not. 37 | ; The adjustment method settings are in a different section. 38 | adjustment-method=randr 39 | 40 | ; Configuration of the location-provider: 41 | ; type 'redshift -l PROVIDER:help' to see the settings. 42 | ; ex: 'redshift -l manual:help' 43 | ; Keep in mind that longitudes west of Greenwich (e.g. the Americas) 44 | ; are negative numbers. 45 | ;[manual] 46 | ;lat=48.1 47 | ;lon=11.6 48 | 49 | ; Configuration of the adjustment-method 50 | ; type 'redshift -m METHOD:help' to see the settings. 51 | ; ex: 'redshift -m randr:help' 52 | ; In this example, randr is configured to adjust screen 1. 53 | ; Note that the numbering starts from 0, so this is actually the 54 | ; second screen. If this option is not specified, Redshift will try 55 | ; to adjust _all_ screens. 56 | [randr] 57 | screen=0 58 | 59 | [manual] 60 | lat=15.826 61 | lon=47.922 -------------------------------------------------------------------------------- /options/arch/refind/refind.conf: -------------------------------------------------------------------------------- 1 | timeout 1 2 | 3 | scanfor manual 4 | 5 | menuentry "Arch Linux" { 6 | icon /EFI/refind/icons/os_arch.png 7 | volume ESP 8 | loader /vmlinuz-linux 9 | initrd /initramfs-linux.img /intel-ucode.img 10 | options "root=PARTLABEL=SLASH rw add_efi_memmap" 11 | submenuentry "Boot using fallback initramfs" { 12 | initrd /boot/initramfs-linux-fallback.img 13 | } 14 | submenuentry "Boot to terminal" { 15 | add_options "systemd.unit=multi-user.target" 16 | } 17 | enabled 18 | } 19 | 20 | -------------------------------------------------------------------------------- /options/arch/refind/refind_linux.conf: -------------------------------------------------------------------------------- 1 | "Boot with standard options" "root=/dev/nvme0n1p3 rw add_efi_memmap" 2 | "Boot to single-user mode" "root=/dev/nvme0n1p3 rw add_efi_memmap initrd=/boot/initramfs-linux-fallback.img" 3 | "Boot with minimal options" "root=/dev/nvme0n1p3 rw add_efi_memmap systemd.unit=multi-user.target" 4 | -------------------------------------------------------------------------------- /options/arch/scripts/julicloud.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | # first, go to mycloud and export the share as NFS 5 | # then, uncover the shares with: showmount -e server 6 | 7 | # if lsmod | grep nfs does not return 0, you may have updgraded the kernel. reboot. 8 | # you can test this with modprobe nfs 9 | 10 | cloud_filipe=~/julicloud/filipe 11 | cloud_eve=~/julicloud/eve 12 | cloud_public=~/julicloud/public 13 | 14 | mkdir -p $cloud_filipe 15 | mkdir -p $cloud_eve 16 | mkdir -p $cloud_public 17 | 18 | sudo mount julicloud:/mnt/HD/HD_a2/filipe $cloud_filipe 19 | sudo mount julicloud:/mnt/HD/HD_a2/Public $cloud_public 20 | sudo mount julicloud:/mnt/HD/HD_a2/eve $cloud_eve 21 | -------------------------------------------------------------------------------- /options/arch/scripts/passmenu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # obtained from: 4 | # https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu 5 | 6 | shopt -s nullglob globstar 7 | 8 | typeit=0 9 | if [[ $1 == "--type" ]]; then 10 | typeit=1 11 | shift 12 | fi 13 | 14 | prefix=${PASSWORD_STORE_DIR-~/.password-store} 15 | password_files=( "$prefix"/**/*.gpg ) 16 | password_files=( "${password_files[@]#"$prefix"/}" ) 17 | password_files=( "${password_files[@]%.gpg}" ) 18 | 19 | # original line 20 | # password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@") 21 | 22 | password=$(printf '%s\n' "${password_files[@]}" | dmenu -fn "Office Code Pro-12:normal" -nb "#32302f" -nf "#ebdbb2" -sb "#0a0814" -sf "#fe8019" -p ">" "$@") 23 | 24 | [[ -n $password ]] || exit 25 | 26 | if [[ $typeit -eq 0 ]]; then 27 | pass show -c "$password" 2>/dev/null 28 | else 29 | pass show "$password" | { read -r pass; printf %s "$pass"; } | 30 | xdotool type --clearmodifiers --file - 31 | fi 32 | 33 | -------------------------------------------------------------------------------- /options/arch/scripts/s8/mount-galaxy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # $ adb devices 4 | # List of devices attached 5 | # ce0917199c15b0700d device 6 | verify_galaxys8_connected() { 7 | adb devices | grep ce0917199c15b0700d > /dev/null 8 | if [ $? -eq 0 ]; then 9 | echo "Galaxy S8 Connected!" 10 | else 11 | echo "Galaxy S8 DISCONNECTED! Aborting." 12 | exit 1 13 | fi 14 | } 15 | 16 | verify_galaxys8_locked() { 17 | string='SCREEN_BRIGHT_WAKE_LOCK' 18 | adb shell dumpsys power | grep $string 19 | 20 | if [ $? -eq 0 ]; then 21 | echo "Device is Locked. Unlock it first!" 22 | exit 1 23 | else 24 | echo "Device is unlocked!" 25 | fi 26 | } 27 | 28 | verify_galaxys8_connected 29 | verify_galaxys8_locked 30 | 31 | MOUNT_POINT=~/s8 32 | mkdir -p $MOUNT_POINT 33 | aft-mtp-mount $MOUNT_POINT 34 | 35 | if [ $? -eq 0 ]; then 36 | echo "Command succeeded." 37 | else 38 | echo "Command Failed. Verify Phone Permission Dialog and try again." 39 | exit 1 40 | fi -------------------------------------------------------------------------------- /options/arch/scripts/s8/umount-galaxy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo umount ~/s8 4 | rm -r ~/s8 -------------------------------------------------------------------------------- /options/arch/scripts/terminal/bssh.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # bssh: fuzzy ssh chooser 4 | # credits: original hack by @marvinbelfort 5 | 6 | set -euo pipefail 7 | 8 | if [[ ! -f $BSSH_SERVERS_FILE ]]; then 9 | echo "[bssh]-> ERROR: no $BSSH_SERVERS_FILE file found." 10 | exit 0 11 | fi 12 | 13 | description=$(cat $BSSH_SERVERS_FILE | fzf) 14 | server=$(echo $description | cut -d "-" -f1) 15 | 16 | if [[ ! -z $server ]]; then 17 | # ping $server 18 | ssh $server -o ServerAliveInterval=5 -o ServerAliveCountMax=1 19 | fi 20 | 21 | # to copy your public key to a server 22 | # ssh-copy-id -i ~/.ssh/id_rsa.pub user@host 23 | -------------------------------------------------------------------------------- /options/arch/scripts/thinkpad/battery.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # stolen from polybar-scripts: 4 | # https://github.com/x70b1/polybar-scripts/blob/master/polybar-scripts/battery-combined-tlp/battery-combined-tlp.sh 5 | 6 | battery=$(sudo tlp-stat -b | tail -2 | head -n 1 | tr -d -c "[:digit:],.") 7 | 8 | echo  $battery % -------------------------------------------------------------------------------- /options/arch/scripts/vconsole/fixfonts.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # terminus font 4 | setfont ter-228b 5 | -------------------------------------------------------------------------------- /options/arch/setup.zsh: -------------------------------------------------------------------------------- 1 | # dir tracker setup 2 | [[ ! -e $DIR_HISTORY ]] && echo $HOME > $DIR_HISTORY 3 | 4 | # symlinkage 5 | source ~/.options/arch/symlinks.zsh 6 | 7 | # arch specific java nuisance 8 | # wmname LG3D 9 | -------------------------------------------------------------------------------- /options/arch/sxhkd/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config/sxhkd 8 | FILE=sxhkdrc 9 | FULL_FILE=$DIR/$FILE 10 | 11 | [[ -e $FULL_FILE ]] && exit 0 12 | 13 | if [[ ! -d $DIR ]]; then 14 | mkdir -p $DIR 15 | fi 16 | rm -f $FULL_FILE 17 | ln -s $(readlink -f $FILE) $(readlink -f $FULL_FILE) 18 | -------------------------------------------------------------------------------- /options/arch/sxhkd/sxhkdrc: -------------------------------------------------------------------------------- 1 | # -*- mode: sxhkd -*- 2 | 3 | # ------------------- screen lock --------------- 4 | super + l 5 | physlock 6 | 7 | # ------------------- brightness settings --------------- 8 | XF86MonBrightnessUp 9 | xbacklight -inc 10 10 | XF86MonBrightnessDown 11 | xbacklight -dec 10 12 | 13 | # ------------------- system volume --------------------- 14 | #also ensures audio is enabled 15 | XF86AudioRaiseVolume 16 | amixer -q set Master 10%+ on 17 | 18 | # Lower volume 19 | XF86AudioLowerVolume 20 | amixer -q set Master 10%- 21 | 22 | # toggle audio 23 | XF86AudioMute 24 | pactl set-sink-mute 0 toggle 25 | # amixer -q set Master off 26 | 27 | # ----------------------- Apps ------------------- 28 | alt + Return 29 | xfce4-terminal 30 | ctrl + Escape 31 | emacsclient --create-frame 32 | ctrl + alt + Escape 33 | restart-emacs-daemon.sh 34 | 35 | # https://askubuntu.com/questions/978226/how-to-make-touch-screen-scrolling-work-in-firefox-quantum 36 | ctrl + i 37 | MOZ_USE_XINPUT2=1 firefox 38 | 39 | alt + i 40 | google-chrome-stable 41 | 42 | ctrl + m 43 | spotify --force-device-scale-factor=1.4 44 | 45 | Print 46 | maim -d 3 ~/Downloads/screenshot.png 47 | ctrl + Print 48 | maim -s ~/Downloads/screenshot.png 49 | 50 | # -------------------------- rofi -------------------------- 51 | alt + space 52 | rofi -theme gruvbox-dark-hard -show run 53 | 54 | alt + Tab 55 | rofi -show window 56 | 57 | # stolen from: https://www.reddit.com/r/unixporn/comments/5mszii/greenclip_simple_clipboard_manager_integrated/ 58 | alt + c 59 | rofi -modi "clipboard:greenclip print" -show clipboard 60 | 61 | # -------------------------- BSPWM -------------------------- 62 | # focus the last node/desktop 63 | # ???? bspc {node,desktop} -f last 64 | 65 | # make sxhkd reload its configuration files: 66 | super + Escape 67 | pkill -USR1 -x sxhkd 68 | 69 | # quit bspwm normally 70 | super + alt + Escape 71 | bspc quit 72 | 73 | # close and kill 74 | ctrl + {_,shift + }q 75 | bspc node --{close,kill} 76 | 77 | # alternate between the tiled and monocle layout 78 | super + m 79 | bspc desktop -l next 80 | 81 | # if the current node is automatic, send it to the last manual, otherwise pull the last leaf 82 | super + y 83 | bspc query -N -n focused.automatic && bspc node -n last.!automatic || bspc node last.leaf -n focused 84 | 85 | # swap the current node and the biggest node 86 | super + g 87 | bspc node -s biggest 88 | 89 | # state/flags 90 | 91 | # set the window state 92 | super + {t,shift + t,s,f} 93 | bspc node -t {tiled,pseudo_tiled,floating,fullscreen} 94 | 95 | # set the node flags 96 | super + ctrl + {x,y,z} 97 | bspc node -g {locked,sticky,private} 98 | 99 | # -------------------------- focus/swap -------------------------- 100 | alt + {1-9,0} 101 | bspc desktop -f {1-9,0} 102 | ctrl + {1-9,0} 103 | bspc desktop -f {1-9,0} 104 | 105 | # focus or send to the given desktop 106 | 107 | # super + shift {1-9,0} 108 | # bspc node -d '^{1-9,10}' 109 | 110 | super + shift {1-5,8,9,0} 111 | bspc node -d {1-5,8,9,0} 112 | 113 | # focus the node in the given direction 114 | alt + {_,shift + }{h,j,k,l} 115 | bspc node -{f,s} {west,south,north,east} 116 | 117 | # focus the node for the given path jump 118 | super + {p,b,comma,period} 119 | bspc node -f @{parent,brother,first,second} 120 | 121 | # focus the next/previous node 122 | super + {_,shift + }c 123 | bspc node -f {next,prev} 124 | 125 | # focus the next/previous desktop 126 | # super + bracket{left,right} 127 | # alt + {p,n} 128 | # bspc desktop -f {prev,next} 129 | 130 | # focus the older or newer node in the focus history 131 | super + {o,i} 132 | bspc wm -h off; \ 133 | bspc node {older,newer} -f; \ 134 | bspc wm -h on 135 | 136 | 137 | # ----------------------------- preselect -------------------------- 138 | # preselect the direction 139 | super + ctrl + {h,j,k,l} 140 | bspc node -p {west,south,north,east} 141 | 142 | # preselect the ratio 143 | super + ctrl + {1-9} 144 | bspc node -o 0.{1-9} 145 | 146 | # cancel the preselection for the focused node 147 | super + ctrl + space 148 | bspc node -p cancel 149 | 150 | # cancel the preselection for the focused desktop 151 | super + ctrl + shift + space 152 | bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel 153 | 154 | # -------------------------- move/resize -------------------------- 155 | # expand a window by moving one of its side outward 156 | super + alt + {h,j,k,l} 157 | bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} 158 | 159 | # contract a window by moving one of its side inward 160 | super + alt + shift + {h,j,k,l} 161 | bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} 162 | 163 | # move a floating window 164 | super + {Left,Down,Up,Right} 165 | bspc node -v {-20 0,0 20,0 -20,20 0} 166 | -------------------------------------------------------------------------------- /options/arch/symlinks.zsh: -------------------------------------------------------------------------------- 1 | for file in ~/.options/arch/**/makelink.zsh; do 2 | $file 3 | done 4 | -------------------------------------------------------------------------------- /options/arch/systemd/lock_if_unlocked.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if pgrep -x physlock; then 4 | echo "physlock already running, nothing to do" 5 | exit 0 6 | fi 7 | 8 | physlock -d 9 | -------------------------------------------------------------------------------- /options/arch/systemd/suspend@ninrod.service: -------------------------------------------------------------------------------- 1 | # 01: place this file in /etc/systemd/system 2 | # 02: sudo systemctl enable suspend@ninrod.service 3 | # 03: sudo systemctl start suspend@ninrod.service 4 | 5 | [Unit] 6 | Description=User suspend actions 7 | Before=suspend.target 8 | 9 | [Service] 10 | User=ninrod 11 | Type=forking 12 | Environment=DISPLAY=:0 13 | ExecStart=/home/ninrod/.options/arch/systemd/lock_if_unlocked.sh 14 | 15 | [Install] 16 | WantedBy=suspend.target -------------------------------------------------------------------------------- /options/arch/termite/config: -------------------------------------------------------------------------------- 1 | [options] 2 | font = Iosevka Term 16 3 | 4 | [colors] 5 | # hard contrast: 6 | background = #1d2021 7 | # background = #282828 8 | 9 | # soft contrast: background = #32302f 10 | foreground = #ebdbb2 11 | foreground_bold = #ebdbb2 12 | 13 | # dark0 + gray 14 | color0 = #282828 15 | color8 = #928374 16 | 17 | # neutral_red + bright_red 18 | color1 = #cc241d 19 | color9 = #fb4934 20 | 21 | # neutral_green + bright_green 22 | color2 = #98971a 23 | color10 = #b8bb26 24 | 25 | # neutral_yellow + bright_yellow 26 | color3 = #d79921 27 | color11 = #fabd2f 28 | 29 | # neutral_blue + bright_blue 30 | color4 = #458588 31 | color12 = #83a598 32 | 33 | # neutral_purple + bright_purple 34 | color5 = #b16286 35 | color13 = #d3869b 36 | 37 | # neutral_aqua + faded_aqua 38 | color6 = #689d6a 39 | color14 = #8ec07c 40 | 41 | # light4 + light1 42 | color7 = #a89984 43 | color15 = #ebdbb2 44 | 45 | # vim: ft=dosini cms=#%s 46 | -------------------------------------------------------------------------------- /options/arch/termite/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config/ 8 | LINK=~/.config/termite 9 | 10 | [[ -h $LINK ]] && exit 0 11 | 12 | if [[ ! -h $LINK ]] && [[ -d $LINK ]]; then 13 | rm -r $LINK 14 | fi 15 | 16 | if [[ ! -d $DIR ]]; then 17 | mkdir -p $DIR 18 | fi 19 | 20 | ln -s $(readlink -f .) $(readlink -f $LINK) 21 | 22 | -------------------------------------------------------------------------------- /options/arch/vconsole/rebinds.map: -------------------------------------------------------------------------------- 1 | keycode 58 = Escape 2 | 3 | keymaps 0-15 4 | keycode 100 = Control 5 | 6 | -------------------------------------------------------------------------------- /options/arch/vconsole/vconsole.conf: -------------------------------------------------------------------------------- 1 | KEYMAP=us-acentos 2 | FONT=ter-228b 3 | -------------------------------------------------------------------------------- /options/arch/xchainkeys/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | 6 | DIR=~/.config/xchainkeys 7 | FILE=xchainkeys.conf 8 | FULL_FILE=$DIR/$FILE 9 | 10 | [[ -e $FULL_FILE ]] && exit 0 11 | 12 | if [[ ! -d $DIR ]]; then 13 | mkdir -p $DIR 14 | fi 15 | rm -f $FULL_FILE 16 | ln -s $(readlink -f $FILE) $(readlink -f $FULL_FILE) 17 | -------------------------------------------------------------------------------- /options/arch/xchainkeys/xchainkeys.conf: -------------------------------------------------------------------------------- 1 | # chain options 2 | timeout 3000 # timeout chain after 3 seconds of inactivity 3 | 4 | # feedback options 5 | feedback on # enable feedback 6 | delay 1000 # display current key combination after 1 second of inactivity 7 | hold 1000 # display error messages for 1 second 8 | position center # center feedback window 9 | 10 | font fixed # use the font "fixed" for the popup window 11 | foreground black # black text and border 12 | background white # white background 13 | 14 | # keybindings 15 | 16 | M-BackSpace :enter 17 | M-BackSpace r :reload 18 | M-BackSpace C-g :abort 19 | M-BackSpace t :exec st 20 | -------------------------------------------------------------------------------- /options/arch/xfce4-terminal/accels.scm: -------------------------------------------------------------------------------- 1 | ; xfce4-terminal GtkAccelMap rc-file -*- scheme -*- 2 | ; this file is an automated accelerator map dump 3 | ; 4 | (gtk_accel_path "/terminal-window/goto-tab-4" "4") 5 | (gtk_accel_path "/terminal-window/goto-tab-3" "3") 6 | ; (gtk_accel_path "/terminal-window/file-menu" "") 7 | ; (gtk_accel_path "/terminal-window/close-other-tabs" "") 8 | ; (gtk_accel_path "/terminal-window/search" "f") 9 | ; (gtk_accel_path "/terminal-window/next-tab" "Page_Down") 10 | (gtk_accel_path "/terminal-window/goto-tab-1" "1") 11 | ; (gtk_accel_path "/terminal-window/show-menubar" "") 12 | ; (gtk_accel_path "/terminal-window/zoom-reset" "0") 13 | ; (gtk_accel_path "/terminal-window/terminal-menu" "") 14 | ; (gtk_accel_path "/terminal-window/close-window" "q") 15 | ; (gtk_accel_path "/terminal-window/close-tab" "w") 16 | ; (gtk_accel_path "/terminal-window/save-contents" "") 17 | ; (gtk_accel_path "/terminal-window/new-tab" "t") 18 | ; (gtk_accel_path "/terminal-window/view-menu" "") 19 | ; (gtk_accel_path "/terminal-window/show-toolbar" "") 20 | ; (gtk_accel_path "/terminal-window/paste" "v") 21 | ; (gtk_accel_path "/terminal-window/copy" "c") 22 | ; (gtk_accel_path "/terminal-window/edit-menu" "") 23 | ; (gtk_accel_path "/terminal-window/fullscreen" "F11") 24 | ; (gtk_accel_path "/terminal-window/read-only" "") 25 | ; (gtk_accel_path "/terminal-window/detach-tab" "d") 26 | (gtk_accel_path "/terminal-window/goto-tab-2" "2") 27 | (gtk_accel_path "/terminal-window/goto-tab-5" "5") 28 | ; (gtk_accel_path "/terminal-window/prev-tab" "Page_Up") 29 | ; (gtk_accel_path "/terminal-window/move-tab-left" "Page_Up") 30 | ; (gtk_accel_path "/terminal-window/zoom-in" "plus") 31 | ; (gtk_accel_path "/terminal-window/search-prev" "") 32 | ; (gtk_accel_path "/terminal-window/reset-and-clear" "") 33 | ; (gtk_accel_path "/terminal-window/about" "") 34 | ; (gtk_accel_path "/terminal-window/search-next" "") 35 | ; (gtk_accel_path "/terminal-window/toggle-menubar" "") 36 | (gtk_accel_path "/terminal-window/goto-tab-7" "7") 37 | ; (gtk_accel_path "/terminal-window/select-all" "a") 38 | ; (gtk_accel_path "/terminal-window/help-menu" "") 39 | (gtk_accel_path "/terminal-window/goto-tab-9" "9") 40 | ; (gtk_accel_path "/terminal-window/show-borders" "") 41 | ; (gtk_accel_path "/terminal-window/preferences" "") 42 | (gtk_accel_path "/terminal-window/goto-tab-6" "6") 43 | (gtk_accel_path "/terminal-window/contents" "") 44 | ; (gtk_accel_path "/terminal-window/new-window" "n") 45 | ; (gtk_accel_path "/terminal-window/move-tab-right" "Page_Down") 46 | ; (gtk_accel_path "/terminal-window/zoom-out" "minus") 47 | ; (gtk_accel_path "/terminal-window/set-title" "s") 48 | ; (gtk_accel_path "/terminal-window/paste-selection" "") 49 | ; (gtk_accel_path "/terminal-window/undo-close-tab" "") 50 | (gtk_accel_path "/terminal-window/goto-tab-8" "8") 51 | ; (gtk_accel_path "/terminal-window/zoom-menu" "") 52 | ; (gtk_accel_path "/terminal-window/reset" "") 53 | ; (gtk_accel_path "/terminal-window/tabs-menu" "") 54 | -------------------------------------------------------------------------------- /options/arch/xfce4-terminal/colorschemes/gruvbox-dark.theme: -------------------------------------------------------------------------------- 1 | [Scheme] 2 | Name=Gruvbox (dark) 3 | ColorForeground=#f2f2e5e5bcbc 4 | ColorBackground=#323230302f2f 5 | ColorCursor=#d65bc4cd8ca1 6 | ColorPalette=#323230302f2f;#cccc24241d1d;#989897971a1a;#d7d799992121;#454585858888;#b1b162628686;#68689d9d6a6a;#f2f2e5e5bcbc;#1d1d20202121;#fbfb49493434;#b8b8bbbb2626;#fafabdbd2f2f;#8383a5a59898;#d3d386869b9b;#8e8ec0c07c7c;#fffff1f1c6c6 7 | -------------------------------------------------------------------------------- /options/arch/xfce4-terminal/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config/xfce4 8 | LINK=~/.config/xfce4/terminal 9 | 10 | [[ -h $LINK ]] && exit 0 11 | 12 | if [[ ! -h $LINK ]] && [[ -d $LINK ]]; then 13 | rm -r $LINK 14 | fi 15 | 16 | if [[ ! -d $DIR ]]; then 17 | mkdir -p $DIR 18 | fi 19 | 20 | ln -s $(readlink -f .) $(readlink -f $LINK) 21 | -------------------------------------------------------------------------------- /options/arch/xfce4-terminal/terminalrc: -------------------------------------------------------------------------------- 1 | [Configuration] 2 | FontName=Fantasque Sans Mono 17 3 | MiscAlwaysShowTabs=FALSE 4 | MiscBell=FALSE 5 | MiscBellUrgent=FALSE 6 | MiscBordersDefault=TRUE 7 | MiscCursorBlinks=FALSE 8 | MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK 9 | MiscDefaultGeometry=80x24 10 | MiscInheritGeometry=FALSE 11 | MiscMenubarDefault=FALSE 12 | MiscMouseAutohide=FALSE 13 | MiscMouseWheelZoom=TRUE 14 | MiscToolbarDefault=FALSE 15 | MiscConfirmClose=TRUE 16 | MiscCycleTabs=TRUE 17 | MiscTabCloseButtons=TRUE 18 | MiscTabCloseMiddleClick=TRUE 19 | MiscTabPosition=GTK_POS_TOP 20 | MiscHighlightUrls=TRUE 21 | MiscMiddleClickOpensUri=FALSE 22 | MiscCopyOnSelect=FALSE 23 | MiscDefaultWorkingDir= 24 | MiscRewrapOnResize=TRUE 25 | MiscUseShiftArrowsToScroll=FALSE 26 | MiscSlimTabs=FALSE 27 | ColorForeground=#f2f2e5e5bcbc 28 | ColorBackground=#1d1d20202121 29 | ColorCursor=#d65bc4cd8ca1 30 | ColorPalette=rgb(29,32,33);rgb(204,36,29);rgb(152,151,26);rgb(215,153,33);rgb(69,133,136);rgb(177,98,134);rgb(104,157,106);rgb(242,229,188);rgb(29,32,33);rgb(251,73,52);rgb(184,187,38);rgb(250,189,47);rgb(131,165,152);rgb(211,134,155);rgb(142,192,124);rgb(255,241,198) 31 | ScrollingUnlimited=TRUE 32 | ShortcutsNoHelpkey=TRUE 33 | ShortcutsNoMenukey=TRUE 34 | ShortcutsNoMnemonics=TRUE 35 | MiscNewTabAdjacent=FALSE 36 | ScrollingBar=TERMINAL_SCROLLBAR_NONE 37 | 38 | -------------------------------------------------------------------------------- /options/arch/xorg/30-touchpad.conf: -------------------------------------------------------------------------------- 1 | 2 | Section "InputClass" 3 | Identifier "libinput touchpad catchall" 4 | MatchIsTouchpad "on" 5 | MatchDevicePath "/dev/input/event*" 6 | Driver "libinput" 7 | Option "Tapping" "on" 8 | EndSection 9 | -------------------------------------------------------------------------------- /options/arch/xorg/Xmodmap.xorg: -------------------------------------------------------------------------------- 1 | ! -*- mode: xmodmap -*- 2 | 3 | ! capslock now is escape 4 | remove Lock = Caps_Lock 5 | keysym Caps_Lock = Escape 6 | add Lock = Caps_Lock 7 | 8 | ! Right Alt is Right Control 9 | remove Mod1 = Alt_R 10 | keycode 108 = Control_R 11 | add Control = Control_R 12 | -------------------------------------------------------------------------------- /options/arch/xorg/Xresources.xorg: -------------------------------------------------------------------------------- 1 | ! uncomment for transparent terminal if you are ready to be made fun of in #rice 2 | ! URxvt.transparent: true 3 | ! URxvt.shading: 15 4 | 5 | ! make otf / ttf fonts look pretty. does not matter if you are using a bitmap font. 6 | Xft.autohint: 0 7 | Xft.lcdfilter: lcddefault 8 | Xft.hintstyle: hintfull 9 | Xft.hinting: 1 10 | Xft.antialias: 1 11 | Xft.rgba: rgb 12 | 13 | ! colors 14 | *.cursorColor: #ebdbb2 15 | 16 | ! hard contrast: *background: #1d2021 17 | *.background: #1d2021 18 | ! soft contrast: *background: #32302f 19 | *.foreground: #ebdbb2 20 | ! Black + DarkGrey 21 | *.color0: #282828 22 | *.color8: #928374 23 | ! DarkRed + Red 24 | *.color1: #cc241d 25 | *.color9: #fb4934 26 | ! DarkGreen + Green 27 | *.color2: #98971a 28 | *.color10: #b8bb26 29 | ! DarkYellow + Yellow 30 | *.color3: #d79921 31 | *.color11: #fabd2f 32 | ! DarkBlue + Blue 33 | *.color4: #458588 34 | *.color12: #83a598 35 | ! DarkMagenta + Magenta 36 | *.color5: #b16286 37 | *.color13: #d3869b 38 | ! DarkCyan + Cyan 39 | *.color6: #689d6a 40 | *.color14: #8ec07c 41 | ! LightGrey + White 42 | *.color7: #a89984 43 | *.color15: #ebdbb2 44 | ! for 256 color stuff 45 | *.color24: #076678 46 | *.color66: #427b58 47 | *.color88: #9d0006 48 | *.color96: #8f3f71 49 | *.color100: #79740e 50 | *.color108: #8ec07c 51 | *.color109: #83a598 52 | *.color130: #af3a03 53 | *.color136: #b57614 54 | *.color142: #b8bb26 55 | *.color167: #fb4934 56 | *.color175: #d3869b 57 | *.color208: #fe8019 58 | *.color214: #fabd2f 59 | *.color223: #ebdbb2 60 | *.color228: #f4e8ba 61 | *.color229: #fdf4c1 62 | *.color230: #ffffc8 63 | *.color234: #1d2021 64 | *.color235: #282828 65 | *.color236: #32302f 66 | *.color237: #3c3836 67 | *.color239: #504945 68 | *.color241: #665c54 69 | *.color243: #7c6f64 70 | *.color244: #928374 71 | *.color245: #928374 72 | *.color246: #a89984 73 | *.color248: #bdae93 74 | *.color250: #d5c4a1 75 | 76 | ! These are all possible options, presented with default values. 77 | ! xst will fallback to *.option if st.option is not present. 78 | ! see src/config.h for more information about option meanings. 79 | 80 | ! These options only take effect on startup. 81 | st.termname: xterm-256color 82 | ! if you do not set shell, precedence is: -e arg, utmp option, SHELL env var, /etc/passwd shell 83 | st.shell: /bin/zsh 84 | 85 | ! The following options options can be reloaded via USR1 signal. 86 | st.font: Iosevka:pixelsize=21:antialias=true:autohint=true; 87 | st.borderpx: 1 88 | ! Available cursor values: 2 4 6 7 = █ _ | ☃ ( 1 3 5 are blinking versions) 89 | st.cursorshape: 2 90 | st.cursorthickness: 2 91 | st.cursorblinkstyle: 0 92 | st.cursorblinkontype: 0 93 | st.bold_font: 0 94 | st.xfps: 120 95 | st.actionfps: 30 96 | st.chscale: 1.0 97 | st.cwscale: 1.0 98 | st.blinktimeout: 200 99 | st.bellvolume: 100 100 | ! this is a char that is exposed like so: `printf '\033[z'` 101 | st.prompt_char: $ 102 | 103 | ! opacity==255 means what terminal will be not transparent, 0 - fully transparent 104 | st.opacity: 230 105 | -------------------------------------------------------------------------------- /options/arch/xorg/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | update_link() { 8 | local file=$1 9 | local deploy=$2 10 | [[ -e $deploy ]] && return 0 11 | ln -sf $(readlink -f $file) $deploy 12 | } 13 | 14 | update_link Xmodmap.xorg ~/.Xmodmap 15 | update_link Xresources.xorg ~/.Xresources 16 | update_link Xresources.xorg ~/.Xdefaults 17 | update_link xinitrc.xorg ~/.xinitrc -------------------------------------------------------------------------------- /options/arch/xorg/readme.org: -------------------------------------------------------------------------------- 1 | * xmodmap and xev 2 | - tips stolen from [[xahlee.info/linux/linux_xmodmap_tutorial.html][Xah's xmodmap tutorial]] 3 | - use the =xev= tool to discover what the keycodes are 4 | - run only =xmodmap= to discover what are your current modifier configuration 5 | * capslock trick 6 | - run this in gnome 7 | #+BEGIN_SRC sh 8 | use xevdconf write /org/gnome/desktop/input-sources/xkb-options "['caps:escape']" 9 | #+END_SRC -------------------------------------------------------------------------------- /options/arch/xorg/xinitrc.xorg: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | 3 | # bootstrap bspwm 4 | exec bspwm 5 | -------------------------------------------------------------------------------- /options/arch/yay/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "buildDir": "/home/ninrod/.cache/yay/", 3 | "editor": "", 4 | "makepkgbin": "/usr/bin/makepkg", 5 | "pacmanbin": "/usr/bin/pacman", 6 | "pacmanconf": "/etc/pacman.conf", 7 | "tarbin": "/usr/bin/bsdtar", 8 | "requestsplitn": 150, 9 | "sortmode": 0, 10 | "timeupdate": false, 11 | "noconfirm": false, 12 | "devel": false, 13 | "cleanAfter": false 14 | } -------------------------------------------------------------------------------- /options/arch/yay/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | LINK=~/.config/yay 8 | 9 | [[ -h $LINK ]] && exit 0 10 | 11 | if [[ ! -h $LINK ]] && [[ -d $LINK ]]; then 12 | rm -r $LINK 13 | fi 14 | 15 | ln -s $(realpath .) $(realpath $LINK) 16 | -------------------------------------------------------------------------------- /options/arch/yay/yay_vcs.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pkgname": "sxlock-git", 4 | "url": "https://api.github.com/repos/lahwaacz/sxlock/branches", 5 | "sha": "76ac317e05e705d6331bb69592bb7412b294050c" 6 | }, 7 | { 8 | "pkgname": "polybar-git", 9 | "url": "https://api.github.com/repos/jaagr/polybar/branches", 10 | "sha": "0fd614b0a92efceda40086d592a2426af5afe988" 11 | }, 12 | { 13 | "pkgname": "go-mtpfs-git", 14 | "url": "https://api.github.com/repos/hanwen/go-mtpfs", 15 | "sha": "d6f8f3c05ce0ed31435057ec342268a0735863bb" 16 | }, 17 | { 18 | "pkgname": "tamzen-font-git", 19 | "url": "https://api.github.com/repos/sunaku/tamzen-font", 20 | "sha": "047976a00514c7082dc4ad296d4293c096deb8a3" 21 | }, 22 | { 23 | "pkgname": "phallus-fonts-git", 24 | "url": "https://api.github.com/repos/phallus/fonts", 25 | "sha": "83589de5b4b1134b89bfa9663686e5288ebe9131" 26 | }, 27 | { 28 | "pkgname": "gdm3setup-utils", 29 | "url": "https://api.github.com/repos/Nano77/various", 30 | "sha": "f3b9c877bce8121adb3711b2ebfb8b8ede8e9a7f" 31 | }, 32 | { 33 | "pkgname": "polybar", 34 | "url": "https://api.github.com/repos/jaagr/polybar", 35 | "sha": "258f55a5ff59cd43274954fc0caf27ed5a457508" 36 | }, 37 | { 38 | "pkgname": "siji-git", 39 | "url": "https://api.github.com/repos/stark/siji", 40 | "sha": "9d88311bb127b21672b2d4b43eed1ab0e494f143" 41 | }, 42 | { 43 | "pkgname": "pgcli-git", 44 | "url": "https://api.github.com/repos/amjith/pgcli", 45 | "sha": "cde420e271c3a00312431784559b45c12681491a" 46 | } 47 | ] -------------------------------------------------------------------------------- /options/deploy.zsh: -------------------------------------------------------------------------------- 1 | option_symlink() { 2 | local OPTIONS_LINK=~/.options 3 | 4 | echo "removing $OPTIONS_LINK" 5 | if [[ -f $OPTIONS_LINK ]] || [[ -h $OPTIONS_LINK ]]; then 6 | rm -f $OPTIONS_LINK 7 | elif [[ -d $OPTIONS_LINK ]]; then 8 | rm -rf $OPTIONS_LINK 9 | fi 10 | 11 | local ALTERNATIVE_OPTIONS=$(cd $SCRIPTPATH; cd ../../; realpath options) 12 | if [[ -e $ALTERNATIVE_OPTIONS ]]; then 13 | echo "symlinking alternative options. Using $ALTERNATIVE_OPTIONS configuration." 14 | ln -s $ALTERNATIVE_OPTIONS $OPTIONS_LINK 15 | return 0 16 | fi 17 | 18 | local abscur=$(cd $GIT_ROOT/options; realpath .) 19 | echo "symlinking default options. Using $abscur configuration." 20 | ln -s $abscur $OPTIONS_LINK 21 | } 22 | 23 | option_symlink 24 | -------------------------------------------------------------------------------- /options/fedora/alias.zsh: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /options/fedora/environment.zsh: -------------------------------------------------------------------------------- 1 | # gsettings set org.gnome.desktop.input-sources xkb-options "['caps:escape']" 2 | # gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:ralt-alt', 'ctrl_modifier']" 3 | -------------------------------------------------------------------------------- /options/fedora/favorites.zsh: -------------------------------------------------------------------------------- 1 | PROJECT_PATHS=( \ 2 | ~/code/sources \ 3 | ~/code/dotfiles \ 4 | ) 5 | -------------------------------------------------------------------------------- /options/fedora/fedora.zsh: -------------------------------------------------------------------------------- 1 | source ~/.options/fedora/environment.zsh 2 | source ~/.options/fedora/favorites.zsh 3 | source ~/.options/fedora/prompt.zsh 4 | source ~/.options/fedora/alias.zsh 5 | -------------------------------------------------------------------------------- /options/fedora/last_hook.zsh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ninrod/dotfiles/d5ee45358d8d7d126031ebb9cb5ba584babff716/options/fedora/last_hook.zsh -------------------------------------------------------------------------------- /options/fedora/prompt.zsh: -------------------------------------------------------------------------------- 1 | # prompt config: nice unicode prompt chars: λ , › , ➤ , ∴ , → , ★ , ➜ , ❯, $ 2 | DOT_PROMPT_CHAR="➜" 3 | SHELL_PROMPT_INFO_LEVEL="0" 4 | -------------------------------------------------------------------------------- /options/fedora/setup.zsh: -------------------------------------------------------------------------------- 1 | # dir tracker setup 2 | [[ ! -e $DIR_HISTORY ]] && echo $HOME > $DIR_HISTORY 3 | 4 | # symlinkage 5 | source ~/.options/fedora/symlinks.zsh 6 | -------------------------------------------------------------------------------- /options/fedora/symlinks.zsh: -------------------------------------------------------------------------------- 1 | for file in ~/.options/fedora/**/makelink.zsh; do 2 | $file 3 | done 4 | -------------------------------------------------------------------------------- /options/fedora/xfce4-terminal/accels.scm: -------------------------------------------------------------------------------- 1 | ; xfce4-terminal GtkAccelMap rc-file -*- scheme -*- 2 | ; this file is an automated accelerator map dump 3 | ; 4 | (gtk_accel_path "/terminal-window/goto-tab-4" "4") 5 | (gtk_accel_path "/terminal-window/goto-tab-3" "3") 6 | ; (gtk_accel_path "/terminal-window/file-menu" "") 7 | ; (gtk_accel_path "/terminal-window/close-other-tabs" "") 8 | ; (gtk_accel_path "/terminal-window/search" "f") 9 | ; (gtk_accel_path "/terminal-window/next-tab" "Page_Down") 10 | (gtk_accel_path "/terminal-window/goto-tab-1" "1") 11 | ; (gtk_accel_path "/terminal-window/show-menubar" "") 12 | ; (gtk_accel_path "/terminal-window/zoom-reset" "0") 13 | ; (gtk_accel_path "/terminal-window/terminal-menu" "") 14 | ; (gtk_accel_path "/terminal-window/close-window" "q") 15 | ; (gtk_accel_path "/terminal-window/close-tab" "w") 16 | ; (gtk_accel_path "/terminal-window/save-contents" "") 17 | ; (gtk_accel_path "/terminal-window/new-tab" "t") 18 | ; (gtk_accel_path "/terminal-window/view-menu" "") 19 | ; (gtk_accel_path "/terminal-window/show-toolbar" "") 20 | ; (gtk_accel_path "/terminal-window/paste" "v") 21 | ; (gtk_accel_path "/terminal-window/copy" "c") 22 | ; (gtk_accel_path "/terminal-window/edit-menu" "") 23 | ; (gtk_accel_path "/terminal-window/fullscreen" "F11") 24 | ; (gtk_accel_path "/terminal-window/read-only" "") 25 | ; (gtk_accel_path "/terminal-window/detach-tab" "d") 26 | (gtk_accel_path "/terminal-window/goto-tab-2" "2") 27 | (gtk_accel_path "/terminal-window/goto-tab-5" "5") 28 | ; (gtk_accel_path "/terminal-window/prev-tab" "Page_Up") 29 | ; (gtk_accel_path "/terminal-window/move-tab-left" "Page_Up") 30 | ; (gtk_accel_path "/terminal-window/zoom-in" "plus") 31 | ; (gtk_accel_path "/terminal-window/search-prev" "") 32 | ; (gtk_accel_path "/terminal-window/reset-and-clear" "") 33 | ; (gtk_accel_path "/terminal-window/about" "") 34 | ; (gtk_accel_path "/terminal-window/search-next" "") 35 | ; (gtk_accel_path "/terminal-window/toggle-menubar" "") 36 | (gtk_accel_path "/terminal-window/goto-tab-7" "7") 37 | ; (gtk_accel_path "/terminal-window/select-all" "a") 38 | ; (gtk_accel_path "/terminal-window/help-menu" "") 39 | (gtk_accel_path "/terminal-window/goto-tab-9" "9") 40 | ; (gtk_accel_path "/terminal-window/show-borders" "") 41 | ; (gtk_accel_path "/terminal-window/preferences" "") 42 | (gtk_accel_path "/terminal-window/goto-tab-6" "6") 43 | (gtk_accel_path "/terminal-window/contents" "") 44 | ; (gtk_accel_path "/terminal-window/new-window" "n") 45 | ; (gtk_accel_path "/terminal-window/move-tab-right" "Page_Down") 46 | ; (gtk_accel_path "/terminal-window/zoom-out" "minus") 47 | ; (gtk_accel_path "/terminal-window/set-title" "s") 48 | ; (gtk_accel_path "/terminal-window/paste-selection" "") 49 | ; (gtk_accel_path "/terminal-window/undo-close-tab" "") 50 | (gtk_accel_path "/terminal-window/goto-tab-8" "8") 51 | ; (gtk_accel_path "/terminal-window/zoom-menu" "") 52 | ; (gtk_accel_path "/terminal-window/reset" "") 53 | ; (gtk_accel_path "/terminal-window/tabs-menu" "") 54 | -------------------------------------------------------------------------------- /options/fedora/xfce4-terminal/colorschemes/gruvbox-dark.theme: -------------------------------------------------------------------------------- 1 | [Scheme] 2 | Name=Gruvbox (dark) 3 | ColorForeground=#f2f2e5e5bcbc 4 | ColorBackground=#323230302f2f 5 | ColorCursor=#d65bc4cd8ca1 6 | ColorPalette=#323230302f2f;#cccc24241d1d;#989897971a1a;#d7d799992121;#454585858888;#b1b162628686;#68689d9d6a6a;#f2f2e5e5bcbc;#1d1d20202121;#fbfb49493434;#b8b8bbbb2626;#fafabdbd2f2f;#8383a5a59898;#d3d386869b9b;#8e8ec0c07c7c;#fffff1f1c6c6 7 | -------------------------------------------------------------------------------- /options/fedora/xfce4-terminal/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | echo "essa porra tá sendo executada?" 5 | 6 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 7 | GIT_ROOT=$(git rev-parse --show-toplevel) 8 | 9 | DIR=~/.config/xfce4 10 | LINK=~/.config/xfce4/terminal 11 | 12 | [[ -h $LINK ]] && exit 0 13 | 14 | if [[ ! -h $LINK ]] && [[ -d $LINK ]]; then 15 | rm -r $LINK 16 | fi 17 | 18 | if [[ ! -d $DIR ]]; then 19 | mkdir -p $DIR 20 | fi 21 | 22 | ln -s $(readlink -f .) $(readlink -f $LINK) 23 | -------------------------------------------------------------------------------- /options/fedora/xfce4-terminal/terminalrc: -------------------------------------------------------------------------------- 1 | [Configuration] 2 | FontName=Fantasque Sans Mono 17 3 | MiscAlwaysShowTabs=FALSE 4 | MiscBell=FALSE 5 | MiscBellUrgent=FALSE 6 | MiscBordersDefault=TRUE 7 | MiscCursorBlinks=FALSE 8 | MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK 9 | MiscDefaultGeometry=80x24 10 | MiscInheritGeometry=FALSE 11 | MiscMenubarDefault=FALSE 12 | MiscMouseAutohide=FALSE 13 | MiscMouseWheelZoom=TRUE 14 | MiscToolbarDefault=FALSE 15 | MiscConfirmClose=TRUE 16 | MiscCycleTabs=TRUE 17 | MiscTabCloseButtons=TRUE 18 | MiscTabCloseMiddleClick=TRUE 19 | MiscTabPosition=GTK_POS_TOP 20 | MiscHighlightUrls=TRUE 21 | MiscMiddleClickOpensUri=FALSE 22 | MiscCopyOnSelect=FALSE 23 | MiscDefaultWorkingDir= 24 | MiscRewrapOnResize=TRUE 25 | MiscUseShiftArrowsToScroll=FALSE 26 | MiscSlimTabs=FALSE 27 | ColorForeground=#f2f2e5e5bcbc 28 | ColorBackground=#1d1d20202121 29 | ColorCursor=#d65bc4cd8ca1 30 | ColorPalette=rgb(29,32,33);rgb(204,36,29);rgb(152,151,26);rgb(215,153,33);rgb(69,133,136);rgb(177,98,134);rgb(104,157,106);rgb(242,229,188);rgb(29,32,33);rgb(251,73,52);rgb(184,187,38);rgb(250,189,47);rgb(131,165,152);rgb(211,134,155);rgb(142,192,124);rgb(255,241,198) 31 | ScrollingUnlimited=TRUE 32 | ShortcutsNoHelpkey=TRUE 33 | ShortcutsNoMenukey=TRUE 34 | ShortcutsNoMnemonics=TRUE 35 | MiscNewTabAdjacent=FALSE 36 | ScrollingBar=TERMINAL_SCROLLBAR_NONE 37 | 38 | -------------------------------------------------------------------------------- /options/osx/environment.zsh: -------------------------------------------------------------------------------- 1 | # setting up PATH 2 | CUSTOM_SCRIPTS_BASE=~/.dotfiles/scripts 3 | 4 | # dotfiles scripts 5 | EMACS_SCRIPTS=$CUSTOM_SCRIPTS_BASE/emacs 6 | VIM_SCRIPTS=$CUSTOM_SCRIPTS_BASE/vim 7 | ZSH_SCRIPTS=$CUSTOM_SCRIPTS_BASE/zsh 8 | GIT_SCRIPTS=$CUSTOM_SCRIPTS_BASE/git 9 | OSX_SCRIPTS=~/.options/osx/scripts 10 | CUSTOM_SCRIPTS=$EMACS_SCRIPTS:$ZSH_SCRIPTS:$VIM_SCRIPTS:$OSX_SCRIPTS:$GIT_SCRIPTS 11 | 12 | # Pega a lista de diretórios GNU com esse comando: 13 | # find /usr/local/opt -type d -follow -name gnubin -print 14 | GNUCORE=/usr/local/opt/coreutils/libexec/gnubin 15 | GNUINDENT=/usr/local/opt/gnu-indent/libexec/gnubin 16 | GNUTAR=/usr/local/opt/gnu-tar/libexec/gnubin 17 | GNUED=/usr/local/opt/ed/libexec/gnubin 18 | GNUGREP=/usr/local/opt/grep/libexec/gnubin 19 | GNUSED=/usr/local/opt/gnu-sed/libexec/gnubin 20 | GNUGAWK=/usr/local/opt/gawk/libexec/gnubin 21 | GNUMAKE=/usr/local/opt/make/libexec/gnubin 22 | GNUFIND=/usr/local/opt/findutils/libexec/gnubin 23 | GNUWHICH=/usr/local/opt/gnu-which/libexec/gnubin 24 | 25 | # RUST 26 | RUST_BIN=~/.cargo/bin 27 | 28 | mountpath () { 29 | PATH="/bin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin" 30 | PATH="$PATH:$CUSTOM_SCRIPTS" 31 | PATH=$PATH:$RUST_BIN 32 | PATH=$GNUCORE:$GNUINDENT:$GNUTAR:$GNUED:$GNUGREP:$GNUSED:$GNUGAWK:$GNUMAKE:$GNUFIND:$GNUWHICH:$PATH 33 | export PATH 34 | } 35 | mountpath 36 | 37 | export BSSH_SERVERS_FILE="$HOME/code/sources/secrets/bssh.servers" 38 | 39 | # manpath 40 | GNUMANPATH="/usr/local/opt/coreutils/libexec/gnuman" 41 | MANPATH="$GNUMANPATH:$MANPATH" 42 | export MANPATH 43 | 44 | # node version manager 45 | nvm_config() { 46 | cd $(readlink -f ~/.dotfiles) 47 | cd .. 48 | [[ ! -e secrets/nvm.zsh ]] && return 0 49 | source secrets/nvm.zsh 50 | if [[ -z ${USE_NVM+x} ]] || [[ $USE_NVM = 0 ]]; then 51 | return 0 52 | fi 53 | export NVM_DIR="$HOME/.nvm" 54 | [[ -e $NVM_DIR/nvm.sh ]] && source $NVM_DIR/nvm.sh 55 | } 56 | curdir=$(pwd -P) 57 | nvm_config 58 | cd $curdir 59 | -------------------------------------------------------------------------------- /options/osx/favorites.zsh: -------------------------------------------------------------------------------- 1 | PROJECT_PATHS=( \ 2 | ~/code/sources \ 3 | ~/code/sources/options \ 4 | ~/code/sources/life \ 5 | ~/code/sources/tricks \ 6 | ) 7 | -------------------------------------------------------------------------------- /options/osx/last_hook.zsh: -------------------------------------------------------------------------------- 1 | # exercism 2 | exercism_completion_file=~/.config/exercism/exercism_completion.zsh 3 | if [ -f $exercism_completion_file ]; then 4 | source $exercism_completion_file 5 | fi 6 | 7 | #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! 8 | export SDKMAN_DIR="/Users/ninrod/.sdkman" 9 | export SDKMAN_INIT_FILE="${SDKMAN_DIR}/bin/sdkman-init.sh" 10 | [[ -s ${SDKMAN_INIT_FILE} ]] && source $SDKMAN_INIT_FILE 11 | -------------------------------------------------------------------------------- /options/osx/osx.zsh: -------------------------------------------------------------------------------- 1 | source ~/.options/osx/favorites.zsh 2 | source ~/.options/osx/environment.zsh 3 | source ~/.options/osx/prompt.zsh 4 | -------------------------------------------------------------------------------- /options/osx/prompt.zsh: -------------------------------------------------------------------------------- 1 | # prompt config: nice unicode prompt chars: , λ , › , ➤ , ∴ , → , ★ , ➜ , ❯ 2 | DOT_PROMPT_CHAR="❯" 3 | SHELL_PROMPT_INFO_LEVEL="0" 4 | 5 | -------------------------------------------------------------------------------- /options/readme.org: -------------------------------------------------------------------------------- 1 | * Sample distro/OS agnostic config 2 | 3 | the idea here is to showcase how you can split your configuration for it to work both on OSx and on arch. 4 | And maybe centos, ubuntu, etc... 5 | -------------------------------------------------------------------------------- /options/shell-options.zsh: -------------------------------------------------------------------------------- 1 | if [[ -n ${1+x} ]] && [[ "$1" == "gitmask" ]]; then 2 | # hack lifted from: https://stackoverflow.com/a/3666941/4921402 3 | return 4 | fi 5 | 6 | load_secrets() { 7 | 8 | GIT_ROOT=$(cd ~/.dotfiles && git rev-parse --show-toplevel) 9 | local my_secrets=$(cd $GIT_ROOT && cd .. && readlink -f secrets) 10 | if [[ ! -d $my_secrets ]]; then 11 | echo "dir $my_secrets does not exist. aborting." 12 | return 0 13 | fi 14 | source $my_secrets/secrets.zsh 15 | } 16 | 17 | # zsh parameter substitution: http://zsh.sourceforge.net/Intro/intro_12.html 18 | unamestr=$(uname -a) 19 | if [[ $unamestr:l == *"microsoft"* ]]; then 20 | source ~/.options/wsl/wsl.zsh 21 | load_secrets 22 | elif [[ $unamestr:l == *"linux"* ]] && [[ $unamestr:l == *"arch"* ]]; then 23 | if [[ -n ${1+x} ]] && [[ "$1" == "setup" ]]; then 24 | source ~/.options/arch/setup.zsh 25 | load_secrets 26 | else 27 | source ~/.options/arch/arch.zsh 28 | fi 29 | elif [[ $unamestr:l == *"darwin"* ]]; then 30 | source ~/.options/osx/osx.zsh $1 31 | if [[ -n ${1+x} ]] && [[ "$1" == "setup" ]]; then 32 | load_secrets 33 | fi 34 | fi 35 | -------------------------------------------------------------------------------- /options/suse/alias.zsh: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /options/suse/environment.zsh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ninrod/dotfiles/d5ee45358d8d7d126031ebb9cb5ba584babff716/options/suse/environment.zsh -------------------------------------------------------------------------------- /options/suse/favorites.zsh: -------------------------------------------------------------------------------- 1 | PROJECT_PATHS=( \ 2 | ~/code/ \ 3 | ~/code/dotfiles \ 4 | ) 5 | -------------------------------------------------------------------------------- /options/suse/last_hook.zsh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ninrod/dotfiles/d5ee45358d8d7d126031ebb9cb5ba584babff716/options/suse/last_hook.zsh -------------------------------------------------------------------------------- /options/suse/prompt.zsh: -------------------------------------------------------------------------------- 1 | # prompt config: nice unicode prompt chars: λ , › , ➤ , ∴ , → , ★ , ➜ , ❯, $ 2 | DOT_PROMPT_CHAR="➜" 3 | SHELL_PROMPT_INFO_LEVEL="2" 4 | -------------------------------------------------------------------------------- /options/suse/setup.zsh: -------------------------------------------------------------------------------- 1 | # dir tracker setup 2 | [[ ! -e $DIR_HISTORY ]] && echo $HOME > $DIR_HISTORY 3 | 4 | # symlinkage 5 | source ~/.options/suse/symlinks.zsh 6 | -------------------------------------------------------------------------------- /options/suse/suse.zsh: -------------------------------------------------------------------------------- 1 | source ~/.options/suse/environment.zsh 2 | source ~/.options/suse/favorites.zsh 3 | source ~/.options/suse/prompt.zsh 4 | source ~/.options/suse/alias.zsh 5 | -------------------------------------------------------------------------------- /options/suse/symlinks.zsh: -------------------------------------------------------------------------------- 1 | for file in ~/.options/suse/**/makelink.zsh; do 2 | $file 3 | done 4 | -------------------------------------------------------------------------------- /options/suse/xfce4-terminal/accels.scm: -------------------------------------------------------------------------------- 1 | ; xfce4-terminal GtkAccelMap rc-file -*- scheme -*- 2 | ; this file is an automated accelerator map dump 3 | ; 4 | (gtk_accel_path "/terminal-window/goto-tab-4" "4") 5 | (gtk_accel_path "/terminal-window/goto-tab-3" "3") 6 | ; (gtk_accel_path "/terminal-window/file-menu" "") 7 | ; (gtk_accel_path "/terminal-window/close-other-tabs" "") 8 | ; (gtk_accel_path "/terminal-window/search" "f") 9 | ; (gtk_accel_path "/terminal-window/next-tab" "Page_Down") 10 | (gtk_accel_path "/terminal-window/goto-tab-1" "1") 11 | ; (gtk_accel_path "/terminal-window/show-menubar" "") 12 | ; (gtk_accel_path "/terminal-window/zoom-reset" "0") 13 | ; (gtk_accel_path "/terminal-window/terminal-menu" "") 14 | ; (gtk_accel_path "/terminal-window/close-window" "q") 15 | ; (gtk_accel_path "/terminal-window/close-tab" "w") 16 | ; (gtk_accel_path "/terminal-window/save-contents" "") 17 | ; (gtk_accel_path "/terminal-window/new-tab" "t") 18 | ; (gtk_accel_path "/terminal-window/view-menu" "") 19 | ; (gtk_accel_path "/terminal-window/show-toolbar" "") 20 | ; (gtk_accel_path "/terminal-window/paste" "v") 21 | ; (gtk_accel_path "/terminal-window/copy" "c") 22 | ; (gtk_accel_path "/terminal-window/edit-menu" "") 23 | ; (gtk_accel_path "/terminal-window/fullscreen" "F11") 24 | ; (gtk_accel_path "/terminal-window/read-only" "") 25 | ; (gtk_accel_path "/terminal-window/detach-tab" "d") 26 | (gtk_accel_path "/terminal-window/goto-tab-2" "2") 27 | (gtk_accel_path "/terminal-window/goto-tab-5" "5") 28 | ; (gtk_accel_path "/terminal-window/prev-tab" "Page_Up") 29 | ; (gtk_accel_path "/terminal-window/move-tab-left" "Page_Up") 30 | ; (gtk_accel_path "/terminal-window/zoom-in" "plus") 31 | ; (gtk_accel_path "/terminal-window/search-prev" "") 32 | ; (gtk_accel_path "/terminal-window/reset-and-clear" "") 33 | ; (gtk_accel_path "/terminal-window/about" "") 34 | ; (gtk_accel_path "/terminal-window/search-next" "") 35 | ; (gtk_accel_path "/terminal-window/toggle-menubar" "") 36 | (gtk_accel_path "/terminal-window/goto-tab-7" "7") 37 | ; (gtk_accel_path "/terminal-window/select-all" "a") 38 | ; (gtk_accel_path "/terminal-window/help-menu" "") 39 | (gtk_accel_path "/terminal-window/goto-tab-9" "9") 40 | ; (gtk_accel_path "/terminal-window/show-borders" "") 41 | ; (gtk_accel_path "/terminal-window/preferences" "") 42 | (gtk_accel_path "/terminal-window/goto-tab-6" "6") 43 | (gtk_accel_path "/terminal-window/contents" "") 44 | ; (gtk_accel_path "/terminal-window/new-window" "n") 45 | ; (gtk_accel_path "/terminal-window/move-tab-right" "Page_Down") 46 | ; (gtk_accel_path "/terminal-window/zoom-out" "minus") 47 | ; (gtk_accel_path "/terminal-window/set-title" "s") 48 | ; (gtk_accel_path "/terminal-window/paste-selection" "") 49 | ; (gtk_accel_path "/terminal-window/undo-close-tab" "") 50 | (gtk_accel_path "/terminal-window/goto-tab-8" "8") 51 | ; (gtk_accel_path "/terminal-window/zoom-menu" "") 52 | ; (gtk_accel_path "/terminal-window/reset" "") 53 | ; (gtk_accel_path "/terminal-window/tabs-menu" "") 54 | -------------------------------------------------------------------------------- /options/suse/xfce4-terminal/colorschemes/gruvbox-dark.theme: -------------------------------------------------------------------------------- 1 | [Scheme] 2 | Name=Gruvbox (dark) 3 | ColorForeground=#f2f2e5e5bcbc 4 | ColorBackground=#323230302f2f 5 | ColorCursor=#d65bc4cd8ca1 6 | ColorPalette=#323230302f2f;#cccc24241d1d;#989897971a1a;#d7d799992121;#454585858888;#b1b162628686;#68689d9d6a6a;#f2f2e5e5bcbc;#1d1d20202121;#fbfb49493434;#b8b8bbbb2626;#fafabdbd2f2f;#8383a5a59898;#d3d386869b9b;#8e8ec0c07c7c;#fffff1f1c6c6 7 | -------------------------------------------------------------------------------- /options/suse/xfce4-terminal/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config/xfce4 8 | LINK=~/.config/xfce4/terminal 9 | 10 | [[ -h $LINK ]] && exit 0 11 | 12 | if [[ ! -h $LINK ]] && [[ -d $LINK ]]; then 13 | rm -r $LINK 14 | fi 15 | 16 | if [[ ! -d $DIR ]]; then 17 | mkdir -p $DIR 18 | fi 19 | 20 | ln -s $(readlink -f .) $(readlink -f $LINK) 21 | -------------------------------------------------------------------------------- /options/suse/xfce4-terminal/terminalrc: -------------------------------------------------------------------------------- 1 | [Configuration] 2 | FontName=Fantasque Sans Mono 17 3 | MiscAlwaysShowTabs=FALSE 4 | MiscBell=FALSE 5 | MiscBellUrgent=FALSE 6 | MiscBordersDefault=TRUE 7 | MiscCursorBlinks=FALSE 8 | MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK 9 | MiscDefaultGeometry=80x24 10 | MiscInheritGeometry=FALSE 11 | MiscMenubarDefault=FALSE 12 | MiscMouseAutohide=FALSE 13 | MiscMouseWheelZoom=TRUE 14 | MiscToolbarDefault=FALSE 15 | MiscConfirmClose=TRUE 16 | MiscCycleTabs=TRUE 17 | MiscTabCloseButtons=TRUE 18 | MiscTabCloseMiddleClick=TRUE 19 | MiscTabPosition=GTK_POS_TOP 20 | MiscHighlightUrls=TRUE 21 | MiscMiddleClickOpensUri=FALSE 22 | MiscCopyOnSelect=FALSE 23 | MiscDefaultWorkingDir= 24 | MiscRewrapOnResize=TRUE 25 | MiscUseShiftArrowsToScroll=FALSE 26 | MiscSlimTabs=FALSE 27 | ColorForeground=#f2f2e5e5bcbc 28 | ColorBackground=#1d1d20202121 29 | ColorCursor=#d65bc4cd8ca1 30 | ColorPalette=rgb(29,32,33);rgb(204,36,29);rgb(152,151,26);rgb(215,153,33);rgb(69,133,136);rgb(177,98,134);rgb(104,157,106);rgb(242,229,188);rgb(29,32,33);rgb(251,73,52);rgb(184,187,38);rgb(250,189,47);rgb(131,165,152);rgb(211,134,155);rgb(142,192,124);rgb(255,241,198) 31 | ScrollingUnlimited=TRUE 32 | ShortcutsNoHelpkey=TRUE 33 | ShortcutsNoMenukey=TRUE 34 | ShortcutsNoMnemonics=TRUE 35 | MiscNewTabAdjacent=FALSE 36 | ScrollingBar=TERMINAL_SCROLLBAR_NONE 37 | 38 | -------------------------------------------------------------------------------- /options/suse/xorg/Xmodmap.xorg: -------------------------------------------------------------------------------- 1 | ! -*- mode: xmodmap -*- 2 | 3 | ! capslock now is escape 4 | remove Lock = Caps_Lock 5 | keysym Caps_Lock = Escape 6 | add Lock = Caps_Lock 7 | 8 | ! Right Alt is Right Control 9 | remove Mod1 = Alt_R 10 | keycode 108 = Control_R 11 | add Control = Control_R 12 | -------------------------------------------------------------------------------- /options/suse/xorg/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | update_link() { 8 | local file=$1 9 | local deploy=$2 10 | [[ -e $deploy ]] && return 0 11 | ln -sf $(readlink -f $file) $deploy 12 | } 13 | 14 | update_link Xmodmap.xorg ~/.Xmodmap 15 | -------------------------------------------------------------------------------- /options/suse/xorg/readme.org: -------------------------------------------------------------------------------- 1 | * xmodmap and xev 2 | - tips stolen from [[xahlee.info/linux/linux_xmodmap_tutorial.html][Xah's xmodmap tutorial]] 3 | - use the =xev= tool to discover what the keycodes are 4 | - run only =xmodmap= to discover what are your current modifier configuration 5 | * capslock trick 6 | - run this in gnome 7 | #+BEGIN_SRC sh 8 | use xevdconf write /org/gnome/desktop/input-sources/xkb-options "['caps:escape']" 9 | #+END_SRC -------------------------------------------------------------------------------- /options/ubuntu/alias.zsh: -------------------------------------------------------------------------------- 1 | # random 2 | alias xclip="xclip -selection c" 3 | alias open=xdg-open 4 | 5 | # scripts 6 | alias bssh="~/.options/arch/scripts/terminal/bssh.sh" 7 | -------------------------------------------------------------------------------- /options/ubuntu/chrome/chrome-flags.conf: -------------------------------------------------------------------------------- 1 | --force-device-scale-factor=1.9 2 | -------------------------------------------------------------------------------- /options/ubuntu/chrome/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config 8 | FILE=chrome-flags.conf 9 | FULL_FILE=$DIR/$FILE 10 | 11 | [[ -e $FULL_FILE ]] && exit 0 12 | 13 | if [[ ! -d $DIR ]]; then 14 | mkdir -p $DIR 15 | fi 16 | rm -f $FULL_FILE 17 | ln -s $(readlink -f $FILE) $(readlink -f $FULL_FILE) 18 | -------------------------------------------------------------------------------- /options/ubuntu/environment.zsh: -------------------------------------------------------------------------------- 1 | export XDG_CONFIG_HOME="$HOME/.config" 2 | export BSSH_SERVERS_FILE="$HOME/code/sources/secrets/bssh.servers" 3 | 4 | # setting up PATH 5 | CUSTOM_SCRIPTS=~/.dotfiles/scripts/emacs:~/.dotfiles/scripts/vim:~/.dotfiles/scripts/zsh 6 | LINUX_SCRIPTS=~/.options/ubuntu/scripts 7 | CARGO_BIN=~/.cargo/bin 8 | GO_BIN=~/go/bin 9 | HOME_LOCAL_BIN=~/.local/bin 10 | GRADLE_HOME=~/.sdkman/candidates/gradle/current 11 | YARN_PATH=~/.yarn/bin 12 | ANDROID_HOME=/home/ninrod/Android/Sdk 13 | 14 | PATH=${PATH}:$CUSTOM_SCRIPTS 15 | PATH=${PATH}:$LINUX_SCRIPTS 16 | PATH=${PATH}:$CARGO_BIN 17 | PATH=${PATH}:$GO_BIN 18 | PATH=${PATH}:$HOME_LOCAL_BIN 19 | PATH=${PATH}:$YARN_PATH 20 | PATH=${PATH}:$ANDROID_HOME/tools 21 | PATH=${PATH}:$ANDROID_HOME/platform-tools 22 | 23 | typeset -aU path 24 | 25 | # hack stolen from: https://github.com/rust-lang-nursery/rustfmt/issues/1687#issuecomment-308756211 26 | 27 | nvm_config() { 28 | cd $(readlink -f ~/.dotfiles) 29 | cd .. 30 | [[ ! -e secrets/nvm.zsh ]] && return 0 31 | source secrets/nvm.zsh 32 | if [[ -z ${USE_NVM+x} ]] || [[ $USE_NVM = 0 ]]; then 33 | return 0 34 | fi 35 | export NVM_DIR="$HOME/.nvm" 36 | [[ -e $NVM_DIR/nvm.sh ]] && source $NVM_DIR/nvm.sh 37 | } 38 | 39 | curdir=$(pwd -P) 40 | nvm_config 41 | cd $curdir 42 | -------------------------------------------------------------------------------- /options/ubuntu/favorites.zsh: -------------------------------------------------------------------------------- 1 | PROJECT_PATHS=( \ 2 | ~/code/sources/ \ 3 | ~/code/sources/dotfiles \ 4 | ~/code/sources/options \ 5 | ~/code/sources/gtd \ 6 | ~/code/sources/logbook \ 7 | ~/go/src/github.com/ninrod \ 8 | ) 9 | -------------------------------------------------------------------------------- /options/ubuntu/last_hook.zsh: -------------------------------------------------------------------------------- 1 | # exercism 2 | exercism_completion_file=~/.config/exercism/exercism_completion.zsh 3 | if [ -f $exercism_completion_file ]; then 4 | source $exercism_completion_file 5 | fi 6 | 7 | #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! 8 | export SDKMAN_DIR="/home/ninrod/.sdkman" 9 | [[ -s "/home/ninrod/.sdkman/bin/sdkman-init.sh" ]] && source "/home/ninrod/.sdkman/bin/sdkman-init.sh" -------------------------------------------------------------------------------- /options/ubuntu/prompt.zsh: -------------------------------------------------------------------------------- 1 | # prompt config: nice unicode prompt chars: λ , › , ➤ , ∴ , → , ★ , ➜ , ❯, $ 2 | DOT_PROMPT_CHAR="➜" 3 | 4 | SHELL_PROMPT_INFO_LEVEL="0" 5 | 6 | hn=$(hostname) 7 | if [[ $hn:l == *"droplet"* ]]; then 8 | SHELL_PROMPT_INFO_LEVEL="2" 9 | fi 10 | -------------------------------------------------------------------------------- /options/ubuntu/ranger/.gitignore: -------------------------------------------------------------------------------- 1 | bookmarks 2 | history 3 | tagged 4 | 5 | -------------------------------------------------------------------------------- /options/ubuntu/ranger/commands.py: -------------------------------------------------------------------------------- 1 | # default config: /usr/share/doc/ranger/config/commands.py 2 | import os 3 | 4 | from ranger.api.commands import * 5 | from ranger.core.loader import CommandLoader 6 | 7 | 8 | class fzf_locate(Command): 9 | def execute(self): 10 | import subprocess 11 | command = "locate '*' | fzf +m" 12 | fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) 13 | stdout, stderr = fzf.communicate() 14 | if fzf.returncode == 0: 15 | fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) 16 | if os.path.isdir(fzf_file): 17 | self.fm.cd(fzf_file) 18 | else: 19 | self.fm.select_file(fzf_file) 20 | 21 | 22 | # https://github.com/hut/ranger/wiki/Commands#fzf-integration 23 | class fzf_select(Command): 24 | """ 25 | :fzf_select 26 | Find a file using fzf. 27 | With a prefix argument select only directories. 28 | See: https://github.com/junegunn/fzf 29 | """ 30 | 31 | def execute(self): 32 | import subprocess 33 | if self.quantifier: 34 | # match only directories 35 | command = "find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ 36 | -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" 37 | 38 | else: 39 | # match files and directories 40 | command = "find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ 41 | -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" 42 | 43 | fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) 44 | stdout, stderr = fzf.communicate() 45 | if fzf.returncode == 0: 46 | fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) 47 | if os.path.isdir(fzf_file): 48 | self.fm.cd(fzf_file) 49 | else: 50 | self.fm.select_file(fzf_file) 51 | -------------------------------------------------------------------------------- /options/ubuntu/ranger/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config/ranger 8 | TARGET=. 9 | 10 | if [[ -d $DIR ]]; then 11 | rm -rf $DIR 12 | else 13 | rm -f $DIR 14 | fi 15 | 16 | ln -s $(readlink -f $TARGET) $DIR 17 | -------------------------------------------------------------------------------- /options/ubuntu/ranger/rc.conf: -------------------------------------------------------------------------------- 1 | # set show_hidden true (or just type zh) 2 | 3 | map bd console mkdir%space 4 | map bf console touch%space 5 | -------------------------------------------------------------------------------- /options/ubuntu/readme.org: -------------------------------------------------------------------------------- 1 | * Ubuntu setup ideas 2 | 3 | 4 | -------------------------------------------------------------------------------- /options/ubuntu/scripts/julicloud.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | # first, go to mycloud and export the share as NFS 5 | # then, uncover the shares with: showmount -e server 6 | 7 | # if lsmod | grep nfs does not return 0, you may have updgraded the kernel. reboot. 8 | # you can test this with modprobe nfs 9 | 10 | cloud_filipe=~/julicloud/filipe 11 | cloud_eve=~/julicloud/eve 12 | cloud_public=~/julicloud/public 13 | 14 | mkdir -p $cloud_filipe 15 | mkdir -p $cloud_eve 16 | mkdir -p $cloud_public 17 | 18 | # JULICLOUD=192.168.0.2 19 | JULICLOUD=julicloud 20 | 21 | sudo mount $JULICLOUD:/mnt/HD/HD_a2/filipe $cloud_filipe 22 | sudo mount $JULICLOUD:/mnt/HD/HD_a2/Public $cloud_public 23 | sudo mount $JULICLOUD:/mnt/HD/HD_a2/eve $cloud_eve 24 | -------------------------------------------------------------------------------- /options/ubuntu/scripts/passmenu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # obtained from: 4 | # https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu 5 | 6 | shopt -s nullglob globstar 7 | 8 | typeit=0 9 | if [[ $1 == "--type" ]]; then 10 | typeit=1 11 | shift 12 | fi 13 | 14 | prefix=${PASSWORD_STORE_DIR-~/.password-store} 15 | password_files=( "$prefix"/**/*.gpg ) 16 | password_files=( "${password_files[@]#"$prefix"/}" ) 17 | password_files=( "${password_files[@]%.gpg}" ) 18 | 19 | # original line 20 | # password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@") 21 | 22 | password=$(printf '%s\n' "${password_files[@]}" | dmenu -fn "Office Code Pro-12:normal" -nb "#32302f" -nf "#ebdbb2" -sb "#0a0814" -sf "#fe8019" -p ">" "$@") 23 | 24 | [[ -n $password ]] || exit 25 | 26 | if [[ $typeit -eq 0 ]]; then 27 | pass show -c "$password" 2>/dev/null 28 | else 29 | pass show "$password" | { read -r pass; printf %s "$pass"; } | 30 | xdotool type --clearmodifiers --file - 31 | fi 32 | 33 | -------------------------------------------------------------------------------- /options/ubuntu/scripts/terminal/bssh.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # bssh: better ssh chooser 4 | # credits: original hack by @marvinbelfort 5 | 6 | set -euo pipefail 7 | 8 | if [[ ! -f $BSSH_SERVERS_FILE ]]; then 9 | echo "[bssh]-> ERROR: no $BSSH_SERVERS_FILE file found." 10 | exit 0 11 | fi 12 | 13 | description=$(cat $BSSH_SERVERS_FILE | fzf) 14 | server=$(echo $description | cut -d "-" -f1) 15 | 16 | if [[ ! -z $server ]]; then 17 | # ping $server 18 | ssh $server -o ServerAliveInterval=5 -o ServerAliveCountMax=1 19 | fi 20 | 21 | # to copy your public key to a server 22 | # ssh-copy-id -i ~/.ssh/id_rsa.pub user@host 23 | -------------------------------------------------------------------------------- /options/ubuntu/setup.zsh: -------------------------------------------------------------------------------- 1 | # dir tracker setup 2 | [[ ! -e $DIR_HISTORY ]] && echo $HOME > $DIR_HISTORY 3 | 4 | # symlinkage 5 | source ~/.options/ubuntu/symlinks.zsh 6 | 7 | # arch specific java nuisance 8 | # wmname LG3D 9 | -------------------------------------------------------------------------------- /options/ubuntu/sources/sources.list: -------------------------------------------------------------------------------- 1 | # main 2 | deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse 3 | 4 | # update and security 5 | deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse 6 | deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse 7 | 8 | # other 9 | deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable 10 | 11 | -------------------------------------------------------------------------------- /options/ubuntu/symlinks.zsh: -------------------------------------------------------------------------------- 1 | for file in ~/.options/ubuntu/**/makelink.zsh; do 2 | $file 3 | done 4 | -------------------------------------------------------------------------------- /options/ubuntu/systemd/lock_if_unlocked.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if pgrep -x physlock; then 4 | echo "physlock already running, nothing to do" 5 | exit 0 6 | fi 7 | 8 | physlock -d 9 | -------------------------------------------------------------------------------- /options/ubuntu/systemd/suspend@ninrod.service: -------------------------------------------------------------------------------- 1 | # 01: place this file in /etc/systemd/system 2 | # 02: sudo systemctl enable suspend@ninrod.service 3 | # 03: sudo systemctl start suspend@ninrod.service 4 | 5 | [Unit] 6 | Description=User suspend actions 7 | Before=suspend.target 8 | 9 | [Service] 10 | User=ninrod 11 | Type=forking 12 | Environment=DISPLAY=:0 13 | ExecStart=/home/ninrod/.options/arch/systemd/lock_if_unlocked.sh 14 | 15 | [Install] 16 | WantedBy=suspend.target -------------------------------------------------------------------------------- /options/ubuntu/ubuntu.zsh: -------------------------------------------------------------------------------- 1 | source ~/.options/ubuntu/environment.zsh 2 | source ~/.options/ubuntu/favorites.zsh 3 | source ~/.options/ubuntu/prompt.zsh 4 | source ~/.options/ubuntu/alias.zsh 5 | # source ~/.options/ubuntu/xmodmap.zsh 6 | -------------------------------------------------------------------------------- /options/ubuntu/xfce4-terminal/accels.scm: -------------------------------------------------------------------------------- 1 | ; xfce4-terminal GtkAccelMap rc-file -*- scheme -*- 2 | ; this file is an automated accelerator map dump 3 | ; 4 | (gtk_accel_path "/terminal-window/goto-tab-4" "4") 5 | (gtk_accel_path "/terminal-window/goto-tab-3" "3") 6 | ; (gtk_accel_path "/terminal-window/file-menu" "") 7 | ; (gtk_accel_path "/terminal-window/close-other-tabs" "") 8 | ; (gtk_accel_path "/terminal-window/search" "f") 9 | ; (gtk_accel_path "/terminal-window/next-tab" "Page_Down") 10 | (gtk_accel_path "/terminal-window/goto-tab-1" "1") 11 | ; (gtk_accel_path "/terminal-window/show-menubar" "") 12 | ; (gtk_accel_path "/terminal-window/zoom-reset" "0") 13 | ; (gtk_accel_path "/terminal-window/terminal-menu" "") 14 | ; (gtk_accel_path "/terminal-window/close-window" "q") 15 | ; (gtk_accel_path "/terminal-window/close-tab" "w") 16 | ; (gtk_accel_path "/terminal-window/save-contents" "") 17 | ; (gtk_accel_path "/terminal-window/new-tab" "t") 18 | ; (gtk_accel_path "/terminal-window/view-menu" "") 19 | ; (gtk_accel_path "/terminal-window/show-toolbar" "") 20 | ; (gtk_accel_path "/terminal-window/paste" "v") 21 | ; (gtk_accel_path "/terminal-window/copy" "c") 22 | ; (gtk_accel_path "/terminal-window/edit-menu" "") 23 | ; (gtk_accel_path "/terminal-window/fullscreen" "F11") 24 | ; (gtk_accel_path "/terminal-window/read-only" "") 25 | ; (gtk_accel_path "/terminal-window/detach-tab" "d") 26 | (gtk_accel_path "/terminal-window/goto-tab-2" "2") 27 | (gtk_accel_path "/terminal-window/goto-tab-5" "5") 28 | ; (gtk_accel_path "/terminal-window/prev-tab" "Page_Up") 29 | ; (gtk_accel_path "/terminal-window/move-tab-left" "Page_Up") 30 | ; (gtk_accel_path "/terminal-window/zoom-in" "plus") 31 | ; (gtk_accel_path "/terminal-window/search-prev" "") 32 | ; (gtk_accel_path "/terminal-window/reset-and-clear" "") 33 | ; (gtk_accel_path "/terminal-window/about" "") 34 | ; (gtk_accel_path "/terminal-window/search-next" "") 35 | ; (gtk_accel_path "/terminal-window/toggle-menubar" "") 36 | (gtk_accel_path "/terminal-window/goto-tab-7" "7") 37 | ; (gtk_accel_path "/terminal-window/select-all" "a") 38 | ; (gtk_accel_path "/terminal-window/help-menu" "") 39 | (gtk_accel_path "/terminal-window/goto-tab-9" "9") 40 | ; (gtk_accel_path "/terminal-window/show-borders" "") 41 | ; (gtk_accel_path "/terminal-window/preferences" "") 42 | (gtk_accel_path "/terminal-window/goto-tab-6" "6") 43 | (gtk_accel_path "/terminal-window/contents" "") 44 | ; (gtk_accel_path "/terminal-window/new-window" "n") 45 | ; (gtk_accel_path "/terminal-window/move-tab-right" "Page_Down") 46 | ; (gtk_accel_path "/terminal-window/zoom-out" "minus") 47 | ; (gtk_accel_path "/terminal-window/set-title" "s") 48 | ; (gtk_accel_path "/terminal-window/paste-selection" "") 49 | ; (gtk_accel_path "/terminal-window/undo-close-tab" "") 50 | (gtk_accel_path "/terminal-window/goto-tab-8" "8") 51 | ; (gtk_accel_path "/terminal-window/zoom-menu" "") 52 | ; (gtk_accel_path "/terminal-window/reset" "") 53 | ; (gtk_accel_path "/terminal-window/tabs-menu" "") 54 | -------------------------------------------------------------------------------- /options/ubuntu/xfce4-terminal/colorschemes/gruvbox-dark.theme: -------------------------------------------------------------------------------- 1 | [Scheme] 2 | Name=Gruvbox (dark) 3 | ColorForeground=#f2f2e5e5bcbc 4 | ColorBackground=#323230302f2f 5 | ColorCursor=#d65bc4cd8ca1 6 | ColorPalette=#323230302f2f;#cccc24241d1d;#989897971a1a;#d7d799992121;#454585858888;#b1b162628686;#68689d9d6a6a;#f2f2e5e5bcbc;#1d1d20202121;#fbfb49493434;#b8b8bbbb2626;#fafabdbd2f2f;#8383a5a59898;#d3d386869b9b;#8e8ec0c07c7c;#fffff1f1c6c6 7 | -------------------------------------------------------------------------------- /options/ubuntu/xfce4-terminal/makelink.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | 7 | DIR=~/.config/xfce4 8 | LINK=~/.config/xfce4/terminal 9 | 10 | if [[ -h $LINK ]]; then 11 | echo "já tem o link, nada mais a fazer" 12 | exit 0 13 | else 14 | echo "o $LINK não existe, vamos avançar" 15 | fi 16 | 17 | if [[ ! -h $LINK ]] && [[ -d $LINK ]]; then 18 | echo "não existe o link, mas existe o diretório com o nome do link, removendo." 19 | rm -r $LINK 20 | else 21 | echo "ou existe o link e portanto eu já removi, ou não existe o link em forma de diretório. skipping" 22 | fi 23 | 24 | if [[ ! -d $DIR ]]; then 25 | echo "o diretório $DIR não existe, vou criá-lo" 26 | mkdir -p $DIR 27 | fi 28 | 29 | ln -s $(readlink -f .) $(readlink -f $LINK) 30 | -------------------------------------------------------------------------------- /options/ubuntu/xfce4-terminal/terminalrc: -------------------------------------------------------------------------------- 1 | [Configuration] 2 | FontName=Fantasque Sans Mono 17 3 | MiscAlwaysShowTabs=FALSE 4 | MiscBell=FALSE 5 | MiscBellUrgent=FALSE 6 | MiscBordersDefault=TRUE 7 | MiscCursorBlinks=FALSE 8 | MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK 9 | MiscDefaultGeometry=80x24 10 | MiscInheritGeometry=FALSE 11 | MiscMenubarDefault=FALSE 12 | MiscMouseAutohide=FALSE 13 | MiscMouseWheelZoom=TRUE 14 | MiscToolbarDefault=FALSE 15 | MiscConfirmClose=TRUE 16 | MiscCycleTabs=TRUE 17 | MiscTabCloseButtons=TRUE 18 | MiscTabCloseMiddleClick=TRUE 19 | MiscTabPosition=GTK_POS_TOP 20 | MiscHighlightUrls=TRUE 21 | MiscMiddleClickOpensUri=FALSE 22 | MiscCopyOnSelect=FALSE 23 | MiscDefaultWorkingDir= 24 | MiscRewrapOnResize=TRUE 25 | MiscUseShiftArrowsToScroll=FALSE 26 | MiscSlimTabs=FALSE 27 | ColorForeground=#f2f2e5e5bcbc 28 | ColorBackground=#1d1d20202121 29 | ColorCursor=#d65bc4cd8ca1 30 | ColorPalette=rgb(29,32,33);rgb(204,36,29);rgb(152,151,26);rgb(215,153,33);rgb(69,133,136);rgb(177,98,134);rgb(104,157,106);rgb(242,229,188);rgb(29,32,33);rgb(251,73,52);rgb(184,187,38);rgb(250,189,47);rgb(131,165,152);rgb(211,134,155);rgb(142,192,124);rgb(255,241,198) 31 | ScrollingUnlimited=TRUE 32 | ShortcutsNoHelpkey=TRUE 33 | ShortcutsNoMenukey=TRUE 34 | ShortcutsNoMnemonics=TRUE 35 | MiscNewTabAdjacent=FALSE 36 | ScrollingBar=TERMINAL_SCROLLBAR_NONE 37 | 38 | -------------------------------------------------------------------------------- /options/ubuntu/xmodmap.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ -f $HOME/.Xmodmap ]]; then 4 | xmodmap -e "keycode 108 = Alt_R Meta_R Alt_R Meta_R" 5 | xmodmap $HOME/.Xmodmap 6 | fi 7 | -------------------------------------------------------------------------------- /options/ubuntu/xorg/xmodmap.xorg: -------------------------------------------------------------------------------- 1 | !Swap right control and right alt 2 | remove Control = Control_R 3 | remove Mod1 = Alt_R 4 | keycode 105 = Alt_R 5 | keycode 108 = Control_R 6 | add Control = Control_R 7 | add Mod1 = Alt_R 8 | -------------------------------------------------------------------------------- /options/user_last_hook.zsh: -------------------------------------------------------------------------------- 1 | unamestr=$(uname -a) 2 | if [[ $unamestr:l == *"microsoft"* ]]; then 3 | source ~/.options/wsl/last_hook.zsh 4 | elif [[ $unamestr:l == *"linux"* ]] && [[ $unamestr:l == *"arch"* ]]; then 5 | source ~/.options/arch/last_hook.zsh 6 | elif [[ $unamestr:l == *"ubuntu"* ]]; then 7 | source ~/.options/ubuntu/last_hook.zsh 8 | elif [[ $unamestr:l == *"darwin"* ]]; then 9 | source ~/.options/osx/last_hook.zsh 10 | fi 11 | -------------------------------------------------------------------------------- /options/wsl/alias.zsh: -------------------------------------------------------------------------------- 1 | # random 2 | alias xclip="xclip -selection c" 3 | alias open=xdg-open 4 | 5 | # scripts 6 | alias bssh="~/.options/arch/scripts/terminal/bssh.sh" 7 | -------------------------------------------------------------------------------- /options/wsl/environment.zsh: -------------------------------------------------------------------------------- 1 | export XDG_CONFIG_HOME="$HOME/.config" 2 | export BSSH_SERVERS_FILE="$HOME/code/sources/secrets/bssh.servers" 3 | 4 | # setting up PATH 5 | CUSTOM_SCRIPTS=~/.dotfiles/scripts/emacs:~/.dotfiles/scripts/vim:~/.dotfiles/scripts/zsh 6 | LINUX_SCRIPTS=~/.options/ubuntu/scripts 7 | CARGO_BIN=~/.cargo/bin 8 | GO_BIN=/usr/local/go/bin 9 | HOME_LOCAL_BIN=~/.local/bin 10 | GRADLE_HOME=~/.sdkman/candidates/gradle/current 11 | YARN_PATH=~/.yarn/bin 12 | ANDROID_HOME=/home/ninrod/Android/Sdk 13 | 14 | PYENV_ROOT="$HOME/.pyenv" 15 | 16 | PATH=${PATH}:$CUSTOM_SCRIPTS 17 | PATH=${PATH}:$LINUX_SCRIPTS 18 | PATH=${PATH}:$CARGO_BIN 19 | PATH=${PATH}:$GO_BIN 20 | PATH=${PATH}:$HOME_LOCAL_BIN 21 | PATH=${PATH}:$YARN_PATH 22 | PATH=${PATH}:$ANDROID_HOME/tools 23 | PATH=${PATH}:$ANDROID_HOME/platform-tools 24 | PATH=${PATH}:$PYENV_ROOT 25 | PATH=${PATH}:$PYENV_ROOT/bin 26 | PATH="$PATH:$HOME/.rvm/bin" 27 | 28 | typeset -aU path 29 | 30 | # hack stolen from: https://github.com/rust-lang-nursery/rustfmt/issues/1687#issuecomment-308756211 31 | nvm_config() { 32 | cd $(readlink -f ~/.dotfiles) 33 | cd .. 34 | [[ ! -e secrets/nvm.zsh ]] && return 0 35 | source secrets/nvm.zsh 36 | if [[ -z ${USE_NVM+x} ]] || [[ $USE_NVM = 0 ]]; then 37 | return 0 38 | fi 39 | export NVM_DIR="$HOME/.nvm" 40 | [[ -e $NVM_DIR/nvm.sh ]] && source $NVM_DIR/nvm.sh # This loads nvm 41 | } 42 | 43 | #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! 44 | export SDKMAN_DIR="$HOME/.sdkman" 45 | [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" 46 | 47 | curdir=$(pwd -P) 48 | nvm_config 49 | cd $curdir 50 | -------------------------------------------------------------------------------- /options/wsl/favorites.zsh: -------------------------------------------------------------------------------- 1 | PROJECT_PATHS=( \ 2 | ~/code/dotfiles \ 3 | "/mnt/c/Users/deinf.filipe/OneDrive - BCB Azure/DEINF-SUBAP-3/THE RONESSA FILES" \ 4 | ) 5 | -------------------------------------------------------------------------------- /options/wsl/last_hook.zsh: -------------------------------------------------------------------------------- 1 | # exercism 2 | exercism_completion_file=~/.config/exercism/exercism_completion.zsh 3 | if [ -f $exercism_completion_file ]; then 4 | source $exercism_completion_file 5 | fi 6 | 7 | #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! 8 | export SDKMAN_DIR="/home/ninrod/.sdkman" 9 | [[ -s "/home/ninrod/.sdkman/bin/sdkman-init.sh" ]] && source "/home/ninrod/.sdkman/bin/sdkman-init.sh" 10 | 11 | eval "$(pyenv init -)" 12 | 13 | source ~/.rvm/scripts/rvm 14 | -------------------------------------------------------------------------------- /options/wsl/prompt.zsh: -------------------------------------------------------------------------------- 1 | # prompt config: nice unicode prompt chars: λ , › , ➤ , ∴ , → , ★ , ➜ , ❯, $ 2 | DOT_PROMPT_CHAR="❯" 3 | 4 | SHELL_PROMPT_INFO_LEVEL="0" 5 | 6 | hn=$(hostname) 7 | if [[ $hn:l == *"droplet"* ]]; then 8 | SHELL_PROMPT_INFO_LEVEL="2" 9 | fi 10 | -------------------------------------------------------------------------------- /options/wsl/readme.org: -------------------------------------------------------------------------------- 1 | * Microsoft WSL2 setup ideas 2 | 3 | 4 | -------------------------------------------------------------------------------- /options/wsl/scripts/bssh.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # bssh: better ssh chooser 4 | # credits: original hack by @marvinbelfort 5 | 6 | set -euo pipefail 7 | 8 | if [[ ! -f $BSSH_SERVERS_FILE ]]; then 9 | echo "[bssh]-> ERROR: no $BSSH_SERVERS_FILE file found." 10 | exit 0 11 | fi 12 | 13 | description=$(cat $BSSH_SERVERS_FILE | fzf) 14 | server=$(echo $description | cut -d "-" -f1) 15 | 16 | if [[ ! -z $server ]]; then 17 | # ping $server 18 | ssh $server -o ServerAliveInterval=5 -o ServerAliveCountMax=1 19 | fi 20 | 21 | # to copy your public key to a server 22 | # ssh-copy-id -i ~/.ssh/id_rsa.pub user@host 23 | -------------------------------------------------------------------------------- /options/wsl/setup.zsh: -------------------------------------------------------------------------------- 1 | # dir tracker setup 2 | [[ ! -e $DIR_HISTORY ]] && echo $HOME > $DIR_HISTORY 3 | 4 | # symlinkage 5 | source ~/.options/wsl/symlinks.zsh 6 | 7 | # arch specific java nuisance 8 | # wmname LG3D 9 | -------------------------------------------------------------------------------- /options/wsl/symlinks.zsh: -------------------------------------------------------------------------------- 1 | for file in ~/.options/wsl/**/makelink.zsh; do 2 | $file 3 | done 4 | -------------------------------------------------------------------------------- /options/wsl/wsl.zsh: -------------------------------------------------------------------------------- 1 | source ~/.options/wsl/environment.zsh 2 | source ~/.options/wsl/favorites.zsh 3 | source ~/.options/wsl/prompt.zsh 4 | source ~/.options/wsl/alias.zsh 5 | -------------------------------------------------------------------------------- /scripts/brew-installs/brew-apps.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | brew install findutils --with-default-names 4 | brew install gnu-indent --with-default-names 5 | brew install gnu-sed --with-default-names 6 | brew install gnutls --with-default-names 7 | brew install grep --with-default-names 8 | brew install gnu-tar --with-default-names 9 | brew install gawk --with-default-names 10 | 11 | -------------------------------------------------------------------------------- /scripts/emacs/background-connect-emacs-daemon.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | nohup emacsclient --create-frame "$@" > /dev/null 2>&1 & 4 | -------------------------------------------------------------------------------- /scripts/emacs/background-emacs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | log_file=~/.dotfiles/scripts/emacs/log/background-emacs.log 4 | 5 | nohup emacs "$@" > $log_file 2>&1 & 6 | # tail -f $log_file 7 | 8 | -------------------------------------------------------------------------------- /scripts/emacs/build-emacs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # tip: compiling with lucid 4 | # https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=emacs-lucid 5 | 6 | git clean -fd 7 | make maintainer-clean 8 | ./autogen.sh 9 | ./configure 10 | make 11 | sudo make install 12 | -------------------------------------------------------------------------------- /scripts/emacs/connect-emacs-daemon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | up-emacs-daemon.sh 4 | emacsclient --create-frame "$@" 5 | -------------------------------------------------------------------------------- /scripts/emacs/is-emacs-daemon-up.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # taken from: http://fontawesome.io/cheatsheet/ 4 | # other:  5 | 6 | # green = #00cd66 7 | # red = #fb4934 8 | # emacs = #873eb4 9 | emacsclient -e '(daemonp)' > /dev/null 2>&1 && echo %{F#427b58} || echo %{F#fb4934} 10 | -------------------------------------------------------------------------------- /scripts/emacs/kill-emacs-server.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # author: Filipe Silva (ninrod) 3 | 4 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 5 | GIT_ROOT=$(git rev-parse --show-toplevel) 6 | source $GIT_ROOT/zsh/termcolors.zsh 7 | 8 | if ! emacsclient -e "(ignore)" > /dev/null 2>&1; then 9 | echo -e "emacs daemon is already ${Green}killed${Rst}, nothing to do." 10 | exit 0 11 | fi 12 | 13 | echo -e "emacs daemon is ${Yellow}up${Rst}. Let us ${Red}kill${Rst} it..." 14 | 15 | emacsclient -e "(kill-emacs)"; rc=$? 16 | if [[ ! $rc = 0 ]]; then 17 | echo -e "there was a ${Red}problem${Rst} killing emacs server: $rc" 18 | exit $rc 19 | fi 20 | 21 | echo -e "emacs daemon was successfully ${Red}killed${Rst}." 22 | -------------------------------------------------------------------------------- /scripts/emacs/log/.gitignore: -------------------------------------------------------------------------------- 1 | *.log -------------------------------------------------------------------------------- /scripts/emacs/restart-emacs-daemon.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | kill-emacs-server.sh 4 | up-emacs-daemon.sh 5 | emacsclient --create-frame 6 | 7 | -------------------------------------------------------------------------------- /scripts/emacs/up-emacs-daemon.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # author: Filipe Silva (ninrod) 4 | 5 | SCRIPTPATH=$(cd $(dirname $0); pwd -P) && cd $SCRIPTPATH 6 | GIT_ROOT=$(git rev-parse --show-toplevel) 7 | source $GIT_ROOT/zsh/termcolors.zsh 8 | 9 | if emacsclient -e "(ignore)" > /dev/null 2>&1; then 10 | echo -e "emacs daemon is already ${Green}up${Rst}, nothing to do." 11 | exit 0 12 | else 13 | echo -e "emacs daemon is ${Red}killed${Rst}. Let us ${Green}ressurect${Rst} it..." 14 | fi 15 | 16 | # lang has to be pt_BR.UTF-8 by this point 17 | 18 | unamestr=$(uname -a) 19 | # if this isn't set, cedilla does not work in tumbleweed 20 | LANG=C 21 | if [[ "$unamestr" == *"Linux"* ]] && [[ $unamestr == *"ARCH"* ]]; then 22 | LANG=pt_BR.UTF-8 23 | fi 24 | 25 | emacs --daemon; rc=$? 26 | if [[ ! $rc = 0 ]]; then 27 | echo -e "there was a ${Red}problem${Rst} starting emacs daemon: $rc" 28 | exit $rc 29 | else 30 | echo -e "emacs daemon ${Blue}started${Rst}. success." 31 | fi 32 | 33 | boostrap_time=$(emacsclient -e "(emacs-init-time)") 34 | echo -e "emacs daemon boostrap time: ${Cyan}${boostrap_time}${Rst}" 35 | 36 | unamestr=$(uname -a) 37 | if [[ "$unamestr" == *"Linux"* ]] && [[ $unamestr == *"ARCH"* ]]; then 38 | notify-send 'emacs-daemon' "emacs daemon boostrap time: ${boostrap_time}" 39 | fi 40 | 41 | -------------------------------------------------------------------------------- /scripts/git/fetchall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # from: http://stackoverflow.com/a/12495234/4921402 4 | find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} fetch \; -------------------------------------------------------------------------------- /scripts/misc/linecount.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P)" && cd $SCRIPTPATH 4 | GIT_ROOT=$(git rev-parse --show-toplevel) && cd $GIT_ROOT 5 | 6 | ag -l | xargs wc -l | sort -n 7 | 8 | -------------------------------------------------------------------------------- /scripts/terminal/bssh.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # bssh: fuzzy ssh chooser 4 | # credits: original hack by @marvinbelfort 5 | 6 | set -euo pipefail 7 | 8 | if [[ ! -f $BSSH_SERVERS_FILE ]]; then 9 | echo "[bssh]-> ERROR: no $BSSH_SERVERS_FILE file found." 10 | exit 0 11 | fi 12 | 13 | description=$(cat $BSSH_SERVERS_FILE | fzf) 14 | server=$(echo $description | cut -d "-" -f1) 15 | 16 | if [[ ! -z $server ]]; then 17 | # ping $server 18 | ssh $server -o ServerAliveInterval=5 -o ServerAliveCountMax=1 19 | fi 20 | 21 | # to copy your public key to a server 22 | # ssh-copy-id -i ~/.ssh/id_rsa.pub user@host 23 | -------------------------------------------------------------------------------- /scripts/terminal/truecolor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # this file was originally taken from https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh 3 | # which was originally taken from iterm2 https://github.com/gnachman/iTerm2/blob/master/tests/24-bit-color.sh 4 | # 5 | # This file echoes a bunch of 24-bit color codes 6 | # to the terminal to demonstrate its functionality. 7 | # The foreground escape sequence is ^[38;2;;;m 8 | # The background escape sequence is ^[48;2;;;m 9 | # range from 0 to 255 inclusive. 10 | # The escape sequence ^[0m returns output to default 11 | 12 | setBackgroundColor() 13 | { 14 | #printf '\x1bPtmux;\x1b\x1b[48;2;%s;%s;%sm' $1 $2 $3 15 | printf '\x1b[48;2;%s;%s;%sm' $1 $2 $3 16 | } 17 | 18 | resetOutput() 19 | { 20 | echo -en "\x1b[0m\n" 21 | } 22 | 23 | # Gives a color $1/255 % along HSV 24 | # Who knows what happens when $1 is outside 0-255 25 | # Echoes "$red $green $blue" where 26 | # $red $green and $blue are integers 27 | # ranging between 0 and 255 inclusive 28 | rainbowColor() 29 | { 30 | let h=$1/43 31 | let f=$1-43*$h 32 | let t=$f*255/43 33 | let q=255-t 34 | 35 | if [ $h -eq 0 ] 36 | then 37 | echo "255 $t 0" 38 | elif [ $h -eq 1 ] 39 | then 40 | echo "$q 255 0" 41 | elif [ $h -eq 2 ] 42 | then 43 | echo "0 255 $t" 44 | elif [ $h -eq 3 ] 45 | then 46 | echo "0 $q 255" 47 | elif [ $h -eq 4 ] 48 | then 49 | echo "$t 0 255" 50 | elif [ $h -eq 5 ] 51 | then 52 | echo "255 0 $q" 53 | else 54 | # execution should never reach here 55 | echo "0 0 0" 56 | fi 57 | } 58 | 59 | for i in `seq 0 127`; do 60 | setBackgroundColor $i 0 0 61 | echo -en " " 62 | done 63 | resetOutput 64 | for i in `seq 255 -1 128`; do 65 | setBackgroundColor $i 0 0 66 | echo -en " " 67 | done 68 | resetOutput 69 | 70 | for i in `seq 0 127`; do 71 | setBackgroundColor 0 $i 0 72 | echo -n " " 73 | done 74 | resetOutput 75 | for i in `seq 255 -1 128`; do 76 | setBackgroundColor 0 $i 0 77 | echo -n " " 78 | done 79 | resetOutput 80 | 81 | for i in `seq 0 127`; do 82 | setBackgroundColor 0 0 $i 83 | echo -n " " 84 | done 85 | resetOutput 86 | for i in `seq 255 -1 128`; do 87 | setBackgroundColor 0 0 $i 88 | echo -n " " 89 | done 90 | resetOutput 91 | 92 | for i in `seq 0 127`; do 93 | setBackgroundColor `rainbowColor $i` 94 | echo -n " " 95 | done 96 | resetOutput 97 | for i in `seq 255 -1 128`; do 98 | setBackgroundColor `rainbowColor $i` 99 | echo -n " " 100 | done 101 | resetOutput 102 | -------------------------------------------------------------------------------- /scripts/tmux/tmux-attach.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [[ -z $TMUX ]] && [[ -z $EMACS ]] && { tmux attach || exec tmux new-session -A -s tmux -n shell; } -------------------------------------------------------------------------------- /scripts/vim/build-vim.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | print "building vim from $VIM_SRC_DIR" 4 | 5 | builtin cd $VIM_SRC_DIR && 6 | git clean -fd && 7 | make distclean && 8 | make clean && 9 | ./configure --prefix=/usr --with-features=huge --enable-multibyte && 10 | make -j4 && 11 | sudo make install 12 | -------------------------------------------------------------------------------- /scripts/zsh/build-zsh.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | print "building zsh from $ZSH_SRC_DIR" 4 | 5 | builtin cd "$ZSH_SRC_DIR" && 6 | git clean -fd && 7 | make distclean && 8 | make clean && 9 | ./Util/preconfig && 10 | ./configure && 11 | make -j9 && 12 | make check && 13 | sudo make install -------------------------------------------------------------------------------- /scripts/zsh/fssh.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # to use, define a hosts file $servers with the following contents: 4 | 5 | # blahblah.com - My delicious server 6 | # ilovemyserver.org - My other server 7 | # so.on.and.so.forth - ... 8 | 9 | user=myuser 10 | servers=/root/.secret/servers_quick_list 11 | description=$(cat $servers | fzf) 12 | server=$(echo $description | cut -d "-" -f1) 13 | 14 | [[ -n $server ]] && exec ssh $server -l $user 15 | 16 | -------------------------------------------------------------------------------- /tmux/deploy.zsh: -------------------------------------------------------------------------------- 1 | verifylink ~/.tmux.conf 2 | updatelinks ~/.tmux.conf tmux/main.tmux 3 | 4 | verifylink ~/.tmux.d 5 | updatelinks ~/.tmux.d tmux -------------------------------------------------------------------------------- /tmux/keybinds.tmux: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | 3 | # vi mode settings 4 | # Note: if you have EDITOR=vim set 5 | # then the following two settings aren't needed 6 | # Use Vi style key bindings to move around command line mode 7 | set-option -g status-keys vi 8 | # Use Vi style key bindings to move around copy mode 9 | setw -g mode-keys vi 10 | # Remove delay when pressing esc in Vim 11 | set -sg escape-time 0 12 | 13 | unbind C-b 14 | set -g prefix C-Space 15 | 16 | # Quick key for moving back to the previous window 17 | bind-key p last-window 18 | 19 | bind Space copy-mode 20 | bind r next-layout 21 | 22 | # Vim style bindings for pane movement 23 | bind-key -r h select-pane -L 24 | bind-key -r j select-pane -D 25 | bind-key -r k select-pane -U 26 | bind-key -r l select-pane -R 27 | 28 | # vim splits 29 | bind-key y split-window -h 30 | bind-key x split-window -v 31 | 32 | # moving panes 33 | bind-key g command-prompt -p "join pane from:" "join-pane -s '%%'" 34 | bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'" 35 | 36 | # Make resizing panes easier 37 | bind-key Left resize-pane -L 5 38 | bind-key Right resize-pane -R 5 39 | bind-key Up resize-pane -U 5 40 | bind-key Down resize-pane -D 5 41 | bind-key = select-layout even-vertical 42 | bind-key | select-layout even-horizontal 43 | 44 | bind-key m set -g mouse 45 | 46 | # toggles tmux bar on/off 47 | bind-key - set status 48 | 49 | #### directly bind function keys 50 | # fast window selection 51 | bind -n F1 select-window -t 1 52 | bind -n F2 select-window -t 2 53 | bind -n F3 select-window -t 3 54 | bind -n F4 select-window -t 4 55 | bind -n F5 select-window -t 5 56 | bind -n F6 new-window 57 | 58 | # renames tmux window 59 | # more info here: http://unix.stackexchange.com/a/269542/155613 60 | bind -n F7 command-prompt "rename-window '%%'" 61 | 62 | # reload tmux config 63 | bind -n F8 source ~/.tmux.conf 64 | 65 | # rotate through different pre set layouts 66 | bind -n F9 next-layout 67 | 68 | # rotate through different pre set layouts 69 | bind -n F10 copy-mode 70 | 71 | # mouse support toggle needs tmux 2.2 72 | bind -n F11 set -g mouse 73 | 74 | # toggles tmux bar on/off 75 | bind-key -n F12 set status 76 | 77 | # switch panes using without prefix 78 | bind -n M-Left select-pane -L 79 | bind -n M-Right select-pane -R 80 | bind -n M-Up select-pane -U 81 | bind -n M-Down select-pane -D 82 | 83 | # create panes with prefix 84 | bind -n C-M-Left split-window -h 85 | bind -n C-M-Right split-window -h 86 | bind -n C-M-Up split-window -v 87 | bind -n C-M-Down split-window -v 88 | -------------------------------------------------------------------------------- /tmux/main.tmux: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | 3 | source ~/.tmux.d/options.tmux 4 | source ~/.tmux.d/osx-hacks.tmux 5 | source ~/.tmux.d/truecolor-hacks.tmux 6 | source ~/.tmux.d/keybinds.tmux 7 | source ~/.tmux.d/theme.tmux 8 | -------------------------------------------------------------------------------- /tmux/options.tmux: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | 3 | # Prevent tmux from renaming the tab when processes change 4 | set-option -g allow-rename off 5 | 6 | # Tells tmux up front what shell to expect 7 | def_shell=/bin/zsh 8 | set-option -g default-shell $def_shell 9 | 10 | # Set base to 1 11 | set -g base-index 1 12 | 13 | # Enable UTF-8 support in status bar 14 | set -g status on 15 | 16 | # Increase scrollback lines 17 | set -g history-limit 30000 18 | 19 | # Renumber windows automatically after removing a window 20 | set-option -g renumber-windows on 21 | -------------------------------------------------------------------------------- /tmux/osx-hacks.tmux: -------------------------------------------------------------------------------- 1 | # small hack for fixing `open` behaviour on OSx. Uneeded in linux. 2 | # if-shell "uname | grep -q Darwin" "set -g default-command 'reattach-to-user-namespace -l $def_shell'" 3 | 4 | # use osx pbcopy 5 | # if-shell "uname | grep -q Darwin" "bind -t vi-copy y copy-pipe 'pbcopy'" 6 | -------------------------------------------------------------------------------- /tmux/theme.tmux: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | 3 | # load symlinked theme specific tmux bar configuration generated via tmuxline.vim 4 | source ~/.tmux.d/tmuxline/simpledark.tmux 5 | -------------------------------------------------------------------------------- /tmux/tmuxline/dracula.tmux: -------------------------------------------------------------------------------- 1 | # This tmux statusbar config was created by tmuxline.vim 2 | # on Mon, 24 Oct 2016 3 | 4 | set -g status-bg "colour59" 5 | set -g message-command-fg "colour117" 6 | set -g status-justify "left" 7 | set -g status-left-length "100" 8 | set -g status "on" 9 | set -g pane-active-border-fg "colour215" 10 | set -g message-bg "colour59" 11 | set -g status-right-length "100" 12 | set -g status-right-attr "none" 13 | set -g message-fg "colour117" 14 | set -g message-command-bg "colour59" 15 | set -g status-attr "none" 16 | set -g pane-border-fg "colour59" 17 | set -g status-left-attr "none" 18 | setw -g window-status-fg "colour231" 19 | setw -g window-status-attr "none" 20 | setw -g window-status-activity-bg "colour59" 21 | setw -g window-status-activity-attr "none" 22 | setw -g window-status-activity-fg "colour215" 23 | setw -g window-status-separator "" 24 | setw -g window-status-bg "colour59" 25 | set -g status-left "#[fg=colour17,bg=colour215] #S #[fg=colour215,bg=colour59,nobold,nounderscore,noitalics]" 26 | set -g status-right "#[fg=colour61,bg=colour59,nobold,nounderscore,noitalics]#[fg=colour231,bg=colour61] %Y-%m-%d | %H:%M #[fg=colour141,bg=colour61,nobold,nounderscore,noitalics]#[fg=colour17,bg=colour141] #h " 27 | setw -g window-status-format "#[fg=colour231,bg=colour59] #I |#[fg=colour231,bg=colour59] #W " 28 | setw -g window-status-current-format "#[fg=colour59,bg=colour59,nobold,nounderscore,noitalics]#[fg=colour117,bg=colour59] #I |#[fg=colour117,bg=colour59] #W #[fg=colour59,bg=colour59,nobold,nounderscore,noitalics]" 29 | -------------------------------------------------------------------------------- /tmux/tmuxline/gruvbox.tmux: -------------------------------------------------------------------------------- 1 | # This tmux statusbar config was created by tmuxline.vim 2 | # on Wed, 06 Jul 2016 3 | 4 | set -g status-bg "colour237" 5 | set -g message-command-fg "colour235" 6 | set -g status-justify "left" 7 | set -g status-left-length "100" 8 | set -g status "on" 9 | set -g pane-active-border-fg "colour208" 10 | set -g message-bg "colour243" 11 | set -g status-right-length "100" 12 | set -g status-right-attr "none" 13 | set -g message-fg "colour235" 14 | set -g message-command-bg "colour243" 15 | set -g status-attr "none" 16 | set -g pane-border-fg "colour243" 17 | set -g status-left-attr "none" 18 | setw -g window-status-fg "colour246" 19 | setw -g window-status-attr "none" 20 | setw -g window-status-activity-bg "colour237" 21 | setw -g window-status-activity-attr "none" 22 | setw -g window-status-activity-fg "colour208" 23 | setw -g window-status-separator "" 24 | setw -g window-status-bg "colour237" 25 | set -g status-left "#[fg=colour235,bg=colour208] #S #[fg=colour208,bg=colour237,nobold,nounderscore,noitalics]" 26 | set -g status-right "#[fg=colour243,bg=colour237,nobold,nounderscore,noitalics]#[fg=colour235,bg=colour243] %Y-%m-%d | %H:%M #[fg=colour208,bg=colour243,nobold,nounderscore,noitalics]#[fg=colour235,bg=colour208] #h " 27 | setw -g window-status-format "#[fg=colour246,bg=colour237] #I |#[fg=colour246,bg=colour237] #W " 28 | setw -g window-status-current-format "#[fg=colour237,bg=colour243,nobold,nounderscore,noitalics]#[fg=colour235,bg=colour243] #I |#[fg=colour235,bg=colour243] #W #[fg=colour243,bg=colour237,nobold,nounderscore,noitalics]" 29 | -------------------------------------------------------------------------------- /tmux/tmuxline/jellybeans.tmux: -------------------------------------------------------------------------------- 1 | # This tmux statusbar config was created by tmuxline.vim 2 | # on Tue, 25 Oct 2016 3 | 4 | set -g status-bg "colour236" 5 | set -g message-command-fg "colour236" 6 | set -g status-justify "left" 7 | set -g status-left-length "100" 8 | set -g status "on" 9 | set -g pane-active-border-fg "colour103" 10 | set -g message-bg "colour103" 11 | set -g status-right-length "100" 12 | set -g status-right-attr "none" 13 | set -g message-fg "colour236" 14 | set -g message-command-bg "colour103" 15 | set -g status-attr "none" 16 | set -g pane-border-fg "colour239" 17 | set -g status-left-attr "none" 18 | setw -g window-status-fg "colour103" 19 | setw -g window-status-attr "none" 20 | setw -g window-status-activity-bg "colour236" 21 | setw -g window-status-activity-attr "none" 22 | setw -g window-status-activity-fg "colour103" 23 | setw -g window-status-separator "" 24 | setw -g window-status-bg "colour236" 25 | set -g status-left "#[fg=colour236,bg=colour103] #S #[fg=colour103,bg=colour236,nobold,nounderscore,noitalics]" 26 | set -g status-right "#[fg=colour239,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour253,bg=colour239] %Y-%m-%d | %H:%M #[fg=colour103,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour236,bg=colour103] #h " 27 | setw -g window-status-format "#[fg=colour103,bg=colour236] #I |#[fg=colour103,bg=colour236] #W " 28 | setw -g window-status-current-format "#[fg=colour236,bg=colour103,nobold,nounderscore,noitalics]#[fg=colour236,bg=colour103] #I |#[fg=colour236,bg=colour103] #W #[fg=colour103,bg=colour236,nobold,nounderscore,noitalics]" 29 | -------------------------------------------------------------------------------- /tmux/tmuxline/powerline.tmux: -------------------------------------------------------------------------------- 1 | # This tmux statusbar config was created by tmuxline.vim 2 | # on Wed, 23 Nov 2016 3 | 4 | set -g status-bg "colour234" 5 | set -g message-command-fg "colour231" 6 | set -g status-justify "left" 7 | set -g status-left-length "100" 8 | set -g status "on" 9 | set -g pane-active-border-fg "colour254" 10 | set -g message-bg "colour31" 11 | set -g status-right-length "100" 12 | set -g status-right-attr "none" 13 | set -g message-fg "colour231" 14 | set -g message-command-bg "colour31" 15 | set -g status-attr "none" 16 | set -g pane-border-fg "colour240" 17 | set -g status-left-attr "none" 18 | setw -g window-status-fg "colour250" 19 | setw -g window-status-attr "none" 20 | setw -g window-status-activity-bg "colour234" 21 | setw -g window-status-activity-attr "none" 22 | setw -g window-status-activity-fg "colour250" 23 | setw -g window-status-separator "" 24 | setw -g window-status-bg "colour234" 25 | set -g status-left "#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold,nounderscore,noitalics]" 26 | set -g status-right "#[fg=colour236,bg=colour234,nobold,nounderscore,noitalics]#[fg=colour247,bg=colour236] %Y-%m-%d | %H:%M #[fg=colour252,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour235,bg=colour252] #h " 27 | setw -g window-status-format "#[fg=colour244,bg=colour234] #I |#[fg=colour250,bg=colour234] #W " 28 | setw -g window-status-current-format "#[fg=colour234,bg=colour31,nobold,nounderscore,noitalics]#[fg=colour117,bg=colour31] #I |#[fg=colour231,bg=colour31,bold] #W #[fg=colour31,bg=colour234,nobold,nounderscore,noitalics]" 29 | -------------------------------------------------------------------------------- /tmux/tmuxline/simpledark.tmux: -------------------------------------------------------------------------------- 1 | # This tmux statusbar config was created by tmuxline.vim 2 | # on Tue, 01 Nov 2016 3 | 4 | set -g message-command-style fg="#b0b0b0",bg="#303030" 5 | set -g message-style bg="#303030",fg="#b0b0b0" 6 | set -g pane-active-border-style fg="#ff3030" 7 | set -g pane-border-style fg="#404040" 8 | set -g status-left-style none 9 | set -g status-right-style none 10 | set -g status-style bg="#202020" 11 | set -g status-style none 12 | setw -g window-status-activity-style bg="#202020",fg="#505050",none 13 | setw -g window-status-style fg="#505050",bg="#202020",none 14 | 15 | set -g status-left-length "100" 16 | set -g status "on" 17 | set -g status-right-length "100" 18 | 19 | set -g status-justify "left" 20 | setw -g window-status-separator "" 21 | 22 | set -g status-left "#[fg=#505050,bg=#202020] #S #[fg=#202020,bg=#202020,nobold,nounderscore,noitalics]" 23 | set -g status-right "#[fg=#202020,bg=#202020,nobold,nounderscore,noitalics]#[fg=#505050,bg=#202020] %H:%M - %d/%m/%Y #[fg=#202020,bg=#202020,nobold,nounderscore,noitalics]#[fg=#505050,bg=#202020] | #(echo $USER)@#h" 24 | setw -g window-status-format "#[fg=#505050,bg=#202020] #I |#[fg=#505050,bg=#202020] #W " 25 | setw -g window-status-current-format "#[fg=#202020,bg=#303030,nobold,nounderscore,noitalics]#[fg=#b0b0b0,bg=#303030] #I |#[fg=#b0b0b0,bg=#303030] #W #[fg=#303030,bg=#202020,nobold,nounderscore,noitalics]" 26 | -------------------------------------------------------------------------------- /tmux/tmuxline/tomorrow-night-eighties.tmux: -------------------------------------------------------------------------------- 1 | # This tmux statusbar config was created by tmuxline.vim 2 | # on Tue, 01 Nov 2016 3 | 4 | set -g status-bg "colour238" 5 | set -g message-command-fg "colour251" 6 | set -g status-justify "left" 7 | set -g status-left-length "100" 8 | set -g status "on" 9 | set -g pane-active-border-fg "colour114" 10 | set -g message-bg "colour239" 11 | set -g status-right-length "100" 12 | set -g status-right-attr "none" 13 | set -g message-fg "colour251" 14 | set -g message-command-bg "colour239" 15 | set -g status-attr "none" 16 | set -g pane-border-fg "colour239" 17 | set -g status-left-attr "none" 18 | setw -g window-status-fg "colour246" 19 | setw -g window-status-attr "none" 20 | setw -g window-status-activity-bg "colour238" 21 | setw -g window-status-activity-attr "none" 22 | setw -g window-status-activity-fg "colour114" 23 | setw -g window-status-separator "" 24 | setw -g window-status-bg "colour238" 25 | set -g status-left "#[fg=colour236,bg=colour114] #S #[fg=colour114,bg=colour238,nobold,nounderscore,noitalics]" 26 | set -g status-right "#[fg=colour239,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour248,bg=colour239] %Y-%m-%d | %H:%M #[fg=colour246,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour238,bg=colour246] #h " 27 | setw -g window-status-format "#[fg=colour246,bg=colour238] #I |#[fg=colour246,bg=colour238] #W " 28 | setw -g window-status-current-format "#[fg=colour238,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour251,bg=colour239] #I |#[fg=colour251,bg=colour239] #W #[fg=colour239,bg=colour238,nobold,nounderscore,noitalics]" 29 | -------------------------------------------------------------------------------- /tmux/truecolor-hacks.tmux: -------------------------------------------------------------------------------- 1 | # Ensure terminal starts with its own colour scheme (defined below) 2 | set -g default-terminal "xterm-256color" 3 | 4 | # add support for truecolor 5 | # more info here: https://github.com/ninrod/tricks/blob/master/shell/tmux.md#the-standard-way-since-tmux-22 6 | # tmux issue: https://github.com/tmux/tmux/issues/34 7 | # fixed since version 2.2 8 | # credits to github user sunaku: http://github.com/sunaku 9 | # usage instructions: http://sunaku.github.io/tmux-24bit-color.html#usage 10 | set-option -ga terminal-overrides ",xterm-256color:Tc" -------------------------------------------------------------------------------- /vim/.gitignore: -------------------------------------------------------------------------------- 1 | bundle/ 2 | .netrwhist 3 | autoload/ 4 | -------------------------------------------------------------------------------- /vim/autocommands.vim: -------------------------------------------------------------------------------- 1 | " better defaults --------------- 2 | " foldmethod configurations 3 | autocmd BufRead * setlocal foldmethod=marker 4 | set foldlevelstart=0 5 | 6 | " jump to last cursor 7 | autocmd BufReadPost * 8 | \ if line("'\"") > 0 && line("'\"") <= line("$") | 9 | \ exe "normal g`\"" | 10 | \ endif 11 | 12 | " disabling auto commenting on new line, e.g. 'o' and 'O' 13 | autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o 14 | 15 | " machit ------------------------ 16 | " machit.vim extends % operator to work on html tags. 17 | runtime macros/matchit.vim 18 | autocmd BufReadPre,FileReadPre *.md,*.jsp MatchDebug 19 | 20 | " binds ---------------------- 21 | " enabling to work properly on the quickfix window 22 | autocmd BufReadPost quickfix nnoremap 23 | 24 | " fix for in command-line-window 25 | silent! autocmd CmdwinEnter * nunmap 26 | silent! autocmd CmdwinLeave * nnoremap :w 27 | 28 | " quick bind for a 'wrap' command 29 | command! -nargs=* Wrap set wrap linebreak nolist 30 | 31 | 32 | " filetypes ---------------------- 33 | " specify syntax highlighting for specific files 34 | autocmd Bufread,BufNewFile *.md set filetype=markdown " Vim interprets .md as 'modula2' otherwise, see :set filetype? 35 | autocmd Bufread,BufNewFile *.bowerrc set filetype=json 36 | 37 | " http://vim.wikia.com/wiki/Word_wrap_without_line_breaks 38 | autocmd Filetype markdown setlocal wrap linebreak nolist textwidth=0 wrapmargin=0 conceallevel=0 fdm=expr 39 | autocmd FileType sh,ruby,yaml,zsh,vim setlocal shiftwidth=2 tabstop=2 expandtab 40 | autocmd FileType java setlocal shiftwidth=4 tabstop=4 expandtab 41 | autocmd Filetype gitcommit setlocal spell textwidth=80 42 | -------------------------------------------------------------------------------- /vim/cursorshape.vim: -------------------------------------------------------------------------------- 1 | "iterm 2 specific: 2 | " escape sequence: `^[]1337;CursorShape=N^G`. where: 3 | " N=0: block; 4 | " N=1: line; 5 | " N=2: underline; 6 | " ^G = \x7 7 | " ˆ[ = \e 8 | " more info here http://www.iterm2.com/documentation-escape-codes.html 9 | " better cursor shape for vim in terminal (works with iTerm2) 10 | " see: https://www.iterm2.com/documentation-escape-codes.html 11 | " SI = START insert mode 12 | " EI = END insert mode 13 | " SR = START replace mode 14 | 15 | " if has('gui_running') 16 | " if empty($TMUX) 17 | " let &t_SI = "\[6 q" 18 | " let &t_EI = "\[2 q" 19 | " let &t_SR = "\[4 q" 20 | " else 21 | " let &t_SI = "\Ptmux;\\[6 q\\\" 22 | " let &t_EI = "\Ptmux;\\[2 q\\\" 23 | " let &t_SR = "\Ptmux;\\[4 q\\\" 24 | " endif 25 | " endif 26 | -------------------------------------------------------------------------------- /vim/deploy.zsh: -------------------------------------------------------------------------------- 1 | verifylink ~/.vim 2 | updatelinks ~/.vim vim -------------------------------------------------------------------------------- /vim/font.vim: -------------------------------------------------------------------------------- 1 | if has("gui_running") 2 | set guifont=Fantasque\ Sans\ Mono\ 16 3 | endif 4 | -------------------------------------------------------------------------------- /vim/hacks.vim: -------------------------------------------------------------------------------- 1 | " sunaku's vim/tmux 256color hack. more info here: 2 | " https://github.com/ninrod/tricks/blob/master/shell/tmux.md#sunakus-hack-for-fixing-256-colors-colorschemes-for-vim-inside-tmux 3 | if &term =~ '256color' 4 | " disable Background Color Erase (BCE) so that color schemes 5 | " render properly when inside 256-color tmux and GNU screen. 6 | " see also http://snk.tuxfamily.org/log/vim-256color-bce.html 7 | set t_ut= 8 | endif 9 | -------------------------------------------------------------------------------- /vim/keybinds.vim: -------------------------------------------------------------------------------- 1 | " core binds {{{ 2 | 3 | nnoremap gl G 4 | vnoremap gl G 5 | onoremap gl G 6 | nnoremap - :noh 7 | xnoremap - :noh 8 | nnoremap :w 9 | 10 | nnoremap Q q 11 | nnoremap q ZQ 12 | 13 | nnoremap ( { 14 | xnoremap ( { 15 | nnoremap ) } 16 | xnoremap ) } 17 | 18 | xnoremap io iw 19 | xnoremap ao aw 20 | onoremap io iw 21 | onoremap ao aw 22 | 23 | omap ir i[ 24 | omap ar a[ 25 | xmap ir i[ 26 | xmap ar a[ 27 | 28 | omap ic i{ 29 | omap ac a{ 30 | xmap ic i{ 31 | xmap ac a{ 32 | 33 | nmap s 34 | omap s 35 | xmap s 36 | 37 | " emacs keybind standardization 38 | nnoremap mk :bd 39 | 40 | " }}} 41 | " window operations {{{ 42 | 43 | nmap y v 44 | nmap x s 45 | nmap h h 46 | nmap j j 47 | nmap k k 48 | nmap l l 49 | 50 | nmap j 51 | nmap k 52 | 53 | " }}} 54 | " jungunn/vim-easy-align {{{ 55 | 56 | nmap ga (EasyAlign) 57 | xmap ga (EasyAlign) 58 | 59 | " }}} 60 | " fzf.vim {{{ 61 | 62 | nnoremap g :GitFiles 63 | nnoremap i :Buffers 64 | nnoremap . :Files 65 | nnoremap gh :History 66 | 67 | " FZF Mapping selecting mappings 68 | nmap (fzf-maps-n) 69 | xmap (fzf-maps-x) 70 | omap (fzf-maps-o) 71 | 72 | " FZF Insert mode completion 73 | imap (fzf-complete-word) 74 | imap (fzf-complete-path) 75 | imap (fzf-complete-file-ag) 76 | imap (fzf-complete-line) 77 | 78 | " }}} 79 | " nin-scratch {{{ 80 | 81 | nnoremap gs :NinScratch 82 | 83 | " }}} 84 | " multiple-cursors {{{ 85 | 86 | nnoremap K :MultipleCursorsFind / 87 | vnoremap K :MultipleCursorsFind / 88 | 89 | " }}} 90 | " BufExplorer {{{ 91 | 92 | nnoremap mi :BufExplorer 93 | 94 | " }}} 95 | " ranger.vim {{{ 96 | 97 | nnoremap :Ranger 98 | 99 | " }}} 100 | 101 | -------------------------------------------------------------------------------- /vim/options.vim: -------------------------------------------------------------------------------- 1 | set encoding=utf-8 2 | syntax on 3 | filetype plugin indent on 4 | 5 | " add truecolor support, if available 6 | if has('termguicolors') || !&term=~'linux' 7 | set termguicolors 8 | endif 9 | 10 | " backups 11 | set nobackup 12 | set nowritebackup 13 | set noswapfile 14 | 15 | " better '/' 16 | set incsearch 17 | set hlsearch 18 | set ignorecase 19 | 20 | " convert tabs to spaces 21 | set expandtab 22 | set tabstop=2 23 | set shiftwidth=2 24 | 25 | set history=1000 26 | 27 | " diff options. without this Gdiff was splitting horizontally on OSx. 28 | set diffopt=filler,vertical 29 | 30 | " show partial commands from operator pending mode 31 | set showcmd 32 | 33 | " show line numbers on status line 34 | set ruler 35 | 36 | " show relative line numbers 37 | set relativenumber 38 | 39 | " with this option on, a buffer is marked as ‘hidden’ if it has unsaved changes, and it is not currently loaded in a window. 40 | " If you try and quit Vim while there are hidden buffers, you will raise an error: 41 | " E162: No write since last change for buffer “a.txt” 42 | set hidden 43 | 44 | " fix backspace behaviour 45 | set backspace=indent,eol,start 46 | 47 | " show trailing spaces 48 | set list listchars=tab:\ \ ,trail:· 49 | 50 | " Get rid of the delay when pressing O (for example) 51 | " http://stackoverflow.com/questions/2158516/vim-delay-before-o-opens-a-new-line 52 | set timeout timeoutlen=1000 ttimeoutlen=100 53 | 54 | " Always show status bar 55 | set laststatus=2 56 | 57 | " Hide the toolbar 58 | set guioptions-=T 59 | 60 | " Autoload files that have changed outside of vim 61 | set autoread 62 | 63 | " better gui clipboard integration 64 | " http://stackoverflow.com/questions/8134647/copy-and-paste-in-vim-via-keyboard-between-different-mac-terminals 65 | " http://vim.wikia.com/wiki/Accessing_the_system_clipboard 66 | set clipboard=unnamedplus 67 | let uname = system("uname -a") 68 | if uname =~ "Darwin" 69 | set clipboard=unnamed 70 | endif 71 | 72 | " Don't show intro 73 | set shortmess+=I 74 | 75 | " better splits 76 | set splitbelow 77 | set splitright 78 | 79 | " Highlight the current line 80 | " set cursorline 81 | 82 | " Visual autocomplete for command menu (e.g. :e ~/path/to/file) 83 | " partially lifted from http://stackoverflow.com/a/15583861/4921402 84 | set wildmenu 85 | set wildmode=list:longest,list:full 86 | set wildignore+=*/.hg/*,*/.svn/*.,*/.DS_Store,*/.idea/*,*/.tmp/*,*/target/* 87 | 88 | " highlight a matching [{()}] when cursor is placed on start/end character 89 | set showmatch 90 | 91 | " do not wrap long lines 92 | set nowrap 93 | 94 | " indicates a wrap line continuation 95 | set showbreak=←← 96 | 97 | " redraw only when we need to (i.e. don't redraw when executing a macro) 98 | set lazyredraw 99 | 100 | " syntax/sh.vim adds `.` to iskeyword(verify with :verbose set iskeyword?). so `w` jumps past it. see :h g:sh_isk 101 | let g:sh_noisk=1 102 | 103 | let g:netrw_banner = 0 104 | let g:netrw_bufsettings = 'relativenumber, number' 105 | let g:netrw_liststyle = 1 106 | " let g:netrw_keepdir = 0 107 | -------------------------------------------------------------------------------- /vim/plugins.vim: -------------------------------------------------------------------------------- 1 | " execute pathogen#infect('bundle/{}/{}') 2 | execute pathogen#infect('~/.dotfiles/deps/vim/{}/{}') 3 | 4 | " appearance 5 | let g:tmuxline_powerline_separators = 0 6 | let g:lightline = {'colorscheme': 'molokai'} 7 | 8 | let g:gruvbox_contrast_dark='hard' 9 | let g:gruvbox_invert_selection=0 10 | 11 | set background=dark 12 | if &term=~'linux' 13 | colorscheme default 14 | else 15 | colorscheme gruvbox 16 | endif 17 | 18 | " for whitespaces at the end of the lines: 19 | highlight SpecialKey ctermfg=124 guifg=#af3a03 20 | 21 | " rainbow configs 22 | let g:rainbow_active = 1 23 | 24 | " multiple cursors config 25 | let g:multi_cursor_exit_from_visual_mode=0 26 | let g:multi_cursor_exit_from_insert_mode=0 27 | 28 | " fzf installation 29 | set rtp+=~/.fzf 30 | 31 | " Activation based on file type 32 | augroup rainbow_lisp 33 | autocmd! 34 | autocmd FileType lisp,clojure,scheme RainbowParentheses 35 | augroup END 36 | -------------------------------------------------------------------------------- /vim/readme.org: -------------------------------------------------------------------------------- 1 | #+STARTUP: indent 2 | #+STARTUP: overview 3 | 4 | * Ninrod's vim configuration 5 | - I've split up vimrc into manageable smaller files 6 | 7 | -------------------------------------------------------------------------------- /vim/vimrc: -------------------------------------------------------------------------------- 1 | source ~/.vim/options.vim 2 | source ~/.vim/autocommands.vim 3 | source ~/.vim/hacks.vim 4 | source ~/.vim/plugins.vim 5 | source ~/.vim/keybinds.vim 6 | source ~/.vim/font.vim 7 | source ~/.vim/cursorshape.vim 8 | 9 | -------------------------------------------------------------------------------- /vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.fontSize": 16, 3 | "editor.lineNumbers": "off", 4 | "emmet.includeLanguages": { 5 | "javascript": "javascriptreact" 6 | }, 7 | "vim.useSystemClipboard": true, 8 | "vim.incsearch": true, 9 | "vim.hlsearch": true, 10 | "keyboard.dispatch": "keyCode", 11 | "vim.normalModeKeyBindingsNonRecursive": [ 12 | { 13 | "before": [ 14 | "-" 15 | ], 16 | "after": [], 17 | "commands": [ 18 | { 19 | "command": ":nohl" 20 | } 21 | ] 22 | }, 23 | { 24 | "before": [ 25 | "" 26 | ], 27 | "after": [], 28 | "commands": [ 29 | { 30 | "command": "workbench.action.files.save", 31 | "args": [] 32 | } 33 | ] 34 | }, 35 | { 36 | "before": [ 37 | "q" 38 | ], 39 | "after": [], 40 | "commands": [ 41 | { 42 | "command": "workbench.action.closeActiveEditor", 43 | "args": [] 44 | } 45 | ] 46 | }, 47 | { 48 | "before": [ 49 | "g", 50 | "o" 51 | ], 52 | "after": [ 53 | "g", 54 | "g" 55 | ] 56 | }, 57 | { 58 | "before": [ 59 | "g", 60 | "l" 61 | ], 62 | "after": [ 63 | "G" 64 | ] 65 | }, 66 | { 67 | "before": [ 68 | "z", 69 | "-" 70 | ], 71 | "after": [ 72 | "z", 73 | "b" 74 | ] 75 | }, 76 | { 77 | "before": [ 78 | ")" 79 | ], 80 | "after": [ 81 | "}" 82 | ] 83 | }, 84 | { 85 | "before": [ 86 | "(" 87 | ], 88 | "after": [ 89 | "{" 90 | ] 91 | } 92 | ], 93 | "workbench.colorCustomizations": { 94 | "editor.lineHighlightBackground": "#2F3238" 95 | }, 96 | "window.zoomLevel": 1, 97 | "workbench.colorTheme": "One Dark Pro Vivid", 98 | "git.confirmSync": false, 99 | "git.enableSmartCommit": true, 100 | "workbench.iconTheme": "vscode-icons", 101 | "telemetry.enableTelemetry": false, 102 | "telemetry.enableCrashReporter": false, 103 | "vsicons.dontShowNewVersionMessage": true 104 | } 105 | -------------------------------------------------------------------------------- /zsh/.gitignore: -------------------------------------------------------------------------------- 1 | deps/ 2 | -------------------------------------------------------------------------------- /zsh/alias-docker.zsh: -------------------------------------------------------------------------------- 1 | # ------------------------------------ 2 | # Docker functions 3 | # ------------------------------------ 4 | 5 | docker_alias_stop_all_containers() { docker stop $(docker ps -a -q); } 6 | docker_alias_remove_all_containers() { docker rm $(docker ps -a -q); } 7 | docker_alias_remove_all_empty_images() {docker images | awk '{print $2 " " $3}' | grep '^' | awk '{print $2}' | xargs -I{} docker rmi {}; } 8 | docker_alias_docker_file_build() { docker build -t=$1 .; } 9 | docker_alias_show_all_docker_related_alias() { alias | grep 'docker' | sed "s/^\([^=]*\)=\(.*\)/\1 => \2/"| sed "s/['|\']//g" | sort; } 10 | docker_alias_bash_into_running_container() { docker exec -it $(docker ps -aqf "name=$1") bash; } 11 | 12 | # ------------------------------------ 13 | # Docker alias 14 | # ------------------------------------ 15 | 16 | # Stop all containers 17 | alias dstop='docker_alias_stop_all_containers' 18 | 19 | # Remove all containers 20 | alias drm='docker_alias_remove_all_containers' 21 | 22 | # Stop and Remove all containers 23 | alias drmf='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)' 24 | 25 | # stop and remove all Exited containers 26 | alias drsc='docker rm $(docker ps -aq --filter status=exited)' 27 | 28 | # Docker remove image 29 | alias dri='docker rmi' 30 | 31 | # Remove all empty images 32 | alias drei='docker_alias_remove_all_empty_images' 33 | 34 | # Dockerfile build, e.g., $dbu tcnksm/test 35 | alias dbu='docker_alias_docker_file_build' 36 | 37 | # Show all alias related docker 38 | alias dalias='docker_alias_show_all_docker_related_alias' 39 | 40 | # Bash into running container 41 | alias dbash='docker_alias_bash_into_running_container' 42 | 43 | # Get latest container ID 44 | alias dl="docker ps -l -q" 45 | 46 | alias dp='docker ps --format="table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}"' 47 | 48 | alias dclean='drmf && drei' 49 | 50 | # Get images 51 | alias di="docker images" 52 | 53 | # Get container IP 54 | alias dip="docker inspect --format '{{ .NetworkSettings.IPAddress }}'" 55 | 56 | # Run deamonized container, e.g., $dkd base /bin/echo hello 57 | alias dkd="docker run -d -P" 58 | 59 | # Run interactive container, e.g., $dki base /bin/bash 60 | alias dki="docker run -i -t -P" 61 | 62 | # Run interactive container and then auto kill it 63 | alias drit='docker run --rm -i -t' 64 | 65 | # Execute interactive container, e.g., $dex base /bin/bash 66 | alias dex="docker exec -i -t" 67 | -------------------------------------------------------------------------------- /zsh/alias-emacs.zsh: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | 3 | # emacs client 4 | alias e="emacsclient --tty" 5 | alias et="emacsclient --tty" 6 | alias eg="background-connect-emacs-daemon.sh" 7 | 8 | # daemon 9 | alias ed="up-emacs-daemon.sh" 10 | alias ek="kill-emacs-server.sh" 11 | alias er="ek && ed" 12 | alias eu="emacsclient -e '(daemonp)'" 13 | alias ei="emacsclient -e '(emacs-init-time)'" 14 | -------------------------------------------------------------------------------- /zsh/alias-git.zsh: -------------------------------------------------------------------------------- 1 | # check 2 | alias g='git status -sb' 3 | alias gv='git branch -vv' 4 | alias gi='builtin cd $(git rev-parse --show-toplevel)' 5 | 6 | # add 7 | alias gd='git diff' 8 | alias gds='git diff --staged' 9 | alias gal='git add -A' 10 | ealias ga='git add' 11 | ealias gc='git commit -m' 12 | 13 | # sync 14 | alias gf='git fetch' 15 | alias gp='git push' 16 | alias gpf='git push --force-with-lease' 17 | alias gm='git merge' 18 | ealias gr='git reset' 19 | 20 | # branch 21 | ealias gb='git branch' 22 | ealias gco='git checkout' 23 | alias gg='git branch -vv' 24 | alias gs='nohup gitg > /dev/null 2>&1 &' 25 | 26 | # log 27 | alias git_log_custom='git log --pretty=format:"%C(yellow)%h%Creset %C(cyan)%>(14)%ad%Creset %C(magenta)%<(7)%an%Creset %C(blue)%d%Creset %C(white)%s%Creset" --abbrev=7 ' 28 | alias gld='git_log_custom --graph --date=format:"%Y-%m-%d %H:%M:%S"' 29 | alias gl='gld --date=relative' 30 | alias gla='gld --date=relative --all' 31 | alias glr='gld --date=relative --all --reflog' 32 | alias glnc='git log --no-color' 33 | alias glt="git log --no-color --date-order --tags --simplify-by-decoration --pretty=format:'%ai %h %d' --date=format:'%Y-%m-%d %H:%M:%S' | grep --color tag" 34 | alias gls="gl --simplify-by-decoration" 35 | 36 | # ls-files 37 | alias glsu='git ls-files --others --exclude-standard' 38 | alias glsi='git ls-files -oiX .gitignore' 39 | 40 | # cleanup 41 | alias git_kill_reflog='git reflog expire --expire-unreachable=now --all && git gc --aggressive --prune=now' 42 | -------------------------------------------------------------------------------- /zsh/alias-rust.zsh: -------------------------------------------------------------------------------- 1 | alias cr='cargo run' -------------------------------------------------------------------------------- /zsh/alias-vim.zsh: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | 3 | alias v="nvim" 4 | # alias n="nvim" 5 | alias vi='vim -u NONE -N' 6 | -------------------------------------------------------------------------------- /zsh/alias.zsh: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | 3 | # ls 4 | alias ls='ls --color=auto --group-directories-first -X' 5 | alias l='ls -lh' 6 | alias la='l -A' 7 | 8 | # quick alias 9 | alias c='clear' 10 | alias q='exit' 11 | alias b='builtin cd ..' 12 | 13 | alias w='echo -e "$Blue ${"$(pwd)"/$HOME/~} ${Red}at ${Cyan}$(whoami)${Red}@${Yellow}$(hostname -s)$Red \ 14 | using $Yellow${0}$Purple ${DOT_PROMPT_CHAR:-$}${Rst}"' 15 | 16 | # apps 17 | alias ag='ag --path-to-ignore ~/.ignore --hidden' 18 | 19 | # https://unix.stackexchange.com/a/39296/155613 20 | # use unaliased version of ag 21 | alias agu='command ag --hidden -u -a' 22 | 23 | alias tarc='tar -zcvf file.tar.gz' 24 | alias tarx='tar -zxvf' 25 | 26 | # zsh config 27 | alias re='exec zsh' 28 | alias dot='la $(find ~ -maxdepth 1 -type l)' 29 | 30 | # dotfiles 31 | alias r='~/.dotfiles/install.zsh' 32 | 33 | # tmux 34 | alias t="~/.dotfiles/scripts/tmux/tmux-attach.sh" 35 | 36 | # dirs 37 | alias d=show_and_choose 38 | alias 1='cd +1' 39 | 40 | # BSSH: better ssh (ownz putty) 41 | alias bssh="~/.dotfiles/scripts/terminal/bssh.sh" 42 | -------------------------------------------------------------------------------- /zsh/call_user_last_hook.zsh: -------------------------------------------------------------------------------- 1 | last_hook_file=~/.options/user_last_hook.zsh 2 | if [[ -e $last_hook_file ]]; then 3 | source $last_hook_file 4 | fi 5 | -------------------------------------------------------------------------------- /zsh/completions.zsh: -------------------------------------------------------------------------------- 1 | ##### completions 2 | 3 | # explaining the compinit -u hack: 4 | # the compinit -u hack is called for because I run the shell as a docker image 5 | # and mount the dotfiles repo as a volume. Compinit gets angry at me because 6 | # when docker mounts the volume, the permissions are wrong. 7 | # So when you run `exec zsh`, for exemple, compinit gets angry at you by saying: 8 | # "zsh compinit: insecure directories and files, run compaudit for list." 9 | # The -u flag tells compinit to be silent about that. 10 | # more info here: http://stackoverflow.com/a/19601821/4921402 11 | # comp bootstrap 12 | autoload -Uz compinit && compinit 13 | zstyle ':completion:*' menu select 14 | 15 | 16 | # case insensitive completion 17 | zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 18 | 19 | ### fuzzy completion 20 | # lifted from http://superuser.com/a/815317/555734 21 | # 0 -- vanilla completion (abc => abc) 22 | # 1 -- smart case completion (abc => Abc) 23 | # 2 -- word flex completion (abc => A-big-Car) 24 | # 3 -- full flex completion (abc => ABraCadabra) 25 | zstyle ':completion:*' matcher-list '' \ 26 | 'm:{a-z\-}={A-Z\_}' \ 27 | 'r:[^[:alpha:]]||[[:alpha:]]=** r:|=* m:{a-z\-}={A-Z\_}' \ 28 | 'r:[[:ascii:]]||[[:ascii:]]=** r:|=* m:{a-z\-}={A-Z\_}' 29 | 30 | # colors: magenta, green, blue,cyan, yellow, red 31 | zstyle ':completion:*:functions' ignored-patterns '_*' 32 | zstyle ':completion:*' format $'\n%F{yellow}Completing %d%f\n' 33 | zstyle ':completion:*' group-name '' 34 | -------------------------------------------------------------------------------- /zsh/constants.zsh: -------------------------------------------------------------------------------- 1 | SHELL_OPTIONS_FILE=~/.options/shell-options.zsh 2 | 3 | zsh_deps=~/.dotfiles/deps/zsh 4 | emacs_deps=~/.dotfiles/deps/emacs 5 | vim_deps=~/.dotfiles/deps/vim 6 | other_deps=~/.dotfiles/deps/other 7 | -------------------------------------------------------------------------------- /zsh/deploy.zsh: -------------------------------------------------------------------------------- 1 | verifylink ~/.zshrc 2 | updatelinks ~/.zshrc zsh/main.zsh 3 | 4 | verifylink ~/.zsh.d 5 | updatelinks ~/.zsh.d zsh 6 | 7 | verifylink ~/.zshenv 8 | updatelinks ~/.zshenv zsh/zshenv.zsh -------------------------------------------------------------------------------- /zsh/dir_tracker.zsh: -------------------------------------------------------------------------------- 1 | pwd_hook() { 2 | touch $DIR_HISTORY 3 | local _cwd=$(pwd) 4 | local num=302 5 | lines=($_cwd) 6 | for line in $(awk '!a[$0]++' $DIR_HISTORY) 7 | do 8 | if [[ $_cwd != $line ]]; then 9 | lines+=($line) 10 | fi 11 | done 12 | printf "%s\n" "${lines[@]:0:${num}}" > $DIR_HISTORY 13 | } 14 | 15 | show_and_choose() { 16 | choice=$( tail -n +2 $DIR_HISTORY | cat - -b | fzf | awk '{print $2}') 17 | if [ -n "$choice" ]; then 18 | cd $choice 19 | fi 20 | } 21 | 22 | # Hook functions 23 | chpwd_functions+=(pwd_hook) 24 | typeset -U chpwd_functions 25 | -------------------------------------------------------------------------------- /zsh/envbootstrap.zsh: -------------------------------------------------------------------------------- 1 | if [[ -e "$SHELL_OPTIONS_FILE" ]]; then 2 | source "$SHELL_OPTIONS_FILE" 3 | fi 4 | -------------------------------------------------------------------------------- /zsh/expand-alias.zsh: -------------------------------------------------------------------------------- 1 | # lifted from Gautam Lyer's blog: 2 | # https://wiki.math.cmu.edu/iki/wiki/tips/20140625-zsh-expand-alias.html 3 | 4 | typeset -a ealiases 5 | ealiases=() 6 | 7 | ealias () { 8 | alias $1 9 | ealiases+=(${1%%\=*}) 10 | } 11 | 12 | expand-ealias () { 13 | if [[ $LBUFFER =~ "(^|[;|&])\s*(${(j:|:)ealiases})\$" ]]; then 14 | zle _expand_alias 15 | zle expand-word 16 | fi 17 | zle magic-space 18 | } 19 | 20 | zle -N expand-ealias 21 | 22 | bindkey -M viins ' ' expand-ealias 23 | bindkey -M viins '^ ' magic-space # control-space to bypass completion 24 | bindkey -M isearch " " magic-space # normal space during searches 25 | -------------------------------------------------------------------------------- /zsh/fixescapecodes.zsh: -------------------------------------------------------------------------------- 1 | # various escape code fixes 2 | 3 | # pgdown,pgup, home, end, delete, backspace and C-arrow keys 4 | bindkey "^[[1~" beginning-of-line # home key 5 | bindkey "^[[H" beginning-of-line # home key 6 | bindkey "^[[4~" end-of-line # end key 7 | bindkey "^[[F" end-of-line # end key 8 | 9 | bindkey "^H" backward-delete-char # backspace key 10 | bindkey "^?" backward-delete-char # backspace key 11 | bindkey "^[[3~" delete-char # delete key 12 | 13 | bindkey "^[OD" backward-word # C-< in tmux 14 | bindkey "^[OC" forward-word # C-> in tmux 15 | bindkey "^[[1;5D" backward-word # C-< outside tmux 16 | bindkey "^[[1;5C" forward-word # C-> outside tmux 17 | 18 | bindkey "^[[5~" up-line-or-search # pgup 19 | bindkey "^[[6~" down-line-or-search #pgdown 20 | 21 | # numeric keypad return fix (enter) 22 | unamestr=$(uname) 23 | if [[ "$unamestr" == 'Linux' ]] && [[ -z ${EMACS+x} ]] && [[ -n ${terminfo[kent]} ]]; then 24 | bindkey "${terminfo[kent]}" accept-line 25 | fi 26 | 27 | # Numeric Keypad fixes 28 | bindkey -s "^[Op" "0" 29 | bindkey -s "^[On" "." 30 | bindkey -s "^[Oq" "1" 31 | bindkey -s "^[Or" "2" 32 | bindkey -s "^[Os" "3" 33 | bindkey -s "^[Ot" "4" 34 | bindkey -s "^[Ou" "5" 35 | bindkey -s "^[Ov" "6" 36 | bindkey -s "^[Ow" "7" 37 | bindkey -s "^[Ox" "8" 38 | bindkey -s "^[Oy" "9" 39 | bindkey -s "^[Ol" "+" 40 | bindkey -s "^[OS" "-" 41 | bindkey -s "^[OR" "*" 42 | bindkey -s "^[OQ" "/" 43 | -------------------------------------------------------------------------------- /zsh/functions.zsh: -------------------------------------------------------------------------------- 1 | # s: get megabytes measurement {{{ 2 | 3 | # usage: s [-h] [path] 4 | s() { 5 | if [[ -z ${1+x} ]]; then 6 | # no argument passed. measure current dir including hidden files. 7 | du -sm *(D) | sort -nr | head -n 20 8 | return 0 9 | fi 10 | # an argument was passed. 11 | if [[ $1 = '-h' ]]; then 12 | # -h switch: human readable size output, but it is not suitable for ordering with, e.g., command sort. 13 | if [[ -n ${2+x} ]]; then 14 | # if a path was passed, apply -h switch to the path 15 | du -sh $2 16 | return 0; 17 | else 18 | # if a path was not passed, apply -h switch to all files, including hidden files 19 | du -sh *(D) 20 | fi 21 | else 22 | # bogus argument. print error 23 | print -l 'bogus argument. check function documentation' 24 | fi 25 | } 26 | 27 | # }}} 28 | # sk: get kilobytes measurement. for human readable output check the s function {{{ 29 | 30 | # usage: s [path] 31 | sk() { 32 | if [[ -z ${1+x} ]]; then 33 | # no argument passed. measure current dir including hidden files. 34 | du -sk *(D) | sort -nr | head -n 20 35 | return 0; 36 | fi 37 | # argument passed. 38 | du -sk $1 | sort -nr | head -n 20 39 | } 40 | 41 | # }}} 42 | # md: faster dir creation {{{ 43 | 44 | mdr() { 45 | mkdir -p $1 46 | builtin cd $1 47 | } 48 | 49 | # }}} 50 | # n: easy run project local npm executables {{{ 51 | 52 | # usage sample: n ng version 53 | n () { 54 | $(npm bin)/$@ 55 | } 56 | 57 | # }}} 58 | # =: front for the `bc` utility {{{ 59 | 60 | # usage: = '1+1' 61 | = () { 62 | bc -l <<< "$@" 63 | } 64 | 65 | # }}} 66 | -------------------------------------------------------------------------------- /zsh/fzf.zsh: -------------------------------------------------------------------------------- 1 | if [[ ! -d $HOME/.fzf ]]; then 2 | print "$HOME/.fzf is missing. no fzf features will be loaded." 3 | return 4 | fi 5 | 6 | # Setup fzf 7 | # --------- 8 | if [[ ! "$PATH" == *$HOME/.fzf/bin* ]]; then 9 | export PATH="$PATH:$HOME/.fzf/bin" 10 | fi 11 | 12 | # Auto-completion 13 | # --------------- 14 | [[ $- == *i* ]] && source "$HOME/shell/completion.zsh" 2> /dev/null 15 | 16 | # Key bindings 17 | # ------------ 18 | source "$HOME/.fzf/shell/key-bindings.zsh" 19 | 20 | # customization 21 | export FZF_DEFAULT_OPTS='--height 40% --reverse --border' -------------------------------------------------------------------------------- /zsh/main.zsh: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | 3 | source ~/.zsh.d/constants.zsh 4 | source ~/.zsh.d/envbootstrap.zsh 5 | 6 | source ~/.zsh.d/options.zsh 7 | source ~/.zsh.d/termcolors.zsh 8 | source ~/.zsh.d/fixescapecodes.zsh 9 | source ~/.zsh.d/zleconfig.zsh 10 | source ~/.zsh.d/functions.zsh 11 | 12 | source ~/.zsh.d/alias.zsh 13 | source ~/.zsh.d/alias-git.zsh 14 | source ~/.zsh.d/alias-docker.zsh 15 | source ~/.zsh.d/alias-emacs.zsh 16 | source ~/.zsh.d/alias-vim.zsh 17 | source ~/.zsh.d/alias-rust.zsh 18 | 19 | source ~/.zsh.d/prompt.zsh 20 | source ~/.zsh.d/ninplug.zsh 21 | 22 | # load step 23 | load_plugins 24 | 25 | # init completion system 26 | source ~/.zsh.d/completions.zsh 27 | 28 | # colors for GNU ls (from coreutils) 29 | eval $(dircolors ~/.lscolors) 30 | 31 | source ~/.zsh.d/fzf.zsh 32 | 33 | # custom plugins 34 | source ~/.zsh.d/pj.zsh 35 | source ~/.zsh.d/dir_tracker.zsh 36 | 37 | # user last step 38 | source ~/.zsh.d/call_user_last_hook.zsh 39 | 40 | [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh 41 | -------------------------------------------------------------------------------- /zsh/nin-vi-mode.zsh: -------------------------------------------------------------------------------- 1 | # bootstrap, keymap-select and cursor shape management {{{ 2 | 3 | # no delays when switching keymaps 4 | export KEYTIMEOUT=1 5 | 6 | # bootstrap vi-mode 7 | bindkey -v 8 | 9 | # }}} 10 | # text objects support {{{ 11 | 12 | # since zsh 5.0.8, text objects were introduced. Let's use some of them. 13 | # see here for more info: http://www.zsh.org/mla/workers/2015/msg01017.html 14 | # and here: https://github.com/zsh-users/zsh/commit/d257f0143e69c3724466c4c92f59538d2f3fffd1 15 | 16 | # using select-bracketed as intructed on: https://github.com/zsh-users/zsh/blob/master/Functions/Zle/select-bracketed#L6 17 | # same as vim c+motion (change inside/around text-object). 18 | autoload -U select-bracketed 19 | zle -N select-bracketed 20 | for m in visual viopp; do 21 | for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do 22 | bindkey -M $m $c select-bracketed 23 | done 24 | done 25 | 26 | # using select-quoted as instructed on: https://github.com/zsh-users/zsh/blob/master/Functions/Zle/select-quoted#L6 27 | # expands c+motion (change inside/around + text-object) to quotes. 28 | autoload -U select-quoted 29 | zle -N select-quoted 30 | for m in visual viopp; do 31 | for c in {a,i}{\',\",\`}; do 32 | bindkey -M $m $c select-quoted 33 | done 34 | done 35 | 36 | # }}} 37 | # simple binds {{{ 38 | 39 | autoload -Uz edit-command-line 40 | zle -N edit-command-line 41 | bindkey -M vicmd 'go' edit-command-line 42 | 43 | bindkey -M vicmd '?' history-incremental-search-backward 44 | 45 | # }}} 46 | # my custom widgets {{{ 47 | 48 | # pressing in normal mode is bogus: you need to press 'i' twice to enter insert mode again. 49 | # rebinding in normal mode to something harmless solves the problem. 50 | nin-noop() { 51 | return 0 52 | } 53 | zle -N nin-noop 54 | bindkey -M vicmd '\e' nin-noop 55 | 56 | # }}} 57 | -------------------------------------------------------------------------------- /zsh/ninplug.zsh: -------------------------------------------------------------------------------- 1 | is_plugin() { 2 | local plugin_path=$1 3 | local plugin_file=${plugin_path:t} 4 | test -f $plugin_path/$plugin_file.plugin.zsh || \ 5 | test -f $plugin_path/_$plugin_file || \ 6 | test -f $plugin_path/$plugin_file.sh 7 | } 8 | 9 | construct_filename() { 10 | local plugin_path=$1 11 | local plugin_file=${plugin_path:t} 12 | 13 | name1=$plugin_path/$plugin_file.plugin.zsh 14 | name2=$plugin_path/_$plugin_file 15 | name3=$plugin_path/$plugin_file.sh 16 | 17 | if test -f $name1; then 18 | echo $name1 19 | return 0 20 | fi 21 | 22 | if test -f $name2; then 23 | echo $name2 24 | return 0 25 | fi 26 | 27 | if test -f $name3; then 28 | echo $name3 29 | return 0 30 | fi 31 | 32 | test -f $name1 33 | } 34 | 35 | load_plugins() { 36 | # this hack is brought to you by Daniel Shahaf in an answer to my question 37 | # link: http://www.zsh.org/mla/zsh-users/22852 38 | plugin_paths+=($zsh_deps/*/*/.git(N:h)) 39 | for plugin_path ($plugin_paths); do 40 | # print $plugin_path 41 | if is_plugin $plugin_path; then 42 | local file=$(construct_filename $plugin_path) 43 | source $file 44 | fi 45 | done 46 | } 47 | -------------------------------------------------------------------------------- /zsh/options.zsh: -------------------------------------------------------------------------------- 1 | # defining word endings 2 | WORDCHARS='*?_-.[]~=&;!#$%^(){}<>' 3 | 4 | # history config options 5 | HISTFILE=$HOME/.zsh_history 6 | HISTSIZE=2000000 7 | SAVEHIST=2000000 8 | setopt append_history 9 | setopt extended_history 10 | setopt share_history 11 | setopt hist_verify 12 | setopt hist_ignore_all_dups 13 | setopt hist_ignore_space 14 | 15 | # dir navigation options 16 | setopt auto_pushd 17 | setopt pushd_ignore_dups 18 | setopt pushd_silent 19 | setopt auto_cd 20 | 21 | # glob options 22 | setopt extended_glob # allows us to use ^ to negate globs 23 | unsetopt nomatch # but when pattern matching fails, simply use the command as is. See robbyrussell/oh-my-zsh#449 24 | 25 | # better completion 26 | setopt menu_complete 27 | -------------------------------------------------------------------------------- /zsh/pj.zsh: -------------------------------------------------------------------------------- 1 | alias f="project_jump" 2 | 3 | project_paths=~/.options/project_paths.zsh 4 | if [[ -e $project_paths ]]; then 5 | source $project_paths 6 | fi 7 | 8 | project_jump () { 9 | emulate -L zsh 10 | project=$1 11 | 12 | if [[ -z ${1+x} ]] && [[ -d ${PROJECT_PATHS[1]} ]]; then 13 | cd ${PROJECT_PATHS[1]} 14 | return 0 15 | fi 16 | 17 | for chosen_project ($PROJECT_PATHS); do 18 | if [[ -d "$chosen_project" ]] && [[ "${chosen_project:t}" == "$project" ]]; then 19 | cd "$chosen_project" 20 | return 0 21 | fi 22 | done 23 | 24 | echo "No such project '${project}'." 25 | } 26 | 27 | _project_jump () { 28 | emulate -L zsh 29 | typeset -a projects 30 | for project ($PROJECT_PATHS); do 31 | projects+=(${project}) 32 | done 33 | compadd ${projects:t} 34 | } 35 | compdef _project_jump project_jump 36 | -------------------------------------------------------------------------------- /zsh/prompt.zsh: -------------------------------------------------------------------------------- 1 | # colors: magenta, green, blue,cyan, yellow, red 2 | # prompt chars: ,λ ,› ,➤ ,∴ ,→ ,★ ,➜ ,❯ 3 | 4 | build_prompt_char() { 5 | local pc="$DOT_PROMPT_CHAR" 6 | local prompt_char="%(?.%F{magenta}.%F{red})${pc:-$}%f" 7 | echo -n "$prompt_char" 8 | } 9 | 10 | # default: showing whoami@hostname without truncation 11 | PROMPT="%F{blue}%1~%f %F{cyan}%n%f%F{red}@%f%F{yellow}%m%f $(build_prompt_char) " 12 | 13 | PROMPT_INFO_LEVEL=$SHELL_PROMPT_INFO_LEVEL 14 | 15 | # 0: showing only PWD with trunction 16 | # 1: showing @hostname and with truncation 17 | # 2: showing whaami@hostname and with truncation 18 | if [[ "${PROMPT_INFO_LEVEL}" == "0" ]]; then 19 | PROMPT="%F{blue}%15<...<%1~%<<%f $(build_prompt_char) " 20 | # PROMPT="$(build_prompt_char) " 21 | elif [[ "${PROMPT_INFO_LEVEL}" == "1" ]]; then 22 | PROMPT="%F{blue}%13<...<%1~%<<%f %F{red}@%f%F{yellow}%m%f $(build_prompt_char) " 23 | elif [[ "${PROMPT_INFO_LEVEL}" == "2" ]]; then 24 | PROMPT="%F{blue}%13<...<%1~%<<%f %F{cyan}%n%f%F{red}@%f%F{yellow}%m%f $(build_prompt_char) " 25 | fi 26 | 27 | -------------------------------------------------------------------------------- /zsh/readme.org: -------------------------------------------------------------------------------- 1 | #+STARTUP: indent 2 | #+STARTUP: overview 3 | 4 | * Ninrod's zsh configuration 5 | - I don't use any plugin manager. just some functions to source plugins that live under ~/.dotfiles/deps. 6 | - I use a separate simple script to git clone the plugins myself (install.zsh) 7 | - zshrc.zsh is the main file and it's split up into more manageable pieces 8 | 9 | -------------------------------------------------------------------------------- /zsh/termcolors.zsh: -------------------------------------------------------------------------------- 1 | # terminal colors 2 | 3 | # ATTENTION: from https://github.com/ninrod/dotfiles/issues/134 we know that 4 | # this could be replace by: 5 | # autload -U colors 6 | # colors 7 | # then we could use colors like this: 8 | # echo "${fg[yellow]} Example text. ${reset_color}" 9 | # echo "${fg_bold[yellow]} Example text. ${reset_color}" 10 | # echo "${bg_bold[yellow]} Example text. ${reset_color} ${bg[yellow]}${bg_bold[black]} Another text. ${reset_color}" 11 | 12 | TC='\e[' 13 | Rst="${TC}0m" # Reset all coloring and style 14 | Black="${TC}30m"; 15 | Red="${TC}31m"; 16 | Green="${TC}32m"; 17 | Yellow="${TC}33m"; 18 | Blue="${TC}34m"; 19 | Purple="${TC}35m"; 20 | Cyan="${TC}36m"; 21 | White="${TC}37m"; 22 | -------------------------------------------------------------------------------- /zsh/zleconfig.zsh: -------------------------------------------------------------------------------- 1 | if [[ -z ${EMACS+x} ]]; then 2 | export EDITOR="vim" 3 | 4 | # simplest possible vi key configuration 5 | # no delays when switching keymaps 6 | # bootstrap vi-mode 7 | # export KEYTIMEOUT=1 8 | # bindkey -v 9 | 10 | # much more complex vi keys configuration 11 | source ~/.zsh.d/nin-vi-mode.zsh 12 | else 13 | # export KEYTIMEOUT=1 14 | # bindkey -v 15 | source ~/.zsh.d/nin-vi-mode.zsh 16 | fi 17 | 18 | source ~/.zsh.d/expand-alias.zsh 19 | 20 | if [[ $TERM = linux ]]; then 21 | sudo loadkeys ~/.options/arch/vconsole/rebinds.map 22 | fi 23 | -------------------------------------------------------------------------------- /zsh/zshenv.zsh: -------------------------------------------------------------------------------- 1 | # dir tracker 2 | DIR_HISTORY=~/.dir_history.txt 3 | DIR_TRACKER_NUM=202 4 | # LD_LIBRARY_PATH=$(rustc --print sysroot)/lib:$LD_LIBRARY_PATH 5 | . "$HOME/.cargo/env" 6 | --------------------------------------------------------------------------------