96 Commits

Author SHA1 Message Date
ee7854eafc feat: Playing around with lazy-nvim and reworking my nvim config 2024-12-19 22:40:55 -05:00
ef961fcfa8 feat: Initial lazy nvim 2024-12-19 17:59:15 -05:00
6d44edc94d feat: Trying blink.cmp for completions, luasnips not playing nicely yet. 2024-12-19 17:20:06 -05:00
381d272da1 feat: Updates nvim scroll-off setting 2024-12-19 11:24:34 -05:00
38e77e8fcd feat: Trying blink.cmp for completions. 2024-12-19 11:20:54 -05:00
2a5c2cdc58 feat: Updates wezterm fps 2024-12-19 11:02:03 -05:00
0949f9e9fa feat: Adds local completions to zsh fpath 2024-12-17 14:21:49 -05:00
2c7bd9123f feat: Adds go to references to lsp config 2024-12-17 08:28:41 -05:00
f325d61131 feat: Updates tmux-sessionator to also open yazi in a 3rd window. 2024-12-15 19:24:48 -05:00
ae13738a4d feat: Updates tmux-sessionator to also create session properly when tmux isn't running. 2024-12-15 19:16:40 -05:00
6c84428179 feat: Updates nvim, fidget and removes neo-dev. 2024-12-15 18:52:28 -05:00
d27f2ad490 feat: LSP updates 2024-12-11 18:07:18 -05:00
ea7033bea8 feat: Adds yazi configuration to show hidden files and symlinks. 2024-12-09 12:27:09 -05:00
a835414bd1 feat: adds yazi config 2024-12-04 07:56:45 -05:00
82341d87df feat: Updates tmux-sessionator to accept a directory option and updates tns function to use that option. 2024-12-03 08:56:56 -05:00
9e48ba0a77 feat: Updates tmux-sessionator how it spawns the editor window so it doesn't kill the pane on exit. 2024-12-03 08:21:00 -05:00
3518ba059f feat: adds swift aliases. 2024-12-02 15:52:31 -05:00
c8e869c853 feat: Updates to zshrc and ansible config. 2024-12-02 08:19:59 -05:00
b1633707c2 feat: Updates to zsh env 2024-11-27 14:42:03 -05:00
5f45954d98 feat: Renames vault-gopass to vault-gopass-client 2024-11-27 10:03:41 -05:00
4fb2b70004 fix: Fixes ansible config and environment variables to utilize the vault-gopass-client file 2024-11-27 10:02:12 -05:00
a86116056f feat: Edits ansible config to use the vault-gopass script 2024-11-27 08:54:38 -05:00
f43cd2c543 feat: Finishes vault-gopass script 2024-11-27 08:47:45 -05:00
48d0e16f6a feat: Begins vault-gopass script 2024-11-27 07:53:26 -05:00
27d66acb6e feat: Adds tks alias to kill tmux session. 2024-11-26 18:16:44 -05:00
af77a986e2 feat: Adds moving to next and previous tmux windows using Alt-h or Alt-l 2024-11-25 09:16:07 -05:00
1dd7460ac4 feat: Adds <c-v> key binding to oil.nvim, also new spelling words 2024-11-24 21:29:15 -05:00
3badd6a046 fix: Fixes filetype plugins for nvim. 2024-11-23 15:26:33 -05:00
0a9e065b4d fix: Fixes some keymap collisions in nvim 2024-11-23 08:26:26 -05:00
8ac60b4196 feat: Adds note about keeping nvim settings at top of init.lua 2024-11-22 12:43:29 -05:00
7f26013d1c feat: Remove colliding keymaps between trouble.nvim and todo-comments.nvim, needs attention in the future 2024-11-22 12:08:11 -05:00
42cef6e0c4 feat: Adds more todo keymaps. 2024-11-22 12:02:10 -05:00
241c43767c feat: Update nvim-cmp and nvim spell 2024-11-22 09:06:16 -05:00
4b39a3eb95 feat: Adds highlight when yank in nvim config. 2024-11-21 22:40:48 -05:00
1e427911ac feat: Updates nvim-cmp 2024-11-21 21:21:28 -05:00
0c15983dae fix: tmux config 2024-11-21 19:45:14 -05:00
68d3f5a183 feat: Removes toggle terminal keymap that conflicts with trouble 2024-11-20 22:50:00 -05:00
d9ea8d80c6 fix: Fix merge conflicts 2024-11-20 22:07:02 -05:00
eed9c143ea feat: Updates zsh tns (tmux new session) function 2024-11-20 08:18:35 -05:00
d06648864e feat: Updates zsh config 2024-11-20 08:07:12 -05:00
9bb33cfaee feat: cleans up tmux config and updates to tmux-sessionator 2024-11-19 09:16:32 -05:00
917ac3ff2a feat: Updates to tmux config 2024-11-18 22:55:15 -05:00
23bd867430 feat: nvim config updates 2024-11-18 17:16:17 -05:00
2e3c750979 feat: Updates to nvim config and snippets 2024-11-18 08:33:38 -05:00
eff01f42fd feat: Working on snippets for nvim 2024-11-17 14:52:30 -05:00
8a17c5ad80 feat: Adds oil.nvim and removes neo-tree 2024-11-17 09:00:59 -05:00
d8891e40fc feat: More nvim plugins and changes, better xcodebuild experience. 2024-11-16 23:43:40 -05:00
f6f45a8c58 feat: Updates plugins for nvim 2024-11-16 11:38:43 -05:00
3b75e6e918 feat: Adds xcodebuild nvim plugin 2024-11-16 01:56:14 -05:00
2813d5b56d feat: Adds xcodebuild nvim plugin 2024-11-16 01:47:09 -05:00
b3476a4af2 feat: Updates git config 2024-11-14 17:52:30 -05:00
49524fef66 feat: Updates to nvim config and git config 2024-11-14 16:26:35 -05:00
15eedbfd1e feat: Updates to nvim config 2024-11-13 10:29:40 -05:00
365baec18a feat: Adds more keymaps to harpoon nvim config 2024-11-11 10:45:50 -05:00
051a418d0b fix: Fixes moving lines up and down in nvim keymaps 2024-11-10 11:25:22 -05:00
f7484147f7 feat: Adds harpoon to nvim 2024-11-10 09:39:09 -05:00
2334f33cdb feat: Cleanup some nvim config 2024-11-07 21:44:00 -05:00
33c011067f feat: Adds nvim-lint configuration and swiftformat 2024-11-07 17:11:05 -05:00
2d687e8c61 feat: Updates command timeout in starship configuration 2024-11-07 10:07:16 -05:00
377f5849f7 feat: Adds hvac-iot repos variables 2024-11-07 10:03:08 -05:00
37d8e4c678 feat: Updates tmux-sessionator path to use nas 2024-11-07 09:58:21 -05:00
edf62341df feat: Updates nvim lsp config 2024-11-06 18:01:34 -05:00
9f9854e9d5 feat: Begins fixes for lsp errors in nvim config 2024-11-06 17:08:26 -05:00
ef45abdd16 feat: Updates ssh config 2024-11-06 09:10:58 -05:00
23c4afabbc feat: Updates gopass config 2024-10-30 13:20:48 -04:00
329589612b feat: Fixes ssh config encryption 2024-10-21 16:35:07 -04:00
87b901f6c0 feat: Updates todos 2024-09-23 09:13:41 -04:00
c0c5e92184 feat: Update tmux config fixes catppucin warning 2024-09-23 08:44:48 -04:00
728c77a2d2 feat: Update nvim config for ts_ls name 2024-09-23 08:42:18 -04:00
319a63ddcc Updates ssh config 2024-06-14 09:55:37 -04:00
6a6c6ace8a Updates git credential helper. 2024-06-14 08:32:51 -04:00
4dbd2864c1 feat: Adds fzf-tab plugin 2024-05-16 18:50:24 -04:00
7b75cca4d7 feat: Adds fzf to shell searches / history 2024-05-16 18:43:38 -04:00
be1ab62d8f feat: Adds fzf to shell searches / history 2024-05-16 18:36:49 -04:00
a379a9ce60 Fix background colors on prompt when ssh 2024-04-24 21:04:52 -04:00
3c172a4597 Adds hostname to zsh prompt when ssh 2024-04-24 20:55:57 -04:00
3f91ec849d Adds karabiner 2024-04-17 21:57:16 -04:00
326ce37b02 Fixes some lsp / cmp errors in nvim 2024-04-15 16:58:44 -04:00
54b6377407 Adds gopass config 2024-04-13 19:10:16 -04:00
61258c8a32 Adds raycast config export from my macbook-pro 2024-04-13 18:32:57 -04:00
ffcb53f6e2 Update .zshenv to source local env if it exists 2024-04-08 21:42:21 -04:00
9c6d5a1e91 Fixes broken tmux-sessionator-path on mymini 2024-04-08 10:13:38 -04:00
a344d29ca4 Updates starship config 2024-04-08 09:38:36 -04:00
a70e1a70b4 Updates colors in starship config 2024-04-07 16:24:07 -04:00
53bad22017 Adds starship configuration 2024-04-07 16:17:38 -04:00
8a9a378f18 Updates to nvim to harden for gopass 2024-04-07 00:07:45 -04:00
65e8de5b75 Adds raycast pass-attribute script 2024-04-06 12:43:37 -04:00
b860ff8858 Adds raycast scripts directory and pass-copy command. 2024-04-06 11:03:50 -04:00
6e33524859 Failed with auto-commit launchd service because gpg signing 2024-04-05 15:39:51 -04:00
6599d90e39 Fixes some errors since moving xdg_data_home 2024-04-05 13:02:06 -04:00
6158763985 Fixes XDG_DATA_HOME directory 2024-04-05 12:37:57 -04:00
9b8e30bde3 Adds pgc alias to get an attribute of a password file and copy to clipboard 2024-04-05 12:15:05 -04:00
094a77c22e Adds pass word store aliases to zshrc 2024-04-05 09:47:20 -04:00
91e05a1345 Enables password store extensions 2024-04-04 12:20:55 -04:00
d9445d4e89 Adds gpg-tty to fix broken prompt for password 2024-04-02 22:15:50 -04:00
87594a5d96 Adds gpg-tui config 2024-04-02 22:14:39 -04:00
93 changed files with 7921 additions and 1200 deletions

View File

@@ -4,3 +4,4 @@
- Add tmux plugins to dots cli manager. - Add tmux plugins to dots cli manager.
- Add tmux-powerline linking to `dots` cli manager. - Add tmux-powerline linking to `dots` cli manager.
- Clean up zet commands, maybe make a gum / fzf filter script. - Clean up zet commands, maybe make a gum / fzf filter script.
- Update README to reflect ansible installation

View File

