diff --git a/.gitignore b/.gitignore index 44c1071..848e7f5 100644 --- a/.gitignore +++ b/.gitignore @@ -32,5 +32,3 @@ vim/backup/ zsh/cache/ Ansible/*.retry - -Fortune/*.dat diff --git a/Ansible/ansible.cfg b/Ansible/ansible.cfg new file mode 100644 index 0000000..1f7181c --- /dev/null +++ b/Ansible/ansible.cfg @@ -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 diff --git a/Ansible/facts/dotfiles.fact b/Ansible/facts/dotfiles.fact deleted file mode 100755 index 78714dc..0000000 --- a/Ansible/facts/dotfiles.fact +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env zsh - -dotfiles_root=$(git rev-parse --show-toplevel) -echo "{ \"path\": \"${dotfiles_root}\" }" diff --git a/Ansible/facts/xdg.fact b/Ansible/facts/xdg.fact deleted file mode 100644 index d3ec8dd..0000000 --- a/Ansible/facts/xdg.fact +++ /dev/null @@ -1,5 +0,0 @@ -{ - "config_home": "~/.config", - "data_home": "~/.local/share", - "state_home": "~/.local/state" -} diff --git a/Ansible/facts/xorg.fact b/Ansible/facts/xorg.fact deleted file mode 100755 index c450d24..0000000 --- a/Ansible/facts/xorg.fact +++ /dev/null @@ -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} }" diff --git a/Ansible/inventory.yml b/Ansible/inventory.yml deleted file mode 100644 index d9c3146..0000000 --- a/Ansible/inventory.yml +++ /dev/null @@ -1,2 +0,0 @@ -all: - localhost: diff --git a/Ansible/local.yml b/Ansible/local.yml new file mode 100644 index 0000000..f18a2d6 --- /dev/null +++ b/Ansible/local.yml @@ -0,0 +1,7 @@ +--- +- name: Local + hosts: localhost + tasks: + - name: Set up dotfiles + ansible.builtin.include_role: + name: dotfiles diff --git a/Ansible/play-setup.yml b/Ansible/play-setup.yml deleted file mode 100644 index dabc7e0..0000000 --- a/Ansible/play-setup.yml +++ /dev/null @@ -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 diff --git a/emacs/init.el b/Ansible/roles/dotfiles/files/emacs/emacs similarity index 100% rename from emacs/init.el rename to Ansible/roles/dotfiles/files/emacs/emacs diff --git a/git/config b/Ansible/roles/dotfiles/files/git/gitconfig similarity index 97% rename from git/config rename to Ansible/roles/dotfiles/files/git/gitconfig index 0c878ca..d77e7a3 100644 --- a/git/config +++ b/Ansible/roles/dotfiles/files/git/gitconfig @@ -4,6 +4,7 @@ [core] editor = nvim quotepath = false + excludesfile = ~/.gitignore [color] ui = auto [alias] @@ -60,8 +61,6 @@ f = fetch sup = submodule update --recursive really-clean = clean -fd - rs = restore --stage - sc = switch --create [ui] color = true [diff] diff --git a/git/ignore b/Ansible/roles/dotfiles/files/git/gitignore similarity index 100% rename from git/ignore rename to Ansible/roles/dotfiles/files/git/gitignore diff --git a/mutt/mailcap b/Ansible/roles/dotfiles/files/mutt/mailcap similarity index 100% rename from mutt/mailcap rename to Ansible/roles/dotfiles/files/mutt/mailcap diff --git a/mutt/muttrc b/Ansible/roles/dotfiles/files/mutt/muttrc similarity index 92% rename from mutt/muttrc rename to Ansible/roles/dotfiles/files/mutt/muttrc index 14e04f3..19b0b9b 100644 --- a/mutt/muttrc +++ b/Ansible/roles/dotfiles/files/mutt/muttrc @@ -19,9 +19,9 @@ set timeout=300 set imap_keepalive=300 # Caching -set header_cache="~/.cache/mutt/headers" -set message_cachedir="~/.cache/mutt/bodies" -set certificate_file="~/.cache/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 @@ -116,4 +116,4 @@ color quoted1 color37 default color quoted2 color64 default # Solarized (light theme) colors -#source ~/.config/mutt/mutt-colors-solarized/mutt-colors-solarized-dark-256.muttrc +#source ~/.mutt/mutt-colors-solarized/mutt-colors-solarized-dark-256.muttrc diff --git a/mutt/view_attachment.sh b/Ansible/roles/dotfiles/files/mutt/view_attachment.sh similarity index 100% rename from mutt/view_attachment.sh rename to Ansible/roles/dotfiles/files/mutt/view_attachment.sh diff --git a/nvim/UltiSnips/lua.snippets b/Ansible/roles/dotfiles/files/neovim/UltiSnips/lua.snippets similarity index 100% rename from nvim/UltiSnips/lua.snippets rename to Ansible/roles/dotfiles/files/neovim/UltiSnips/lua.snippets diff --git a/nvim/UltiSnips/python.snippets b/Ansible/roles/dotfiles/files/neovim/UltiSnips/python.snippets similarity index 100% rename from nvim/UltiSnips/python.snippets rename to Ansible/roles/dotfiles/files/neovim/UltiSnips/python.snippets diff --git a/nvim/after/ftplugin/css.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/css.lua similarity index 100% rename from nvim/after/ftplugin/css.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/css.lua diff --git a/nvim/after/ftplugin/gitcommit.vim b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/gitcommit.vim similarity index 100% rename from nvim/after/ftplugin/gitcommit.vim rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/gitcommit.vim diff --git a/nvim/after/ftplugin/gohtmltmpl.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/gohtmltmpl.lua similarity index 100% rename from nvim/after/ftplugin/gohtmltmpl.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/gohtmltmpl.lua diff --git a/nvim/after/ftplugin/lua.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/lua.lua similarity index 100% rename from nvim/after/ftplugin/lua.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/lua.lua diff --git a/nvim/after/ftplugin/python.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/python.lua similarity index 100% rename from nvim/after/ftplugin/python.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/python.lua diff --git a/nvim/after/ftplugin/rust.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/rust.lua similarity index 100% rename from nvim/after/ftplugin/rust.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/rust.lua diff --git a/nvim/after/ftplugin/zsh.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/zsh.lua similarity index 100% rename from nvim/after/ftplugin/zsh.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/zsh.lua diff --git a/nvim/after/plugin/gitgutter.lua b/Ansible/roles/dotfiles/files/neovim/after/plugin/gitgutter.lua similarity index 100% rename from nvim/after/plugin/gitgutter.lua rename to Ansible/roles/dotfiles/files/neovim/after/plugin/gitgutter.lua diff --git a/nvim/after/plugin/treesitter.lua b/Ansible/roles/dotfiles/files/neovim/after/plugin/treesitter.lua similarity index 50% rename from nvim/after/plugin/treesitter.lua rename to Ansible/roles/dotfiles/files/neovim/after/plugin/treesitter.lua index f1ebcef..40a6f9f 100644 --- a/nvim/after/plugin/treesitter.lua +++ b/Ansible/roles/dotfiles/files/neovim/after/plugin/treesitter.lua @@ -1,7 +1,7 @@ -local treesitter = require 'nvim-treesitter' +local treesitter_configs = require 'nvim-treesitter.configs' -treesitter.setup { - ensure_installed = { "lua", "vim" }, +treesitter_configs.setup { + ensure_installed = { "lua", "vim", "javascript", "swift" }, sync_install = true, auto_install = true, hightlight = { diff --git a/nvim/after/syntax/css.vim b/Ansible/roles/dotfiles/files/neovim/after/syntax/css.vim similarity index 100% rename from nvim/after/syntax/css.vim rename to Ansible/roles/dotfiles/files/neovim/after/syntax/css.vim diff --git a/nvim/ftdetect/gohtmltmpl.lua b/Ansible/roles/dotfiles/files/neovim/ftdetect/gohtmltmpl.lua similarity index 100% rename from nvim/ftdetect/gohtmltmpl.lua rename to Ansible/roles/dotfiles/files/neovim/ftdetect/gohtmltmpl.lua diff --git a/nvim/ftdetect/zsh.lua b/Ansible/roles/dotfiles/files/neovim/ftdetect/zsh.lua similarity index 100% rename from nvim/ftdetect/zsh.lua rename to Ansible/roles/dotfiles/files/neovim/ftdetect/zsh.lua diff --git a/nvim/init.lua b/Ansible/roles/dotfiles/files/neovim/init.lua similarity index 84% rename from nvim/init.lua rename to Ansible/roles/dotfiles/files/neovim/init.lua index 8143253..d57d195 100644 --- a/nvim/init.lua +++ b/Ansible/roles/dotfiles/files/neovim/init.lua @@ -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() diff --git a/nvim/lua/autocommands.lua b/Ansible/roles/dotfiles/files/neovim/lua/autocommands.lua similarity index 100% rename from nvim/lua/autocommands.lua rename to Ansible/roles/dotfiles/files/neovim/lua/autocommands.lua diff --git a/nvim/lua/colors.lua b/Ansible/roles/dotfiles/files/neovim/lua/colors.lua similarity index 86% rename from nvim/lua/colors.lua rename to Ansible/roles/dotfiles/files/neovim/lua/colors.lua index 6dc00f9..ffdde76 100644 --- a/nvim/lua/colors.lua +++ b/Ansible/roles/dotfiles/files/neovim/lua/colors.lua @@ -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 ]] diff --git a/nvim/lua/configuration.lua b/Ansible/roles/dotfiles/files/neovim/lua/configuration.lua similarity index 83% rename from nvim/lua/configuration.lua rename to Ansible/roles/dotfiles/files/neovim/lua/configuration.lua index 6fbf469..ac20607 100644 --- a/nvim/lua/configuration.lua +++ b/Ansible/roles/dotfiles/files/neovim/lua/configuration.lua @@ -1,6 +1,6 @@ -- Eryn Wells --- [[ 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 diff --git a/nvim/lua/diagnostics.lua b/Ansible/roles/dotfiles/files/neovim/lua/diagnostics.lua similarity index 100% rename from nvim/lua/diagnostics.lua rename to Ansible/roles/dotfiles/files/neovim/lua/diagnostics.lua diff --git a/nvim/lua/gui.lua b/Ansible/roles/dotfiles/files/neovim/lua/gui.lua similarity index 61% rename from nvim/lua/gui.lua rename to Ansible/roles/dotfiles/files/neovim/lua/gui.lua index 873fc99..8800fb5 100644 --- a/nvim/lua/gui.lua +++ b/Ansible/roles/dotfiles/files/neovim/lua/gui.lua @@ -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 diff --git a/nvim/lua/keys.lua b/Ansible/roles/dotfiles/files/neovim/lua/keys.lua similarity index 55% rename from nvim/lua/keys.lua rename to Ansible/roles/dotfiles/files/neovim/lua/keys.lua index d83fb21..1ce1297 100644 --- a/nvim/lua/keys.lua +++ b/Ansible/roles/dotfiles/files/neovim/lua/keys.lua @@ -1,35 +1,11 @@ -- Eryn Wells -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'}, '', 'gk', options) - map({'n', 'v'}, '', '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', '', '"+y', options) - -- Cut to the system clipboard - map('v', '', '"+x', options) - -- Paste from the system clipboard - map({'i', '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', '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', 'ff', builtin.find_files, { desc = 'Telescope find files' }) - map('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) - map('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) - map('n', '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, } diff --git a/nvim/lua/lsp.lua b/Ansible/roles/dotfiles/files/neovim/lua/lsp.lua similarity index 91% rename from nvim/lua/lsp.lua rename to Ansible/roles/dotfiles/files/neovim/lua/lsp.lua index 0a4277d..87f964f 100644 --- a/nvim/lua/lsp.lua +++ b/Ansible/roles/dotfiles/files/neovim/lua/lsp.lua @@ -3,6 +3,8 @@ local clangd_extensions = require 'clangd_extensions' local cmp = require 'cmp' +local lspconfig = require 'lspconfig' + local keys = require 'keys' cmp.setup { @@ -58,7 +60,7 @@ local function on_attach(client, buffer_number) keys.init_lsp_key_mappings(buffer_number) end -vim.lsp.config("clangd", { +lspconfig.clangd.setup { on_attach = function(client, buffer_number) on_attach(client, buffer_number) @@ -67,24 +69,19 @@ vim.lsp.config("clangd", { clangd_inlay_hints.set_inlay_hints() end, capabilities = cmp_capabilities, -}) +} -vim.lsp.config("eslint", { +lspconfig.eslint.setup { on_attach = on_attach, capabilities = cmp_capabilities, -}) +} -vim.lsp.config("ts_ls", { +lspconfig.html.setup { on_attach = on_attach, capabilities = cmp_capabilities, -}) +} -vim.lsp.config("html", { - on_attach = on_attach, - capabilities = cmp_capabilities, -}) - -vim.lsp.config("lua_ls", { +lspconfig.lua_ls.setup { on_attach = on_attach, capabilities = cmp_capabilities, settings = { @@ -99,14 +96,14 @@ vim.lsp.config("lua_ls", { }, }, }, -}) +} -vim.lsp.config("pyright", { +lspconfig.pyright.setup { on_attach = on_attach, capabilities = cmp_capabilities, -}) +} -vim.lsp.config("rust_analyzer", { +lspconfig.rust_analyzer.setup { on_attach = function(client, buffer_number) on_attach(client, buffer_number) end, @@ -118,8 +115,7 @@ vim.lsp.config("rust_analyzer", { enable = true, }, }, - checkOnSave = true, - check = { + checkOnSave = { command = 'clippy', extraArgs = { "--", @@ -137,4 +133,4 @@ vim.lsp.config("rust_analyzer", { }, }, }, -}) +} diff --git a/nvim/lua/treesitter.lua b/Ansible/roles/dotfiles/files/neovim/lua/treesitter.lua similarity index 90% rename from nvim/lua/treesitter.lua rename to Ansible/roles/dotfiles/files/neovim/lua/treesitter.lua index c9cb59f..3c198f1 100644 --- a/nvim/lua/treesitter.lua +++ b/Ansible/roles/dotfiles/files/neovim/lua/treesitter.lua @@ -1,7 +1,7 @@ -- Treesitter configuration -- Eryn Wells -local treesitter = require 'nvim-treesitter' +local treesitter = require 'nvim-treesitter.configs' -- For some reason the Lua linter complains about missing fields here even -- though they're not requried. So, ignore the error. diff --git a/nvim/syntax/gocsstmpl.vim b/Ansible/roles/dotfiles/files/neovim/syntax/gocsstmpl.vim similarity index 100% rename from nvim/syntax/gocsstmpl.vim rename to Ansible/roles/dotfiles/files/neovim/syntax/gocsstmpl.vim diff --git a/nethackrc b/Ansible/roles/dotfiles/files/nethack/nethackrc similarity index 100% rename from nethackrc rename to Ansible/roles/dotfiles/files/nethack/nethackrc diff --git a/screenrc b/Ansible/roles/dotfiles/files/screen/screenrc similarity index 100% rename from screenrc rename to Ansible/roles/dotfiles/files/screen/screenrc diff --git a/tmux/tmux.conf b/Ansible/roles/dotfiles/files/tmux/tmux.conf similarity index 98% rename from tmux/tmux.conf rename to Ansible/roles/dotfiles/files/tmux/tmux.conf index 178c750..efaada8 100644 --- a/tmux/tmux.conf +++ b/Ansible/roles/dotfiles/files/tmux/tmux.conf @@ -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 diff --git a/vimrc b/Ansible/roles/dotfiles/files/vim/vimrc similarity index 95% rename from vimrc rename to Ansible/roles/dotfiles/files/vim/vimrc index a0d2aea..bf45210 100644 --- a/vimrc +++ b/Ansible/roles/dotfiles/files/vim/vimrc @@ -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 diff --git a/zsh/functions/append_to_path b/Ansible/roles/dotfiles/files/zsh/functions/append_to_path similarity index 100% rename from zsh/functions/append_to_path rename to Ansible/roles/dotfiles/files/zsh/functions/append_to_path diff --git a/zsh/functions/binary_exists b/Ansible/roles/dotfiles/files/zsh/functions/binary_exists similarity index 100% rename from zsh/functions/binary_exists rename to Ansible/roles/dotfiles/files/zsh/functions/binary_exists diff --git a/zsh/functions/connect_ssh_agent b/Ansible/roles/dotfiles/files/zsh/functions/connect_ssh_agent similarity index 100% rename from zsh/functions/connect_ssh_agent rename to Ansible/roles/dotfiles/files/zsh/functions/connect_ssh_agent diff --git a/zsh/functions/darwin-icloud-drive-path b/Ansible/roles/dotfiles/files/zsh/functions/darwin-icloud-drive-path similarity index 100% rename from zsh/functions/darwin-icloud-drive-path rename to Ansible/roles/dotfiles/files/zsh/functions/darwin-icloud-drive-path diff --git a/zsh/functions/darwin/darwin-hardware-model b/Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-hardware-model similarity index 100% rename from zsh/functions/darwin/darwin-hardware-model rename to Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-hardware-model diff --git a/zsh/functions/darwin/darwin-os-build b/Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-os-build similarity index 100% rename from zsh/functions/darwin/darwin-os-build rename to Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-os-build diff --git a/zsh/functions/darwin/darwin-os-version b/Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-os-version similarity index 100% rename from zsh/functions/darwin/darwin-os-version rename to Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-os-version diff --git a/zsh/functions/darwin_configure_screenshots_directory b/Ansible/roles/dotfiles/files/zsh/functions/darwin_configure_screenshots_directory similarity index 100% rename from zsh/functions/darwin_configure_screenshots_directory rename to Ansible/roles/dotfiles/files/zsh/functions/darwin_configure_screenshots_directory diff --git a/zsh/functions/darwin_init_once b/Ansible/roles/dotfiles/files/zsh/functions/darwin_init_once similarity index 100% rename from zsh/functions/darwin_init_once rename to Ansible/roles/dotfiles/files/zsh/functions/darwin_init_once diff --git a/zsh/functions/do_init_functions b/Ansible/roles/dotfiles/files/zsh/functions/do_init_functions similarity index 100% rename from zsh/functions/do_init_functions rename to Ansible/roles/dotfiles/files/zsh/functions/do_init_functions diff --git a/zsh/functions/finder b/Ansible/roles/dotfiles/files/zsh/functions/finder similarity index 100% rename from zsh/functions/finder rename to Ansible/roles/dotfiles/files/zsh/functions/finder diff --git a/zsh/functions/g b/Ansible/roles/dotfiles/files/zsh/functions/g similarity index 100% rename from zsh/functions/g rename to Ansible/roles/dotfiles/files/zsh/functions/g diff --git a/zsh/functions/homebrew-prefix b/Ansible/roles/dotfiles/files/zsh/functions/homebrew-prefix similarity index 100% rename from zsh/functions/homebrew-prefix rename to Ansible/roles/dotfiles/files/zsh/functions/homebrew-prefix diff --git a/zsh/functions/import_cacert b/Ansible/roles/dotfiles/files/zsh/functions/import_cacert similarity index 100% rename from zsh/functions/import_cacert rename to Ansible/roles/dotfiles/files/zsh/functions/import_cacert diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_app_environments b/Ansible/roles/dotfiles/files/zsh/functions/init_app_environments new file mode 100644 index 0000000..dbd7a51 --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_app_environments @@ -0,0 +1,17 @@ +#!/usr/bin/env zsh +# Eryn Wells + +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 "$@" diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_configure_ls b/Ansible/roles/dotfiles/files/zsh/functions/init_configure_ls new file mode 100644 index 0000000..1808574 --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_configure_ls @@ -0,0 +1,30 @@ +#!/usr/bin/env zsh +# Eryn Wells + +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 diff --git a/zsh/functions/init_profile_darwin b/Ansible/roles/dotfiles/files/zsh/functions/init_profile_darwin similarity index 100% rename from zsh/functions/init_profile_darwin rename to Ansible/roles/dotfiles/files/zsh/functions/init_profile_darwin diff --git a/zsh/functions/init_profile_darwin_say_hello b/Ansible/roles/dotfiles/files/zsh/functions/init_profile_darwin_say_hello similarity index 100% rename from zsh/functions/init_profile_darwin_say_hello rename to Ansible/roles/dotfiles/files/zsh/functions/init_profile_darwin_say_hello diff --git a/zsh/functions/init-rc-aliases b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_aliases similarity index 93% rename from zsh/functions/init-rc-aliases rename to Ansible/roles/dotfiles/files/zsh/functions/init_rc_aliases index c19ee7c..4e16fa8 100644 --- a/zsh/functions/init-rc-aliases +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_aliases @@ -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 "$@" diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_completion b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_completion new file mode 100644 index 0000000..5b378fa --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_completion @@ -0,0 +1,41 @@ +#!/usr/bin/env zsh +# Eryn Wells + +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 diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_prompt b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_prompt new file mode 100644 index 0000000..669bbd4 --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_prompt @@ -0,0 +1,24 @@ +#!/usr/bin/env zsh +# Eryn Wells + +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 diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_zle b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_zle new file mode 100644 index 0000000..f4fc1f1 --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_zle @@ -0,0 +1,20 @@ +#!/usr/bin/env zsh +# Eryn Wells + +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 diff --git a/zsh/functions/init_rc_fpath_darwin b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_fpath_darwin similarity index 100% rename from zsh/functions/init_rc_fpath_darwin rename to Ansible/roles/dotfiles/files/zsh/functions/init_rc_fpath_darwin diff --git a/zsh/functions/init-rc-linux b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_linux similarity index 83% rename from zsh/functions/init-rc-linux rename to Ansible/roles/dotfiles/files/zsh/functions/init_rc_linux index 1f01355..d756389 100644 --- a/zsh/functions/init-rc-linux +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_linux @@ -1,11 +1,11 @@ #!/usr/bin/env zsh # Eryn Wells -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 "$@" diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_rc_tilde_paths b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_tilde_paths new file mode 100644 index 0000000..ba26585 --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_tilde_paths @@ -0,0 +1,12 @@ +#!/usr/bin/env zsh +# Eryn Wells + +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" diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_site_environment b/Ansible/roles/dotfiles/files/zsh/functions/init_site_environment new file mode 100644 index 0000000..b4f382b --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_site_environment @@ -0,0 +1,9 @@ +#!/usr/bin/env zsh +# Eryn Wells + +function init_site_environments +{ + export ERYNWELLS_ME_SITE="$HOME/Developer/erynwells.me" +} + +init_site_environments "$@" diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_website_environment b/Ansible/roles/dotfiles/files/zsh/functions/init_website_environment new file mode 100644 index 0000000..e1f791e --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_website_environment @@ -0,0 +1,9 @@ +#!/usr/bin/env zsh +# Eryn Wells + +function init_website_environments +{ + export ERYNWELLS_ME_SITE="$HOME/Developer/erynwells.me" +} + +init_website_environments "$@" diff --git a/zsh/functions/init_xcode b/Ansible/roles/dotfiles/files/zsh/functions/init_xcode similarity index 100% rename from zsh/functions/init_xcode rename to Ansible/roles/dotfiles/files/zsh/functions/init_xcode diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_zsh_functions b/Ansible/roles/dotfiles/files/zsh/functions/init_zsh_functions new file mode 100644 index 0000000..5f53b8b --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_zsh_functions @@ -0,0 +1,16 @@ +#!/usr/bin/env zsh +# Eryn Wells + +autoload load_module + +local myfpath="$HOME/.zsh/func" + +for func in $myfpath/*; do + [[ ! -e "$func" || -d "$func" ]] && continue + + local functionName=`basename $func` + [[ "$functionName" =~ "prompt_*" ]] && continue + [[ "$functionName" =~ "init_*" ]] && continue + + autoload -Uz $functionName +done diff --git a/zsh/functions/init-rc-zsh-history b/Ansible/roles/dotfiles/files/zsh/functions/init_zsh_history similarity index 86% rename from zsh/functions/init-rc-zsh-history rename to Ansible/roles/dotfiles/files/zsh/functions/init_zsh_history index 31d021f..ad07940 100644 --- a/zsh/functions/init-rc-zsh-history +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_zsh_history @@ -1,7 +1,7 @@ #!/usr/bin/env zsh # Eryn Wells -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 "$@" diff --git a/zsh/functions/init-rc-zsh-options b/Ansible/roles/dotfiles/files/zsh/functions/init_zsh_options similarity index 83% rename from zsh/functions/init-rc-zsh-options rename to Ansible/roles/dotfiles/files/zsh/functions/init_zsh_options index 8240abb..127f842 100644 --- a/zsh/functions/init-rc-zsh-options +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_zsh_options @@ -1,7 +1,7 @@ #!/usr/bin/env zsh # Eryn Wells -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 "$@" diff --git a/zsh/functions/list_tmux_sessions b/Ansible/roles/dotfiles/files/zsh/functions/list_tmux_sessions similarity index 100% rename from zsh/functions/list_tmux_sessions rename to Ansible/roles/dotfiles/files/zsh/functions/list_tmux_sessions diff --git a/zsh/functions/load_module b/Ansible/roles/dotfiles/files/zsh/functions/load_module similarity index 100% rename from zsh/functions/load_module rename to Ansible/roles/dotfiles/files/zsh/functions/load_module diff --git a/zsh/functions/neovim_init_once b/Ansible/roles/dotfiles/files/zsh/functions/neovim_init_once similarity index 100% rename from zsh/functions/neovim_init_once rename to Ansible/roles/dotfiles/files/zsh/functions/neovim_init_once diff --git a/zsh/functions/nethack b/Ansible/roles/dotfiles/files/zsh/functions/nethack similarity index 100% rename from zsh/functions/nethack rename to Ansible/roles/dotfiles/files/zsh/functions/nethack diff --git a/zsh/functions/open-xcode b/Ansible/roles/dotfiles/files/zsh/functions/open-xcode similarity index 100% rename from zsh/functions/open-xcode rename to Ansible/roles/dotfiles/files/zsh/functions/open-xcode diff --git a/zsh/functions/prepend_to_path b/Ansible/roles/dotfiles/files/zsh/functions/prepend_to_path similarity index 100% rename from zsh/functions/prepend_to_path rename to Ansible/roles/dotfiles/files/zsh/functions/prepend_to_path diff --git a/zsh/functions/prompt_colorize b/Ansible/roles/dotfiles/files/zsh/functions/prompt_colorize similarity index 100% rename from zsh/functions/prompt_colorize rename to Ansible/roles/dotfiles/files/zsh/functions/prompt_colorize diff --git a/zsh/functions/prompt_loquacious_setup b/Ansible/roles/dotfiles/files/zsh/functions/prompt_loquacious_setup similarity index 100% rename from zsh/functions/prompt_loquacious_setup rename to Ansible/roles/dotfiles/files/zsh/functions/prompt_loquacious_setup diff --git a/zsh/functions/refresh_system_tags b/Ansible/roles/dotfiles/files/zsh/functions/refresh_system_tags similarity index 100% rename from zsh/functions/refresh_system_tags rename to Ansible/roles/dotfiles/files/zsh/functions/refresh_system_tags diff --git a/zsh/functions/setup-cpython b/Ansible/roles/dotfiles/files/zsh/functions/setup-cpython similarity index 100% rename from zsh/functions/setup-cpython rename to Ansible/roles/dotfiles/files/zsh/functions/setup-cpython diff --git a/zsh/functions/setup_android b/Ansible/roles/dotfiles/files/zsh/functions/setup_android similarity index 100% rename from zsh/functions/setup_android rename to Ansible/roles/dotfiles/files/zsh/functions/setup_android diff --git a/zsh/functions/solarized b/Ansible/roles/dotfiles/files/zsh/functions/solarized similarity index 100% rename from zsh/functions/solarized rename to Ansible/roles/dotfiles/files/zsh/functions/solarized diff --git a/zsh/functions/up b/Ansible/roles/dotfiles/files/zsh/functions/up similarity index 100% rename from zsh/functions/up rename to Ansible/roles/dotfiles/files/zsh/functions/up diff --git a/zsh/functions/update-path b/Ansible/roles/dotfiles/files/zsh/functions/update-path similarity index 97% rename from zsh/functions/update-path rename to Ansible/roles/dotfiles/files/zsh/functions/update-path index 624258a..4172df4 100644 --- a/zsh/functions/update-path +++ b/Ansible/roles/dotfiles/files/zsh/functions/update-path @@ -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. diff --git a/Ansible/roles/dotfiles/files/zsh/functions/weeknotes b/Ansible/roles/dotfiles/files/zsh/functions/weeknotes new file mode 100644 index 0000000..9381644 --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/weeknotes @@ -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 "$@" diff --git a/zsh/functions/init-env b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env similarity index 100% rename from zsh/functions/init-env rename to Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env diff --git a/zsh/functions/init-env-darwin b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-darwin similarity index 93% rename from zsh/functions/init-env-darwin rename to Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-darwin index 166edfe..9d9ac43 100644 --- a/zsh/functions/init-env-darwin +++ b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-darwin @@ -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 "$@" diff --git a/zsh/functions/init-env-path b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-path similarity index 87% rename from zsh/functions/init-env-path rename to Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-path index 705854d..f948ed2 100644 --- a/zsh/functions/init-env-path +++ b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-path @@ -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" \ diff --git a/zsh/functions/init-env-playdate b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-playdate similarity index 100% rename from zsh/functions/init-env-playdate rename to Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-playdate diff --git a/zsh/functions/init-env-python b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-python similarity index 64% rename from zsh/functions/init-env-python rename to Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-python index 6286e24..5f3da27 100644 --- a/zsh/functions/init-env-python +++ b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-python @@ -1,7 +1,6 @@ # Eryn Wells 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 "$@" diff --git a/zsh/functions/init-env-tilde-paths b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-tilde-paths similarity index 92% rename from zsh/functions/init-env-tilde-paths rename to Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-tilde-paths index 70acbd3..9e3f8ef 100644 --- a/zsh/functions/init-env-tilde-paths +++ b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-tilde-paths @@ -15,8 +15,6 @@ function init-env-tilde-paths c="$candidate_code_path" break done - - export df="$DOTFILES_HOME" } init-env-tilde-paths "$@" diff --git a/zsh/functions/init-env-vi b/Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-vi similarity index 100% rename from zsh/functions/init-env-vi rename to Ansible/roles/dotfiles/files/zsh/init-env-functions/init-env-vi diff --git a/zsh/functions/init-rc-darwin b/Ansible/roles/dotfiles/files/zsh/init-rc-functions/init-rc-darwin similarity index 100% rename from zsh/functions/init-rc-darwin rename to Ansible/roles/dotfiles/files/zsh/init-rc-functions/init-rc-darwin diff --git a/zsh/zprofile b/Ansible/roles/dotfiles/files/zsh/zprofile similarity index 100% rename from zsh/zprofile rename to Ansible/roles/dotfiles/files/zsh/zprofile diff --git a/zsh/zshenv b/Ansible/roles/dotfiles/files/zsh/zshenv similarity index 62% rename from zsh/zshenv rename to Ansible/roles/dotfiles/files/zsh/zshenv index 452e17e..540ecba 100644 --- a/zsh/zshenv +++ b/Ansible/roles/dotfiles/files/zsh/zshenv @@ -5,27 +5,13 @@ unsetopt GLOBAL_RCS export SYS=`uname -s | tr A-Z a-z` -function init-env-dotfiles-path -{ - local dotfiles_config="$HOME/.config/dotfiles/home" - if [[ -f "$dotfiles_config" ]]; then - export DOTFILES_HOME=$(cat "$dotfiles_config") - return - fi - - if [[ -f "$HOME/.dotfiles/setup.sh" ]]; then - export DOTFILES_HOME="$HOME/.dotfiles" - return - fi - - echo "WARNING: Couldn't find path to dotfiles" 1>&2 -} - function init-env-fpath { local -r fpath_candidates=( \ - "$DOTFILES_HOME/zsh/${SYS}-functions" \ - "$DOTFILES_HOME/zsh/functions" \ + "$HOME/.zsh/${SYS}-functions" \ + "$HOME/.zsh/init-env-functions" \ + "$HOME/.zsh/init-rc-functions" \ + "$HOME/.zsh/functions" \ ) # Process the array in reverse order (`Oa` means "descending index order", @@ -39,14 +25,12 @@ function init-env-fpath done } -init-env-dotfiles-path init-env-fpath autoload -Uz do_init_functions typeset -a zsh_init_env_functions=( \ init-env \ - init-env-default-xdg-vars \ init-env-path \ init-env-tilde-paths \ init-env-python \ diff --git a/zsh/zshrc b/Ansible/roles/dotfiles/files/zsh/zshrc similarity index 59% rename from zsh/zshrc rename to Ansible/roles/dotfiles/files/zsh/zshrc index da1297d..ce0e2c1 100644 --- a/zsh/zshrc +++ b/Ansible/roles/dotfiles/files/zsh/zshrc @@ -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 diff --git a/Ansible/roles/dotfiles/handlers/main.yml b/Ansible/roles/dotfiles/handlers/main.yml new file mode 100644 index 0000000..dfc89e5 --- /dev/null +++ b/Ansible/roles/dotfiles/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: Rediscover package manager + ansible.builtin.setup: + gather_subset: pkg_mgr diff --git a/Ansible/roles/dotfiles/tasks/darwin/bootstrap.yml b/Ansible/roles/dotfiles/tasks/darwin/bootstrap.yml new file mode 100644 index 0000000..0474ec1 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/darwin/bootstrap.yml @@ -0,0 +1,3 @@ +--- +- name: (macOS) Configure homebrew + ansible.builtin.include_tasks: homebrew.yml diff --git a/Ansible/roles/dotfiles/tasks/darwin/homebrew.yml b/Ansible/roles/dotfiles/tasks/darwin/homebrew.yml new file mode 100644 index 0000000..2ac20c6 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/darwin/homebrew.yml @@ -0,0 +1,37 @@ +--- +- name: (macOS | homebrew) Does the brew command exist? + ansible.builtin.stat: + path: /opt/homebrew/bin/brew + register: _dotfiles_homebrew_brew + +- name: (macOS | homebrew) Install Homebrew + when: not _dotfiles_homebrew_brew.stat.exists + block: + - name: (macOS | homebrew) Create temporary file for install script + ansible.builtin.tempfile: + state: file + prefix: homebrew-install + register: _dotfiles_homebrew_install_script + + - name: (macOS | homebrew) Set up homebrew + block: + - name: (macOS | homebrew) Fetch install script + ansible.builtin.get_url: + url: https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh + dest: "{{ _dotfiles_homebrew_install_script.path }}" + mode: "0644" + + - name: (macOS | homebrew) Run install script + ansible.builtin.command: + cmd: bash {{ _dotfiles_homebrew_install_script.path }} + environment: + NONINTERACTIVE: 1 + + - name: (macOS | homebrew) Gather package manager facts + ansible.builtin.setup: + gather_subset: pkg_mgr + always: + - name: (macOS | homebrew) Remove temporary install script + ansible.builtin.file: + path: "{{ _dotfiles_homebrew_install_script.path }}" + state: absent diff --git a/Ansible/roles/dotfiles/tasks/dotfiles.yml b/Ansible/roles/dotfiles/tasks/dotfiles.yml new file mode 100644 index 0000000..389ab23 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/dotfiles.yml @@ -0,0 +1,28 @@ +--- +- name: (dotfiles) ZSH + ansible.builtin.include_tasks: zsh.yml + tags: [ always, dotfiles_shell, dotfiles_zsh ] + +- name: (dotfiles) Vim + ansible.builtin.include_tasks: vim.yml + tags: [ always, dotfiles_vim ] + +- name: (dotfiles) Emacs + ansible.builtin.include_tasks: emacs.yml + tags: dotfiles_emacs + +- name: (dotfiles) Git + ansible.builtin.include_tasks: git.yml + tags: [ always, dotfiles_git ] + +- name: (dotfiles) Mutt + ansible.builtin.include_tasks: mutt.yml + tags: dotfiles_mutt + +- name: (dotfiles) Shell utilities + ansible.builtin.include_tasks: shell_utilities.yml + tags: dotfiles_shell + +- name: (dotfiles) Nethack + ansible.builtin.include_tasks: nethack.yml + tags: dotfiles_nethack diff --git a/Ansible/roles/dotfiles/tasks/emacs.yml b/Ansible/roles/dotfiles/tasks/emacs.yml new file mode 100644 index 0000000..415cf08 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/emacs.yml @@ -0,0 +1,7 @@ +--- +- name: (emacs) Link emacs config + ansible.builtin.file: + path: ~/.emacs + src: "{{ role_path }}/files/emacs/emacs" + state: link + force: true diff --git a/Ansible/roles/dotfiles/tasks/git.yml b/Ansible/roles/dotfiles/tasks/git.yml new file mode 100644 index 0000000..b326569 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/git.yml @@ -0,0 +1,10 @@ +--- +- name: (git) Link global git configs + ansible.builtin.file: + path: ~/.{{ item }} + src: "{{ role_path }}/files/git/{{ item }}" + state: link + force: true + loop: + - gitconfig + - gitignore diff --git a/Ansible/roles/dotfiles/tasks/main.yml b/Ansible/roles/dotfiles/tasks/main.yml new file mode 100644 index 0000000..91fc42c --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/main.yml @@ -0,0 +1,17 @@ +--- +- name: Bootstrap system + ansible.builtin.include_tasks: "{{ ansible_facts.os_family | lower }}/bootstrap.yml" + +#- name: Install packages +# ansible.builtin.include_tasks: packages.yml + +- name: Link dotfiles + ansible.builtin.include_tasks: dotfiles.yml + tags: + - dotfiles_git + - dotfiles_mutt + - dotfiles_neovim + - dotfiles_nethack + - dotfiles_shell + - dotfiles_vim + - dotfiles_zsh diff --git a/Ansible/roles/dotfiles/tasks/mutt.yml b/Ansible/roles/dotfiles/tasks/mutt.yml new file mode 100644 index 0000000..6cf777d --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/mutt.yml @@ -0,0 +1,25 @@ +--- +- name: (mutt) Link muttrc + ansible.builtin.file: + path: ~/.muttrc + src: "{{ role_path }}/files/mutt/muttrc" + state: link + force: true + +- name: (mutt) Make mutt config directory + ansible.builtin.file: + path: ~/.config/mutt + state: directory + force: true + +- name: (mutt) Link mailcap + ansible.builtin.file: + path: ~/.config/mutt/mailcap + src: "{{ role_path }}/files/mutt/mailcap" + state: link + force: true + +- name: (mutt) Create local state directory + ansible.builtin.file: + path: ~/.local/state/mutt + state: directory diff --git a/Ansible/roles/dotfiles/tasks/nethack.yml b/Ansible/roles/dotfiles/tasks/nethack.yml new file mode 100644 index 0000000..d6e8951 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/nethack.yml @@ -0,0 +1,15 @@ +--- +- name: (nethack) Install nethack package + ansible.builtin.package: + name: nethack + state: present + when: + - dotfiles_install_packages is defined + - "'nethack' in dotfiles_install_packages" + +- name: (nethack) Link nethackrc + ansible.builtin.file: + path: ~/.nethackrc + src: "{{ role_path }}/files/nethack/nethackrc" + state: link + force: true diff --git a/Ansible/roles/dotfiles/tasks/packages.yml b/Ansible/roles/dotfiles/tasks/packages.yml new file mode 100644 index 0000000..0642dc4 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/packages.yml @@ -0,0 +1,13 @@ +--- +- name: Install packages + become: "{{ _dotfiles_requires_become[ansible_facts.pkg_mgr] | default(true) }}" + vars: + package_names: _dotfiles_package_names[ansible_facts.pkg_mgr] + ansible.builtin.package: + name: > + {{ + package_names[package] | default(package) + for package + in (_dotfiles_core_packages + dotfiles_install_packages) + }} + state: present diff --git a/Ansible/roles/dotfiles/tasks/shell_utilities.yml b/Ansible/roles/dotfiles/tasks/shell_utilities.yml new file mode 100644 index 0000000..197a1ee --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/shell_utilities.yml @@ -0,0 +1,16 @@ +--- +- name: (tmux) Link tmux.conf + ansible.builtin.file: + path: ~/.tmux.conf + src: "{{ role_path }}/files/tmux/tmux.conf" + state: link + force: true + tags: dotfiles_tmux + +- name: (screen) Link screenrc + ansible.builtin.file: + path: ~/.screenrc + src: "{{ role_path }}/files/screen/screenrc" + state: link + force: true + tags: dotfiles_screen diff --git a/Ansible/roles/dotfiles/tasks/vim.yml b/Ansible/roles/dotfiles/tasks/vim.yml new file mode 100644 index 0000000..e3ff49b --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/vim.yml @@ -0,0 +1,33 @@ +--- +- name: (vim) Link plain vim config + ansible.builtin.file: + path: ~/.vimrc + src: "{{ role_path }}/files/vim/vimrc" + state: link + force: true + +- name: (neovim) Create standard config directory + tags: dotfiles_neovim + ansible.builtin.file: + path: ~/.config + state: directory + +- name: (neovim) Link config + tags: dotfiles_neovim + ansible.builtin.file: + path: ~/.config/nvim + src: "{{ role_path }}/files/neovim" + state: link + force: true + +- name: (neovim) Create .local directories + tags: dotfiles_neovim + ansible.builtin.file: + path: "{{ item }}" + state: directory + loop: + - ~/.local/share/nvim + - ~/.local/state/nvim + - ~/.local/state/nvim/backup + - ~/.local/state/nvim/swap + - ~/.local/state/nvim/undo diff --git a/Ansible/roles/dotfiles/tasks/zsh.yml b/Ansible/roles/dotfiles/tasks/zsh.yml new file mode 100644 index 0000000..c0b8570 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/zsh.yml @@ -0,0 +1,45 @@ +--- +- name: (zsh) Find zsh binary + ansible.builtin.command: + cmd: sh -c 'which zsh' + register: _dotfiles_which_zsh + +- name: (zsh) Configure zsh + when: (_dotfiles_which_zsh | length) > 0 + block: + - name: (zsh) Make zsh my shell + ansible.builtin.user: + name: "{{ ansible_user }}" + shell: "{{ _dotfiles_which_zsh.stdout }}" + state: present + + - name: (zsh) Link startup files + ansible.builtin.file: + path: ~/.{{ item }} + src: "{{ role_path }}/files/zsh/{{ item }}" + state: link + force: true + loop: + - zshenv + - zshrc + - zprofile + + - name: (zsh) Create zsh directories + ansible.builtin.file: + path: "{{ item }}" + state: directory + force: true + loop: + - ~/.zsh + - ~/.zsh/cache + + - name: (zsh) Link function library directories + ansible.builtin.file: + path: ~/.zsh/{{ item }} + src: "{{ role_path }}/files/zsh/{{ item }}" + state: link + force: true + loop: + - init-env-functions + - init-rc-functions + - functions diff --git a/Ansible/roles/dotfiles/vars/main.yml b/Ansible/roles/dotfiles/vars/main.yml new file mode 100644 index 0000000..de5b952 --- /dev/null +++ b/Ansible/roles/dotfiles/vars/main.yml @@ -0,0 +1,11 @@ +_dotfiles_core_packages: + - zsh + - git + - tmux + - neovim + +_dotfiles_package_names: + homebrew: + +_dotfiles_requires_become: + homebrew: false diff --git a/Ansible/roles/eryn/defaults/main.yml b/Ansible/roles/eryn/defaults/main.yml deleted file mode 100644 index 2c73f2a..0000000 --- a/Ansible/roles/eryn/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -eryn_vim_plug_tag: 0.14.0 diff --git a/Ansible/roles/eryn/handlers/main.yml b/Ansible/roles/eryn/handlers/main.yml deleted file mode 100644 index d251ba1..0000000 --- a/Ansible/roles/eryn/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ -- name: "Rebuild local facts" - ansible.builtin.setup: - gather_subset: [ local ] - -- name: "Reload Dock" - ansible.builtin.command: killall Dock diff --git a/Ansible/roles/eryn/tasks/git.yml b/Ansible/roles/eryn/tasks/git.yml deleted file mode 100644 index 6b0bf55..0000000 --- a/Ansible/roles/eryn/tasks/git.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: "git : Symlink configs" - ansible.builtin.include_tasks: symlink_dotfile.yml - vars: - dotfile_src: "{{ item }}" - loop: - - gitconfig - - gitignore diff --git a/Ansible/roles/eryn/tasks/macos/defaults.yml b/Ansible/roles/eryn/tasks/macos/defaults.yml deleted file mode 100644 index f3d721e..0000000 --- a/Ansible/roles/eryn/tasks/macos/defaults.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- name: "macOS : General : Set localization defaults" - community.general.osx_defaults: - domain: NSGlobalDomain - key: "{{ item.key }}" - type: "{{ item.type | default(omit) }}" - value: "{{ item.value }}" - state: present - loop: - - { name: AppleICUForce24HourTime, value: true, type: bool } - - { name: AppleLanguages, value: [ en-US, es-US, ja-US ], type: array } - - { name: AppleShowScrollBars, value: WhenScrolling } - - { name: InitialKeyRepeat, value: 15, type: int } - - { name: KeyRepeat, value: 2, type: int } - - { name: NSAutomaticCapitalizationEnabled, value: false, type: bool } - - { name: NSAutomaticDashSubstitutionEnabled, value: false, type: bool } - - { name: NSAutomaticPeriodSubstitutionEnabled, value: false, type: bool } - - { name: NSAutomaticQuoteSubstitutionEnabled, value: false, type: bool } - - { name: NSAutomaticSpellingCorrectionEnabled, value: false, type: bool } - - { name: NSAutomaticTextCompletionCollapsed, value: true, type: bool } - - { name: NSAutomaticTextCompletionEnabled, value: true, type: bool } - -- name: "macOS : Dock : Set defaults" - community.general.osx_defaults: - domain: com.apple.Dock - key: "{{ item.key }}" - type: "{{ item.type | default(omit) }}" - value: "{{ item.value }}" - state: present - loop: - - { name: autohide, value: true, type: bool } - - { name: showhidden, value: true, type: bool } - - { name: tilesize, value: 72, type: int } - notify: Reload Dock - -- name: "macOS : TextEdit : Set defaults" - community.general.osx_defaults: - domain: com.apple.TextEdit - key: "{{ item.key }}" - type: "{{ item.type | default(omit) }}" - value: "{{ item.value }}" - state: present - loop: - - { key: IgnoreHTML, value: true, type: bool } - - { key: RichText, value: false, type: bool } - - { key: author, value: "Eryn Wells" } - - { key: NSFixedPitchFontSize, value: 14, type: int } - - { key: NSFixedPitchFontSize, value: 14, type: int } diff --git a/Ansible/roles/eryn/tasks/macos/homebrew.yml b/Ansible/roles/eryn/tasks/macos/homebrew.yml deleted file mode 100644 index 4602e09..0000000 --- a/Ansible/roles/eryn/tasks/macos/homebrew.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- name: "macOS : homebrew : Does the brew command exist?" - ansible.builtin.stat: - path: /opt/homebrew/bin/brew - register: _eryn_homebrew_brew - -- name: "macOS : homebrew : Install Homebrew" - when: not _eryn_homebrew_brew.stat.exists - block: - - name: "macOS : homebrew : Create temporary file for install script" - ansible.builtin.tempfile: - state: file - prefix: homebrew-install - register: _eryn_homebrew_install_script - - - name: "macOS : homebrew : Set up homebrew" - block: - - name: "macOS : homebrew : Fetch install script" - ansible.builtin.get_url: - url: https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh - dest: "{{ _eryn_homebrew_install_script.path }}" - mode: "0644" - - - name: "macOS : homebrew : Run install script" - ansible.builtin.command: - cmd: bash {{ _eryn_homebrew_install_script.path }} - environment: - NONINTERACTIVE: 1 - - - name: "macOS : homebrew : Gather package manager facts" - ansible.builtin.setup: - gather_subset: pkg_mgr - always: - - name: "macOS : homebrew : Remove temporary install script" - ansible.builtin.file: - path: "{{ _eryn_homebrew_install_script.path }}" - state: absent diff --git a/Ansible/roles/eryn/tasks/macos/main.yml b/Ansible/roles/eryn/tasks/macos/main.yml deleted file mode 100644 index cc189c1..0000000 --- a/Ansible/roles/eryn/tasks/macos/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: "macOS : Configure defaults" - ansible.builtin.import_tasks: macos/defaults.yml - -- name: "macOS : Configure log utility" - ansible.builtin.import_tasks: macos/system-log.yml - -- name: "macOS : Configure homebrew" - ansible.builtin.import_tasks: macos/homebrew.yml diff --git a/Ansible/roles/eryn/tasks/macos/system-log.yml b/Ansible/roles/eryn/tasks/macos/system-log.yml deleted file mode 100644 index 3d646a2..0000000 --- a/Ansible/roles/eryn/tasks/macos/system-log.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: "macOS : log : Symlink config" - ansible.builtin.include_tasks: symlink_dotfile.yml - vars: - dotfile_src: logrc diff --git a/Ansible/roles/eryn/tasks/main.yml b/Ansible/roles/eryn/tasks/main.yml deleted file mode 100644 index fa5b40d..0000000 --- a/Ansible/roles/eryn/tasks/main.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Configure macOS - ansible.builtin.import_tasks: macos/main.yml - when: ansible_os_family == "macOS" - -- name: Configure XDG environment - ansible.builtin.import_tasks: xdg_home.yml - -- name: Configure zsh - ansible.builtin.import_tasks: zsh.yml - -- name: Configure vim - ansible.builtin.import_tasks: vim.yml -- name: Configure neovim - ansible.builtin.import_tasks: neovim.yml - -- name: Configure git - ansible.builtin.import_tasks: git.yml - -- name: Configure tmux - ansible.builtin.import_tasks: tmux.yml - -- name: Configure X.org - ansible.builtin.import_tasks: xorg.yml - when: ansible_os_family == "Linux" diff --git a/Ansible/roles/eryn/tasks/neovim.yml b/Ansible/roles/eryn/tasks/neovim.yml deleted file mode 100644 index 777c0bf..0000000 --- a/Ansible/roles/eryn/tasks/neovim.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: "neovim : Install neovim" - ansible.builtin.package: - name: neovim - state: present - -- name: "neovim : Download vim-plug from GitHub" - ansible.builtin.get_url: - url: "https://raw.githubusercontent.com/junegunn/vim-plug/{{ eryn_vim_plug_tag }}/plug.vim" - dest: "{{ ansible_local.xdg.data_home }}/nvim/site/autoload/plug.vim" - mode: "0644" - -- name: "neovim : Symlink config" - ansible.builtin.include_tasks: symlink_dotfile_directory.yml - vars: - dotfile_src: config/nvim diff --git a/Ansible/roles/eryn/tasks/nethack.yml b/Ansible/roles/eryn/tasks/nethack.yml deleted file mode 100644 index 9aa10cb..0000000 --- a/Ansible/roles/eryn/tasks/nethack.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: "nethack : Symlink config" - ansible.builtin.include_tasks: symlink_dotfile.yml - vars: - dotfile_src: nethackrc diff --git a/Ansible/roles/eryn/tasks/symlink_dotfile.yml b/Ansible/roles/eryn/tasks/symlink_dotfile.yml deleted file mode 100644 index f03fbab..0000000 --- a/Ansible/roles/eryn/tasks/symlink_dotfile.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: "Symlink {{ dotfile_src }}" - ansible.builtin.file: - src: "{{ ansible_local.dotfiles.path }}/{{ dotfile_src }}" - dest: "{{ dotfile_dest | default('~/.' + dotfile_src) }}" - owner: "{{ ansible_user_id }}" - mode: 0640 - state: link - ignore_errors: "{{ eryn_dotfiles_ignore_symlink_errors | default(false) }}" diff --git a/Ansible/roles/eryn/tasks/symlink_dotfile_directory.yml b/Ansible/roles/eryn/tasks/symlink_dotfile_directory.yml deleted file mode 100644 index 88da218..0000000 --- a/Ansible/roles/eryn/tasks/symlink_dotfile_directory.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: "Symlink {{ dotfile_src }}" - ansible.builtin.file: - src: "{{ ansible_local.dotfiles.path }}/{{ dotfile_src }}" - dest: "{{ dotfile_dest | default('~/.' + dotfile_src) }}" - owner: "{{ ansible_user_id }}" - mode: 0750 - state: link - ignore_errors: "{{ eryn_dotfiles_ignore_symlink_errors | default(false) }}" diff --git a/Ansible/roles/eryn/tasks/tmux.yml b/Ansible/roles/eryn/tasks/tmux.yml deleted file mode 100644 index 3c5effc..0000000 --- a/Ansible/roles/eryn/tasks/tmux.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: "tmux : Symlink config" - ansible.builtin.include_tasks: symlink_dotfile_directory.yml - vars: - dotfile_src: config/tmux diff --git a/Ansible/roles/eryn/tasks/vim.yml b/Ansible/roles/eryn/tasks/vim.yml deleted file mode 100644 index 42346a3..0000000 --- a/Ansible/roles/eryn/tasks/vim.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- name: "vim : Install vim" - ansible.builtin.package: - name: - - vim - - neovide - state: present - -- name: "vim : Symlink config files" - ansible.builtin.include_tasks: symlink_dotfile.yml - vars: - dotfile_src: "{{ item }}" - loop: - - vimrc - - vimrc.common - -# The viminfo file goes here, but vim won't write it if the directory doesn't exist. -- name: "vim : Create vim state directory" - ansible.builtin.file: - path: "{{ ansible_local.xdg.state_home }}/vim" - owner: "{{ ansible_user_id }}" - mode: "0750" - state: directory - -- name: "vim : Symlink runtime directory" - ansible.builtin.include_tasks: symlink_dotfile_directory.yml - vars: - dotfile_src: "{{ item }}" - loop: - - vim diff --git a/Ansible/roles/eryn/tasks/xdg_home.yml b/Ansible/roles/eryn/tasks/xdg_home.yml deleted file mode 100644 index df472cd..0000000 --- a/Ansible/roles/eryn/tasks/xdg_home.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Create XDG directories - ansible.builtin.file: - path: "{{ item }}" - state: directory - owner: "{{ ansible_user_id }}" - mode: 0750 - loop: - - "{{ ansible_local.xdg.config_home }}" - - "{{ ansible_local.xdg.data_home }}" - - "{{ ansible_local.xdg.state_home }}" - diff --git a/Ansible/roles/eryn/tasks/xorg.yml b/Ansible/roles/eryn/tasks/xorg.yml deleted file mode 100644 index 6956952..0000000 --- a/Ansible/roles/eryn/tasks/xorg.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -# TODO: This likely will require a lot more packages to install. IIRC, X.org -# also requires input and video packages to run in a basic state. Not to -# mention, graphics acceleration, window management, etc. - -- name: "Xorg : Install X.org" - ansible.builtin.package: - name: xorg - state: present - notify: Rebuild local facts - -# Make sure local facts are rebuilt so the steps below can correctly detect -# if X.org is present. -- name: "Xorg : Flush handlers" - meta: flush_handlers - -- name: "Xorg : Configure" - when: ansible_local.xorg.exists - block: - - name: "Xorg : Symlink Xdefaults" - ansible.builtin.include_tasks: symlink_dotfile_directory.yml - vars: - dotfile_src: Xdefaults diff --git a/Ansible/roles/eryn/tasks/zsh.yml b/Ansible/roles/eryn/tasks/zsh.yml deleted file mode 100644 index 943e435..0000000 --- a/Ansible/roles/eryn/tasks/zsh.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- name: "zsh : Set user shell" - ansible.builtin.user: - name: "{{ ansible_user_id }}" - shell: /bin/zsh - state: present - -- name: "zsh : Symlink startup files" - ansible.builtin.include_tasks: symlink_dotfile.yml - vars: - dotfile_src: "{{ item.src | default(item) }}" - dotfile_dest: "{{ item.dest | default(item) }}" - loop: - - zshenv - - zshrc - - zprofile - -- name: "zsh : Install user functions" - block: - - name: "zsh : Create zsh directory" - ansible.builtin.file: - path: ~/.zsh - owner: "{{ ansible_user_id }}" - mode: 0755 - state: directory - - - name: "zsh : Symlink functions directories" - ansible.builtin.include_tasks: symlink_dotfile_directory.yml - vars: - dotfile_src: "{{ item }}" - loop: - - zsh/func diff --git a/Dotfiles/Dotfiles.xcodeproj/project.pbxproj b/Dotfiles/Dotfiles.xcodeproj/project.pbxproj new file mode 100644 index 0000000..095777f --- /dev/null +++ b/Dotfiles/Dotfiles.xcodeproj/project.pbxproj @@ -0,0 +1,320 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + C084FC452797B3C100915D6A /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = C084FC442797B3C100915D6A /* main.swift */; }; + C084FC4B2797B3EC00915D6A /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = C084FC4A2797B3EC00915D6A /* ArgumentParser */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + C084FC3F2797B3C100915D6A /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + C084FC412797B3C100915D6A /* ShellLog */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ShellLog; sourceTree = BUILT_PRODUCTS_DIR; }; + C084FC442797B3C100915D6A /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C084FC3E2797B3C100915D6A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C084FC4B2797B3EC00915D6A /* ArgumentParser in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C084FC362797B39E00915D6A = { + isa = PBXGroup; + children = ( + C084FC432797B3C100915D6A /* ShellLog */, + C084FC422797B3C100915D6A /* Products */, + ); + sourceTree = ""; + }; + C084FC422797B3C100915D6A /* Products */ = { + isa = PBXGroup; + children = ( + C084FC412797B3C100915D6A /* ShellLog */, + ); + name = Products; + sourceTree = ""; + }; + C084FC432797B3C100915D6A /* ShellLog */ = { + isa = PBXGroup; + children = ( + C084FC442797B3C100915D6A /* main.swift */, + ); + path = ShellLog; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C084FC402797B3C100915D6A /* ShellLog */ = { + isa = PBXNativeTarget; + buildConfigurationList = C084FC462797B3C100915D6A /* Build configuration list for PBXNativeTarget "ShellLog" */; + buildPhases = ( + C084FC3D2797B3C100915D6A /* Sources */, + C084FC3E2797B3C100915D6A /* Frameworks */, + C084FC3F2797B3C100915D6A /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ShellLog; + packageProductDependencies = ( + C084FC4A2797B3EC00915D6A /* ArgumentParser */, + ); + productName = ShellLog; + productReference = C084FC412797B3C100915D6A /* ShellLog */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C084FC372797B39E00915D6A /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1320; + LastUpgradeCheck = 1320; + TargetAttributes = { + C084FC402797B3C100915D6A = { + CreatedOnToolsVersion = 13.2.1; + }; + }; + }; + buildConfigurationList = C084FC3A2797B39E00915D6A /* Build configuration list for PBXProject "Dotfiles" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = C084FC362797B39E00915D6A; + packageReferences = ( + C084FC492797B3EC00915D6A /* XCRemoteSwiftPackageReference "swift-argument-parser" */, + ); + productRefGroup = C084FC422797B3C100915D6A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C084FC402797B3C100915D6A /* ShellLog */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + C084FC3D2797B3C100915D6A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C084FC452797B3C100915D6A /* main.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + C084FC3B2797B39E00915D6A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Debug; + }; + C084FC3C2797B39E00915D6A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Release; + }; + C084FC472797B3C100915D6A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 78372RE6B4; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INSTALL_PATH = "$(HOME)/bin"; + MACOSX_DEPLOYMENT_TARGET = 11.6; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + C084FC482797B3C100915D6A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 78372RE6B4; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INSTALL_PATH = "$(HOME)/bin"; + MACOSX_DEPLOYMENT_TARGET = 11.6; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C084FC3A2797B39E00915D6A /* Build configuration list for PBXProject "Dotfiles" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C084FC3B2797B39E00915D6A /* Debug */, + C084FC3C2797B39E00915D6A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C084FC462797B3C100915D6A /* Build configuration list for PBXNativeTarget "ShellLog" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C084FC472797B3C100915D6A /* Debug */, + C084FC482797B3C100915D6A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + C084FC492797B3EC00915D6A /* XCRemoteSwiftPackageReference "swift-argument-parser" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/apple/swift-argument-parser.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.0.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + C084FC4A2797B3EC00915D6A /* ArgumentParser */ = { + isa = XCSwiftPackageProductDependency; + package = C084FC492797B3EC00915D6A /* XCRemoteSwiftPackageReference "swift-argument-parser" */; + productName = ArgumentParser; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = C084FC372797B39E00915D6A /* Project object */; +} diff --git a/Dotfiles/Dotfiles.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Dotfiles/Dotfiles.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Dotfiles/Dotfiles.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Dotfiles/Dotfiles.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Dotfiles/Dotfiles.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Dotfiles/Dotfiles.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Dotfiles/Dotfiles.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Dotfiles/Dotfiles.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..91fdecb --- /dev/null +++ b/Dotfiles/Dotfiles.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "swift-argument-parser", + "repositoryURL": "https://github.com/apple/swift-argument-parser.git", + "state": { + "branch": null, + "revision": "e1465042f195f374b94f915ba8ca49de24300a0d", + "version": "1.0.2" + } + } + ] + }, + "version": 1 +} diff --git a/Dotfiles/ShellLog/main.swift b/Dotfiles/ShellLog/main.swift new file mode 100644 index 0000000..57334a1 --- /dev/null +++ b/Dotfiles/ShellLog/main.swift @@ -0,0 +1,57 @@ +// +// main.swift +// ShellLog +// +// Created by Eryn Wells on 1/18/22. +// + +import ArgumentParser +import OSLog + +enum Level { + case Debug + case Info + case Warn + case Error +} + +extension Level: ExpressibleByArgument { + init?(argument: String) { + switch (argument) { + case "debug": + self = .Debug + case "info": + self = .Info + case "warn": + self = .Warn + case "error": + self = .Error + default: + return nil + } + } +} + +struct ShellLog: ParsableCommand { + + @Option(name: .shortAndLong, help: "The log level") + var level: Level? + + @Argument() var message: String + + func run() throws { + let log = Logger(subsystem: "me.erynwells.shell", category: "Shell") + switch level { + case .some(.Debug): + log.debug("\(message, privacy: .public)") + case .none, .some(.Info): + log.info("\(message, privacy: .public)") + case .some(.Warn): + log.warning("\(message, privacy: .public)") + case .some(.Error): + log.error("\(message, privacy: .public)") + } + } +} + +ShellLog.main() diff --git a/Fortune/Makefile b/Fortune/Makefile deleted file mode 100644 index 859c115..0000000 --- a/Fortune/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# Makefile -# Eryn Wells - -STRFILE != which strfile -DATFILES := eryn.dat - -.SUFFIXES : .dat .txt - -.txt.dat : - $(STRFILE) $(.IMPSRC) $(.TARGET) - -all : $(DATFILES) - -clean : .PHONY - rm -f $(DATFILES) diff --git a/Fortune/eryn.txt b/Fortune/eryn.txt deleted file mode 100644 index 87f0bc2..0000000 --- a/Fortune/eryn.txt +++ /dev/null @@ -1,16 +0,0 @@ -Please practice this until you can easily do it. - -- Andrej Diamantstein -% -Easy, isn't it? - -- Andrej Diamantstein -% -TWENTY THREE NINETEEN!!!! -% -You only have to let the soft animal of your body -love what it loves. - -- Mary Oliver, Wild Geese -% -Be a lamp, or a lifeboat, or a ladder -help someone’s soul to heal -Walk out of your house like a shepherd. - -- Rumi, Ode 3090 diff --git a/README.md b/README.md index ce5b5f6..58c6084 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,7 @@ This is my collection of dotfiles, preserved here for all to see and enjoy. Feel free to copy anything you see here. It would be nice if you added a comment mentioning where you got it. -My environment relies on `zsh`, `neovim`, and `git`. - +My environment relies on `zsh`, `vim`, and `git`. ## Installation diff --git a/nvim/UltiSnips/rust.snippets b/nvim/UltiSnips/rust.snippets deleted file mode 100644 index da88543..0000000 --- a/nvim/UltiSnips/rust.snippets +++ /dev/null @@ -1,38 +0,0 @@ -# rust.snippets -# vim: set ts=8 sw=8 sts=8 noet list: -# Eryn Wells - -snippet nnapp -// Eryn Wells - -use nannou::prelude::*; - -struct Model { - _window: window::Id, -} - -impl Model { - fn new(app: &App) -> Self { - let window = app.new_window().view(view).build().unwrap(); - Self { - _window: window, - } - } - - fn update(app: &App, model: &mut Model, update: Update) { - model.update(app, update) - } - - fn update(&mut self, app: &App, update: Update) { - // TODO: Update the model here. - } -} - -fn view(app: &App, model: &Model, frame: Frame) { - // TODO: Draw the view here. -} - -fn main() { - nannou::app(Model::new).update(update).run(); -} -endsnippet diff --git a/nvim/after/ftplugin/html.lua b/nvim/after/ftplugin/html.lua deleted file mode 100644 index 25913ef..0000000 --- a/nvim/after/ftplugin/html.lua +++ /dev/null @@ -1,4 +0,0 @@ --- Eryn Wells - -vim.opt_local.shiftwidth = 2 -vim.opt_local.softtabstop = 2 diff --git a/nvim/after/ftplugin/text.vim b/nvim/after/ftplugin/text.vim deleted file mode 100644 index ee5520d..0000000 --- a/nvim/after/ftplugin/text.vim +++ /dev/null @@ -1 +0,0 @@ -abbr hawaii Hawai‘i diff --git a/nvim/ftdetect/make.lua b/nvim/ftdetect/make.lua deleted file mode 100644 index d398cf8..0000000 --- a/nvim/ftdetect/make.lua +++ /dev/null @@ -1,7 +0,0 @@ --- Filetype detection for Makefiles --- Eryn Wells - -vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, { - pattern = "*.make", - command = "setfiletype make", -}) diff --git a/setup.sh b/setup.sh index 758c4bf..3447306 100755 --- a/setup.sh +++ b/setup.sh @@ -3,23 +3,10 @@ dotfiles_dir=$(cd "$(dirname "$0")" && pwd) sys=`uname -s | tr A-Z a-z` -skipitems=( \ - '.*\.orig' \ - '.*~' \ - Alfred \ - Ansible \ - bin \ - Colors \ - Dotfiles \ - Fortune \ - LaunchAgents \ - py \ - Python \ - README.md \ - setup.sh \ - Web \ - Xcode \ -) +skipitems=(setup.sh README.md py bin Alfred Colors Dotfiles LaunchAgents Python '.*\.orig' '.*~') + +typeset -A vimbundles +vimbundles=(Vundle.vim "https://github.com/gmarik/Vundle.vim.git") function link { local action @@ -54,11 +41,6 @@ function matches_skip_item { return 1 } -function build_fortunes { - echo "Building fortunes file" - (cd Fortune && make) -} - print -P " %BHome:%b $HOME" print -P " %BDotfiles:%b $dotfiles_dir" print -P "%BSkip Items:%b $skipitems\n" @@ -139,10 +121,7 @@ while getopts "v" arg $@; do esac done -print "Creating Python virtual environment" -local venv_path=~/.local/share/python-virtual-environments/eryn -python3 -m venv --system-site-packages "$venv_path" -"$venv_path/bin/pip" install "$dotfiles_dir/Python/eryntools" +python3 -m pip install --user "$dotfiles_dir/Python/eryntools" if (( $configure_vim )); then print -P "%BConfiguring Vim%b" @@ -168,6 +147,4 @@ if (( $configure_vim )); then $VIM +PlugInstall +qall fi -build_fortunes - exit 0 diff --git a/vim/plugins.vim b/vim/plugins.vim index 9478c60..2c9d29c 100644 --- a/vim/plugins.vim +++ b/vim/plugins.vim @@ -25,16 +25,17 @@ Plug 'PeterRincker/vim-argumentative' " Environment niceties Plug 'scrooloose/nerdtree' +if has('nvim') + Plug 'Mofiqul/dracula.nvim' +endif + " Snippets Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' -if has('nvim') - " Telescope - Plug 'nvim-lua/plenary.nvim' - Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.8' } +Plug 'dracula/vim', {'as': 'dracula'} - " Language servers +if has('nvim') Plug 'neovim/nvim-lspconfig' Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-nvim-lsp' diff --git a/vimrc.common b/vimrc.common index fe87b5a..f748382 100644 --- a/vimrc.common +++ b/vimrc.common @@ -78,6 +78,8 @@ set copyindent " copy previous indentation on autoindent set scrolloff=3 " scroll 3 lines ahead of point set sidescrolloff=5 " scroll 5 columns ahead of point +set pastetoggle= " toggle paste mode with this + " completion menu set wildmenu set wildmode=longest,list diff --git a/zsh/functions/bool b/zsh/functions/bool deleted file mode 100644 index 1fe2567..0000000 --- a/zsh/functions/bool +++ /dev/null @@ -1,31 +0,0 @@ -# Eryn Wells -# vim: set ft=zsh: - -function bool { - if [[ "$1" =~ '^-?[0-9]+$' ]]; then - if (( $1 == 0 )); then - echo "no" - return 1 - else - echo "yes" - return 0 - fi - fi - - local lowercase_value=${(L)1} - - if [[ "$lowercase_value" == "yes" || "$lowercase_value" == "true" ]]; then - echo "yes" - return 0 - fi - - if [[ "$lowercase_value" == "no" || "$lowercase_value" == "false" ]]; then - echo "no" - return 1 - fi - - echo "no" - return 1 -} - -bool "$@" diff --git a/zsh/functions/init-env-default-xdg-vars b/zsh/functions/init-env-default-xdg-vars deleted file mode 100644 index c1f5d63..0000000 --- a/zsh/functions/init-env-default-xdg-vars +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env zsh -# Eryn Wells - -# See https://specifications.freedesktop.org/basedir/latest/ for definitions of -# these paths. - - -function init-env-default-xdg-vars -{ - zmodload zsh/zutil - - local -a opt_create - zparseopts -a opt_args -D -E -F - \ - {c,-create,-no-create}=opt_create - - # Base directories - export \ - XDG_BIN_HOME=${XDG_BIN_HOME:-$HOME/.local/bin} \ - XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache} \ - XDG_CONFIG_HOME=${XDG_CACHE_HOME:-$HOME/.config} \ - XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} \ - XDG_STATE_HOME=${XDG_DATA_HOME:-$HOME/.local/state} \ - XDG_RUNTIME_DIR=${XDG_DATA_HOME:-$HOME/.local/var} - - # User directories - export \ - XDG_DESKTOP_DIR=${XDG_DESKTOP_DIR:-$HOME/Desktop} \ - XDG_DOCUMENTS_DIR=${XDG_DOCUMENTS_DIR:-$HOME/Document} \ - XDG_DOWNLOAD_DIR=${XDG_DOWNLOAD_DIR:-$HOME/Downloads} \ - XDG_MUSIC_DIR=${XDG_MUSIC_DIR:-$HOME/Music} \ - XDG_PICTURES_DIR=${XDG_PICTURES_DIR:-$HOME/Pictures} \ - XDG_PUBLICSHARE_DIR=${XDG_PUBLICSHARE_DIR:-$HOME/Public} \ - XDG_VIDEOS_DIR=${XDG_VIDEOS_DIR:-$HOME/Video} - - if [[ $opt_create[(I)--no-create] -ne 0 ]]; then - mkdir -p -m 0700 \ - $XDG_BIN_HOME \ - $XDG_CACHE_HOME \ - $XDG_CONFIG_HOME \ - $XDG_DATA_HOME \ - $XDG_STATE_HOME - fi -} - - -init-env-default-xdg-vars "$@" diff --git a/zsh/functions/init-rc-app-environments b/zsh/functions/init-rc-app-environments deleted file mode 100644 index e5250c3..0000000 --- a/zsh/functions/init-rc-app-environments +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env zsh -# Eryn Wells - -autoload binary_exists - -function init-rc-app-environments -{ - # Default ledger file - local -r ledger_file="$HOME/Documents/Ledger/personal.ledger" - [[ -f "$ledger_file" ]] && export LEDGER_FILE="$ledger_file" -} - -init-rc-app-environments "$@" diff --git a/zsh/functions/init-rc-completion b/zsh/functions/init-rc-completion deleted file mode 100644 index f73b06c..0000000 --- a/zsh/functions/init-rc-completion +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env zsh -# Eryn Wells - -function init-rc-completion -{ - 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 -} - -init-rc-completion "$@" diff --git a/zsh/functions/init-rc-ls b/zsh/functions/init-rc-ls deleted file mode 100644 index 5d2bcbd..0000000 --- a/zsh/functions/init-rc-ls +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env zsh -# Eryn Wells - -function init-rc-ls -{ - alias la="ls -A $ls_options" - alias ll="ls -l $ls_options" - alias l.="ls -d $ls_options .*" - - # Enable ls colors - export CLICOLOR=1 COLORTERM=1 - - # Define colors for ls. See the LSCOLORS documentation in ls(1). - # The default is "exfxcxdxbxegedabagacadah". - export LSCOLORS=Exdxcxfxbxegedabagacadah - - local dircolors_bin=$(whence -p dircolors || whence -p gdircolors) - if [[ -x "$dircolors_bin" ]]; then - if [[ -f "$HOME/.dircolors/$SYS.cfg" ]]; then - eval $dircolors_bin "$HOME/.dircolors/$SYS.cfg" - elif [[ -f "$HOME/.dircolors/default.cfg" ]]; then - eval $dircolors_bin "$HOME/.dircolors/default.cfg" - fi - fi -} - -init-rc-ls "$@" diff --git a/zsh/functions/init-rc-prompt b/zsh/functions/init-rc-prompt deleted file mode 100644 index 98f3ed9..0000000 --- a/zsh/functions/init-rc-prompt +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env zsh -# Eryn Wells - -function init-rc-prompt -{ - 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 -} - -init-rc-prompt "$@" diff --git a/zsh/functions/init-rc-zle b/zsh/functions/init-rc-zle deleted file mode 100644 index 37e79e9..0000000 --- a/zsh/functions/init-rc-zle +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env zsh -# Eryn Wells - -function init-rc-zle -{ - case "${ERYN_ZLE_MODE:-emacs}" in - vim) - bindkey -v - zle -A .backward-delete-char vi-backward-delete-char - ;; - emacs) - bindkey -e - ;; - esac -} - -init-rc-zle "$@"