Compare commits

..

15 commits

150 changed files with 956 additions and 726 deletions

2
.gitignore vendored
View file

@ -32,5 +32,3 @@ vim/backup/
zsh/cache/
Ansible/*.retry
Fortune/*.dat

16
Ansible/ansible.cfg Normal file
View file

@ -0,0 +1,16 @@
[defaults]
bin_ansible_callbacks = True
callbacks_enabled = ansible.posix.profile_tasks, ansible.posix.timer
remote_user = eryn
roles_path = roles
stdout_callback = community.general.yaml
[connection]
pipelining = true
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s
[vault]
username = ansible-infrastructure-vault
keyname = default

View file

@ -1,4 +0,0 @@
#!/usr/bin/env zsh
dotfiles_root=$(git rev-parse --show-toplevel)
echo "{ \"path\": \"${dotfiles_root}\" }"

View file

@ -1,5 +0,0 @@
{
"config_home": "~/.config",
"data_home": "~/.local/share",
"state_home": "~/.local/state"
}

View file

@ -1,9 +0,0 @@
#!/usr/bin/env zsh
if which xorg 1>/dev/null 2>&1; then
xorg_exists="true"
else
xorg_exists="false"
fi
echo "{ \"exists\": ${xorg_exists} }"

View file

@ -1,2 +0,0 @@
all:
localhost:

7
Ansible/local.yml Normal file
View file

@ -0,0 +1,7 @@
---
- name: Local
hosts: localhost
tasks:
- name: Set up dotfiles
ansible.builtin.include_role:
name: dotfiles

View file

@ -1,13 +0,0 @@
---
- name: Set up dotfiles
hosts: localhost
connection: local
module_defaults:
ansible.builtin.setup:
fact_path: "./facts"
vars:
eryn_dotfiles_ignore_symlink_errors: "{{ ansible_check_mode }}"
tasks:
- name: Include eryn role
ansible.builtin.include_role:
name: eryn

View file

@ -61,8 +61,6 @@
f = fetch
sup = submodule update --recursive
really-clean = clean -fd
rs = restore --stage
sc = switch --create
[ui]
color = true
[diff]

View file

@ -19,9 +19,9 @@ set timeout=300
set imap_keepalive=300
# Caching
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/bodies"
set certificate_file="~/.mutt/certificates"
set header_cache="~/.local/state/mutt/cache/headers"
set message_cachedir="~/.local/state/mutt/cache/bodies"
set certificate_file="~/.local/state/mutt/certificates"
set use_from=yes
set envelope_from=yes
@ -50,14 +50,14 @@ hdr_order Date: From: To: Cc: Subject:
# Aliases
set reverse_alias=yes
set alias_file="~/.mutt/aliases"
set alias_file="~/.config/mutt/aliases"
# Composing and Sending
set edit_headers=yes
set include=yes
# HTML email :(
set mailcap_path="~/.mutt/mailcap"
set mailcap_path="~/.config/mutt/mailcap"
auto_view text/html
alternative_order text/html text/plain text/enriched

View file

@ -1,7 +1,7 @@
local treesitter_configs = require 'nvim-treesitter.configs'
treesitter_configs.setup {
ensure_installed = { "lua", "vim" },
ensure_installed = { "lua", "vim", "javascript", "swift" },
sync_install = true,
auto_install = true,
hightlight = {

View file

@ -14,8 +14,20 @@ function gitTopLevelDirectory()
return gitRepoTopLevelDirectoryPath
end
-- Enable per-project (per-git repository) customization of (neo)vim by looking
-- for .vim and .nvim directories in the root of the git repository.
local function _addPathToRuntimePath(path, options)
if string.len(path) == 0 then
return
end
if vim.fn.isdirectory(path) == 1 then
if options.prepend then
vim.opt.runtimepath:prepend(path)
else
vim.opt.runtimepath:append(path)
end
end
end
function addGitTopLevelDirectoryToRuntimePath()
local gitTopLevelPath = gitTopLevelDirectory()
if gitTopLevelPath == nil or string.len(gitTopLevelPath) == 0 then
@ -41,13 +53,13 @@ function addGitTopLevelDirectoryToRuntimePath()
end
end
addGitTopLevelDirectoryToRuntimePath()
vim.cmd [[
source ~/.vimrc.common
source ~/.vim/plugins.vim
]]
addGitTopLevelDirectoryToRuntimePath()
require 'autocommands'
require 'colors'
require 'configuration'
@ -56,7 +68,9 @@ require 'treesitter'
require 'lsp'
local keys = require 'keys'
keys.init()
keys.init_key_opts()
keys.init_window_key_mappings()
keys.init_diagnostic_key_mappings()
local gui = require 'gui'
gui.init()

View file

@ -48,15 +48,4 @@ vim.api.nvim_create_autocmd("ColorScheme", {
group = colorscheme_group,
})
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "zaibatsu",
callback = function()
vim.cmd [[
hi! Pmenu ctermbg=8
hi! VertSplit ctermbg=8
]]
end,
group = colorscheme_group,
})
vim.cmd [[ color zaibatsu ]]

View file

@ -1,6 +1,6 @@
-- Eryn Wells <eryn@erynwells.me>
-- [[ Editor Configuration ]]
-- [[ Editor Confguration ]]
local opt = vim.opt
-- Reread files when they change outside of neovim
@ -16,7 +16,7 @@ opt.splitbelow = true
-- Show line numbers
opt.number = true
opt.relativenumber = false
opt.relativenumber = true
-- Start with ~all folds open.
opt.foldlevel = 99
@ -34,13 +34,8 @@ opt.errorbells = false
-- Wrap text rather than letting it run offscreen
opt.wrap = true
opt.linebreak = true
-- Wrap to 80 characters by default
opt.textwidth = 80
-- Mark columns 80, 90, and 120
opt.textwidth = 120
opt.colorcolumn = {80, 90, 120}
-- Briefly show the matching parenthesis or bracket when typing one of those
-- characters.
opt.showmatch = true
opt.formatoptions:append("n")
@ -64,14 +59,13 @@ opt.incsearch = true
opt.gdefault = true
-- Prefer spaces to tabs. Indent tab characters 8 spaces, and soft indent 4
-- spaces. Never write tabs if you can help it.
-- spaces. Never write tabs if you can help it, and do some nice things when
-- wrapping and joining and copying.
opt.tabstop = 8
opt.shiftwidth = 4
opt.softtabstop = 4
opt.shiftround = true
opt.expandtab = true
-- Do some nice things when wrapping, joining, and copying.
opt.joinspaces = false
opt.autoindent = true
opt.copyindent = true
@ -85,10 +79,9 @@ opt.background = "dark"
opt.backup = true
opt.undofile = true
local statedir = vim.fn.stdpath("state")
opt.backupdir = {statedir .. "/backup//"}
opt.directory = {statedir .. "/swap//", "."}
opt.undodir = {statedir .. "/undo//"}
opt.backupdir = {vim.fn.stdpath("state") .. "/backup//"}
opt.directory = {vim.fn.stdpath("state") .. "/swap//", "."}
opt.undodir = {vim.fn.stdpath("state") .. "/undo//"}
-- Fields to save in the Shada file. Parameters as follows: (see :help shada)
-- % number of buffers to save and restore when no file argument is given
@ -99,7 +92,7 @@ opt.undodir = {statedir .. "/undo//"}
-- : maximum number of lines of command history to save
-- s shada entries over 100 KiB are skipped
opt.shada = {"%100", "'1000", "h", "<1000", ":1000", "s100"}
opt.shadafile = statedir .. "/shada/default.shada"
opt.shadafile = vim.fn.stdpath("state") .. "/shada/default.shada"
-- Scroll ahead of the point a bit in each direction
opt.scrolloff = 3

View file

@ -5,18 +5,16 @@ local function _init_neovide()
return
end
-- No use for these animations.
vim.g.neovide_cursor_animation_length = 0
vim.g.neovide_position_animation_length = 0
vim.g.neovide_scroll_animation_length = 0
vim.g.neovide_input_macos_option_key_is_meta = "both"
vim.o.guifont = "InputMonoCondensed:h16"
vim.cmd [[ colorscheme lunaperche ]]
vim.cmd [[ colorscheme dracula ]]
end
function init_gui()
vim.o.guifont = "Berkeley Mono,Input Mono Condensed,SF Mono,Courier New:h18"
_init_neovide()
end

View file

@ -1,35 +1,11 @@
-- Eryn Wells <eryn@erynwells.me>
local map = vim.keymap.set
local function init_key_options()
local function init_key_opts()
vim.g.mapleader = ","
end
local function text_navigation_mappings()
local options = { noremap = true }
-- Navigate by soft-wrapped lines using Alt/Option/Meta + jk
map({'n', 'v'}, '<M-k>', 'gk', options)
map({'n', 'v'}, '<M-j>', 'gj', options)
end
local function clipboard_mappings()
if not vim.fn.has('gui_running') then
return
end
local options = { noremap = true }
-- Copy to the system clipboard
map('v', '<D-c>', '"+y', options)
-- Cut to the system clipboard
map('v', '<D-x>', '"+x', options)
-- Paste from the system clipboard
map({'i', 'v'}, '<D-v>', '"+p', options)
end
local function window_key_mappings()
local map = vim.keymap.set
local options = { silent = true }
-- Allow starting commands with ; instead of typing Shift-;. Save lots of keypresses!
@ -53,6 +29,7 @@ end
--
local function diagnostic_mappings()
local map = vim.keymap.set
local options = { noremap=true, silent=true }
-- Basic diagnostic mappings, these will navigate to or display diagnostics
@ -62,7 +39,8 @@ local function diagnostic_mappings()
map('n', '<leader>q', vim.diagnostic.setloclist, options)
end
local function local_lsp_mappings(buffer_number)
local function set_up_local_lsp_mappings(buffer_number)
local map = vim.keymap.set
local options = { noremap=true, silent=true, buffer=buffer_number }
map('n', 'ga', vim.lsp.buf.code_action, options)
@ -85,29 +63,9 @@ local function local_lsp_mappings(buffer_number)
end, options)
end
local function telescope_mappings()
local builtin = require('telescope.builtin')
map('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
map('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
map('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
map('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
if vim.fn.has('gui_running') then
map('n', 'D-O', builtin.buffers, { desc = 'Open existing' })
end
end
local function init_all_global_keybindings()
init_key_options()
clipboard_mappings()
window_key_mappings()
text_navigation_mappings()
diagnostic_mappings()
telescope_mappings()
end
return {
init = init_all_global_keybindings,
init_lsp_key_mappings = local_lsp_mappings,
init_key_opts = init_key_opts,
init_window_key_mappings = window_key_mappings,
init_diagnostic_key_mappings = diagnostic_mappings,
init_lsp_key_mappings = set_up_local_lsp_mappings,
}

View file

@ -76,11 +76,6 @@ lspconfig.eslint.setup {
capabilities = cmp_capabilities,
}
lspconfig.ts_ls.setup {
on_attach = on_attach,
capabilities = cmp_capabilities,
}
lspconfig.html.setup {
on_attach = on_attach,
capabilities = cmp_capabilities,
@ -120,8 +115,7 @@ lspconfig.rust_analyzer.setup {
enable = true,
},
},
checkOnSave = true,
check = {
checkOnSave = {
command = 'clippy',
extraArgs = {
"--",

View file

@ -31,7 +31,7 @@ set -g update-environment "SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
set -g status-style bg=black
set -g status-left " #S "
set -g status-left-style bg=green,fg=black
set -g status-right "#[bg=red,fg=white] #h #[bg=blue,fg=white] %Y-%m-%d %R #[default]"
set -g status-right "#[bg=red,fg=white] #h #[bg=blue,fg=white] %a %b %e, %R #[default]"
# Start window and pane indexing from 1 instead of 0
set -g base-index 1

View file

@ -6,7 +6,7 @@ source ~/.vimrc.common
if !has('nvim')
set nocompatible " use enhanced vim features
let s:localdir=expand("~/.local/state/vim")
let s:localdir=expand("~/.local/vim")
if !isdirectory(s:localdir)
call mkdir(s:localdir, "p")
endif

View file

@ -0,0 +1,17 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
autoload binary_exists
function init_app_environments
{
# NetHack options
# use color in the terminal
binary_exists nethack && export NETHACKOPTIONS="color"
# Default ledger file
local ledgerFile="$HOME/Documents/Ledger/personal.ledger"
[[ -e "$ledgerFile" ]] && LEDGER_FILE="$ledgerFile"
}
init_app_environments "$@"

View file

@ -0,0 +1,30 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
local system_ls=`which ls`
local has_gnu_ls
local ls_options
if $system_ls --version 2>&1 | grep GNU 1>/dev/null; then
has_gnu_ls=1
ls_options='--color=auto'
else
has_gnu_ls=0
ls_options='-G'
fi
alias ls="$system_ls $ls_options"
alias la="$system_ls -A $ls_options"
alias ll="$system_ls -l $ls_options"
alias l.="$system_ls -d $ls_options .*"
local dircolors_bin=`whence -p dircolors || whence -p gdircolors`
if [[ $has_gnu_ls -eq 1 && -n "$dircolors_bin" ]]; then
if [[ -e "$HOME/.dircolors/$SYS.cfg" ]]; then
dircolors="$HOME/.dircolors/$SYS.cfg"
else
dircolors="$HOME/.dircolors/default.cfg"
fi
eval `$dircolors_bin $dircolors`
fi

View file

@ -3,7 +3,7 @@
autoload binary_exists
function init-rc-aliases
function init_rc_aliases
{
alias j='jobs'
alias h='history'
@ -34,4 +34,4 @@ function init-rc-aliases
alias -s jar='java -jar'
}
init-rc-aliases "$@"
init_rc_aliases "$@"

View file

@ -0,0 +1,41 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
autoload -Uz compinit
compinit
# Cache completions
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path ~/.zsh/cache
# Make ls show completion list in color.
# See also: https://github.com/ohmyzsh/ohmyzsh/issues/6060
if [[ -n "$LS_COLORS" ]]; then
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
else
zstyle ':completion:*:default' list-colors \
'di=34' 'ln=35' 'so=32' 'pi=33' 'ex=31' 'bd=34;46' 'cd=34;43' 'su=30;41' \
'sg=30;46' 'tw=30;42' 'ow=30;43'
fi
# For rm, cp, and mv don't complete if file is on the line already
zstyle ':completion:*:rm:*' ignore-line yes
zstyle ':completion:*:cp:*' ignore-line yes
zstyle ':completion:*:mv:*' ignore-line yes
# Remove trailing slashes in directory arguments
zstyle ':completion:*' squeeze-slashes true
# Never select parent directory
zstyle ':completion:*:cd:*' ignore-parents parent pwd
# Expand partial paths
zstyle ':completion:*' expand 'yes'
# Show a pretty menu of killable processes
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:*:kill:*' menu yes select
# Complete man pages by section
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.*' insert-sections true

View file

@ -0,0 +1,24 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
local theme=loquacious
autoload -U add-zsh-hook
autoload -Uz vcs_info
zstyle ':vcs_info:*' disable p4 bzr cdv darcs mtn svk tla cvs svn
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git:general:*' formats '%b'
zstyle ':vcs_info:git-svn:general:*' formats '%b'
# Export the current Git branch before every prompt.
function export_gitbranch {
vcs_info general
export gitbranch=${vcs_info_msg_0_}
}
add-zsh-hook precmd export_gitbranch
autoload -U promptinit
promptinit
prompt $theme

View file

@ -0,0 +1,20 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
local mode=emacs
if [[ -z "$mode" ]]; then
mode=emacs
fi
function configure_zle_emacs { }
function configure_zle_vim { }
if [[ $mode == 'vim' ]]; then
bindkey -v
configure_zle_vim
zle -A .backward-delete-char vi-backward-delete-char
elif [[ $mode == 'emacs' ]]; then
bindkey -e
configure_zle_emacs
fi

View file

@ -1,11 +1,11 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function init-rc-linux
function init_rc_linux
{
alias iptls='sudo iptables --line-numbers -nv -L'
alias ip6tls='sudo ip6tables --line-numbers -nv -L'
alias rlx="xrdb $HOME/.Xdefaults"
}
init-rc-linux "$@"
init_rc_linux "$@"

View file

@ -0,0 +1,12 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
for x in "$HOME/Code" "$HOME/Documents/Code"; do
if [[ ! -d "$x" ]]; then
continue
fi
export c="$x"
break
done
export dd="$HOME/Library/Developer/Xcode/DerivedData"

View file

@ -0,0 +1,9 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function init_site_environments
{
export ERYNWELLS_ME_SITE="$HOME/Developer/erynwells.me"
}
init_site_environments "$@"

View file

@ -0,0 +1,9 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function init_website_environments
{
export ERYNWELLS_ME_SITE="$HOME/Developer/erynwells.me"
}
init_website_environments "$@"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function init-rc-zsh-history
function init_zsh_history
{
setopt \
APPEND_HISTORY \
@ -18,4 +18,4 @@ function init-rc-zsh-history
HISTFILE="$HOME/.zhistory"
}
init-rc-zsh-history "$@"
init_zsh_history "$@"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function init-rc-zsh-options
function init_zsh_options
{
# Report seconds since shell was invoked in milliseconds
typeset -F SECONDS
@ -13,4 +13,4 @@ function init-rc-zsh-options
COMPLETE_IN_WORD
}
init-rc-zsh-options "$@"
init_zsh_options "$@"

View file

@ -20,8 +20,7 @@ Arguments
---------
%B-e%b | %B--export%b | %B--no-export%b
Export the variable after modification. The default is to export if the
variable is modified.
Export the variable after modification.
%B-f%b | %B--force%b
Unconditionally add the path, even if it doesn't exist.

View file

@ -0,0 +1,15 @@
#!/usr/bin/env zsh
autoload init_website_environment
function weeknotes
{
init_website_environment
YEAR=`date '+%Y'`
WEEK_NUMBER=`date '+%V'`
PAGE_PATH=blog/${YEAR}/weeknotes-${YEAR}w${WEEK_NUMBER}.md
UPCOMING_SUNDAY=`${ERYNWELLS_ME_SITE}/scripts/next_sunday.py`
}
weeknotes "$@"

View file

@ -10,6 +10,8 @@ function init-env-darwin
export XCODE_INSTALLS="$XCODE_LIBRARY/Installs"
export dd="$XCODE_DERIVED_DATA"
fi
export df=~/.dotfiles
}
init-env-darwin "$@"

View file

@ -6,10 +6,8 @@ function init-env-path
{
path=()
update-path \
"$HOME/Website/scripts" \
"$HOME/bin" \
"$HOME/.local/bin" \
"$HOME/.local/lib/node_modules/bin" \
"$HOME/.cargo/bin" \
"$HOME/.ghcup/bin" \
"$HOME/.gem/ruby/2.2.0/bin" \

View file

@ -1,7 +1,6 @@
# Eryn Wells <eryn@erynwells.me>
autoload -Uz prepend_to_path
autoload -Uz update-path
function init-env-python
{
@ -11,9 +10,6 @@ function init-env-python
prepend_to_path "$f/bin"
done
fi
export PYTHON_VIRTUAL_ENVS="$HOME/.local/share/python-virtual-environments"
update-path --prepend "$PYTHON_VIRTUAL_ENVS/eryn/bin"
}
init-env-python "$@"

View file

@ -15,8 +15,6 @@ function init-env-tilde-paths
c="$candidate_code_path"
break
done
export df=~/.dotfiles
}
init-env-tilde-paths "$@"

View file

@ -9,7 +9,9 @@ function init-env-fpath
{
local -r fpath_candidates=( \
"$HOME/.zsh/${SYS}-functions" \
"$HOME/.zsh/func" \
"$HOME/.zsh/init-env-functions" \
"$HOME/.zsh/init-rc-functions" \
"$HOME/.zsh/functions" \
)
# Process the array in reverse order (`Oa` means "descending index order",

View file

@ -2,14 +2,15 @@
zsh_init_rc_functions=( \
init_rc_fpath_darwin \
init-rc-aliases \
init-rc-ls \
init-rc-prompt \
init-rc-zle \
init-rc-completion \
init-rc-zsh-options \
init-rc-zsh-history \
init-rc-app-environments \
init_rc_aliases \
init_configure_ls \
init_rc_tilde_paths \
init_rc_configure_prompt \
init_rc_configure_zle \
init_rc_configure_completion \
init_zsh_options \
init_zsh_history \
init_app_environments \
init-rc-$SYS \
)
@ -21,7 +22,6 @@ fi
do_init_functions zsh_init_rc_functions
autoload -Uz bool
autoload -Uz g
autoload -Uz nethack
autoload -Uz pw

View file

@ -0,0 +1,4 @@
---
- name: Rediscover package manager
ansible.builtin.setup:
gather_subset: pkg_mgr

Some files were not shown because too many files have changed in this diff Show more