@@ -161,7 +161,7 @@ home=~/.config/ansible
;bin_ansible_callbacks=False ;bin_ansible_callbacks=False
# (tmppath) Temporary directory for Ansible to use on the controller. # (tmppath) Temporary directory for Ansible to use on the controller.
local_tmp=~/.local/ansible/tmp local_tmp=~/.local/share/ansible/tmp
# (list) List of logger names to filter out of the log file # (list) List of logger names to filter out of the log file
;log_filter= ;log_filter=
@@ -261,10 +261,10 @@ roles_path={{ ANSIBLE_HOME ~ "~/.local/ansible/roles:/roles:/usr/share/ansible/r
;vars_plugins={{ ANSIBLE_HOME ~ "/plugins/vars:/usr/share/ansible/plugins/vars" }} ;vars_plugins={{ ANSIBLE_HOME ~ "/plugins/vars:/usr/share/ansible/plugins/vars" }}
# (string) The vault_id to use for encrypting by default. If multiple vault_ids are provided, this specifies which to use for encryption. The --encrypt-vault-id cli option overrides the configured value. # (string) The vault_id to use for encrypting by default. If multiple vault_ids are provided, this specifies which to use for encryption. The --encrypt-vault-id cli option overrides the configured value.
;vault_encrypt_identity= vault_encrypt_identity=michael
# (string) The label to use for the default vault id label in cases where a vault id label is not provided # (string) The label to use for the default vault id label in cases where a vault id label is not provided
;vault_identity=default vault_identity=michael
# (list) A list of vault-ids to use by default. Equivalent to multiple --vault-id args. Vault-ids are tried in order. # (list) A list of vault-ids to use by default. Equivalent to multiple --vault-id args. Vault-ids are tried in order.
;vault_identity_list= ;vault_identity_list=
@@ -274,7 +274,7 @@ roles_path={{ ANSIBLE_HOME ~ "~/.local/ansible/roles:/roles:/usr/share/ansible/r
# (path) The vault password file to use. Equivalent to --vault-password-file or --vault-id # (path) The vault password file to use. Equivalent to --vault-password-file or --vault-id
# If executable, it will be run and the resulting stdout will be used as the password. # If executable, it will be run and the resulting stdout will be used as the password.
vault_password_file=~/.local/ansible/.vaultpwd vault_password_file=~/.local/share/scripts/vault-gopass-client
# (integer) Sets the default verbosity, equivalent to the number of ``-v`` passed in the command line. # (integer) Sets the default verbosity, equivalent to the number of ``-v`` passed in the command line.
;verbosity=0 ;verbosity=0
@@ -982,4 +982,3 @@ cache_dir=~/.cache/ansible
# Setting this option to V(inventory) will only run the vars plugin after parsing inventory. # Setting this option to V(inventory) will only run the vars plugin after parsing inventory.
# If this option is omitted, the global C(RUN_VARS_PLUGINS) configuration is used to determine when to execute the vars plugin. # If this option is omitted, the global C(RUN_VARS_PLUGINS) configuration is used to determine when to execute the vars plugin.
;stage= ;stage=

View File

@@ -0,0 +1,14 @@
## Actually All Emojis
An up-to-date package for [espanso](https://espanso.org/) which provides triggers for all emojis (`v14.0`). Emojis and codes fetched from [Unicode.org](https://unicode.org/emoji/charts/full-emoji-list.html)
### Usage
To use this package, just type the name of the emoji between two colons. For example, to use the `smile` emoji 😄, you can type: `:smile:`
A full list of emojis and their CLDR Short Names can be found [here](https://unicode.org/emoji/charts/full-emoji-list.html)
**Note**: There are two options for this package. One with spaces between words, and one with underscores. This version uses _spaces_
For example `:kissing face:`
To install the version with underscores use `actually-all-emojis`

View File

@@ -0,0 +1,7 @@
author: Jobie Wong
description: An updated package providing all v.14 emojis - fetched from unicode.org
name: actually-all-emojis-spaces
title: Actually All Emojis (Spaces)
version: 0.1.0
homepage: "https://github.com/jobiewong/espanso-emojis"
tags: ["emoji", "chat"]

View File

@@ -0,0 +1,2 @@
---
hub

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
[core] [core]
excludesfile = ~/.config/git/gitignore excludesfile = ~/.config/git/gitignore
ignorecasse = false
[init] [init]
defaultBranch = main defaultBranch = main
[user] [user]
@@ -19,3 +20,10 @@
smudge = git-lfs smudge -- %f smudge = git-lfs smudge -- %f
process = git-lfs filter-process process = git-lfs filter-process
required = true required = true
[credential]
helper = gopass
[credential "https://git.housh.dev"]
username = michael
[push]
autoSetupRemote = true

6
gopass/config Normal file
View File

@@ -0,0 +1,6 @@
[mounts]
path = /Users/michael/.local/share/password-store
[recipients]
hash = 3199e2acda60d6f17a15882ba11749feda9775cf848554c8f04f12bc84521fd3
[mounts "servers"]
path = /Users/michael/.local/share/gopass/stores/servers

32
gpg-tui/gpg-tui.toml Normal file
View File

@@ -0,0 +1,32 @@
[general]
splash = false
tick_rate = 250
color = "gray"
style = "colored"
file_explorer = "xplr"
detail_level = "minimum"
# log_file = "test"
# key_bindings = [
# { keys = [ "?" ], command = ":help" },
# { keys = [ "o" ], command = ":options" },
# { keys = [ "n" ], command = ":normal" },
# { keys = [ "v" ], command = ":visual" },
# { keys = [ "c" ], command = ":copy" },
# { keys = [ "p", "C-v" ], command = ":paste" },
# { keys = [ "x" ], command = ":export" },
# { keys = [ "s" ], command = ":set prompt :sign" },
# { keys = [ "e" ], command = ":set prompt :edit" },
# { keys = [ "i" ], command = ":set prompt :import"},
# { keys = [ "f" ], command = ":set prompt :receive" },
# { keys = [ "u" ], command = ":set prompt :send" },
# { keys = [ "g" ], command = ":generate" },
# { keys = [ "d", "backspace" ], command = ":delete" },
# { keys = [ "C-r" ], command = ":refresh" },
# ]
[gpg]
armor = false
homedir = "~/.gnupg"
outdir = "~/.gnupg/out"
# outfile = "{type}_{query}.{ext}"
# default_key = "0xA1B2C3XY"

View File

@@ -0,0 +1,202 @@
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": []
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"game_pad_swap_sticks": false,
"identifiers": {
"is_game_pad": false,
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 834,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"mouse_flip_horizontal_wheel": false,
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheels": false,
"mouse_swap_xy": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"game_pad_swap_sticks": false,
"identifiers": {
"is_game_pad": false,
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 834,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"mouse_flip_horizontal_wheel": false,
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheels": false,
"mouse_swap_xy": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}

240
karabiner/karabiner.json Normal file
View File

@@ -0,0 +1,240 @@
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"manipulators": [
{
"description": "Change caps_lock to command+control+option+shift.",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_command",
"left_control",
"left_option"
]
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"game_pad_swap_sticks": false,
"identifiers": {
"is_game_pad": false,
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 834,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"mouse_flip_horizontal_wheel": false,
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheels": false,
"mouse_swap_xy": false,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": [
{
"key_code": "left_control"
}
]
}
],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"game_pad_swap_sticks": false,
"identifiers": {
"is_game_pad": false,
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 834,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"mouse_flip_horizontal_wheel": false,
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheels": false,
"mouse_swap_xy": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}

View File

@@ -0,0 +1,31 @@
<?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>Label</key>
<string>com.micheal.dotfiles.commit</string>
<key>WorkingDirectory</key>
<string>/Users/michael/.dotfiles</string>
<key>ProgramArguments</key>
<array>
<string>/Users/michael/.local/share/scripts/auto-git-commit</string>
</array>
<key>StartInterval</key>
<integer>3600</integer>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/com.michael.dotfiles.commit.log</string>
<key>StandardErrorPath</key>
<string>/tmp/com.michael.dotfiles.commit.error.log</string>
</dict>
</plist>

8
nvim/lazynvim/.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
tt.*
.tests
doc/tags
debug
.repro
foo.*
*.log
data

View File

@@ -0,0 +1,15 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

201
nvim/lazynvim/LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

4
nvim/lazynvim/README.md Normal file
View File

@@ -0,0 +1,4 @@
# 💤 LazyVim
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.

View File

@@ -0,0 +1,20 @@
-- Markdown specific key maps.
--
local todos = require("todo-comments")
local keywords = { "WARN", "WARNING", "IMPORTANT" }
-- Show all the warnings in the quick fix list.
vim.keymap.set(
"n",
"<leader>tw",
"<CMD>Trouble todo toggle filter = {tag = {WARN, IMPORTANT}}<CR>",
{ desc = "[T]odo [W]arnings" }
)
vim.keymap.set("n", "]w", function()
todos.jump_next({ keywords = keywords })
end, { desc = "Next [W]arning" })
vim.keymap.set("n", "[w", function()
todos.jump_prev({ keywords = keywords })
end, { desc = "Previous [W]arning" })

View File

@@ -0,0 +1,2 @@
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2

2
nvim/lazynvim/init.lua Normal file
View File

@@ -0,0 +1,2 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")

View File

@@ -0,0 +1,14 @@
{
"extras": [
"lazyvim.plugins.extras.coding.luasnip",
"lazyvim.plugins.extras.editor.harpoon2",
"lazyvim.plugins.extras.formatting.prettier",
"lazyvim.plugins.extras.lang.ansible",
"lazyvim.plugins.extras.lang.clangd",
"lazyvim.plugins.extras.lang.docker"
],
"news": {
"NEWS.md": "10960"
},
"version": 7
}

View File

@@ -0,0 +1,50 @@
local defaultGroupOptions = { clear = true }
local markdownGroup = vim.api.nvim_create_augroup("MyMarkdownGroup", defaultGroupOptions)
local spellGroup = vim.api.nvim_create_augroup("SpellGroup", defaultGroupOptions)
local createCmd = vim.api.nvim_create_autocmd
-- Spell check
createCmd("BufEnter", {
pattern = { "*.md", "*.markdown", "*.txt", "*.tex" },
group = spellGroup,
callback = function(_)
vim.cmd.setlocal("textwidth=80")
vim.cmd.setlocal("spell spelllang=en_us")
end,
})
-- Markdown
createCmd("BufWritePost", {
pattern = { "*.md", "*.markdown" },
group = markdownGroup,
callback = function(_)
local cursor = vim.fn.getpos(".")
vim.cmd("FormatWrite")
vim.fn.setpos(".", cursor)
end,
})
-- Go
createCmd("BufWritePre", {
pattern = "*.go",
callback = function()
require("go.format").goimport()
end,
group = vim.api.nvim_create_augroup("GoFormat", defaultGroupOptions),
})
vim.api.nvim_exec2(
[[
autocmd BufNewFile,BufRead /private/**/gopass** setlocal noswapfile nobackup noundofile shada=""
]],
{}
)
-- Highlight when yanking.
createCmd("TextYankPost", {
desc = "Highlight when yanking text.",
group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})

View File

@@ -0,0 +1,46 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
local keymap = vim.keymap.set
local default_options = { noremap = true, silent = true }
local wk = require("which-key")
local wk_add = function(mode, keymaps)
wk.add(keymaps, { mode = mode, silent = true })
end
keymap("i", "jk", "<ESC>", default_options)
--------------------------------------------------------------------------------
-- Normal Mode
--------------------------------------------------------------------------------
wk_add("n", {
{ "<Left>", ":vertical resize +1<CR>", desc = "Resize Pane Left" },
{ "<Right>", ":vertical resize -1<CR>", desc = "Resize Pane Right" },
{ "<Up>", "resize -1<CR>", desc = "Resize Pane Up" },
{ "<Down>", "resize +1<CR>", desc = "Resize Pane Down" },
{ "<leader>n", "<CMD>:noh<CR>", desc = "[N]o highlighting" },
{ "<leader>s", "<CMD>:set spell!<CR>", desc = "[S]pell check toggle" },
{ "<C-s>", "<CMD>:write<CR>", desc = "[S]ave" },
{ "J", ":move .+1<CR>==", desc = "Move line down" },
{ "K", ":move .-2<CR>==", desc = "Move line up" },
{ "<leader>z", "<CMD>:ZenMode<CR>", desc = "[Z]en Mode" },
})
--------------------------------------------------------------------------------
-- Visual Mode
--------------------------------------------------------------------------------
vim.keymap.set("v", "K", ":move '<-2<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
vim.keymap.set("v", "J", ":move '>+1<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
-- Toggle term key maps, that get attached when terminal is opened.
function _G.set_terminal_keymaps()
local opts = { buffer = 0 }
keymap("t", "<esc>", [[<C-\><C-n>]], opts)
end
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")

View File

@@ -0,0 +1,53 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true, -- check for plugin updates periodically
notify = false, -- notify on update
}, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View File

@@ -0,0 +1,72 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
--
local o = vim.opt
local wo = vim.wo
local fn = vim.fn
vim.cmd.set("inccommand=split")
o.filetype = "on"
o.updatetime = 500 -- faster completion
o.timeoutlen = 800 -- time to wait for a mapped sequence to complete (in milliseconds)
o.ttimeoutlen = 300 -- Time in milliseconds to wait for a key code sequence to complete
o.backup = false -- creates a backup file
o.swapfile = false -- enable/disable swap file creation
o.dir = fn.stdpath("data") .. "/swp" -- swap file directory
o.undofile = false -- enable/disable undo file creation
o.undodir = fn.stdpath("data") .. "/undodir" -- set undo directory
o.history = 500 -- Use the 'history' option to set the number of lines from command mode that are remembered.
o.hidden = true -- required to keep multiple buffers and open multiple buffers
o.clipboard = "unnamedplus" -- allows neovim to access the system clipboard
o.fileencoding = "utf-8" -- the encoding written to a file
o.conceallevel = 0 -- so that `` is visible in markdown files
o.number = true -- set numbered lines
o.relativenumber = true -- set relative numbered lines
o.cmdheight = 1 -- space for displaying messages/commands
o.showmode = false -- we don't need to see things like -- INSERT -- anymore
o.showtabline = 2 -- always show tabs
o.laststatus = 2 -- The value of this option influences when the last window will have a status line (2 always)
o.smartcase = true -- smart case
o.smartindent = true -- make indenting smarter again
o.splitbelow = true -- force all horizontal splits to go below current window
o.splitright = true -- force all vertical splits to go to the right of current window
o.autoindent = true -- turn on auto indent.
o.expandtab = true -- convert tabs to spaces
o.smarttab = true -- turn on smart tab
o.shiftwidth = 2 -- the number of spaces inserted for each indentation
o.tabstop = 2 -- how many columns a tab counts for
o.termguicolors = true -- set term gui colors (most terminals support this)
o.cursorline = true -- highlight the current line
o.scrolloff = 20 -- Minimal number of screen lines to keep above and below the cursor
o.sidescrolloff = 5 -- The minimal number of columns to scroll horizontally
o.hlsearch = false -- highlight all matches on previous search pattern
o.ignorecase = true -- ignore case in search patterns
o.foldenable = false -- disable folding; enable with zi
o.foldmethod = "expr"
o.foldexpr = "nvim_treesitter#foldexpr()"
vim.cmd.set("nolist") -- don't show listchars.
-- o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<"
o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣"
o.shortmess = o.shortmess + "c" -- prevent "pattern not found" messages
wo.colorcolumn = "99999"
o.wildmode = "full"
o.lazyredraw = false -- do not redraw screen while running macros
o.grepprg = "rg --hidden --vimgrep --smart-case --"
o.completeopt = { "menu", "menuone", "noselect", "noinsert" } -- A comma separated list of options for Insert mode completion
o.wildignorecase = true -- When set case is ignored when completing file names and directories
o.wildignore = [[
.git,.hg,.svn
*.aux,*.out,*.toc
*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
*.mp3,*.oga,*.ogg,*.wav,*.flac
*.eot,*.otf,*.ttf,*.woff
*.doc,*.pdf,*.cbr,*.cbz
*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
*.swp,.lock,.DS_Store,._*
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
]]
o.viminfo = "" -- disable viminfo from copying information from current session, for security.
vim.g.snacks_animate = false

View File

@@ -0,0 +1,9 @@
return {
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
{
"LazyVim/LazyVim",
opts = {
colorscheme = "catppuccin",
},
},
}

View File

@@ -0,0 +1,3 @@
return {
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
}

View File

@@ -0,0 +1,23 @@
return {
"j-hui/fidget.nvim",
event = "VeryLazy",
config = function()
local fidget = require("fidget")
fidget.setup({
notification = {
window = {
normal_hl = "String", -- Base highlight group in the notification window
winblend = 0, -- Background color opacity in the notification window
border = "rounded", -- Border around the notification window
zindex = 45, -- Stacking priority of the notification window
max_width = 0, -- Maximum width of the notification window
max_height = 0, -- Maximum height of the notification window
x_padding = 1, -- Padding from right edge of window boundary
y_padding = 1, -- Padding from bottom edge of window boundary
align = "bottom", -- How to align the notification window
relative = "editor", -- What the notification window position is relative to
},
},
})
end,
}

View File

@@ -0,0 +1,23 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
lua = { "stulua" },
markdown = {
"prettier",
prepend_args = {
"--print-width",
"100",
"--prose-wrap",
"always",
"--parser",
"markdown",
},
},
swift = { "swiftformat" },
-- ["*"] = {
-- require("formatter.filetypes.any").remove_trailing_whitespace,
-- },
},
},
}

View File

@@ -0,0 +1,78 @@
return {
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
opts = {
settings = {
save_on_toggle = true,
sync_on_ui_close = true,
},
},
keys = {
{
"<C-e>",
function()
require("harpoon").ui:toggle_quick_menu(require("harpoon"):list())
end,
desc = "Open Harpoon window.",
},
{
"<leader>a",
function()
require("harpoon"):list():add()
end,
desc = "[A]dd to the harpoon list.",
},
{
"<A-y>",
function()
require("harpoon"):list():select(1)
end,
desc = "Select first harpoon buffer.",
},
{
"<A-u>",
function()
require("harpoon"):list():select(2)
end,
desc = "Select second harpoon buffer.",
},
{
"<A-i>",
function()
require("harpoon"):list():select(3)
end,
desc = "Select third harpoon buffer.",
},
{
"<A-o>",
function()
require("harpoon"):list():select(4)
end,
desc = "Select fourth harpoon buffer.",
},
{
"<C-[>",
function()
require("harpoon"):list():prev()
end,
desc = "Previous harpoon buffer.",
},
{
"<C-]>",
function()
require("harpoon"):list():next()
end,
desc = "Next harpoon buffer.",
},
-- Extensions
require("harpoon"):extend({
UI_CREATE = function(cx)
vim.keymap.set("n", "<C-v>", function()
require("harpoon").ui:select_menu_item({ vsplit = true })
end, { buffer = cx.buffer, desc = "Open in [V]split" })
end,
}),
},
},
}

View File

@@ -0,0 +1,32 @@
-- Plugins that don't require much configuration are in here.
--
return {
{ import = "lazyvim.plugins.extras.lang.ansible" },
{ import = "lazyvim.plugins.extras.lang.cmake" },
{ import = "lazyvim.plugins.extras.lang.docker" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.lang.markdown" },
{ import = "lazyvim.plugins.extras.lang.yaml" },
{ import = "lazyvim.plugins.extras.coding.luasnip" },
{
import = "lazyvim.plugins.extras.editor.mini-files",
opts = {
options = {
use_as_default_explorer = true,
},
},
},
{
"folke/snacks.nvim",
opts = {
indent = { enabled = false },
},
},
{
import = "lazyvim.plugins.extras.coding.blink",
keymap = {
preset = "enter",
["<C-y>"] = { "select_and_accept" },
},
},
}

View File

@@ -0,0 +1,147 @@
return {
{
"williamboman/mason.nvim",
dependencies = {
"neovim/nvim-lspconfig",
},
opts = {
ensure_installed = {
"clangd",
"marksman",
"shfmt",
},
},
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"cmake",
"dockerfile",
"editorconfig",
"ini",
"json",
"jq",
"latex",
"make",
"swift",
},
},
},
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
opts = {
servers = {
bashls = {},
clangd = {},
dockerls = {},
gopls = {},
jsonls = {},
lua_ls = {},
marksman = {},
sourcekit = {},
yamlls = {},
},
setup = {
clangd = function(_, opts)
opts.capabilities.offsetEncoding = { "utf-16" }
end,
sourcekit = function(_, opts)
opts.cmd = {
vim.trim(vim.fn.system("xcrun -f sourcekit-lsp")) or nil
}
end
},
},
},
}
-- return {
-- "neovim/nvim-lspconfig",
-- event = { "BufReadPre", "BufNewFile" },
-- dependencies = {
-- "hrsh7th/cmp-nvim-lsp",
-- { "antosha417/nvim-lsp-file-operations", config = true },
-- "williamboman/mason.nvim",
-- "williamboman/mason-lspconfig.nvim",
-- {
-- "folke/lazydev.nvim",
-- ft = "lua",
-- opts = {
-- library = {
-- { path = "${3rd}/luv/library", words = { "vim%.uv" } },
-- },
-- },
-- },
-- },
-- config = function()
-- require("mason").setup()
-- require("mason-lspconfig").setup({
-- opts = {
-- ensure_installed = lsp_servers,
-- },
-- })
-- local lspconfig = require("lspconfig")
-- local cmp_nvim_lsp = require("cmp_nvim_lsp")
-- local capabilities = cmp_nvim_lsp.default_capabilities()
-- local opts = { noremap = true, silent = true }
-- local on_attach = function(_, bufnr)
-- opts.buffer = bufnr
--
-- opts.desc = "Show line diagnostics"
-- vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
--
-- opts.desc = "Show diagnostics in Telescope"
-- vim.keymap.set("n", "<leader><leader>d", "<CMD>Telescope diagnostics bufnr=0<CR>", opts)
--
-- opts.desc = "Show documentation for what is under cursor"
-- vim.keymap.set("n", "<C-k>", vim.lsp.buf.hover, opts)
--
-- opts.desc = "[G]oto [D]efinition"
-- vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions trim_text=true<cr>", opts)
--
-- opts.desc = "[G]oto [D]eclaration"
-- vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
--
-- opts.desc = "LSP [C]ode [A]ction"
-- vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
--
-- --opts.desc = "[R]e-[N]ame"
-- --vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
--
-- opts.desc = "[R]eload or start LSP"
-- vim.keymap.set("n", "<leader>rl", ":LspRestart | :LspStart<CR>", opts)
--
-- opts.desc = "Goto previous diagnostic"
-- vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
--
-- opts.desc = "Goto next diagnostic"
-- vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
-- end
--
-- for _, lsp in ipairs(lsp_servers) do
-- lspconfig[lsp].setup({
-- capabilities = capabilities,
-- on_attach = on_attach,
-- on_init = function(client)
-- -- HACK: to fix some issues with LSP
-- -- more details: https://github.com/neovim/neovim/issues/19237#issuecomment-2237037154
-- client.offset_encoding = "utf-8"
-- end,
-- cmd = lsp == "sourcekit" and { vim.trim(vim.fn.system("xcrun -f sourcekit-lsp")) } or nil,
-- })
-- end
--
-- -- nice icons
-- local signs = { Error = " ", Warn = " ", Hint = "󰠠 ", Info = " " }
-- for type, icon in pairs(signs) do
-- local hl = "DiagnosticSign" .. type
-- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
-- end
--
-- -- For some reason I was having trouble getting this to work inside the on-attach, so it's here.
-- vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e-[N]ame" })
-- end,
-- }

View File

@@ -0,0 +1,39 @@
return {
{
"L3MON4D3/LuaSnip",
opts = function()
LazyVim.cmp.actions.snippet_forward = function()
if require("luasnip").jumpable(1) then
require("luasnip").jump(1)
return true
end
end
LazyVim.cmp.actions.snippet_stop = function()
if require("luasnip").expand_or_jumpable() then -- or just jumpable(1) is fine?
require("luasnip").unlink_current()
return true
end
end
end,
keys = {
{
"<C-k>",
mode = { "i", "s" },
function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end
},
{
"<C-j>",
mode = { "i", "s" },
function()
if ls.jumpable(-1) then
ls.jump(-1)
end
end
},
},
},
}

View File

@@ -0,0 +1,36 @@
return {
"stevearc/oil.nvim",
event = "VeryLazy",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
columns = { "icon" },
keymaps = {
["<C-h>"] = false,
["<M-h>"] = "actions.select_split",
["<C-v>"] = {
"actions.select",
opts = { vertical = true },
desc = "Open the entry in a vertical split",
},
view_options = {
is_hidden_file = function(name, _) -- second arg is bufnr, but not currently used.
-- Don't show .DS_Store in output.
local is_ds_store = name ~= ".DS_Store"
return not is_ds_store
end,
},
}
},
keys = {
-- Show the parent directory in current window.
{ "-", "<CMD>Oil<CR>", desc = "Open parent directory." },
-- Open parent directory in floating window.
{
"<space>-",
function() require("oil").toggle_float() end,
desc = "Open parent directory in floating window."
},
},
}

View File

@@ -0,0 +1,10 @@
return {
{
import = "lazyvim.plugins.extras.editor.telescope",
opts = {
ensure_installed = {
"swift",
},
},
},
}

View File

@@ -0,0 +1,14 @@
return {
"folke/todo-comments.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
},
keys = {
{ "<leader>xt", false },
{ "<leader>xT", false },
{ "<leader>tq", "<CMD>Trouble todo toggle<CR>", desc = "[T]odo [Q]uick fix list." },
{ "<leader><leader>t", "<CMD>TodoTelescope<CR>", desc = "[T]odo telescope list." },
{ "<leader>tl", "<CMD>TodoLocList<CR>", desc = "[T]odo [L]ocation list." },
},
}

View File

@@ -0,0 +1,73 @@
local progress_handle
return {
"wojciech-kulik/xcodebuild.nvim",
event = "VeryLazy",
dependencies = {
"nvim-telescope/telescope.nvim",
"MunifTanjim/nui.nvim",
},
opts = {
show_build_progress_bar = false,
logs = {
auto_open_on_success_tests = false,
auto_open_on_failed_tests = false,
auto_open_on_success_build = false,
auto_open_on_failed_build = false,
auto_focus = false,
auto_close_on_app_launch = true,
only_summary = true,
notify = function(message, severity)
local fidget = require("fidget")
if progress_handle then
progress_handle.message = message
if not message:find("Loading") then
progress_handle:finish()
progress_handle = nil
if vim.trim(message) ~= "" then
fidget.notify(message, severity)
end
end
else
fidget.notify(message, severity)
end
end,
notify_progress = function(message)
local progress = require("fidget.progress")
if progress_handle then
progress_handle.title = ""
progress_handle.message = message
else
progress_handle = progress.handle.create({
message = message,
lsp_client = { name = "xcodebuild.nvim" },
})
end
end,
},
code_coverage = {
enabled = true,
},
},
keys = {
{ "<leader>X", "<cmd>XcodebuildPicker<cr>", desc = "Show Xcodebuild Actions" },
{ "<leader>xf", "<cmd>XcodebuildProjectManager<cr>", desc = "Show Project Manager Actions" },
{ "<leader>xb", "<cmd>XcodebuildBuild<cr>", desc = "Build Project" },
{ "<leader>xB", "<cmd>XcodebuildBuildForTesting<cr>", desc = "Build For Testing" },
{ "<leader>xr", "<cmd>XcodebuildBuildRun<cr>", desc = "Build & Run Project" },
{ "<leader>xt", "<cmd>XcodebuildTest<cr>", desc = "Run Tests" },
{ "<leader>xt", "<cmd>XcodebuildTestSelected<cr>", desc = "Run Selected Tests" },
{ "<leader>xT", "<cmd>XcodebuildTestClass<cr>", desc = "Run This Test Class" },
{ "<leader>xl", "<cmd>XcodebuildToggleLogs<cr>", desc = "Toggle Xcodebuild Logs" },
{ "<leader>xc", "<cmd>XcodebuildToggleCodeCoverage<cr>", desc = "Toggle Code Coverage" },
{ "<leader>xC", "<cmd>XcodebuildShowCodeCoverageReport<cr>", desc = "Show Code Coverage Report" },
{ "<leader>xe", "<cmd>XcodebuildTestExplorerToggle<cr>", desc = "Toggle Test Explorer" },
{ "<leader>xs", "<cmd>XcodebuildFailingSnapshots<cr>", desc = "Show Failing Snapshots" },
{ "<leader>xd", "<cmd>XcodebuildSelectDevice<cr>", desc = "Select Device" },
{ "<leader>xp", "<cmd>XcodebuildSelectTestPlan<cr>", desc = "Select Test Plan" },
{ "<leader>xq", "<cmd>Telescope quickfix<cr", desc = "Show QuickFix List" },
{ "<leader>xx", "<cmd>XcodebuildQuickfixLine<cr>", desc = "Quickfix Line" },
{ "<leader>xa", "<cmd>XcodebuildCodeActions<cr>", desc = "Show Code Actions" },
},
}

View File

@@ -1,4 +1,5 @@
local ls = require('luasnip') -- Setup snippets here.
local ls = require("luasnip")
local s = ls.snippet local s = ls.snippet
local sn = ls.snippet_node local sn = ls.snippet_node
local ms = ls.multi_snippet local ms = ls.multi_snippet
@@ -7,3 +8,10 @@ local f = ls.function_node
local c = ls.choice_node local c = ls.choice_node
local t = ls.text_node local t = ls.text_node
ls.add_snippets("lua", {
s("hello", {
t('print("hello '),
i(1),
t(' world")'),
}),
})

View File

@@ -0,0 +1,34 @@
-- Setup snippets here.
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local ms = ls.multi_snippet
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local t = ls.text_node
ls.add_snippets("lua", {
-- Setup a new snippet file.
s("sf", {
t({
"-- Setup snippets.",
'local ls = require("luasnip")',
"local s = ls.snippet",
"local sn = ls.snippet_node",
"local ms = ls.multi_snippet",
"local i = ls.insert_node",
"local f = ls.function_node",
"local c = ls.choice_node",
"local t = ls.text_node",
"-- Add snippets",
}),
t('ls.add_snippets("'),
i(1, "<file-type>"),
t({
'", {',
"\t-- Define snippets here.",
"})",
}),
}),
})

View File

