(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
# Usage: | |
# source iterm2.zsh | |
# iTerm2 tab color commands | |
# https://iterm2.com/documentation-escape-codes.html | |
if [[ -n "$ITERM_SESSION_ID" ]]; then | |
tab-color() { | |
echo -ne "\033]6;1;bg;red;brightness;$1\a" | |
echo -ne "\033]6;1;bg;green;brightness;$2\a" |
#First, you need to set the RIPGREP_CONFIG_PATH environment variable to the file path of your config file | |
# export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc | |
# Don't let ripgrep vomit really long lines to my terminal. | |
--max-columns=150 | |
--max-columns-preview | |
# Add my 'web' type. | |
--type-add | |
web:*.{html,css,js}* |
#!/bin/sh | |
# | |
set -ex | |
TEMP_DIR="$(mktemp -d -t XXXX)" | |
# cleanup | |
trap 'RESULT=$?; rm -rf "$TEMP_DIR" ; exit $RESULT' INT TERM EXIT QUIT | |
OLD_PWD="$PWD" | |
cd "$TEMP_DIR" |
;; switch to english input method when switching to normal mode | |
;; and switch back when entering insert/replace modes | |
;; need external script support, currently mac-only | |
(defvar default-im "org.unknown.keylayout.layoutformc" "Default ascii-only input method") | |
(defvar prev-im (substring (shell-command-to-string "/usr/local/bin/im-select") 0 -1) | |
"IM that I use when starting Emacs and exiting insert mode") | |
(defun im-use-english () | |
"Switch to english input method on a Mac. im-select is a tool | |
provided at https://github.com/daipeihust/im-select" |
--- Emacs Hammerspoon Script | |
-- Author: Justin Tanner | |
-- Email: work@jwtanner.com | |
-- License: MIT | |
--- What does this thing do? | |
-- Allows you to have Emacs *like* keybindings in apps other than Emacs. | |
-- You can use Ctrl-Space to mark and cut text just like Emacs. Also enables Emacs prefix keys such as Ctrl-xs (save). | |
--- Installation |
# | |
# Original solution via StackOverflow: | |
# http://stackoverflow.com/questions/35802939/install-only-available-packages-using-conda-install-yes-file-requirements-t | |
# | |
# | |
# Install via `conda` directly. | |
# This will fail to install all | |
# dependencies. If one fails, | |
# all dependencies will fail to install. |
# Install tmux 2.8 on Centos | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel | |
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz | |
tar -xf libevent-2.1.8-stable.tar.gz | |
cd libevent-2.1.8-stable | |
./configure --prefix=/usr/local |
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo | |
echo usage: $0 network-interface | |
echo | |
echo e.g. $0 eth0 | |
echo | |
echo shows packets-per-second |
# The get() method on dicts | |
# and its "default" argument | |
name_for_userid = { | |
382: "Alice", | |
590: "Bob", | |
951: "Dilbert", | |
} | |
def greeting(userid): |