Compare commits

...
Sign in to create a new pull request.

61 commits

Author SHA1 Message Date
6b08decfb9 [nvim] Add an app template snippet for Nannou apps (nnapp) 2025-08-12 20:37:15 -07:00
884fa0a542 [setup.sh] Build fortunes file in setup.sh 2025-08-11 17:12:14 -07:00
aefda50590 [setup.sh] Add some missing items to the skipitems array; skip Fortune 2025-08-11 17:08:07 -07:00
09f0985006 Ignore Fortune .dat files 2025-08-11 17:07:39 -07:00
71ab83d8f3 [fortune] A few more quotes 2025-08-11 17:07:28 -07:00
cf613b3012 [fortune] Add some fortune strings and a Makefile to build indexed string files 2025-08-11 17:00:13 -07:00
196004e993 Merge remote-tracking branch 'origin/main' 2025-08-09 07:46:48 -07:00
972d5f4524 [vim] Set mode with a string in Ansible tasks file for setting up vim 2025-08-09 07:45:52 -07:00
e0f813182a [vim] Configure ts_ls for Typescript and JS 2025-08-09 07:45:15 -07:00
bd05bc392a [vim] Add Meta-O to show open buffers in Neovide 2025-08-09 07:44:55 -07:00
fa0e59ea39 [zsh] Autoload the bool function 2025-08-01 10:40:10 -07:00
6dc9120dd0 [zsh] Update the Usage message of update-path to note the default is exporting the modified variable 2025-08-01 10:40:10 -07:00
bb82a7ca75 [nvim] Update format of rust-analyzer LSP config
I think the format of the config table for rust-analyzer changed. checkOnSave
takes a bool, and a separate check table provides the parameters.
2025-08-01 10:40:10 -07:00
f7e802d3f3 [zsh] bool() function
Converts its first argument to a bool return value (0 or 1) and echos
"yes" or "no".
2025-08-01 10:40:10 -07:00
03fe14895c [neovim] Add a couple overrides for the zaibatsu colorscheme
Improve the contrast of menu chrome with this color scheme.
2025-06-04 13:07:56 -07:00
9d9475db78 [neovim] Remove javascript and swift LSPs from the ensure_installed list 2025-06-04 13:07:12 -07:00
b3394844f2 [neovim] Disable relativenumber -- absolute numbers in the gutter 2025-06-03 13:19:51 -07:00
534d9a102b [neovim] Give key bindings a little love; add GUI bindings for neovide
- Clean up the init interface. Move all the init methods into a single
  init_all() call.
- Add two keybindings for <M-j> and <M-k> to move by soft-wrapped lines in
  Normal mode
- Add a few key bindings for the usual shortcuts for cut/copy/paste when in GUI
  mode. In vim, D is the character that represents the Super/Apple key. So,
  <D-x>, <D-c>, and <D-v> now do what you'd expect.
