Compare commits
15 commits
main
...
ansible-al
| Author | SHA1 | Date | |
|---|---|---|---|
| d6bb7ae726 | |||
| 3b509c45d1 | |||
| 2c23fad3e8 | |||
| 6c6c7937c6 | |||
| 398c6f2d18 | |||
| 01312752fc | |||
| bc4b9f8089 | |||
| f7a29e3c1d | |||
| 65182a7c52 | |||
| 29e0b21a99 | |||
| b454868ca8 | |||
| 916086b743 | |||
| c664ca3b9d | |||
| ae514e9a07 | |||
| 74196601f6 |
150 changed files with 956 additions and 726 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -32,5 +32,3 @@ vim/backup/
|
||||||
zsh/cache/
|
zsh/cache/
|
||||||
|
|
||||||
Ansible/*.retry
|
Ansible/*.retry
|
||||||
|
|
||||||
Fortune/*.dat
|
|
||||||
|
|
|
||||||
16
Ansible/ansible.cfg
Normal file
16
Ansible/ansible.cfg
Normal 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
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
#!/usr/bin/env zsh
|
|
||||||
|
|
||||||
dotfiles_root=$(git rev-parse --show-toplevel)
|
|
||||||
echo "{ \"path\": \"${dotfiles_root}\" }"
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"config_home": "~/.config",
|
|
||||||
"data_home": "~/.local/share",
|
|
||||||
"state_home": "~/.local/state"
|
|
||||||
}
|
|
||||||
|
|
@ -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} }"
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
all:
|
|
||||||
localhost:
|
|
||||||
7
Ansible/local.yml
Normal file
7
Ansible/local.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
- name: Local
|
||||||
|
hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- name: Set up dotfiles
|
||||||
|
ansible.builtin.include_role:
|
||||||
|
name: dotfiles
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -61,8 +61,6 @@
|
||||||
f = fetch
|
f = fetch
|
||||||
sup = submodule update --recursive
|
sup = submodule update --recursive
|
||||||
really-clean = clean -fd
|
really-clean = clean -fd
|
||||||
rs = restore --stage
|
|
||||||
sc = switch --create
|
|
||||||
[ui]
|
[ui]
|
||||||
color = true
|
color = true
|
||||||
[diff]
|
[diff]
|
||||||
|
|
@ -19,9 +19,9 @@ set timeout=300
|
||||||
set imap_keepalive=300
|
set imap_keepalive=300
|
||||||
|
|
||||||
# Caching
|
# Caching
|
||||||
set header_cache="~/.mutt/cache/headers"
|
set header_cache="~/.local/state/mutt/cache/headers"
|
||||||
set message_cachedir="~/.mutt/cache/bodies"
|
set message_cachedir="~/.local/state/mutt/cache/bodies"
|
||||||
set certificate_file="~/.mutt/certificates"
|
set certificate_file="~/.local/state/mutt/certificates"
|
||||||
|
|
||||||
set use_from=yes
|
set use_from=yes
|
||||||
set envelope_from=yes
|
set envelope_from=yes
|
||||||
|
|
@ -50,14 +50,14 @@ hdr_order Date: From: To: Cc: Subject:
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
set reverse_alias=yes
|
set reverse_alias=yes
|
||||||
set alias_file="~/.mutt/aliases"
|
set alias_file="~/.config/mutt/aliases"
|
||||||
|
|
||||||
# Composing and Sending
|
# Composing and Sending
|
||||||
set edit_headers=yes
|
set edit_headers=yes
|
||||||
set include=yes
|
set include=yes
|
||||||
|
|
||||||
# HTML email :(
|
# HTML email :(
|
||||||
set mailcap_path="~/.mutt/mailcap"
|
set mailcap_path="~/.config/mutt/mailcap"
|
||||||
auto_view text/html
|
auto_view text/html
|
||||||
alternative_order text/html text/plain text/enriched
|
alternative_order text/html text/plain text/enriched
|
||||||
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
local treesitter_configs = require 'nvim-treesitter.configs'
|
local treesitter_configs = require 'nvim-treesitter.configs'
|
||||||
|
|
||||||
treesitter_configs.setup {
|
treesitter_configs.setup {
|
||||||
ensure_installed = { "lua", "vim" },
|
ensure_installed = { "lua", "vim", "javascript", "swift" },
|
||||||
sync_install = true,
|
sync_install = true,
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
hightlight = {
|
hightlight = {
|
||||||
|
|
@ -14,8 +14,20 @@ function gitTopLevelDirectory()
|
||||||
return gitRepoTopLevelDirectoryPath
|
return gitRepoTopLevelDirectoryPath
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Enable per-project (per-git repository) customization of (neo)vim by looking
|
local function _addPathToRuntimePath(path, options)
|
||||||
-- for .vim and .nvim directories in the root of the git repository.
|
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()
|
function addGitTopLevelDirectoryToRuntimePath()
|
||||||
local gitTopLevelPath = gitTopLevelDirectory()
|
local gitTopLevelPath = gitTopLevelDirectory()
|
||||||
if gitTopLevelPath == nil or string.len(gitTopLevelPath) == 0 then
|
if gitTopLevelPath == nil or string.len(gitTopLevelPath) == 0 then
|
||||||
|
|
@ -41,13 +53,13 @@ function addGitTopLevelDirectoryToRuntimePath()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
addGitTopLevelDirectoryToRuntimePath()
|
||||||
|
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
source ~/.vimrc.common
|
source ~/.vimrc.common
|
||||||
source ~/.vim/plugins.vim
|
source ~/.vim/plugins.vim
|
||||||
]]
|
]]
|
||||||
|
|
||||||
addGitTopLevelDirectoryToRuntimePath()
|
|
||||||
|
|
||||||
require 'autocommands'
|
require 'autocommands'
|
||||||
require 'colors'
|
require 'colors'
|
||||||
require 'configuration'
|
require 'configuration'
|
||||||
|
|
@ -56,7 +68,9 @@ require 'treesitter'
|
||||||
require 'lsp'
|
require 'lsp'
|
||||||
|
|
||||||
local keys = require 'keys'
|
local keys = require 'keys'
|
||||||
keys.init()
|
keys.init_key_opts()
|
||||||
|
keys.init_window_key_mappings()
|
||||||
|
keys.init_diagnostic_key_mappings()
|
||||||
|
|
||||||
local gui = require 'gui'
|
local gui = require 'gui'
|
||||||
gui.init()
|
gui.init()
|
||||||
|
|
@ -48,15 +48,4 @@ vim.api.nvim_create_autocmd("ColorScheme", {
|
||||||
group = colorscheme_group,
|
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 ]]
|
vim.cmd [[ color zaibatsu ]]
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
-- Eryn Wells <eryn@erynwells.me>
|
-- Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
-- [[ Editor Configuration ]]
|
-- [[ Editor Confguration ]]
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|
||||||
-- Reread files when they change outside of neovim
|
-- Reread files when they change outside of neovim
|
||||||
|
|
@ -16,7 +16,7 @@ opt.splitbelow = true
|
||||||
|
|
||||||
-- Show line numbers
|
-- Show line numbers
|
||||||
opt.number = true
|
opt.number = true
|
||||||
opt.relativenumber = false
|
opt.relativenumber = true
|
||||||
|
|
||||||
-- Start with ~all folds open.
|
-- Start with ~all folds open.
|
||||||
opt.foldlevel = 99
|
opt.foldlevel = 99
|
||||||
|
|
@ -34,13 +34,8 @@ opt.errorbells = false
|
||||||
-- Wrap text rather than letting it run offscreen
|
-- Wrap text rather than letting it run offscreen
|
||||||
opt.wrap = true
|
opt.wrap = true
|
||||||
opt.linebreak = true
|
opt.linebreak = true
|
||||||
-- Wrap to 80 characters by default
|
opt.textwidth = 120
|
||||||
opt.textwidth = 80
|
|
||||||
-- Mark columns 80, 90, and 120
|
|
||||||
opt.colorcolumn = {80, 90, 120}
|
opt.colorcolumn = {80, 90, 120}
|
||||||
|
|
||||||
-- Briefly show the matching parenthesis or bracket when typing one of those
|
|
||||||
-- characters.
|
|
||||||
opt.showmatch = true
|
opt.showmatch = true
|
||||||
|
|
||||||
opt.formatoptions:append("n")
|
opt.formatoptions:append("n")
|
||||||
|
|
@ -64,14 +59,13 @@ opt.incsearch = true
|
||||||
opt.gdefault = true
|
opt.gdefault = true
|
||||||
|
|
||||||
-- Prefer spaces to tabs. Indent tab characters 8 spaces, and soft indent 4
|
-- 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.tabstop = 8
|
||||||
opt.shiftwidth = 4
|
opt.shiftwidth = 4
|
||||||
opt.softtabstop = 4
|
opt.softtabstop = 4
|
||||||
opt.shiftround = true
|
opt.shiftround = true
|
||||||
opt.expandtab = true
|
opt.expandtab = true
|
||||||
|
|
||||||
-- Do some nice things when wrapping, joining, and copying.
|
|
||||||
opt.joinspaces = false
|
opt.joinspaces = false
|
||||||
opt.autoindent = true
|
opt.autoindent = true
|
||||||
opt.copyindent = true
|
opt.copyindent = true
|
||||||
|
|
@ -85,10 +79,9 @@ opt.background = "dark"
|
||||||
opt.backup = true
|
opt.backup = true
|
||||||
opt.undofile = true
|
opt.undofile = true
|
||||||
|
|
||||||
local statedir = vim.fn.stdpath("state")
|
opt.backupdir = {vim.fn.stdpath("state") .. "/backup//"}
|
||||||
opt.backupdir = {statedir .. "/backup//"}
|
opt.directory = {vim.fn.stdpath("state") .. "/swap//", "."}
|
||||||
opt.directory = {statedir .. "/swap//", "."}
|
opt.undodir = {vim.fn.stdpath("state") .. "/undo//"}
|
||||||
opt.undodir = {statedir .. "/undo//"}
|
|
||||||
|
|
||||||
-- Fields to save in the Shada file. Parameters as follows: (see :help shada)
|
-- 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
|
-- % 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
|
-- : maximum number of lines of command history to save
|
||||||
-- s shada entries over 100 KiB are skipped
|
-- s shada entries over 100 KiB are skipped
|
||||||
opt.shada = {"%100", "'1000", "h", "<1000", ":1000", "s100"}
|
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
|
-- Scroll ahead of the point a bit in each direction
|
||||||
opt.scrolloff = 3
|
opt.scrolloff = 3
|
||||||
|
|
@ -5,18 +5,16 @@ local function _init_neovide()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- No use for these animations.
|
|
||||||
vim.g.neovide_cursor_animation_length = 0
|
vim.g.neovide_cursor_animation_length = 0
|
||||||
vim.g.neovide_position_animation_length = 0
|
vim.g.neovide_position_animation_length = 0
|
||||||
vim.g.neovide_scroll_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
|
end
|
||||||
|
|
||||||
function init_gui()
|
function init_gui()
|
||||||
vim.o.guifont = "Berkeley Mono,Input Mono Condensed,SF Mono,Courier New:h18"
|
|
||||||
_init_neovide()
|
_init_neovide()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -1,35 +1,11 @@
|
||||||
-- Eryn Wells <eryn@erynwells.me>
|
-- Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
local map = vim.keymap.set
|
local function init_key_opts()
|
||||||
|
|
||||||
local function init_key_options()
|
|
||||||
vim.g.mapleader = ","
|
vim.g.mapleader = ","
|
||||||
end
|
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 function window_key_mappings()
|
||||||
|
local map = vim.keymap.set
|
||||||
local options = { silent = true }
|
local options = { silent = true }
|
||||||
|
|
||||||
-- Allow starting commands with ; instead of typing Shift-;. Save lots of keypresses!
|
-- Allow starting commands with ; instead of typing Shift-;. Save lots of keypresses!
|
||||||
|
|
@ -53,6 +29,7 @@ end
|
||||||
--
|
--
|
||||||
|
|
||||||
local function diagnostic_mappings()
|
local function diagnostic_mappings()
|
||||||
|
local map = vim.keymap.set
|
||||||
local options = { noremap=true, silent=true }
|
local options = { noremap=true, silent=true }
|
||||||
|
|
||||||
-- Basic diagnostic mappings, these will navigate to or display diagnostics
|
-- 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)
|
map('n', '<leader>q', vim.diagnostic.setloclist, options)
|
||||||
end
|
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 }
|
local options = { noremap=true, silent=true, buffer=buffer_number }
|
||||||
|
|
||||||
map('n', 'ga', vim.lsp.buf.code_action, options)
|
map('n', 'ga', vim.lsp.buf.code_action, options)
|
||||||
|
|
@ -85,29 +63,9 @@ local function local_lsp_mappings(buffer_number)
|
||||||
end, options)
|
end, options)
|
||||||
end
|
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 {
|
return {
|
||||||
init = init_all_global_keybindings,
|
init_key_opts = init_key_opts,
|
||||||
init_lsp_key_mappings = local_lsp_mappings,
|
init_window_key_mappings = window_key_mappings,
|
||||||
|
init_diagnostic_key_mappings = diagnostic_mappings,
|
||||||
|
init_lsp_key_mappings = set_up_local_lsp_mappings,
|
||||||
}
|
}
|
||||||
|
|
@ -76,11 +76,6 @@ lspconfig.eslint.setup {
|
||||||
capabilities = cmp_capabilities,
|
capabilities = cmp_capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
lspconfig.ts_ls.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = cmp_capabilities,
|
|
||||||
}
|
|
||||||
|
|
||||||
lspconfig.html.setup {
|
lspconfig.html.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = cmp_capabilities,
|
capabilities = cmp_capabilities,
|
||||||
|
|
@ -120,8 +115,7 @@ lspconfig.rust_analyzer.setup {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
checkOnSave = true,
|
checkOnSave = {
|
||||||
check = {
|
|
||||||
command = 'clippy',
|
command = 'clippy',
|
||||||
extraArgs = {
|
extraArgs = {
|
||||||
"--",
|
"--",
|
||||||
|
|
@ -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-style bg=black
|
||||||
set -g status-left " #S "
|
set -g status-left " #S "
|
||||||
set -g status-left-style bg=green,fg=black
|
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
|
# Start window and pane indexing from 1 instead of 0
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
|
|
@ -6,7 +6,7 @@ source ~/.vimrc.common
|
||||||
if !has('nvim')
|
if !has('nvim')
|
||||||
set nocompatible " use enhanced vim features
|
set nocompatible " use enhanced vim features
|
||||||
|
|
||||||
let s:localdir=expand("~/.local/state/vim")
|
let s:localdir=expand("~/.local/vim")
|
||||||
if !isdirectory(s:localdir)
|
if !isdirectory(s:localdir)
|
||||||
call mkdir(s:localdir, "p")
|
call mkdir(s:localdir, "p")
|
||||||
endif
|
endif
|
||||||
|
|
@ -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 "$@"
|
||||||
30
Ansible/roles/dotfiles/files/zsh/functions/init_configure_ls
Normal file
30
Ansible/roles/dotfiles/files/zsh/functions/init_configure_ls
Normal 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
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
autoload binary_exists
|
autoload binary_exists
|
||||||
|
|
||||||
function init-rc-aliases
|
function init_rc_aliases
|
||||||
{
|
{
|
||||||
alias j='jobs'
|
alias j='jobs'
|
||||||
alias h='history'
|
alias h='history'
|
||||||
|
|
@ -34,4 +34,4 @@ function init-rc-aliases
|
||||||
alias -s jar='java -jar'
|
alias -s jar='java -jar'
|
||||||
}
|
}
|
||||||
|
|
||||||
init-rc-aliases "$@"
|
init_rc_aliases "$@"
|
||||||
|
|
@ -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
|
||||||
|
|
@ -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
|
||||||
|
|
@ -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
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
# Eryn Wells <eryn@erynwells.me>
|
# Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
function init-rc-linux
|
function init_rc_linux
|
||||||
{
|
{
|
||||||
alias iptls='sudo iptables --line-numbers -nv -L'
|
alias iptls='sudo iptables --line-numbers -nv -L'
|
||||||
alias ip6tls='sudo ip6tables --line-numbers -nv -L'
|
alias ip6tls='sudo ip6tables --line-numbers -nv -L'
|
||||||
alias rlx="xrdb $HOME/.Xdefaults"
|
alias rlx="xrdb $HOME/.Xdefaults"
|
||||||
}
|
}
|
||||||
|
|
||||||
init-rc-linux "$@"
|
init_rc_linux "$@"
|
||||||
|
|
@ -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"
|
||||||
|
|
@ -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 "$@"
|
||||||
|
|
@ -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 "$@"
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
# Eryn Wells <eryn@erynwells.me>
|
# Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
function init-rc-zsh-history
|
function init_zsh_history
|
||||||
{
|
{
|
||||||
setopt \
|
setopt \
|
||||||
APPEND_HISTORY \
|
APPEND_HISTORY \
|
||||||
|
|
@ -18,4 +18,4 @@ function init-rc-zsh-history
|
||||||
HISTFILE="$HOME/.zhistory"
|
HISTFILE="$HOME/.zhistory"
|
||||||
}
|
}
|
||||||
|
|
||||||
init-rc-zsh-history "$@"
|
init_zsh_history "$@"
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
# Eryn Wells <eryn@erynwells.me>
|
# Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
function init-rc-zsh-options
|
function init_zsh_options
|
||||||
{
|
{
|
||||||
# Report seconds since shell was invoked in milliseconds
|
# Report seconds since shell was invoked in milliseconds
|
||||||
typeset -F SECONDS
|
typeset -F SECONDS
|
||||||
|
|
@ -13,4 +13,4 @@ function init-rc-zsh-options
|
||||||
COMPLETE_IN_WORD
|
COMPLETE_IN_WORD
|
||||||
}
|
}
|
||||||
|
|
||||||
init-rc-zsh-options "$@"
|
init_zsh_options "$@"
|
||||||
|
|
@ -20,8 +20,7 @@ Arguments
|
||||||
---------
|
---------
|
||||||
|
|
||||||
%B-e%b | %B--export%b | %B--no-export%b
|
%B-e%b | %B--export%b | %B--no-export%b
|
||||||
Export the variable after modification. The default is to export if the
|
Export the variable after modification.
|
||||||
variable is modified.
|
|
||||||
|
|
||||||
%B-f%b | %B--force%b
|
%B-f%b | %B--force%b
|
||||||
Unconditionally add the path, even if it doesn't exist.
|
Unconditionally add the path, even if it doesn't exist.
|
||||||
15
Ansible/roles/dotfiles/files/zsh/functions/weeknotes
Normal file
15
Ansible/roles/dotfiles/files/zsh/functions/weeknotes
Normal 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 "$@"
|
||||||
|
|
@ -10,6 +10,8 @@ function init-env-darwin
|
||||||
export XCODE_INSTALLS="$XCODE_LIBRARY/Installs"
|
export XCODE_INSTALLS="$XCODE_LIBRARY/Installs"
|
||||||
export dd="$XCODE_DERIVED_DATA"
|
export dd="$XCODE_DERIVED_DATA"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export df=~/.dotfiles
|
||||||
}
|
}
|
||||||
|
|
||||||
init-env-darwin "$@"
|
init-env-darwin "$@"
|
||||||
|
|
@ -6,10 +6,8 @@ function init-env-path
|
||||||
{
|
{
|
||||||
path=()
|
path=()
|
||||||
update-path \
|
update-path \
|
||||||
"$HOME/Website/scripts" \
|
|
||||||
"$HOME/bin" \
|
"$HOME/bin" \
|
||||||
"$HOME/.local/bin" \
|
"$HOME/.local/bin" \
|
||||||
"$HOME/.local/lib/node_modules/bin" \
|
|
||||||
"$HOME/.cargo/bin" \
|
"$HOME/.cargo/bin" \
|
||||||
"$HOME/.ghcup/bin" \
|
"$HOME/.ghcup/bin" \
|
||||||
"$HOME/.gem/ruby/2.2.0/bin" \
|
"$HOME/.gem/ruby/2.2.0/bin" \
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
# Eryn Wells <eryn@erynwells.me>
|
# Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
autoload -Uz prepend_to_path
|
autoload -Uz prepend_to_path
|
||||||
autoload -Uz update-path
|
|
||||||
|
|
||||||
function init-env-python
|
function init-env-python
|
||||||
{
|
{
|
||||||
|
|
@ -11,9 +10,6 @@ function init-env-python
|
||||||
prepend_to_path "$f/bin"
|
prepend_to_path "$f/bin"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export PYTHON_VIRTUAL_ENVS="$HOME/.local/share/python-virtual-environments"
|
|
||||||
update-path --prepend "$PYTHON_VIRTUAL_ENVS/eryn/bin"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init-env-python "$@"
|
init-env-python "$@"
|
||||||
|
|
@ -15,8 +15,6 @@ function init-env-tilde-paths
|
||||||
c="$candidate_code_path"
|
c="$candidate_code_path"
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
|
|
||||||
export df=~/.dotfiles
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init-env-tilde-paths "$@"
|
init-env-tilde-paths "$@"
|
||||||
|
|
@ -9,7 +9,9 @@ function init-env-fpath
|
||||||
{
|
{
|
||||||
local -r fpath_candidates=( \
|
local -r fpath_candidates=( \
|
||||||
"$HOME/.zsh/${SYS}-functions" \
|
"$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",
|
# Process the array in reverse order (`Oa` means "descending index order",
|
||||||
|
|
@ -2,14 +2,15 @@
|
||||||
|
|
||||||
zsh_init_rc_functions=( \
|
zsh_init_rc_functions=( \
|
||||||
init_rc_fpath_darwin \
|
init_rc_fpath_darwin \
|
||||||
init-rc-aliases \
|
init_rc_aliases \
|
||||||
init-rc-ls \
|
init_configure_ls \
|
||||||
init-rc-prompt \
|
init_rc_tilde_paths \
|
||||||
init-rc-zle \
|
init_rc_configure_prompt \
|
||||||
init-rc-completion \
|
init_rc_configure_zle \
|
||||||
init-rc-zsh-options \
|
init_rc_configure_completion \
|
||||||
init-rc-zsh-history \
|
init_zsh_options \
|
||||||
init-rc-app-environments \
|
init_zsh_history \
|
||||||
|
init_app_environments \
|
||||||
init-rc-$SYS \
|
init-rc-$SYS \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -21,7 +22,6 @@ fi
|
||||||
|
|
||||||
do_init_functions zsh_init_rc_functions
|
do_init_functions zsh_init_rc_functions
|
||||||
|
|
||||||
autoload -Uz bool
|
|
||||||
autoload -Uz g
|
autoload -Uz g
|
||||||
autoload -Uz nethack
|
autoload -Uz nethack
|
||||||
autoload -Uz pw
|
autoload -Uz pw
|
||||||
4
Ansible/roles/dotfiles/handlers/main.yml
Normal file
4
Ansible/roles/dotfiles/handlers/main.yml
Normal 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
Loading…
Add table
Add a link
Reference in a new issue