mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-25 15:54:52 +00:00
reset git history
This commit is contained in:
commit
a368fda34d
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
.DS_Store
|
||||
.vim/dirs/*
|
||||
.vim/.netrwhist
|
||||
vim/dirs/*
|
||||
vim/.netrwhist
|
||||
.ssh/known_hosts
|
||||
spacemacs.d/.spacemacs.env
|
||||
*.lock.json
|
5
autohotkey/RemapCaps.ahk
Normal file
5
autohotkey/RemapCaps.ahk
Normal file
@ -0,0 +1,5 @@
|
||||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
|
||||
; #Warn ; Enable warnings to assist with detecting common errors.
|
||||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
||||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||
Capslock::Esc
|
13
bin/calc
Executable file
13
bin/calc
Executable file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Run a quick calculation with Ruby
|
||||
#
|
||||
# Usage: calc "1/2"
|
||||
|
||||
class Integer
|
||||
def /(other)
|
||||
fdiv(other)
|
||||
end
|
||||
end
|
||||
|
||||
puts eval(ARGV.join(""))
|
16
bin/connect_aws/Dockerfile
Normal file
16
bin/connect_aws/Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
FROM alpine:latest
|
||||
|
||||
COPY requirements.txt /
|
||||
|
||||
RUN apk update && \
|
||||
apk add \
|
||||
openssh \
|
||||
python \
|
||||
py-pip \
|
||||
&& \
|
||||
pip install -r requirements.txt
|
||||
|
||||
COPY connect_cloud.sh /
|
||||
COPY connect_cloud.py /
|
||||
|
||||
ENTRYPOINT ["/connect_cloud.sh"]
|
85
bin/connect_aws/connect_cloud.py
Executable file
85
bin/connect_aws/connect_cloud.py
Executable file
@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""Connect to Cloud instances"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
import boto3
|
||||
|
||||
# Initiate the parser
|
||||
parser = argparse.ArgumentParser("Type the name of the connection you want")
|
||||
parser.add_argument('profile', metavar='P', nargs='?',
|
||||
help='an account to use')
|
||||
parser.add_argument('environment', metavar='E', nargs='?',
|
||||
help='an environment to specify')
|
||||
args = parser.parse_args()
|
||||
|
||||
# Get AWS credentials profile
|
||||
profile_map = {
|
||||
'gs' : {
|
||||
'profile': 'ghoststory',
|
||||
'prod': 'id_rsa_gstory_prod.pem',
|
||||
'dev': 'id_rsa_gstory_prod.pem',
|
||||
'username': 'centos',
|
||||
},
|
||||
'di' : {
|
||||
'profile': 't2indies',
|
||||
'prod': 'disintegration-prod.pem',
|
||||
'dev': 'disintegration-dev.pem',
|
||||
'username': 'centos',
|
||||
},
|
||||
'pd' : {
|
||||
'profile': 't2indies',
|
||||
'prod': 't2indies-prod.pem',
|
||||
'dev': 't2indies-dev.pem',
|
||||
'username': 'centos',
|
||||
},
|
||||
'corp' : {
|
||||
'profile': 't2corp',
|
||||
'prod': 'take2games-corp.pem',
|
||||
'dev': 'take2games-corp.pem',
|
||||
'username': 'ec2-user',
|
||||
},
|
||||
'ksp' : {
|
||||
'profile': 'kerbal',
|
||||
'prod': 'kerbal_prod_key.pem',
|
||||
'dev': 'kerbal_dev_key.pem',
|
||||
'username': 'centos',
|
||||
},
|
||||
}
|
||||
profile_dict = profile_map.get(args.profile)
|
||||
profile = profile_dict['profile']
|
||||
|
||||
# Connect to AWS
|
||||
session = boto3.Session(profile_name=profile)
|
||||
client = session.client('ec2', verify=False)
|
||||
|
||||
response = client.describe_instances()
|
||||
|
||||
print(len(response['Reservations']), "total instances\n")
|
||||
|
||||
matched_instances = []
|
||||
for instance_wrapper in response['Reservations']:
|
||||
instance = instance_wrapper['Instances'][0]
|
||||
is_matched_env = False
|
||||
is_matched_role = False
|
||||
for tag in instance.get('Tags', []):
|
||||
if tag['Key'] == "site_env" and args.environment in tag['Value']:
|
||||
is_matched_env = True
|
||||
if tag['Key'] == "role" and tag['Value'] == 'host':
|
||||
is_matched_role = True
|
||||
if tag['Key'] == "Name":
|
||||
instance['Name'] = tag['Value']
|
||||
if is_matched_env and is_matched_role:
|
||||
matched_instances.append(instance)
|
||||
|
||||
for instance in matched_instances:
|
||||
print(instance['Name'])
|
||||
print(instance['PublicIpAddress'])
|
||||
print("")
|
||||
|
||||
with open("aws_connect", 'w') as outfile:
|
||||
outfile.write("ssh-keyscan {} >> ~/.ssh/known_hosts\n".format(matched_instances[0]['PublicIpAddress']))
|
||||
outfile.write("ssh -i ~/.ssh/{} {}@{}".format(profile_dict[args.environment], profile_dict['username'], matched_instances[0]['PublicIpAddress']))
|
||||
os.chmod("aws_connect", 0o755)
|
5
bin/connect_aws/connect_cloud.sh
Executable file
5
bin/connect_aws/connect_cloud.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
python connect_cloud.py "$@"
|
||||
|
||||
/aws_connect
|
8
bin/connect_aws/requirements.txt
Normal file
8
bin/connect_aws/requirements.txt
Normal file
@ -0,0 +1,8 @@
|
||||
boto3==1.9.239
|
||||
botocore==1.12.239
|
||||
docutils==0.15.2
|
||||
jmespath==0.9.4
|
||||
python-dateutil==2.8.0
|
||||
s3transfer==0.2.1
|
||||
six==1.12.0
|
||||
urllib3==1.25.6
|
26
bin/docker_cleanup
Executable file
26
bin/docker_cleanup
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Stop all containers
|
||||
if [ "$(docker ps -a -q)" ]; then
|
||||
echo "Stopping docker containers..."
|
||||
docker stop $(docker ps -a -q)
|
||||
else
|
||||
echo "No running docker containers."
|
||||
fi
|
||||
|
||||
# Remove all stopped containers
|
||||
if [ "$(docker ps -a -q)" ]; then
|
||||
echo "Removing docker containers..."
|
||||
docker rm $(docker ps -a -q)
|
||||
else
|
||||
echo "No stopped docker containers."
|
||||
fi
|
||||
|
||||
# Remove all untagged images
|
||||
if [[ $(docker images | grep "^<none>") ]]; then
|
||||
docker rmi $(docker images | rg "^<none>" | awk '{print $3}')
|
||||
else
|
||||
echo "No untagged docker images."
|
||||
fi
|
||||
|
||||
echo "Cleaned up docker."
|
16
bin/emacs_env
Executable file
16
bin/emacs_env
Executable file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function export-emacs {
|
||||
if [ "$(emacsclient -e t)" != 't' ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
for name in "${@}"; do
|
||||
value=$(eval echo \"\$${name}\")
|
||||
emacsclient -e "(setenv \"${name}\" \"${value}\")" >/dev/null
|
||||
done
|
||||
}
|
||||
|
||||
for i in $(python -c $"import os; [print(k) for k in os.environ.keys()]"); do
|
||||
export-emacs "$i"
|
||||
done
|
3
bin/notify
Executable file
3
bin/notify
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
system %{osascript -e 'display notification "#{ARGV.join(' ')}"'}
|
3
bin/save_env
Executable file
3
bin/save_env
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
python -c $"import os; [print(k) for k in os.environ.keys()]" > ~/Document/GitHub/dotfiles/env.txt
|
22
bin/watchit
Executable file
22
bin/watchit
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require "digest"
|
||||
|
||||
def compute_sha
|
||||
contents = Dir["./**/*.rs"].map do |file|
|
||||
File.read(file)
|
||||
end.join("\n")
|
||||
|
||||
Digest::MD5.hexdigest(contents)
|
||||
end
|
||||
|
||||
sha = compute_sha
|
||||
|
||||
loop do
|
||||
new_sha = compute_sha
|
||||
if sha != new_sha
|
||||
sha = new_sha
|
||||
system "clear && echo '#{'-'*80}' && cargo test"
|
||||
end
|
||||
sleep 1
|
||||
end
|
25
bin/youtube
Executable file
25
bin/youtube
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require "uri"
|
||||
|
||||
module Clipboard
|
||||
class << self
|
||||
def paste
|
||||
`pbpaste`.chomp
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def parse_params(url)
|
||||
url.query.split("&").each_with_object({}) do |param, acc|
|
||||
key, value = *param.split("=", 2)
|
||||
acc[key] = value
|
||||
end
|
||||
end
|
||||
|
||||
url = URI.parse Clipboard.paste
|
||||
params = parse_params url
|
||||
id = params.fetch("v") { raise "Probably not a youtube URL" }
|
||||
|
||||
clean_url = "https://www.youtube.com/watch?v=#{id}"
|
||||
system "(cd ~/Downloads && youtube-dl -f best \"#{clean_url}\")"
|
12
git/gitconfig.symlink
Normal file
12
git/gitconfig.symlink
Normal file
@ -0,0 +1,12 @@
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
[user]
|
||||
name = Noah Masur
|
||||
email = noah.masur@take2games.com
|
||||
[hub]
|
||||
host = github.take2games.com
|
||||
[pager]
|
||||
branch = false
|
61
homebrew/Brewfile
Normal file
61
homebrew/Brewfile
Normal file
@ -0,0 +1,61 @@
|
||||
tap "homebrew/cask"
|
||||
|
||||
brew "ansible"
|
||||
brew "emacs-plus"
|
||||
brew "terraform"
|
||||
brew "packer"
|
||||
brew "pyenv"
|
||||
brew "pyenv-virtualenv"
|
||||
brew "the_silver_searcher"
|
||||
brew "ripgrep"
|
||||
brew "sd"
|
||||
brew "telnet"
|
||||
brew "bat"
|
||||
brew "fd"
|
||||
brew "exa"
|
||||
brew "tldr"
|
||||
brew "wget"
|
||||
brew "jq"
|
||||
brew "gpg"
|
||||
brew "prettyping"
|
||||
brew "fzf"
|
||||
brew "httpie"
|
||||
brew "qrencode"
|
||||
brew "dos2unix"
|
||||
brew "trash"
|
||||
brew "youtube-dl"
|
||||
brew "zsh-syntax-highlighting"
|
||||
brew "zsh-autosuggestions"
|
||||
brew "googler"
|
||||
brew "ruby"
|
||||
brew "shellcheck"
|
||||
brew "xsv"
|
||||
|
||||
# git
|
||||
# hub
|
||||
# pulumi
|
||||
# libmagic
|
||||
# awscli
|
||||
# saulpw/vd/visidata
|
||||
# brew tap weaveworks/tap && brew install weaveworks/tap/eksctl (EKS on AWS)
|
||||
# fasd (cd)
|
||||
# glances (top)
|
||||
|
||||
# cask "github-desktop"
|
||||
# cask "iterm2"
|
||||
# cask "google-chrome"
|
||||
# cask "docker"
|
||||
# cask "slack"
|
||||
# cask "dash"
|
||||
# cask "discord"
|
||||
# cask "postman"
|
||||
# cask "onepassword"
|
||||
# cask "steam"
|
||||
# cask "vlc"
|
||||
# cask "keybase"
|
||||
# cask "cyberduck"
|
||||
# cask "zoomus"
|
||||
# cask "dropbox"
|
||||
# cask "calibre"
|
||||
# cask "drawio"
|
||||
# cask "skype"
|
213
iterm/Jellybeans.itermcolors
Normal file
213
iterm/Jellybeans.itermcolors
Normal file
@ -0,0 +1,213 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Ansi 0 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.5725490196078431</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.5725490196078431</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.5725490196078431</real>
|
||||
</dict>
|
||||
<key>Ansi 1 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.45098039215686275</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.45098039215686275</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.88627450980392153</real>
|
||||
</dict>
|
||||
<key>Ansi 10 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.6705882352941176</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.87058823529411766</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.74117647058823533</real>
|
||||
</dict>
|
||||
<key>Ansi 11 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.62745098039215685</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.86274509803921573</real>
|
||||
<key>Red Component</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<key>Ansi 12 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.96470588235294119</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.84705882352941175</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.69411764705882351</real>
|
||||
</dict>
|
||||
<key>Ansi 13 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>1</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.85490196078431369</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.98431372549019602</real>
|
||||
</dict>
|
||||
<key>Ansi 14 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.6588235294117647</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.69803921568627447</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.10196078431372549</real>
|
||||
</dict>
|
||||
<key>Ansi 15 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>1</real>
|
||||
<key>Green Component</key>
|
||||
<real>1</real>
|
||||
<key>Red Component</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<key>Ansi 2 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.47450980392156861</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.72549019607843135</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.58039215686274503</real>
|
||||
</dict>
|
||||
<key>Ansi 3 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.4823529411764706</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.72941176470588232</real>
|
||||
<key>Red Component</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<key>Ansi 4 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.86274509803921573</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.74509803921568629</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.59215686274509804</real>
|
||||
</dict>
|
||||
<key>Ansi 5 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.98039215686274506</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.75294117647058822</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.88235294117647056</real>
|
||||
</dict>
|
||||
<key>Ansi 6 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.55686274509803924</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.59607843137254901</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.0</real>
|
||||
</dict>
|
||||
<key>Ansi 7 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.87058823529411766</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.87058823529411766</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.87058823529411766</real>
|
||||
</dict>
|
||||
<key>Ansi 8 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.74117647058823533</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.74117647058823533</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.74117647058823533</real>
|
||||
</dict>
|
||||
<key>Ansi 9 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.63137254901960782</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.63137254901960782</real>
|
||||
<key>Red Component</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<key>Background Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.070588235294117646</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.070588235294117646</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.070588235294117646</real>
|
||||
</dict>
|
||||
<key>Bold Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>1</real>
|
||||
<key>Green Component</key>
|
||||
<real>1</real>
|
||||
<key>Red Component</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<key>Cursor Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.37647059559822083</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.64705878496170044</real>
|
||||
<key>Red Component</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<key>Cursor Text Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>1</real>
|
||||
<key>Green Component</key>
|
||||
<real>1</real>
|
||||
<key>Red Component</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<key>Foreground Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.87058823529411766</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.87058823529411766</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.87058823529411766</real>
|
||||
</dict>
|
||||
<key>Selected Text Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.95686274509803915</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.95686274509803915</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.95686274509803915</real>
|
||||
</dict>
|
||||
<key>Selection Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.56862745098039214</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.30588235294117649</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.27843137254901962</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
4748
iterm/com.googlecode.iterm2.plist
Normal file
4748
iterm/com.googlecode.iterm2.plist
Normal file
File diff suppressed because it is too large
Load Diff
153
iterm/imgcat
Executable file
153
iterm/imgcat
Executable file
@ -0,0 +1,153 @@
|
||||
#!/bin/bash
|
||||
|
||||
# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux;
|
||||
# <sequence> ST, and for all ESCs in <sequence> to be replaced with ESC ESC. It
|
||||
# only accepts ESC backslash for ST. We use TERM instead of TMUX because TERM
|
||||
# gets passed through ssh.
|
||||
function print_osc() {
|
||||
if [[ $TERM == screen* ]] ; then
|
||||
printf "\033Ptmux;\033\033]"
|
||||
else
|
||||
printf "\033]"
|
||||
fi
|
||||
}
|
||||
|
||||
# More of the tmux workaround described above.
|
||||
function print_st() {
|
||||
if [[ $TERM == screen* ]] ; then
|
||||
printf "\a\033\\"
|
||||
else
|
||||
printf "\a"
|
||||
fi
|
||||
}
|
||||
|
||||
function load_version() {
|
||||
if [ -z ${IMGCAT_BASE64_VERSION+x} ]; then
|
||||
export IMGCAT_BASE64_VERSION=$(base64 --version 2>&1)
|
||||
fi
|
||||
}
|
||||
|
||||
function b64_encode() {
|
||||
load_version
|
||||
if [[ "$IMGCAT_BASE64_VERSION" =~ GNU ]]; then
|
||||
# Disable line wrap
|
||||
base64 -w0
|
||||
else
|
||||
base64
|
||||
fi
|
||||
}
|
||||
|
||||
function b64_decode() {
|
||||
load_version
|
||||
if [[ "$IMGCAT_BASE64_VERSION" =~ fourmilab ]]; then
|
||||
BASE64ARG=-d
|
||||
elif [[ "$IMGCAT_BASE64_VERSION" =~ GNU ]]; then
|
||||
BASE64ARG=-di
|
||||
else
|
||||
BASE64ARG=-D
|
||||
fi
|
||||
base64 $BASE64ARG
|
||||
}
|
||||
|
||||
# print_image filename inline base64contents print_filename
|
||||
# filename: Filename to convey to client
|
||||
# inline: 0 or 1
|
||||
# base64contents: Base64-encoded contents
|
||||
# print_filename: If non-empty, print the filename
|
||||
# before outputting the image
|
||||
function print_image() {
|
||||
print_osc
|
||||
printf '1337;File='
|
||||
if [[ -n "$1" ]]; then
|
||||
printf 'name='`printf "%s" "$1" | b64_encode`";"
|
||||
fi
|
||||
|
||||
printf "%s" "$3" | b64_decode | wc -c | awk '{printf "size=%d",$1}'
|
||||
printf ";inline=$2"
|
||||
printf ":"
|
||||
printf "%s" "$3"
|
||||
print_st
|
||||
printf '\n'
|
||||
if [[ -n "$4" ]]; then
|
||||
echo $1
|
||||
fi
|
||||
}
|
||||
|
||||
function error() {
|
||||
echo "ERROR: $*" 1>&2
|
||||
}
|
||||
|
||||
function show_help() {
|
||||
echo "Usage: imgcat [-p] filename ..." 1>& 2
|
||||
echo " or: cat filename | imgcat" 1>& 2
|
||||
}
|
||||
|
||||
function check_dependency() {
|
||||
if ! (builtin command -V "$1" > /dev/null 2>& 1); then
|
||||
echo "imgcat: missing dependency: can't find $1" 1>& 2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
## Main
|
||||
|
||||
if [ -t 0 ]; then
|
||||
has_stdin=f
|
||||
else
|
||||
has_stdin=t
|
||||
fi
|
||||
|
||||
# Show help if no arguments and no stdin.
|
||||
if [ $has_stdin = f -a $# -eq 0 ]; then
|
||||
show_help
|
||||
exit
|
||||
fi
|
||||
|
||||
check_dependency awk
|
||||
check_dependency base64
|
||||
check_dependency wc
|
||||
|
||||
# Look for command line flags.
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|--h|--help)
|
||||
show_help
|
||||
exit
|
||||
;;
|
||||
-p|--p|--print)
|
||||
print_filename=1
|
||||
;;
|
||||
-u|--u|--url)
|
||||
check_dependency curl
|
||||
encoded_image=$(curl -s "$2" | b64_encode) || (error "No such file or url $2"; exit 2)
|
||||
has_stdin=f
|
||||
print_image "$2" 1 "$encoded_image" "$print_filename"
|
||||
set -- ${@:1:1} "-u" ${@:3}
|
||||
if [ "$#" -eq 2 ]; then
|
||||
exit
|
||||
fi
|
||||
;;
|
||||
-*)
|
||||
error "Unknown option flag: $1"
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
if [ -r "$1" ] ; then
|
||||
has_stdin=f
|
||||
print_image "$1" 1 "$(b64_encode < "$1")" "$print_filename"
|
||||
else
|
||||
error "imgcat: $1: No such file or directory"
|
||||
exit 2
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Read and print stdin
|
||||
if [ $has_stdin = t ]; then
|
||||
print_image "" 1 "$(cat | b64_encode)" ""
|
||||
fi
|
||||
|
||||
exit 0
|
0
python/boto/requirements.txt
Normal file
0
python/boto/requirements.txt
Normal file
21
python/ipython/requirements.txt
Normal file
21
python/ipython/requirements.txt
Normal file
@ -0,0 +1,21 @@
|
||||
appnope==0.1.0
|
||||
backcall==0.1.0
|
||||
certifi==2019.9.11
|
||||
chardet==3.0.4
|
||||
decorator==4.4.0
|
||||
idna==2.8
|
||||
ipython==7.8.0
|
||||
ipython-genutils==0.2.0
|
||||
jedi==0.15.1
|
||||
parso==0.5.1
|
||||
pexpect==4.7.0
|
||||
pickleshare==0.7.5
|
||||
prompt-toolkit==2.0.9
|
||||
ptyprocess==0.6.0
|
||||
Pygments==2.4.2
|
||||
python-dotenv==0.10.3
|
||||
requests==2.22.0
|
||||
six==1.12.0
|
||||
traitlets==4.3.2
|
||||
urllib3==1.25.6
|
||||
wcwidth==0.1.7
|
94
scripts/bootstrap
Executable file
94
scripts/bootstrap
Executable file
@ -0,0 +1,94 @@
|
||||
#!/bin/sh
|
||||
|
||||
DOTS=$(dirname "$0")/..
|
||||
cd "$DOTS" || (echo "Directory not found: $DOTS"; exit 1)
|
||||
DOTS="$PWD"
|
||||
|
||||
check_for_zsh() {
|
||||
if ! (echo "$SHELL" | grep zsh > /dev/null)
|
||||
then
|
||||
echo "Switch to using zsh before continuing"
|
||||
echo ""
|
||||
echo "MacOS Instructions:"
|
||||
echo "System Preferences > Users & Groups > Unlock"
|
||||
echo "Right-click on user, Advanced Options..."
|
||||
echo "Login shell: /bin/zsh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "zsh ✓"
|
||||
}
|
||||
|
||||
check_for_ohmyzsh() {
|
||||
if [ ! -d ~/.oh-my-zsh ]
|
||||
then
|
||||
echo "oh-my-zsh ✕"
|
||||
echo ""
|
||||
echo "Install oh-my-zsh before continuing"
|
||||
echo "You can run the script: install_ohmyzsh"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "oh-my-zsh ✓"
|
||||
}
|
||||
|
||||
install_xcode() {
|
||||
if [ "$(uname)" = "Darwin" ]
|
||||
then
|
||||
if ! (xcode-select --version > /dev/null 2>&1)
|
||||
then
|
||||
xcode-select --install
|
||||
fi
|
||||
echo "xcode ✓"
|
||||
fi
|
||||
}
|
||||
|
||||
install_homebrew() {
|
||||
if ! (which /usr/local/bin/brew > /dev/null)
|
||||
then
|
||||
printf "homebrew ✕\n\n"
|
||||
printf "\ninstalling homebrew..."
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "homebrew ✓"
|
||||
}
|
||||
|
||||
install_brews() {
|
||||
brewfile=$DOTS/homebrew/Brewfile
|
||||
if ! (/usr/local/bin/brew bundle check --file "$brewfile" > /dev/null)
|
||||
then
|
||||
/usr/local/bin/brew bundle --file "$brewfile"
|
||||
fi
|
||||
|
||||
echo "brews installed ✓"
|
||||
}
|
||||
|
||||
install_spacemacs() {
|
||||
emacsdir=~/.emacs.d
|
||||
if ! (git -C "$emacsdir" pull > /dev/null 2>&1)
|
||||
then
|
||||
git clone https://github.com/syl20bnr/spacemacs "$emacsdir"
|
||||
fi
|
||||
|
||||
echo "spacemacs ✓"
|
||||
}
|
||||
|
||||
printf "\nbootstrapping...\n\n"
|
||||
check_for_zsh
|
||||
check_for_ohmyzsh
|
||||
install_xcode
|
||||
install_homebrew
|
||||
install_brews
|
||||
install_spacemacs
|
||||
("$DOTS/scripts/setup_symlinks")
|
||||
|
||||
echo ""
|
||||
echo "consider running other scripts:"
|
||||
echo " - configure_macos"
|
||||
echo " - setup_keybase"
|
||||
echo " - install_python"
|
||||
echo " - install_rust"
|
||||
echo ""
|
103
scripts/configure_macos
Executable file
103
scripts/configure_macos
Executable file
@ -0,0 +1,103 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)"
|
||||
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
|
||||
|
||||
# echo "Enable subpixel font rendering on non-Apple LCDs"
|
||||
# defaults write NSGlobalDomain AppleFontSmoothing -int 2
|
||||
|
||||
# echo "Automatically show and hide the dock"
|
||||
# defaults write com.apple.dock autohide -bool true
|
||||
|
||||
echo "Make Dock icons of hidden applications translucent"
|
||||
defaults write com.apple.dock showhidden -bool true
|
||||
|
||||
# echo "Show all filename extensions in Finder"
|
||||
# defaults write NSGlobalDomain AppleShowAllExtensions -bool true
|
||||
|
||||
echo "Use current directory as default search scope in Finder"
|
||||
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
|
||||
|
||||
echo "Expand save panel by default"
|
||||
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
|
||||
|
||||
echo "Expand print panel by default"
|
||||
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
|
||||
|
||||
echo "Disable the \"Are you sure you want to open this application?\" dialog"
|
||||
defaults write com.apple.LaunchServices LSQuarantine -bool false
|
||||
|
||||
echo "Enable highlight hover effect for the grid view of a stack (Dock)"
|
||||
defaults write com.apple.dock mouse-over-hilte-stack -bool true
|
||||
|
||||
echo "Enable spring loading for all Dock items"
|
||||
defaults write enable-spring-load-actions-on-all-items -bool true
|
||||
|
||||
echo "Disable press-and-hold for keys in favor of key repeat"
|
||||
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
|
||||
defaults write -g ApplePressAndHoldEnabled -bool false
|
||||
|
||||
echo "Set a blazingly fast keyboard repeat rate"
|
||||
defaults write NSGlobalDomain KeyRepeat -int 2
|
||||
|
||||
echo "Set a shorter Delay until key repeat"
|
||||
defaults write NSGlobalDomain InitialKeyRepeat -int 12
|
||||
|
||||
echo "Disable disk image verification"
|
||||
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
||||
|
||||
echo "Avoid creating .DS_Store files on network volumes"
|
||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
||||
|
||||
echo "Disable the warning when changing a file extension"
|
||||
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
|
||||
|
||||
# echo "Enable snap-to-grid for desktop icons"
|
||||
# /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
||||
|
||||
echo "Disable the warning before emptying the Trash"
|
||||
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
||||
|
||||
# echo "Enable tap to click (Trackpad)"
|
||||
# defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
|
||||
|
||||
echo "Enable Safari’s debug menu"
|
||||
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
|
||||
|
||||
echo "Make Safari’s search banners default to Contains instead of Starts With"
|
||||
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
|
||||
|
||||
echo "Add a context menu item for showing the Web Inspector in web views"
|
||||
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
|
||||
|
||||
# echo "Only use UTF-8 in Terminal.app"
|
||||
# defaults write com.apple.terminal StringEncodings -array 4
|
||||
|
||||
# echo "Make ⌘ + F focus the search input in iTunes"
|
||||
# defaults write com.apple.iTunes NSUserKeyEquivalents -dict-add "Target Search Field" "@F"
|
||||
|
||||
# Noah Prefs
|
||||
echo "Enable dock magnification"
|
||||
defaults write com.apple.dock magnification -bool true
|
||||
|
||||
echo "Set dock size"
|
||||
defaults write com.apple.dock largesize -int 48
|
||||
defaults write com.apple.dock tilesize -int 44
|
||||
|
||||
# echo "Allow apps from anywhere"
|
||||
# sudo spctl --master-disable
|
||||
|
||||
# ---
|
||||
|
||||
echo "Reset Launchpad"
|
||||
# [ -e ~/Library/Application\ Support/Dock/*.db ] && rm ~/Library/Application\ Support/Dock/*.db
|
||||
rm ~/Library/Application\ Support/Dock/*.db
|
||||
|
||||
echo "Show the ~/Library folder"
|
||||
chflags nohidden ~/Library
|
||||
|
||||
# Clean up
|
||||
echo "Kill affected applications"
|
||||
for app in Safari Finder Dock Mail SystemUIServer; do killall "$app" >/dev/null 2>&1; done
|
14
scripts/install_ohmyzsh
Executable file
14
scripts/install_ohmyzsh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
install_ohmyzsh() {
|
||||
if [ ! -d ~/.oh-my-zsh ]
|
||||
then
|
||||
printf "\ninstalling oh my zsh...\nremember to restart terminal afterwards\n\n"
|
||||
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "installed ✓"
|
||||
}
|
||||
|
||||
install_ohmyzsh
|
53
scripts/install_python
Executable file
53
scripts/install_python
Executable file
@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
|
||||
PYTHON_VERSION=3.8.2
|
||||
DOTS=$(dirname "$0")/..
|
||||
cd "$DOTS" || (echo "Directory not found: $DOTS"; exit 1)
|
||||
DOTS="$PWD"
|
||||
|
||||
check_for_pyenv() {
|
||||
if ! (which pyenv > /dev/null)
|
||||
then
|
||||
echo ""
|
||||
echo "pyenv not found"
|
||||
if ! (/usr/local/bin/brew list | grep pyenv > /dev/null)
|
||||
then
|
||||
echo "pyenv not installed, run: bootstrap"
|
||||
echo ""
|
||||
else
|
||||
echo "pyenv is installed, run: setup_symlinks (and restart)"
|
||||
echo ""
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
echo "pyenv ✓"
|
||||
}
|
||||
|
||||
setup_python() {
|
||||
/usr/local/bin/pyenv install $PYTHON_VERSION --skip-existing
|
||||
/usr/local/bin/pyenv global $PYTHON_VERSION
|
||||
|
||||
echo "python $PYTHON_VERSION ✓"
|
||||
}
|
||||
|
||||
setup_python_envs() {
|
||||
for dir in "$DOTS"/python/*/
|
||||
do
|
||||
dir=${dir%*/}
|
||||
envname=$(basename "$dir")
|
||||
if ! (/usr/local/bin/pyenv versions | grep -w "$envname" > /dev/null)
|
||||
then
|
||||
/usr/local/bin/pyenv virtualenv "$PYTHON_VERSION" "$envname" > /dev/null
|
||||
fi
|
||||
# shellcheck source=/dev/null
|
||||
. "$HOME/.pyenv/versions/$envname/bin/activate"
|
||||
pip install --upgrade pip > /dev/null
|
||||
pip install -r "$dir/requirements.txt" > /dev/null
|
||||
deactivate
|
||||
echo " - venv: $envname ✓"
|
||||
done
|
||||
}
|
||||
|
||||
check_for_pyenv
|
||||
setup_python
|
||||
setup_python_envs
|
39
scripts/install_rust
Executable file
39
scripts/install_rust
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
install_rust() {
|
||||
if ! (which ~/.cargo/bin/rustup > /dev/null)
|
||||
then
|
||||
echo "installing rustup"
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
fi
|
||||
|
||||
echo "rustup ✓"
|
||||
}
|
||||
|
||||
update_rust() {
|
||||
~/.cargo/bin/rustup update > /dev/null 2>&1
|
||||
rust_version=$(~/.cargo/bin/rustc --version | awk '{print $2}')
|
||||
|
||||
echo "latest rust: $rust_version ✓"
|
||||
}
|
||||
|
||||
download_rust_analyzer() {
|
||||
if ! (which rust-analyzer > /dev/null)
|
||||
then
|
||||
echo "downloading rust analyzer"
|
||||
rust_analyzer_bin=/usr/local/bin/rust-analyzer
|
||||
curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-mac -o $rust_analyzer_bin
|
||||
chmod +x $rust_analyzer_bin
|
||||
fi
|
||||
|
||||
echo "rust-analyzer ✓"
|
||||
}
|
||||
|
||||
cargo_tools() {
|
||||
cargo install toml-cli
|
||||
cargo install jql
|
||||
}
|
||||
|
||||
install_rust
|
||||
update_rust
|
||||
download_rust_analyzer
|
42
scripts/setup_keybase
Executable file
42
scripts/setup_keybase
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
setup_keybase() {
|
||||
KEYBASE_USER=$(keybase whoami || (echo "Please login to keybase first"; exit 1))
|
||||
keybase fs sync enable "/keybase/private/$KEYBASE_USER"
|
||||
|
||||
echo "keybase ✓"
|
||||
}
|
||||
|
||||
setup_keybase_ssh() {
|
||||
SSH_DIR="/Volumes/Keybase/private/$KEYBASE_USER/ssh"
|
||||
if [ -d "$SSH_DIR" ]
|
||||
then
|
||||
rm -rf ~/.ssh
|
||||
ln -s "$SSH_DIR" ~/.ssh
|
||||
|
||||
echo " - keybase: ssh ✓"
|
||||
else
|
||||
echo "Directory not found: $SSH_DIR"
|
||||
echo "Please check your keybase files"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
setup_keybase_aws() {
|
||||
AWS_DIR="/Volumes/Keybase/private/$KEYBASE_USER/aws"
|
||||
if [ -d "$AWS_DIR" ]
|
||||
then
|
||||
rm -rf ~/.aws
|
||||
ln -s "$AWS_DIR" ~/.aws
|
||||
|
||||
echo " - keybase: aws ✓"
|
||||
else
|
||||
echo "Directory not found: $AWS_DIR"
|
||||
echo "Please check your keybase files"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
setup_keybase
|
||||
setup_keybase_ssh
|
||||
setup_keybase_aws
|
26
scripts/setup_symlinks
Executable file
26
scripts/setup_symlinks
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
DOTS=$(dirname "$0")/..
|
||||
cd "$DOTS" || (echo "Directory not found: $DOTS"; exit 1)
|
||||
DOTS="$PWD"
|
||||
|
||||
setup_symlinks() {
|
||||
for source in $(find "$DOTS" -iname "*.symlink")
|
||||
do
|
||||
dest="$HOME/.`basename \"${source%.*}\"`"
|
||||
rm -rf "$dest"
|
||||
ln -s "$source" "$dest"
|
||||
done
|
||||
|
||||
# Spacemacs
|
||||
rm -rf "$HOME/.spacemacs.d"
|
||||
ln -s "$DOTS/spacemacs.d" "$HOME/.spacemacs.d"
|
||||
|
||||
# Vim
|
||||
rm -rf "$HOME/.vim"
|
||||
ln -s "$DOTS/vim" "$HOME/.vim"
|
||||
|
||||
echo "symlinks ✓"
|
||||
}
|
||||
|
||||
setup_symlinks
|
450
spacemacs.d/init.el
Normal file
450
spacemacs.d/init.el
Normal file
@ -0,0 +1,450 @@
|
||||
;; -*- mode: emacs-lisp -*-
|
||||
;; This file is loaded by Spacemacs at startup.
|
||||
;; It must be stored in your home directory.
|
||||
|
||||
(defun dotspacemacs/layers ()
|
||||
"Configuration Layers declaration.
|
||||
You should not put any user code in this function besides modifying the variable
|
||||
values."
|
||||
(setq-default
|
||||
;; Base distribution to use. This is a layer contained in the directory
|
||||
;; `+distribution'. For now available distributions are `spacemacs-base'
|
||||
;; or `spacemacs'. (default 'spacemacs)
|
||||
dotspacemacs-distribution 'spacemacs
|
||||
;; Lazy installation of layers (i.e. layers are installed only when a file
|
||||
;; with a supported type is opened). Possible values are `all', `unused'
|
||||
;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
|
||||
;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
|
||||
;; lazy install any layer that support lazy installation even the layers
|
||||
;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
|
||||
;; installation feature and you have to explicitly list a layer in the
|
||||
;; variable `dotspacemacs-configuration-layers' to install it.
|
||||
;; (default 'unused)
|
||||
dotspacemacs-enable-lazy-installation 'unused
|
||||
;; If non-nil then Spacemacs will ask for confirmation before installing
|
||||
;; a layer lazily. (default t)
|
||||
dotspacemacs-ask-for-lazy-installation t
|
||||
;; If non-nil layers with lazy install support are lazy installed.
|
||||
;; List of additional paths where to look for configuration layers.
|
||||
;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
|
||||
dotspacemacs-configuration-layer-path '()
|
||||
;; List of configuration layers to load.
|
||||
dotspacemacs-configuration-layers
|
||||
'(
|
||||
php
|
||||
sql
|
||||
sml
|
||||
javascript
|
||||
html
|
||||
csv
|
||||
;; (rust :variables rust-backend 'racer)
|
||||
(rust :variables
|
||||
rust-format-on-save t)
|
||||
(lsp :variables
|
||||
lsp-ui-doc-enable nil
|
||||
lsp-ui-sideline-code-actions-prefix " "
|
||||
lsp-ui-sideline-show-hover nil
|
||||
lsp-rust-server 'rust-analyzer
|
||||
lsp-rust-analyzer-server-display-inlay-hints t
|
||||
lsp-rust-analyzer-cargo-watch-enable t)
|
||||
python
|
||||
;; javascript
|
||||
helm
|
||||
;; auto-completion
|
||||
(auto-completion :variables
|
||||
auto-completion-return-key-behavior nil
|
||||
auto-completion-tab-key-behavior 'complete
|
||||
auto-completion-enable-sort-by-usage t
|
||||
auto-completion-private-snippets-directory nil)
|
||||
;; better-defaults
|
||||
emacs-lisp
|
||||
git
|
||||
markdown
|
||||
org
|
||||
osx
|
||||
ranger
|
||||
dash
|
||||
yaml
|
||||
terraform
|
||||
docker
|
||||
nginx
|
||||
restclient
|
||||
games
|
||||
xkcd
|
||||
;; (shell :variables
|
||||
;; shell-default-height 30
|
||||
;; shell-default-position 'bottom)
|
||||
;; spell-checking
|
||||
;; syntax-checking
|
||||
(syntax-checking :variables
|
||||
syntax-checking-enable-tooltips nil)
|
||||
;; version-control
|
||||
)
|
||||
;; List of additional packages that will be installed without being
|
||||
;; wrapped in a layer. If you need some configuration for these
|
||||
;; packages, then consider creating a layer. You can also put the
|
||||
;; configuration in `dotspacemacs/user-config'.
|
||||
dotspacemacs-additional-packages '(dockerfile-mode jenkins)
|
||||
;; A list of packages that cannot be updated.
|
||||
dotspacemacs-frozen-packages '()
|
||||
;; A list of packages that will not be installed and loaded.
|
||||
dotspacemacs-excluded-packages '()
|
||||
;; Defines the behaviour of Spacemacs when installing packages.
|
||||
;; Possible values are `used-only', `used-but-keep-unused' and `all'.
|
||||
;; `used-only' installs only explicitly used packages and uninstall any
|
||||
;; unused packages as well as their unused dependencies.
|
||||
;; `used-but-keep-unused' installs only the used packages but won't uninstall
|
||||
;; them if they become unused. `all' installs *all* packages supported by
|
||||
;; Spacemacs and never uninstall them. (default is `used-only')
|
||||
dotspacemacs-install-packages 'used-only))
|
||||
|
||||
(defun dotspacemacs/init ()
|
||||
"Initialization function.
|
||||
This function is called at the very startup of Spacemacs initialization
|
||||
before layers configuration.
|
||||
You should not put any user code in there besides modifying the variable
|
||||
values."
|
||||
;; This setq-default sexp is an exhaustive list of all the supported
|
||||
;; spacemacs settings.
|
||||
(setq-default
|
||||
;; If non nil ELPA repositories are contacted via HTTPS whenever it's
|
||||
;; possible. Set it to nil if you have no way to use HTTPS in your
|
||||
;; environment, otherwise it is strongly recommended to let it set to t.
|
||||
;; This variable has no effect if Emacs is launched with the parameter
|
||||
;; `--insecure' which forces the value of this variable to nil.
|
||||
;; (default t)
|
||||
dotspacemacs-elpa-https t
|
||||
;; Maximum allowed time in seconds to contact an ELPA repository.
|
||||
dotspacemacs-elpa-timeout 5
|
||||
;; If non nil then spacemacs will check for updates at startup
|
||||
;; when the current branch is not `develop'. Note that checking for
|
||||
;; new versions works via git commands, thus it calls GitHub services
|
||||
;; whenever you start Emacs. (default nil)
|
||||
dotspacemacs-check-for-update nil
|
||||
;; If non-nil, a form that evaluates to a package directory. For example, to
|
||||
;; use different package directories for different Emacs versions, set this
|
||||
;; to `emacs-version'.
|
||||
dotspacemacs-elpa-subdirectory nil
|
||||
;; One of `vim', `emacs' or `hybrid'.
|
||||
;; `hybrid' is like `vim' except that `insert state' is replaced by the
|
||||
;; `hybrid state' with `emacs' key bindings. The value can also be a list
|
||||
;; with `:variables' keyword (similar to layers). Check the editing styles
|
||||
;; section of the documentation for details on available variables.
|
||||
;; (default 'vim)
|
||||
dotspacemacs-editing-style 'vim
|
||||
;; NO IDEA WHAT THIS IS
|
||||
dotspacemacs-mode-line-theme 'spacemacs
|
||||
;; If non nil output loading progress in `*Messages*' buffer. (default nil)
|
||||
dotspacemacs-verbose-loading nil
|
||||
;; Specify the startup banner. Default value is `official', it displays
|
||||
;; the official spacemacs logo. An integer value is the index of text
|
||||
;; banner, `random' chooses a random text banner in `core/banners'
|
||||
;; directory. A string value must be a path to an image format supported
|
||||
;; by your Emacs build.
|
||||
;; If the value is nil then no banner is displayed. (default 'official)
|
||||
dotspacemacs-startup-banner 'official
|
||||
;; List of items to show in startup buffer or an association list of
|
||||
;; the form `(list-type . list-size)`. If nil then it is disabled.
|
||||
;; Possible values for list-type are:
|
||||
;; `recents' `bookmarks' `projects' `agenda' `todos'."
|
||||
;; List sizes may be nil, in which case
|
||||
;; `spacemacs-buffer-startup-lists-length' takes effect.
|
||||
dotspacemacs-startup-lists '((recents . 5)
|
||||
(projects . 7))
|
||||
;; True if the home buffer should respond to resize events.
|
||||
dotspacemacs-startup-buffer-responsive t
|
||||
;; Default major mode of the scratch buffer (default `text-mode')
|
||||
dotspacemacs-scratch-mode 'text-mode
|
||||
;; List of themes, the first of the list is loaded when spacemacs starts.
|
||||
;; Press <SPC> T n to cycle to the next theme in the list (works great
|
||||
;; with 2 themes variants, one dark and one light)
|
||||
dotspacemacs-themes '(spacemacs-dark
|
||||
spacemacs-light)
|
||||
;; If non nil the cursor color matches the state color in GUI Emacs.
|
||||
dotspacemacs-colorize-cursor-according-to-state t
|
||||
;; Default font, or prioritized list of fonts. `powerline-scale' allows to
|
||||
;; quickly tweak the mode-line size to make separators look not too crappy.
|
||||
dotspacemacs-default-font '("Fira Mono for Powerline"
|
||||
:size 15
|
||||
:weight normal
|
||||
:width normal
|
||||
:powerline-scale 1.1)
|
||||
;; The leader key
|
||||
dotspacemacs-leader-key "SPC"
|
||||
;; The key used for Emacs commands (M-x) (after pressing on the leader key).
|
||||
;; (default "SPC")
|
||||
dotspacemacs-emacs-command-key "SPC"
|
||||
;; The key used for Vim Ex commands (default ":")
|
||||
dotspacemacs-ex-command-key ":"
|
||||
;; The leader key accessible in `emacs state' and `insert state'
|
||||
;; (default "M-m")
|
||||
dotspacemacs-emacs-leader-key "M-m"
|
||||
;; Major mode leader key is a shortcut key which is the equivalent of
|
||||
;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
|
||||
dotspacemacs-major-mode-leader-key ","
|
||||
;; Major mode leader key accessible in `emacs state' and `insert state'.
|
||||
;; (default "C-M-m")
|
||||
dotspacemacs-major-mode-emacs-leader-key "C-M-m"
|
||||
;; These variables control whether separate commands are bound in the GUI to
|
||||
;; the key pairs C-i, TAB and C-m, RET.
|
||||
;; Setting it to a non-nil value, allows for separate commands under <C-i>
|
||||
;; and TAB or <C-m> and RET.
|
||||
;; In the terminal, these pairs are generally indistinguishable, so this only
|
||||
;; works in the GUI. (default nil)
|
||||
dotspacemacs-distinguish-gui-tab nil
|
||||
;; If non nil `Y' is remapped to `y$' in Evil states. (default nil)
|
||||
dotspacemacs-remap-Y-to-y$ nil
|
||||
;; If non-nil, the shift mappings `<' and `>' retain visual state if used
|
||||
;; there. (default t)
|
||||
dotspacemacs-retain-visual-state-on-shift t
|
||||
;; If non-nil, J and K move lines up and down when in visual mode.
|
||||
;; (default nil)
|
||||
dotspacemacs-visual-line-move-text nil
|
||||
;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.
|
||||
;; (default nil)
|
||||
dotspacemacs-ex-substitute-global nil
|
||||
;; Name of the default layout (default "Default")
|
||||
dotspacemacs-default-layout-name "Default"
|
||||
;; If non nil the default layout name is displayed in the mode-line.
|
||||
;; (default nil)
|
||||
dotspacemacs-display-default-layout nil
|
||||
;; If non nil then the last auto saved layouts are resume automatically upon
|
||||
;; start. (default nil)
|
||||
dotspacemacs-auto-resume-layouts nil
|
||||
;; Size (in MB) above which spacemacs will prompt to open the large file
|
||||
;; literally to avoid performance issues. Opening a file literally means that
|
||||
;; no major mode or minor modes are active. (default is 1)
|
||||
dotspacemacs-large-file-size 1
|
||||
;; Location where to auto-save files. Possible values are `original' to
|
||||
;; auto-save the file in-place, `cache' to auto-save the file to another
|
||||
;; file stored in the cache directory and `nil' to disable auto-saving.
|
||||
;; (default 'cache)
|
||||
dotspacemacs-auto-save-file-location 'cache
|
||||
;; Maximum number of rollback slots to keep in the cache. (default 5)
|
||||
dotspacemacs-max-rollback-slots 5
|
||||
;; If non nil, `helm' will try to minimize the space it uses. (default nil)
|
||||
dotspacemacs-helm-resize nil
|
||||
;; if non nil, the helm header is hidden when there is only one source.
|
||||
;; (default nil)
|
||||
dotspacemacs-helm-no-header nil
|
||||
;; define the position to display `helm', options are `bottom', `top',
|
||||
;; `left', or `right'. (default 'bottom)
|
||||
dotspacemacs-helm-position 'bottom
|
||||
;; Controls fuzzy matching in helm. If set to `always', force fuzzy matching
|
||||
;; in all non-asynchronous sources. If set to `source', preserve individual
|
||||
;; source settings. Else, disable fuzzy matching in all sources.
|
||||
;; (default 'always)
|
||||
dotspacemacs-helm-use-fuzzy 'always
|
||||
;; If non nil the paste micro-state is enabled. When enabled pressing `p`
|
||||
;; several times cycle between the kill ring content. (default nil)
|
||||
dotspacemacs-enable-paste-transient-state nil
|
||||
;; Which-key delay in seconds. The which-key buffer is the popup listing
|
||||
;; the commands bound to the current keystroke sequence. (default 0.4)
|
||||
dotspacemacs-which-key-delay 0.4
|
||||
;; Which-key frame position. Possible values are `right', `bottom' and
|
||||
;; `right-then-bottom'. right-then-bottom tries to display the frame to the
|
||||
;; right; if there is insufficient space it displays it at the bottom.
|
||||
;; (default 'bottom)
|
||||
dotspacemacs-which-key-position 'bottom
|
||||
;; If non nil a progress bar is displayed when spacemacs is loading. This
|
||||
;; may increase the boot time on some systems and emacs builds, set it to
|
||||
;; nil to boost the loading time. (default t)
|
||||
dotspacemacs-loading-progress-bar t
|
||||
;; If non nil the frame is fullscreen when Emacs starts up. (default nil)
|
||||
;; (Emacs 24.4+ only)
|
||||
dotspacemacs-fullscreen-at-startup nil
|
||||
;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
|
||||
;; Use to disable fullscreen animations in OSX. (default nil)
|
||||
dotspacemacs-fullscreen-use-non-native nil
|
||||
;; If non nil the frame is maximized when Emacs starts up.
|
||||
;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
|
||||
;; (default nil) (Emacs 24.4+ only)
|
||||
dotspacemacs-maximized-at-startup nil
|
||||
;; A value from the range (0..100), in increasing opacity, which describes
|
||||
;; the transparency level of a frame when it's active or selected.
|
||||
;; Transparency can be toggled through `toggle-transparency'. (default 90)
|
||||
dotspacemacs-active-transparency 90
|
||||
;; A value from the range (0..100), in increasing opacity, which describes
|
||||
;; the transparency level of a frame when it's inactive or deselected.
|
||||
;; Transparency can be toggled through `toggle-transparency'. (default 90)
|
||||
dotspacemacs-inactive-transparency 90
|
||||
;; If non nil show the titles of transient states. (default t)
|
||||
dotspacemacs-show-transient-state-title t
|
||||
;; If non nil show the color guide hint for transient state keys. (default t)
|
||||
dotspacemacs-show-transient-state-color-guide t
|
||||
;; If non nil unicode symbols are displayed in the mode line. (default t)
|
||||
dotspacemacs-mode-line-unicode-symbols t
|
||||
;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth
|
||||
;; scrolling overrides the default behavior of Emacs which recenters point
|
||||
;; when it reaches the top or bottom of the screen. (default t)
|
||||
dotspacemacs-smooth-scrolling t
|
||||
;; Control line numbers activation.
|
||||
;; If set to `t' or `relative' line numbers are turned on in all `prog-mode' and
|
||||
;; `text-mode' derivatives. If set to `relative', line numbers are relative.
|
||||
;; This variable can also be set to a property list for finer control:
|
||||
;; '(:relative nil
|
||||
;; :disabled-for-modes dired-mode
|
||||
;; doc-view-mode
|
||||
;; markdown-mode
|
||||
;; org-mode
|
||||
;; pdf-view-mode
|
||||
;; text-mode
|
||||
;; :size-limit-kb 1000)
|
||||
;; (default nil)
|
||||
dotspacemacs-line-numbers 'relative
|
||||
;; Code folding method. Possible values are `evil' and `origami'.
|
||||
;; (default 'evil)
|
||||
dotspacemacs-folding-method 'evil
|
||||
;; If non-nil smartparens-strict-mode will be enabled in programming modes.
|
||||
;; (default nil)
|
||||
dotspacemacs-smartparens-strict-mode nil
|
||||
;; If non-nil pressing the closing parenthesis `)' key in insert mode passes
|
||||
;; over any automatically added closing parenthesis, bracket, quote, etc…
|
||||
;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)
|
||||
dotspacemacs-smart-closing-parenthesis nil
|
||||
;; Select a scope to highlight delimiters. Possible values are `any',
|
||||
;; `current', `all' or `nil'. Default is `all' (highlight any scope and
|
||||
;; emphasis the current one). (default 'all)
|
||||
dotspacemacs-highlight-delimiters 'all
|
||||
;; If non nil, advise quit functions to keep server open when quitting.
|
||||
;; (default nil)
|
||||
dotspacemacs-persistent-server nil
|
||||
;; List of search tool executable names. Spacemacs uses the first installed
|
||||
;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.
|
||||
;; (default '("ag" "pt" "ack" "grep"))
|
||||
dotspacemacs-search-tools '("ag" "pt" "ack" "grep")
|
||||
;; The default package repository used if no explicit repository has been
|
||||
;; specified with an installed package.
|
||||
;; Not used for now. (default nil)
|
||||
dotspacemacs-default-package-repository nil
|
||||
;; Delete whitespace while saving buffer. Possible values are `all'
|
||||
;; to aggressively delete empty line and long sequences of whitespace,
|
||||
;; `trailing' to delete only the whitespace at end of lines, `changed'to
|
||||
;; delete only whitespace for changed lines or `nil' to disable cleanup.
|
||||
;; (default nil)
|
||||
dotspacemacs-whitespace-cleanup nil
|
||||
))
|
||||
|
||||
(defun dotspacemacs/user-init ()
|
||||
"Initialization function for user code.
|
||||
It is called immediately after `dotspacemacs/init', before layer configuration
|
||||
executes.
|
||||
This function is mostly useful for variables that need to be set
|
||||
before packages are loaded. If you are unsure, you should try in setting them in
|
||||
`dotspacemacs/user-config' first."
|
||||
)
|
||||
|
||||
(defun dotspacemacs/user-config ()
|
||||
"Configuration function for user code.
|
||||
This function is called at the very end of Spacemacs initialization after
|
||||
layers configuration.
|
||||
This is the place where most of your configurations should be done. Unless it is
|
||||
explicitly specified that a variable should be set before a package is loaded,
|
||||
you should place your code here."
|
||||
|
||||
;; Sets Spacemacs macOS window view settings
|
||||
(add-to-list 'default-frame-alist
|
||||
'(ns-transparent-titlebar . t))
|
||||
|
||||
(add-to-list 'default-frame-alist
|
||||
'(ns-appearance . dark)) ;; or light - depending on your theme
|
||||
|
||||
;; Sets window size and position
|
||||
(if (eq system-type 'darwin)
|
||||
;; If Mac
|
||||
(setq initial-frame-alist '((top . 10) (left . 160) (width . 160) (height . 64)))
|
||||
;; Else non-Mac
|
||||
(setq initial-frame-alist '((top . 20) (left . 30) (width . 130) (height . 57)))
|
||||
)
|
||||
|
||||
;; Org Mode -- count empty lines as blank separators
|
||||
(setq org-cycle-separator-lines -1)
|
||||
|
||||
;; Ranger Mode -- kill all the buffers on exit
|
||||
(setq ranger-cleanup-on-disable t)
|
||||
|
||||
;; Helm -- use ripgrep (rg) instead of silver searcher (ag)
|
||||
(setq helm-ag-base-command "rg --vimgrep --no-heading --smart-case")
|
||||
|
||||
;; Autocomplete -- help tooltips
|
||||
(setq auto-completion-enable-help-tooltip t)
|
||||
|
||||
;; Escape parenthesis
|
||||
(define-key evil-insert-state-map (kbd "M-l") 'sp-up-sexp)
|
||||
|
||||
;; Python Mode -- code folding
|
||||
(define-key evil-normal-state-map (kbd "z i") 'hs-hide-level)
|
||||
|
||||
;; Adds environment variables
|
||||
(setq exec-path-from-shell-arguments '("-l"))
|
||||
;; (with-temp-buffer
|
||||
;; (insert-file-contents "/Users/noah.masur/Documents/GitHub/dotfiles/env.txt")
|
||||
;; (while (search-forward-regexp "\\(.*\\)\n?" nil t)
|
||||
;; (exec-path-from-shell-copy-env (match-string 1))
|
||||
;; ))
|
||||
;; (defun source-file-and-get-envs (filename)
|
||||
;; (let* ((cmd (concat ". " filename "; env"))
|
||||
;; (env-str (shell-command-to-string cmd))
|
||||
;; (env-lines (split-string env-str "\n"))
|
||||
;; (envs (mapcar (lambda (s) (replace-regexp-in-string "=.*$" "" s)) env-lines)))
|
||||
;; (delete "" envs)))
|
||||
;; (exec-path-from-shell-copy-envs (source-file-and-get-envs "/Users/noah.masur/.bash_profile"))
|
||||
|
||||
;; Starts emacsclient server to receive terminal commands
|
||||
|
||||
;; Add QR code
|
||||
(defun kisaragi/qr-encode (str &optional buf)
|
||||
"Encode STR as a QR code.
|
||||
|
||||
Return a new buffer or BUF with the code in it."
|
||||
(interactive "MString to encode: ")
|
||||
(let ((buffer (get-buffer-create (or buf "*QR Code*")))
|
||||
(format (if (display-graphic-p) "PNG" "UTF8"))
|
||||
(inhibit-read-only t))
|
||||
(with-current-buffer buffer
|
||||
(delete-region (point-min) (point-max)))
|
||||
(make-process
|
||||
:name "qrencode" :buffer buffer
|
||||
:command `("qrencode" ,str "-t" ,format "-o" "-")
|
||||
:coding 'no-conversion
|
||||
;; seems only the filter function is able to move point to top
|
||||
:filter (lambda (process string)
|
||||
(with-current-buffer (process-buffer process)
|
||||
(insert string)
|
||||
(goto-char (point-min))
|
||||
(set-marker (process-mark process) (point))))
|
||||
:sentinel (lambda (process change)
|
||||
(when (string= change "finished\n")
|
||||
(with-current-buffer (process-buffer process)
|
||||
(cond ((string= format "PNG")
|
||||
(image-mode)
|
||||
(image-transform-fit-to-height))
|
||||
(t ;(string= format "UTF8")
|
||||
(text-mode)
|
||||
(decode-coding-region (point-min) (point-max) 'utf-8)))))))
|
||||
(when (called-interactively-p 'interactive)
|
||||
(display-buffer buffer))
|
||||
buffer))
|
||||
|
||||
(org-reload)
|
||||
|
||||
(server-start)
|
||||
)
|
||||
|
||||
;; Do not write anything past this comment. This is where Emacs will
|
||||
;; auto-generate custom variable definitions.
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(org-agenda-files (quote ("~/Dropbox (Take-Two)/org/tasks.org")))
|
||||
'(package-selected-packages
|
||||
(quote
|
||||
(php-auto-yasnippets drupal-mode phpunit phpcbf php-extras php-mode sql-indent ob-sml sml-mode slack jenkins emojify circe oauth2 websocket web-mode tagedit slim-mode scss-mode sass-mode pug-mode helm-css-scss haml-mode emmet-mode company-web web-completion-data restclient-helm ob-restclient ob-http nginx-mode company-restclient restclient know-your-http-well docker tablist docker-tramp csv-mode xkcd typit mmt sudoku pacmacs 2048-game terraform-mode hcl-mode dockerfile-mode toml-mode racer cargo rust-mode company-quickhelp pos-tip ranger yaml-mode logito pcache ht helm-company helm-c-yasnippet fuzzy company-tern tern company-statistics auto-yasnippet ac-ispell auto-complete yapfify pyvenv pytest pyenv-mode py-isort pip-requirements live-py-mode hy-mode dash-functional helm-pydoc cython-mode company-anaconda company anaconda-mode pythonic web-beautify livid-mode skewer-mode simple-httpd json-mode json-snatcher json-reformat js2-refactor yasnippet multiple-cursors js2-mode js-doc coffee-mode helm-dash dash-docs dash-at-point smeargle reveal-in-osx-finder pbcopy osx-trash osx-dictionary orgit org-projectile org-category-capture org-present org-pomodoro alert log4e gntp org-mime org-download mmm-mode markdown-toc markdown-mode magit-gitflow magit-popup launchctl htmlize helm-gitignore gnuplot gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link evil-magit magit transient git-commit with-editor ws-butler winum which-key volatile-highlights vi-tilde-fringe uuidgen use-package toc-org spaceline powerline restart-emacs request rainbow-delimiters popwin persp-mode pcre2el paradox spinner org-plus-contrib org-bullets open-junk-file neotree move-text macrostep lorem-ipsum linum-relative link-hint indent-guide hydra lv hungry-delete hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation helm-themes helm-swoop helm-projectile projectile pkg-info epl helm-mode-manager helm-make helm-flx helm-descbinds helm-ag google-translate golden-ratio flx-ido flx fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-search-highlight-persist highlight evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state smartparens evil-indent-plus evil-iedit-state iedit evil-exchange evil-escape evil-ediff evil-args evil-anzu anzu evil goto-chg undo-tree eval-sexp-fu elisp-slime-nav dumb-jump f dash s diminish define-word column-enforce-mode clean-aindent-mode bind-map bind-key auto-highlight-symbol auto-compile packed aggressive-indent adaptive-wrap ace-window ace-link ace-jump-helm-line helm avy helm-core popup async))))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
)
|
1
spacemacs.d/layers/README.md
Normal file
1
spacemacs.d/layers/README.md
Normal file
@ -0,0 +1 @@
|
||||
Directory to store layers
|
264
vim/autoload/pathogen.vim
Normal file
264
vim/autoload/pathogen.vim
Normal file
@ -0,0 +1,264 @@
|
||||
" pathogen.vim - path option manipulation
|
||||
" Maintainer: Tim Pope <http://tpo.pe/>
|
||||
" Version: 2.4
|
||||
|
||||
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
|
||||
"
|
||||
" For management of individually installed plugins in ~/.vim/bundle (or
|
||||
" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your
|
||||
" .vimrc is the only other setup necessary.
|
||||
"
|
||||
" The API is documented inline below.
|
||||
|
||||
if exists("g:loaded_pathogen") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_pathogen = 1
|
||||
|
||||
" Point of entry for basic default usage. Give a relative path to invoke
|
||||
" pathogen#interpose() or an absolute path to invoke pathogen#surround().
|
||||
" Curly braces are expanded with pathogen#expand(): "bundle/{}" finds all
|
||||
" subdirectories inside "bundle" inside all directories in the runtime path.
|
||||
" If no arguments are given, defaults "bundle/{}", and also "pack/{}/start/{}"
|
||||
" on versions of Vim without native package support.
|
||||
function! pathogen#infect(...) abort
|
||||
if a:0
|
||||
let paths = filter(reverse(copy(a:000)), 'type(v:val) == type("")')
|
||||
else
|
||||
let paths = ['bundle/{}', 'pack/{}/start/{}']
|
||||
endif
|
||||
if has('packages')
|
||||
call filter(paths, 'v:val !~# "^pack/[^/]*/start/[^/]*$"')
|
||||
endif
|
||||
let static = '^\%([$~\\/]\|\w:[\\/]\)[^{}*]*$'
|
||||
for path in filter(copy(paths), 'v:val =~# static')
|
||||
call pathogen#surround(path)
|
||||
endfor
|
||||
for path in filter(copy(paths), 'v:val !~# static')
|
||||
if path =~# '^\%([$~\\/]\|\w:[\\/]\)'
|
||||
call pathogen#surround(path)
|
||||
else
|
||||
call pathogen#interpose(path)
|
||||
endif
|
||||
endfor
|
||||
call pathogen#cycle_filetype()
|
||||
if pathogen#is_disabled($MYVIMRC)
|
||||
return 'finish'
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Split a path into a list.
|
||||
function! pathogen#split(path) abort
|
||||
if type(a:path) == type([]) | return a:path | endif
|
||||
if empty(a:path) | return [] | endif
|
||||
let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
|
||||
return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
|
||||
endfunction
|
||||
|
||||
" Convert a list to a path.
|
||||
function! pathogen#join(...) abort
|
||||
if type(a:1) == type(1) && a:1
|
||||
let i = 1
|
||||
let space = ' '
|
||||
else
|
||||
let i = 0
|
||||
let space = ''
|
||||
endif
|
||||
let path = ""
|
||||
while i < a:0
|
||||
if type(a:000[i]) == type([])
|
||||
let list = a:000[i]
|
||||
let j = 0
|
||||
while j < len(list)
|
||||
let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
|
||||
let path .= ',' . escaped
|
||||
let j += 1
|
||||
endwhile
|
||||
else
|
||||
let path .= "," . a:000[i]
|
||||
endif
|
||||
let i += 1
|
||||
endwhile
|
||||
return substitute(path,'^,','','')
|
||||
endfunction
|
||||
|
||||
" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
|
||||
function! pathogen#legacyjoin(...) abort
|
||||
return call('pathogen#join',[1] + a:000)
|
||||
endfunction
|
||||
|
||||
" Turn filetype detection off and back on again if it was already enabled.
|
||||
function! pathogen#cycle_filetype() abort
|
||||
if exists('g:did_load_filetypes')
|
||||
filetype off
|
||||
filetype on
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Check if a bundle is disabled. A bundle is considered disabled if its
|
||||
" basename or full name is included in the list g:pathogen_blacklist or the
|
||||
" comma delimited environment variable $VIMBLACKLIST.
|
||||
function! pathogen#is_disabled(path) abort
|
||||
if a:path =~# '\~$'
|
||||
return 1
|
||||
endif
|
||||
let sep = pathogen#slash()
|
||||
let blacklist = get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) + pathogen#split($VIMBLACKLIST)
|
||||
if !empty(blacklist)
|
||||
call map(blacklist, 'substitute(v:val, "[\\/]$", "", "")')
|
||||
endif
|
||||
return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1
|
||||
endfunction
|
||||
|
||||
" Prepend the given directory to the runtime path and append its corresponding
|
||||
" after directory. Curly braces are expanded with pathogen#expand().
|
||||
function! pathogen#surround(path) abort
|
||||
let sep = pathogen#slash()
|
||||
let rtp = pathogen#split(&rtp)
|
||||
let path = fnamemodify(a:path, ':s?[\\/]\=$??')
|
||||
let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)')
|
||||
let after = filter(reverse(pathogen#expand(path, sep.'after')), '!pathogen#is_disabled(v:val[0:-7])')
|
||||
call filter(rtp, 'index(before + after, v:val) == -1')
|
||||
let &rtp = pathogen#join(before, rtp, after)
|
||||
return &rtp
|
||||
endfunction
|
||||
|
||||
" For each directory in the runtime path, add a second entry with the given
|
||||
" argument appended. Curly braces are expanded with pathogen#expand().
|
||||
function! pathogen#interpose(name) abort
|
||||
let sep = pathogen#slash()
|
||||
let name = a:name
|
||||
if has_key(s:done_bundles, name)
|
||||
return ""
|
||||
endif
|
||||
let s:done_bundles[name] = 1
|
||||
let list = []
|
||||
for dir in pathogen#split(&rtp)
|
||||
if dir =~# '\<after$'
|
||||
let list += reverse(filter(pathogen#expand(dir[0:-6].name, sep.'after'), '!pathogen#is_disabled(v:val[0:-7])')) + [dir]
|
||||
else
|
||||
let list += [dir] + filter(pathogen#expand(dir.sep.name), '!pathogen#is_disabled(v:val)')
|
||||
endif
|
||||
endfor
|
||||
let &rtp = pathogen#join(pathogen#uniq(list))
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
let s:done_bundles = {}
|
||||
|
||||
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
|
||||
function! pathogen#helptags() abort
|
||||
let sep = pathogen#slash()
|
||||
for glob in pathogen#split(&rtp)
|
||||
for dir in map(split(glob(glob), "\n"), 'v:val.sep."/doc/".sep')
|
||||
if (dir)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir) == 2 && !empty(split(glob(dir.'*.txt'))) && (!filereadable(dir.'tags') || filewritable(dir.'tags'))
|
||||
silent! execute 'helptags' pathogen#fnameescape(dir)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
command! -bar Helptags :call pathogen#helptags()
|
||||
|
||||
" Execute the given command. This is basically a backdoor for --remote-expr.
|
||||
function! pathogen#execute(...) abort
|
||||
for command in a:000
|
||||
execute command
|
||||
endfor
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Section: Unofficial
|
||||
|
||||
function! pathogen#is_absolute(path) abort
|
||||
return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]')
|
||||
endfunction
|
||||
|
||||
" Given a string, returns all possible permutations of comma delimited braced
|
||||
" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields
|
||||
" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard
|
||||
" and globbed. Actual globs are preserved.
|
||||
function! pathogen#expand(pattern, ...) abort
|
||||
let after = a:0 ? a:1 : ''
|
||||
let pattern = substitute(a:pattern, '^[~$][^\/]*', '\=expand(submatch(0))', '')
|
||||
if pattern =~# '{[^{}]\+}'
|
||||
let [pre, pat, post] = split(substitute(pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
|
||||
let found = map(split(pat, ',', 1), 'pre.v:val.post')
|
||||
let results = []
|
||||
for pattern in found
|
||||
call extend(results, pathogen#expand(pattern))
|
||||
endfor
|
||||
elseif pattern =~# '{}'
|
||||
let pat = matchstr(pattern, '^.*{}[^*]*\%($\|[\\/]\)')
|
||||
let post = pattern[strlen(pat) : -1]
|
||||
let results = map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
|
||||
else
|
||||
let results = [pattern]
|
||||
endif
|
||||
let vf = pathogen#slash() . 'vimfiles'
|
||||
call map(results, 'v:val =~# "\\*" ? v:val.after : isdirectory(v:val.vf.after) ? v:val.vf.after : isdirectory(v:val.after) ? v:val.after : ""')
|
||||
return filter(results, '!empty(v:val)')
|
||||
endfunction
|
||||
|
||||
" \ on Windows unless shellslash is set, / everywhere else.
|
||||
function! pathogen#slash() abort
|
||||
return !exists("+shellslash") || &shellslash ? '/' : '\'
|
||||
endfunction
|
||||
|
||||
function! pathogen#separator() abort
|
||||
return pathogen#slash()
|
||||
endfunction
|
||||
|
||||
" Convenience wrapper around glob() which returns a list.
|
||||
function! pathogen#glob(pattern) abort
|
||||
let files = split(glob(a:pattern),"\n")
|
||||
return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")')
|
||||
endfunction
|
||||
|
||||
" Like pathogen#glob(), only limit the results to directories.
|
||||
function! pathogen#glob_directories(pattern) abort
|
||||
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
|
||||
endfunction
|
||||
|
||||
" Remove duplicates from a list.
|
||||
function! pathogen#uniq(list) abort
|
||||
let i = 0
|
||||
let seen = {}
|
||||
while i < len(a:list)
|
||||
if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
|
||||
call remove(a:list,i)
|
||||
elseif a:list[i] ==# ''
|
||||
let i += 1
|
||||
let empty = 1
|
||||
else
|
||||
let seen[a:list[i]] = 1
|
||||
let i += 1
|
||||
endif
|
||||
endwhile
|
||||
return a:list
|
||||
endfunction
|
||||
|
||||
" Backport of fnameescape().
|
||||
function! pathogen#fnameescape(string) abort
|
||||
if exists('*fnameescape')
|
||||
return fnameescape(a:string)
|
||||
elseif a:string ==# '-'
|
||||
return '\-'
|
||||
else
|
||||
return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Like findfile(), but hardcoded to use the runtimepath.
|
||||
function! pathogen#runtime_findfile(file,count) abort
|
||||
let rtp = pathogen#join(1,pathogen#split(&rtp))
|
||||
let file = findfile(a:file,rtp,a:count)
|
||||
if file ==# ''
|
||||
return ''
|
||||
else
|
||||
return fnamemodify(file,':p')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':
|
1117
vim/colors/solarized.vim
Normal file
1117
vim/colors/solarized.vim
Normal file
File diff suppressed because it is too large
Load Diff
57
vim/init.vim
Normal file
57
vim/init.vim
Normal file
@ -0,0 +1,57 @@
|
||||
syntax enable
|
||||
set background=dark
|
||||
" colorscheme solarized
|
||||
set nu
|
||||
set expandtab
|
||||
set shiftwidth=4
|
||||
set softtabstop=4
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set pastetoggle=<F3>
|
||||
set visualbell
|
||||
|
||||
" remember last position
|
||||
if has("autocmd")
|
||||
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
||||
endif
|
||||
|
||||
" path manipulation
|
||||
execute pathogen#infect()
|
||||
filetype plugin indent on
|
||||
|
||||
" terraform plugin
|
||||
let g:terraform_align=1
|
||||
let g:terraform_remap_spacebar=1
|
||||
|
||||
" powerline
|
||||
let g:Powerline_symbols = 'fancy'
|
||||
|
||||
" line type
|
||||
let &t_ti.="\e[1 q"
|
||||
let &t_SI.="\e[5 q"
|
||||
let &t_EI.="\e[1 q"
|
||||
let &t_te.="\e[0 q"
|
||||
|
||||
" better backup, swap and undo storage
|
||||
set noswapfile
|
||||
set backup
|
||||
set undofile
|
||||
set backupdir=~/.vim/dirs/backup
|
||||
set undodir=~/.vim/dirs/undo
|
||||
if !isdirectory(&backupdir)
|
||||
call mkdir(&backupdir, "p")
|
||||
endif
|
||||
if !isdirectory(&undodir)
|
||||
call mkdir(&undodir, "p")
|
||||
endif
|
||||
|
||||
" 256 colors
|
||||
" if !has("gui_running")
|
||||
" set nocompatible
|
||||
" colorscheme solarized
|
||||
" set mouse=a
|
||||
" endif
|
||||
|
||||
" change title
|
||||
let &titlestring = @%
|
||||
set title
|
86
zsh/aliases
Normal file
86
zsh/aliases
Normal file
@ -0,0 +1,86 @@
|
||||
# ls aliases
|
||||
alias ls='exa'
|
||||
alias ll='ls -alhF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CFA'
|
||||
alias lh='ls -l'
|
||||
# alias lh='ls -lhtraF'
|
||||
|
||||
# Old aliases
|
||||
alias inv='source ~/.venv/inventorybot/bin/activate'
|
||||
alias awscli='source ~/.venv/aws/bin/activate'
|
||||
alias gstory='source ~/.venv/gstory/bin/activate'
|
||||
alias stu='source ~/.venv/stupid/bin/activate'
|
||||
alias r='/projects/device42/run'
|
||||
alias qu='/projects/device42/utils/quickupdate-noah'
|
||||
alias qudb='/projects/device42/utils/debug-noah'
|
||||
alias dlog='/projects/device42/logwatch.sh'
|
||||
alias hlog='/projects/soc-utils/Hive_Bot/utils/logwatch.sh'
|
||||
alias bot='cd /projects/device42/inventorybot'
|
||||
alias tap='terraform apply'
|
||||
alias mod='cd /projects/terraform/modules'
|
||||
alias hs='cd /projects/soc-utils/Hive_Scripts'
|
||||
alias esc='cd /projects/soc-utils/Hive_Responders/Escalator'
|
||||
|
||||
# Emacs
|
||||
emacsenv='~/Documents/GitHub/dotfiles/bin/emacs_env'
|
||||
|
||||
# Improved CLI Tools
|
||||
alias ping='prettyping --nolegend'
|
||||
alias cat='bat'
|
||||
alias icat='$PROJ/dotfiles/iterm/imgcat'
|
||||
alias h='http -Fh --all'
|
||||
alias search='googler -j'
|
||||
alias checkip='curl checkip.amazonaws.com'
|
||||
|
||||
# Dotfile and config shortcuts
|
||||
alias aliases='edit $DOTS/zsh/aliases'
|
||||
alias zenv='edit $DOTS/zsh/env'
|
||||
alias zrc='edit $DOTS/zsh/zrcsh.symlink'
|
||||
alias reload='source ~/.zshrc'
|
||||
alias runbootstrap='$DOTS/scripts/bootstrap'
|
||||
alias sshc='edit ~/.ssh/config'
|
||||
alias hosts='edit /etc/hosts'
|
||||
|
||||
# Navigation shortcuts
|
||||
alias dots='cd $DOTS'
|
||||
alias org='cd ~/Dropbox\ \(Take-Two\)/org'
|
||||
alias proj='cd $PROJ'
|
||||
alias tpt='cd $PROJ/thirdpartytrust'
|
||||
alias hv='cd $PROJ/soc-utils/Hive_Bot/hivebot'
|
||||
alias tf='cd $TFDIR'
|
||||
alias gs='cd $TFDIR/projects/ghoststory'
|
||||
alias pd='cd $TFDIR/projects/privatedivision'
|
||||
alias t2='cd $TFDIR/projects/take2games'
|
||||
alias kb='cd $TFDIR/projects/kerbalspaceprogram'
|
||||
alias di='cd $TFDIR/projects/disintegration'
|
||||
alias slack='cd $PROJ/slack'
|
||||
alias misty='cd $PROJ/misty'
|
||||
alias dl='cd ~/Downloads'
|
||||
alias ssl='echo openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr'
|
||||
|
||||
# Virtualenv
|
||||
alias d='deactivate'
|
||||
alias pv='cd $WORKON_HOME'
|
||||
alias ip='source $WORKON_HOME/ipython/bin/activate'
|
||||
alias tp='source $WORKON_HOME/thirdpartytrust/bin/activate'
|
||||
alias hive='source $WORKON_HOME/hivebot/bin/activate'
|
||||
|
||||
# Docker
|
||||
alias dc='$DOTS/bin/docker_cleanup'
|
||||
alias dr='docker run'
|
||||
alias db='docker build . -t'
|
||||
alias connect='docker run --rm -v ~/.aws:/root/.aws -v ~/.ssh:/root/.ssh -it connect-aws'
|
||||
|
||||
# Python
|
||||
alias py='python'
|
||||
alias domisty='cd $PROJ/misty && ./buildrun.sh'
|
||||
|
||||
# Rust
|
||||
alias ca='cargo'
|
||||
|
||||
# Non-MacOS
|
||||
if [ $(uname) = "Linux" ]; then
|
||||
alias pbcopy='xclip -selection clipboard -in'
|
||||
alias pbpaste='xclip -selection clipboard -out'
|
||||
fi
|
105
zsh/functions
Normal file
105
zsh/functions
Normal file
@ -0,0 +1,105 @@
|
||||
# Open in Emacs
|
||||
edit() {
|
||||
emacsclient --no-wait --alternate-editor="emacs" "$@" &> /dev/null & disown
|
||||
}
|
||||
|
||||
# Create QR code from link
|
||||
qr() { qrencode "$1" -t ANSIUTF8 -o -; }
|
||||
|
||||
# Open directory in projects
|
||||
prj() {
|
||||
local projdir
|
||||
projdir=$(ls $PROJ | fzf)
|
||||
if [[ -z $projdir ]]
|
||||
then
|
||||
return 1
|
||||
else
|
||||
cd $projdir
|
||||
fi
|
||||
}
|
||||
|
||||
# Activate pyenv virtualenv
|
||||
venv() {
|
||||
source ~/.pyenv/versions/$1/bin/activate
|
||||
}
|
||||
|
||||
# Temporarily enter iPython interpreter with its Pyenv
|
||||
ipy() {
|
||||
STORED_VENV=$VIRTUAL_ENV
|
||||
source $WORKON_HOME/ipython/bin/activate && \
|
||||
ipython && \
|
||||
deactivate && \
|
||||
if [ $STORED_VENV ]; then
|
||||
source $STORED_VENV/bin/activate
|
||||
fi
|
||||
}
|
||||
|
||||
# Run pylint on all python files
|
||||
lint() {
|
||||
fd -IH -t f .py$ | xargs pylint
|
||||
}
|
||||
|
||||
# Stolen from: https://github.com/davidpdrsn/dotfiles/blob/master/zsh/functions
|
||||
|
||||
# Extract archives
|
||||
extract() {
|
||||
if [ -f $1 ] ; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xjf $1 ;;
|
||||
*.tar.gz) tar xzf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) rar x $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xf $1 ;;
|
||||
*.tbz2) tar xjf $1 ;;
|
||||
*.tgz) tar xzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*) echo "'$1' cannot be extracted via extract()" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
||||
}
|
||||
|
||||
# fe [FUZZY PATTERN] - Open the selected file with the default editor
|
||||
# - Bypass fuzzy finder if there's only one match (--select-1)
|
||||
# - Exit if there's no match (--exit-0)
|
||||
fe() {
|
||||
local file
|
||||
file=$(fzf --query="$1" --select-1 --exit-0)
|
||||
[ -n "$file" ] && ${EDITOR:-vim} "$file"
|
||||
}
|
||||
|
||||
# fd - cd to selected directory
|
||||
fcd() {
|
||||
local dir
|
||||
dir=$(find ${1:-*} -path '*/\.*' -prune \
|
||||
-o -type d -print 2> /dev/null | fzf +m) &&
|
||||
cd "$dir"
|
||||
}
|
||||
|
||||
# dir - fd name of dir in this directory
|
||||
dir() {
|
||||
# fd ".*$1.*" -H -d 1
|
||||
ls -lha | rg "$1"
|
||||
}
|
||||
|
||||
# vers - switch to pyenv virtualenv with fuzzy menu
|
||||
vers() {
|
||||
local version
|
||||
version=$(pyenv versions --bare --skip-aliases | fzf)
|
||||
if [[ -z $version ]]
|
||||
then
|
||||
return 1
|
||||
else
|
||||
source $WORKON_HOME/$version/bin/activate
|
||||
fi
|
||||
}
|
||||
|
||||
# unsetaws - remove all AWS environment variables
|
||||
unsetaws() {
|
||||
unset AWS_ACCESS_KEY_ID
|
||||
unset AWS_SECRET_ACCESS_KEY
|
||||
}
|
107
zsh/ohmyzsh
Normal file
107
zsh/ohmyzsh
Normal file
@ -0,0 +1,107 @@
|
||||
# Path to your oh-my-zsh installation.
|
||||
export ZSH="$HOME/.oh-my-zsh"
|
||||
|
||||
# Set name of the theme to load --- if set to "random", it will
|
||||
# load a random theme each time oh-my-zsh is loaded, in which case,
|
||||
# to know which specific one was loaded, run: echo $RANDOM_THEME
|
||||
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
|
||||
# ZSH_THEME="remy"
|
||||
# ZSH_THEME="agnoster"
|
||||
# ZSH_THEME="typewritten"
|
||||
ZSH_THEME="nicoulaj"
|
||||
|
||||
# Removes the prompt when encountering a .env file
|
||||
ZSH_DOTENV_PROMPT=false
|
||||
|
||||
# Set list of themes to pick from when loading at random
|
||||
# Setting this variable when ZSH_THEME=random will cause zsh to load
|
||||
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
|
||||
# If set to an empty array, this variable will have no effect.
|
||||
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
|
||||
|
||||
# Uncomment the following line to use case-sensitive completion.
|
||||
# CASE_SENSITIVE="true"
|
||||
|
||||
# Uncomment the following line to use hyphen-insensitive completion.
|
||||
# Case-sensitive completion must be off. _ and - will be interchangeable.
|
||||
# HYPHEN_INSENSITIVE="true"
|
||||
|
||||
# Uncomment the following line to disable bi-weekly auto-update checks.
|
||||
# DISABLE_AUTO_UPDATE="true"
|
||||
|
||||
# Uncomment the following line to automatically update without prompting.
|
||||
# DISABLE_UPDATE_PROMPT="true"
|
||||
|
||||
# Uncomment the following line to change how often to auto-update (in days).
|
||||
# export UPDATE_ZSH_DAYS=13
|
||||
|
||||
# Uncomment the following line if pasting URLs and other text is messed up.
|
||||
# DISABLE_MAGIC_FUNCTIONS=true
|
||||
|
||||
# Uncomment the following line to disable colors in ls.
|
||||
# DISABLE_LS_COLORS="true"
|
||||
|
||||
# Uncomment the following line to disable auto-setting terminal title.
|
||||
# DISABLE_AUTO_TITLE="true"
|
||||
|
||||
# Uncomment the following line to enable command auto-correction.
|
||||
# ENABLE_CORRECTION="true"
|
||||
|
||||
# Uncomment the following line to display red dots whilst waiting for completion.
|
||||
# COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
# Uncomment the following line if you want to disable marking untracked files
|
||||
# under VCS as dirty. This makes repository status check for large repositories
|
||||
# much, much faster.
|
||||
# DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||
|
||||
# Uncomment the following line if you want to change the command execution time
|
||||
# stamp shown in the history command output.
|
||||
# You can set one of the optional three formats:
|
||||
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
||||
# or set a custom format using the strftime function format specifications,
|
||||
# see 'man strftime' for details.
|
||||
# HIST_STAMPS="mm/dd/yyyy"
|
||||
|
||||
# Would you like to use another custom folder than $ZSH/custom?
|
||||
# ZSH_CUSTOM=~/.zsh/custom
|
||||
|
||||
# Which plugins would you like to load?
|
||||
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
|
||||
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
# Add wisely, as too many plugins slow down shell startup.
|
||||
plugins=(
|
||||
ripgrep
|
||||
docker
|
||||
dotenv
|
||||
osx
|
||||
cargo
|
||||
gem
|
||||
)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
# User configuration
|
||||
|
||||
# export MANPATH="/usr/local/man:$MANPATH"
|
||||
|
||||
# You may need to manually set your language environment
|
||||
# export LANG=en_US.UTF-8
|
||||
|
||||
# Preferred editor for local and remote sessions
|
||||
# if [[ -n $SSH_CONNECTION ]]; then
|
||||
# export EDITOR='vim'
|
||||
# else
|
||||
# export EDITOR='mvim'
|
||||
# fi
|
||||
|
||||
# Compilation flags
|
||||
# export ARCHFLAGS="-arch x86_64"
|
||||
|
||||
# Auto-Suggestions
|
||||
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=6,bg=6"
|
||||
export ZSH_AUTOSUGGEST_STRATEGY=(completion history)
|
||||
bindkey '^ ' autosuggest-accept
|
||||
zstyle ':completion:*' use-cache on
|
||||
zstyle ':completion:*' cache-path ~/.zsh/cache
|
18
zsh/vim
Normal file
18
zsh/vim
Normal file
@ -0,0 +1,18 @@
|
||||
### Activate vi / vim mode:
|
||||
bindkey -v
|
||||
|
||||
# Remove delay when entering normal mode (vi)
|
||||
KEYTIMEOUT=5
|
||||
|
||||
# Change cursor shape for different vi modes.
|
||||
function zle-keymap-select {
|
||||
if [[ $KEYMAP == vicmd ]] || [[ $1 = 'block' ]]; then
|
||||
echo -ne '\e[1 q'
|
||||
elif [[ $KEYMAP == main ]] || [[ $KEYMAP == viins ]] || [[ $KEYMAP = '' ]] || [[ $1 = 'beam' ]]; then
|
||||
echo -ne '\e[5 q'
|
||||
fi
|
||||
}
|
||||
zle -N zle-keymap-select
|
||||
|
||||
# Start with beam shape cursor on zsh startup and after every command.
|
||||
zle-line-init() { zle-keymap-select 'beam'}
|
12
zsh/zshrc.symlink
Normal file
12
zsh/zshrc.symlink
Normal file
@ -0,0 +1,12 @@
|
||||
DOTFILE=`readlink ~/.zshrc`
|
||||
export DOTS=`dirname "$(dirname $DOTFILE)"`
|
||||
|
||||
source $DOTS/zsh/env
|
||||
source $DOTS/zsh/ohmyzsh
|
||||
source $DOTS/zsh/aliases
|
||||
source $DOTS/zsh/functions
|
||||
source $DOTS/zsh/vim
|
||||
|
||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||
|
||||
source ~/.iterm2_shell_integration.zsh
|
Loading…
Reference in New Issue
Block a user