2025-06-03 13:19:51 -07:00
31215aadbf [neovim] Remove an extraneous newline 2025-05-21 11:02:23 -07:00
dd6a88d34f [vim] Remove pastetoggle setting from vimrc.common
This setting was removed from neovim recently and setting it was causing it to
barf. I'm not sure what the replacement is.
2025-05-21 11:00:27 -07:00
2fea369110 [nvim] Move setting the GUI font to init_gui() from _init_neovide()
Make a font family list that includes Berkeley Mono, SF Mono, and Courier New.
2025-04-18 09:55:18 -07:00
a87f399939 [nvim] Set the GUI colorscheme to lunaperche 2025-04-18 09:55:18 -07:00
891aacb9ed [tmux] Remove the comma from between the date and time 2025-04-18 09:53:41 -07:00
89fcc479db Ansible: set exec bit on facts/xorg.fact 2025-02-20 13:38:20 -08:00
6bf81515f6 Ansible: Write some system-wide defaults for macOS 2025-02-20 08:25:09 -08:00
687083bf31 Ansible: Add X.org configuration
- Detect if X.org is installed with a small fact script
- Symlink Xdefaults file if X.org is installed
2025-02-19 13:08:20 -08:00
29fdc610bb Ansible: download vim-plug from GitHub
Use get_url to download vim-plug/plug.vim from GitHub.
Create a new eryn_vim_plug_tag variable to control which tag to download.
2025-02-18 13:27:14 -08:00
4bd546e649 Remove vimbundles array from setup.sh
This array is no longer used.
2025-02-18 13:22:23 -08:00
e8d08af807 zsh: Add my website's scripts directory to $path, assuming it's at ~/Website 2025-02-12 07:53:06 -08:00
2db42121c9 Ansible: Use the fully qualified name of the import_tasks module in main.yml for the eryn role 2025-02-12 07:52:33 -08:00
7c8d97c25e Ansible: Install vim and neovide before setting up vim 2025-02-12 07:51:51 -08:00
73ca945487 Ansible: Add homebrew, system log, and main tasks for macOS to the eryn role 2025-02-12 07:51:29 -08:00
41dc68869a nvim: Abbreviation for hawaii that includes the 'okina 2025-01-31 22:39:04 -08:00
47a797d6e3 Ansible: Ignore symlink errors in check mode 2025-01-31 22:38:15 -08:00
b8aac0793e Ansible: add tasks for setting up git, nethack, and tmux configs 2025-01-31 22:37:52 -08:00
9005e00e4e Ansible: Create XDG home directories based on xdg facts 2025-01-31 16:40:50 -08:00
cc42c50438 Ansible: Remove unnecessary _zsh_dir variable from zsh.yml 2025-01-31 16:36:55 -08:00
0839618327 Ansible: Symlink dotfile tasks
Add a new tasks file for symlinking a directory. Doing it this way instead of
stat'ing the file and forking based on its type in symlink_dotfile.yml is more
efficient, I think?

Clean up file permissions: remove other permissions.

Add a variable to toggle skipping symlink errors.
2025-01-31 16:34:42 -08:00
d022b579d2 Ansible: Add tasks for setting up neovim and vim 2025-01-31 16:34:20 -08:00
baed6171dc Ansible: Add XDG facts to the ansible environment 2025-01-31 16:28:36 -08:00
72896c3feb Ansible: another take a using Ansible to set up dotfiles 2025-01-31 16:27:22 -08:00
be6b93cdde [nvim] Set shiftwidth and softtabstop to 2 spaces for HTML files
Never thought I'd be *that* person, but here we are.
2025-01-31 13:33:32 -08:00
728cf81a7b [tmux] Move config to XDG_CONFIG_HOME 2025-01-31 13:31:27 -08:00
a0f23a108f [git] Add aliases for restore --stage (rs) and switch --create (sc) 2025-01-31 13:31:16 -08:00
2f897bb808 [nvim] Move repeated use of vim.fn.stdpath("state") to a local 2025-01-31 13:31:16 -08:00
e0d3364d9d [nvim] Add some helpful comments to configuration.lua 2025-01-31 13:31:16 -08:00
e015132f15 [nvim] Move the textwidth back to 80 characters
I just prefer this, turns out.
2025-01-31 13:31:16 -08:00
f8c04599c5 [nvim] Treat files with a .make extension as Makefiles 2024-12-05 11:53:34 -08:00
329db6f6de [zsh] Configure ls(1) colors with environment variables instead of aliases
ls(1) on macOS and FreeBSD is the BSD version of the utility. As such it can be
configured to display directory contents in color using a command line argument
(-G) or environment variables (LSCOLORS). Using environment variables is nice
because it'll work regardless of the arguments you pass, so there's no need to
configure aliases.
2024-11-12 13:47:20 -08:00
070f8f9a71 Remove Dotfiles project
I had something in mind for this Xcode project that never panned out.
2024-11-12 13:46:59 -08:00
b644323e31 [vim] Remove some unused plugins 2024-11-12 13:32:34 -08:00
440efbf8fc [nvim] Install telescope
Add these bindings:
- find_files to ,ff
- live_grep to ,fg
- buffers to ,fb
- help_tags to ,fh
2024-11-09 08:34:10 -08:00
b233d52b6d [nvim] Factor out the map variable in keys.lua 2024-11-09 08:33:55 -08:00
7d1f5bf0cd Remove Ansible directory 2024-11-08 08:25:01 -08:00
202dfdb886 [nvim] Call addGitTopLevelDirectoryToRuntimePath after sourcing common vimrc 2024-10-09 09:50:05 -07:00
0a3dd9451a [nvim] Remove unused _addPathToRuntimePath function 2024-10-09 09:49:40 -07:00
ad6cc90afa [vim] Move vim state directory to ~/.local/state/vim 2024-10-09 09:48:16 -07:00
4c9e58e179 Create a eryn Python virtual environment in my home directory for local packages 2024-10-01 10:23:13 -07:00
cd21b15b65 [zsh] Add Python virtual environments configuration to init-env-python 2024-09-30 14:45:20 -07:00
be4d690e32 [zsh] Update all init-rc functions 2024-09-30 11:13:10 -07:00
1145ef23e1 [zsh] Move ~df to init-env-tilde-paths 2024-09-30 10:27:39 -07:00
73 changed files with 719 additions and 716 deletions