@@ -0,0 +1,131 @@
-- Setup snippets.
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local ms = ls.multi_snippet
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local t = ls.text_node
local fmt = require("luasnip.extras.fmt").fmt
local rep = require("luasnip.extras").rep
-- Add snippets
ls.add_snippets("swift", {
-- Add a dependency snippet.
s({ trig = "@d", desc = "Add a dependency." }, fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })),
-- Add a dependency client.
s(
{
trig = "@dc",
desc = "Add a dependency client.",
},
fmt(
[[
public extension DependencyValues {{
var {}: {} {{
get {{ self[{}.self] }}
set {{ self[{}.self] = newValue }}
}}
}}
@DependencyClient
public struct {} {{
// Insert interface here.
{}
}}
extension {}: TestDependencyKey {{
public static let testValue: {} = Self()
}}
]],
{
i(1, "<name>"),
i(2, "<Dependency>"),
rep(2),
rep(2),
rep(2),
i(0),
rep(2),
rep(2),
}
)
),
s(
{ trig = "str", desc = "Add a struct" },
fmt(
[[
struct {}: {} {{
{}
}}
]],
{ i(1, "<Name>"), i(2, "<Protocols>"), i(0) }
)
),
-- Decorate a type or function with an @_spi(...)
s({ trig = "@_s", desc = "Add spi modifier." }, fmt("@_spi({})", { i(1, "name") })),
-- Add an @_spi(...) import ...
s(
{ trig = "@_si", desc = "Import with spi." },
fmt(
[[
@_spi({}) import {}
{}
]],
{ i(1, "name"), i(2, "module"), i(0) }
)
),
-- Document a function
-- TODO: add dynamic number of prameters.
s(
{ trig = "docf", desc = "Document a function." },
fmt(
[[
/// {}
///
/// - Parameters:
/// - {}: {}
]],
{ i(1, "A short description."), i(2, "<param>"), i(3, "Describe the parameter.") }
)
),
-- Add a parameter to a documentation string.
s(
{ trig = "param", desc = "Add a parameter to documentation" },
fmt(
[[
/// - {}: {}
]],
{ i(1, "<param>"), i(2, "<description>") }
)
),
-- Add a withDependencies
s(
{ trig = "wd", desc = "withDependencies" },
fmt(
[[
withDependencies {{
$0.{} = {}
}} operation: {{
@Dependency(\.{}) var {}
{}
}}
]],
{
i(1, "<dependency>"),
i(2, "<override>"),
rep(1),
rep(1),
i(0),
}
)
),
})

View File

@@ -0,0 +1,16 @@
MeasureQuick
Housh
sealtite
Subcool
OEM
NEC
AHJ
CFM
Hydronic
subpar
quo
IAQ
wc
HVAC
dehumidification
ansible

Binary file not shown.

View File

@@ -0,0 +1,3 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120

View File

@@ -0,0 +1,20 @@
-- Markdown specific key maps.
--
local todos = require("todo-comments")
local keywords = { "WARN", "WARNING", "IMPORTANT" }
-- Show all the warnings in the quick fix list.
vim.keymap.set(
"n",
"<leader>tw",
"<CMD>Trouble todo toggle filter = {tag = {WARN, IMPORTANT}}<CR>",
{ desc = "[T]odo [W]arnings" }
)
vim.keymap.set("n", "]w", function()
todos.jump_next({ keywords = keywords })
end, { desc = "Next [W]arning" })
vim.keymap.set("n", "[w", function()
todos.jump_prev({ keywords = keywords })
end, { desc = "Previous [W]arning" })

View File

@@ -0,0 +1,2 @@
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2

View File

@@ -2,20 +2,21 @@
vim.g.mapleader = " " vim.g.mapleader = " "
vim.g.maplocalleader = " " vim.g.maplocalleader = " "
-- Auto commands -- NOTE: Keep settings at the top, otherwise some options don't work well.
require('user.autocmd') -- mainly have had trouble with not using the settings in an `.editorconfig`
-- file for projects.
-- Plugins
require('user.plugins')
-- Key maps
require('user.mappings')
-- Theme (must stay after plugins are loaded)
require('user.theme')
-- Common settings -- Common settings
require('user.settings') require("user.settings")
vim.o.shiftwidth = 2 -- Auto commands
require("user.autocmd")
-- Plugins
require("user.plugins")
-- Key maps
require("user.keymaps")
-- Theme (must stay after plugins are loaded)
require("user.theme")

View File

@@ -1,81 +1,50 @@
local defaultGroupOptions = { clear = true } local defaultGroupOptions = { clear = true }
local markdownGroup = vim.api.nvim_create_augroup("MyMarkdownGroup", defaultGroupOptions) local markdownGroup = vim.api.nvim_create_augroup("MyMarkdownGroup", defaultGroupOptions)
local spellGroup = vim.api.nvim_create_augroup('SpellGroup', defaultGroupOptions) local spellGroup = vim.api.nvim_create_augroup("SpellGroup", defaultGroupOptions)
local createCmd = vim.api.nvim_create_autocmd local createCmd = vim.api.nvim_create_autocmd
local swiftGroup = vim.api.nvim_create_augroup('swift_lsp', { clear = true })
-- Remove all trailing whitespace on save
vim.api.nvim_exec([[
augroup TrimWhiteSpace
au!
autocmd BufWritePre * :%s/\s\+$//e
augroup END
]], false)
-- Prevent new line to also start with a comment
vim.api.nvim_exec([[
augroup NewLineComment
au!
au FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
augroup END
]], false)
-- Spell check -- Spell check
createCmd( createCmd("BufEnter", {
"BufEnter", pattern = { "*.md", "*.markdown", "*.txt", "*.tex" },
{ group = spellGroup,
pattern = { '*.md', '*.markdown', '*.txt', '*.tex' }, callback = function(_)
group = spellGroup, vim.cmd.setlocal("textwidth=80")
callback = function(_) vim.cmd.setlocal("spell spelllang=en_us")
vim.cmd.setlocal('textwidth=80') end,
vim.cmd.setlocal('spell spelllang=en_us') })
end,
}
)
-- Markdown -- Markdown
createCmd( createCmd("BufWritePost", {
"BufWritePost", pattern = { "*.md", "*.markdown" },
{ group = markdownGroup,
pattern = { "*.md", "*.markdown" }, callback = function(_)
group = markdownGroup, local cursor = vim.fn.getpos(".")
callback = function(_) vim.cmd("FormatWrite")
local cursor = vim.fn.getpos('.') vim.fn.setpos(".", cursor)
vim.cmd("FormatWrite") end,
vim.fn.setpos('.', cursor) })
end,
}
)
-- Go -- Go
createCmd( createCmd("BufWritePre", {
"BufWritePre", pattern = "*.go",
{ callback = function()
pattern = "*.go", require("go.format").goimport()
callback = function() end,
require('go.format').goimport() group = vim.api.nvim_create_augroup("GoFormat", defaultGroupOptions),
end, })
group = vim.api.nvim_create_augroup("GoFormat", defaultGroupOptions)
} vim.api.nvim_exec2(
[[
autocmd BufNewFile,BufRead /private/**/gopass** setlocal noswapfile nobackup noundofile shada=""
]],
{}
) )
-- Swift -- Highlight when yanking.
-- createCmd( createCmd("TextYankPost", {
-- "FileType", desc = "Highlight when yanking text.",
-- { group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }),
-- pattern = { 'swift' }, callback = function()
-- callback = function() vim.highlight.on_yank()
-- local root_dir = vim.fs.dirname(vim.fs.find({ end,
-- "Package.swift", })
-- ".git",
-- }, { upward = true })[1])
-- local client = vim.lsp.start({
-- name = "sourcekit-lsp",
-- cmd = { "sourcekit-lsp" },
-- root_dir = root_dir
-- })
-- vim.lsp.buf_attach_client(0, client)
-- end,
-- group = swiftGroup
-- }
-- )

View File

@@ -0,0 +1,52 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
local keymap = vim.keymap.set
local default_options = { noremap = true, silent = true }
local wk = require("which-key")
local wk_add = function(mode, keymaps)
wk.add(keymaps, { mode = mode, silent = true })
end
--------------------------------------------------------------------------------
-- Insert Mode
--------------------------------------------------------------------------------
-- easier escape key mapping
keymap("i", "jk", "<ESC>", default_options)
wk_add("i", {
{ "<C-s>", "<ESC>:write<CR>a", desc = "[S]ave" },
})
--------------------------------------------------------------------------------
-- Normal Mode
--------------------------------------------------------------------------------
wk_add("n", {
{ "<Left>", ":vertical resize +1<CR>", desc = "Resize Pane Left" },
{ "<Right>", ":vertical resize -1<CR>", desc = "Resize Pane Right" },
{ "<Up>", "resize -1<CR>", desc = "Resize Pane Up" },
{ "<Down>", "resize +1<CR>", desc = "Resize Pane Down" },
{ "<leader>n", "<CMD>:noh<CR>", desc = "[N]o highlighting" },
{ "<leader>s", "<CMD>:set spell!<CR>", desc = "[S]pell check toggle" },
{ "<C-s>", "<CMD>:write<CR>", desc = "[S]ave" },
{ "J", ":move .+1<CR>==", desc = "Move line down" },
{ "K", ":move .-2<CR>==", desc = "Move line up" },
{ "<leader>z", "<CMD>:ZenMode<CR>", desc = "[Z]en Mode" },
})
--------------------------------------------------------------------------------
-- Visual Mode
--------------------------------------------------------------------------------
vim.keymap.set("v", "K", ":move '<-2<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
vim.keymap.set("v", "J", ":move '>+1<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
-- Toggle term key maps, that get attached when terminal is opened.
function _G.set_terminal_keymaps()
local opts = { buffer = 0 }
keymap("t", "<esc>", [[<C-\><C-n>]], opts)
end
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")

View File

@@ -1,126 +0,0 @@
local keymap = vim.keymap.set
local default_options = {noremap = true, silent = true}
local telescope = require('telescope.builtin')
-- local expr_options = {noremap = true, expr = true, silent = true}
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- easier escape key mapping
keymap('i', 'jk', '<ESC>', default_options)
keymap('n', '<c-s>', ':w<CR>', default_options)
keymap('i', '<c-s>', '<ESC>:w<CR>a', default_options)
-- paste over currently selected text without yanking it
keymap("v", "p", "\"_dP", default_options)
-- buffer focus
-- keymap('n', '<c-j>', '<c-w>j', default_options)
-- keymap('n', '<c-h>', '<c-w>h', default_options)
-- keymap('n', '<c-k>', '<c-w>k', default_options)
-- keymap('n', '<c-l>', '<c-w>l', default_options)
-- Resizing panes
keymap("n", "<Left>", ":vertical resize +1<CR>", default_options)
keymap("n", "<Right>", ":vertical resize -1<CR>", default_options)
keymap("n", "<Up>", ":resize -1<CR>", default_options)
keymap("n", "<Down>", ":resize +1<CR>", default_options)
-- Move selected line / block of text in visual mode
keymap("x", "K", ":move '<-2<CR>gv-gv", default_options)
keymap("x", "J", ":move '>+1<CR>gv-gv", default_options)
-- Toggle neo-tree open or closed
keymap("n", "<c-n>", "<CMD>:Neotree toggle<CR>", default_options)
-- Toggle Lazy Git
keymap("n", '<leader>gg', ':LazyGit<CR>', default_options)
keymap("n", "<leader>gf", ":Telescope git_files<CR>", default_options)
keymap("n", "<leader>t", ":ToggleTerm<CR>", default_options)
-- Zen Mode Toggle
keymap('n', '<leader>z', "<cmd>:ZenMode<CR>", default_options)
-- Toggle term key maps, that get attached when terminal is opened.
function _G.set_terminal_keymaps()
local opts = { buffer = 0 }
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
end
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
-- Formatting
keymap('n', '<leader>f', '<cmd>:Format<CR>', default_options)
keymap('n', '<leader>F', '<cmd>:FormatWrite<CR>', default_options)
-- Telescope keymaps
vim.keymap.set('n', '<leader>ff', telescope.find_files, {})
vim.keymap.set('n', '<leader>fg', telescope.live_grep, {})
vim.keymap.set('n', '<leader>fb', telescope.buffers, {})
vim.keymap.set('n', '<leader>fh', telescope.help_tags, {})
-- Find espanso config files.
keymap('n', '<leader>fe', function()
telescope.find_files({
cwd='$HOME/.dotfiles/espanso/espanso'
})
end, default_options)
-- Find nvim config files.
keymap('n', '<leader>fn', function()
telescope.find_files({
cwd='$HOME/.dotfiles/nvim/m-housh'
})
end, default_options)
-- Find script files.
keymap('n', '<leader>fs', function()
telescope.find_files({
cwd='$HOME/.dotfiles/scripts/scripts'
})
end, default_options)
-- Find zsh config files.
keymap('n', '<leader>fz', function()
telescope.find_files({
cwd = '$HOME/.dotfiles/zsh/config',
hidden = true
})
end, default_options)
-- Turn off highlighting after search.
keymap('n', '<leader>n', '<cmd>:noh<cr>', default_options)
-- Toggle Spell Checking.
keymap('n', '<leader>s', '<cmd>:set spell!<cr>', default_options)
-- LuaSnip Keymaps
--local ls = require('luasnip')
-- <c-k> to expand snippets.
-- This will expand the snippet or jump to the next item within the snippet.
-- vim.keymap.set({ "i", "s" }, "<c-k>", function()
-- if ls.expand_or_jumpable() then
-- ls.expand_or_jump()
-- end
-- end, { silent = true })
-- <c-j>
-- This will jump backwards in the snippet.
-- vim.keymap.set({ "i", "s" }, "<c-j>", function()
-- if ls.jumpable(-1) then
-- ls.jump(-1)
-- end
-- end, { silent = true })
-- <c-l>
-- This is for selecting withing a list of options.
-- vim.keymap.set("i", "<c-l>", function()
-- if ls.choice_active() then
-- ls.change_choice(1)
-- end
-- end, { silent = true })
-- Reload the snippets.
--vim.keymap.set("n", "<leader><leader>s", "<cmd>source ~/.config/m-housh/lua/snippets/init.lua<cr>")

View File

@@ -0,0 +1,58 @@
return {
{
"saghen/blink.cmp",
enabeld = false,
dependencies = {
"rafamadriz/friendly-snippets",
--"L3MON4D3/LuaSnip",
},
version = "v0.*",
opts = {
appearance = {
use_nvim_cmp_as_default = true,
nerd_font_variant = "mono",
},
signature = { enabled = true },
keymap = {
preset = "default",
["<CR>"] = { "accept", "fallback" },
["<C-space>"] = {
function(cmp)
cmp.show({ providers = { "snippets" } })
end,
},
--["<C-k>"] = { "select_prev", "fallback" },
--["<C-j>"] = { "select_next", "fallback" },
["<C-n>"] = {
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_and_accept()
end
end,
"snippet_forward",
"fallback",
},
},
-- snippets = {
-- expand = function(snippet)
-- require("luasnip").lsp_expand(snippet)
-- end,
-- active = function(filter)
-- if filter and filter.direction then
-- return require("luasnip").jumpable(filter.direction)
-- end
-- return require("luasnip").in_snippet()
-- end,
-- jump = function(direction)
-- require("luasnip").jump(direction)
-- end,
-- },
sources = {
default = { "lsp", "path", "snippets", "buffer" },
},
},
opts_extend = { "sources.default" },
},
}

View File

@@ -1,155 +1,91 @@
return { return {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
enabled = true, enabled = true,
dependencies = { event = "VeryLazy",
"hrsh7th/cmp-nvim-lsp", dependencies = {
"hrsh7th/cmp-buffer", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path", "hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-cmdline", "hrsh7th/cmp-path", -- source for file system paths
--"hrsh7th/cmp-vsnip", "L3MON4D3/LuaSnip", -- snippet engine
'saadparwaiz1/cmp_luasnip', "saadparwaiz1/cmp_luasnip", -- for autocompletion
"f3fora/cmp-spell", "rafamadriz/friendly-snippets", -- useful snippets
"hrsh7th/cmp-calc", "onsails/lspkind.nvim", -- vs-code like pictograms
"hrsh7th/cmp-emoji", },
--"L3MON4D3/LuaSnip", config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- Adds a number of user-friendly snippets -- TODO: This is implemented in LuaSnip config, does it need to be here?
'rafamadriz/friendly-snippets',
},
event = { 'BufReadPre', 'BufNewFile' },
config = function()
-- Setup nvim-cmp.
local cmp = require "cmp"
local lspkind = require("lspkind")
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
--local luasnip = require('luasnip')
local has_words_before = function() -- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
local line, col = unpack(vim.api.nvim_win_get_cursor(0)) require("luasnip.loaders.from_vscode").lazy_load()
return col ~= 0
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(
col, col):match("%s") == nil
end
local feedkey = function(key, mode) cmp.setup({
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), completion = {
mode, true) completeopt = "menu,menuone,preview",
end },
snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args)
require('lspconfig').sourcekit.setup { luasnip.lsp_expand(args.body)
capabilities = capabilities end,
} },
mapping = cmp.mapping.preset.insert({
lspkind.init({ ["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
symbol_map = { ["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
["<C-Space>"] = cmp.mapping.confirm({
Text = "", behavior = cmp.ConfirmBehavior.Insert,
Method = "󰡱", select = true,
Function = "󰡱", }), -- select completion, this makes it so it doesn't auto complete when suggesting.
Constructor = "", ["<C-e>"] = cmp.mapping.abort(), -- close completion window
Field = "", ["<CR>"] = cmp.mapping({
Variable = "", i = function(fallback)
Class = "", if cmp.visible() then
Interface = "", if luasnip.expandable() then
Module = "", luasnip.expand()
Property = "", else
Unit = "", cmp.mapping.confirm({ select = false })
Value = "", fallback()
Enum = "", end
Keyword = "", else
Snippet = "", fallback()
Color = "", end
File = "", end,
Reference = "", s = cmp.mapping.confirm({ select = true }),
Folder = "", c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
EnumMember = "", }),
Constant = "", -- TODO:
Struct = "", -- The next two mappings are also implemented in the LuaSnip configuration,
Event = "", -- as <C-j> and <C-k> do they actually need to be here??
Operator = "", ["<C-b>"] = cmp.mapping(function(fallback)
TypeParameter = "" if luasnip.jumpable(-1) then
} luasnip.jump(-1)
}) else
fallback()
-- Configure nvim-cmp. end
--require('luasnip.loaders.from_vscode').lazy_load() end, { "i", "s" }),
--luasnip.config.setup {} ["<C-f>"] = cmp.mapping(function(fallback)
cmp.setup({ if luasnip.jumpable(1) then
formatting = { luasnip.jump(1)
format = lspkind.cmp_format { else
with_text = false, fallback()
maxwidth = 50, end
menu = { end, { "i", "s" }),
buffer = "BUF", }),
nvim_lsp = "LSP", -- sources for autocompletion
path = "PATH", sources = cmp.config.sources({
vsnip = "SNIP", { name = "nvim_lsp" },
calc = "CALC", { name = "luasnip" }, -- snippets
spell = "SPELL", { name = "buffer" }, -- text within current buffer
emoji = "EMOJI" { name = "path" }, -- file system paths
} }),
} -- configure lspkind for vs-code like pictograms in completion menu
}, formatting = {
experimental = {native_menu = false, ghost_text = false}, format = lspkind.cmp_format({
snippet = { maxwidth = 50,
expand = function(args) ellipsis_char = "...",
luasnip.lsp_expand(args.body) }),
--require('luasnip').lsp_expand(args.body) },
end })
}, end,
mapping = { }
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true
},
-- Accept ([y]es) the completions.
['<C-y'] = cmp.mapping.confirm { select = true },
-- ["<Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- -- elseif luasnip.expandable() then
-- -- luasnip.expand()
-- -- elseif luasnip.expand_or_jumpable() then
-- -- luasnip.expand_or_jump()
-- elseif has_words_before() then
-- cmp.complete()
-- else
-- fallback()
-- end
-- end, {"i", "s"}),
["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_prev_item()
-- elseif vim.fn["vsnip#jumpable"](-1) == 1 then
-- feedkey("<Plug>(vsnip-jump-prev)", "")
end
end, {"i", "s"})
},
sources = {
{name = "nvim_lsp"},
{name = "buffer", keyword_length = 5},
--{name = 'luasnip', option = { show_autosnippets = true } },
{name = "calc"},
{name = "emoji"},
{name = "spell"},
{name = "path"}
}
})
-- Use buffer source for `/`.
cmp.setup.cmdline("/", {sources = {{name = "buffer"}}})
-- Use cmdline & path source for ':'.
cmp.setup.cmdline(":", {
sources = cmp.config.sources({{name = "path"}}, {{name = "cmdline"}})
})
end
}

View File

@@ -0,0 +1,23 @@
return {
"j-hui/fidget.nvim",
event = "VeryLazy",
config = function()
local fidget = require("fidget")
fidget.setup({
notification = {
window = {
normal_hl = "String", -- Base highlight group in the notification window
winblend = 0, -- Background color opacity in the notification window
border = "rounded", -- Border around the notification window
zindex = 45, -- Stacking priority of the notification window
max_width = 0, -- Maximum width of the notification window
max_height = 0, -- Maximum height of the notification window
x_padding = 1, -- Padding from right edge of window boundary
y_padding = 1, -- Padding from bottom edge of window boundary
align = "bottom", -- How to align the notification window
relative = "editor", -- What the notification window position is relative to
},
},
})
end,
}

