mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
Compare commits
96 Commits
6759e4e85b
...
lazynvim
| Author | SHA1 | Date | |
|---|---|---|---|
|
ee7854eafc
|
|||
|
ef961fcfa8
|
|||
|
6d44edc94d
|
|||
|
381d272da1
|
|||
|
38e77e8fcd
|
|||
|
2a5c2cdc58
|
|||
|
0949f9e9fa
|
|||
|
2c7bd9123f
|
|||
|
f325d61131
|
|||
|
ae13738a4d
|
|||
|
6c84428179
|
|||
|
d27f2ad490
|
|||
|
ea7033bea8
|
|||
|
a835414bd1
|
|||
|
82341d87df
|
|||
|
9e48ba0a77
|
|||
|
3518ba059f
|
|||
|
c8e869c853
|
|||
|
b1633707c2
|
|||
|
5f45954d98
|
|||
|
4fb2b70004
|
|||
|
a86116056f
|
|||
|
f43cd2c543
|
|||
|
48d0e16f6a
|
|||
|
27d66acb6e
|
|||
|
af77a986e2
|
|||
|
1dd7460ac4
|
|||
|
3badd6a046
|
|||
|
0a9e065b4d
|
|||
|
8ac60b4196
|
|||
|
7f26013d1c
|
|||
|
42cef6e0c4
|
|||
|
241c43767c
|
|||
|
4b39a3eb95
|
|||
|
1e427911ac
|
|||
|
0c15983dae
|
|||
|
68d3f5a183
|
|||
|
d9ea8d80c6
|
|||
|
eed9c143ea
|
|||
|
d06648864e
|
|||
|
9bb33cfaee
|
|||
|
917ac3ff2a
|
|||
|
23bd867430
|
|||
|
2e3c750979
|
|||
|
eff01f42fd
|
|||
|
8a17c5ad80
|
|||
|
d8891e40fc
|
|||
|
f6f45a8c58
|
|||
|
3b75e6e918
|
|||
|
2813d5b56d
|
|||
|
b3476a4af2
|
|||
|
49524fef66
|
|||
|
15eedbfd1e
|
|||
|
365baec18a
|
|||
|
051a418d0b
|
|||
|
f7484147f7
|
|||
|
2334f33cdb
|
|||
|
33c011067f
|
|||
|
2d687e8c61
|
|||
|
377f5849f7
|
|||
|
37d8e4c678
|
|||
|
edf62341df
|
|||
|
9f9854e9d5
|
|||
|
ef45abdd16
|
|||
|
23c4afabbc
|
|||
|
329589612b
|
|||
|
87b901f6c0
|
|||
|
c0c5e92184
|
|||
|
728c77a2d2
|
|||
|
319a63ddcc
|
|||
|
6a6c6ace8a
|
|||
|
4dbd2864c1
|
|||
|
7b75cca4d7
|
|||
|
be1ab62d8f
|
|||
|
a379a9ce60
|
|||
|
3c172a4597
|
|||
|
3f91ec849d
|
|||
|
326ce37b02
|
|||
|
54b6377407
|
|||
|
61258c8a32
|
|||
|
ffcb53f6e2
|
|||
|
9c6d5a1e91
|
|||
|
a344d29ca4
|
|||
|
a70e1a70b4
|
|||
|
53bad22017
|
|||
|
8a9a378f18
|
|||
|
65e8de5b75
|
|||
|
b860ff8858
|
|||
|
6e33524859
|
|||
|
6599d90e39
|
|||
|
6158763985
|
|||
|
9b8e30bde3
|
|||
|
094a77c22e
|
|||
|
91e05a1345
|
|||
|
d9445d4e89
|
|||
|
87594a5d96
|
1
TODO.md
1
TODO.md
@@ -4,3 +4,4 @@
|
||||
- Add tmux plugins to dots cli manager.
|
||||
- Add tmux-powerline linking to `dots` cli manager.
|
||||
- Clean up zet commands, maybe make a gum / fzf filter script.
|
||||
- Update README to reflect ansible installation
|
||||
|
||||
@@ -161,7 +161,7 @@ home=~/.config/ansible
|
||||
;bin_ansible_callbacks=False
|
||||
|
||||
# (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
|
||||
;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" }}
|
||||
|
||||
# (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
|
||||
;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.
|
||||
;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
|
||||
# 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.
|
||||
;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.
|
||||
# If this option is omitted, the global C(RUN_VARS_PLUGINS) configuration is used to determine when to execute the vars plugin.
|
||||
;stage=
|
||||
|
||||
|
||||
@@ -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`
|
||||
@@ -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"]
|
||||
@@ -0,0 +1,2 @@
|
||||
---
|
||||
hub
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
[core]
|
||||
excludesfile = ~/.config/git/gitignore
|
||||
ignorecasse = false
|
||||
[init]
|
||||
defaultBranch = main
|
||||
[user]
|
||||
@@ -19,3 +20,10 @@
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
[credential]
|
||||
helper = gopass
|
||||
|
||||
[credential "https://git.housh.dev"]
|
||||
username = michael
|
||||
[push]
|
||||
autoSetupRemote = true
|
||||
|
||||
6
gopass/config
Normal file
6
gopass/config
Normal 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
32
gpg-tui/gpg-tui.toml
Normal 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"
|
||||
202
karabiner/automatic_backups/karabiner_20240417.json
Normal file
202
karabiner/automatic_backups/karabiner_20240417.json
Normal 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
240
karabiner/karabiner.json
Normal 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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
31
macOS/LaunchAgents/com.michael.dotfiles.commit.plist
Normal file
31
macOS/LaunchAgents/com.michael.dotfiles.commit.plist
Normal 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
8
nvim/lazynvim/.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
tt.*
|
||||
.tests
|
||||
doc/tags
|
||||
debug
|
||||
.repro
|
||||
foo.*
|
||||
*.log
|
||||
data
|
||||
15
nvim/lazynvim/.neoconf.json
Normal file
15
nvim/lazynvim/.neoconf.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"neodev": {
|
||||
"library": {
|
||||
"enabled": true,
|
||||
"plugins": true
|
||||
}
|
||||
},
|
||||
"neoconf": {
|
||||
"plugins": {
|
||||
"lua_ls": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
201
nvim/lazynvim/LICENSE
Normal file
201
nvim/lazynvim/LICENSE
Normal 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
4
nvim/lazynvim/README.md
Normal 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.
|
||||
20
nvim/lazynvim/after/ftplugin/markdown.lua
Normal file
20
nvim/lazynvim/after/ftplugin/markdown.lua
Normal 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" })
|
||||
2
nvim/lazynvim/after/ftplugin/swift.lua
Normal file
2
nvim/lazynvim/after/ftplugin/swift.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
2
nvim/lazynvim/init.lua
Normal file
2
nvim/lazynvim/init.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||
require("config.lazy")
|
||||
14
nvim/lazynvim/lazyvim.json
Normal file
14
nvim/lazynvim/lazyvim.json
Normal 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
|
||||
}
|
||||
50
nvim/lazynvim/lua/config/autocmds.lua
Normal file
50
nvim/lazynvim/lua/config/autocmds.lua
Normal 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,
|
||||
})
|
||||
46
nvim/lazynvim/lua/config/keymaps.lua
Normal file
46
nvim/lazynvim/lua/config/keymaps.lua
Normal 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()")
|
||||
53
nvim/lazynvim/lua/config/lazy.lua
Normal file
53
nvim/lazynvim/lua/config/lazy.lua
Normal 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",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
72
nvim/lazynvim/lua/config/options.lua
Normal file
72
nvim/lazynvim/lua/config/options.lua
Normal 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
|
||||
9
nvim/lazynvim/lua/plugins/colorscheme.lua
Normal file
9
nvim/lazynvim/lua/plugins/colorscheme.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "catppuccin",
|
||||
},
|
||||
},
|
||||
}
|
||||
3
nvim/lazynvim/lua/plugins/disabled.lua
Normal file
3
nvim/lazynvim/lua/plugins/disabled.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
||||
}
|
||||
23
nvim/lazynvim/lua/plugins/fidget.lua
Normal file
23
nvim/lazynvim/lua/plugins/fidget.lua
Normal 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,
|
||||
}
|
||||
23
nvim/lazynvim/lua/plugins/formatter.lua
Normal file
23
nvim/lazynvim/lua/plugins/formatter.lua
Normal 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,
|
||||
-- },
|
||||
},
|
||||
},
|
||||
}
|
||||
78
nvim/lazynvim/lua/plugins/harpoon.lua
Normal file
78
nvim/lazynvim/lua/plugins/harpoon.lua
Normal 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,
|
||||
}),
|
||||
},
|
||||
},
|
||||
}
|
||||
32
nvim/lazynvim/lua/plugins/init.lua
Normal file
32
nvim/lazynvim/lua/plugins/init.lua
Normal 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" },
|
||||
},
|
||||
},
|
||||
}
|
||||
147
nvim/lazynvim/lua/plugins/lsp.lua
Normal file
147
nvim/lazynvim/lua/plugins/lsp.lua
Normal 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,
|
||||
-- }
|
||||
39
nvim/lazynvim/lua/plugins/luasnip.lua
Normal file
39
nvim/lazynvim/lua/plugins/luasnip.lua
Normal 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
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
36
nvim/lazynvim/lua/plugins/oil.lua
Normal file
36
nvim/lazynvim/lua/plugins/oil.lua
Normal 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."
|
||||
},
|
||||
},
|
||||
}
|
||||
10
nvim/lazynvim/lua/plugins/telescope.lua
Normal file
10
nvim/lazynvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
{
|
||||
import = "lazyvim.plugins.extras.editor.telescope",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"swift",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
14
nvim/lazynvim/lua/plugins/todo-comment.lua
Normal file
14
nvim/lazynvim/lua/plugins/todo-comment.lua
Normal 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." },
|
||||
},
|
||||
}
|
||||
73
nvim/lazynvim/lua/plugins/xcodebuild.lua
Normal file
73
nvim/lazynvim/lua/plugins/xcodebuild.lua
Normal 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" },
|
||||
},
|
||||
}
|
||||
10
nvim/m-housh/lua/user/snippets/init.lua → nvim/lazynvim/snippets/init.lua
Executable file → Normal file
10
nvim/m-housh/lua/user/snippets/init.lua → nvim/lazynvim/snippets/init.lua
Executable file → Normal file
@@ -1,4 +1,5 @@
|
||||
local ls = require('luasnip')
|
||||
-- Setup snippets here.
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local ms = ls.multi_snippet
|
||||
@@ -7,3 +8,10 @@ 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")'),
|
||||
}),
|
||||
})
|
||||
34
nvim/lazynvim/snippets/lua.lua
Normal file
34
nvim/lazynvim/snippets/lua.lua
Normal 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.",
|
||||
"})",
|
||||
}),
|
||||
}),
|
||||
})
|
||||
131
nvim/lazynvim/snippets/swift.lua
Normal file
131
nvim/lazynvim/snippets/swift.lua
Normal 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),
|
||||
}
|
||||
)
|
||||
),
|
||||
})
|
||||
16
nvim/lazynvim/spell/en.utf-8.add
Executable file
16
nvim/lazynvim/spell/en.utf-8.add
Executable file
@@ -0,0 +1,16 @@
|
||||
MeasureQuick
|
||||
Housh
|
||||
sealtite
|
||||
Subcool
|
||||
OEM
|
||||
NEC
|
||||
AHJ
|
||||
CFM
|
||||
Hydronic
|
||||
subpar
|
||||
quo
|
||||
IAQ
|
||||
wc
|
||||
HVAC
|
||||
dehumidification
|
||||
ansible
|
||||
BIN
nvim/lazynvim/spell/en.utf-8.add.spl
Executable file
BIN
nvim/lazynvim/spell/en.utf-8.add.spl
Executable file
Binary file not shown.
3
nvim/lazynvim/stylua.toml
Normal file
3
nvim/lazynvim/stylua.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
column_width = 120
|
||||
20
nvim/m-housh/after/ftplugin/markdown.lua
Normal file
20
nvim/m-housh/after/ftplugin/markdown.lua
Normal 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" })
|
||||
2
nvim/m-housh/after/ftplugin/swift.lua
Normal file
2
nvim/m-housh/after/ftplugin/swift.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
@@ -2,20 +2,21 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Auto commands
|
||||
require('user.autocmd')
|
||||
|
||||
-- Plugins
|
||||
require('user.plugins')
|
||||
|
||||
-- Key maps
|
||||
require('user.mappings')
|
||||
|
||||
-- Theme (must stay after plugins are loaded)
|
||||
require('user.theme')
|
||||
-- NOTE: Keep settings at the top, otherwise some options don't work well.
|
||||
-- mainly have had trouble with not using the settings in an `.editorconfig`
|
||||
-- file for projects.
|
||||
|
||||
-- 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")
|
||||
|
||||
@@ -1,81 +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 spellGroup = vim.api.nvim_create_augroup("SpellGroup", defaultGroupOptions)
|
||||
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
|
||||
createCmd(
|
||||
"BufEnter",
|
||||
{
|
||||
pattern = { '*.md', '*.markdown', '*.txt', '*.tex' },
|
||||
group = spellGroup,
|
||||
callback = function(_)
|
||||
vim.cmd.setlocal('textwidth=80')
|
||||
vim.cmd.setlocal('spell spelllang=en_us')
|
||||
end,
|
||||
}
|
||||
)
|
||||
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,
|
||||
}
|
||||
)
|
||||
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)
|
||||
}
|
||||
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=""
|
||||
]],
|
||||
{}
|
||||
)
|
||||
|
||||
-- Swift
|
||||
-- createCmd(
|
||||
-- "FileType",
|
||||
-- {
|
||||
-- pattern = { 'swift' },
|
||||
-- callback = function()
|
||||
-- local root_dir = vim.fs.dirname(vim.fs.find({
|
||||
-- "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
|
||||
-- }
|
||||
-- )
|
||||
-- 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,
|
||||
})
|
||||
|
||||
52
nvim/m-housh/lua/user/keymaps.lua
Executable file
52
nvim/m-housh/lua/user/keymaps.lua
Executable 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()")
|
||||
@@ -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>")
|
||||
58
nvim/m-housh/lua/user/plugin/blink.lua
Normal file
58
nvim/m-housh/lua/user/plugin/blink.lua
Normal 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" },
|
||||
},
|
||||
}
|
||||
@@ -1,155 +1,91 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
enabled = true,
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
--"hrsh7th/cmp-vsnip",
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
"f3fora/cmp-spell",
|
||||
"hrsh7th/cmp-calc",
|
||||
"hrsh7th/cmp-emoji",
|
||||
--"L3MON4D3/LuaSnip",
|
||||
"hrsh7th/nvim-cmp",
|
||||
enabled = true,
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer", -- source for text in buffer
|
||||
"hrsh7th/cmp-path", -- source for file system paths
|
||||
"L3MON4D3/LuaSnip", -- snippet engine
|
||||
"saadparwaiz1/cmp_luasnip", -- for autocompletion
|
||||
"rafamadriz/friendly-snippets", -- useful snippets
|
||||
"onsails/lspkind.nvim", -- vs-code like pictograms
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
-- Adds a number of user-friendly snippets
|
||||
'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')
|
||||
-- TODO: This is implemented in LuaSnip config, does it need to be here?
|
||||
|
||||
local has_words_before = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0
|
||||
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(
|
||||
col, col):match("%s") == nil
|
||||
end
|
||||
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
local feedkey = function(key, mode)
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true),
|
||||
mode, true)
|
||||
end
|
||||
|
||||
|
||||
require('lspconfig').sourcekit.setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
lspkind.init({
|
||||
symbol_map = {
|
||||
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "ﰠ",
|
||||
Variable = "",
|
||||
Class = "ﴯ",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "ﰠ",
|
||||
Unit = "塞",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "פּ",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = ""
|
||||
}
|
||||
})
|
||||
|
||||
-- Configure nvim-cmp.
|
||||
--require('luasnip.loaders.from_vscode').lazy_load()
|
||||
--luasnip.config.setup {}
|
||||
cmp.setup({
|
||||
formatting = {
|
||||
format = lspkind.cmp_format {
|
||||
with_text = false,
|
||||
maxwidth = 50,
|
||||
menu = {
|
||||
buffer = "BUF",
|
||||
nvim_lsp = "LSP",
|
||||
path = "PATH",
|
||||
vsnip = "SNIP",
|
||||
calc = "CALC",
|
||||
spell = "SPELL",
|
||||
emoji = "EMOJI"
|
||||
}
|
||||
}
|
||||
},
|
||||
experimental = {native_menu = false, ghost_text = false},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
--require('luasnip').lsp_expand(args.body)
|
||||
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
|
||||
}
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = "menu,menuone,preview",
|
||||
},
|
||||
snippet = { -- configure how nvim-cmp interacts with snippet engine
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
["<C-Space>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
}), -- select completion, this makes it so it doesn't auto complete when suggesting.
|
||||
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||
["<CR>"] = cmp.mapping({
|
||||
i = function(fallback)
|
||||
if cmp.visible() then
|
||||
if luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
else
|
||||
cmp.mapping.confirm({ select = false })
|
||||
fallback()
|
||||
end
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
s = cmp.mapping.confirm({ select = true }),
|
||||
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
|
||||
}),
|
||||
-- TODO:
|
||||
-- The next two mappings are also implemented in the LuaSnip configuration,
|
||||
-- as <C-j> and <C-k> do they actually need to be here??
|
||||
["<C-b>"] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<C-f>"] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
-- sources for autocompletion
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "buffer" }, -- text within current buffer
|
||||
{ name = "path" }, -- file system paths
|
||||
}),
|
||||
-- configure lspkind for vs-code like pictograms in completion menu
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
23
nvim/m-housh/lua/user/plugin/fidget.lua
Normal file
23
nvim/m-housh/lua/user/plugin/fidget.lua
Normal 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,
|
||||
}
|
||||
@@ -1,32 +1,69 @@
|
||||
return {
|
||||
"mhartington/formatter.nvim",
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local util = require("formatter.util")
|
||||
require("formatter").setup({
|
||||
filetype = {
|
||||
markdown = function()
|
||||
return {
|
||||
exe = "prettier",
|
||||
args = {
|
||||
"--stdin-filepath",
|
||||
util.escape_path(util.get_current_buffer_file_path()),
|
||||
"--print-width",
|
||||
"80",
|
||||
"--prose-wrap",
|
||||
"always",
|
||||
"--parser",
|
||||
"markdown"
|
||||
},
|
||||
stdin = true,
|
||||
try_node_modules = true,
|
||||
}
|
||||
end,
|
||||
["*"] = {
|
||||
-- formatter for any / all file types.
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
"mhartington/formatter.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local util = require("formatter.util")
|
||||
require("formatter").setup({
|
||||
filetype = {
|
||||
lua = {
|
||||
require("formatter.filetypes.lua").stylua,
|
||||
function()
|
||||
return {
|
||||
exe = "stylua",
|
||||
args = {
|
||||
"--search-parent-directories",
|
||||
"--stdin-filepath",
|
||||
util.escape_path(util.get_current_buffer_file_path()),
|
||||
"--",
|
||||
"-",
|
||||
},
|
||||
stdin = true,
|
||||
}
|
||||
end,
|
||||
},
|
||||
markdown = function()
|
||||
return {
|
||||
exe = "prettier",
|
||||
args = {
|
||||
"--stdin-filepath",
|
||||
util.escape_path(util.get_current_buffer_file_path()),
|
||||
"--print-width",
|
||||
"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,
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
return {
|
||||
"ray-x/go.nvim",
|
||||
enabled = false,
|
||||
lazy = true,
|
||||
dependencies = { -- optional packages
|
||||
"ray-x/guihua.lua",
|
||||
|
||||
86
nvim/m-housh/lua/user/plugin/harpoon.lua
Normal file
86
nvim/m-housh/lua/user/plugin/harpoon.lua
Normal 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,
|
||||
}
|
||||
@@ -1,31 +1,2 @@
|
||||
-- This file contains plugin's that don't require much configuration.
|
||||
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
|
||||
},
|
||||
}
|
||||
return {}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
return {
|
||||
"kdheepak/lazygit.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-lua/plenary.nvim"
|
||||
},
|
||||
config = function()
|
||||
require("telescope").load_extension("lazygit")
|
||||
end,
|
||||
}
|
||||
return {}
|
||||
-- return {
|
||||
-- "kdheepak/lazygit.nvim",
|
||||
-- dependencies = {
|
||||
-- "nvim-telescope/telescope.nvim",
|
||||
-- "nvim-lua/plenary.nvim"
|
||||
-- },
|
||||
-- config = function()
|
||||
-- require("telescope").load_extension("lazygit")
|
||||
-- end,
|
||||
-- }
|
||||
|
||||
@@ -1,224 +1,105 @@
|
||||
return {
|
||||
{
|
||||
"williamboman/nvim-lsp-installer",
|
||||
config = function()
|
||||
require("nvim-lsp-installer").setup({})
|
||||
end
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"onsails/lspkind-nvim",
|
||||
"famiu/bufdelete.nvim",
|
||||
"ray-x/lsp_signature.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
"folke/neodev.nvim",
|
||||
"mhartington/formatter.nvim",
|
||||
"ray-x/go.nvim",
|
||||
},
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bashls",
|
||||
"clangd",
|
||||
"dockerls",
|
||||
"gopls",
|
||||
"jsonls",
|
||||
"jedi_language_server",
|
||||
"lua_ls",
|
||||
"marksman",
|
||||
"terraformls",
|
||||
"tsserver",
|
||||
"texlab",
|
||||
"yamlls",
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
config = function()
|
||||
require('neodev').setup()
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup()
|
||||
local nvim_lsp = require("lspconfig")
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(bufnr)
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
|
||||
-- Mappings.
|
||||
local opts = {noremap = true, silent = true}
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
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)
|
||||
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", 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)
|
||||
-- buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
buf_set_keymap("n", "<space>wa",
|
||||
"<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wr",
|
||||
"<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wl",
|
||||
"<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>",
|
||||
opts)
|
||||
buf_set_keymap("n", "<space>D",
|
||||
"<cmd>lua vim.lsp.buf.type_definition()<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)
|
||||
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)
|
||||
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
|
||||
|
||||
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)
|
||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
end
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
--local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
local servers = {
|
||||
"bashls",
|
||||
"clangd",
|
||||
"dockerls",
|
||||
"gopls",
|
||||
"jsonls",
|
||||
"jedi_language_server",
|
||||
"lua_ls",
|
||||
"marksman",
|
||||
"sourcekit",
|
||||
"terraformls",
|
||||
"tsserver",
|
||||
"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
|
||||
}
|
||||
-- The language servers to setup.
|
||||
local lsp_servers = {
|
||||
"bashls",
|
||||
"clangd",
|
||||
"dockerls",
|
||||
"gopls",
|
||||
"jsonls",
|
||||
"lua_ls",
|
||||
"marksman",
|
||||
"sourcekit",
|
||||
"yamlls",
|
||||
}
|
||||
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
-- "hrsh7th/cmp-nvim-lsp",
|
||||
"saghen/blink.cmp",
|
||||
{ "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 capabilities = require("blink.cmp").get_lsp_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 = "[G]oto [R]eferences"
|
||||
vim.keymap.set("n", "gr", "<CMD>Telescope lsp_references<CR>", 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,
|
||||
}
|
||||
|
||||
@@ -1,119 +1,217 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
local colors = {
|
||||
red = '#ca1243',
|
||||
grey = '#a0a1a7',
|
||||
black = '#383a42',
|
||||
white = '#f3f3f3',
|
||||
light_green = '#83a598',
|
||||
orange = '#fe8019',
|
||||
green = '#8ec07c',
|
||||
}
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local lualine = require("lualine")
|
||||
|
||||
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
|
||||
local function xcodebuild_device()
|
||||
if vim.g.xcodebuild_platform == "macOS" then
|
||||
return " macOS"
|
||||
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
|
||||
if vim.g.xcodebuild_os then
|
||||
return " " .. vim.g.xcodebuild_device_name .. " (" .. vim.g.xcodebuild_os .. ")"
|
||||
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
|
||||
return " " .. vim.g.xcodebuild_device_name
|
||||
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
|
||||
|
||||
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 = {},
|
||||
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
|
||||
lualine.setup({
|
||||
options = {
|
||||
globalstatus = true,
|
||||
theme = "auto",
|
||||
symbols = {
|
||||
alternate_file = "#",
|
||||
directory = "",
|
||||
readonly = "",
|
||||
unnamed = "[No Name]",
|
||||
newfile = "[New]",
|
||||
},
|
||||
disabled_buftypes = { "quickfix", "prompt" },
|
||||
component_separators = "",
|
||||
section_separators = { left = "", right = "" },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
-- { "mode" },
|
||||
{ "filename" },
|
||||
},
|
||||
lualine_b = {
|
||||
{ "diagnostics" },
|
||||
{ "diff" },
|
||||
{
|
||||
"searchcount",
|
||||
maxcount = 999,
|
||||
timeout = 500,
|
||||
},
|
||||
},
|
||||
lualine_c = {},
|
||||
lualine_x = {
|
||||
{ "' ' .. vim.g.xcodebuild_last_status", color = { fg = "#a6e3a1" } },
|
||||
-- { "' ' .. vim.g.xcodebuild_test_plan", color = { fg = "#a6e3a1", bg = "#161622" } },
|
||||
{ xcodebuild_device, color = { fg = "#f9e2af", bg = "#161622" } },
|
||||
},
|
||||
lualine_y = {
|
||||
{ "branch" },
|
||||
},
|
||||
lualine_z = {
|
||||
{ "location" },
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
extensions = { "nvim-dap-ui", "quickfix", "trouble", "nvim-tree", "lazy", "mason" },
|
||||
})
|
||||
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
|
||||
-- }
|
||||
|
||||
45
nvim/m-housh/lua/user/plugin/luasnip.lua
Normal file
45
nvim/m-housh/lua/user/plugin/luasnip.lua
Normal 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,
|
||||
}
|
||||
@@ -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
|
||||
},
|
||||
}
|
||||
}
|
||||
71
nvim/m-housh/lua/user/plugin/nvim-dap.lua
Normal file
71
nvim/m-housh/lua/user/plugin/nvim-dap.lua
Normal 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,
|
||||
}
|
||||
87
nvim/m-housh/lua/user/plugin/nvim-dapui.lua
Normal file
87
nvim/m-housh/lua/user/plugin/nvim-dapui.lua
Normal 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,
|
||||
}
|
||||
24
nvim/m-housh/lua/user/plugin/nvim-lint.lua
Normal file
24
nvim/m-housh/lua/user/plugin/nvim-lint.lua
Normal 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,
|
||||
}
|
||||
68
nvim/m-housh/lua/user/plugin/oil.lua
Normal file
68
nvim/m-housh/lua/user/plugin/oil.lua
Normal 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,
|
||||
}
|
||||
@@ -1,15 +1,16 @@
|
||||
return {
|
||||
'm-housh/swift.nvim',
|
||||
dependencies = {
|
||||
'akinsho/toggleterm.nvim'
|
||||
},
|
||||
ft = { 'swift' },
|
||||
config = function()
|
||||
require('swift').setup()
|
||||
local default_options = { noremap = true, silent = true }
|
||||
local actions = require('swift.actions')
|
||||
|
||||
vim.keymap.set('n', '<c-b>', actions.build, default_options)
|
||||
vim.keymap.set('n', '<c-u>', actions.test, default_options)
|
||||
end
|
||||
}
|
||||
"m-housh/swift.nvim",
|
||||
dependencies = {
|
||||
"akinsho/toggleterm.nvim",
|
||||
},
|
||||
ft = { "swift" },
|
||||
config = function()
|
||||
require("swift").setup()
|
||||
local default_options = { noremap = true, silent = true }
|
||||
local actions = require("swift.actions")
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.keymap.set("n", "<C-b>", actions.build, default_options)
|
||||
vim.keymap.set("n", "<C-S-U>", actions.test, default_options)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,72 +1,102 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
},
|
||||
lazy = true,
|
||||
config = function()
|
||||
local actions = require('telescope.actions')
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
lazy = true,
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
file_ignore_patterns = {"node_modules", "%.jpg", "%.png", ".swiftpm"},
|
||||
vimgrep_arguments = {
|
||||
'rg',
|
||||
'--follow',
|
||||
'--color=never',
|
||||
'--no-heading',
|
||||
'--with-filename',
|
||||
'--line-number',
|
||||
'--column',
|
||||
'--smart-case'
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
-- Close on first esc instead of gonig to normal mode
|
||||
["<esc>"] = actions.close,
|
||||
["<A-q>"] = actions.send_selected_to_qflist,
|
||||
["<C-q>"] = actions.send_to_qflist,
|
||||
["<s-tab>"] = actions.toggle_selection + actions.move_selection_next,
|
||||
["<tab>"] = actions.toggle_selection + actions.move_selection_previous,
|
||||
},
|
||||
n = {
|
||||
["<s-tab>"] = actions.toggle_selection + actions.move_selection_next,
|
||||
["<tab>"] = actions.toggle_selection + actions.move_selection_previous,
|
||||
["<A-q>"] = actions.send_selected_to_qflist,
|
||||
["<C-q>"] = actions.send_to_qflist,
|
||||
},
|
||||
},
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "descending",
|
||||
layout_strategy = "flex",
|
||||
layout_config = {
|
||||
width = 0.75,
|
||||
prompt_position = "bottom",
|
||||
preview_cutoff = 120,
|
||||
horizontal = { mirror = false },
|
||||
vertical = { mirror = true },
|
||||
},
|
||||
file_sorter = require'telescope.sorters'.get_fuzzy_file,
|
||||
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
|
||||
-- path_display = true, -- strange behaviour not showing the files in result window
|
||||
winblend = 0,
|
||||
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,
|
||||
require("telescope").setup({
|
||||
ensure_installed = {
|
||||
"swift",
|
||||
},
|
||||
defaults = {
|
||||
file_ignore_patterns = { "node_modules", "%.jpg", "%.png", ".swiftpm" },
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"--follow",
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--smart-case",
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
-- Close on first esc instead of going to normal mode
|
||||
["<esc>"] = actions.close,
|
||||
["<A-q>"] = actions.send_selected_to_qflist,
|
||||
["<C-q>"] = actions.send_to_qflist,
|
||||
["<s-tab>"] = actions.toggle_selection + actions.move_selection_next,
|
||||
["<tab>"] = actions.toggle_selection + actions.move_selection_previous,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
},
|
||||
n = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<s-tab>"] = actions.toggle_selection + actions.move_selection_next,
|
||||
["<tab>"] = actions.toggle_selection + actions.move_selection_previous,
|
||||
["<A-q>"] = actions.send_selected_to_qflist,
|
||||
["<C-q>"] = actions.send_to_qflist,
|
||||
},
|
||||
},
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "descending",
|
||||
layout_strategy = "flex",
|
||||
layout_config = {
|
||||
width = 0.75,
|
||||
prompt_position = "bottom",
|
||||
preview_cutoff = 120,
|
||||
horizontal = { mirror = false },
|
||||
vertical = { mirror = true },
|
||||
},
|
||||
file_sorter = require("telescope.sorters").get_fuzzy_file,
|
||||
generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
|
||||
-- path_display = true, -- strange behaviour not showing the files in result window
|
||||
winblend = 0,
|
||||
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
|
||||
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker
|
||||
}
|
||||
})
|
||||
end
|
||||
-- Developer configurations: Not meant for general override
|
||||
buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
|
||||
},
|
||||
})
|
||||
|
||||
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,
|
||||
}
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = { }
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = {
|
||||
"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,
|
||||
}
|
||||
|
||||
@@ -1,78 +1,78 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
},
|
||||
build = ':TSUpdate',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"cmake",
|
||||
"dockerfile",
|
||||
"go",
|
||||
"hcl",
|
||||
"html",
|
||||
"java",
|
||||
"javascript",
|
||||
"json",
|
||||
"latex",
|
||||
"ledger",
|
||||
"llvm",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"python",
|
||||
"swift",
|
||||
"toml",
|
||||
"xml",
|
||||
"yaml"
|
||||
}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ignore_install = {}, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = {} -- list of language that will be disabled
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<CR>",
|
||||
scope_incremental = "<CR>",
|
||||
node_incremental = "<TAB>",
|
||||
node_decremental = "<S-TAB>"
|
||||
}
|
||||
},
|
||||
indent = {enable = true},
|
||||
autopairs = {{enable = true}},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
["al"] = "@loop.outer",
|
||||
["il"] = "@loop.inner",
|
||||
["ib"] = "@block.inner",
|
||||
["ab"] = "@block.outer",
|
||||
["ir"] = "@parameter.inner",
|
||||
["ar"] = "@parameter.outer",
|
||||
["a="] = "@assignment.outer",
|
||||
["i="] = "@assignment.inner",
|
||||
}
|
||||
}
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
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
|
||||
}
|
||||
}
|
||||
end
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"cmake",
|
||||
"dockerfile",
|
||||
"go",
|
||||
"hcl",
|
||||
"html",
|
||||
"java",
|
||||
"javascript",
|
||||
"json",
|
||||
"latex",
|
||||
"ledger",
|
||||
"llvm",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"python",
|
||||
"swift",
|
||||
"toml",
|
||||
"xml",
|
||||
"yaml",
|
||||
}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ignore_install = {}, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = {}, -- list of language that will be disabled
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<CR>",
|
||||
scope_incremental = "<CR>",
|
||||
node_incremental = "<TAB>",
|
||||
node_decremental = "<S-TAB>",
|
||||
},
|
||||
},
|
||||
indent = { enable = true },
|
||||
autopairs = { { enable = true } },
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
["al"] = "@loop.outer",
|
||||
["il"] = "@loop.inner",
|
||||
["ib"] = "@block.inner",
|
||||
["ab"] = "@block.outer",
|
||||
["ir"] = "@parameter.inner",
|
||||
["ar"] = "@parameter.outer",
|
||||
["a="] = "@assignment.outer",
|
||||
["i="] = "@assignment.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
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
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
46
nvim/m-housh/lua/user/plugin/trouble.lua
Normal file
46
nvim/m-housh/lua/user/plugin/trouble.lua
Normal 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,
|
||||
}
|
||||
81
nvim/m-housh/lua/user/plugin/xcodebuild.lua
Normal file
81
nvim/m-housh/lua/user/plugin/xcodebuild.lua
Normal 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,
|
||||
}
|
||||
@@ -1,72 +1,47 @@
|
||||
-- Bootstrap Lazy.
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
dev = {
|
||||
path = '~/LocalProjects/plugins',
|
||||
fallback = true
|
||||
},
|
||||
|
||||
-- Theme --
|
||||
{ import = 'user.plugin.theme' },
|
||||
|
||||
-- Completions --
|
||||
{ import = 'user.plugin.cmp' },
|
||||
|
||||
-- Git --
|
||||
{ import = 'user.plugin.lazygit' },
|
||||
|
||||
-- LSP, formatting, etc. --
|
||||
{ 'folke/neodev.nvim', opts = {} },
|
||||
{ import = 'user.plugin.lsp' },
|
||||
{ import = 'user.plugin.lualine' },
|
||||
{ import = 'user.plugin.treesitter' },
|
||||
{ import = 'user.plugin.formatter' },
|
||||
{ import = 'user.plugin.go' },
|
||||
--{'fladson/vim-kitty', lazy=true, },
|
||||
|
||||
-- Navigation --
|
||||
{ import = 'user.plugin.neo-tree' },
|
||||
{ import = 'user.plugin.telescope' },
|
||||
|
||||
-- Utilities --
|
||||
{ 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
|
||||
},
|
||||
|
||||
dev = {
|
||||
path = "~/LocalProjects/plugins",
|
||||
fallback = true,
|
||||
},
|
||||
-- Import all the plugin configs in the 'plugin' directory
|
||||
{ import = "user.plugin" },
|
||||
-- Plugins that don't have a configuration file.
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
},
|
||||
{ "NoahTheDuke/vim-just", ft = { "just" } },
|
||||
{
|
||||
"chipsenkbeil/distant.nvim",
|
||||
version = "v0.*",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
}, {
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>ll", "<CMD>Lazy<CR>", { desc = "Open [L]azy" })
|
||||
|
||||
@@ -2,7 +2,8 @@ local o = vim.opt
|
||||
local wo = vim.wo
|
||||
local fn = vim.fn
|
||||
|
||||
vim.cmd.set('inccommand=split')
|
||||
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
|
||||
@@ -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.termguicolors = true -- set term gui colors (most terminals support this)
|
||||
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.hlsearch = false -- highlight all matches on previous search pattern
|
||||
o.ignorecase = true -- ignore case in search patterns
|
||||
@@ -47,7 +48,7 @@ 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.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
|
||||
@@ -62,4 +63,4 @@ o.wildignore = [[
|
||||
*.swp,.lock,.DS_Store,._*
|
||||
*/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.
|
||||
|
||||
17
nvim/m-housh/snippets/init.lua
Normal file
17
nvim/m-housh/snippets/init.lua
Normal 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")'),
|
||||
}),
|
||||
})
|
||||
34
nvim/m-housh/snippets/lua.lua
Normal file
34
nvim/m-housh/snippets/lua.lua
Normal 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.",
|
||||
"})",
|
||||
}),
|
||||
}),
|
||||
})
|
||||
131
nvim/m-housh/snippets/swift.lua
Normal file
131
nvim/m-housh/snippets/swift.lua
Normal 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),
|
||||
}
|
||||
)
|
||||
),
|
||||
})
|
||||
@@ -9,3 +9,8 @@ CFM
|
||||
Hydronic
|
||||
subpar
|
||||
quo
|
||||
IAQ
|
||||
wc
|
||||
HVAC
|
||||
dehumidification
|
||||
ansible
|
||||
|
||||
Binary file not shown.
BIN
raycast/Raycast 2024-04-13 18.31.52.rayconfig
Normal file
BIN
raycast/Raycast 2024-04-13 18.31.52.rayconfig
Normal file
Binary file not shown.
48
scripts/scripts/raycast/pass-attribute.sh
Executable file
48
scripts/scripts/raycast/pass-attribute.sh
Executable 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"
|
||||
|
||||
47
scripts/scripts/raycast/pass-copy.sh
Executable file
47
scripts/scripts/raycast/pass-copy.sh
Executable 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"
|
||||
|
||||
|
||||
33
scripts/scripts/raycast/pass-gen.sh
Executable file
33
scripts/scripts/raycast/pass-gen.sh
Executable 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"
|
||||
|
||||
|
||||
17
scripts/scripts/raycast/script-command.template.sh
Executable file
17
scripts/scripts/raycast/script-command.template.sh
Executable 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"
|
||||
@@ -2,20 +2,22 @@
|
||||
|
||||
# Adapted from: https://github.com/ThePrimeagen/.dotfiles/blob/master/bin/.local/scripts/tmux-sessionizer
|
||||
|
||||
DEBUG=
|
||||
debug="${DEBUG}"
|
||||
|
||||
#################### Options ####################
|
||||
|
||||
declare -a paths=()
|
||||
declare chooseOpt=
|
||||
declare -a directory=()
|
||||
|
||||
zparseopts -D -- \
|
||||
{c,-choose}=chooseOpt
|
||||
{c,-choose}=chooseOpt \
|
||||
{d,-directory}:=directory
|
||||
|
||||
#################### Helpers ####################
|
||||
|
||||
function debug_print {
|
||||
if [ -n "$DEBUG" ]; then
|
||||
if [ -n "$debug" ]; then
|
||||
echo "DEBUG: $1"
|
||||
fi
|
||||
}
|
||||
@@ -39,9 +41,21 @@ function setup_fuzzy_find_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 ####################
|
||||
|
||||
declare choose="${chooseOpt[-1]}"
|
||||
declare selected=
|
||||
|
||||
if [[ -n $choose ]]; then
|
||||
debug_print "Choose from existing."
|
||||
@@ -49,6 +63,14 @@ if [[ -n $choose ]]; then
|
||||
tmux list-sessions -F \#S | gum filter \
|
||||
--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
|
||||
debug_print "Using existing session: $1"
|
||||
selected=$1
|
||||
@@ -72,14 +94,19 @@ selected_name=$(basename "$selected" | tr . _)
|
||||
tmux_running=$(pgrep tmux)
|
||||
|
||||
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
|
||||
tmux new-session -s "$selected_name" -c "$selected"
|
||||
exit 0
|
||||
create_session "$selected_name" "$selected"
|
||||
# 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
|
||||
|
||||
# Create a session if it doesn't exist.
|
||||
if ! tmux has-session -t "$selected_name" 2> /dev/null; then
|
||||
tmux new-session -ds "$selected_name" -c "$selected"
|
||||
fi
|
||||
# if ! tmux has-session -t "$selected_name" 2> /dev/null; then
|
||||
# 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"
|
||||
# fi
|
||||
|
||||
[ -z $TMUX ] && tmux attach -t "$selected_name" \
|
||||
|| tmux switch-client -t "$selected_name"
|
||||
|
||||
79
scripts/scripts/vault-gopass-client
Executable file
79
scripts/scripts/vault-gopass-client
Executable 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
|
||||
127
ssh/config
127
ssh/config
@@ -1,63 +1,66 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
39666435313433363934613839323232343930306538313561363334343230643736363733383262
|
||||
3138386437383132393037643561346235653464653363390a356431646266316263393433366434
|
||||
66633066383465306338613433616237373963323463323538316437666262653461303133643763
|
||||
3863366261376239320a306135616533616336343935613164636231313135366561353531646538
|
||||
63376539383637343565346465633138653431356363333463656365393430303338393636363866
|
||||
63313732373238656664376132376334376634303964616537613638363261623832386663393831
|
||||
62326332656136613433653338383339333232376431303931343930396464656566633537306563
|
||||
64323733306164386639613333333935623534613065363630363030613236336164373561636362
|
||||
64613339323637333962383163376263343438373232373066623738373762616137323731353738
|
||||
38613861313632346566376436356634383033646563333766373336376364373333306264383835
|
||||
64316138336133666361306562343566353439653630306632346633616531663535353133623966
|
||||
39376234646136656561393738663836316233633866313365653739346261353130353861636534
|
||||
39393462356231326661303636343761386466336438346331636639626636653064346164623465
|
||||
30383034323166336330643461313535643931313038363766653736303930363865613566393537
|
||||
66326332643163656161383930396636306639333062323439366666333131653866633862663539
|
||||
32383131333936306130396537656662663835643537333734376431643466663333636262333233
|
||||
34343337653234656465626530646132646433656261623637323363326462636232313162313638
|
||||
38373835363037396566643635343734643835323833663065303363373963363634363338343861
|
||||
62623363663636616663633862333730326432633130333666353365313930323036343531666634
|
||||
32333136616532336637366662613333313030306339393331646132353437366136656234643466
|
||||
39326364313263326536613530393164366436643666343136316163383833366662383764323963
|
||||
61373863343663666337643464616164653264396230623735346237376633313736626261656232
|
||||
38616566356633313261373032386263623861653165646634653731653336313435346234646366
|
||||
31396661313330613963336633366165396534393434333737336166363237653338323035346237
|
||||
36633133636438343137323136383364336338353534373134313337626665353163626630316463
|
||||
64396363396137653566356236623961656535323962616162363337363038396566623437626130
|
||||
30343766373532633437333663663637316132363835383230303631393063396431326161633739
|
||||
65323762333337656362653930386666353664356234643335613566656637353530366534343032
|
||||
66303231653466323635353836636539356638663035636339383362643535626463643061653135
|
||||
64323261353135373563333263346361376538653537363166336432313134373139383235396463
|
||||
66376665353063633262356333343639333435346463306235663031333232653430396437643662
|
||||
39303938616634383733303630343430616231353630656361336466316162306231333833623832
|
||||
36386163323239353263383361343666333966323532653131393064633531363738373966373233
|
||||
35313130393261353862306565353564323338343366313130323162396164646437303534633530
|
||||
38353338343466623738326534333735316338626239316666363935336365633332323238333836
|
||||
39393462313962663265663531336365396534643531383936316261623035616564306566376464
|
||||
38353031396432383165316233303934666639313733383536323161343063393161313264633466
|
||||
38373563396637656638326563353536653130363362623366646137326164393165313734396533
|
||||
35373965613261633934633265373836326631626239623463383863626163636665343364356132
|
||||
61363039313135353535326635393161626262663062303035623136313738353030336132636231
|
||||
66323435386534333233333465616333633261613762643535336561323736613230613034366534
|
||||
62343433333237333266353765383631333831316164316164323932646463353232336432663335
|
||||
61346135356436616339353162306131653735376535393865613738326130326130363830623036
|
||||
65663764346134373566613436316666623637323035346630666362633337316532366261326135
|
||||
30353135373466376434333561396163313131363036376233616137646463373761633235393138
|
||||
38333964643238656539666332656236363734663937386338626235333032333065636338353236
|
||||
30396238636231643131636465393966346236383235336162616632626336653562643566353337
|
||||
35616234383331306162656536303934393834313933653735633263653364303362323031323939
|
||||
33393261306565323333626263356363613332376434643635623864373839356536393234656534
|
||||
30636338643963343032333464633837626164663236616466316337383364633866326333313635
|
||||
38653433366266323135326332613335636664363163326334366339656139623738333738656262
|
||||
37323532653263393061323631656137656433353231613363633763353830656235383561366233
|
||||
36393963366537313731303537313031353730336563343561653962623464386338396538313937
|
||||
34383135356337626435333332663035366665633430613531313132376237363339373031376564
|
||||
37646461633431646532663230626161303661353464373263363336303661353565383864626266
|
||||
37643465323063313439366434303338363036623765343838383231663937396665343464303839
|
||||
64373630643764663431316364656464626133323232383364306565343066336162656236366562
|
||||
36323763343138613763393964386664303634303136376531666139666435353361376135666235
|
||||
35646463383433333130366339643664373665396135366166643837373037303333353562613637
|
||||
34303831323162663933616262316566313064376131626266383235336663353233656634386539
|
||||
34633965633366336538313739383962326565646432633234653563653534306261323133363865
|
||||
3730626461336461613339656364633033666234633264636465
|
||||
36386431326264346262396233353265336630626364653932343439343531663635366436656637
|
||||
3633613465313232613061653031353332353763626233370a373034393230393733343231313734
|
||||
34616431343331653763653362306631393036393165336363326463633338386230653133313061
|
||||
3238393235386461390a376237663766323437353633303138626631656163353665656534363066
|
||||
63303864393437343539346532373366353335303436643465393138363332366335636232663334
|
||||
38333262613162663261663039653330643036343666636261626166346139346532346163633563
|
||||
64653639343634343535323532646430636563623435363065386561643434333630356133636435
|
||||
63343135393130356362643561626434636562313562386630363636653161343663343031343330
|
||||
65636339356639383062356333323232633333636434643138663136366632313431366132373264
|
||||
65373237623066643336386232616565366634643865643238383632653735616134303466346463
|
||||
62663064666364636566643963653836663737393537326462343639303736643536313335653238
|
||||
38306230363262323634353563616662333336636563636233393864633136363730393136636664
|
||||
34653862633639353631323239343463303331656636623537356635316434323932373831346431
|
||||
32333338393763383237373062383138366332363439336466663636386631636361356333353333
|
||||
36656133343637336131396564343032373930353962373331333231616537326262313039643862
|
||||
63343638656636373239393564333365636636346565376631303431616530343639653835653766
|
||||
32656433376235646661393463383564626362373364306539373062383264653130323139386332
|
||||
62373634633635653833653835613037663234313134616565666663303263623930306232313436
|
||||
36646534306635626166333933636538383766633730626236363737333463643564616437386138
|
||||
35663738326161643863383135643565326336653131636539303632393237336462383434303137
|
||||
61653230643861333834376135323864323834323938343964653433336265353134396133653165
|
||||
30646139626138643565356166316566306634663265386535623665633333653930643338336232
|
||||
32383932363332396438653435636365343564366464613065326633393136393030323338633632
|
||||
61636264383135363435383239653466633339313863626665326566356634313635643462396163
|
||||
66383738306132656163643438613665663833353638326532346439336465353365613338313934
|
||||
61386335313338383130376431323734383731623038616161386363373334333232626337333939
|
||||
38363265383538633135643535373731346261343165306665333234613133343763623261653634
|
||||
39643565376264373431323337363166393362336630323038626139343930383034376262613432
|
||||
33643733333531363136363631323933616433666336653335373365343333333438333063633935
|
||||
65643562303634386365336436653630636662343865376433393735323631616363383566616231
|
||||
36333935316139653864323333333665326163356538363564633532393839346138646666353534
|
||||
61626131313336643365323030343933613566303036373039373461323633313235386263383662
|
||||
62333063343462383338656264663364323039356161366165306631663334373438653433373030
|
||||
64353361653032626163376135313264323861636636656539363533626437383939383963383639
|
||||
36653637663135313132323536633864633561626436393336333963376439363131363766613863
|
||||
37373462366538363536623465346265663731663739613766623665376361316630663630366337
|
||||
31316236373561643536646533373238623763633630343663643461373366623835356234643030
|
||||
61356331383838316564636530656634353264663031393539386532623239336565656564346261
|
||||
31646463383431666462643366653535393736313462323437376262326464323537616663663433
|
||||
30323233613937353738666432356663326232383632333366646330323431616436393361323536
|
||||
36663063386634383966363632656364323035613231303362383339646237396438633037366539
|
||||
65383165333238633337313339663231623164656435623966336236666365653361393934353938
|
||||
65353438386139346364336263316666343632353736356230663830363062316336396136393065
|
||||
64306336643939343631386231343436353131393463636564636361323332666666613863323232
|
||||
31356132363631373363656361326230666564366130393063333862616334653932373266306538
|
||||
65616630373738333837623934653763336230323263616666616338373530663862313136613231
|
||||
66363439376231336532373736613638333632306337346161623430656130636362656235613637
|
||||
33376338663765396235653138626638663763303433623764363633323263623431386262663334
|
||||
65393934316236343434336334373639396437656265653736636135306464663631373461326636
|
||||
63316435623762623463383563363331396262383236396433666562336332633963663630616236
|
||||
65303362346162373233663065646137353135643336313239643662613537346263653839666564
|
||||
63623833346463313965636135373538323362356634363632366361393536363766653032633661
|
||||
62656164393331623662646230343030633162613235666232613164643837616264656239383062
|
||||
61336532383035363932363730623239353063373264386564656265323736363737396431346330
|
||||
30376631636437303765623063303566313038653239343264313837383136303033343834306461
|
||||
31366564333635386634653834663866643861396664303132313435333135623361396232643164
|
||||
31663137656461623765313961313830373438363738306232313263386363616336623763663736
|
||||
33646639343239353331616564653130303338373536663464363832376362366361663438366138
|
||||
65633738363662373266326638616366326463313837333733346462333235356235306166663262
|
||||
62333735323563613963336335613462646664663561393436643530356339323737343265323637
|
||||
66663136393033356661613065363030653535393966326637626637316261356135353631653562
|
||||
65626233316534646137333936346134303761323034303736366633613066353333656165326662
|
||||
63363766613963346633613861333266353663333665373362643638326263633236396338373961
|
||||
66636361363633623238663565376637373433363966616237393936336534656161333065666461
|
||||
36333834653465636666316639333733656463363437646439376634386463643134
|
||||
|
||||
180
starship/starship.toml
Normal file
180
starship/starship.toml
Normal 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)'
|
||||
@@ -70,12 +70,13 @@ bind-key -r K kill-pane
|
||||
bind -n S-Left previous-window
|
||||
bind -n S-Right next-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 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 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
|
||||
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 'christoomey/vim-tmux-navigator'
|
||||
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
|
||||
set -g @catppuccin_window_left_separator ""
|
||||
set -g @catppuccin_window_right_separator " "
|
||||
set -g @catppuccin_window_middle_separator " █"
|
||||
set -g @catppuccin_window_number_position "right"
|
||||
set -g @catppuccin_window_default_fill "number"
|
||||
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"
|
||||
# Configure Catppuccin
|
||||
set -g @catppuccin_flavor "macchiato"
|
||||
set -g @catppuccin_status_background "none"
|
||||
set -g @catppuccin_window_status_style "none"
|
||||
set -g @catppuccin_pane_status_enabled "off"
|
||||
set -g @catppuccin_pane_border_status "off"
|
||||
|
||||
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.
|
||||
run '~/.config/tmux/plugins/tpm/tpm'
|
||||
# status left look and feel
|
||||
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'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
local wezterm = require('wezterm')
|
||||
local wezterm = require("wezterm")
|
||||
local config = {}
|
||||
|
||||
if wezterm.config_builder then
|
||||
config = wezterm.config_builder()
|
||||
config = wezterm.config_builder()
|
||||
end
|
||||
|
||||
--config.color_scheme = 'rose-pine'
|
||||
@@ -12,29 +12,30 @@ end
|
||||
-- background = "#131111"
|
||||
-- }
|
||||
|
||||
config.color_scheme = 'Catppuccin Mocha'
|
||||
|
||||
config.color_scheme = "Catppuccin Mocha"
|
||||
|
||||
-- Font
|
||||
config.font = wezterm.font_with_fallback {
|
||||
'JetBrains Mono',
|
||||
'Inconsolata Nerd Font Mono',
|
||||
}
|
||||
config.font = wezterm.font_with_fallback({
|
||||
"JetBrains Mono",
|
||||
"Inconsolata Nerd Font Mono",
|
||||
})
|
||||
config.font_size = 16.0
|
||||
|
||||
-- Window
|
||||
config.adjust_window_size_when_changing_font_size = false
|
||||
config.enable_scroll_bar = false
|
||||
config.initial_cols = 150
|
||||
config.initial_rows= 80
|
||||
config.initial_rows = 80
|
||||
config.window_padding = {
|
||||
left = 5,
|
||||
right = 5,
|
||||
top = 0,
|
||||
bottom = 0
|
||||
left = 10,
|
||||
right = 5,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
}
|
||||
config.window_close_confirmation = 'NeverPrompt'
|
||||
config.window_close_confirmation = "NeverPrompt"
|
||||
--config.window_decorations = 'TITLE'
|
||||
-- Set higher fps
|
||||
config.max_fps = 120
|
||||
|
||||
-- Tab Bar
|
||||
config.show_tabs_in_tab_bar = true
|
||||
|
||||
193
yazi/theme.toml
Normal file
193
yazi/theme.toml
Normal 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
3
yazi/yazi.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
[manager]
|
||||
show_hidden = true
|
||||
show_symlink = true
|
||||
@@ -3,16 +3,16 @@
|
||||
# This includes general default environment variables, local overrides may be stored
|
||||
# in `$XDG_DATA_HOME/zsh/env.zsh`.
|
||||
|
||||
# XDG
|
||||
# XDG Directories
|
||||
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_CACHE_HOME="$HOME/.cache"
|
||||
|
||||
# Config
|
||||
export ZDOTDIR="$HOME/.config/zsh"
|
||||
export ZFUNCDIR="$ZDOTDIR/functions"
|
||||
export SHELL="$(which zsh)"
|
||||
export SHELL="$(command -v zsh)"
|
||||
export TERM=xterm-256color
|
||||
export EDITOR=nvim
|
||||
export VISUAL=nvim
|
||||
@@ -26,38 +26,31 @@ export GITUSER="m-housh"
|
||||
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||
|
||||
# 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 BUCKET="/Volumes/Bucket"
|
||||
export REPOS="$BUCKET/Repos"
|
||||
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 DOTFILES="$HOME/.dotfiles"
|
||||
export DOCUMENTS="$HOME/Documents"
|
||||
export DOWNLOADS="$HOME/Downloads"
|
||||
export PDFS="$HOME/Library/Mobile Documents/com~apple~Preview/Documents"
|
||||
export PROPOSALS="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work/Proposals"
|
||||
export SCREENSHOTS="$BUCKET/Pictures/Screenshots"
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
export SCRIPTS="$HOME/.local/scripts"
|
||||
export WORK="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work"
|
||||
export ZETDIR="$GHREPOS/zets"
|
||||
export GHREPOS="$REPOS/github.com"
|
||||
export LOCAL_REPOS="$REPOS/local"
|
||||
export LOCAL_ENV="$XDG_DATA_HOME/zsh/env.zsh"
|
||||
export MYZSHRC="$ZDOTDIR/.zshrc"
|
||||
export NAP_CONFIG="$HOME/.config/nap/config.yaml"
|
||||
export SKELETONDIR="$DOTFILES/skeleton"
|
||||
export ANSIBLE_GEN_DIR="$GHREPOS/ansible/ansible-gen-playbook"
|
||||
export ANSIBLE_MACOS_PLAYBOOK_DIR="$GHREPOS/ansible/ansible-macos-playbook"
|
||||
export PDFS="$HOME/Library/Mobile Documents/com~apple~Preview/Documents"
|
||||
export PROPOSALS="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work/Proposals"
|
||||
export REPOS="/Volumes/Bucket/Repos"
|
||||
export SCREENSHOTS="$BUCKET/Pictures/Screenshots"
|
||||
export SCRIPTS="$XDG_DATA_HOME/scripts"
|
||||
export SITES="$GHREPOS/sites"
|
||||
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
|
||||
export PASSWORD_STORE_GENERATED_LENGTH=40
|
||||
|
||||
export SKELETONDIR="$DOTFILES/skeleton"
|
||||
export WORK="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work"
|
||||
export ZETDIR="$GHREPOS/zets"
|
||||
|
||||
# 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"
|
||||
|
||||
# Go
|
||||
@@ -84,11 +77,23 @@ export PSQL_HISTORY="$XDG_DATA_HOME/psql_history"
|
||||
export VAULT_ADDR="https://vault.housh.dev"
|
||||
|
||||
# Ansible
|
||||
export ANSIBLE_LOCAL="$GHREPOS/ansible"
|
||||
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
|
||||
export ANSIBLE_VAULT_PASSWORD_FILE="$XDG_DATA_HOME/ansible/.vaultpwd"
|
||||
export DEFAULT_VAULT_PASSWORD_FILE="$XDG_DATA_HOME/ansible/.vaultpwd"
|
||||
export ANSIBLE_VAULT_PASSWORD_FILE="$SCRIPTS/vault-gopass-client"
|
||||
export DEFAULT_VAULT_PASSWORD_FILE="$SCRIPTS/vault-gopass-client"
|
||||
|
||||
# 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"
|
||||
|
||||
@@ -61,8 +61,10 @@ path_prepend \
|
||||
"/usr/local/bin" \
|
||||
"/opt/homebrew/bin" \
|
||||
"/opt/homebrew/sbin" \
|
||||
"$HOME/.local/share/gem/bin" \
|
||||
"$GOROOT/bin" \
|
||||
"$GOPATH/bin" \
|
||||
"$XDG_DATA_HOME/bin" \
|
||||
"$HOME/.local/bin" \
|
||||
"$SCRIPTS"
|
||||
|
||||
@@ -71,7 +73,7 @@ fpath_prepend \
|
||||
"$(brew --prefix)/share/zsh/site-functions" \
|
||||
"$(brew --prefix)/share/zsh-completions" \
|
||||
"$ZDOTDIR/completions" \
|
||||
"$HOME/.local/completions" \
|
||||
"$HOME/.local/share/zsh/completions" \
|
||||
"$ZDOTDIR/functions"
|
||||
|
||||
autoload -Uz $fpath[1]/*(.:t)
|
||||
@@ -96,7 +98,7 @@ export HISTFILE=$ZDOTDIR/history
|
||||
setopt autocd
|
||||
|
||||
# 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 ------------------------------
|
||||
# (see `man zshoptions`)
|
||||
@@ -120,24 +122,35 @@ _source_if "${ZDOTDIR}/zsh-functions"
|
||||
# Plugins
|
||||
zsh_add_plugin "zsh-users/zsh-autosuggestions"
|
||||
zsh_add_plugin "zsh-users/zsh-syntax-highlighting"
|
||||
zsh_add_plugin "Aloxaf/fzf-tab"
|
||||
|
||||
#------------------------------ completions ------------------------------
|
||||
# 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:|=*'
|
||||
|
||||
# partial completion suggestions
|
||||
zstyle ':completion:*' list-suffixes
zstyle ':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.
|
||||
zmodload zsh/complist
|
||||
_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 / managed by brew. (`brew install pure`)
|
||||
# Prompt / managed by brew. (`brew install starship`)
|
||||
autoload -Uz promptinit; promptinit
|
||||
prompt pure
|
||||
eval "$(starship init zsh)"
|
||||
#prompt pure
|
||||
|
||||
#------------------------------ aliases ------------------------------
|
||||
|
||||
@@ -163,12 +176,22 @@ alias hnc='hugo new content' # generate new hugo site content quickly
|
||||
alias j='just' # run justfile's quickly.
|
||||
alias l='ls -lahH --color=auto' # better ls command.
|
||||
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 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 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 tss='~/.local/scripts/tmux-sessionator --choose' # attach to an existing tmux session.
|
||||
alias ts='$SCRIPTS/tmux-sessionator' # create new tmux session, fuzzy finding common locations.
|
||||
alias tss='$SCRIPTS/tmux-sessionator --choose' # attach to an existing tmux session.
|
||||
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 vi='nvim' # set vi to open neovim
|
||||
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 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 ------------------------------
|
||||
|
||||
# TODO: The .zshrc-local is a legacy location and should be removed once my machines are
|
||||
# use the new location in XDG_DATA_HOME.
|
||||
# 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.
|
||||
_source_if "$ZDOTDIR/.zshrc-local"
|
||||
_source_if "$LOCAL_ENV"
|
||||
|
||||
|
||||
@@ -9,36 +9,9 @@
|
||||
# the current working directory.
|
||||
|
||||
function tns() {
|
||||
|
||||
local session_name=
|
||||
local tmux_dir=
|
||||
|
||||
# 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
|
||||
local directory=$1
|
||||
if [ -n "$directory" ]; then
|
||||
directory=${PWD}
|
||||
fi
|
||||
|
||||
# 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"
|
||||
tmux-sessionator --directory "$directory"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user