2
.gitignore vendored
View file

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

View file

@ -1,11 +0,0 @@
init: venv deps
venv: ./env/bin/pip
python3 -m venv env
deps: ./env/bin/ansible-playbook
./env/bin/pip install -r requirements.txt
freeze:
./env/bin/pip freeze > requirements.txt

View file

@ -1,53 +0,0 @@
---
- hosts: localhost
vars:
repo: https://github.com/erynofwales/dotfiles.git
local_repo: ~/.dotfiles
dotfiles:
- Xdefaults
- emacs
- emacs.d
- env
- gdbinit
- gitconfig
- gitignore
- gvimrc
- hgrc
- indent.pro
- muttrc
- nethackrc
- profile
- rc
- screenrc
nvim_conifg: ~/.config/nvim
vim_bundles:
Vundle.vim: https://github.com/gmarik/Vundle.vim.git
tasks:
- name: Pull dotfiles
git: repo={{ repo }} dest={{ local_repo }}
- name: Link dotfiles
file: src={{ local_repo }}/{{ item }} dest=~/.{{ item }} state=link
with_items: "{{ dotfiles }}"
- name: Link ~/bin
file: src={{ local_repo }}/bin dest=~/bin state=link
# Don't show last login when I open a terminal
- name: Touch .hushlogin
file: path=~/.hushlogin state=touch
# Setup neovim
- name: Create ~/.config
file: path=~/.config state=directory
- name: Symlink vim dir for neovim
file: src={{ local_repo }}/vim dest={{ nvim_config }}
- name: Symlink vimrc for neovim
file: src={{ local_repo }}/vimrc dest={{ nvim_config }}/init.vim
# Setup vim bundles
- name: Get Vim bundles
git: repo={{ item[1] }} dest={{ local_repo }}/vim/bundle/{{ item[0] }}
with_items: "{{ vim_bundles }}"
- name: Install bundles registered in vim
command: vim +PluginInstall +qall

4
Ansible/facts/dotfiles.fact Executable file
View file

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

5
Ansible/facts/xdg.fact Normal file
View file

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

9
Ansible/facts/xorg.fact Executable file
View file

@ -0,0 +1,9 @@
#!/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} }"

2
Ansible/inventory.yml Normal file
View file

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

View file

@ -1,12 +0,0 @@
---
- hosts: localhost
vars:
dotfiles: ~/.dotfiles
packages: [mutt, offlineimap, urlview, w3m]
tasks:
- name: "Install packages: {{ packages|join(', ') }}"
homebrew: name={{ packages }} state=present
- name: Link mutt config files
file: src={{ dotfiles }}/{{ item }} dest=~/.{{ item }} state=link
with_items: [muttrc, mutt]

13
Ansible/play-setup.yml Normal file
View file

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

View file

@ -1,12 +0,0 @@
ansible==8.7.0
ansible-core==2.15.12
cffi==1.17.0
cryptography==43.0.0
importlib-resources==5.0.7
Jinja2==3.1.4
MarkupSafe==2.1.5
packaging==24.1
passlib==1.7.4
pycparser==2.22
PyYAML==6.0.2
resolvelib==1.0.1

View file