View File

@@ -1,32 +1,69 @@
return { return {
"mhartington/formatter.nvim", "mhartington/formatter.nvim",
event = { 'BufReadPre', 'BufNewFile' }, event = { "BufReadPre", "BufNewFile" },
config = function() config = function()
local util = require("formatter.util") local util = require("formatter.util")
require("formatter").setup({ require("formatter").setup({
filetype = { filetype = {
markdown = function() lua = {
return { require("formatter.filetypes.lua").stylua,
exe = "prettier", function()
args = { return {
"--stdin-filepath", exe = "stylua",
util.escape_path(util.get_current_buffer_file_path()), args = {
"--print-width", "--search-parent-directories",
"80", "--stdin-filepath",
"--prose-wrap", util.escape_path(util.get_current_buffer_file_path()),
"always", "--",
"--parser", "-",
"markdown" },
}, stdin = true,
stdin = true, }
try_node_modules = true, end,
} },
end, markdown = function()
["*"] = { return {
-- formatter for any / all file types. exe = "prettier",
require("formatter.filetypes.any").remove_trailing_whitespace args = {
} "--stdin-filepath",
} util.escape_path(util.get_current_buffer_file_path()),
}) "--print-width",
end "100",
"--prose-wrap",
"always",
"--parser",
"markdown",
},
stdin = true,
try_node_modules = true,
}
end,
swift = function()
return {
exe = "swiftformat",
}
end,
["*"] = {
-- formatter for any / all file types.
require("formatter.filetypes.any").remove_trailing_whitespace,
},
},
})
-- Keymaps
local wk = require("which-key")
wk.add({
{ "<space>f", ":Format", desc = "[F]ormat" },
{ "<space>F", ":FormateWrite", desc = "[F]ormat write" },
}, { mode = "n", silent = true })
local augroup = vim.api.nvim_create_augroup
local autocmd = vim.api.nvim_create_autocmd
augroup("__formatter__", { clear = true })
autocmd("BufWritePost", {
group = "__formatter__",
command = ":FormatWrite",
})
end,
} }

View File

@@ -1,5 +1,6 @@
return { return {
"ray-x/go.nvim", "ray-x/go.nvim",
enabled = false,
lazy = true, lazy = true,
dependencies = { -- optional packages dependencies = { -- optional packages
"ray-x/guihua.lua", "ray-x/guihua.lua",

View File

@@ -0,0 +1,86 @@
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
local harpoon = require("harpoon")
harpoon:setup({
settings = {
save_on_toggle = true,
sync_on_ui_close = true,
key = function()
return vim.loop.cwd()
end,
},
})
local conf = require("telescope.config").values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
require("telescope.pickers")
.new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
})
:find()
end
-- Keymaps
vim.keymap.set("n", "<C-e>", function()
toggle_telescope(harpoon:list())
end, { desc = "Open Harpoon window" })
vim.keymap.set("n", "<leader>a", function()
harpoon:list():add()
end, { desc = "[A]dd to harpoon list." })
vim.keymap.set("n", "<C-e>", function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end, { desc = "Toggle quick menu." })
-- Buffer key maps. Currently keeping all buffer movements
-- isolated to top left row of keys on keyboard and all begin
-- with the <Control> key.
-- Select buffer numbers.
vim.keymap.set("n", "<A-y>", function()
harpoon:list():select(1)
end, { desc = "Select first harpoon buffer." })
vim.keymap.set("n", "<A-u>", function()
harpoon:list():select(2)
end, { desc = "Select second harpoon buffer." })
vim.keymap.set("n", "<A-i>", function()
harpoon:list():select(3)
end, { desc = "Select third harpoon buffer." })
vim.keymap.set("n", "<A-o>", function()
harpoon:list():select(4)
end, { desc = "Select fourth harpoon buffer." })
-- Toggle previous and next buffers.
vim.keymap.set("n", "<C-[>", function()
harpoon:list():prev()
end, { desc = "[P]revious harpoon buffer." })
vim.keymap.set("n", "<C-]>", function()
harpoon:list():next()
end, { desc = "[N]ext harpoon buffer." })
-- Extensions
harpoon:extend({
UI_CREATE = function(cx)
vim.keymap.set("n", "<C-v>", function()
harpoon.ui:select_menu_item({ vsplit = true })
end, { buffer = cx.buffer, desc = "Open in [V]split" })
end,
})
end,
}

View File

@@ -1,31 +1,2 @@
-- This file contains plugin's that don't require much configuration. -- This file contains plugin's that don't require much configuration.
return { return {}
-- {
-- "L3MON4D3/LuaSnip",
-- version = "2.*",
-- build = "make install_jsregexp",
-- event = { 'BufReadPre', 'BufNewFile' },
-- config = function()
-- local luasnip = require('luasnip')
-- local types = require('luasnip.util.types')
-- luasnip.config.set_config {
-- history = true,
-- updateevents = "TextChanged,TextChangedI",
-- enable_autosnippets = true,
-- ext_opts = {
-- [types.choiceNode] = {
-- active = {
-- virt_text = { { "<-", "Error" } },
-- },
-- },
-- },
-- }
-- end
-- },
{
"hrsh7th/vim-vsnip",
config = function()
vim.g.vsnip_snippet_dir = os.getenv('HOME') .. '/.config/m-housh/lua/snippets/'
end
},
}

View File

@@ -1,10 +1,11 @@
return { return {}
"kdheepak/lazygit.nvim", -- return {
dependencies = { -- "kdheepak/lazygit.nvim",
"nvim-telescope/telescope.nvim", -- dependencies = {
"nvim-lua/plenary.nvim" -- "nvim-telescope/telescope.nvim",
}, -- "nvim-lua/plenary.nvim"
config = function() -- },
require("telescope").load_extension("lazygit") -- config = function()
end, -- require("telescope").load_extension("lazygit")
} -- end,
-- }

View File

@@ -1,224 +1,105 @@
return { -- The language servers to setup.
{ local lsp_servers = {
"williamboman/nvim-lsp-installer", "bashls",
config = function() "clangd",
require("nvim-lsp-installer").setup({}) "dockerls",
end "gopls",
}, "jsonls",
{ "lua_ls",
"williamboman/mason-lspconfig.nvim", "marksman",
dependencies = { "sourcekit",
"williamboman/mason.nvim", "yamlls",
"onsails/lspkind-nvim", }
"famiu/bufdelete.nvim",
"ray-x/lsp_signature.nvim", return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
"folke/neodev.nvim", event = { "BufReadPre", "BufNewFile" },
"mhartington/formatter.nvim", dependencies = {
"ray-x/go.nvim", -- "hrsh7th/cmp-nvim-lsp",
}, "saghen/blink.cmp",
opts = { { "antosha417/nvim-lsp-file-operations", config = true },
ensure_installed = { "williamboman/mason.nvim",
"bashls", "williamboman/mason-lspconfig.nvim",
"clangd", {
"dockerls", "folke/lazydev.nvim",
"gopls", ft = "lua",
"jsonls", opts = {
"jedi_language_server", library = {
"lua_ls", { path = "${3rd}/luv/library", words = { "vim%.uv" } },
"marksman", },
"terraformls", },
"tsserver", },
"texlab", },
"yamlls", config = function()
} require("mason").setup()
} require("mason-lspconfig").setup({
}, opts = {
{ ensure_installed = lsp_servers,
"neovim/nvim-lspconfig", },
dependencies = { })
"hrsh7th/cmp-nvim-lsp", local lspconfig = require("lspconfig")
}, --local cmp_nvim_lsp = require("cmp_nvim_lsp")
config = function() --local capabilities = cmp_nvim_lsp.default_capabilities()
require('neodev').setup() local capabilities = require("blink.cmp").get_lsp_capabilities()
require("mason").setup() local opts = { noremap = true, silent = true }
require("mason-lspconfig").setup() local on_attach = function(_, bufnr)
local nvim_lsp = require("lspconfig") opts.buffer = bufnr
-- Use an on_attach function to only map the following keys opts.desc = "Show line diagnostics"
-- after the language server attaches to the current buffer vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
local on_attach = function(bufnr)
local function buf_set_keymap(...) opts.desc = "Show diagnostics in Telescope"
vim.api.nvim_buf_set_keymap(bufnr, ...) vim.keymap.set("n", "<leader><leader>d", "<CMD>Telescope diagnostics bufnr=0<CR>", opts)
end
opts.desc = "Show documentation for what is under cursor"
-- Mappings. vim.keymap.set("n", "<C-k>", vim.lsp.buf.hover, opts)
local opts = {noremap = true, silent = true}
opts.desc = "[G]oto [D]efinition"
-- See `:help vim.lsp.*` for documentation on any of the below functions vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions trim_text=true<cr>", opts)
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
buf_set_keymap("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts) opts.desc = "[G]oto [D]eclaration"
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts) vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
buf_set_keymap("n", "gT", vim.lsp.buf.type_definition, opts) opts.desc = "[G]oto [R]eferences"
-- buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) vim.keymap.set("n", "gr", "<CMD>Telescope lsp_references<CR>", opts)
buf_set_keymap("n", "<space>wa",
"<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts) opts.desc = "LSP [C]ode [A]ction"
buf_set_keymap("n", "<space>wr", vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
"<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
buf_set_keymap("n", "<space>wl", --opts.desc = "[R]e-[N]ame"
"<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", --vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
opts)
buf_set_keymap("n", "<space>D", opts.desc = "[R]eload or start LSP"
"<cmd>lua vim.lsp.buf.type_definition()<CR>", opts) vim.keymap.set("n", "<leader>rl", ":LspRestart | :LspStart<CR>", opts)
buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
buf_set_keymap("n", "<space>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts.desc = "Goto previous diagnostic"
opts) vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
buf_set_keymap("n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts) opts.desc = "Goto next diagnostic"
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts) vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
end
buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
buf_set_keymap("n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts) for _, lsp in ipairs(lsp_servers) do
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts) lspconfig[lsp].setup({
capabilities = capabilities,
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') on_attach = on_attach,
end on_init = function(client)
-- HACK: to fix some issues with LSP
-- Use a loop to conveniently call 'setup' on multiple servers and -- more details: https://github.com/neovim/neovim/issues/19237#issuecomment-2237037154
-- map buffer local keybindings when the language server attaches client.offset_encoding = "utf-8"
--local capabilities = vim.lsp.protocol.make_client_capabilities() end,
local capabilities = require("cmp_nvim_lsp").default_capabilities() cmd = lsp == "sourcekit" and { vim.trim(vim.fn.system("xcrun -f sourcekit-lsp")) } or nil,
})
local servers = { end
"bashls",
"clangd", -- nice icons
"dockerls", local signs = { Error = "", Warn = "", Hint = "󰠠 ", Info = "" }
"gopls", for type, icon in pairs(signs) do
"jsonls", local hl = "DiagnosticSign" .. type
"jedi_language_server", vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
"lua_ls", end
"marksman",
"sourcekit", -- For some reason I was having trouble getting this to work inside the on-attach, so it's here.
"terraformls", vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e-[N]ame" })
"tsserver", end,
"texlab",
"yamlls",
}
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
settings = {
gopls = {
experimentalPostfixCompletions = true,
analyses = {
unusedparams = true,
shadow = true
},
staticcheck = true
},
lua_ls = {
Lua = {
completion = {
callSnippet = "Replace"
},
workspace = { checkThirdParty = false },
telemetry = { enable = false },
}
},
json = {
format = {enabled = false},
schemas = {
{
description = "ESLint config",
fileMatch = {".eslintrc.json", ".eslintrc"},
url = "http://json.schemastore.org/eslintrc"
}, {
description = "Package config",
fileMatch = {"package.json"},
url = "https://json.schemastore.org/package"
}, {
description = "Packer config",
fileMatch = {"packer.json"},
url = "https://json.schemastore.org/packer"
}, {
description = "Renovate config",
fileMatch = {
"renovate.json", "renovate.json5",
".github/renovate.json", ".github/renovate.json5",
".renovaterc", ".renovaterc.json"
},
url = "https://docs.renovatebot.com/renovate-schema"
}, {
description = "OpenApi config",
fileMatch = {"*api*.json"},
url = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"
}
}
},
redhat = {telemetry = {enabled = false}},
texlab = {
auxDirectory = ".",
bibtexFormatter = "texlab",
build = {
args = {
"--keep-intermediates", "--keep-logs", "--synctex", "%f"
},
executable = "tectonic",
forwardSearchAfter = false,
onSave = false
},
chktex = {onEdit = false, onOpenAndSave = false},
diagnosticsDelay = 300,
formatterLineLength = 80,
forwardSearch = {args = {}},
latexFormatter = "latexindent",
latexindent = {modifyLineBreaks = false}
},
yaml = {
schemaStore = {
enable = true,
url = "https://www.schemastore.org/api/json/catalog.json"
},
schemas = {
kubernetes = "/*.yaml",
["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}",
["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
["http://json.schemastore.org/prettierrc"] = ".prettierrc.{yml,yaml}",
["http://json.schemastore.org/kustomization"] = "kustomization.{yml,yaml}",
["http://json.schemastore.org/ansible-playbook"] = "*play*.{yml,yaml}",
["http://json.schemastore.org/chart"] = "Chart.{yml,yaml}",
["https://json.schemastore.org/dependabot-v2"] = ".github/dependabot.{yml,yaml}",
["https://json.schemastore.org/gitlab-ci"] = "*gitlab-ci*.{yml,yaml}",
["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"] = "*api*.{yml,yaml}",
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = "docker-compose.{yml,yaml}",
["https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json"] = "*flow*.{yml,yaml}"
},
format = {enabled = false},
validate = false, -- TODO: conflicts between Kubernetes resources and kustomization.yaml
completion = true,
hover = true
}
},
flags = {debounce_text_changes = 150}
}
require"lsp_signature".setup({
bind = true, -- This is mandatory, otherwise border config won't get registered.
floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
doc_lines = 2, -- Set to 0 for not showing doc
hint_prefix = "🐼 ",
-- use_lspsaga = false, -- set to true if you want to use lspsaga popup
handler_opts = {
border = "shadow" -- double, single, shadow, none
}
})
end
-- Test source-kit
require('lspconfig').sourcekit.setup{}
end
}
} }

View File

@@ -1,119 +1,217 @@
return { return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
config = function() dependencies = { "nvim-tree/nvim-web-devicons" },
local colors = { config = function()
red = '#ca1243', local lualine = require("lualine")
grey = '#a0a1a7',
black = '#383a42',
white = '#f3f3f3',
light_green = '#83a598',
orange = '#fe8019',
green = '#8ec07c',
}
local empty = require('lualine.component'):extend() local function xcodebuild_device()
function empty:draw(default_highlight) if vim.g.xcodebuild_platform == "macOS" then
self.status = '' return " macOS"
self.applied_separator = '' end
self:apply_highlights(default_highlight)
self:apply_section_separators()
return self.status
end
-- Put proper separators and gaps between components in sections if vim.g.xcodebuild_os then
local function process_sections(sections) return "" .. vim.g.xcodebuild_device_name .. " (" .. vim.g.xcodebuild_os .. ")"
for name, section in pairs(sections) do end
local left = name:sub(9, 10) < 'x'
for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do
table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
end
for id, comp in ipairs(section) do
if type(comp) ~= 'table' then
comp = { comp }
section[id] = comp
end
comp.separator = left and { right = '' } or { left = '' }
end
end
return sections
end
local function search_result() return "" .. vim.g.xcodebuild_device_name
if vim.v.hlsearch == 0 then end
return ''
end
local last_search = vim.fn.getreg '/'
if not last_search or last_search == '' then
return ''
end
local searchcount = vim.fn.searchcount { maxcount = 9999 }
return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
end
local function modified() lualine.setup({
if vim.bo.modified then options = {
return '+' globalstatus = true,
elseif vim.bo.modifiable == false or vim.bo.readonly == true then theme = "auto",
return '-' symbols = {
end alternate_file = "#",
return '' directory = "",
end readonly = "",
unnamed = "[No Name]",
require('lualine').setup { newfile = "[New]",
options = { },
theme = 'auto', disabled_buftypes = { "quickfix", "prompt" },
component_separators = '', component_separators = "",
section_separators = { left = '', right = '' }, section_separators = { left = "", right = "" },
}, },
sections = process_sections { sections = {
lualine_a = { 'mode' }, lualine_a = {
lualine_b = { -- { "mode" },
'branch', { "filename" },
'diff', },
{ lualine_b = {
'diagnostics', { "diagnostics" },
source = { 'nvim' }, { "diff" },
sections = { 'error' }, {
diagnostics_color = { error = { bg = colors.red, fg = colors.white } }, "searchcount",
}, maxcount = 999,
{ timeout = 500,
'diagnostics', },
source = { 'nvim' }, },
sections = { 'warn' }, lualine_c = {},
diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } }, lualine_x = {
}, { "' ' .. vim.g.xcodebuild_last_status", color = { fg = "#a6e3a1" } },
{ 'filename', file_status = false, path = 1 }, -- { "'󰙨 ' .. vim.g.xcodebuild_test_plan", color = { fg = "#a6e3a1", bg = "#161622" } },
{ modified, color = { bg = colors.red } }, { xcodebuild_device, color = { fg = "#f9e2af", bg = "#161622" } },
{ },
'%w', lualine_y = {
cond = function() { "branch" },
return vim.wo.previewwindow },
end, lualine_z = {
}, { "location" },
{ },
'%r', },
cond = function() inactive_sections = {
return vim.bo.readonly lualine_a = {},
end, lualine_b = {},
}, lualine_c = { "filename" },
{ lualine_x = {},
'%q', lualine_y = {},
cond = function() lualine_z = {},
return vim.bo.buftype == 'quickfix' },
end, extensions = { "nvim-dap-ui", "quickfix", "trouble", "nvim-tree", "lazy", "mason" },
}, })
}, end,
lualine_c = {},
lualine_x = {},
lualine_y = { search_result, 'filetype' },
lualine_z = { '%l:%c', '%p%%/%L' },
},
inactive_sections = {
lualine_c = { '%f %y %m' },
lualine_x = {},
},
tabline = {},
extensions = {"nvim-tree"}
}
end
} }
-- return {
-- "nvim-lualine/lualine.nvim",
-- config = function()
-- local colors = {
-- red = '#ca1243',
-- grey = '#a0a1a7',
-- black = '#383a42',
-- white = '#f3f3f3',
-- light_green = '#83a598',
-- orange = '#fe8019',
-- green = '#8ec07c',
-- }
--
-- local empty = require('lualine.component'):extend()
-- function empty:draw(default_highlight)
-- self.status = ''
-- self.applied_separator = ''
-- self:apply_highlights(default_highlight)
-- self:apply_section_separators()
-- return self.status
-- end
--
-- -- Put proper separators and gaps between components in sections
-- local function process_sections(sections)
-- for name, section in pairs(sections) do
-- local left = name:sub(9, 10) < 'x'
-- for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do
-- table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
-- end
-- for id, comp in ipairs(section) do
-- if type(comp) ~= 'table' then
-- comp = { comp }
-- section[id] = comp
-- end
-- comp.separator = left and { right = '' } or { left = '' }
-- end
-- end
-- return sections
-- end
--
-- local function search_result()
-- if vim.v.hlsearch == 0 then
-- return ''
-- end
-- local last_search = vim.fn.getreg '/'
-- if not last_search or last_search == '' then
-- return ''
-- end
-- local searchcount = vim.fn.searchcount { maxcount = 9999 }
-- return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
-- end
--
-- local function modified()
-- if vim.bo.modified then
-- return '+'
-- elseif vim.bo.modifiable == false or vim.bo.readonly == true then
-- return '-'
-- end
-- return ''
-- end
--
-- local function xcodebuild_device()
-- if vim.g.xcodebuild_platform == "macOS" then
-- return " macOS"
-- end
--
-- local deviceIcon = ""
-- if vim.g.xcodebuild_platform:match("watch") then
-- deviceIcon = "􀟤"
-- elseif vim.g.xcodebuild_platform:match("tv") then
-- deviceIcon = "􀡴 "
-- elseif vim.g.xcodebuild_platform:match("vision") then
-- deviceIcon = "􁎖 "
-- end
--
-- if vim.g.xcodebuild_os then
-- return deviceIcon .. " " .. vim.g.xcodebuild_device_name .. " (" .. vim.g.xcodebuild_os .. ")"
-- end
--
-- return deviceIcon .. " " .. vim.g.xcodebuild_device_name
-- end
--
--
-- require('lualine').setup {
-- options = {
-- theme = 'auto',
-- component_separators = '',
-- section_separators = { left = '', right = '' },
-- },
-- sections = process_sections {
-- lualine_a = { 'mode' },
-- lualine_b = {
-- 'branch',
-- 'diff',
-- {
-- 'diagnostics',
-- source = { 'nvim' },
-- sections = { 'error' },
-- diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
-- },
-- {
-- 'diagnostics',
-- source = { 'nvim' },
-- sections = { 'warn' },
-- diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
-- },
-- { 'filename', file_status = false, path = 1 },
-- { modified, color = { bg = colors.red } },
-- {
-- '%w',
-- cond = function()
-- return vim.wo.previewwindow
-- end,
-- },
-- {
-- '%r',
-- cond = function()
-- return vim.bo.readonly
-- end,
-- },
-- {
-- '%q',
-- cond = function()
-- return vim.bo.buftype == 'quickfix'
-- end,
-- },
-- },
-- lualine_c = {},
-- lualine_x = {
-- { "' ' .. vim.g.xcodebuild_last_status", color = { fg = "Gray" } },
-- { "'󰙨 ' .. vim.g.xcodebuild_test_plan", color = { fg = "#a6e3a1", bg = "#161622" } },
-- { xcodebuild_device, color = { fg = "#f9e2af", bg = "#161622" } },
-- },
-- lualine_y = { search_result, 'filetype' },
-- lualine_z = { '%l:%c', '%p%%/%L' },
-- },
-- inactive_sections = {
-- lualine_c = { '%f %y %m' },
-- lualine_x = {},
-- },
-- tabline = {},
-- extensions = {"nvim-tree"}
-- }
-- end
-- }

