mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
Compare commits
61 Commits
lazynvim
...
b77180638a
| Author | SHA1 | Date | |
|---|---|---|---|
|
b77180638a
|
|||
|
a06f1cc2a6
|
|||
|
2a54c8c599
|
|||
|
dddcb877d6
|
|||
|
0bd1e6242d
|
|||
|
e8de865417
|
|||
|
3825ef78ff
|
|||
|
81582b2194
|
|||
|
9363055e5a
|
|||
|
3230fb7007
|
|||
|
6f11d99043
|
|||
|
802ea082c8
|
|||
|
9cb3792223
|
|||
|
3041d0a5e5
|
|||
|
ecf3e98e25
|
|||
|
cbe4ebc538
|
|||
|
511c7307b6
|
|||
|
30ac84ecac
|
|||
|
547cc41436
|
|||
|
3fd33cd92e
|
|||
|
8c83898abf
|
|||
|
3fc1054206
|
|||
|
6c6c5c507d
|
|||
|
b627d68ae3
|
|||
|
d8feb9535d
|
|||
|
73973aed67
|
|||
|
534a902512
|
|||
|
5dc1b33da8
|
|||
|
4624fa48d3
|
|||
|
fa0cf72ae0
|
|||
|
e10715940f
|
|||
|
a5ca5b4f63
|
|||
|
26b98e444d
|
|||
|
3796572324
|
|||
|
3382c4b165
|
|||
|
afdedc5acf
|
|||
|
ad5ade6679
|
|||
|
994ff17ceb
|
|||
|
ccc2367bc3
|
|||
|
7f98d4046f
|
|||
|
98804b3aa5
|
|||
|
53db3f3e8f
|
|||
|
86422bd68b
|
|||
|
95139d50ba
|
|||
|
15b1aded69
|
|||
|
dcac27db37
|
|||
|
a71ae05e5b
|
|||
|
9a1b00610e
|
|||
|
4f47e288ea
|
|||
|
963fcd2810
|
|||
|
9ead148f34
|
|||
|
0d8364eaf9
|
|||
|
4d42fa4dab
|
|||
|
f23adad4b0
|
|||
|
44f5c35d38
|
|||
|
25ddde6e12
|
|||
|
4a023203bd
|
|||
|
5f07ffede9
|
|||
|
6cdf85b4e3
|
|||
|
876e7f6d0e
|
|||
|
b78fb64bd3
|
3
.markdownlint.jsonc
Normal file
3
.markdownlint.jsonc
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"MD013": { "code_blocks": false }
|
||||
}
|
||||
2
.prettierrc.yaml
Normal file
2
.prettierrc.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
proseWrap: always
|
||||
printWidth: 80
|
||||
2
TODO.md
2
TODO.md
@@ -5,3 +5,5 @@
|
||||
- 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
|
||||
- Update ansible to do gpg installation.
|
||||
- Update ansible to include sketchybar.
|
||||
|
||||
32
ghostty/config
Normal file
32
ghostty/config
Normal file
@@ -0,0 +1,32 @@
|
||||
theme = Catppuccin Mocha
|
||||
|
||||
confirm-close-surface = false
|
||||
|
||||
font-size = 18
|
||||
font-thicken = false
|
||||
|
||||
window-save-state = always
|
||||
|
||||
# NOTE: This setting removes tabs, rounded borders, and window controls.
|
||||
# Also makes some of the below macos-titlebar-* things not matter, but
|
||||
# will take affect if this is set to true.
|
||||
window-decoration = true
|
||||
|
||||
copy-on-select = true
|
||||
quit-after-last-window-closed = true
|
||||
|
||||
macos-auto-secure-input = true
|
||||
macos-non-native-fullscreen = visible-menu
|
||||
macos-titlebar-style = transparent
|
||||
macos-titlebar-proxy-icon = hidden
|
||||
macos-icon = custom-style
|
||||
|
||||
keybind = super+shift+t=toggle_quick_terminal
|
||||
|
||||
# Splits
|
||||
keybind = super+j=goto_split:down
|
||||
keybind = super+h=goto_split:left
|
||||
keybind = super+k=goto_split:up
|
||||
keybind = super+l=goto_split:right
|
||||
keybind = super+shift+j=goto_split:previous
|
||||
keybind = super+shift+k=goto_split:next
|
||||
@@ -1,29 +1,67 @@
|
||||
[core]
|
||||
excludesfile = ~/.config/git/gitignore
|
||||
ignorecasse = false
|
||||
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
[user]
|
||||
name = Michael Housh
|
||||
email = mhoush@houshhomeenergy.com
|
||||
signingkey = mhoush@houshhomeenergy.com
|
||||
email = michael@mhoush.com
|
||||
signingkey = 0x90D3EB6274D5B7CF
|
||||
|
||||
[commit]
|
||||
gpgsign = true
|
||||
|
||||
[tag]
|
||||
gpgSign = true
|
||||
sort = version:refname
|
||||
|
||||
[color]
|
||||
ui = true
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
|
||||
[credential]
|
||||
helper = gopass
|
||||
|
||||
[credential "https://git.housh.dev"]
|
||||
username = michael
|
||||
|
||||
[push]
|
||||
default = simple
|
||||
autoSetupRemote = true
|
||||
followTags = true
|
||||
|
||||
[fetch]
|
||||
prune = true
|
||||
#pruneTags = true
|
||||
#all = true
|
||||
|
||||
[pull]
|
||||
rebase = true
|
||||
|
||||
[filter "lfs"]
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
|
||||
[column]
|
||||
ui = auto
|
||||
|
||||
[branch]
|
||||
sort = committerdate
|
||||
|
||||
[diff]
|
||||
algorithm = histogram
|
||||
colorMoved = plain
|
||||
mnemonicPrefix = true
|
||||
renames = true
|
||||
|
||||
[rerere]
|
||||
enabled = true
|
||||
autoupdate = true
|
||||
|
||||
[rebase]
|
||||
autoSquash = true
|
||||
autoStash = true
|
||||
updateRefs = true
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
[mounts]
|
||||
path = /Users/michael/.local/share/password-store
|
||||
[recipients]
|
||||
hash = 3199e2acda60d6f17a15882ba11749feda9775cf848554c8f04f12bc84521fd3
|
||||
hash = b73e3c328517ad0b8a03ab1ba113e117595d40ae355f1e42984a8f8144bafc4a
|
||||
[mounts "servers"]
|
||||
path = /Users/michael/.local/share/gopass/stores/servers
|
||||
[recipients "homelab"]
|
||||
hash = e4e019251bcd688aa1691b6b4363a9798593f4aed464afb63d11149ea771b4e0
|
||||
[mounts "homelab"]
|
||||
[recipients "new-test"]
|
||||
hash = 3199e2acda60d6f17a15882ba11749feda9775cf848554c8f04f12bc84521fd3
|
||||
[mounts "new-test"]
|
||||
[recipients "servers"]
|
||||
hash = e4e019251bcd688aa1691b6b4363a9798593f4aed464afb63d11149ea771b4e0
|
||||
|
||||
16
gpg/LaunchAgents/gnupg.gpg-agent-symlink.plist
Normal file
16
gpg/LaunchAgents/gnupg.gpg-agent-symlink.plist
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/ProperyList-1.0/dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>net.jms1.gpg-agent-symlink</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/bin/sh</string>
|
||||
<string>-c</string>
|
||||
<string>/bin/ln -sf $HOME/.gnupg/S.gpg-agent.ssh $SSH_AUTH_SOCK</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
17
gpg/LaunchAgents/gnupg.gpg-agent.plist
Normal file
17
gpg/LaunchAgents/gnupg.gpg-agent.plist
Normal file
@@ -0,0 +1,17 @@
|
||||
<?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>net.jms1.gpg-agent</string>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>KeepAlive</key>
|
||||
<false/>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/usr/local/MacGPG2/bin/gpg-connect-agent</string>
|
||||
<string>/bye</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
13
gpg/gpg-agent.conf
Normal file
13
gpg/gpg-agent.conf
Normal file
@@ -0,0 +1,13 @@
|
||||
# https://github.com/drduh/config/blob/main/gpg-agent.conf
|
||||
# https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html
|
||||
enable-ssh-support
|
||||
ttyname $GPG_TTY
|
||||
default-cache-ttl 60
|
||||
max-cache-ttl 120
|
||||
#pinentry-program /usr/bin/pinentry-curses
|
||||
#pinentry-program /usr/bin/pinentry-gnome3
|
||||
#pinentry-program /usr/bin/pinentry-tty
|
||||
#pinentry-program /usr/bin/pinentry-x11
|
||||
#pinentry-program /usr/local/bin/pinentry-curses
|
||||
|
||||
pinentry-program /opt/homebrew/bin/pinentry-mac
|
||||
70
gpg/gpg.conf
Normal file
70
gpg/gpg.conf
Normal file
@@ -0,0 +1,70 @@
|
||||
# https://github.com/drduh/config/blob/main/gpg.conf
|
||||
# https://www.gnupg.org/documentation/manuals/gnupg/GPG-Options.html
|
||||
# 'gpg --version' to get capabilities
|
||||
# Use AES256, 192, or 128 as cipher
|
||||
personal-cipher-preferences AES256 AES192 AES
|
||||
# Use SHA512, 384, or 256 as digest
|
||||
personal-digest-preferences SHA512 SHA384 SHA256
|
||||
# Use ZLIB, BZIP2, ZIP, or no compression
|
||||
personal-compress-preferences ZLIB BZIP2 ZIP Uncompressed
|
||||
# Default preferences for new keys
|
||||
default-preference-list SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed
|
||||
# SHA512 as digest to sign keys
|
||||
cert-digest-algo SHA512
|
||||
# SHA512 as digest for symmetric ops
|
||||
s2k-digest-algo SHA512
|
||||
# AES256 as cipher for symmetric ops
|
||||
s2k-cipher-algo AES256
|
||||
# UTF-8 support for compatibility
|
||||
charset utf-8
|
||||
# No comments in messages
|
||||
no-comments
|
||||
# No version in output
|
||||
no-emit-version
|
||||
# Disable banner
|
||||
no-greeting
|
||||
# Long key id format
|
||||
keyid-format 0xlong
|
||||
# Display UID validity
|
||||
list-options show-uid-validity
|
||||
verify-options show-uid-validity
|
||||
# Display all keys and their fingerprints
|
||||
with-fingerprint
|
||||
# Display key origins and updates
|
||||
#with-key-origin
|
||||
# Cross-certify subkeys are present and valid
|
||||
require-cross-certification
|
||||
# Enforce memory locking to avoid accidentally swapping GPG memory to disk
|
||||
require-secmem
|
||||
# Disable caching of passphrase for symmetrical ops
|
||||
no-symkey-cache
|
||||
# Output ASCII instead of binary
|
||||
armor
|
||||
# Enable smartcard
|
||||
use-agent
|
||||
# Disable recipient key ID in messages (breaks Mailvelope)
|
||||
throw-keyids
|
||||
# Default key ID to use (helpful with throw-keyids)
|
||||
#default-key 0xFF00000000000001
|
||||
#trusted-key 0xFF00000000000001
|
||||
# Group recipient keys (preferred ID last)
|
||||
#group keygroup = 0xFF00000000000003 0xFF00000000000002 0xFF00000000000001
|
||||
# Keyserver URL
|
||||
#keyserver hkps://keys.openpgp.org
|
||||
#keyserver hkps://keys.mailvelope.com
|
||||
#keyserver hkps://keyserver.ubuntu.com:443
|
||||
#keyserver hkps://pgpkeys.eu
|
||||
#keyserver hkps://pgp.circl.lu
|
||||
#keyserver hkp://zkaan2xfbuxia2wpf7ofnkbz6r5zdbbvxbunvp5g2iebopbfc4iqmbad.onion
|
||||
# Keyserver proxy
|
||||
#keyserver-options http-proxy=http://127.0.0.1:8118
|
||||
#keyserver-options http-proxy=socks5-hostname://127.0.0.1:9050
|
||||
# Enable key retrieval using WKD and DANE
|
||||
#auto-key-locate wkd,dane,local
|
||||
#auto-key-retrieve
|
||||
# Trust delegation mechanism
|
||||
#trust-model tofu+pgp
|
||||
# Show expired subkeys
|
||||
#list-options show-unusable-subkeys
|
||||
# Verbose output
|
||||
#verbose
|
||||
71
hpa/config.toml
Normal file
71
hpa/config.toml
Normal file
@@ -0,0 +1,71 @@
|
||||
# NOTE:
|
||||
# Configuration settings for the `hpa` command line tool.
|
||||
# You can delete settings that are not applicable to your use case.
|
||||
|
||||
# Default arguments / options that get passed into `ansible-playbook` commands.
|
||||
# WARNING: Do not put arguments / options that contain spaces in the same string,
|
||||
# they should be separate strings, for example do not do something like
|
||||
# ['--tags debug'], instead use ['--tags', 'debug'].
|
||||
#
|
||||
args = []
|
||||
|
||||
# Set to true if you want to pass the vault args to `ansible-playbook` commands.
|
||||
useVaultArgs = true
|
||||
|
||||
# NOTE:
|
||||
# Configuration for running the generate command(s). This allows custimizations
|
||||
# to the files that get used to generate the final output (generally a pdf).
|
||||
# See `pandoc --help`. Below are the defaults that get used, which only need
|
||||
# adjusted if your template does not follow the default template design or if
|
||||
# you add extra files to your template that need to be included in the final
|
||||
# output. Also be aware that any of the files specified in the `files` or
|
||||
# `includeInHeader` options, need to be inside the `buildDirectory` when generating
|
||||
# the final output file.
|
||||
|
||||
# [generate]
|
||||
# this relative to the project directory.
|
||||
# buildDirectory = '.build'
|
||||
# pdfEngine = 'xelatex'
|
||||
# includeInHeader = [
|
||||
# 'head.tex',
|
||||
# 'footer.tex'
|
||||
# ]
|
||||
# files = [
|
||||
# 'Report.md',
|
||||
# 'Definitions.md'
|
||||
# ]
|
||||
# outputFileName = 'Report'
|
||||
|
||||
# NOTE:
|
||||
# These are more for local development of the ansible playbook and should not be needed
|
||||
# in most cases. Uncomment the lines if you want to customize the playbook and use it
|
||||
# instead of the provided / default playbook.
|
||||
|
||||
#[playbook]
|
||||
#directory = '/path/to/local/playbook-directory'
|
||||
#inventory = '/path/to/local/inventory.ini'
|
||||
#version = 'main'
|
||||
|
||||
# NOTE:
|
||||
# These are to declare where your template files are either on your local system or
|
||||
# a remote git repository.
|
||||
[template]
|
||||
# The directory path on your local system to the template files.
|
||||
directory = '/Volumes/Bucket/Repos/hhe-consult-template'
|
||||
# The url to a git repository that contains your template files.
|
||||
url = 'https://git.housh.dev/hhe/consult-template.git'
|
||||
|
||||
# The version, tag, branch, or sha of the template files to clone from the remote
|
||||
# template repository. In general it is best practice to use a version instead of a
|
||||
# branch.
|
||||
version = 'main'
|
||||
|
||||
# NOTE:
|
||||
# Holds settings for `ansible-vault` commands.
|
||||
[vault]
|
||||
# Arguments to pass to commands that use `ansible-vault`, such as encrypting or decrypting
|
||||
# files.
|
||||
args = [ '--vault-id=consults@$SCRIPTS/vault-gopass-client' ]
|
||||
|
||||
# An id to use when encrypting `ansible-vault` files.
|
||||
encryptId = 'consults'
|
||||
@@ -1,14 +1,27 @@
|
||||
{
|
||||
"extras": [
|
||||
"lazyvim.plugins.extras.coding.luasnip",
|
||||
"lazyvim.plugins.extras.coding.mini-snippets",
|
||||
"lazyvim.plugins.extras.coding.mini-surround",
|
||||
"lazyvim.plugins.extras.editor.fzf",
|
||||
"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"
|
||||
"lazyvim.plugins.extras.lang.cmake",
|
||||
"lazyvim.plugins.extras.lang.docker",
|
||||
"lazyvim.plugins.extras.lang.git",
|
||||
"lazyvim.plugins.extras.lang.json",
|
||||
"lazyvim.plugins.extras.lang.markdown",
|
||||
"lazyvim.plugins.extras.lang.sql",
|
||||
"lazyvim.plugins.extras.lang.tailwind",
|
||||
"lazyvim.plugins.extras.lang.tex",
|
||||
"lazyvim.plugins.extras.lang.toml",
|
||||
"lazyvim.plugins.extras.lang.yaml",
|
||||
"lazyvim.plugins.extras.util.startuptime"
|
||||
],
|
||||
"install_version": 8,
|
||||
"news": {
|
||||
"NEWS.md": "10960"
|
||||
"NEWS.md": "11866"
|
||||
},
|
||||
"version": 7
|
||||
"version": 8
|
||||
}
|
||||
@@ -1,28 +1,29 @@
|
||||
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,
|
||||
pattern = "*.md",
|
||||
group = markdownGroup,
|
||||
callback = function(_)
|
||||
-- HACK: Set filetype to markdown for '.md' files.
|
||||
-- Not sure why it doesn't detect these as markdown files, but this fixes the issue.
|
||||
vim.cmd.setlocal("filetype=markdown")
|
||||
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", {
|
||||
@@ -33,6 +34,7 @@ createCmd("BufWritePre", {
|
||||
group = vim.api.nvim_create_augroup("GoFormat", defaultGroupOptions),
|
||||
})
|
||||
|
||||
-- GoPass
|
||||
vim.api.nvim_exec2(
|
||||
[[
|
||||
autocmd BufNewFile,BufRead /private/**/gopass** setlocal noswapfile nobackup noundofile shada=""
|
||||
|
||||
@@ -5,7 +5,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
@@ -18,6 +18,22 @@ require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
{
|
||||
import = "lazyvim.plugins.extras.editor.mini-files",
|
||||
opts = {
|
||||
options = {
|
||||
use_as_default_explorer = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
import = "lazyvim.plugins.extras.coding.blink",
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
["<C-y>"] = { "select_and_accept" },
|
||||
},
|
||||
},
|
||||
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
@@ -34,7 +50,7 @@ require("lazy").setup({
|
||||
checker = {
|
||||
enabled = true, -- check for plugin updates periodically
|
||||
notify = false, -- notify on update
|
||||
}, -- automatically check for plugin updates
|
||||
}, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
|
||||
8
nvim/lazynvim/lua/plugins/cmp.lua
Normal file
8
nvim/lazynvim/lua/plugins/cmp.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "default"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
return {
|
||||
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
||||
{ "akinsho/bufferline.nvim", enabled = false },
|
||||
}
|
||||
|
||||
@@ -1,23 +1,30 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stulua" },
|
||||
markdown = {
|
||||
"prettier",
|
||||
prepend_args = {
|
||||
"--print-width",
|
||||
"100",
|
||||
"--prose-wrap",
|
||||
"always",
|
||||
"--parser",
|
||||
"markdown",
|
||||
},
|
||||
formatters = {
|
||||
["markdown-toc"] = {
|
||||
condition = function(_, ctx)
|
||||
for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do
|
||||
if line:find("<!%-%- toc %-%->") then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
["markdownlint-cli2"] = {
|
||||
condition = function(_, ctx)
|
||||
local diag = vim.tbl_filter(function(d)
|
||||
return d.source == "markdownlint"
|
||||
end, vim.diagnostic.get(ctx.buf))
|
||||
return #diag > 0
|
||||
end,
|
||||
},
|
||||
},
|
||||
formatters_by_ft = {
|
||||
["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||
["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||
lua = { "stulua" },
|
||||
swift = { "swiftformat" },
|
||||
-- ["*"] = {
|
||||
-- require("formatter.filetypes.any").remove_trailing_whitespace,
|
||||
-- },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,21 +1,6 @@
|
||||
-- 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 = {
|
||||
@@ -23,10 +8,22 @@ return {
|
||||
},
|
||||
},
|
||||
{
|
||||
import = "lazyvim.plugins.extras.coding.blink",
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
["<C-y>"] = { "select_and_accept" },
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
cmd = {
|
||||
"TmuxNavigateLeft",
|
||||
"TmuxNavigateDown",
|
||||
"TmuxNavigateUp",
|
||||
"TmuxNavigateRight",
|
||||
"TmuxNavigatePrevious",
|
||||
"TmuxNavigatorProcessList",
|
||||
},
|
||||
keys = {
|
||||
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
|
||||
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
|
||||
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
|
||||
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
|
||||
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
12
nvim/lazynvim/lua/plugins/lint.lua
Normal file
12
nvim/lazynvim/lua/plugins/lint.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters = {
|
||||
markdownlint = {
|
||||
args = { "--config", "~/.markdownlint.jsonc", "--" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
"mason-org/mason.nvim",
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
@@ -9,6 +9,7 @@ return {
|
||||
"clangd",
|
||||
"marksman",
|
||||
"shfmt",
|
||||
"tinymist",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -38,10 +39,33 @@ return {
|
||||
clangd = {},
|
||||
dockerls = {},
|
||||
gopls = {},
|
||||
harper_ls = {},
|
||||
jsonls = {},
|
||||
lua_ls = {},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
telemetry = {
|
||||
enable = false
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
marksman = {},
|
||||
sourcekit = {},
|
||||
tinymist = {
|
||||
settings = {
|
||||
formatterMode = "typstyle",
|
||||
},
|
||||
},
|
||||
yamlls = {},
|
||||
},
|
||||
setup = {
|
||||
|
||||
47
nvim/lazynvim/lua/plugins/snacks.lua
Normal file
47
nvim/lazynvim/lua/plugins/snacks.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
-- NOTE: Header looks jacked up here, but fine when rendered in the ui.
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
opts = {
|
||||
picker = {
|
||||
hidden = true,
|
||||
ignored = true
|
||||
},
|
||||
image = {
|
||||
doc = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
dashboard = {
|
||||
row = nil,
|
||||
col = nil,
|
||||
preset = {
|
||||
header = [[
|
||||
*
|
||||
+++++
|
||||
+++++++++
|
||||
==+++++++++++
|
||||
+===:+++++++++++*
|
||||
+======--+++++++++++*##+====
|
||||
+==========:=+++++++++++#+====
|
||||
+=============-=++++++++++++====
|
||||
+================-:+++++++++++++==
|
||||
+===================--++++++++++++++*
|
||||
+======================--+++++++++++++++*
|
||||
=========================-++++++++++++++++
|
||||
==========================:+++++++++++++++
|
||||
===========================:++++++++++++++
|
||||
===========================-.-++++++++++++
|
||||
===========================-::.=++++++++++
|
||||
===========================----..=++++++++
|
||||
===========================------..:=+++++
|
||||
===========================--------:...-++
|
||||
===========================------------:.:
|
||||
===========================---------------
|
||||
===========================---------------
|
||||
===========================---------------
|
||||
]],
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
return {
|
||||
{
|
||||
import = "lazyvim.plugins.extras.editor.telescope",
|
||||
enabled = false,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"swift",
|
||||
|
||||
15
nvim/lazynvim/lua/plugins/typst-preview.lua
Normal file
15
nvim/lazynvim/lua/plugins/typst-preview.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
'chomosuke/typst-preview.nvim',
|
||||
ft = 'typst', -- or ft = 'typst'
|
||||
version = '1.*',
|
||||
opts = {
|
||||
debug = true,
|
||||
}, -- lazy.nvim will implicitly calls `setup {}`
|
||||
keys = {
|
||||
{
|
||||
"<leader>tp",
|
||||
"<CMD>TypstPreviewToggle<CR>",
|
||||
desc = "Toggle typst preview."
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -7,28 +7,35 @@ 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
|
||||
|
||||
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.",
|
||||
"})",
|
||||
}),
|
||||
}),
|
||||
-- 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.",
|
||||
"})",
|
||||
}),
|
||||
}),
|
||||
s("c", {
|
||||
c(1, {
|
||||
fmt("{}", { i(1), t("debug") }),
|
||||
fmt("{}", { i(1), t("warning") }),
|
||||
}),
|
||||
}),
|
||||
})
|
||||
|
||||
@@ -14,3 +14,8 @@ wc
|
||||
HVAC
|
||||
dehumidification
|
||||
ansible
|
||||
orchestrator
|
||||
ethernet
|
||||
unifi
|
||||
wildcard
|
||||
Housh
|
||||
|
||||
Binary file not shown.
@@ -7,16 +7,16 @@ vim.g.maplocalleader = " "
|
||||
-- file for projects.
|
||||
|
||||
-- Common settings
|
||||
require("user.settings")
|
||||
require("config.settings")
|
||||
|
||||
-- Auto commands
|
||||
require("user.autocmd")
|
||||
require("config.autocmd")
|
||||
|
||||
-- Plugins
|
||||
require("user.plugins")
|
||||
require("config.lazy")
|
||||
|
||||
-- Key maps
|
||||
require("user.keymaps")
|
||||
require("config.keymaps")
|
||||
|
||||
-- Theme (must stay after plugins are loaded)
|
||||
require("user.theme")
|
||||
require("config.theme")
|
||||
|
||||
@@ -33,6 +33,14 @@ createCmd("BufWritePre", {
|
||||
group = vim.api.nvim_create_augroup("GoFormat", defaultGroupOptions),
|
||||
})
|
||||
|
||||
-- Leaf
|
||||
createCmd({ "BufRead", "BufNewFile" }, {
|
||||
pattern = "*.leaf",
|
||||
callback = function()
|
||||
vim.opt.filetype = "html"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_exec2(
|
||||
[[
|
||||
autocmd BufNewFile,BufRead /private/**/gopass** setlocal noswapfile nobackup noundofile shada=""
|
||||
83
nvim/m-housh/lua/config/lazy.lua
Executable file
83
nvim/m-housh/lua/config/lazy.lua
Executable file
@@ -0,0 +1,83 @@
|
||||
-- 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,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
dev = {
|
||||
path = "~/LocalProjects/plugins",
|
||||
fallback = true,
|
||||
},
|
||||
-- Import all the plugin configs in the 'plugin' directory
|
||||
{ import = "plugins" },
|
||||
-- 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",
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.ai",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("mini.ai").setup({})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"vhyrro/luarocks.nvim",
|
||||
enabled = true,
|
||||
priority = 1001, -- this plugin needs to run before anything else
|
||||
opts = {
|
||||
rocks = { "magick" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua", -- only load on lua files
|
||||
opts = {
|
||||
library = {
|
||||
-- See the configuration section for more details
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
-- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" }, -- if you use standalone mini plugins
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||
opts = {},
|
||||
},
|
||||
}, {
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
rocks = {
|
||||
hererocks = true, -- recommended if you do not have global installation of Lua 5.1.
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>ll", "<CMD>Lazy<CR>", { desc = "Open [L]azy" })
|
||||
61
nvim/m-housh/lua/plugins/blink.lua
Normal file
61
nvim/m-housh/lua/plugins/blink.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
-- https://cmp.saghen.dev/
|
||||
return {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
enabled = false,
|
||||
dependencies = {
|
||||
-- "rafamadriz/friendly-snippets",
|
||||
{ "L3MON4D3/LuaSnip", version = "v2.*" },
|
||||
},
|
||||
version = "v0.*",
|
||||
opts = {
|
||||
signature = { enabled = true },
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer", "luasnip" },
|
||||
providers = {
|
||||
lsp = {
|
||||
name = "lsp",
|
||||
enabled = true,
|
||||
module = "blink.cmp.sources.lsp",
|
||||
score_offset = 1000, -- higher = higher priority
|
||||
},
|
||||
luasnip = {
|
||||
name = "luasnip",
|
||||
enabled = true,
|
||||
module = "blink.cmp.sources.luasnip",
|
||||
score_offset = 950,
|
||||
},
|
||||
snippets = {
|
||||
name = "snippets",
|
||||
enabled = true,
|
||||
module = "blink.cmp.sources.snippets",
|
||||
score_offset = 900,
|
||||
},
|
||||
},
|
||||
},
|
||||
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,
|
||||
},
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
keymap = {
|
||||
preset = "default",
|
||||
|
||||
["<Tab>"] = {},
|
||||
["<S-Tab>"] = {},
|
||||
["<C-b>"] = { "snippet_backward", "fallback" },
|
||||
["<C-f>"] = { "snippet_forward", "fallback" },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -3,6 +3,8 @@ return {
|
||||
enabled = true,
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
"folke/lazydev.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer", -- source for text in buffer
|
||||
"hrsh7th/cmp-path", -- source for file system paths
|
||||
@@ -74,8 +76,10 @@ return {
|
||||
}),
|
||||
-- sources for autocompletion
|
||||
sources = cmp.config.sources({
|
||||
{ name = "lazydev", group_index = 0 },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "render-markdown" }, -- markdown
|
||||
{ name = "buffer" }, -- text within current buffer
|
||||
{ name = "path" }, -- file system paths
|
||||
}),
|
||||
@@ -1,7 +1,7 @@
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
}
|
||||
20
nvim/m-housh/lua/plugins/fidget.lua
Normal file
20
nvim/m-housh/lua/plugins/fidget.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
"j-hui/fidget.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
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
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
56
nvim/m-housh/lua/plugins/flash.lua
Normal file
56
nvim/m-housh/lua/plugins/flash.lua
Normal file
@@ -0,0 +1,56 @@
|
||||
return {
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
search = {
|
||||
mode = "normal",
|
||||
},
|
||||
modes = {
|
||||
char = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"s",
|
||||
mode = { "n", "x", "o" },
|
||||
function()
|
||||
require("flash").jump()
|
||||
end,
|
||||
desc = "Flash",
|
||||
},
|
||||
{
|
||||
"S",
|
||||
mode = { "n", "x", "o" },
|
||||
function()
|
||||
require("flash").treesitter()
|
||||
end,
|
||||
desc = "Flash Treesitter",
|
||||
},
|
||||
{
|
||||
"r",
|
||||
mode = "o",
|
||||
function()
|
||||
require("flash").remote()
|
||||
end,
|
||||
desc = "Remote Flash",
|
||||
},
|
||||
{
|
||||
"R",
|
||||
mode = { "o", "x" },
|
||||
function()
|
||||
require("flash").treesitter_search()
|
||||
end,
|
||||
desc = "Treesitter Search",
|
||||
},
|
||||
{
|
||||
"<c-s>",
|
||||
mode = { "c" },
|
||||
function()
|
||||
require("flash").toggle()
|
||||
end,
|
||||
desc = "Toggle Flash Search",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,7 +1,19 @@
|
||||
return {
|
||||
"mhartington/formatter.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
keys = {
|
||||
{
|
||||
"<leader>f",
|
||||
":Format",
|
||||
desc = "[F]ormat",
|
||||
},
|
||||
{
|
||||
"<leader>F",
|
||||
":FormatWrite",
|
||||
desc = "[F]ormat write",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local util = require("formatter.util")
|
||||
require("formatter").setup({
|
||||
filetype = {
|
||||
@@ -50,13 +62,6 @@ return {
|
||||
},
|
||||
})
|
||||
|
||||
-- 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
|
||||
|
||||
5
nvim/m-housh/lua/plugins/ghostty.lua
Normal file
5
nvim/m-housh/lua/plugins/ghostty.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"ghostty",
|
||||
dir = vim.env.GHOSTTY_PATH .. "/Contents/Resources/vim/vimfiles/",
|
||||
lazy = false,
|
||||
}
|
||||
86
nvim/m-housh/lua/plugins/harpoon.lua
Normal file
86
nvim/m-housh/lua/plugins/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,
|
||||
}
|
||||
45
nvim/m-housh/lua/plugins/image.lua
Normal file
45
nvim/m-housh/lua/plugins/image.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
return {
|
||||
"3rd/image.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = { "markdown" },
|
||||
highlight = { enable = true },
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
backend = "kitty",
|
||||
--backend = "ueberzug",
|
||||
integrations = {
|
||||
markdown = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = true,
|
||||
floating_windows = true,
|
||||
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
|
||||
},
|
||||
neorg = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
filetypes = { "norg" },
|
||||
},
|
||||
},
|
||||
max_width = nil,
|
||||
max_height = nil,
|
||||
max_width_window_percentage = nil,
|
||||
max_height_window_percentage = 50,
|
||||
editor_only_render_when_focused = true, -- auto show/hide images when the editor gains/looses focus
|
||||
tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
|
||||
kitty_method = "normal",
|
||||
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened
|
||||
},
|
||||
}
|
||||
120
nvim/m-housh/lua/plugins/lsp.lua
Executable file
120
nvim/m-housh/lua/plugins/lsp.lua
Executable file
@@ -0,0 +1,120 @@
|
||||
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({
|
||||
ensure_installed = {
|
||||
"bashls",
|
||||
"clangd",
|
||||
"dockerls",
|
||||
"gopls",
|
||||
"jinja_lsp",
|
||||
"jqls",
|
||||
"jsonls",
|
||||
"ltex",
|
||||
"lua_ls",
|
||||
"marksman",
|
||||
"tinymist",
|
||||
"yamlls",
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
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", "x" }, "<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
|
||||
|
||||
-- The language servers to setup.
|
||||
local lsp_servers = {
|
||||
"bashls",
|
||||
"clangd",
|
||||
"dockerls",
|
||||
"gopls",
|
||||
"jsonls",
|
||||
"lua_ls",
|
||||
"marksman",
|
||||
"sourcekit",
|
||||
"tinymist",
|
||||
"yamlls",
|
||||
}
|
||||
|
||||
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,
|
||||
},
|
||||
}
|
||||
69
nvim/m-housh/lua/plugins/lualine.lua
Executable file
69
nvim/m-housh/lua/plugins/lualine.lua
Executable file
@@ -0,0 +1,69 @@
|
||||
local function xcodebuild_device()
|
||||
if vim.g.xcodebuild_platform == "macOS" then
|
||||
return " macOS"
|
||||
end
|
||||
|
||||
if vim.g.xcodebuild_os then
|
||||
return " " .. vim.g.xcodebuild_device_name .. " (" .. vim.g.xcodebuild_os .. ")"
|
||||
end
|
||||
|
||||
return " " .. vim.g.xcodebuild_device_name
|
||||
end
|
||||
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {
|
||||
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" },
|
||||
|
||||
},
|
||||
}
|
||||
55
nvim/m-housh/lua/plugins/luasnip.lua
Normal file
55
nvim/m-housh/lua/plugins/luasnip.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "v2.*",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{
|
||||
"<C-k>",
|
||||
mode = { "i", "s" },
|
||||
function()
|
||||
local ls = require("luasnip")
|
||||
if ls.expand_or_jumpable() then
|
||||
ls.expand_or_jump()
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"<C-j>",
|
||||
mode = { "i", "s" },
|
||||
function()
|
||||
local ls = require("luasnip")
|
||||
if ls.jumpable(-1) then
|
||||
ls.jump(-1)
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"<C-n>",
|
||||
mode = { "i", "s" },
|
||||
function()
|
||||
local ls = require("luasnip")
|
||||
if ls.choice_active() then
|
||||
ls.change_choice(1)
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local ls = require("luasnip")
|
||||
ls.setup({
|
||||
history = true,
|
||||
enable_autosnippets = false,
|
||||
updatevents = "TextChanged,TextChangedI",
|
||||
extra_opts = {
|
||||
[require("luasnip.util.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" })
|
||||
end,
|
||||
}
|
||||
24
nvim/m-housh/lua/plugins/markdown-preview.lua
Normal file
24
nvim/m-housh/lua/plugins/markdown-preview.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
-- This needs some work, as it's not working. May need to install a different browser??
|
||||
return {
|
||||
"iamcco/markdown-preview.nvim",
|
||||
enabled = false,
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
ft = { "markdown" },
|
||||
config = function()
|
||||
return {
|
||||
mkdp_browser = "Vivaldi",
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>mp",
|
||||
ft = "markdown",
|
||||
"<cmd>MarkdownPreviewToggle<cr>",
|
||||
desc = "Markdown Preview",
|
||||
},
|
||||
},
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
}
|
||||
46
nvim/m-housh/lua/plugins/noice.lua
Executable file
46
nvim/m-housh/lua/plugins/noice.lua
Executable file
@@ -0,0 +1,46 @@
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- OPTIONAL:
|
||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- If not available, we use `mini` as the fallback
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
opts = {
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = true, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
signature = { enabled = false },
|
||||
},
|
||||
routes = {
|
||||
{ -- enables messages for showing macro recording.
|
||||
view = "notify",
|
||||
filter = { event = "msg_showmode" },
|
||||
},
|
||||
{ -- Hide the written messages.
|
||||
view = "notify",
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
kind = "",
|
||||
find = "written",
|
||||
},
|
||||
opts = { skip = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
38
nvim/m-housh/lua/plugins/oil.lua
Normal file
38
nvim/m-housh/lua/plugins/oil.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
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.",
|
||||
},
|
||||
},
|
||||
}
|
||||
8
nvim/m-housh/lua/plugins/presenting.lua
Normal file
8
nvim/m-housh/lua/plugins/presenting.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"sotte/presenting.nvim",
|
||||
opts = {
|
||||
-- fill in your options here
|
||||
-- see :help Presenting.config
|
||||
},
|
||||
cmd = { "Presenting" },
|
||||
}
|
||||
49
nvim/m-housh/lua/plugins/todo-comments.lua
Normal file
49
nvim/m-housh/lua/plugins/todo-comments.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"folke/trouble.nvim",
|
||||
},
|
||||
opts = {
|
||||
keywords = {
|
||||
-- Adds the important keyword, I primarily use this in markdown
|
||||
-- documents to be able to jump and color appropriately.
|
||||
FIX = { alt = { "IMPORTANT" } },
|
||||
|
||||
-- Adds mark keyword, used in swift.
|
||||
NOTE = { alt = { "MARK" } },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>tq",
|
||||
"<CMD>Trouble todo toggle<CR>",
|
||||
desc = "Todo quick fix list.",
|
||||
},
|
||||
{
|
||||
"<leader><leader>t",
|
||||
"<CMD>TodoTelescope<CR>",
|
||||
desc = "Todo telescope list.",
|
||||
},
|
||||
{
|
||||
"<leader>tl",
|
||||
"<CMD>TodoLocList<CR>",
|
||||
desc = "Todo location list.",
|
||||
},
|
||||
{
|
||||
"]t",
|
||||
function()
|
||||
require("todo-comments").jump_next()
|
||||
end,
|
||||
desc = "Next todo.",
|
||||
},
|
||||
{
|
||||
"[t",
|
||||
function()
|
||||
require("todo-comments").jump_prev()
|
||||
end,
|
||||
desc = "Previous todo.",
|
||||
},
|
||||
},
|
||||
}
|
||||
76
nvim/m-housh/lua/plugins/treesitter.lua
Executable file
76
nvim/m-housh/lua/plugins/treesitter.lua
Executable file
@@ -0,0 +1,76 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
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
|
||||
},
|
||||
},
|
||||
}
|
||||
16
nvim/m-housh/lua/plugins/which-key.lua
Executable file
16
nvim/m-housh/lua/plugins/which-key.lua
Executable file
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
preset = "helix",
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,57 +1,58 @@
|
||||
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")
|
||||
"wojciech-kulik/xcodebuild.nvim",
|
||||
--event = "VeryLazy",
|
||||
ft = "swift",
|
||||
--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,
|
||||
},
|
||||
})
|
||||
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" })
|
||||
@@ -77,5 +78,5 @@ return {
|
||||
|
||||
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,
|
||||
end,
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
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,23 +0,0 @@
|
||||
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,86 +0,0 @@
|
||||
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,105 +0,0 @@
|
||||
-- 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,217 +0,0 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local lualine = require("lualine")
|
||||
|
||||
local function xcodebuild_device()
|
||||
if vim.g.xcodebuild_platform == "macOS" then
|
||||
return " macOS"
|
||||
end
|
||||
|
||||
if vim.g.xcodebuild_os then
|
||||
return " " .. vim.g.xcodebuild_device_name .. " (" .. vim.g.xcodebuild_os .. ")"
|
||||
end
|
||||
|
||||
return " " .. vim.g.xcodebuild_device_name
|
||||
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
|
||||
-- }
|
||||
@@ -1,45 +0,0 @@
|
||||
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,47 +0,0 @@
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
-- config.lsp.signature.enabled = false
|
||||
opts = {
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = true, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
signature = { enabled = false },
|
||||
},
|
||||
routes = {
|
||||
{ -- enables messages for showing macro recording.
|
||||
view = "notify",
|
||||
filter = { event = "msg_showmode" },
|
||||
},
|
||||
{ -- Hide the written messages.
|
||||
view = 'notify',
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
kind = "",
|
||||
find = "written"
|
||||
},
|
||||
opts = { skip = true }
|
||||
}
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- OPTIONAL:
|
||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- If not available, we use `mini` as the fallback
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
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,29 +0,0 @@
|
||||
return {
|
||||
"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 +0,0 @@
|
||||
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,
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
-- 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,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
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" })
|
||||
@@ -31,4 +31,11 @@ ls.add_snippets("lua", {
|
||||
"})",
|
||||
}),
|
||||
}),
|
||||
s("c", {
|
||||
c(1, {
|
||||
t("1st"),
|
||||
t("2nd"),
|
||||
}),
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
@@ -11,8 +11,18 @@ local fmt = require("luasnip.extras.fmt").fmt
|
||||
local rep = require("luasnip.extras").rep
|
||||
-- Add snippets
|
||||
ls.add_snippets("swift", {
|
||||
|
||||
-- Logging
|
||||
s(
|
||||
{ trig = "logg", desc = "Log a message" },
|
||||
fmt('logger.{}("{}")', {
|
||||
i(1),
|
||||
i(2),
|
||||
})
|
||||
),
|
||||
|
||||
-- Add a dependency snippet.
|
||||
s({ trig = "@d", desc = "Add a dependency." }, fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })),
|
||||
s({ trig = "@dep", desc = "Add a dependency." }, fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })),
|
||||
|
||||
-- Add a dependency client.
|
||||
s(
|
||||
|
||||
129
scripts/scripts/ask-gpt
Executable file
129
scripts/scripts/ask-gpt
Executable file
@@ -0,0 +1,129 @@
|
||||
#!/bin/zsh
|
||||
#
|
||||
# Ask chat-gpt a question and view the output.
|
||||
|
||||
local api_key="${OPENAI_API_KEY}"
|
||||
local debug="${DEBUG}"
|
||||
local outputFile="/tmp/output.json"
|
||||
|
||||
function usage() {
|
||||
cat << EOF
|
||||
|
||||
Ask chat-gpt a question and view the output.
|
||||
|
||||
Example usage:
|
||||
|
||||
ask-gpt 'Who are you?'
|
||||
|
||||
# Send output to a file:
|
||||
ask-gpt --print 'Who are you' > /tmp/gpt.md
|
||||
|
||||
Usage: ask-gpt [-k <key>] [-m <model>] [-p] [-j] [-h] question
|
||||
|
||||
Options:
|
||||
-k | --key : Use api key (default: environment variable 'OPENAI_API_KEY')
|
||||
-m | --model: Specify the chat-gpt model (default is 'gpt-4o-mini')
|
||||
-j | --json: Print the full json output to stdout.
|
||||
-p | --print: Print the output to stdout in markdown format.
|
||||
-h | --help: Show usage.
|
||||
|
||||
Include debug output:
|
||||
|
||||
DEBUG=1 ask-gpt 'Who are you?'
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
######################### Helpers #########################
|
||||
|
||||
function debug_print {
|
||||
if [ ! -z "$debug" ]; then
|
||||
echo "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
function makeGptInput {
|
||||
echo $(jq --null-input \
|
||||
--arg model "$1" \
|
||||
--arg question "$2" \
|
||||
'{
|
||||
"model": $model,
|
||||
"messages": [
|
||||
{ "role": "system", "content": "You are such a helpful assistant!" },
|
||||
{ "role": "developer", "content": "You message data is escaped properly to parse as JSON, including escaping newline characters." },
|
||||
{ "role": "user", "content": $question }
|
||||
]
|
||||
}')
|
||||
}
|
||||
|
||||
function getGptOutput {
|
||||
echo "$1" | jq -r '.choices[].message.content'
|
||||
}
|
||||
|
||||
function askGpt {
|
||||
local key=$1
|
||||
local input=$2
|
||||
|
||||
echo $(curl "https://api.openai.com/v1/chat/completions" \
|
||||
-sS \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $key" \
|
||||
-d "$input")
|
||||
}
|
||||
|
||||
######################### MAIN #########################
|
||||
zparseopts -D -E -F -- \
|
||||
{h,-help}=help \
|
||||
{k,-key}:=key \
|
||||
{m,-model}=model \
|
||||
{j,-json}=json \
|
||||
{p,-print}=printOutput
|
||||
|
||||
# Check if help was specified and show usage.
|
||||
[ ! -z "$help" ] && usage && exit 0
|
||||
|
||||
local question="$1"
|
||||
# Ensure there is a question / first argument.
|
||||
[ -z "$question" ] && print "No question found." && usage && exit 1
|
||||
|
||||
# parse the api key.
|
||||
if [ ! -z "$key" ]; then
|
||||
api_key="${key[-1]}"
|
||||
debug_print "Using custom passed in key."
|
||||
fi
|
||||
|
||||
# Fail if we did not find an api key.
|
||||
[ -z "$api_key" ] && echo "No api key found." && usage && exit 1
|
||||
|
||||
# Set default model if not specified.
|
||||
if [ -z "$model" ]; then
|
||||
model="gpt-4o-mini"
|
||||
fi
|
||||
debug_print "Model: $model"
|
||||
|
||||
# Generate the input for chat-gpt.
|
||||
local input="$(makeGptInput $model $question)"
|
||||
debug_print "Input: $input"
|
||||
|
||||
# Get the chat-gpt output.
|
||||
local output="$(askGpt $api_key $input)"
|
||||
|
||||
# TODO: Remove.
|
||||
echo "$output" > "$outputFile"
|
||||
|
||||
debug_print "Full ouptput: $(echo $output | jq '.')"
|
||||
|
||||
# If json option is specified, then send full output to stdout and exit.
|
||||
[ ! -z "$json" ] && (echo "$output" | jq '.') && exit 0
|
||||
|
||||
# parse the output message.
|
||||
local parsedOutput="$(getGptOutput $output)"
|
||||
|
||||
echo "$parsedOutput"
|
||||
|
||||
# Show the output based on options passed in.
|
||||
# if [ -z "$printOutput" ]; then
|
||||
# echo "# $question\n$parsedOutput" | gum format | gum pager
|
||||
# else
|
||||
# echo "# $question\n$parsedOutput" | gum format
|
||||
# fi
|
||||
28
sketchybar/plugins/battery.sh
Executable file
28
sketchybar/plugins/battery.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
PERCENTAGE="$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)"
|
||||
CHARGING="$(pmset -g batt | grep 'AC Power')"
|
||||
|
||||
if [ "$PERCENTAGE" = "" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "${PERCENTAGE}" in
|
||||
9[0-9]|100) ICON=""
|
||||
;;
|
||||
[6-8][0-9]) ICON=""
|
||||
;;
|
||||
[3-5][0-9]) ICON=""
|
||||
;;
|
||||
[1-2][0-9]) ICON=""
|
||||
;;
|
||||
*) ICON=""
|
||||
esac
|
||||
|
||||
if [[ "$CHARGING" != "" ]]; then
|
||||
ICON=""
|
||||
fi
|
||||
|
||||
# The item invoking this script (name $NAME) will get its icon and label
|
||||
# updated with the current battery status
|
||||
sketchybar --set "$NAME" icon="$ICON" label="${PERCENTAGE}%"
|
||||
7
sketchybar/plugins/clock.sh
Executable file
7
sketchybar/plugins/clock.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# The $NAME variable is passed from sketchybar and holds the name of
|
||||
# the item invoking this script:
|
||||
# https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting
|
||||
|
||||
sketchybar --set "$NAME" label="$(date '+%m/%d %H:%M')"
|
||||
10
sketchybar/plugins/front_app.sh
Executable file
10
sketchybar/plugins/front_app.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Some events send additional information specific to the event in the $INFO
|
||||
# variable. E.g. the front_app_switched event sends the name of the newly
|
||||
# focused application in the $INFO variable:
|
||||
# https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting
|
||||
|
||||
if [ "$SENDER" = "front_app_switched" ]; then
|
||||
sketchybar --set "$NAME" label="$INFO"
|
||||
fi
|
||||
7
sketchybar/plugins/space.sh
Executable file
7
sketchybar/plugins/space.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# The $SELECTED variable is available for space components and indicates if
|
||||
# the space invoking this script (with name: $NAME) is currently selected:
|
||||
# https://felixkratz.github.io/SketchyBar/config/components#space----associate-mission-control-spaces-with-an-item
|
||||
|
||||
sketchybar --set "$NAME" background.drawing="$SELECTED"
|
||||
20
sketchybar/plugins/volume.sh
Executable file
20
sketchybar/plugins/volume.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# The volume_change event supplies a $INFO variable in which the current volume
|
||||
# percentage is passed to the script.
|
||||
|
||||
if [ "$SENDER" = "volume_change" ]; then
|
||||
VOLUME="$INFO"
|
||||
|
||||
case "$VOLUME" in
|
||||
[6-9][0-9]|100) ICON=""
|
||||
;;
|
||||
[3-5][0-9]) ICON=""
|
||||
;;
|
||||
[1-9]|[1-2][0-9]) ICON=""
|
||||
;;
|
||||
*) ICON=""
|
||||
esac
|
||||
|
||||
sketchybar --set "$NAME" icon="$ICON" label="$VOLUME%"
|
||||
fi
|
||||
91
sketchybar/sketchybarrc
Executable file
91
sketchybar/sketchybarrc
Executable file
@@ -0,0 +1,91 @@
|
||||
# This is a demo config to showcase some of the most important commands.
|
||||
# It is meant to be changed and configured, as it is intentionally kept sparse.
|
||||
# For a (much) more advanced configuration example see my dotfiles:
|
||||
# https://github.com/FelixKratz/dotfiles
|
||||
|
||||
PLUGIN_DIR="$CONFIG_DIR/plugins"
|
||||
|
||||
##### Bar Appearance #####
|
||||
# Configuring the general appearance of the bar.
|
||||
# These are only some of the options available. For all options see:
|
||||
# https://felixkratz.github.io/SketchyBar/config/bar
|
||||
# If you are looking for other colors, see the color picker:
|
||||
# https://felixkratz.github.io/SketchyBar/config/tricks#color-picker
|
||||
|
||||
sketchybar --bar position=top height=40 blur_radius=30 color=0xd1000000
|
||||
|
||||
##### Changing Defaults #####
|
||||
# We now change some default values, which are applied to all further items.
|
||||
# For a full list of all available item properties see:
|
||||
# https://felixkratz.github.io/SketchyBar/config/items
|
||||
|
||||
default=(
|
||||
padding_left=5
|
||||
padding_right=5
|
||||
icon.font="Hack Nerd Font:Bold:17.0"
|
||||
label.font="Hack Nerd Font:Bold:14.0"
|
||||
icon.color=0xffffffff
|
||||
label.color=0xffffffff
|
||||
icon.padding_left=4
|
||||
icon.padding_right=4
|
||||
label.padding_left=4
|
||||
label.padding_right=4
|
||||
)
|
||||
sketchybar --default "${default[@]}"
|
||||
|
||||
##### Adding Mission Control Space Indicators #####
|
||||
# Let's add some mission control spaces:
|
||||
# https://felixkratz.github.io/SketchyBar/config/components#space----associate-mission-control-spaces-with-an-item
|
||||
# to indicate active and available mission control spaces.
|
||||
|
||||
SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10")
|
||||
for i in "${!SPACE_ICONS[@]}"
|
||||
do
|
||||
sid="$(($i+1))"
|
||||
space=(
|
||||
space="$sid"
|
||||
icon="${SPACE_ICONS[i]}"
|
||||
icon.padding_left=7
|
||||
icon.padding_right=7
|
||||
background.color=0x40ffffff
|
||||
background.corner_radius=5
|
||||
background.height=25
|
||||
label.drawing=off
|
||||
script="$PLUGIN_DIR/space.sh"
|
||||
click_script="yabai -m space --focus $sid"
|
||||
)
|
||||
sketchybar --add space space."$sid" left --set space."$sid" "${space[@]}"
|
||||
done
|
||||
|
||||
##### Adding Left Items #####
|
||||
# We add some regular items to the left side of the bar, where
|
||||
# only the properties deviating from the current defaults need to be set
|
||||
|
||||
sketchybar --add item chevron left \
|
||||
--set chevron icon= label.drawing=off \
|
||||
--add item front_app left \
|
||||
--set front_app icon.drawing=off script="$PLUGIN_DIR/front_app.sh" \
|
||||
--subscribe front_app front_app_switched
|
||||
|
||||
##### Adding Right Items #####
|
||||
# In the same way as the left items we can add items to the right side.
|
||||
# Additional position (e.g. center) are available, see:
|
||||
# https://felixkratz.github.io/SketchyBar/config/items#adding-items-to-sketchybar
|
||||
|
||||
# Some items refresh on a fixed cycle, e.g. the clock runs its script once
|
||||
# every 10s. Other items respond to events they subscribe to, e.g. the
|
||||
# volume.sh script is only executed once an actual change in system audio
|
||||
# volume is registered. More info about the event system can be found here:
|
||||
# https://felixkratz.github.io/SketchyBar/config/events
|
||||
|
||||
sketchybar --add item clock right \
|
||||
--set clock update_freq=10 icon= script="$PLUGIN_DIR/clock.sh" \
|
||||
--add item volume right \
|
||||
--set volume script="$PLUGIN_DIR/volume.sh" \
|
||||
--subscribe volume volume_change \
|
||||
--add item battery right \
|
||||
--set battery update_freq=120 script="$PLUGIN_DIR/battery.sh" \
|
||||
--subscribe battery system_woke power_source_change
|
||||
|
||||
##### Force all scripts to run the first time (never do this in a script) #####
|
||||
sketchybar --update
|
||||
@@ -58,10 +58,10 @@ bind \\ splitw -h
|
||||
bind - splitw -v
|
||||
|
||||
# Use Alt-arrow keys to navigate panes
|
||||
bind -n M-Left select-pane -L
|
||||
bind -n M-Right select-pane -R
|
||||
bind -n M-Up select-pane -U
|
||||
bind -n M-Down select-pane -D
|
||||
# bind -n M-Left select-pane -L
|
||||
# bind -n M-Right select-pane -R
|
||||
# bind -n M-Up select-pane -U
|
||||
# bind -n M-Down select-pane -D
|
||||
|
||||
# Close a pane quickly
|
||||
bind-key -r K kill-pane
|
||||
@@ -73,7 +73,7 @@ bind -n M-h previous-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 f run-shell "tmux display-popup -E -w 80% -h 80% $SCRIPTS/tmux-sessionator"
|
||||
bind-key -r C run-shell -b "~/.local/scripts/tmux-sessionator ~/.dotfiles"
|
||||
unbind s
|
||||
bind s run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/session.sh switch"
|
||||
@@ -84,6 +84,7 @@ bind-key r source-file ~/.config/tmux/tmux.conf\; \display-message "source-file
|
||||
######################################## Plugins ########################################
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @plugin 'sainnhe/tmux-fzf'
|
||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
#set -g @plugin 'erikw/tmux-powerline'
|
||||
@@ -91,6 +92,7 @@ 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 @plugin 'omerxx/tmux-floax'
|
||||
|
||||
# Configure Catppuccin
|
||||
set -g @catppuccin_flavor "macchiato"
|
||||
@@ -126,11 +128,18 @@ 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"
|
||||
|
||||
# For yazi images to work correctly
|
||||
set -gq allow-passthrough on
|
||||
set -g visual-activity off
|
||||
set -ga update-environment TERM
|
||||
set -ga update-environment TERM_PROGRAM
|
||||
|
||||
# pane border look and feel
|
||||
setw -g pane-border-status top
|
||||
setw -g pane-border-format ""
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Catpuccin - Mocha
|
||||
# : Manager {{{
|
||||
|
||||
[manager]
|
||||
[mgr]
|
||||
cwd = { fg = "#94e2d5" }
|
||||
|
||||
# Hovered
|
||||
|
||||
193
yazi/theme.toml-1748966637471042
Normal file
193
yazi/theme.toml-1748966637471042
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" }
|
||||
]
|
||||
|
||||
# : }}}
|
||||
@@ -1,3 +1,3 @@
|
||||
[manager]
|
||||
[mgr]
|
||||
show_hidden = true
|
||||
show_symlink = true
|
||||
|
||||
3
yazi/yazi.toml-1748966636821415
Normal file
3
yazi/yazi.toml-1748966636821415
Normal file
@@ -0,0 +1,3 @@
|
||||
[manager]
|
||||
show_hidden = true
|
||||
show_symlink = true
|
||||
@@ -26,11 +26,15 @@ export GITUSER="m-housh"
|
||||
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||
|
||||
# Directories
|
||||
export ARCHIVE="/Volumes/Archive"
|
||||
export BUCKET="/Volumes/Bucket"
|
||||
export REPOS="/Volumes/Bucket/Repos"
|
||||
export DRIVE="/Volumes/Personal-Drive"
|
||||
|
||||
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 CONSULTS="$DRIVE/Consults"
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
export DOCUMENTS="$HOME/Documents"
|
||||
export DOWNLOADS="$HOME/Downloads"
|
||||
@@ -41,7 +45,6 @@ export MYZSHRC="$ZDOTDIR/.zshrc"
|
||||
export NAP_CONFIG="$HOME/.config/nap/config.yaml"
|
||||
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"
|
||||
@@ -81,6 +84,9 @@ export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
|
||||
export ANSIBLE_VAULT_PASSWORD_FILE="$SCRIPTS/vault-gopass-client"
|
||||
export DEFAULT_VAULT_PASSWORD_FILE="$SCRIPTS/vault-gopass-client"
|
||||
|
||||
# Rust
|
||||
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||
|
||||
# Tmux-Sessionator path.
|
||||
export TMUX_SESSIONATOR_PATH="$HOME:$SCRIPTS:$LOCAL_REPOS:$REPOS:$ANSIBLE_LOCAL:$GHREPOS:$HVACIOTREPOS"
|
||||
|
||||
@@ -96,4 +102,8 @@ export GPG_TTY=$(tty)
|
||||
# Starship Prompt
|
||||
export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/starship.toml"
|
||||
|
||||
# Zoxide
|
||||
export _ZO_DATA_DIR="$XDG_DATA_HOME"
|
||||
unset _ZO_ECHO
|
||||
|
||||
[ -f "$LOCAL_ENV" ] && source "$LOCAL_ENV"
|
||||
|
||||
@@ -66,7 +66,9 @@ path_prepend \
|
||||
"$GOPATH/bin" \
|
||||
"$XDG_DATA_HOME/bin" \
|
||||
"$HOME/.local/bin" \
|
||||
"$SCRIPTS"
|
||||
"$SCRIPTS" \
|
||||
"$HOME/.local/pnpm" \
|
||||
"$CARGO_HOME/bin"
|
||||
|
||||
# last arg will be first in $FPATH
|
||||
fpath_prepend \
|
||||
@@ -112,6 +114,7 @@ setopt aliases
|
||||
setopt auto_pushd # Push the current directory on the stack.
|
||||
setopt pushd_ignore_dups # Ignore duplicates in stack
|
||||
setopt pushd_silent # Do not print stack after pushd or popd.
|
||||
setopt CORRECT # Offers corrections on misspelled commands.
|
||||
|
||||
bindkey -v # Enable vi mode
|
||||
export KEYTIMEOUT=1 # Switch between vim mode quicker.
|
||||
@@ -163,6 +166,7 @@ alias d='docker' # run docker commands quickly
|
||||
alias dc='docker compose' # run docker-compose commands quickly
|
||||
alias dv='dirs -v' # list directory info
|
||||
alias essh='edit-ssh-config' # edit ssh config quickly
|
||||
alias fl='find-latest' # Find the last modified file in a directory.
|
||||
alias g='git' # access git commands quickly
|
||||
alias ga='git add' # add files to git quickly
|
||||
alias gcb='git checkout -b' # checkout a new git branch, creating if needed.
|
||||
@@ -174,9 +178,10 @@ alias gs='git status' # git status quickly
|
||||
alias hn='hugo new' # generate a hugo site
|
||||
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 l='eza --long --git --group --links --icons --all' # better ls command.
|
||||
alias lfs='ls -lahH --color=auto "$ZDOTDIR/functions"' # List functions.
|
||||
alias ls='ls --color'
|
||||
alias ls='eza --long --git --group --links --icons --all'
|
||||
alias lt='eza --long --git --group --links --icons --tree'
|
||||
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.
|
||||
@@ -201,10 +206,14 @@ alias nvim-mhoush='NVIM_APPNAME=m-housh && nvim' # set neovim to use my con
|
||||
alias nvim-kickstart='NVIM_APPNAME=kickstart nvim' # set neovim to use kickstart config.
|
||||
alias nvim-lazy='NVIM_APPNAME=lazy nvim' # set neovim to use lazy config.
|
||||
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" # set wget history location.
|
||||
# GPG Yubikey restart relearn when switching keys and stubbed.
|
||||
alias yubikeyrestart='gpg-connect-agent killagent /bye && gpg-connect-agent "scd serialno" "learn --force" /bye && gpg --card-status'
|
||||
alias z='zoxide'
|
||||
|
||||
# NOTE: This needs to stay near the bottom, or it doesn't work properly.
|
||||
# Use fzf in history / search contexts.
|
||||
source <(fzf --zsh)
|
||||
source <(kubectl completion zsh)
|
||||
|
||||
#------------------------------ local configs ------------------------------
|
||||
|
||||
@@ -214,3 +223,36 @@ source <(fzf --zsh)
|
||||
# I tried sourcing them in the the `.zshenv` files, but did not work.
|
||||
_source_if "$ZDOTDIR/.zshrc-local"
|
||||
_source_if "$LOCAL_ENV"
|
||||
|
||||
# pnpm
|
||||
export PNPM_HOME="/Users/michael/.local/share/pnpm"
|
||||
case ":$PATH:" in
|
||||
*":$PNPM_HOME:"*) ;;
|
||||
*) export PATH="$PNPM_HOME:$PATH" ;;
|
||||
esac
|
||||
# pnpm end
|
||||
|
||||
# The following lines have been added by Docker Desktop to enable Docker CLI completions.
|
||||
fpath=(/Users/michael/.docker/completions $fpath)
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
#eval "$(ssh-agent -s)" 1>/dev/null
|
||||
|
||||
########################################
|
||||
# Set things up for using gpg-agent
|
||||
|
||||
export GPG_TTY=$(tty)
|
||||
|
||||
function use-gpg-agent-for-ssh {
|
||||
SOCK="$( gpgconf --list-dirs agent-ssh-socket )"
|
||||
if [[ -n "${SOCK:-}" ]]
|
||||
then
|
||||
unset SSH_AGENT_PID
|
||||
export SSH_AUTH_SOCK="$SOCK"
|
||||
fi
|
||||
}
|
||||
use-gpg-agent-for-ssh
|
||||
|
||||
command -v direnv >/dev/null 2>&1 && eval "$(direnv hook zsh)"
|
||||
command -v zoxide >/dev/null 2>&1 && eval "$(zoxide init --cmd cd zsh)"
|
||||
|
||||
5
zsh/config/functions/brew-update
Executable file
5
zsh/config/functions/brew-update
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
function brew-update() {
|
||||
brew update && brew upgrade --greedy && brew cleanup
|
||||
}
|
||||
12
zsh/config/functions/dp
Executable file
12
zsh/config/functions/dp
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/zsh
|
||||
|
||||
function dp() {
|
||||
[ -z "$1" ] && echo "Must supply temperature" && return 1
|
||||
[ -z "$2" ] && echo "Must supply relative humidity" && return 1
|
||||
|
||||
local temperature=$1
|
||||
local humidity=$2
|
||||
|
||||
/opt/homebrew/bin/psychrometrics dew-point --dry-bulb "$temperature" --relative-humidity "$humidity"
|
||||
|
||||
}
|
||||
7
zsh/config/functions/find-latest
Executable file
7
zsh/config/functions/find-latest
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Find the last modified file in a directory.
|
||||
function find-latest() {
|
||||
local dir=$1
|
||||
echo "$(find $dir -maxdepth 1 -mindepth 1 -type f | sort -nr | head -1)"
|
||||
}
|
||||
5
zsh/config/functions/gpgreset
Executable file
5
zsh/config/functions/gpgreset
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/zsh
|
||||
|
||||
function gpgreset() {
|
||||
gpgconf --kill all && gpgconf --launch all
|
||||
}
|
||||
@@ -8,18 +8,18 @@
|
||||
#
|
||||
|
||||
function n() {
|
||||
if [ -z "$1" ]; then
|
||||
local gitdir=$(git rev-parse --show-toplevel 2> /dev/null)
|
||||
# if [ -z "$1" ]; then
|
||||
# local gitdir=$(git rev-parse --show-toplevel 2> /dev/null)
|
||||
#
|
||||
# [ -n "$gitdir" ] \
|
||||
# && nvim -c ":Telescope git_files" \
|
||||
# && return 0
|
||||
#
|
||||
# [ -d "$1" ] \
|
||||
# && nvim -c ":Telescope find_files" \
|
||||
# && return 0
|
||||
# fi
|
||||
|
||||
[ -n "$gitdir" ] \
|
||||
&& nvim -c ":Telescope git_files" \
|
||||
&& return 0
|
||||
|
||||
[ -d "$1" ] \
|
||||
&& nvim -c ":Telescope find_files" \
|
||||
&& return 0
|
||||
fi
|
||||
|
||||
nvim "$1"
|
||||
nvim "$@"
|
||||
}
|
||||
|
||||
|
||||
13
zsh/config/functions/new-proposal
Executable file
13
zsh/config/functions/new-proposal
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/zsh
|
||||
|
||||
prefix=$(date '+%y.%m.%d')
|
||||
name=$(gum input --placeholder="Enter customer name...")
|
||||
|
||||
if [ -z "$name" ]; then
|
||||
echo "Name should not be blank." && exit 1
|
||||
fi
|
||||
|
||||
cleanedName="${name%% *}${name##* }"
|
||||
directory="$PROPOSALS/$prefix.$cleanedName"
|
||||
mkdir "$directory"
|
||||
echo "$directory"
|
||||
Reference in New Issue
Block a user