@ -0,0 +1,2 @@
---
eryn_vim_plug_tag: 0.14.0

View file

@ -0,0 +1,6 @@
- name: "Rebuild local facts"
ansible.builtin.setup:
gather_subset: [ local ]
- name: "Reload Dock"
ansible.builtin.command: killall Dock

View file

@ -0,0 +1,8 @@
---
- name: "git : Symlink configs"
ansible.builtin.include_tasks: symlink_dotfile.yml
vars:
dotfile_src: "{{ item }}"
loop:
- gitconfig
- gitignore

View file

@ -0,0 +1,48 @@
---
- 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 }

View file

@ -0,0 +1,37 @@
---
- 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

View file

@ -0,0 +1,9 @@
---
- 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

View file

@ -0,0 +1,5 @@
---
- name: "macOS : log : Symlink config"
ansible.builtin.include_tasks: symlink_dotfile.yml
vars:
dotfile_src: logrc

View file

@ -0,0 +1,25 @@
---
- 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"

View file

@ -0,0 +1,16 @@
---
- 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

View file

@ -0,0 +1,5 @@
---
- name: "nethack : Symlink config"
ansible.builtin.include_tasks: symlink_dotfile.yml
vars:
dotfile_src: nethackrc

View file

@ -0,0 +1,9 @@
---
- 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) }}"

View file

@ -0,0 +1,9 @@
---
- 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) }}"

View file

@ -0,0 +1,5 @@
---
- name: "tmux : Symlink config"
ansible.builtin.include_tasks: symlink_dotfile_directory.yml
vars:
dotfile_src: config/tmux

View file

@ -0,0 +1,30 @@
---
- 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

View file

@ -0,0 +1,12 @@
---
- 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 }}"

View file

@ -0,0 +1,23 @@
---
# 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

View file

@ -0,0 +1,32 @@
---
- 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

View file

@ -1,320 +0,0 @@
// !$*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 = "<group>"; };
/* 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 = "<group>";
};
C084FC422797B3C100915D6A /* Products */ = {
isa = PBXGroup;
children = (
C084FC412797B3C100915D6A /* ShellLog */,
);
name = Products;
sourceTree = "<group>";
};
C084FC432797B3C100915D6A /* ShellLog */ = {
isa = PBXGroup;
children = (
C084FC442797B3C100915D6A /* main.swift */,
);
path = ShellLog;
sourceTree = "<group>";
};
/* 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 */;
}

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View file

@ -1,16 +0,0 @@
{
"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
}

View file

@ -1,57 +0,0 @@
//
// 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()

16
Fortune/Makefile Normal file
View file

@ -0,0 +1,16 @@
STRFILE=strfile
DATFILES=eryn.dat
.PHONY: all clean
%.dat: %
$(STRFILE) $^ $@
.PHONY: all
all: $(DATFILES)
.PHONY: clean
clean:
rm -f $(DATFILES)

16
Fortune/eryn Normal file
View file

@ -0,0 +1,16 @@
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 someones soul to heal
Walk out of your house like a shepherd.
-- Rumi, Ode 3090

View file

@ -0,0 +1,38 @@
# rust.snippets
# vim: set ts=8 sw=8 sts=8 noet list:
# Eryn Wells <eryn@erynwells.me>
snippet nnapp
// Eryn Wells <eryn@erynwells.me>
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

View file

@ -0,0 +1,4 @@
-- Eryn Wells <eryn@erynwells.me>
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2

View file

@ -0,0 +1 @@
abbr hawaii Hawaii

View file

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

View file

@ -0,0 +1,7 @@
-- Filetype detection for Makefiles
-- Eryn Wells <eryn@erynwells.me>
vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
pattern = "*.make",
command = "setfiletype make",
})

View file

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

View file

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

View file