View File

@@ -0,0 +1,45 @@
return {
"L3MON4D3/LuaSnip",
version = "v2.*",
event = "VeryLazy",
config = function()
local ls = require("luasnip")
local types = require("luasnip.util.types")
ls.setup({
history = true,
enable_autosnippets = false,
updatevents = "TextChanged,TextChangedI",
extra_opts = {
[types.choiceNode] = {
active = {
virt_text = { { "choiceNode", "Comment" } },
},
},
},
})
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_lua").lazy_load({ paths = vim.fn.stdpath("config") .. "/snippets" })
-- Keymaps
local opts = { silent = true }
-- Use <Ctrl>k to expand snippets.
-- This will expand the current item or jump to the next item within the snippet.
vim.keymap.set({ "i", "s" }, "<C-k>", function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end, opts)
-- Use <Ctrl>j to jump backwards in a snippet.
-- This always moves to the previous item within a snippet.
vim.keymap.set({ "i", "s" }, "<C-j>", function()
if ls.jumpable(-1) then
ls.jump(-1)
end
end, opts)
-- Reload snippets.
vim.keymap.set("n", "<leader><leader>s", "<CMD>source ~/.config/m-housh/lua/user/plugin/luasnip.lua<CR>")
end,
}

View File

@@ -1,25 +0,0 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
opts = {
close_if_last_window = false,
enable_git_status = true,
enable_diagnostics = true,
filesystem = {
always_show = {
"plugins",
".zshrc",
".zshenv"
},
filtered_items = {
hide_dotfiles = false
},
use_libuv_file_watcher = true
},
}
}

View File

@@ -0,0 +1,71 @@
local function setupListeners()
local dap = require("dap")
local areSet = false
dap.listeners.after["event_initialized"]["me"] = function()
if not areSet then
areSet = true
vim.keymap.set("n", "<leader>dc", dap.continue, { desc = "Continue", noremap = true })
vim.keymap.set("n", "<leader>dC", dap.run_to_cursor, { desc = "Run To Cursor" })
vim.keymap.set("n", "<leader>ds", dap.step_over, { desc = "Step Over" })
vim.keymap.set("n", "<leader>di", dap.step_into, { desc = "Step Into" })
vim.keymap.set("n", "<leader>do", dap.step_out, { desc = "Step Out" })
vim.keymap.set({ "n", "v" }, "<Leader>dh", require("dap.ui.widgets").hover, { desc = "Hover" })
vim.keymap.set({ "n", "v" }, "<Leader>de", require("dapui").eval, { desc = "Eval" })
end
end
dap.listeners.after["event_terminated"]["me"] = function()
if areSet then
areSet = false
vim.keymap.del("n", "<leader>dc")
vim.keymap.del("n", "<leader>dC")
vim.keymap.del("n", "<leader>ds")
vim.keymap.del("n", "<leader>di")
vim.keymap.del("n", "<leader>do")
vim.keymap.del({ "n", "v" }, "<Leader>dh")
vim.keymap.del({ "n", "v" }, "<Leader>de")
end
end
end
return {
"mfussenegger/nvim-dap",
--event = "VeryLazy",
dependencies = {
"wojciech-kulik/xcodebuild.nvim",
},
config = function()
local xcodebuild = require("xcodebuild.integrations.dap")
-- TODO: make sure to set path to your codelldb
local codelldbPath = os.getenv("HOME") .. "/tools/codelldb-aarch64-darwin/extension/adapter/codelldb"
xcodebuild.setup(codelldbPath)
local define = vim.fn.sign_define
define("DapBreakpoint", { text = "", texthl = "DiagnosticError", linehl = "", numhl = "" })
define("DapBreakpointRejected", { text = "", texthl = "DiagnosticError", linehl = "", numhl = "" })
define("DapStopped", { text = "", texthl = "DiagnosticOk", linehl = "", numhl = "" })
define("DapLogPoint", { text = "", texthl = "DiagnosticInfo", linehl = "", numhl = "" })
define("DapLogPoint", { text = "", texthl = "DiagnosticInfo", linehl = "", numhl = "" })
setupListeners()
--when breakpoint is hit, it sets the focus to the buffer with the breakpoint
require("dap").defaults.fallback.switchbuf = "usetab,uselast"
--stylua: ignore start
vim.keymap.set("n", "<leader>dd", xcodebuild.build_and_debug, { desc = "Build & Debug" })
vim.keymap.set("n", "<leader>dr", xcodebuild.debug_without_build, { desc = "Debug Without Building" })
vim.keymap.set("n", "<leader>dt", xcodebuild.debug_tests, { desc = "Debug Tests" })
vim.keymap.set("n", "<leader>dT", xcodebuild.debug_class_tests, { desc = "Debug Class Tests" })
vim.keymap.set("n", "<leader>b", xcodebuild.toggle_breakpoint, { desc = "Toggle Breakpoint" })
vim.keymap.set("n", "<leader>B", xcodebuild.toggle_message_breakpoint, { desc = "Toggle Message Breakpoint" })
--stylua: ignore end
vim.keymap.set("n", "<leader>dx", function()
xcodebuild.terminate_session()
require("dap").listeners.after["event_terminated"]["me"]()
end, { desc = "Terminate debugger" })
end,
}

View File

@@ -0,0 +1,87 @@
return {
"rcarriga/nvim-dap-ui",
dependencies = {
"mfussenegger/nvim-dap",
"nvim-neotest/nvim-nio",
},
lazy = true,
config = function()
require("dapui").setup({
controls = {
element = "repl",
enabled = true,
icons = {
disconnect = "",
run_last = "",
terminate = "⏹︎",
pause = "⏸︎",
play = "",
step_into = "󰆹",
step_out = "󰆸",
step_over = "",
step_back = "",
},
},
floating = {
border = "single",
mappings = {
close = { "q", "<Esc>" },
},
},
icons = {
collapsed = "",
expanded = "",
current_frame = "",
},
layouts = {
{
elements = {
{ id = "stacks", size = 0.25 },
{ id = "scopes", size = 0.25 },
{ id = "breakpoints", size = 0.25 },
{ id = "watches", size = 0.25 },
},
position = "left",
size = 40,
},
{
elements = {
{ id = "repl", size = 0.4 },
{ id = "console", size = 0.6 },
},
position = "bottom",
size = 10,
},
},
})
local dap, dapui = require("dap"), require("dapui")
local group = vim.api.nvim_create_augroup("dapui_config", { clear = true })
-- hide ~ in DAPUI
vim.api.nvim_create_autocmd("BufWinEnter", {
group = group,
pattern = "DAP*",
callback = function()
vim.wo.fillchars = "eob: "
end,
})
vim.api.nvim_create_autocmd("BufWinEnter", {
group = group,
pattern = "\\[dap\\-repl\\]",
callback = function()
vim.wo.fillchars = "eob: "
end,
})
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
end,
}

View File

@@ -0,0 +1,24 @@
return {
"mfussenegger/nvim-lint",
event = { "BufReadPre", "BufNewFile" },
config = function()
local lint = require("lint")
lint.linters_by_ft = {
swift = { "swiftlint" },
}
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufWritePost", "BufReadPost", "InsertLeave", "TextChanged" }, {
group = lint_augroup,
callback = function()
require("lint").try_lint()
end,
})
vim.keymap.set("n", "<leader>ml", function()
require("lint").try_lint()
end, { desc = "[L]int file" })
end,
}

View File

@@ -0,0 +1,68 @@
return {
"stevearc/oil.nvim",
event = "VeryLazy",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
columns = { "icon" },
keymaps = {
["<C-h>"] = false,
["<M-h>"] = "actions.select_split",
["<C-v>"] = {
"actions.select",
opts = { vertical = true },
desc = "Open the entry in a vertical split",
},
},
view_options = {
is_hidden_file = function(name, _) -- second arg is bufnr, but not currently used.
-- Don't show .DS_Store in output.
local is_ds_store = name ~= ".DS_Store"
return not is_ds_store
end,
},
},
keys = {
-- Show the parent directory in current window.
{ "-", "<CMD>Oil<CR>", desc = "Open directory." },
-- Open parent directory in floating window.
{
"<leader>-",
function()
require("oil").toggle_float()
end,
desc = "Open directory in float.",
},
},
-- config = function()
-- require("oil").setup({
-- columns = { "icon" },
-- keymaps = {
-- ["<C-h>"] = false,
-- ["<M-h>"] = "actions.select_split",
-- ["<C-v>"] = {
-- "actions.select",
-- opts = { vertical = true },
-- desc = "Open the entry in a vertical split",
-- },
-- },
-- view_options = {
-- is_hidden_file = function(name, _) -- second arg is bufnr, but not currently used.
-- -- Don't show .DS_Store in output.
-- local is_ds_store = name ~= ".DS_Store"
-- return not is_ds_store
-- end,
-- },
-- })
--
-- -- Show the parent directory in current window.
-- vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory." })
--
-- -- Open parent directory in floating window.
-- vim.keymap.set("n", "<space>-", require("oil").toggle_float)
--
-- -- Old habits die hard, map what used to toggle neo-tree to just open a float.
-- vim.keymap.set("n", "<C-n>", require("oil").toggle_float)
-- end,
}

View File

@@ -1,15 +1,16 @@
return { return {
'm-housh/swift.nvim', "m-housh/swift.nvim",
dependencies = { dependencies = {
'akinsho/toggleterm.nvim' "akinsho/toggleterm.nvim",
}, },
ft = { 'swift' }, ft = { "swift" },
config = function() config = function()
require('swift').setup() require("swift").setup()
local default_options = { noremap = true, silent = true } local default_options = { noremap = true, silent = true }
local actions = require('swift.actions') local actions = require("swift.actions")
vim.opt.tabstop = 2
vim.keymap.set('n', '<c-b>', actions.build, default_options) vim.opt.shiftwidth = 2
vim.keymap.set('n', '<c-u>', actions.test, default_options) vim.keymap.set("n", "<C-b>", actions.build, default_options)
end vim.keymap.set("n", "<C-S-U>", actions.test, default_options)
} end,
}

View File

@@ -1,72 +1,102 @@
return { return {
'nvim-telescope/telescope.nvim', "nvim-telescope/telescope.nvim",
branch = '0.1.x', branch = "0.1.x",
dependencies = { dependencies = {
'nvim-lua/plenary.nvim' "nvim-lua/plenary.nvim",
}, },
lazy = true, lazy = true,
config = function() config = function()
local actions = require('telescope.actions') local actions = require("telescope.actions")
local builtin = require("telescope.builtin")
require('telescope').setup({ require("telescope").setup({
defaults = { ensure_installed = {
file_ignore_patterns = {"node_modules", "%.jpg", "%.png", ".swiftpm"}, "swift",
vimgrep_arguments = { },
'rg', defaults = {
'--follow', file_ignore_patterns = { "node_modules", "%.jpg", "%.png", ".swiftpm" },
'--color=never', vimgrep_arguments = {
'--no-heading', "rg",
'--with-filename', "--follow",
'--line-number', "--color=never",
'--column', "--no-heading",
'--smart-case' "--with-filename",
}, "--line-number",
mappings = { "--column",
i = { "--smart-case",
-- Close on first esc instead of gonig to normal mode },
["<esc>"] = actions.close, mappings = {
["<A-q>"] = actions.send_selected_to_qflist, i = {
["<C-q>"] = actions.send_to_qflist, -- Close on first esc instead of going to normal mode
["<s-tab>"] = actions.toggle_selection + actions.move_selection_next, ["<esc>"] = actions.close,
["<tab>"] = actions.toggle_selection + actions.move_selection_previous, ["<A-q>"] = actions.send_selected_to_qflist,
}, ["<C-q>"] = actions.send_to_qflist,
n = { ["<s-tab>"] = actions.toggle_selection + actions.move_selection_next,
["<s-tab>"] = actions.toggle_selection + actions.move_selection_next, ["<tab>"] = actions.toggle_selection + actions.move_selection_previous,
["<tab>"] = actions.toggle_selection + actions.move_selection_previous, ["<C-j>"] = actions.move_selection_next,
["<A-q>"] = actions.send_selected_to_qflist, ["<C-k>"] = actions.move_selection_previous,
["<C-q>"] = actions.send_to_qflist, },
}, n = {
}, ["<C-j>"] = actions.move_selection_next,
prompt_prefix = "", ["<C-k>"] = actions.move_selection_previous,
selection_caret = "", ["<s-tab>"] = actions.toggle_selection + actions.move_selection_next,
entry_prefix = " ", ["<tab>"] = actions.toggle_selection + actions.move_selection_previous,
initial_mode = "insert", ["<A-q>"] = actions.send_selected_to_qflist,
selection_strategy = "reset", ["<C-q>"] = actions.send_to_qflist,
sorting_strategy = "descending", },
layout_strategy = "flex", },
layout_config = { prompt_prefix = "",
width = 0.75, selection_caret = "",
prompt_position = "bottom", entry_prefix = " ",
preview_cutoff = 120, initial_mode = "insert",
horizontal = { mirror = false }, selection_strategy = "reset",
vertical = { mirror = true }, sorting_strategy = "descending",
}, layout_strategy = "flex",
file_sorter = require'telescope.sorters'.get_fuzzy_file, layout_config = {
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter, width = 0.75,
-- path_display = true, -- strange behaviour not showing the files in result window prompt_position = "bottom",
winblend = 0, preview_cutoff = 120,
border = {}, horizontal = { mirror = false },
borderchars = { '', '', '', '', '', '', '', '' }, vertical = { mirror = true },
color_devicons = true, },
use_less = true, file_sorter = require("telescope.sorters").get_fuzzy_file,
set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil, generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
file_previewer = require'telescope.previewers'.vim_buffer_cat.new, -- path_display = true, -- strange behaviour not showing the files in result window
grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new, winblend = 0,
qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new, border = {},
borderchars = { "", "", "", "", "", "", "", "" },
color_devicons = true,
use_less = true,
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
-- Developer configurations: Not meant for general override -- Developer configurations: Not meant for general override
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
} },
}) })
end
local map = function(keys, action, desc)
local opts = { silent = true, noremap = true, desc = desc }
vim.keymap.set("n", keys, action, opts)
end
local find_files = function(dir)
return function()
builtin.find_files({ cwd = dir, hidden = true, no_ignore = true })
end
end
vim.keymap.set("n", "<C-A-j>", builtin.jumplist, { silent = true, noremap = true, desc = "Open [J]ump List." })
map("<leader>ff", builtin.find_files, "[F]ind [F]iles")
map("<leader>fg", builtin.live_grep, "[F]ind [G]rep")
map("<leader>fb", builtin.buffers, "[F]ind [B]uffers")
map("<leader>fh", builtin.help_tags, "[F]ind [H]elp")
map("<leader>fd", find_files("$DOTFILES"), "[F]ind [D]otfiles")
map("<leader>fn", find_files("$DOTFILES/nvim/m-housh"), "[F]ind [N]vim file")
map("<leader>fs", find_files("$DOTFILES/scripts/scripts"), "[F]ind [S]cript")
map("<leader>fz", find_files("$DOTFILES/zsh/config"), "[F]ind [Z]sh config file")
map("<leader>gf", builtin.git_files, "Find [G]it [F]iles")
end,
} }

View File

@@ -1,5 +1,29 @@
return { return {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = {
opts = { } "nvim-lua/plenary.nvim",
"folke/trouble.nvim",
},
opts = {},
config = function()
local todos = require("todo-comments")
todos.setup({
keywords = {
-- Adds the important keyword, I primarily use this in markdown
-- documents to be able to jump and color appropriately.
FIX = { alt = { "IMPORTANT" } },
},
})
vim.keymap.set("n", "<leader>tq", "<CMD>Trouble todo toggle<CR>", { desc = "[T]odo [Q]uick fix list." })
vim.keymap.set("n", "<leader><leader>t", "<CMD>TodoTelescope<CR>", { desc = "[T]odo telescope list." })
vim.keymap.set("n", "<leader>tl", "<CMD>TodoLocList<CR>", { desc = "[T]odo [L]ocation list." })
vim.keymap.set("n", "]t", function()
todos.jump_next()
end, { desc = "Next [T]odo" })
vim.keymap.set("n", "[t", function()
todos.jump_prev()
end, { desc = "Previous [T]odo" })
end,
} }

View File

@@ -1,78 +1,78 @@
return { return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
dependencies = { dependencies = {
'nvim-telescope/telescope-fzf-native.nvim', "nvim-telescope/telescope-fzf-native.nvim",
'nvim-treesitter/nvim-treesitter-textobjects', "nvim-treesitter/nvim-treesitter-textobjects",
}, },
build = ':TSUpdate', build = ":TSUpdate",
event = { 'BufReadPre', 'BufNewFile' }, event = { "BufReadPre", "BufNewFile" },
config = function() config = function()
require('nvim-treesitter.configs').setup { require("nvim-treesitter.configs").setup({
ensure_installed = { ensure_installed = {
"bash", "bash",
"cmake", "cmake",
"dockerfile", "dockerfile",
"go", "go",
"hcl", "hcl",
"html", "html",
"java", "java",
"javascript", "javascript",
"json", "json",
"latex", "latex",
"ledger", "ledger",
"llvm", "llvm",
"lua", "lua",
"make", "make",
"markdown", "markdown",
"python", "python",
"swift", "swift",
"toml", "toml",
"xml", "xml",
"yaml" "yaml",
}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages }, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
ignore_install = {}, -- List of parsers to ignore installing ignore_install = {}, -- List of parsers to ignore installing
highlight = { highlight = {
enable = true, -- false will disable the whole extension enable = true, -- false will disable the whole extension
disable = {} -- list of language that will be disabled disable = {}, -- list of language that will be disabled
}, },
incremental_selection = { incremental_selection = {
enable = true, enable = true,
keymaps = { keymaps = {
init_selection = "<CR>", init_selection = "<CR>",
scope_incremental = "<CR>", scope_incremental = "<CR>",
node_incremental = "<TAB>", node_incremental = "<TAB>",
node_decremental = "<S-TAB>" node_decremental = "<S-TAB>",
} },
}, },
indent = {enable = true}, indent = { enable = true },
autopairs = {{enable = true}}, autopairs = { { enable = true } },
textobjects = { textobjects = {
select = { select = {
enable = true, enable = true,
-- Automatically jump forward to textobj, similar to targets.vim -- Automatically jump forward to textobj, similar to targets.vim
lookahead = true, lookahead = true,
keymaps = { keymaps = {
-- You can use the capture groups defined in textobjects.scm -- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer", ["af"] = "@function.outer",
["if"] = "@function.inner", ["if"] = "@function.inner",
["ac"] = "@class.outer", ["ac"] = "@class.outer",
["ic"] = "@class.inner", ["ic"] = "@class.inner",
["al"] = "@loop.outer", ["al"] = "@loop.outer",
["il"] = "@loop.inner", ["il"] = "@loop.inner",
["ib"] = "@block.inner", ["ib"] = "@block.inner",
["ab"] = "@block.outer", ["ab"] = "@block.outer",
["ir"] = "@parameter.inner", ["ir"] = "@parameter.inner",
["ar"] = "@parameter.outer", ["ar"] = "@parameter.outer",
["a="] = "@assignment.outer", ["a="] = "@assignment.outer",
["i="] = "@assignment.inner", ["i="] = "@assignment.inner",
} },
} },
}, },
rainbow = { rainbow = {
enable = true, enable = true,
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
max_file_lines = 2000 -- Do not enable for files with more than specified lines max_file_lines = 2000, -- Do not enable for files with more than specified lines
} },
} })
end end,
} }

