Compare commits
61 commits
ansible-al
...
main
Author | SHA1 | Date | |
---|---|---|---|
6b08decfb9 | |||
884fa0a542 | |||
aefda50590 | |||
09f0985006 | |||
71ab83d8f3 | |||
cf613b3012 | |||
196004e993 | |||
972d5f4524 | |||
e0f813182a | |||
bd05bc392a | |||
fa0e59ea39 | |||
6dc9120dd0 | |||
bb82a7ca75 | |||
f7e802d3f3 | |||
03fe14895c | |||
9d9475db78 | |||
b3394844f2 | |||
534d9a102b | |||
31215aadbf | |||
dd6a88d34f | |||
2fea369110 | |||
a87f399939 | |||
891aacb9ed | |||
89fcc479db | |||
6bf81515f6 | |||
687083bf31 | |||
29fdc610bb | |||
4bd546e649 | |||
e8d08af807 | |||
2db42121c9 | |||
7c8d97c25e | |||
73ca945487 | |||
41dc68869a | |||
47a797d6e3 | |||
b8aac0793e | |||
9005e00e4e | |||
cc42c50438 | |||
0839618327 | |||
d022b579d2 | |||
baed6171dc | |||
72896c3feb | |||
be6b93cdde | |||
728cf81a7b | |||
a0f23a108f | |||
2f897bb808 | |||
e0d3364d9d | |||
e015132f15 | |||
f8c04599c5 | |||
329db6f6de | |||
070f8f9a71 | |||
b644323e31 | |||
440efbf8fc | |||
b233d52b6d | |||
7d1f5bf0cd | |||
202dfdb886 | |||
0a3dd9451a | |||
ad6cc90afa | |||
4c9e58e179 | |||
cd21b15b65 | |||
be4d690e32 | |||
1145ef23e1 |
73 changed files with 719 additions and 716 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -32,3 +32,5 @@ vim/backup/
|
|||
zsh/cache/
|
||||
|
||||
Ansible/*.retry
|
||||
|
||||
Fortune/*.dat
|
||||
|
|
|
@ -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
|
|
@ -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
4
Ansible/facts/dotfiles.fact
Executable 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
5
Ansible/facts/xdg.fact
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"config_home": "~/.config",
|
||||
"data_home": "~/.local/share",
|
||||
"state_home": "~/.local/state"
|
||||
}
|
9
Ansible/facts/xorg.fact
Executable file
9
Ansible/facts/xorg.fact
Executable 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
2
Ansible/inventory.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
all:
|
||||
localhost:
|
|
@ -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
13
Ansible/play-setup.yml
Normal 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
|
|
@ -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
|
2
Ansible/roles/eryn/defaults/main.yml
Normal file
2
Ansible/roles/eryn/defaults/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
eryn_vim_plug_tag: 0.14.0
|
6
Ansible/roles/eryn/handlers/main.yml
Normal file
6
Ansible/roles/eryn/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
- name: "Rebuild local facts"
|
||||
ansible.builtin.setup:
|
||||
gather_subset: [ local ]
|
||||
|
||||
- name: "Reload Dock"
|
||||
ansible.builtin.command: killall Dock
|
8
Ansible/roles/eryn/tasks/git.yml
Normal file
8
Ansible/roles/eryn/tasks/git.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
- name: "git : Symlink configs"
|
||||
ansible.builtin.include_tasks: symlink_dotfile.yml
|
||||
vars:
|
||||
dotfile_src: "{{ item }}"
|
||||
loop:
|
||||
- gitconfig
|
||||
- gitignore
|
48
Ansible/roles/eryn/tasks/macos/defaults.yml
Normal file
48
Ansible/roles/eryn/tasks/macos/defaults.yml
Normal 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 }
|
37
Ansible/roles/eryn/tasks/macos/homebrew.yml
Normal file
37
Ansible/roles/eryn/tasks/macos/homebrew.yml
Normal 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
|
9
Ansible/roles/eryn/tasks/macos/main.yml
Normal file
9
Ansible/roles/eryn/tasks/macos/main.yml
Normal 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
|
5
Ansible/roles/eryn/tasks/macos/system-log.yml
Normal file
5
Ansible/roles/eryn/tasks/macos/system-log.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: "macOS : log : Symlink config"
|
||||
ansible.builtin.include_tasks: symlink_dotfile.yml
|
||||
vars:
|
||||
dotfile_src: logrc
|
25
Ansible/roles/eryn/tasks/main.yml
Normal file
25
Ansible/roles/eryn/tasks/main.yml
Normal 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"
|
16
Ansible/roles/eryn/tasks/neovim.yml
Normal file
16
Ansible/roles/eryn/tasks/neovim.yml
Normal 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
|
5
Ansible/roles/eryn/tasks/nethack.yml
Normal file
5
Ansible/roles/eryn/tasks/nethack.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: "nethack : Symlink config"
|
||||
ansible.builtin.include_tasks: symlink_dotfile.yml
|
||||
vars:
|
||||
dotfile_src: nethackrc
|
9
Ansible/roles/eryn/tasks/symlink_dotfile.yml
Normal file
9
Ansible/roles/eryn/tasks/symlink_dotfile.yml
Normal 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) }}"
|
9
Ansible/roles/eryn/tasks/symlink_dotfile_directory.yml
Normal file
9
Ansible/roles/eryn/tasks/symlink_dotfile_directory.yml
Normal 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) }}"
|
5
Ansible/roles/eryn/tasks/tmux.yml
Normal file
5
Ansible/roles/eryn/tasks/tmux.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: "tmux : Symlink config"
|
||||
ansible.builtin.include_tasks: symlink_dotfile_directory.yml
|
||||
vars:
|
||||
dotfile_src: config/tmux
|
30
Ansible/roles/eryn/tasks/vim.yml
Normal file
30
Ansible/roles/eryn/tasks/vim.yml
Normal 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
|
12
Ansible/roles/eryn/tasks/xdg_home.yml
Normal file
12
Ansible/roles/eryn/tasks/xdg_home.yml
Normal 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 }}"
|
||||
|
23
Ansible/roles/eryn/tasks/xorg.yml
Normal file
23
Ansible/roles/eryn/tasks/xorg.yml
Normal 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
|
32
Ansible/roles/eryn/tasks/zsh.yml
Normal file
32
Ansible/roles/eryn/tasks/zsh.yml
Normal 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
|
|
@ -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 */;
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
|
@ -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>
|
|
@ -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
|
||||
}
|
|
@ -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
16
Fortune/Makefile
Normal 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
16
Fortune/eryn
Normal 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 someone’s soul to heal
|
||||
Walk out of your house like a shepherd.
|
||||
-- Rumi, Ode 3090
|
38
config/nvim/UltiSnips/rust.snippets
Normal file
38
config/nvim/UltiSnips/rust.snippets
Normal 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
|
4
config/nvim/after/ftplugin/html.lua
Normal file
4
config/nvim/after/ftplugin/html.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
-- Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.softtabstop = 2
|
1
config/nvim/after/ftplugin/text.vim
Normal file
1
config/nvim/after/ftplugin/text.vim
Normal file
|
@ -0,0 +1 @@
|
|||
abbr hawaii Hawai‘i
|
|
@ -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 = {
|
||||
|
|
7
config/nvim/ftdetect/make.lua
Normal file
7
config/nvim/ftdetect/make.lua
Normal 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",
|
||||
})
|
|
@ -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()
|
||||
|
|
|
@ -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 ]]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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 = {
|
||||
"--",
|
||||
|
|
|
@ -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
|
|
@ -61,6 +61,8 @@
|
|||
f = fetch
|
||||
sup = submodule update --recursive
|
||||
really-clean = clean -fd
|
||||
rs = restore --stage
|
||||
sc = switch --create
|
||||
[ui]
|
||||
color = true
|
||||
[diff]
|
||||
|
|
33
setup.sh
33
setup.sh
|
@ -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
|
||||
|
|
|
@ -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
2
vimrc
|
@ -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
|
||||
|
|
|
@ -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
31
zsh/func/bool
Normal 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 "$@"
|
|
@ -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 "$@"
|
||||
|
|
|
@ -6,6 +6,7 @@ function init-env-path
|
|||
{
|
||||
path=()
|
||||
update-path \
|
||||
"$HOME/Website/scripts" \
|
||||
"$HOME/bin" \
|
||||
"$HOME/.local/bin" \
|
||||
"$HOME/.cargo/bin" \
|
||||
|
|
|
@ -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 "$@"
|
||||
|
|
|
@ -15,6 +15,8 @@ function init-env-tilde-paths
|
|||
c="$candidate_code_path"
|
||||
break
|
||||
done
|
||||
|
||||
export df=~/.dotfiles
|
||||
}
|
||||
|
||||
init-env-tilde-paths "$@"
|
||||
|
|
|
@ -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 "$@"
|
13
zsh/func/init-rc-app-environments
Normal file
13
zsh/func/init-rc-app-environments
Normal 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 "$@"
|
46
zsh/func/init-rc-completion
Normal file
46
zsh/func/init-rc-completion
Normal 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 "$@"
|
|
@ -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
27
zsh/func/init-rc-ls
Normal 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
29
zsh/func/init-rc-prompt
Normal 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
17
zsh/func/init-rc-zle
Normal 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 "$@"
|
|
@ -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 "$@"
|
|
@ -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 "$@"
|
|
@ -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 "$@"
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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"
|
|
@ -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
18
zshrc
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue