mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-15 14:42:37 +00:00
Compare commits
5 Commits
9af452c849
...
10987bd255
| Author | SHA1 | Date | |
|---|---|---|---|
|
10987bd255
|
|||
|
0045e6149c
|
|||
|
3081c6b9b3
|
|||
|
e154efcac4
|
|||
|
71eae2eb5b
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "mail"]
|
||||||
|
path = mail
|
||||||
|
url = ssh://git@git.housh.dev:2222/michael/mail.git
|
||||||
141
dev-env
141
dev-env
@@ -7,98 +7,108 @@
|
|||||||
dry_run="0"
|
dry_run="0"
|
||||||
|
|
||||||
if [ -z "$XDG_CONFIG_HOME" ]; then
|
if [ -z "$XDG_CONFIG_HOME" ]; then
|
||||||
echo "no xdg config home"
|
echo "no xdg config home"
|
||||||
echo "using ~/.config"
|
echo "using ~/.config"
|
||||||
XDG_CONFIG_HOME=$HOME/.config
|
XDG_CONFIG_HOME=$HOME/.config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$XDG_DATA_HOME" ]; then
|
if [ -z "$XDG_DATA_HOME" ]; then
|
||||||
echo "no xdg data home"
|
echo "no xdg data home"
|
||||||
echo "using ~/.local/share"
|
echo "using ~/.local/share"
|
||||||
XDG_DATA_HOME=$HOME/.local/share
|
XDG_DATA_HOME=$HOME/.local/share
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$DEV_ENV" ]; then
|
if [ -z "$DEV_ENV" ]; then
|
||||||
echo "env var DEV_ENV needs to be present"
|
echo "env var DEV_ENV needs to be present"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 =~ ^--dry ]]; then
|
if [[ $1 =~ ^--dry ]]; then
|
||||||
dry_run="1"
|
dry_run="1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
if [[ $dry_run == "1" ]]; then
|
if [[ $dry_run == "1" ]]; then
|
||||||
echo "[DRY_RUN]: $1"
|
echo "[DRY_RUN]: $1"
|
||||||
else
|
else
|
||||||
echo "$1"
|
echo "$1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
log "env: $DEV_ENV"
|
log "env: $DEV_ENV"
|
||||||
|
|
||||||
# Removes a destination directory and copies all files to the destination.
|
# Removes a destination directory and copies all files to the destination.
|
||||||
update_dirs() {
|
update_dirs() {
|
||||||
log "copying over files from: $1"
|
log "copying over files from: $1"
|
||||||
pushd $1 &>/dev/null
|
pushd $1 &>/dev/null
|
||||||
(
|
(
|
||||||
# Copy everything except systemd, share, and zsh folders, they need treated differently.
|
# Copy everything except systemd, share, and zsh folders, they need treated differently.
|
||||||
configs=$(
|
configs=$(
|
||||||
find . -mindepth 1 -maxdepth 1 -type d \
|
find . -mindepth 1 -maxdepth 1 -type d \
|
||||||
\( -name "systemd" -o -name "zsh" -o -name "share" -o -name "scripts" -o -name "kanata" \) \
|
\( -name "systemd" -o -name "zsh" -o -name "share" -o -name "scripts" -o -name "kanata" \) \
|
||||||
-prune -o -type d -print
|
-prune -o -type d -print
|
||||||
)
|
)
|
||||||
for c in $configs; do
|
for c in $configs; do
|
||||||
directory=${2%/}/${c#./}
|
directory=${2%/}/${c#./}
|
||||||
log " removing: rm -rf $directory"
|
log " removing: rm -rf $directory"
|
||||||
|
|
||||||
if [[ $dry_run == "0" ]]; then
|
if [[ $dry_run == "0" ]]; then
|
||||||
rm -rf $directory
|
rm -rf $directory
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log " copying env: cp $c $2"
|
log " copying env: cp $c $2"
|
||||||
if [[ $dry_run == "0" ]]; then
|
if [[ $dry_run == "0" ]]; then
|
||||||
cp -r ./$c $2
|
cp -r ./$c $2
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
)
|
)
|
||||||
popd &>/dev/null
|
popd &>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Removes a destination file and copies a single file to the destination.
|
# Removes a destination file and copies a single file to the destination.
|
||||||
copy() {
|
copy() {
|
||||||
log "removing: $2"
|
log "removing: $2"
|
||||||
if [[ $dry_run == "0" ]]; then
|
if [[ $dry_run == "0" ]]; then
|
||||||
rm $2 &>/dev/null
|
rm $2 &>/dev/null
|
||||||
fi
|
fi
|
||||||
log "copying: $1 to $2"
|
log "copying: $1 to $2"
|
||||||
if [[ $dry_run == "0" ]]; then
|
if [[ $dry_run == "0" ]]; then
|
||||||
cp $1 $2
|
cp $1 $2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Copy all files from a directory into another directory.
|
# Copy all files from a directory into another directory.
|
||||||
copy_files() {
|
copy_files() {
|
||||||
log "copying over files from: $1"
|
log "copying over files from: $1"
|
||||||
pushd "$1" &>/dev/null || exit 1
|
pushd "$1" &>/dev/null || exit 1
|
||||||
(
|
(
|
||||||
for f in $(find . -mindepth 1 -maxdepth 1 -type f); do
|
for f in $(find . -mindepth 1 -maxdepth 1 -type f); do
|
||||||
|
|
||||||
declare dest
|
declare dest
|
||||||
dest="$2/$(basename "$f")"
|
dest="$2/$(basename "$f")"
|
||||||
|
|
||||||
if [[ $dry_run == "0" ]]; then
|
if [[ $dry_run == "0" ]]; then
|
||||||
rm -rf $dest >/dev/null 2>&1
|
rm -rf $dest >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log " copying env: cp $f $dest"
|
log " copying env: cp $f $dest"
|
||||||
if [[ $dry_run == "0" ]]; then
|
if [[ $dry_run == "0" ]]; then
|
||||||
cp $f $dest
|
cp $f $dest
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
popd &>/dev/null || exit 1
|
popd &>/dev/null || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
email() {
|
||||||
|
if command -v mailctl; then
|
||||||
|
log "Updating using mailctl..."
|
||||||
|
[[ $dry_run == "0" ]] && mailctl update && mailctl config
|
||||||
|
else
|
||||||
|
log "Installing mailctl..."
|
||||||
|
[[ $dry_run == "0" ]] && . "$DEV_ENV/mail/install"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
############################## MAIN ##############################
|
############################## MAIN ##############################
|
||||||
@@ -154,9 +164,12 @@ copy_files $DEV_ENV/env/.local/share/applications/icons $XDG_DATA_HOME/applicati
|
|||||||
mkdir $HOME/pkgbuilds
|
mkdir $HOME/pkgbuilds
|
||||||
update_dirs $DEV_ENV/env/pkgbuilds $HOME/pkgbuilds
|
update_dirs $DEV_ENV/env/pkgbuilds $HOME/pkgbuilds
|
||||||
|
|
||||||
|
# Email.
|
||||||
|
email
|
||||||
|
|
||||||
if [[ $dry_run == "0" ]]; then
|
if [[ $dry_run == "0" ]]; then
|
||||||
systemctl --user daemon-reload
|
systemctl --user daemon-reload
|
||||||
hyprctl reload
|
hyprctl reload
|
||||||
espanso service restart
|
espanso service restart
|
||||||
exec zsh -l
|
exec zsh -l
|
||||||
fi
|
fi
|
||||||
|
|||||||
12
env/.config/hypr/hyprland.conf
vendored
12
env/.config/hypr/hyprland.conf
vendored
@@ -6,12 +6,12 @@
|
|||||||
# Refer to the wiki for more information.
|
# Refer to the wiki for more information.
|
||||||
# https://wiki.hyprland.org/Configuring/
|
# https://wiki.hyprland.org/Configuring/
|
||||||
|
|
||||||
source = ~/.config/hypr/env.conf
|
source = ~/.config/hypr/hyprenv.conf
|
||||||
source = ~/.config/hypr/monitors.conf
|
source = ~/.config/hypr/hyprmonitors.conf
|
||||||
source = ~/.config/hypr/windows.conf
|
source = ~/.config/hypr/hyprwindows.conf
|
||||||
source = ~/.config/hypr/keybinds.conf
|
source = ~/.config/hypr/hyprkeybinds.conf
|
||||||
source = ~/.config/hypr/input.conf
|
source = ~/.config/hypr/hyprinput.conf
|
||||||
source = ~/.config/hypr/autostart.conf
|
source = ~/.config/hypr/hyprautostart.conf
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
### LOOK AND FEEL ###
|
### LOOK AND FEEL ###
|
||||||
|
|||||||
213
env/.config/nvim/init.lua
vendored
213
env/.config/nvim/init.lua
vendored
@@ -1,15 +1,204 @@
|
|||||||
-- bootstrap lazy.nvim, LazyVim and your plugin
|
-- NOTE: This requires neovim >= 0.12, you can use bob to download nightly.
|
||||||
|
--
|
||||||
vim.g.netrw_browsex_viewer = "xdg-open"
|
vim.g.netrw_browsex_viewer = "xdg-open"
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.swapfile = false
|
||||||
|
vim.opt.undofile = true
|
||||||
|
vim.opt.winborder = "rounded"
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.showtabline = 2
|
||||||
|
vim.opt.signcolumn = "yes"
|
||||||
|
vim.opt.wrap = false
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
require("config.lazy")
|
vim.pack.add({
|
||||||
|
{ src = "https://github.com/catppuccin/nvim" },
|
||||||
vim.filetype.add({
|
{ src = "https://github.com/nvim-mini/mini.pick" },
|
||||||
pattern = {
|
{ src = "https://github.com/stevearc/oil.nvim" },
|
||||||
[".*"] = function(path, bufnr)
|
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
||||||
local first_line = vim.api.nvim_buf_get_lines(bufnr, 0, 1, false)[1] or ""
|
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
|
||||||
if first_line:match("^#!.*zsh") then
|
{ src = "https://github.com/mason-org/mason.nvim" },
|
||||||
return "bash"
|
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
||||||
end
|
{ src = "https://github.com/ThePrimeagen/harpoon", version = "harpoon2" },
|
||||||
end,
|
{ src = "https://github.com/christoomey/vim-tmux-navigator" },
|
||||||
},
|
})
|
||||||
|
|
||||||
|
require("mason").setup()
|
||||||
|
require("mini.pick").setup()
|
||||||
|
require("oil").setup()
|
||||||
|
require("harpoon").setup({ settings = { save_on_toggle = true, sync_on_ui_close = true } })
|
||||||
|
|
||||||
|
-- Set color scheme
|
||||||
|
vim.cmd([[colorscheme catppuccin-mocha]])
|
||||||
|
vim.cmd(":hi statusline guibg=NONE")
|
||||||
|
vim.cmd [[set completeopt+=menuone,noselect,popup]]
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
vim.lsp.enable({
|
||||||
|
"lua_ls", "tinymist", "marksman", "bashls", "hyprls",
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config('bashls', {
|
||||||
|
filetypes = { "bash", "sh", "zsh" },
|
||||||
|
cmd = { 'bash-language-server', 'start' },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Fix warnings for 'vim' global keyword.
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
workspace = {
|
||||||
|
library = {
|
||||||
|
vim.api.nvim_get_runtime_file("", true),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Keymaps
|
||||||
|
local map = vim.keymap.set
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
|
||||||
|
map('i', 'jk', '<ESC>')
|
||||||
|
|
||||||
|
map('n', '<leader>a', function() harpoon:list():add() end, { desc = "[A]dd file to harpoon" })
|
||||||
|
map('n', '<leader>bb', ':bprevious', { desc = "[B]uffer [b]ack" })
|
||||||
|
map('n', '<leader>bn', ':bnext', { desc = "[B]uffer [n]ext" })
|
||||||
|
map('n', '<leader>cf', vim.lsp.buf.format, { desc = "[F]ormat" })
|
||||||
|
map('n', '<C-e>', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = "Open harpoon menu" })
|
||||||
|
map('n', '<leader>e', ':Oil<CR>', { desc = "[E]xplore files" })
|
||||||
|
map('n', '<leader>ff', ':Pick files tool="git"<CR>', { desc = "[F]ind file" })
|
||||||
|
map('n', '<leader>fh', ':Pick help<CR>', { desc = "[H]elp search" })
|
||||||
|
map('n', '<leader>hb', function() harpoon:list():prev() end, { desc = "[H]arpoon [b]ack" })
|
||||||
|
map('n', '<leader>hn', function() harpoon:list():next() end, { desc = "[H]arpoon [n]ext" })
|
||||||
|
map('n', '<leader>o', ':update<CR> :source<CR>', { desc = "Source current file" })
|
||||||
|
|
||||||
|
-- Tmux / pane navigation
|
||||||
|
map('n', "<C-h>", "<cmd><C-U>TmuxNavigateLeft<CR>")
|
||||||
|
map('n', "<C-j>", "<cmd><C-U>TmuxNavigateDown<CR>")
|
||||||
|
map('n', "<C-k>", "<cmd><C-U>TmuxNavigateUp<CR>")
|
||||||
|
map('n', "<C-l>", "<cmd><C-U>TmuxNavigateRight<CR>")
|
||||||
|
|
||||||
|
-- Move line(s) up or down.
|
||||||
|
map('n', "J", ":move .+1<CR>==", { desc = "Move line down" })
|
||||||
|
map('n', "K", ":move .-2<CR>==", { desc = "Move line up" })
|
||||||
|
map("v", "K", ":move '<-2<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
|
||||||
|
map("v", "J", ":move '>+1<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
|
||||||
|
|
||||||
|
-- Harpoon 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]ertical split" })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Auto commands.
|
||||||
|
local defaultopts = { clear = true }
|
||||||
|
|
||||||
|
-- Force zsh files to use bash syntax highlighting
|
||||||
|
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||||
|
group = vim.api.nvim_create_augroup('my.zsh', defaultopts),
|
||||||
|
pattern = "*",
|
||||||
|
callback = function(args)
|
||||||
|
local first_line = vim.api.nvim_buf_get_lines(args.buf, 0, 1, false)[1] or ""
|
||||||
|
if first_line:match("^#!.*zsh") then
|
||||||
|
-- vim.bo[args.buf].filetype = "bash"
|
||||||
|
vim.cmd.setlocal("filetype=bash")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Markdown
|
||||||
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
|
pattern = "*.md",
|
||||||
|
group = vim.api.nvim_create_augroup('my.markdown', defaultopts),
|
||||||
|
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=120")
|
||||||
|
vim.cmd.setlocal("spell spelllang=en_us")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Neomutt
|
||||||
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
|
pattern = "neomutt*",
|
||||||
|
group = vim.api.nvim_create_augroup('my.neomutt', defaultopts),
|
||||||
|
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=120")
|
||||||
|
vim.cmd.setlocal("spell spelllang=en_us")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- GoPass
|
||||||
|
vim.api.nvim_exec2(
|
||||||
|
[[
|
||||||
|
autocmd BufNewFile,BufRead /private/**/gopass** setlocal noswapfile nobackup noundofile shada=""
|
||||||
|
]],
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Stolen from: https://github.com/SylvanFranklin/.config/blob/main/nvim/init.lua
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
||||||
|
callback = function(args)
|
||||||
|
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
||||||
|
if client:supports_method('textDocument/completion') then
|
||||||
|
-- Optional: trigger autocompletion on EVERY keypress. May be slow!
|
||||||
|
local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end
|
||||||
|
client.server_capabilities.completionProvider.triggerCharacters = chars
|
||||||
|
vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Hyprlang LSP
|
||||||
|
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, {
|
||||||
|
pattern = { "*.hl", "hypr*.conf" },
|
||||||
|
callback = function(event)
|
||||||
|
vim.lsp.start {
|
||||||
|
name = "hyprlang",
|
||||||
|
cmd = { "hyprls" },
|
||||||
|
root_dir = vim.fn.getcwd(),
|
||||||
|
}
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Highlight when yanking.
|
||||||
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
desc = "Highlight when yanking text.",
|
||||||
|
group = vim.api.nvim_create_augroup("my.highlight-yank", defaultopts),
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Add '-' to be part of words.
|
||||||
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
|
desc = "Add '-' to be part of word.",
|
||||||
|
group = vim.api.nvim_create_augroup('my.iskeyword', defaultopts),
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
vim.cmd.setlocal("iskeyword+=-")
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
desc = "Format on write.",
|
||||||
|
group = vim.api.nvim_create_augroup('my.format-on-write', defaultopts),
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format()
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|||||||
27
env/.config/nvim/lazyvim.json
vendored
27
env/.config/nvim/lazyvim.json
vendored
@@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"extras": [
|
|
||||||
"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.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": "11866"
|
|
||||||
},
|
|
||||||
"version": 8
|
|
||||||
}
|
|
||||||
86
env/.config/nvim/lua/config/autocmds.lua
vendored
86
env/.config/nvim/lua/config/autocmds.lua
vendored
@@ -1,86 +0,0 @@
|
|||||||
local defaultGroupOptions = { clear = true }
|
|
||||||
local markdownGroup = vim.api.nvim_create_augroup("MyMarkdownGroup", defaultGroupOptions)
|
|
||||||
local createCmd = vim.api.nvim_create_autocmd
|
|
||||||
|
|
||||||
createCmd("BufEnter", {
|
|
||||||
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=120")
|
|
||||||
vim.cmd.setlocal("spell spelllang=en_us")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Hyprlang LSP
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
|
||||||
pattern = { "*.hl", "hypr*.conf" },
|
|
||||||
callback = function(event)
|
|
||||||
print(string.format("starting hyprls for %s", vim.inspect(event)))
|
|
||||||
vim.lsp.start({
|
|
||||||
name = "hyprlang",
|
|
||||||
cmd = { "hyprls" },
|
|
||||||
root_dir = vim.fn.getcwd(),
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Markdown
|
|
||||||
-- createCmd("BufWritePost", {
|
|
||||||
-- pattern = { "*.md", "*.markdown" },
|
|
||||||
-- group = markdownGroup,
|
|
||||||
-- callback = function(_)
|
|
||||||
-- -- local cursor = vim.fn.getpos(".")
|
|
||||||
-- vim.cmd("FormatWrite")
|
|
||||||
-- -- vim.fn.setpos(".", cursor)
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- Set neomutt compose email file types to markdown.
|
|
||||||
vim.api.nvim_create_autocmd("BufRead", {
|
|
||||||
pattern = "neomutt*",
|
|
||||||
callback = function()
|
|
||||||
vim.cmd.setlocal("filetype=markdown")
|
|
||||||
vim.cmd.setlocal("textwidth=120")
|
|
||||||
vim.cmd.setlocal("spell spelllang=en_us")
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Go
|
|
||||||
createCmd("BufWritePre", {
|
|
||||||
pattern = "*.go",
|
|
||||||
callback = function()
|
|
||||||
require("go.format").goimport()
|
|
||||||
end,
|
|
||||||
group = vim.api.nvim_create_augroup("GoFormat", defaultGroupOptions),
|
|
||||||
})
|
|
||||||
|
|
||||||
-- GoPass
|
|
||||||
vim.api.nvim_exec2(
|
|
||||||
[[
|
|
||||||
autocmd BufNewFile,BufRead /private/**/gopass** setlocal noswapfile nobackup noundofile shada=""
|
|
||||||
]],
|
|
||||||
{}
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Highlight when yanking.
|
|
||||||
createCmd("TextYankPost", {
|
|
||||||
desc = "Highlight when yanking text.",
|
|
||||||
group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }),
|
|
||||||
callback = function()
|
|
||||||
vim.highlight.on_yank()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Force zsh scripts to use bash syntax highlighting.
|
|
||||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
|
||||||
pattern = "*",
|
|
||||||
callback = function(args)
|
|
||||||
local first_line = vim.api.nvim_buf_get_lines(args.buf, 0, 1, false)[1] or ""
|
|
||||||
if first_line:match("^#!.*zsh") then
|
|
||||||
vim.bo[args.buf].filetype = "bash"
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
54
env/.config/nvim/lua/config/keymaps.lua
vendored
54
env/.config/nvim/lua/config/keymaps.lua
vendored
@@ -1,54 +0,0 @@
|
|||||||
-- Keymaps are automatically loaded on the VeryLazy event
|
|
||||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
|
||||||
-- Add any additional keymaps here
|
|
||||||
|
|
||||||
local keymap = vim.keymap.set
|
|
||||||
local default_options = { noremap = true, silent = true }
|
|
||||||
local wk = require("which-key")
|
|
||||||
|
|
||||||
local wk_add = function(mode, keymaps)
|
|
||||||
wk.add(keymaps, { mode = mode, silent = true })
|
|
||||||
end
|
|
||||||
|
|
||||||
keymap("i", "jk", "<ESC>", default_options)
|
|
||||||
|
|
||||||
local make_executable = function()
|
|
||||||
local file = vim.fn.expand("%:p")
|
|
||||||
vim.cmd("silent !chmod +x " .. file)
|
|
||||||
print("Made " .. file .. " executable")
|
|
||||||
end
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
-- Normal Mode
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
wk_add("n", {
|
|
||||||
{ "<Left>", ":vertical resize +1<CR>", desc = "Resize Pane Left" },
|
|
||||||
{ "<Right>", ":vertical resize -1<CR>", desc = "Resize Pane Right" },
|
|
||||||
{ "<Up>", "resize -1<CR>", desc = "Resize Pane Up" },
|
|
||||||
{ "<Down>", "resize +1<CR>", desc = "Resize Pane Down" },
|
|
||||||
|
|
||||||
{ "<leader>n", "<CMD>:noh<CR>", desc = "[N]o highlighting" },
|
|
||||||
{ "<leader>s", "<CMD>:set spell!<CR>", desc = "[S]pell check toggle" },
|
|
||||||
{ "<C-s>", "<CMD>:write<CR>", desc = "[S]ave" },
|
|
||||||
|
|
||||||
{ "J", ":move .+1<CR>==", desc = "Move line down" },
|
|
||||||
{ "K", ":move .-2<CR>==", desc = "Move line up" },
|
|
||||||
|
|
||||||
{ "<leader>x", make_executable, desc = "Make current file e[x]ecutable" },
|
|
||||||
{ "<leader>z", "<CMD>:ZenMode<CR>", desc = "[Z]en Mode" },
|
|
||||||
})
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
-- Visual Mode
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
vim.keymap.set("v", "K", ":move '<-2<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
|
|
||||||
vim.keymap.set("v", "J", ":move '>+1<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
|
|
||||||
|
|
||||||
-- Toggle term key maps, that get attached when terminal is opened.
|
|
||||||
function _G.set_terminal_keymaps()
|
|
||||||
local opts = { buffer = 0 }
|
|
||||||
keymap("t", "<esc>", [[<C-\><C-n>]], opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
|
|
||||||
69
env/.config/nvim/lua/config/lazy.lua
vendored
69
env/.config/nvim/lua/config/lazy.lua
vendored
@@ -1,69 +0,0 @@
|
|||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|
||||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
|
||||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
|
||||||
if vim.v.shell_error ~= 0 then
|
|
||||||
vim.api.nvim_echo({
|
|
||||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
|
||||||
{ out, "WarningMsg" },
|
|
||||||
{ "\nPress any key to exit..." },
|
|
||||||
}, true, {})
|
|
||||||
vim.fn.getchar()
|
|
||||||
os.exit(1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
require("lazy").setup({
|
|
||||||
spec = {
|
|
||||||
-- add LazyVim and import its plugins
|
|
||||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
|
||||||
{
|
|
||||||
import = "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" },
|
|
||||||
},
|
|
||||||
defaults = {
|
|
||||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
|
||||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
|
||||||
lazy = false,
|
|
||||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
|
||||||
-- have outdated releases, which may break your Neovim install.
|
|
||||||
version = false, -- always use the latest git commit
|
|
||||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
|
||||||
},
|
|
||||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
|
||||||
checker = {
|
|
||||||
enabled = true, -- check for plugin updates periodically
|
|
||||||
notify = false, -- notify on update
|
|
||||||
}, -- automatically check for plugin updates
|
|
||||||
performance = {
|
|
||||||
rtp = {
|
|
||||||
-- disable some rtp plugins
|
|
||||||
disabled_plugins = {
|
|
||||||
"gzip",
|
|
||||||
-- "matchit",
|
|
||||||
-- "matchparen",
|
|
||||||
-- "netrwPlugin",
|
|
||||||
"tarPlugin",
|
|
||||||
"tohtml",
|
|
||||||
"tutor",
|
|
||||||
"zipPlugin",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
72
env/.config/nvim/lua/config/options.lua
vendored
72
env/.config/nvim/lua/config/options.lua
vendored
@@ -1,72 +0,0 @@
|
|||||||
-- Options are automatically loaded before lazy.nvim startup
|
|
||||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
|
||||||
-- Add any additional options here
|
|
||||||
--
|
|
||||||
local o = vim.opt
|
|
||||||
local wo = vim.wo
|
|
||||||
local fn = vim.fn
|
|
||||||
|
|
||||||
vim.cmd.set("inccommand=split")
|
|
||||||
o.filetype = "on"
|
|
||||||
o.updatetime = 500 -- faster completion
|
|
||||||
o.timeoutlen = 800 -- time to wait for a mapped sequence to complete (in milliseconds)
|
|
||||||
o.ttimeoutlen = 300 -- Time in milliseconds to wait for a key code sequence to complete
|
|
||||||
o.backup = false -- creates a backup file
|
|
||||||
o.swapfile = false -- enable/disable swap file creation
|
|
||||||
o.dir = fn.stdpath("data") .. "/swp" -- swap file directory
|
|
||||||
o.undofile = false -- enable/disable undo file creation
|
|
||||||
o.undodir = fn.stdpath("data") .. "/undodir" -- set undo directory
|
|
||||||
o.history = 500 -- Use the 'history' option to set the number of lines from command mode that are remembered.
|
|
||||||
o.hidden = true -- required to keep multiple buffers and open multiple buffers
|
|
||||||
--o.clipboard = "unnamedplus" -- allows neovim to access the system clipboard
|
|
||||||
o.fileencoding = "utf-8" -- the encoding written to a file
|
|
||||||
o.conceallevel = 0 -- so that `` is visible in markdown files
|
|
||||||
o.number = true -- set numbered lines
|
|
||||||
o.relativenumber = true -- set relative numbered lines
|
|
||||||
o.cmdheight = 1 -- space for displaying messages/commands
|
|
||||||
o.showmode = false -- we don't need to see things like -- INSERT -- anymore
|
|
||||||
o.showtabline = 2 -- always show tabs
|
|
||||||
o.laststatus = 2 -- The value of this option influences when the last window will have a status line (2 always)
|
|
||||||
o.smartcase = true -- smart case
|
|
||||||
o.smartindent = true -- make indenting smarter again
|
|
||||||
o.splitbelow = true -- force all horizontal splits to go below current window
|
|
||||||
o.splitright = true -- force all vertical splits to go to the right of current window
|
|
||||||
o.autoindent = true -- turn on auto indent.
|
|
||||||
o.expandtab = true -- convert tabs to spaces
|
|
||||||
o.smarttab = true -- turn on smart tab
|
|
||||||
o.shiftwidth = 2 -- the number of spaces inserted for each indentation
|
|
||||||
o.tabstop = 2 -- how many columns a tab counts for
|
|
||||||
o.termguicolors = true -- set term gui colors (most terminals support this)
|
|
||||||
o.cursorline = true -- highlight the current line
|
|
||||||
o.scrolloff = 20 -- Minimal number of screen lines to keep above and below the cursor
|
|
||||||
o.sidescrolloff = 5 -- The minimal number of columns to scroll horizontally
|
|
||||||
o.hlsearch = false -- highlight all matches on previous search pattern
|
|
||||||
o.ignorecase = true -- ignore case in search patterns
|
|
||||||
o.foldenable = false -- disable folding; enable with zi
|
|
||||||
o.foldmethod = "expr"
|
|
||||||
o.foldexpr = "nvim_treesitter#foldexpr()"
|
|
||||||
vim.cmd.set("nolist") -- don't show listchars.
|
|
||||||
-- o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<"
|
|
||||||
o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣"
|
|
||||||
o.shortmess = o.shortmess + "c" -- prevent "pattern not found" messages
|
|
||||||
wo.colorcolumn = "99999"
|
|
||||||
o.wildmode = "full"
|
|
||||||
o.lazyredraw = false -- do not redraw screen while running macros
|
|
||||||
o.grepprg = "rg --hidden --vimgrep --smart-case --"
|
|
||||||
o.completeopt = { "menu", "menuone", "noselect", "noinsert" } -- A comma separated list of options for Insert mode completion
|
|
||||||
o.wildignorecase = true -- When set case is ignored when completing file names and directories
|
|
||||||
o.wildignore = [[
|
|
||||||
.git,.hg,.svn
|
|
||||||
*.aux,*.out,*.toc
|
|
||||||
*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
|
|
||||||
*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
|
|
||||||
*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
|
|
||||||
*.mp3,*.oga,*.ogg,*.wav,*.flac
|
|
||||||
*.eot,*.otf,*.ttf,*.woff
|
|
||||||
*.doc,*.pdf,*.cbr,*.cbz
|
|
||||||
*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
|
|
||||||
*.swp,.lock,.DS_Store,._*
|
|
||||||
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
|
|
||||||
]]
|
|
||||||
o.viminfo = "" -- disable viminfo from copying information from current session, for security.
|
|
||||||
vim.g.snacks_animate = false
|
|
||||||
8
env/.config/nvim/lua/plugins/cmp.lua
vendored
8
env/.config/nvim/lua/plugins/cmp.lua
vendored
@@ -1,8 +0,0 @@
|
|||||||
return {
|
|
||||||
"saghen/blink.cmp",
|
|
||||||
opts = {
|
|
||||||
keymap = {
|
|
||||||
preset = "default"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
env/.config/nvim/lua/plugins/colorscheme.lua
vendored
9
env/.config/nvim/lua/plugins/colorscheme.lua
vendored
@@ -1,9 +0,0 @@
|
|||||||
return {
|
|
||||||
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
|
|
||||||
{
|
|
||||||
"LazyVim/LazyVim",
|
|
||||||
opts = {
|
|
||||||
colorscheme = "catppuccin",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
4
env/.config/nvim/lua/plugins/disabled.lua
vendored
4
env/.config/nvim/lua/plugins/disabled.lua
vendored
@@ -1,4 +0,0 @@
|
|||||||
return {
|
|
||||||
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
|
||||||
{ "akinsho/bufferline.nvim", enabled = false },
|
|
||||||
}
|
|
||||||
23
env/.config/nvim/lua/plugins/fidget.lua
vendored
23
env/.config/nvim/lua/plugins/fidget.lua
vendored
@@ -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,
|
|
||||||
}
|
|
||||||
30
env/.config/nvim/lua/plugins/formatter.lua
vendored
30
env/.config/nvim/lua/plugins/formatter.lua
vendored
@@ -1,30 +0,0 @@
|
|||||||
return {
|
|
||||||
"stevearc/conform.nvim",
|
|
||||||
opts = {
|
|
||||||
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" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
78
env/.config/nvim/lua/plugins/harpoon.lua
vendored
78
env/.config/nvim/lua/plugins/harpoon.lua
vendored
@@ -1,78 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"ThePrimeagen/harpoon",
|
|
||||||
branch = "harpoon2",
|
|
||||||
opts = {
|
|
||||||
settings = {
|
|
||||||
save_on_toggle = true,
|
|
||||||
sync_on_ui_close = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<C-e>",
|
|
||||||
function()
|
|
||||||
require("harpoon").ui:toggle_quick_menu(require("harpoon"):list())
|
|
||||||
end,
|
|
||||||
desc = "Open Harpoon window.",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>a",
|
|
||||||
function()
|
|
||||||
require("harpoon"):list():add()
|
|
||||||
end,
|
|
||||||
desc = "[A]dd to the harpoon list.",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<A-y>",
|
|
||||||
function()
|
|
||||||
require("harpoon"):list():select(1)
|
|
||||||
end,
|
|
||||||
desc = "Select first harpoon buffer.",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<A-u>",
|
|
||||||
function()
|
|
||||||
require("harpoon"):list():select(2)
|
|
||||||
end,
|
|
||||||
desc = "Select second harpoon buffer.",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<A-i>",
|
|
||||||
function()
|
|
||||||
require("harpoon"):list():select(3)
|
|
||||||
end,
|
|
||||||
desc = "Select third harpoon buffer.",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<A-o>",
|
|
||||||
function()
|
|
||||||
require("harpoon"):list():select(4)
|
|
||||||
end,
|
|
||||||
desc = "Select fourth harpoon buffer.",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<C-[>",
|
|
||||||
function()
|
|
||||||
require("harpoon"):list():prev()
|
|
||||||
end,
|
|
||||||
desc = "Previous harpoon buffer.",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<C-]>",
|
|
||||||
function()
|
|
||||||
require("harpoon"):list():next()
|
|
||||||
end,
|
|
||||||
desc = "Next harpoon buffer.",
|
|
||||||
},
|
|
||||||
-- Extensions
|
|
||||||
require("harpoon"):extend({
|
|
||||||
UI_CREATE = function(cx)
|
|
||||||
vim.keymap.set("n", "<C-v>", function()
|
|
||||||
require("harpoon").ui:select_menu_item({ vsplit = true })
|
|
||||||
end, { buffer = cx.buffer, desc = "Open in [V]split" })
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
29
env/.config/nvim/lua/plugins/init.lua
vendored
29
env/.config/nvim/lua/plugins/init.lua
vendored
@@ -1,29 +0,0 @@
|
|||||||
-- Plugins that don't require much configuration are in here.
|
|
||||||
--
|
|
||||||
return {
|
|
||||||
{
|
|
||||||
"folke/snacks.nvim",
|
|
||||||
opts = {
|
|
||||||
indent = { enabled = false },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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
env/.config/nvim/lua/plugins/lint.lua
vendored
12
env/.config/nvim/lua/plugins/lint.lua
vendored
@@ -1,12 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"mfussenegger/nvim-lint",
|
|
||||||
opts = {
|
|
||||||
linters = {
|
|
||||||
markdownlint = {
|
|
||||||
args = { "--config", "~/.markdownlint.jsonc", "--" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
169
env/.config/nvim/lua/plugins/lsp.lua
vendored
169
env/.config/nvim/lua/plugins/lsp.lua
vendored
@@ -1,169 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"mason-org/mason.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
ensure_installed = {
|
|
||||||
"clangd",
|
|
||||||
"marksman",
|
|
||||||
"shfmt",
|
|
||||||
"tinymist",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
opts = {
|
|
||||||
ensure_installed = {
|
|
||||||
"bash",
|
|
||||||
"cmake",
|
|
||||||
"dockerfile",
|
|
||||||
"editorconfig",
|
|
||||||
"ini",
|
|
||||||
"jq",
|
|
||||||
"latex",
|
|
||||||
"make",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
opts = {
|
|
||||||
servers = {
|
|
||||||
bashls = {},
|
|
||||||
clangd = {},
|
|
||||||
dockerls = {},
|
|
||||||
gopls = {},
|
|
||||||
harper_ls = {},
|
|
||||||
jsonls = {},
|
|
||||||
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 = {
|
|
||||||
clangd = function(_, opts)
|
|
||||||
opts.capabilities.offsetEncoding = { "utf-16" }
|
|
||||||
end,
|
|
||||||
sourcekit = function(_, opts)
|
|
||||||
opts.cmd = {
|
|
||||||
vim.trim(vim.fn.system("xcrun -f sourcekit-lsp")) or nil,
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- return {
|
|
||||||
-- "neovim/nvim-lspconfig",
|
|
||||||
-- event = { "BufReadPre", "BufNewFile" },
|
|
||||||
-- dependencies = {
|
|
||||||
-- "hrsh7th/cmp-nvim-lsp",
|
|
||||||
-- { "antosha417/nvim-lsp-file-operations", config = true },
|
|
||||||
-- "williamboman/mason.nvim",
|
|
||||||
-- "williamboman/mason-lspconfig.nvim",
|
|
||||||
-- {
|
|
||||||
-- "folke/lazydev.nvim",
|
|
||||||
-- ft = "lua",
|
|
||||||
-- opts = {
|
|
||||||
-- library = {
|
|
||||||
-- { path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- config = function()
|
|
||||||
-- require("mason").setup()
|
|
||||||
-- require("mason-lspconfig").setup({
|
|
||||||
-- opts = {
|
|
||||||
-- ensure_installed = lsp_servers,
|
|
||||||
-- },
|
|
||||||
-- })
|
|
||||||
-- local lspconfig = require("lspconfig")
|
|
||||||
-- local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
|
||||||
-- local capabilities = cmp_nvim_lsp.default_capabilities()
|
|
||||||
-- local opts = { noremap = true, silent = true }
|
|
||||||
-- local on_attach = function(_, bufnr)
|
|
||||||
-- opts.buffer = bufnr
|
|
||||||
--
|
|
||||||
-- opts.desc = "Show line diagnostics"
|
|
||||||
-- vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
|
|
||||||
--
|
|
||||||
-- opts.desc = "Show diagnostics in Telescope"
|
|
||||||
-- vim.keymap.set("n", "<leader><leader>d", "<CMD>Telescope diagnostics bufnr=0<CR>", opts)
|
|
||||||
--
|
|
||||||
-- opts.desc = "Show documentation for what is under cursor"
|
|
||||||
-- vim.keymap.set("n", "<C-k>", vim.lsp.buf.hover, opts)
|
|
||||||
--
|
|
||||||
-- opts.desc = "[G]oto [D]efinition"
|
|
||||||
-- vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions trim_text=true<cr>", opts)
|
|
||||||
--
|
|
||||||
-- opts.desc = "[G]oto [D]eclaration"
|
|
||||||
-- vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
|
||||||
--
|
|
||||||
-- opts.desc = "LSP [C]ode [A]ction"
|
|
||||||
-- vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
|
||||||
--
|
|
||||||
-- --opts.desc = "[R]e-[N]ame"
|
|
||||||
-- --vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
|
||||||
--
|
|
||||||
-- opts.desc = "[R]eload or start LSP"
|
|
||||||
-- vim.keymap.set("n", "<leader>rl", ":LspRestart | :LspStart<CR>", opts)
|
|
||||||
--
|
|
||||||
-- opts.desc = "Goto previous diagnostic"
|
|
||||||
-- vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
|
|
||||||
--
|
|
||||||
-- opts.desc = "Goto next diagnostic"
|
|
||||||
-- vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- for _, lsp in ipairs(lsp_servers) do
|
|
||||||
-- lspconfig[lsp].setup({
|
|
||||||
-- capabilities = capabilities,
|
|
||||||
-- on_attach = on_attach,
|
|
||||||
-- on_init = function(client)
|
|
||||||
-- -- HACK: to fix some issues with LSP
|
|
||||||
-- -- more details: https://github.com/neovim/neovim/issues/19237#issuecomment-2237037154
|
|
||||||
-- client.offset_encoding = "utf-8"
|
|
||||||
-- end,
|
|
||||||
-- cmd = lsp == "sourcekit" and { vim.trim(vim.fn.system("xcrun -f sourcekit-lsp")) } or nil,
|
|
||||||
-- })
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- -- nice icons
|
|
||||||
-- local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
|
||||||
-- for type, icon in pairs(signs) do
|
|
||||||
-- local hl = "DiagnosticSign" .. type
|
|
||||||
-- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- -- For some reason I was having trouble getting this to work inside the on-attach, so it's here.
|
|
||||||
-- vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e-[N]ame" })
|
|
||||||
-- end,
|
|
||||||
-- }
|
|
||||||
39
env/.config/nvim/lua/plugins/luasnip.lua
vendored
39
env/.config/nvim/lua/plugins/luasnip.lua
vendored
@@ -1,39 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
opts = function()
|
|
||||||
LazyVim.cmp.actions.snippet_forward = function()
|
|
||||||
if require("luasnip").jumpable(1) then
|
|
||||||
require("luasnip").jump(1)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
LazyVim.cmp.actions.snippet_stop = function()
|
|
||||||
if require("luasnip").expand_or_jumpable() then -- or just jumpable(1) is fine?
|
|
||||||
require("luasnip").unlink_current()
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<C-k>",
|
|
||||||
mode = { "i", "s" },
|
|
||||||
function()
|
|
||||||
if ls.expand_or_jumpable() then
|
|
||||||
ls.expand_or_jump()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<C-j>",
|
|
||||||
mode = { "i", "s" },
|
|
||||||
function()
|
|
||||||
if ls.jumpable(-1) then
|
|
||||||
ls.jump(-1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
40
env/.config/nvim/lua/plugins/oil.lua
vendored
40
env/.config/nvim/lua/plugins/oil.lua
vendored
@@ -1,40 +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 = {
|
|
||||||
show_hidden = true,
|
|
||||||
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
|
|
||||||
return false
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
-- Show the parent directory in current window.
|
|
||||||
{ "-", "<CMD>Oil<CR>", desc = "Open parent directory." },
|
|
||||||
-- Open parent directory in floating window.
|
|
||||||
{
|
|
||||||
"<space>-",
|
|
||||||
function()
|
|
||||||
require("oil").toggle_float()
|
|
||||||
end,
|
|
||||||
desc = "Open parent directory in floating window.",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
47
env/.config/nvim/lua/plugins/snacks.lua
vendored
47
env/.config/nvim/lua/plugins/snacks.lua
vendored
@@ -1,47 +0,0 @@
|
|||||||
-- 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 = [[
|
|
||||||
*
|
|
||||||
+++++
|
|
||||||
+++++++++
|
|
||||||
==+++++++++++
|
|
||||||
+===:+++++++++++*
|
|
||||||
+======--+++++++++++*##+====
|
|
||||||
+==========:=+++++++++++#+====
|
|
||||||
+=============-=++++++++++++====
|
|
||||||
+================-:+++++++++++++==
|
|
||||||
+===================--++++++++++++++*
|
|
||||||
+======================--+++++++++++++++*
|
|
||||||
=========================-++++++++++++++++
|
|
||||||
==========================:+++++++++++++++
|
|
||||||
===========================:++++++++++++++
|
|
||||||
===========================-.-++++++++++++
|
|
||||||
===========================-::.=++++++++++
|
|
||||||
===========================----..=++++++++
|
|
||||||
===========================------..:=+++++
|
|
||||||
===========================--------:...-++
|
|
||||||
===========================------------:.:
|
|
||||||
===========================---------------
|
|
||||||
===========================---------------
|
|
||||||
===========================---------------
|
|
||||||
]],
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
11
env/.config/nvim/lua/plugins/telescope.lua
vendored
11
env/.config/nvim/lua/plugins/telescope.lua
vendored
@@ -1,11 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
import = "lazyvim.plugins.extras.editor.telescope",
|
|
||||||
enabled = false,
|
|
||||||
opts = {
|
|
||||||
ensure_installed = {
|
|
||||||
"swift",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
14
env/.config/nvim/lua/plugins/todo-comment.lua
vendored
14
env/.config/nvim/lua/plugins/todo-comment.lua
vendored
@@ -1,14 +0,0 @@
|
|||||||
return {
|
|
||||||
"folke/todo-comments.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"folke/trouble.nvim",
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ "<leader>xt", false },
|
|
||||||
{ "<leader>xT", false },
|
|
||||||
{ "<leader>tq", "<CMD>Trouble todo toggle<CR>", desc = "[T]odo [Q]uick fix list." },
|
|
||||||
{ "<leader><leader>t", "<CMD>TodoTelescope<CR>", desc = "[T]odo telescope list." },
|
|
||||||
{ "<leader>tl", "<CMD>TodoLocList<CR>", desc = "[T]odo [L]ocation list." },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
15
env/.config/nvim/lua/plugins/typst-preview.lua
vendored
15
env/.config/nvim/lua/plugins/typst-preview.lua
vendored
@@ -1,15 +0,0 @@
|
|||||||
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."
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
73
env/.config/nvim/lua/plugins/xcodebuild.lua
vendored
73
env/.config/nvim/lua/plugins/xcodebuild.lua
vendored
@@ -1,73 +0,0 @@
|
|||||||
local progress_handle
|
|
||||||
|
|
||||||
return {
|
|
||||||
"wojciech-kulik/xcodebuild.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
show_build_progress_bar = false,
|
|
||||||
logs = {
|
|
||||||
auto_open_on_success_tests = false,
|
|
||||||
auto_open_on_failed_tests = false,
|
|
||||||
auto_open_on_success_build = false,
|
|
||||||
auto_open_on_failed_build = false,
|
|
||||||
auto_focus = false,
|
|
||||||
auto_close_on_app_launch = true,
|
|
||||||
only_summary = true,
|
|
||||||
notify = function(message, severity)
|
|
||||||
local fidget = require("fidget")
|
|
||||||
if progress_handle then
|
|
||||||
progress_handle.message = message
|
|
||||||
if not message:find("Loading") then
|
|
||||||
progress_handle:finish()
|
|
||||||
progress_handle = nil
|
|
||||||
if vim.trim(message) ~= "" then
|
|
||||||
fidget.notify(message, severity)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
fidget.notify(message, severity)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
notify_progress = function(message)
|
|
||||||
local progress = require("fidget.progress")
|
|
||||||
|
|
||||||
if progress_handle then
|
|
||||||
progress_handle.title = ""
|
|
||||||
progress_handle.message = message
|
|
||||||
else
|
|
||||||
progress_handle = progress.handle.create({
|
|
||||||
message = message,
|
|
||||||
lsp_client = { name = "xcodebuild.nvim" },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
code_coverage = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ "<leader>X", "<cmd>XcodebuildPicker<cr>", desc = "Show Xcodebuild Actions" },
|
|
||||||
{ "<leader>xf", "<cmd>XcodebuildProjectManager<cr>", desc = "Show Project Manager Actions" },
|
|
||||||
{ "<leader>xb", "<cmd>XcodebuildBuild<cr>", desc = "Build Project" },
|
|
||||||
{ "<leader>xB", "<cmd>XcodebuildBuildForTesting<cr>", desc = "Build For Testing" },
|
|
||||||
{ "<leader>xr", "<cmd>XcodebuildBuildRun<cr>", desc = "Build & Run Project" },
|
|
||||||
{ "<leader>xt", "<cmd>XcodebuildTest<cr>", desc = "Run Tests" },
|
|
||||||
{ "<leader>xt", "<cmd>XcodebuildTestSelected<cr>", desc = "Run Selected Tests" },
|
|
||||||
{ "<leader>xT", "<cmd>XcodebuildTestClass<cr>", desc = "Run This Test Class" },
|
|
||||||
{ "<leader>xl", "<cmd>XcodebuildToggleLogs<cr>", desc = "Toggle Xcodebuild Logs" },
|
|
||||||
{ "<leader>xc", "<cmd>XcodebuildToggleCodeCoverage<cr>", desc = "Toggle Code Coverage" },
|
|
||||||
{ "<leader>xC", "<cmd>XcodebuildShowCodeCoverageReport<cr>", desc = "Show Code Coverage Report" },
|
|
||||||
{ "<leader>xe", "<cmd>XcodebuildTestExplorerToggle<cr>", desc = "Toggle Test Explorer" },
|
|
||||||
{ "<leader>xs", "<cmd>XcodebuildFailingSnapshots<cr>", desc = "Show Failing Snapshots" },
|
|
||||||
{ "<leader>xd", "<cmd>XcodebuildSelectDevice<cr>", desc = "Select Device" },
|
|
||||||
{ "<leader>xp", "<cmd>XcodebuildSelectTestPlan<cr>", desc = "Select Test Plan" },
|
|
||||||
{ "<leader>xq", "<cmd>Telescope quickfix<cr", desc = "Show QuickFix List" },
|
|
||||||
{ "<leader>xx", "<cmd>XcodebuildQuickfixLine<cr>", desc = "Quickfix Line" },
|
|
||||||
{ "<leader>xa", "<cmd>XcodebuildCodeActions<cr>", desc = "Show Code Actions" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
28
env/.config/zsh/.zshrc
vendored
28
env/.config/zsh/.zshrc
vendored
@@ -19,17 +19,6 @@ zle -N down-line-or-beginning-search
|
|||||||
# Colors
|
# Colors
|
||||||
autoload -Uz colors && colors
|
autoload -Uz colors && colors
|
||||||
|
|
||||||
#------------------------------ pager ------------------------------
|
|
||||||
#eval "$(batman --export-env)"
|
|
||||||
# export LESS_TERMCAP_mb="[35m" # magenta
|
|
||||||
# export LESS_TERMCAP_md="[33m" # yellow
|
|
||||||
# export LESS_TERMCAP_me=""
|
|
||||||
# export LESS_TERMCAP_se=""
|
|
||||||
# export LESS_TERMCAP_so="[34m" # blue
|
|
||||||
# export LESS_TERMCAP_ue=""
|
|
||||||
# export LESS_TERMCAP_so="[4m" # underline
|
|
||||||
# export LESSHISTFILE="-"
|
|
||||||
|
|
||||||
#------------------------------ path ------------------------------
|
#------------------------------ path ------------------------------
|
||||||
|
|
||||||
# Helper function to prepend to the $PATH
|
# Helper function to prepend to the $PATH
|
||||||
@@ -70,7 +59,8 @@ path_prepend \
|
|||||||
"$SCRIPTS/mail" \
|
"$SCRIPTS/mail" \
|
||||||
"$HOME/.local/pnpm" \
|
"$HOME/.local/pnpm" \
|
||||||
"$CARGO_HOME/bin" \
|
"$CARGO_HOME/bin" \
|
||||||
"$HOME/.local/bin"
|
"$HOME/.local/bin" \
|
||||||
|
"$XDG_DATA_HOME/bob/nvim-bin"
|
||||||
|
|
||||||
# last arg will be first in $FPATH
|
# last arg will be first in $FPATH
|
||||||
fpath_prepend \
|
fpath_prepend \
|
||||||
@@ -96,8 +86,6 @@ export HISTFILESIZE=5000
|
|||||||
export SAVEHIST=5000
|
export SAVEHIST=5000
|
||||||
export HISTFILE="$XDG_CONFIG_HOME/zsh/history"
|
export HISTFILE="$XDG_CONFIG_HOME/zsh/history"
|
||||||
|
|
||||||
#set -o vi
|
|
||||||
|
|
||||||
#------------------------------ cdpath ------------------------------
|
#------------------------------ cdpath ------------------------------
|
||||||
setopt autocd
|
setopt autocd
|
||||||
|
|
||||||
@@ -131,7 +119,6 @@ zsh_add_plugin "Aloxaf/fzf-tab"
|
|||||||
|
|
||||||
#------------------------------ completions ------------------------------
|
#------------------------------ completions ------------------------------
|
||||||
# case insensitive path-completion
|
# case insensitive path-completion
|
||||||
#zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
|
|
||||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
|
||||||
|
|
||||||
# partial completion suggestions
|
# partial completion suggestions
|
||||||
@@ -153,10 +140,8 @@ _source_if "$ZDOTDIR/plugins/fzf-tab/fzf-tab.plugin.zsh"
|
|||||||
|
|
||||||
#------------------------------ prompt ------------------------------
|
#------------------------------ prompt ------------------------------
|
||||||
|
|
||||||
# Prompt / managed by brew. (`brew install starship`)
|
|
||||||
autoload -Uz promptinit; promptinit
|
autoload -Uz promptinit; promptinit
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
#prompt pure
|
|
||||||
|
|
||||||
#------------------------------ aliases ------------------------------
|
#------------------------------ aliases ------------------------------
|
||||||
|
|
||||||
@@ -201,11 +186,7 @@ alias tks='tmux kill-session -t' # kill tmux session
|
|||||||
alias temp='cd $(mktemp -d)' # create a temporary directory and move into it.
|
alias temp='cd $(mktemp -d)' # create a temporary directory and move into it.
|
||||||
alias vi='nvim' # set vi to open neovim
|
alias vi='nvim' # set vi to open neovim
|
||||||
alias newf='"$SCRIPTS"/newx --function' # generate a new shell function
|
alias newf='"$SCRIPTS"/newx --function' # generate a new shell function
|
||||||
alias nlnv='nvim "$LOCAL_ENV"' # open local environment overrides file in neovime
|
alias n='nvim'
|
||||||
alias nvim='unset VIMINIT && unset MYVIMRC && nvim' # alias nvim to unset vimrc, useful when using both vim & neovim
|
|
||||||
alias nvim-mhoush='NVIM_APPNAME=m-housh && nvim' # set neovim to use my config.
|
|
||||||
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.
|
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" # set wget history location.
|
||||||
# GPG Yubikey restart relearn when switching keys and stubbed.
|
# 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 yubikeyrestart='gpg-connect-agent killagent /bye && gpg-connect-agent "scd serialno" "learn --force" /bye && gpg --card-status'
|
||||||
@@ -235,12 +216,9 @@ esac
|
|||||||
# pnpm end
|
# pnpm end
|
||||||
|
|
||||||
# The following lines have been added by Docker Desktop to enable Docker CLI completions.
|
# The following lines have been added by Docker Desktop to enable Docker CLI completions.
|
||||||
# fpath=(/Users/michael/.docker/completions $fpath)
|
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
compinit
|
compinit
|
||||||
|
|
||||||
#eval "$(ssh-agent -s)" 1>/dev/null
|
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# Set things up for using gpg-agent
|
# Set things up for using gpg-agent
|
||||||
|
|
||||||
|
|||||||
25
env/.config/zsh/functions/n
vendored
25
env/.config/zsh/functions/n
vendored
@@ -1,25 +0,0 @@
|
|||||||
#!/usr/bin/env zsh
|
|
||||||
|
|
||||||
# Open's neovim.
|
|
||||||
#
|
|
||||||
# If the argument passed in is a directory or not supplied, then
|
|
||||||
# open neovim with telescope find files opened. Otherwise open the
|
|
||||||
# file that is supplied.
|
|
||||||
#
|
|
||||||
|
|
||||||
function n() {
|
|
||||||
# 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
|
|
||||||
|
|
||||||
nvim "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
2
env/.tmux.conf
vendored
2
env/.tmux.conf
vendored
@@ -14,7 +14,7 @@ TMUX_FZF_OPTIONS="-p -w 60% -h 80% -m"
|
|||||||
set-option -sa terminal-overrides ",xterm*:Tc"
|
set-option -sa terminal-overrides ",xterm*:Tc"
|
||||||
|
|
||||||
# Change the default $TERM to tmux-256color
|
# Change the default $TERM to tmux-256color
|
||||||
set -g default-terminal "xterm-256color"
|
set -g default-terminal "tmux-256color"
|
||||||
|
|
||||||
# Change windows to start with an index of 1 instead of 0
|
# Change windows to start with an index of 1 instead of 0
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
|
|||||||
8
env/.zshenv
vendored
8
env/.zshenv
vendored
@@ -19,9 +19,6 @@ export VISUAL=nvim
|
|||||||
export EDITOR_PREFIX=nvim
|
export EDITOR_PREFIX=nvim
|
||||||
export MANPAGER="bat"
|
export MANPAGER="bat"
|
||||||
export BROWSER="brave"
|
export BROWSER="brave"
|
||||||
#export VIMINIT='source $MYVIMRC'
|
|
||||||
#export MYVIMRC="$HOME/.vim/vimrc"
|
|
||||||
#export NVIM_APPNAME="m-housh"
|
|
||||||
|
|
||||||
# Git
|
# Git
|
||||||
export GITUSER="m-housh"
|
export GITUSER="m-housh"
|
||||||
@@ -36,6 +33,8 @@ export LOCAL_ENV="$XDG_DATA_HOME/zsh/env.zsh"
|
|||||||
export MYZSHRC="$ZDOTDIR/.zshrc"
|
export MYZSHRC="$ZDOTDIR/.zshrc"
|
||||||
export SCRIPTS="$HOME/.local/scripts"
|
export SCRIPTS="$HOME/.local/scripts"
|
||||||
export SKELETONDIR="$DOTFILES/skeleton"
|
export SKELETONDIR="$DOTFILES/skeleton"
|
||||||
|
export REPOS="$HOME/dev"
|
||||||
|
export WORK="$HOME/work"
|
||||||
|
|
||||||
# NPM
|
# NPM
|
||||||
export NPM_CONFIG_CACHE="$XDG_DATA_HOME/npm"
|
export NPM_CONFIG_CACHE="$XDG_DATA_HOME/npm"
|
||||||
@@ -68,10 +67,9 @@ export VAULT_ADDR="https://vault.housh.dev"
|
|||||||
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||||
|
|
||||||
# Tmux-Sessionator path.
|
# Tmux-Sessionator path.
|
||||||
export TMUX_SESSIONATOR_PATH="$HOME:$SCRIPTS:$HOME/.config:$HOME/.config/personal:$HOME/dev:$HOME/dev/homelab/utils:$HOME/dev/homelab/services:$HOME/work/consults:$HOME/work"
|
export TMUX_SESSIONATOR_PATH="$HOME:$SCRIPTS:$HOME/.config:$HOME/.config/personal:$REPOS:$REPOS/homelab/utils:$REPOS/homelab/services:$WORK/consults:$WORK"
|
||||||
|
|
||||||
# Password-store
|
# Password-store
|
||||||
# export PASSWORD_STORE_DIR="$XDG_DATA_HOME/gopass/stores/root"
|
|
||||||
export PASSWORD_STORE_GENERATED_LENGTH=40
|
export PASSWORD_STORE_GENERATED_LENGTH=40
|
||||||
export PASSWORD_STORE_ENABLE_EXTENSIONS=true
|
export PASSWORD_STORE_ENABLE_EXTENSIONS=true
|
||||||
|
|
||||||
|
|||||||
1
mail
Submodule
1
mail
Submodule
Submodule mail added at 013f3c7c18
Reference in New Issue
Block a user