View File

@@ -0,0 +1,46 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
event = { "BufReadPre", "BufNewFile" },
keys = {
{ "<leader>d", "<cmd>Trouble diagnostics toggle<cr>", { desc = "Trouble [D]iagnostics" } },
{ "<leader>dq", "<cmd>Trouble quickfix toggle<cr>", { desc = "Trouble [Q]uikfix." } },
{ "<leader>dl", "<cmd>Trouble loclist toggle<cr>", { desc = "Trouble [L]ocation list" } },
},
opts = {},
config = function()
require("trouble").setup({
auto_open = false,
auto_close = false,
auto_preview = true,
auto_jump = false,
mode = "quickfix",
severity = vim.diagnostic.severity.ERROR,
cycle_results = false,
})
vim.api.nvim_create_autocmd("User", {
pattern = { "XcodebuildBuildFinished", "XcodebuildTestsFinished" },
callback = function(event)
if event.data.cancelled then
return
end
if event.data.success then
require("trouble").close()
elseif not event.data.failedCount or event.data.failedCount > 0 then
if next(vim.fn.getqflist()) then
require("trouble").open("quickfix")
else
require("trouble").close()
end
require("trouble").refresh()
end
end,
})
-- Jump to diagnostic issues across the whole project.
vim.keymap.set("n", "<A-d>", "<cmd>silent cc | silent cn<cr>zz", { desc = "Jump to next issue" })
vim.keymap.set("n", "<A-s>", "<cmd>silent cc | silent cp<cr>zz", { desc = "Jump to previous issue" })
end,
}

View File

@@ -0,0 +1,81 @@
local progress_handle
return {
"wojciech-kulik/xcodebuild.nvim",
event = "VeryLazy",
--branch = "fix/issue-249",
dependencies = {
"nvim-telescope/telescope.nvim",
"MunifTanjim/nui.nvim",
},
config = function()
require("xcodebuild").setup({
show_build_progress_bar = false,
logs = {
auto_open_on_success_tests = false,
auto_open_on_failed_tests = false,
auto_open_on_success_build = false,
auto_open_on_failed_build = false,
auto_focus = false,
auto_close_on_app_launch = true,
only_summary = true,
notify = function(message, severity)
local fidget = require("fidget")
if progress_handle then
progress_handle.message = message
if not message:find("Loading") then
progress_handle:finish()
progress_handle = nil
if vim.trim(message) ~= "" then
fidget.notify(message, severity)
end
end
else
fidget.notify(message, severity)
end
end,
notify_progress = function(message)
local progress = require("fidget.progress")
if progress_handle then
progress_handle.title = ""
progress_handle.message = message
else
progress_handle = progress.handle.create({
message = message,
lsp_client = { name = "xcodebuild.nvim" },
})
end
end,
},
code_coverage = {
enabled = true,
},
})
-- stylua: ignore start
vim.keymap.set("n", "<leader>X", "<cmd>XcodebuildPicker<cr>", { desc = "Show Xcodebuild Actions" })
vim.keymap.set("n", "<leader>xf", "<cmd>XcodebuildProjectManager<cr>", { desc = "Show Project Manager Actions" })
vim.keymap.set("n", "<leader>xb", "<cmd>XcodebuildBuild<cr>", { desc = "Build Project" })
vim.keymap.set("n", "<leader>xB", "<cmd>XcodebuildBuildForTesting<cr>", { desc = "Build For Testing" })
vim.keymap.set("n", "<leader>xr", "<cmd>XcodebuildBuildRun<cr>", { desc = "Build & Run Project" })
vim.keymap.set("n", "<leader>xt", "<cmd>XcodebuildTest<cr>", { desc = "Run Tests" })
vim.keymap.set("v", "<leader>xt", "<cmd>XcodebuildTestSelected<cr>", { desc = "Run Selected Tests" })
vim.keymap.set("n", "<leader>xT", "<cmd>XcodebuildTestClass<cr>", { desc = "Run This Test Class" })
vim.keymap.set("n", "<leader>xl", "<cmd>XcodebuildToggleLogs<cr>", { desc = "Toggle Xcodebuild Logs" })
vim.keymap.set("n", "<leader>xc", "<cmd>XcodebuildToggleCodeCoverage<cr>", { desc = "Toggle Code Coverage" })
vim.keymap.set("n", "<leader>xC", "<cmd>XcodebuildShowCodeCoverageReport<cr>", { desc = "Show Code Coverage Report" })
vim.keymap.set("n", "<leader>xe", "<cmd>XcodebuildTestExplorerToggle<cr>", { desc = "Toggle Test Explorer" })
vim.keymap.set("n", "<leader>xs", "<cmd>XcodebuildFailingSnapshots<cr>", { desc = "Show Failing Snapshots" })
vim.keymap.set("n", "<leader>xd", "<cmd>XcodebuildSelectDevice<cr>", { desc = "Select Device" })
vim.keymap.set("n", "<leader>xp", "<cmd>XcodebuildSelectTestPlan<cr>", { desc = "Select Test Plan" })
vim.keymap.set("n", "<leader>xq", "<cmd>Telescope quickfix<cr>", { desc = "Show QuickFix List" })
vim.keymap.set("n", "<leader>xx", "<cmd>XcodebuildQuickfixLine<cr>", { desc = "Quickfix Line" })
vim.keymap.set("n", "<leader>xa", "<cmd>XcodebuildCodeActions<cr>", { desc = "Show Code Actions" })
end,
}

View File

@@ -1,72 +1,47 @@
-- Bootstrap Lazy. -- Bootstrap Lazy.
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
"git", "git",
"clone", "clone",
"--filter=blob:none", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git", "https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release "--branch=stable", -- latest stable release
lazypath, lazypath,
}) })
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
dev = { dev = {
path = '~/LocalProjects/plugins', path = "~/LocalProjects/plugins",
fallback = true fallback = true,
}, },
-- Import all the plugin configs in the 'plugin' directory
-- Theme -- { import = "user.plugin" },
{ import = 'user.plugin.theme' }, -- Plugins that don't have a configuration file.
{
-- Completions -- "folke/zen-mode.nvim",
{ import = 'user.plugin.cmp' }, opts = {},
},
-- Git -- {
{ import = 'user.plugin.lazygit' }, "christoomey/vim-tmux-navigator",
lazy = false,
-- LSP, formatting, etc. -- },
{ 'folke/neodev.nvim', opts = {} }, { "NoahTheDuke/vim-just", ft = { "just" } },
{ import = 'user.plugin.lsp' }, {
{ import = 'user.plugin.lualine' }, "chipsenkbeil/distant.nvim",
{ import = 'user.plugin.treesitter' }, version = "v0.*",
{ import = 'user.plugin.formatter' }, event = "VeryLazy",
{ import = 'user.plugin.go' }, },
--{'fladson/vim-kitty', lazy=true, }, }, {
checker = {
-- Navigation -- enabled = true,
{ import = 'user.plugin.neo-tree' }, notify = false,
{ import = 'user.plugin.telescope' }, },
change_detection = {
-- Utilities -- notify = false,
{ import = 'user.plugin.comment' }, },
{ import = 'user.plugin.noice' },
{ import = 'user.plugin.swift' },
{ import = 'user.plugin.toggleterm' },
{ import = 'user.plugin.which-key' },
{ import = 'user.plugin.wrapping' },
{
"folke/zen-mode.nvim",
opts = { }
},
{
"christoomey/vim-tmux-navigator",
lazy = false,
},
{
"NMAC427/guess-indent.nvim",
opts = { }
},
{ import = 'user.plugin.todo-comments' },
{ "NoahTheDuke/vim-just", ft = { "just" } },
{
'chipsenkbeil/distant.nvim',
branch = 'v0.3',
config = function()
require('distant'):setup()
end
},
}) })
vim.keymap.set("n", "<leader>ll", "<CMD>Lazy<CR>", { desc = "Open [L]azy" })

View File

@@ -2,7 +2,8 @@ local o = vim.opt
local wo = vim.wo local wo = vim.wo
local fn = vim.fn local fn = vim.fn
vim.cmd.set('inccommand=split') vim.cmd.set("inccommand=split")
o.filetype = "on"
o.updatetime = 500 -- faster completion o.updatetime = 500 -- faster completion
o.timeoutlen = 800 -- time to wait for a mapped sequence to complete (in milliseconds) o.timeoutlen = 800 -- time to wait for a mapped sequence to complete (in milliseconds)
o.ttimeoutlen = 300 -- Time in milliseconds to wait for a key code sequence to complete o.ttimeoutlen = 300 -- Time in milliseconds to wait for a key code sequence to complete
@@ -33,7 +34,7 @@ o.shiftwidth = 2 -- the number of spaces inserted for each indentation
o.tabstop = 2 -- how many columns a tab counts for o.tabstop = 2 -- how many columns a tab counts for
o.termguicolors = true -- set term gui colors (most terminals support this) o.termguicolors = true -- set term gui colors (most terminals support this)
o.cursorline = true -- highlight the current line o.cursorline = true -- highlight the current line
o.scrolloff = 8 -- Minimal number of screen lines to keep above and below the cursor o.scrolloff = 20 -- Minimal number of screen lines to keep above and below the cursor
o.sidescrolloff = 5 -- The minimal number of columns to scroll horizontally o.sidescrolloff = 5 -- The minimal number of columns to scroll horizontally
o.hlsearch = false -- highlight all matches on previous search pattern o.hlsearch = false -- highlight all matches on previous search pattern
o.ignorecase = true -- ignore case in search patterns o.ignorecase = true -- ignore case in search patterns
@@ -47,7 +48,7 @@ wo.colorcolumn = "99999"
o.wildmode = "full" o.wildmode = "full"
o.lazyredraw = false -- do not redraw screen while running macros o.lazyredraw = false -- do not redraw screen while running macros
o.grepprg = "rg --hidden --vimgrep --smart-case --" o.grepprg = "rg --hidden --vimgrep --smart-case --"
o.completeopt = {"menu", "menuone", "noselect", "noinsert"} -- A comma separated list of options for Insert mode completion o.completeopt = { "menu", "menuone", "noselect", "noinsert" } -- A comma separated list of options for Insert mode completion
o.wildignorecase = true -- When set case is ignored when completing file names and directories o.wildignorecase = true -- When set case is ignored when completing file names and directories
o.wildignore = [[ o.wildignore = [[
.git,.hg,.svn .git,.hg,.svn
@@ -62,4 +63,4 @@ o.wildignore = [[
*.swp,.lock,.DS_Store,._* *.swp,.lock,.DS_Store,._*
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**" */tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
]] ]]
o.viminfo="" -- disable viminfo from copying information from current session, for security. o.viminfo = "" -- disable viminfo from copying information from current session, for security.

View File

@@ -0,0 +1,17 @@
-- Setup snippets here.
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local ms = ls.multi_snippet
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local t = ls.text_node
ls.add_snippets("lua", {
s("hello", {
t('print("hello '),
i(1),
t(' world")'),
}),
})

View File

@@ -0,0 +1,34 @@
-- Setup snippets here.
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local ms = ls.multi_snippet
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local t = ls.text_node
ls.add_snippets("lua", {
-- Setup a new snippet file.
s("sf", {
t({
"-- Setup snippets.",
'local ls = require("luasnip")',
"local s = ls.snippet",
"local sn = ls.snippet_node",
"local ms = ls.multi_snippet",
"local i = ls.insert_node",
"local f = ls.function_node",
"local c = ls.choice_node",
"local t = ls.text_node",
"-- Add snippets",
}),
t('ls.add_snippets("'),
i(1, "<file-type>"),
t({
'", {',
"\t-- Define snippets here.",
"})",
}),
}),
})

View File

@@ -0,0 +1,131 @@
-- Setup snippets.
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local ms = ls.multi_snippet
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local t = ls.text_node
local fmt = require("luasnip.extras.fmt").fmt
local rep = require("luasnip.extras").rep
-- Add snippets
ls.add_snippets("swift", {
-- Add a dependency snippet.
s({ trig = "@d", desc = "Add a dependency." }, fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })),
-- Add a dependency client.
s(
{
trig = "@dc",
desc = "Add a dependency client.",
},
fmt(
[[
public extension DependencyValues {{
var {}: {} {{
get {{ self[{}.self] }}
set {{ self[{}.self] = newValue }}
}}
}}
@DependencyClient
public struct {} {{
// Insert interface here.
{}
}}
extension {}: TestDependencyKey {{
public static let testValue: {} = Self()
}}
]],
{
i(1, "<name>"),
i(2, "<Dependency>"),
rep(2),
rep(2),
rep(2),
i(0),
rep(2),
rep(2),
}
)
),
s(
{ trig = "str", desc = "Add a struct" },
fmt(
[[
struct {}: {} {{
{}
}}
]],
{ i(1, "<Name>"), i(2, "<Protocols>"), i(0) }
)
),
-- Decorate a type or function with an @_spi(...)
s({ trig = "@_s", desc = "Add spi modifier." }, fmt("@_spi({})", { i(1, "name") })),
-- Add an @_spi(...) import ...
s(
{ trig = "@_si", desc = "Import with spi." },
fmt(
[[
@_spi({}) import {}
{}
]],
{ i(1, "name"), i(2, "module"), i(0) }
)
),
-- Document a function
-- TODO: add dynamic number of prameters.
s(
{ trig = "docf", desc = "Document a function." },
fmt(
[[
/// {}
///
/// - Parameters:
/// - {}: {}
]],
{ i(1, "A short description."), i(2, "<param>"), i(3, "Describe the parameter.") }
)
),
-- Add a parameter to a documentation string.
s(
{ trig = "param", desc = "Add a parameter to documentation" },
fmt(
[[
/// - {}: {}
]],
{ i(1, "<param>"), i(2, "<description>") }
)
),
-- Add a withDependencies
s(
{ trig = "wd", desc = "withDependencies" },
fmt(
[[
withDependencies {{
$0.{} = {}
}} operation: {{
@Dependency(\.{}) var {}
{}
}}
]],
{
i(1, "<dependency>"),
i(2, "<override>"),
rep(1),
rep(1),
i(0),
}
)
),
})

View File

@@ -9,3 +9,8 @@ CFM
Hydronic Hydronic
subpar subpar
quo quo
IAQ
wc
HVAC
dehumidification
ansible

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,48 @@
#!/bin/zsh -l
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title pass-attribute
# @raycast.mode compact
# Optional parameters:
# @raycast.icon 🗝️
# @raycast.argument1 { "type": "text", "placeholder": "Key" }
# @raycast.argument2 { "type": "text", "placeholder": "For" }
# @raycast.packageName Password
# Documentation:
# @raycast.description Get an attribute / key from the password store
# @raycast.author Michael Housh
# @raycast.authorURL https://github.com/m-housh
PREFIX="$HOME/.local/share/password-store"
PASS="$(command -v pass)"
#
# Begin program
#
[ -z "$PASS" ] && \
echo "Error: pass utility not found." && \
exit 1
key="$1"
file="$2"
selected=$(find "$PREFIX" -type f -name "$file.gpg")
# Check if we found a password file at the path.
[ -z "$selected" ] && \
echo "Path not found: $file" && \
exit 1
# Sanitize the path to work with the pass command.
selected="${selected//$PREFIX\//}"
selected="${selected//.gpg/}"
# Capture the result of searching for the key.
result=$("$PASS" get "$key" "$selected")
[ -z "$result" ] && echo "Key not found" && exit 1
echo "$result" | pbcopy
echo "$key: Copied to clipboard"

View File

@@ -0,0 +1,47 @@
#!/bin/zsh -l
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title pass-copy
# @raycast.mode compact
# Optional parameters:
# @raycast.icon 🔐
# @raycast.argument1 { "type": "text", "placeholder": "For" }
# @raycast.packageName Password
# Documentation:
# @raycast.description Copy password from password-store
# @raycast.author Michael Housh
# @raycast.authorURL https://github.com/m-housh
PREFIX="$HOME/.local/share/password-store"
LOG=/tmp/pass-copy.out
ISOSEC="$HOME/.local/share/scripts/isosec"
PASS="$(command -v pass)"
_log() {
echo "$($ISOSEC) $1" >> "$LOG"
}
#
# Begin program
#
[ -z "$PASS" ] && \
echo "Error: pass utility not found." && \
_log "Error: pass utility not found." && \
exit 1
selected=$(find "$PREFIX" -type f -name "$1".gpg)
[ -z "$selected" ] && \
_log "Error: Not Found" && \
_log "Input: $1" && \
exit 1
selected="${selected//$PREFIX\//}"
selected="${selected//.gpg/}"
_log "Running pass with selection: $selected"
"$PASS" --clip "$selected"

View File

@@ -0,0 +1,33 @@
#!/bin/zsh -l
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title pass-gen
# @raycast.mode compact
# Optional parameters:
# @raycast.icon 🔐
# @raycast.argument1 { "type": "text", "placeholder": "Path" }
# @raycast.packageName Password
# Documentation:
# @raycast.description Copy password from password-store
# @raycast.author Michael Housh
# @raycast.authorURL https://github.com/m-housh
PREFIX="$HOME/.local/share/password-store"
PASS="$(command -v pass)"
[ -z "$PASS" ] && \
echo "Error: pass utility not found." && \
exit 1
[ -z "$1" ] && \
echo "Error: must supply a name/path for the password" && \
exit 1
"$PASS" generate --clip "$1"
_log "Ending"

View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Raycast Script Command Template
#
# Duplicate this file and remove ".template." from the filename to get started.
# See full documentation here: https://github.com/raycast/script-commands
#
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title My First Script
# @raycast.mode fullOutput
#
# Optional parameters:
# @raycast.icon 🤖
# @raycast.packageName Raycast Scripts
echo "Hello from My First Script"

View File