@ -1,6 +1,6 @@
-- Eryn Wells <eryn@erynwells.me>
-- [[ Editor Confguration ]]
-- [[ Editor Configuration ]]
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 = true
opt.relativenumber = false
-- Start with ~all folds open.
opt.foldlevel = 99
@ -34,8 +34,13 @@ opt.errorbells = false
-- Wrap text rather than letting it run offscreen
opt.wrap = true
opt.linebreak = true
opt.textwidth = 120
-- Wrap to 80 characters by default
opt.textwidth = 80
-- Mark columns 80, 90, and 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")
@ -59,13 +64,14 @@ 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, and do some nice things when
-- wrapping and joining and copying.
-- spaces. Never write tabs if you can help it.
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
@ -79,9 +85,10 @@ opt.background = "dark"
opt.backup = true
opt.undofile = true
opt.backupdir = {vim.fn.stdpath("state") .. "/backup//"}
opt.directory = {vim.fn.stdpath("state") .. "/swap//", "."}
opt.undodir = {vim.fn.stdpath("state") .. "/undo//"}
local statedir = vim.fn.stdpath("state")
opt.backupdir = {statedir .. "/backup//"}
opt.directory = {statedir .. "/swap//", "."}
opt.undodir = {statedir .. "/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
@ -92,7 +99,7 @@ opt.undodir = {vim.fn.stdpath("state") .. "/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 = vim.fn.stdpath("state") .. "/shada/default.shada"
opt.shadafile = statedir .. "/shada/default.shada"
-- Scroll ahead of the point a bit in each direction
opt.scrolloff = 3

View file

@ -5,16 +5,18 @@ 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.o.guifont = "InputMonoCondensed:h16"
vim.g.neovide_input_macos_option_key_is_meta = "both"
vim.cmd [[ colorscheme dracula ]]
vim.cmd [[ colorscheme lunaperche ]]
end
function init_gui()
vim.o.guifont = "Berkeley Mono,Input Mono Condensed,SF Mono,Courier New:h18"
_init_neovide()
end

View file

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

View file

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

View file

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

View file

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

View file

@ -3,10 +3,23 @@
dotfiles_dir=$(cd "$(dirname "$0")" && pwd)
sys=`uname -s | tr A-Z a-z`
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")
skipitems=( \
'.*\.orig' \
'.*~' \
Alfred \
Ansible \
bin \
Colors \
Dotfiles \
Fortune \
LaunchAgents \
py \
Python \
README.md \
setup.sh \
Web \
Xcode \
)
function link {
local action
@ -41,6 +54,11 @@ 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"
@ -121,7 +139,10 @@ while getopts "v" arg $@; do
esac
done
python3 -m pip install --user "$dotfiles_dir/Python/eryntools"
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"
if (( $configure_vim )); then
print -P "%BConfiguring Vim%b"
@ -147,4 +168,6 @@ if (( $configure_vim )); then
$VIM +PlugInstall +qall
fi
build_fortunes
exit 0

View file

@ -25,17 +25,16 @@ 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'
Plug 'dracula/vim', {'as': 'dracula'}
if has('nvim')
" Telescope
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.8' }
" Language servers
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-nvim-lsp'

2
vimrc
View file

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

View file

@ -78,8 +78,6 @@ 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=<F1> " toggle paste mode with this
" completion menu
set wildmenu
set wildmode=longest,list

31
zsh/func/bool Normal file
View file

@ -0,0 +1,31 @@
# Eryn Wells <eryn@erynwells.me>
# 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 "$@"

View file

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

View file

@ -6,6 +6,7 @@ function init-env-path
{
path=()
update-path \
"$HOME/Website/scripts" \
"$HOME/bin" \
"$HOME/.local/bin" \
"$HOME/.cargo/bin" \

View file

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

View file

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

View file

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

View file

@ -0,0 +1,13 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
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 "$@"

View file

@ -0,0 +1,46 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
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 "$@"

View file

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

27
zsh/func/init-rc-ls Normal file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
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 "$@"

29
zsh/func/init-rc-prompt Normal file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
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 "$@"

17
zsh/func/init-rc-zle Normal file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
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 "$@"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

18
zshrc
View file

@ -2,15 +2,14 @@
zsh_init_rc_functions=( \
init_rc_fpath_darwin \
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-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-$SYS \
)
@ -22,6 +21,7 @@ fi
do_init_functions zsh_init_rc_functions
autoload -Uz bool
autoload -Uz g
autoload -Uz nethack
autoload -Uz pw