@@ -2,20 +2,22 @@
# Adapted from: https://github.com/ThePrimeagen/.dotfiles/blob/master/bin/.local/scripts/tmux-sessionizer # Adapted from: https://github.com/ThePrimeagen/.dotfiles/blob/master/bin/.local/scripts/tmux-sessionizer
DEBUG= debug="${DEBUG}"
#################### Options #################### #################### Options ####################
declare -a paths=() declare -a paths=()
declare chooseOpt= declare chooseOpt=
declare -a directory=()
zparseopts -D -- \ zparseopts -D -- \
{c,-choose}=chooseOpt {c,-choose}=chooseOpt \
{d,-directory}:=directory
#################### Helpers #################### #################### Helpers ####################
function debug_print { function debug_print {
if [ -n "$DEBUG" ]; then if [ -n "$debug" ]; then
echo "DEBUG: $1" echo "DEBUG: $1"
fi fi
} }
@@ -39,9 +41,21 @@ function setup_fuzzy_find_paths() {
debug_print "paths: $paths" debug_print "paths: $paths"
} }
function create_session() {
local selected_name=$1
local selected=$2
tmux new-session -ds "$selected_name" -c "$selected" -n "editor"
tmux send-keys -t editor 'n' Enter
tmux new-window -d -n "terminal" -c "$selected"
tmux new-window -d -n 'files' -c "$selected"
tmux send-keys -t files 'yazi' Enter
}
#################### MAIN #################### #################### MAIN ####################
declare choose="${chooseOpt[-1]}" declare choose="${chooseOpt[-1]}"
declare selected=
if [[ -n $choose ]]; then if [[ -n $choose ]]; then
debug_print "Choose from existing." debug_print "Choose from existing."
@@ -49,6 +63,14 @@ if [[ -n $choose ]]; then
tmux list-sessions -F \#S | gum filter \ tmux list-sessions -F \#S | gum filter \
--placeholder "Pick a session..." --placeholder "Pick a session..."
) )
elif [ ${#directory} -gt 0 ]; then
debug_print "Using directory option."
selected=${directory[-1]}
if [ "$selected" = "." ] || [ "$selected" = "" ]; then
selected="${PWD}"
fi
debug_print "Directory: $selected"
elif [[ "$#" -eq 1 ]]; then elif [[ "$#" -eq 1 ]]; then
debug_print "Using existing session: $1" debug_print "Using existing session: $1"
selected=$1 selected=$1
@@ -72,14 +94,19 @@ selected_name=$(basename "$selected" | tr . _)
tmux_running=$(pgrep tmux) tmux_running=$(pgrep tmux)
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
tmux new-session -s "$selected_name" -c "$selected" create_session "$selected_name" "$selected"
exit 0 # tmux new-session -s "$selected_name" -c "$selected"
# exit 0
elif ! tmux has-session -t "$selected_name" 2> /dev/null; then
create_session "$selected_name" "$selected"
fi fi
# Create a session if it doesn't exist. # Create a session if it doesn't exist.
if ! tmux has-session -t "$selected_name" 2> /dev/null; then # if ! tmux has-session -t "$selected_name" 2> /dev/null; then
tmux new-session -ds "$selected_name" -c "$selected" # tmux new-session -ds "$selected_name" -c "$selected" -n "editor"
fi # tmux send-keys -t editor 'n' Enter
# tmux new-window -d -n "terminal" -c "$selected"
# fi
[ -z $TMUX ] && tmux attach -t "$selected_name" \ [ -z $TMUX ] && tmux attach -t "$selected_name" \
|| tmux switch-client -t "$selected_name" || tmux switch-client -t "$selected_name"

View File

@@ -0,0 +1,79 @@
#!/usr/bin/env zsh
#
# An adapter script to use gopass to store and retrieve passwords for ansible vault.
#
# When calling from ansible vault it get's passed --vault-id [ID] which is the id
# of the secret to retrieve.
#
local secretPath="ansible"
function usage() {
cat <<EOF
An adapter script that integrates gopass as storage for ansible vault id's.
To retreive a secret based on the vault id, then pass the '--vault-id' flag with an
associated [ID] to look for. (This is generally handled / passed in by the ansible-vault
command)
You can also call this script with the '--set' flag and an [ID] argument
to create a new secret for the given id. The default behavior of the
set option is to prompt for the secret, you can optionally pass the '--generate'
flag to automatically generate a secret. If an [ID] argument is not supplied to
the set option then we will prompt for the id to store the secret under.
Secrets are stored in the default password store at '$secretPath/<ID>'.
Usage: vault-gopass-client [-s | --set] [-g | --generate] [--vault-id <ID>] [ID]
-s | --set: Set a new secret for the given ID.
-g | --generate: Used with the set option to automatically generate the secret.
--vault-id <ID>: Used to retrieve a secret for the given ID.
-h | --help: Show this usage message.
Examples:
# Automatically generate a secret for the 'foo' id.
$ vault-gopass --set --generate foo
# Retrieve the secret for 'foo' and print it to stdout.
$ vault-gopass --vault-id foo
EOF
}
# parse the passed in options, failing if unrecognized options are given.
zparseopts -D -E -F - \
g=generateFlag -generate=generateFlag \
h=helpFlag -help=helpFlag \
s=setFlag -set=setFlag \
-vault-id:=vaultId \
|| exit 1
# check for the help flag, show usage and exit.
[ ${#helpFlag} = 1 ] && usage && exit 0
if [ ${#vaultId} = 2 ]; then
# we received the vault-id option, so we print the
# secret to stdout
password=$(gopass show --password "$secretPath/${vaultId[-1]}")
echo "$password"
exit 0
elif [ ${#setFlag} = 1 ]; then
# Use the first argument as the id, we ask for an id
# if not supplied.
local id=$1
if [ "$id" = "" ]; then
read -r id\?"Vault ID: "
fi
# Check for generate flag to automatically generate a password.
[ ${#generateFlag} = 1 ] \
&& gopass generate "$secretPath/$id" 24 \
&& exit 0
# Insert a password prompting the user to supply it.
gopass insert "$secretPath/$id"
fi

View File

@@ -1,63 +1,66 @@
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
39666435313433363934613839323232343930306538313561363334343230643736363733383262 36386431326264346262396233353265336630626364653932343439343531663635366436656637
3138386437383132393037643561346235653464653363390a356431646266316263393433366434 3633613465313232613061653031353332353763626233370a373034393230393733343231313734
66633066383465306338613433616237373963323463323538316437666262653461303133643763 34616431343331653763653362306631393036393165336363326463633338386230653133313061
3863366261376239320a306135616533616336343935613164636231313135366561353531646538 3238393235386461390a376237663766323437353633303138626631656163353665656534363066
63376539383637343565346465633138653431356363333463656365393430303338393636363866 63303864393437343539346532373366353335303436643465393138363332366335636232663334
63313732373238656664376132376334376634303964616537613638363261623832386663393831 38333262613162663261663039653330643036343666636261626166346139346532346163633563
62326332656136613433653338383339333232376431303931343930396464656566633537306563 64653639343634343535323532646430636563623435363065386561643434333630356133636435
64323733306164386639613333333935623534613065363630363030613236336164373561636362 63343135393130356362643561626434636562313562386630363636653161343663343031343330
64613339323637333962383163376263343438373232373066623738373762616137323731353738 65636339356639383062356333323232633333636434643138663136366632313431366132373264
38613861313632346566376436356634383033646563333766373336376364373333306264383835 65373237623066643336386232616565366634643865643238383632653735616134303466346463
64316138336133666361306562343566353439653630306632346633616531663535353133623966 62663064666364636566643963653836663737393537326462343639303736643536313335653238
39376234646136656561393738663836316233633866313365653739346261353130353861636534 38306230363262323634353563616662333336636563636233393864633136363730393136636664
39393462356231326661303636343761386466336438346331636639626636653064346164623465 34653862633639353631323239343463303331656636623537356635316434323932373831346431
30383034323166336330643461313535643931313038363766653736303930363865613566393537 32333338393763383237373062383138366332363439336466663636386631636361356333353333
66326332643163656161383930396636306639333062323439366666333131653866633862663539 36656133343637336131396564343032373930353962373331333231616537326262313039643862
32383131333936306130396537656662663835643537333734376431643466663333636262333233 63343638656636373239393564333365636636346565376631303431616530343639653835653766
34343337653234656465626530646132646433656261623637323363326462636232313162313638 32656433376235646661393463383564626362373364306539373062383264653130323139386332
38373835363037396566643635343734643835323833663065303363373963363634363338343861 62373634633635653833653835613037663234313134616565666663303263623930306232313436
62623363663636616663633862333730326432633130333666353365313930323036343531666634 36646534306635626166333933636538383766633730626236363737333463643564616437386138
32333136616532336637366662613333313030306339393331646132353437366136656234643466 35663738326161643863383135643565326336653131636539303632393237336462383434303137
39326364313263326536613530393164366436643666343136316163383833366662383764323963 61653230643861333834376135323864323834323938343964653433336265353134396133653165
61373863343663666337643464616164653264396230623735346237376633313736626261656232 30646139626138643565356166316566306634663265386535623665633333653930643338336232
38616566356633313261373032386263623861653165646634653731653336313435346234646366 32383932363332396438653435636365343564366464613065326633393136393030323338633632
31396661313330613963336633366165396534393434333737336166363237653338323035346237 61636264383135363435383239653466633339313863626665326566356634313635643462396163
36633133636438343137323136383364336338353534373134313337626665353163626630316463 66383738306132656163643438613665663833353638326532346439336465353365613338313934
64396363396137653566356236623961656535323962616162363337363038396566623437626130 61386335313338383130376431323734383731623038616161386363373334333232626337333939
30343766373532633437333663663637316132363835383230303631393063396431326161633739 38363265383538633135643535373731346261343165306665333234613133343763623261653634
65323762333337656362653930386666353664356234643335613566656637353530366534343032 39643565376264373431323337363166393362336630323038626139343930383034376262613432
66303231653466323635353836636539356638663035636339383362643535626463643061653135 33643733333531363136363631323933616433666336653335373365343333333438333063633935
64323261353135373563333263346361376538653537363166336432313134373139383235396463 65643562303634386365336436653630636662343865376433393735323631616363383566616231
66376665353063633262356333343639333435346463306235663031333232653430396437643662 36333935316139653864323333333665326163356538363564633532393839346138646666353534
39303938616634383733303630343430616231353630656361336466316162306231333833623832 61626131313336643365323030343933613566303036373039373461323633313235386263383662
36386163323239353263383361343666333966323532653131393064633531363738373966373233 62333063343462383338656264663364323039356161366165306631663334373438653433373030
35313130393261353862306565353564323338343366313130323162396164646437303534633530 64353361653032626163376135313264323861636636656539363533626437383939383963383639
38353338343466623738326534333735316338626239316666363935336365633332323238333836 36653637663135313132323536633864633561626436393336333963376439363131363766613863
39393462313962663265663531336365396534643531383936316261623035616564306566376464 37373462366538363536623465346265663731663739613766623665376361316630663630366337
38353031396432383165316233303934666639313733383536323161343063393161313264633466 31316236373561643536646533373238623763633630343663643461373366623835356234643030
38373563396637656638326563353536653130363362623366646137326164393165313734396533 61356331383838316564636530656634353264663031393539386532623239336565656564346261
35373965613261633934633265373836326631626239623463383863626163636665343364356132 31646463383431666462643366653535393736313462323437376262326464323537616663663433
61363039313135353535326635393161626262663062303035623136313738353030336132636231 30323233613937353738666432356663326232383632333366646330323431616436393361323536
66323435386534333233333465616333633261613762643535336561323736613230613034366534 36663063386634383966363632656364323035613231303362383339646237396438633037366539
62343433333237333266353765383631333831316164316164323932646463353232336432663335 65383165333238633337313339663231623164656435623966336236666365653361393934353938
61346135356436616339353162306131653735376535393865613738326130326130363830623036 65353438386139346364336263316666343632353736356230663830363062316336396136393065
65663764346134373566613436316666623637323035346630666362633337316532366261326135 64306336643939343631386231343436353131393463636564636361323332666666613863323232
30353135373466376434333561396163313131363036376233616137646463373761633235393138 31356132363631373363656361326230666564366130393063333862616334653932373266306538
38333964643238656539666332656236363734663937386338626235333032333065636338353236 65616630373738333837623934653763336230323263616666616338373530663862313136613231
30396238636231643131636465393966346236383235336162616632626336653562643566353337 66363439376231336532373736613638333632306337346161623430656130636362656235613637
35616234383331306162656536303934393834313933653735633263653364303362323031323939 33376338663765396235653138626638663763303433623764363633323263623431386262663334
33393261306565323333626263356363613332376434643635623864373839356536393234656534 65393934316236343434336334373639396437656265653736636135306464663631373461326636
30636338643963343032333464633837626164663236616466316337383364633866326333313635 63316435623762623463383563363331396262383236396433666562336332633963663630616236
38653433366266323135326332613335636664363163326334366339656139623738333738656262 65303362346162373233663065646137353135643336313239643662613537346263653839666564
37323532653263393061323631656137656433353231613363633763353830656235383561366233 63623833346463313965636135373538323362356634363632366361393536363766653032633661
36393963366537313731303537313031353730336563343561653962623464386338396538313937 62656164393331623662646230343030633162613235666232613164643837616264656239383062
34383135356337626435333332663035366665633430613531313132376237363339373031376564 61336532383035363932363730623239353063373264386564656265323736363737396431346330
37646461633431646532663230626161303661353464373263363336303661353565383864626266 30376631636437303765623063303566313038653239343264313837383136303033343834306461
37643465323063313439366434303338363036623765343838383231663937396665343464303839 31366564333635386634653834663866643861396664303132313435333135623361396232643164
64373630643764663431316364656464626133323232383364306565343066336162656236366562 31663137656461623765313961313830373438363738306232313263386363616336623763663736
36323763343138613763393964386664303634303136376531666139666435353361376135666235 33646639343239353331616564653130303338373536663464363832376362366361663438366138
35646463383433333130366339643664373665396135366166643837373037303333353562613637 65633738363662373266326638616366326463313837333733346462333235356235306166663262
34303831323162663933616262316566313064376131626266383235336663353233656634386539 62333735323563613963336335613462646664663561393436643530356339323737343265323637
34633965633366336538313739383962326565646432633234653563653534306261323133363865 66663136393033356661613065363030653535393966326637626637316261356135353631653562
3730626461336461613339656364633033666234633264636465 65626233316534646137333936346134303761323034303736366633613066353333656165326662
63363766613963346633613861333266353663333665373362643638326263633236396338373961
66636361363633623238663565376637373433363966616237393936336534656161333065666461
36333834653465636666316639333733656463363437646439376634386463643134

180
starship/starship.toml Normal file
View File

@@ -0,0 +1,180 @@
"$schema" = 'https://starship.rs/config-schema.json'
command_timeout = 1000
format = """
[](color_orange)\
$os\
$username\
$hostname\
[](bg:color_pink fg:color_orange)\
$directory\
[](fg:color_pink bg:color_lavender)\
$git_branch\
$git_status\
[](fg:color_lavender bg:color_blue)\
$c\
$rust\
$golang\
$nodejs\
$php\
$java\
$kotlin\
$haskell\
$python\
[](fg:color_blue bg:color_bg3)\
$docker_context\
$conda\
[](fg:color_bg3 bg:color_green)\
$time\
[ ](fg:color_green)\
$line_break$character"""
palette = 'catppuccin_mocha'
[palettes.catppuccin_mocha]
color_fg0 = '#cad3f5'
color_bg1 = '#1e2030'
color_bg3 = '#24273a'
color_blue = '#8aadf4'
color_aqua = '#94e2d5'
color_green = '#a6e3a1'
color_orange = '#f5a97f'
color_purple = '#c6a0f6'
color_lavender = '#b4befe'
color_red = '#ed8796'
color_yellow = '#eed49f'
color_grey = '#585b70'
color_maroon = '#eba0ac'
color_pink = '#f5c2e7'
[os]
disabled = false
style = "bold bg:color_orange fg:color_fg0"
[os.symbols]
Windows = "󰍲"
Ubuntu = "󰕈"
SUSE = ""
Raspbian = "󰐿"
Mint = "󰣭"
Macos = "󰀵"
Manjaro = ""
Linux = "󰌽"
Gentoo = "󰣨"
Fedora = "󰣛"
Alpine = ""
Amazon = ""
Android = ""
Arch = "󰣇"
Artix = "󰣇"
CentOS = ""
Debian = "󰣚"
Redhat = "󱄛"
RedHatEnterprise = "󱄛"
[username]
show_always = true
style_user = "bold bg:color_orange fg:color_grey"
style_root = "bold bg:color_orange fg:color_grey"
format = '[ $user ]($style)'
[hostname]
ssh_only = true
format = '[$ssh_symbol : $hostname](bold bg:color_orange fg:color_grey)'
disabled = false
[directory]
style = "bold fg:color_grey bg:color_pink"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"
truncate_to_repo = true
[directory.substitutions]
"Documents" = "󰈙 "
"Downloads" = " "
"Music" = "󰝚 "
"Pictures" = " "
"Developer" = "󰲋 "
[git_branch]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol $branch ](bold fg:color_grey bg:color_lavender)]($style)'
[git_status]
style = "bg:color_blue"
format = '[[($all_status$ahead_behind )](bold fg:color_grey bg:color_lavender)]($style)'
[nodejs]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[c]
symbol = " "
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[rust]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[golang]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[php]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[java]
symbol = " "
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[kotlin]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[haskell]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[python]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[docker_context]
symbol = ""
style = "bg:color_bg3"
format = '[[ $symbol( $context) ](fg:#83a598 bg:color_bg3)]($style)'
[conda]
style = "bg:color_bg3"
format = '[[ $symbol( $environment) ](fg:#83a598 bg:color_bg3)]($style)'
[time]
disabled = false
time_format = "%R"
style = "bg:color_green"
format = '[[  $time ](bold fg:color_grey bg:color_green)]($style)'
[line_break]
disabled = false
[character]
disabled = false
success_symbol = '[](bold fg:color_green)'
error_symbol = '[](bold fg:color_red)'
vimcmd_symbol = '[](bold fg:color_green)'
vimcmd_replace_one_symbol = '[](bold fg:color_purple)'
vimcmd_replace_symbol = '[](bold fg:color_purple)'
vimcmd_visual_symbol = '[](bold fg:color_yellow)'

View File

@@ -70,12 +70,13 @@ bind-key -r K kill-pane
bind -n S-Left previous-window bind -n S-Left previous-window
bind -n S-Right next-window bind -n S-Right next-window
bind -n M-h previous-window bind -n M-h previous-window
bind -n M-L next-window bind -n M-l next-window
bind C-l send-keys 'C-l' bind C-l send-keys 'C-l'
bind f run-shell "tmux display-popup -E -w 80% -h 80% ~/.local/scripts/tmux-sessionator" bind f run-shell "tmux display-popup -E -w 80% -h 80% ~/.local/scripts/tmux-sessionator"
bind-key -r C run-shell -b "~/.local/scripts/tmux-sessionator ~/.dotfiles" bind-key -r C run-shell -b "~/.local/scripts/tmux-sessionator ~/.dotfiles"
bind S run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/session.sh switch" unbind s
bind s run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/session.sh switch"
# reload new changes # reload new changes
bind-key r source-file ~/.config/tmux/tmux.conf\; \display-message "source-file done" bind-key r source-file ~/.config/tmux/tmux.conf\; \display-message "source-file done"
@@ -88,24 +89,68 @@ set -g @plugin 'tmux-plugins/tmux-yank'
#set -g @plugin 'erikw/tmux-powerline' #set -g @plugin 'erikw/tmux-powerline'
set -g @plugin 'christoomey/vim-tmux-navigator' set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'catppuccin/tmux' set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @catppuccin_flavour 'mocha' # latte, frappe, macchiato, mocha # Configure Catppuccin
set -g @catppuccin_window_left_separator "" set -g @catppuccin_flavor "macchiato"
set -g @catppuccin_window_right_separator " " set -g @catppuccin_status_background "none"
set -g @catppuccin_window_middle_separator " █" set -g @catppuccin_window_status_style "none"
set -g @catppuccin_window_number_position "right" set -g @catppuccin_pane_status_enabled "off"
set -g @catppuccin_window_default_fill "number" set -g @catppuccin_pane_border_status "off"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#W"
set -g @catppuccin_status_modules_right "directory session"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator ""
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_directory_text "#{pane_current_path}" # Configure Online
set -g @online_icon "ok"
set -g @offline_icon "nok"
# Needs to stay at the bottom. # status left look and feel
run '~/.config/tmux/plugins/tpm/tpm' set -g status-left-length 100
set -g status-left ""
set -ga status-left "#{?client_prefix,#{#[bg=#{@thm_red},fg=#{@thm_bg},bold]  #S },#{#[bg=#{@thm_bg},fg=#{@thm_green}]  #S }}"
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_overlay_0},none]│"
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_maroon}]  #{pane_current_command} "
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_overlay_0},none]│"
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_blue}]  #{=/-32/...:#{s|$USER|~|:#{b:pane_current_path}}} "
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_overlay_0},none]#{?window_zoomed_flag,│,}"
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_yellow}]#{?window_zoomed_flag,  zoom ,}"
# status right look and feel
set -g status-right-length 100
set -g status-right ""
set -ga status-right "#{?#{e|>=:10,#{battery_percentage}},#{#[bg=#{@thm_red},fg=#{@thm_bg}]},#{#[bg=#{@thm_bg},fg=#{@thm_pink}]}} #{battery_icon} #{battery_percentage} "
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_overlay_0}, none]│"
set -ga status-right "#[bg=#{@thm_bg}]#{?#{==:#{online_status},ok},#[fg=#{@thm_mauve}] 󰖩 on ,#[fg=#{@thm_red},bold]#[reverse] 󰖪 off }"
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_overlay_0}, none]│"
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_blue}] 󰭦 %Y-%m-%d 󰅐 %H:%M "
# bootstrap tpm
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Configure Tmux
set -g status-position top
set -g status-style "bg=#{@thm_bg}"
set -g status-justify "absolute-centre"
# pane border look and feel
setw -g pane-border-status top
setw -g pane-border-format ""
setw -g pane-active-border-style "bg=#{@thm_bg},fg=#{@thm_overlay_0}"
setw -g pane-border-style "bg=#{@thm_bg},fg=#{@thm_surface_0}"
setw -g pane-border-lines single
# window look and feel
set -wg automatic-rename on
set -g automatic-rename-format "Window"
set -g window-status-format " #I#{?#{!=:#{window_name},Window},: #W,} "
set -g window-status-style "bg=#{@thm_bg},fg=#{@thm_rosewater}"
set -g window-status-last-style "bg=#{@thm_bg},fg=#{@thm_peach}"
set -g window-status-activity-style "bg=#{@thm_red},fg=#{@thm_bg}"
set -g window-status-bell-style "bg=#{@thm_red},fg=#{@thm_bg},bold"
set -gF window-status-separator "#[bg=#{@thm_bg},fg=#{@thm_overlay_0}]│"
set -g window-status-current-format " #I#{?#{!=:#{window_name},Window},: #W,} "
set -g window-status-current-style "bg=#{@thm_peach},fg=#{@thm_bg},bold"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

View File

@@ -1,8 +1,8 @@
local wezterm = require('wezterm') local wezterm = require("wezterm")
local config = {} local config = {}
if wezterm.config_builder then if wezterm.config_builder then
config = wezterm.config_builder() config = wezterm.config_builder()
end end
--config.color_scheme = 'rose-pine' --config.color_scheme = 'rose-pine'
@@ -12,29 +12,30 @@ end
-- background = "#131111" -- background = "#131111"
-- } -- }
config.color_scheme = 'Catppuccin Mocha' config.color_scheme = "Catppuccin Mocha"
-- Font -- Font
config.font = wezterm.font_with_fallback { config.font = wezterm.font_with_fallback({
'JetBrains Mono', "JetBrains Mono",
'Inconsolata Nerd Font Mono', "Inconsolata Nerd Font Mono",
} })
config.font_size = 16.0 config.font_size = 16.0
-- Window -- Window
config.adjust_window_size_when_changing_font_size = false config.adjust_window_size_when_changing_font_size = false
config.enable_scroll_bar = false config.enable_scroll_bar = false
config.initial_cols = 150 config.initial_cols = 150
config.initial_rows= 80 config.initial_rows = 80
config.window_padding = { config.window_padding = {
left = 5, left = 10,
right = 5, right = 5,
top = 0, top = 0,
bottom = 0 bottom = 0,
} }
config.window_close_confirmation = 'NeverPrompt' config.window_close_confirmation = "NeverPrompt"
--config.window_decorations = 'TITLE' --config.window_decorations = 'TITLE'
-- Set higher fps
config.max_fps = 120
-- Tab Bar -- Tab Bar
config.show_tabs_in_tab_bar = true config.show_tabs_in_tab_bar = true

193
yazi/theme.toml Normal file
View File

@@ -0,0 +1,193 @@
# https://github.com/yazi-rs/flavors.git
# Catpuccin - Mocha
# : Manager {{{
[manager]
cwd = { fg = "#94e2d5" }
# Hovered
hovered = { reversed = true }
preview_hovered = { underline = true }
# Find
find_keyword = { fg = "#f9e2af", bold = true, italic = true, underline = true }
find_position = { fg = "#f5c2e7", bg = "reset", bold = true, italic = true }
# Marker
marker_copied = { fg = "#a6e3a1", bg = "#a6e3a1" }
marker_cut = { fg = "#f38ba8", bg = "#f38ba8" }
marker_marked = { fg = "#94e2d5", bg = "#94e2d5" }
marker_selected = { fg = "#f9e2af", bg = "#f9e2af" }
# Tab
tab_active = { reversed = true }
tab_inactive = {}
tab_width = 1
# Count
count_copied = { fg = "#1e1e2e", bg = "#a6e3a1" }
count_cut = { fg = "#1e1e2e", bg = "#f38ba8" }
count_selected = { fg = "#1e1e2e", bg = "#f9e2af" }
# Border
border_symbol = "│"
border_style = { fg = "#7f849c" }
# : }}}
# : Mode {{{
[mode]
normal_main = { fg = "#1e1e2e", bg = "#89b4fa", bold = true }
normal_alt = { fg = "#89b4fa", bg = "#313244" }
# Select mode
select_main = { fg = "#1e1e2e", bg = "#a6e3a1", bold = true }
select_alt = { fg = "#a6e3a1", bg = "#313244" }
# Unset mode
unset_main = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true }
unset_alt = { fg = "#f2cdcd", bg = "#313244" }
# : }}}
# : Status bar {{{
[status]
separator_open = ""
separator_close = ""
# Progress
progress_label = { fg = "#ffffff", bold = true }
progress_normal = { fg = "#89b4fa", bg = "#45475a" }
progress_error = { fg = "#f38ba8", bg = "#45475a" }
# Permissions
perm_sep = { fg = "#7f849c" }
perm_type = { fg = "#89b4fa" }
perm_read = { fg = "#f9e2af" }
perm_write = { fg = "#f38ba8" }
perm_exec = { fg = "#a6e3a1" }
# TODO: -- remove these once Yazi 0.4 gets released
separator_style = { fg = "#313244", bg = "#313244" }
mode_normal = { fg = "#1e1e2e", bg = "#89b4fa", bold = true }
mode_select = { fg = "#1e1e2e", bg = "#a6e3a1", bold = true }
mode_unset = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true }
permissions_t = { fg = "#89b4fa" }
permissions_r = { fg = "#f9e2af" }
permissions_w = { fg = "#f38ba8" }
permissions_x = { fg = "#a6e3a1" }
permissions_s = { fg = "#7f849c" }
# TODO: remove these once Yazi 0.4 gets released --
# : }}}
# : Pick {{{
[pick]
border = { fg = "#89b4fa" }
active = { fg = "#f5c2e7", bold = true }
inactive = {}
# TODO: -- remove these once Yazi 0.4 gets released
[select]
border = { fg = "#89b4fa" }
active = { fg = "#f5c2e7", bold = true }
inactive = {}
# TODO: remove these once Yazi 0.4 gets released --
# : }}}
# : Input {{{
[input]
border = { fg = "#89b4fa" }
title = {}
value = {}
selected = { reversed = true }
# : }}}
# : Completion {{{
[completion]
border = { fg = "#89b4fa" }
# : }}}
# : Tasks {{{
[tasks]
border = { fg = "#89b4fa" }
title = {}
hovered = { fg = "#f5c2e7", underline = true }
# : }}}
# : Which {{{
[which]
mask = { bg = "#313244" }
cand = { fg = "#94e2d5" }
rest = { fg = "#9399b2" }
desc = { fg = "#f5c2e7" }
separator = "  "
separator_style = { fg = "#585b70" }
# : }}}
# : Help {{{
[help]
on = { fg = "#94e2d5" }
run = { fg = "#f5c2e7" }
hovered = { reversed = true, bold = true }
footer = { fg = "#313244", bg = "#cdd6f4" }
# : }}}
# : Notify {{{
[notify]
title_info = { fg = "#a6e3a1" }
title_warn = { fg = "#f9e2af" }
title_error = { fg = "#f38ba8" }
# : }}}
# : File-specific styles {{{
[filetype]
rules = [
# Images
{ mime = "image/*", fg = "#94e2d5" },
# Media
{ mime = "{audio,video}/*", fg = "#f9e2af" },
# Archives
{ mime = "application/*zip", fg = "#f5c2e7" },
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#f5c2e7" },
# Documents
{ mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#a6e3a1" },
# Fallback
{ name = "*", fg = "#cdd6f4" },
{ name = "*/", fg = "#89b4fa" }
]
# : }}}

3
yazi/yazi.toml Normal file
View File

@@ -0,0 +1,3 @@
[manager]
show_hidden = true
show_symlink = true

View File

@@ -3,16 +3,16 @@
# This includes general default environment variables, local overrides may be stored # This includes general default environment variables, local overrides may be stored
# in `$XDG_DATA_HOME/zsh/env.zsh`. # in `$XDG_DATA_HOME/zsh/env.zsh`.
# XDG # XDG Directories
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state" export XDG_STATE_HOME="$HOME/.local/state"
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
# Config # Config
export ZDOTDIR="$HOME/.config/zsh" export ZDOTDIR="$HOME/.config/zsh"
export ZFUNCDIR="$ZDOTDIR/functions" export ZFUNCDIR="$ZDOTDIR/functions"
export SHELL="$(which zsh)" export SHELL="$(command -v zsh)"
export TERM=xterm-256color export TERM=xterm-256color
export EDITOR=nvim export EDITOR=nvim
export VISUAL=nvim export VISUAL=nvim
@@ -26,38 +26,31 @@ export GITUSER="m-housh"
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1 export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
# Directories # Directories
export ANSIBLE_LOCAL="$REPOS/ansible"
export ANSIBLE_GEN_DIR="$ANSIBLE_LOCAL/ansible-gen-playbook"
export ANSIBLE_MACOS_PLAYBOOK_DIR="$HOME/ansible-macos-playbook"
export ARCHIVE="/Volumes/Archive" export ARCHIVE="/Volumes/Archive"
export BUCKET="/Volumes/Bucket" export BUCKET="/Volumes/Bucket"
export REPOS="$BUCKET/Repos" export DOTFILES="$HOME/.dotfiles"
export GHREPOS="$REPOS/github.com/$GITUSER"
export HHEREPOS="$REPOS/github.com/hhe-dev"
export LOCAL_REPOS="$REPOS/local"
export LOCAL_ENV="$XDG_DATA_HOME/zsh/env.zsh"
export HCP_NOTES="$HHEREPOS/hcp-notes"
export HXZET="$BUCKET/Repos/github.com/hvac-hx/hx-zets"
export HAAS="$BUCKET/Repos/github.com/haas"
export HAASZET="$HAAS/zets"
export DOCUMENTS="$HOME/Documents" export DOCUMENTS="$HOME/Documents"
export DOWNLOADS="$HOME/Downloads" export DOWNLOADS="$HOME/Downloads"
export PDFS="$HOME/Library/Mobile Documents/com~apple~Preview/Documents" export GHREPOS="$REPOS/github.com"
export PROPOSALS="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work/Proposals" export LOCAL_REPOS="$REPOS/local"
export SCREENSHOTS="$BUCKET/Pictures/Screenshots" export LOCAL_ENV="$XDG_DATA_HOME/zsh/env.zsh"
export DOTFILES="$HOME/.dotfiles"
export SCRIPTS="$HOME/.local/scripts"
export WORK="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work"
export ZETDIR="$GHREPOS/zets"
export MYZSHRC="$ZDOTDIR/.zshrc" export MYZSHRC="$ZDOTDIR/.zshrc"
export NAP_CONFIG="$HOME/.config/nap/config.yaml" export NAP_CONFIG="$HOME/.config/nap/config.yaml"
export SKELETONDIR="$DOTFILES/skeleton" export PDFS="$HOME/Library/Mobile Documents/com~apple~Preview/Documents"
export ANSIBLE_GEN_DIR="$GHREPOS/ansible/ansible-gen-playbook" export PROPOSALS="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work/Proposals"
export ANSIBLE_MACOS_PLAYBOOK_DIR="$GHREPOS/ansible/ansible-macos-playbook" export REPOS="/Volumes/Bucket/Repos"
export SCREENSHOTS="$BUCKET/Pictures/Screenshots"
export SCRIPTS="$XDG_DATA_HOME/scripts"
export SITES="$GHREPOS/sites" export SITES="$GHREPOS/sites"
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store" export SKELETONDIR="$DOTFILES/skeleton"
export PASSWORD_STORE_GENERATED_LENGTH=40 export WORK="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work"
export ZETDIR="$GHREPOS/zets"
# NPM # NPM
export NPM_CONFIG_CACHE="$HOME/.local/npm" export NPM_CONFIG_CACHE="$XDG_DATA_HOME/npm"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc" export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
# Go # Go
@@ -84,11 +77,23 @@ export PSQL_HISTORY="$XDG_DATA_HOME/psql_history"
export VAULT_ADDR="https://vault.housh.dev" export VAULT_ADDR="https://vault.housh.dev"
# Ansible # Ansible
export ANSIBLE_LOCAL="$GHREPOS/ansible"
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible" export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
export ANSIBLE_VAULT_PASSWORD_FILE="$XDG_DATA_HOME/ansible/.vaultpwd" export ANSIBLE_VAULT_PASSWORD_FILE="$SCRIPTS/vault-gopass-client"
export DEFAULT_VAULT_PASSWORD_FILE="$XDG_DATA_HOME/ansible/.vaultpwd" export DEFAULT_VAULT_PASSWORD_FILE="$SCRIPTS/vault-gopass-client"
# Tmux-Sessionator path. # Tmux-Sessionator path.
export TMUX_SESSIONATOR_PATH="$HOME:$SCRIPTS:$LOCAL_REPOS:$REPOS:$GH_REPOS" export TMUX_SESSIONATOR_PATH="$HOME:$SCRIPTS:$LOCAL_REPOS:$REPOS:$ANSIBLE_LOCAL:$GHREPOS:$HVACIOTREPOS"
# Password-store
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
export PASSWORD_STORE_GENERATED_LENGTH=40
export PASSWORD_STORE_ENABLE_EXTENSIONS=true
# GPG-TUI
export GPG_TUI_CONFIG="$XDG_CONFIG_HOME/gpg-tui/gpg-tui.toml"
export GPG_TTY=$(tty)
# Starship Prompt
export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/starship.toml"
[ -f "$LOCAL_ENV" ] && source "$LOCAL_ENV"

View File

@@ -61,8 +61,10 @@ path_prepend \
"/usr/local/bin" \ "/usr/local/bin" \
"/opt/homebrew/bin" \ "/opt/homebrew/bin" \
"/opt/homebrew/sbin" \ "/opt/homebrew/sbin" \
"$HOME/.local/share/gem/bin" \
"$GOROOT/bin" \ "$GOROOT/bin" \
"$GOPATH/bin" \ "$GOPATH/bin" \
"$XDG_DATA_HOME/bin" \
"$HOME/.local/bin" \ "$HOME/.local/bin" \
"$SCRIPTS" "$SCRIPTS"
@@ -71,7 +73,7 @@ fpath_prepend \
"$(brew --prefix)/share/zsh/site-functions" \ "$(brew --prefix)/share/zsh/site-functions" \
"$(brew --prefix)/share/zsh-completions" \ "$(brew --prefix)/share/zsh-completions" \
"$ZDOTDIR/completions" \ "$ZDOTDIR/completions" \
"$HOME/.local/completions" \ "$HOME/.local/share/zsh/completions" \
"$ZDOTDIR/functions" "$ZDOTDIR/functions"
autoload -Uz $fpath[1]/*(.:t) autoload -Uz $fpath[1]/*(.:t)
@@ -96,7 +98,7 @@ export HISTFILE=$ZDOTDIR/history
setopt autocd setopt autocd
# NOTE: This may be overriden in local env overrides (typically located in $XDG_DATA_HOME/zsh/env.zsh # NOTE: This may be overriden in local env overrides (typically located in $XDG_DATA_HOME/zsh/env.zsh
export CDPATH=".:$GHREPOS:$GHREPOS/ansible:$REPOS/github.com:$DOTFILES:$LOCAL_REPOS:$HOME" export CDPATH=".:$REPOS:$REPOS/ansible:$DOTFILES:$LOCAL_REPOS:$BUCKET:$HOME"
#------------------------------ options ------------------------------ #------------------------------ options ------------------------------
# (see `man zshoptions`) # (see `man zshoptions`)
@@ -120,24 +122,35 @@ _source_if "${ZDOTDIR}/zsh-functions"
# Plugins # Plugins
zsh_add_plugin "zsh-users/zsh-autosuggestions" zsh_add_plugin "zsh-users/zsh-autosuggestions"
zsh_add_plugin "zsh-users/zsh-syntax-highlighting" zsh_add_plugin "zsh-users/zsh-syntax-highlighting"
zsh_add_plugin "Aloxaf/fzf-tab"
#------------------------------ completions ------------------------------ #------------------------------ completions ------------------------------
# case insensitive path-completion # case insensitive path-completion
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
# partial completion suggestions # partial completion suggestions
zstyle ':completion:*' list-suffixeszstyle ':completion:*' expand prefix suffix zstyle ':completion:*' list-suffixes
#zstyle ':completion:*' expand prefix suffix
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
zstyle ':completion:*' menu select
autoload -Uz compinit; compinit # zstyle(s) should be added before this. autoload -Uz compinit; compinit # zstyle(s) should be added before this.
zmodload zsh/complist zmodload zsh/complist
_comp_options+=(globdots) # Include hidden files. _comp_options+=(globdots) # Include hidden files.
autoload bashcompinit && bashcompinit
[[ -r "$PASSWORD_STORE_DIR/.extensions/completions/extensions.bash.completion" ]] && \
source "$PASSWORD_STORE_DIR/.extensions/completions/extensions.bash.completion"
_source_if "$ZDOTDIR/plugins/fzf-tab/fzf-tab.plugin.zsh"
#------------------------------ prompt ------------------------------ #------------------------------ prompt ------------------------------
# Prompt / managed by brew. (`brew install pure`) # Prompt / managed by brew. (`brew install starship`)
autoload -Uz promptinit; promptinit autoload -Uz promptinit; promptinit
prompt pure eval "$(starship init zsh)"
#prompt pure
#------------------------------ aliases ------------------------------ #------------------------------ aliases ------------------------------
@@ -163,12 +176,22 @@ alias hnc='hugo new content' # generate new hugo site content quickly
alias j='just' # run justfile's quickly. alias j='just' # run justfile's quickly.
alias l='ls -lahH --color=auto' # better ls command. alias l='ls -lahH --color=auto' # better ls command.
alias lfs='ls -lahH --color=auto "$ZDOTDIR/functions"' # List functions. alias lfs='ls -lahH --color=auto "$ZDOTDIR/functions"' # List functions.
alias ls='ls --color'
alias pass='gopass'
alias p='gopass' # run the pass command quickly.
alias pf='pass fzf' # fuzzy find a password quickly and copy selection to clipboard.
alias pg='gopass show' # get an attribute of a password file quickly.
alias pgc='gopass show --clip' # get an attribute of a password file and copy to the clipboard.
alias reload='exec zsh -l' # reload the shell, useful when making changes. alias reload='exec zsh -l' # reload the shell, useful when making changes.
alias s='swift' # shorthand to access swift commands
alias st='swift test' # swift test
alias sb='swift build' # swift build
alias t='tmux' # access tmux quickly alias t='tmux' # access tmux quickly
alias tka='tmux kill-server' # kill tmux server and all sessions. alias tka='tmux kill-server' # kill tmux server and all sessions.
alias ts='~/.local/scripts/tmux-sessionator' # create new tmux session, fuzzy finding common locations. alias ts='$SCRIPTS/tmux-sessionator' # create new tmux session, fuzzy finding common locations.
alias tss='~/.local/scripts/tmux-sessionator --choose' # attach to an existing tmux session. alias tss='$SCRIPTS/tmux-sessionator --choose' # attach to an existing tmux session.
alias tls='tmux list-sessions' # list tmux sessions alias tls='tmux list-sessions' # list tmux sessions
alias tks='tmux kill-session -t' # kill tmux session
alias temp='cd $(mktemp -d)' # create a temporary directory and move into it. alias temp='cd $(mktemp -d)' # create a temporary directory and move into it.
alias vi='nvim' # set vi to open neovim alias vi='nvim' # set vi to open neovim
alias newf='"$SCRIPTS"/newx --function' # generate a new shell function alias newf='"$SCRIPTS"/newx --function' # generate a new shell function
@@ -179,11 +202,15 @@ alias nvim-kickstart='NVIM_APPNAME=kickstart nvim' # set neovim to use kickst
alias nvim-lazy='NVIM_APPNAME=lazy nvim' # set neovim to use lazy config. alias nvim-lazy='NVIM_APPNAME=lazy nvim' # set neovim to use lazy config.
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" # set wget history location. alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" # set wget history location.
# NOTE: This needs to stay near the bottom, or it doesn't work properly.
# Use fzf in history / search contexts.
source <(fzf --zsh)
#------------------------------ local configs ------------------------------ #------------------------------ local configs ------------------------------
# TODO: The .zshrc-local is a legacy location and should be removed once my machines are # TODO: The .zshrc-local is a legacy location and should be removed once my machines are
# use the new location in XDG_DATA_HOME. # use the new location in XDG_DATA_HOME.
# HACK: These need to stay here, otherwise environment overrides do not work properly # HACK: These need to stay here, otherwise environment overrides do not work properly
# I tried sourcing them in the the `.zshenv` files, but did not work. # I tried sourcing them in the the `.zshenv` files, but did not work.
_source_if "$ZDOTDIR/.zshrc-local" _source_if "$ZDOTDIR/.zshrc-local"
_source_if "$LOCAL_ENV" _source_if "$LOCAL_ENV"

View File

@@ -9,36 +9,9 @@
# the current working directory. # the current working directory.
function tns() { function tns() {
local directory=$1
local session_name= if [ -n "$directory" ]; then
local tmux_dir= directory=${PWD}
# parse the session, if based on the directory of the argument passed in.
# otherwise use the current directory.
[ -n "$1" ] && \
session_name=$(basename "$1" | tr . _) && \
tmux_dir="$1"
[ -z "$session_name" ] \
&& session_name=$(basename "$PWD" | tr . _) && \
tmux_dir="$PWD"
tmux_running=$(pgrep tmux)
# check if tmux is not running / attached to a session.
# if not, then create a new session.
if [ -z $TMUX ] && [ -z $tmux_running ]; then
tmux new-session -s "$session_name" -c "$tmux_dir" && return 0
fi fi
tmux-sessionator --directory "$directory"
# create a session if it doesn't exist, in the background, so
# that we can switch sessions.
if ! tmux has-session -t "$session_name" 2> /dev/null; then
tmux new-session -ds "$session_name" -c "$tmux_dir"
fi
# attach to the session or switch if it already exists.
[ -z $TMUX ] && \
tmux attach -t "$session_name" \
|| tmux switch-client -t "$session_name"
} }