Compare commits

...

121 Commits

Author SHA1 Message Date
d84bc8062e Use prettier instead of prettierd
I keep having issues with prettierd not working and prettier works just
fine.
2025-12-05 13:48:28 +01:00
4e3d0500b9 Fixed pnpm setup 2025-12-03 21:32:20 +01:00
38f4c63336 Extra luals settings 2025-11-22 00:29:11 +01:00
434ff26226 Add eslint 2025-11-22 00:29:11 +01:00
af95197cb1 Update lspconfig 2025-11-22 00:29:10 +01:00
c2772d1874 Add vtsls as manual lsp 2025-11-22 00:29:10 +01:00
dd22699549 Switch default branch to main 2025-11-22 00:29:10 +01:00
b35b35731b zsh: Fix bat command availability check 2025-09-13 19:37:31 +02:00
881f99ef16 nvim: Use fork of which-key to fix border 2025-09-13 02:42:42 +02:00
0117cc612e zsh: Only start sesh-select if both sesh and sesh-select are available 2025-09-13 02:00:53 +02:00
1d3ae136be sesh: Moved sesh-select to be under sesh 2025-09-13 01:59:45 +02:00
362064b206 git: Also install git fixup on git-alten 2025-09-13 01:35:29 +02:00
c84b6b6584 nvim: Added crate plugin 2025-09-12 02:47:17 +02:00
9108f57780 nvim: Update other plugins 2025-09-12 02:21:14 +02:00
e4d4be54c6 nvim: Update schema-companion and kubernetes matcher 2025-09-12 02:21:14 +02:00
54b1090984 nvim: Switch back to fzf for fuzzy finding
Since I am now using fzf for a bunch of other things as well it made
sense to switch back in smart open as well.
2025-09-12 02:21:14 +02:00
43b0059631 nvim: Update smart-open to fix pause when opening 2025-09-12 02:21:14 +02:00
5c64115e5d tmux: Enable detach-on-destroy for scratch sessions 2025-09-12 02:21:13 +02:00
af1ddc5b3f nvim: Added keybind to cargo run in shell window 2025-09-12 02:21:13 +02:00
c2f57e070c tmux: Added plugin for selecting urls with the keyboard 2025-09-12 02:21:13 +02:00
374825559b tmux: Improve kill keybinds and pervent tmux from closing when there are still sessions 2025-09-12 02:21:13 +02:00
d8cf7121ef sesh: Created preconfigured sessions 2025-09-12 02:21:13 +02:00
1176535475 tmux: Use sesh for tmux session management
The zsh tmux plugin has been removed and instead fzf is shown to select
a session.
2025-09-12 02:21:13 +02:00
25b3a169a2 fzf: Improve border label 2025-09-12 02:21:13 +02:00
254bfd4be2 zsh: Improve how command availability is detected 2025-09-12 02:21:13 +02:00
ba282e656d nvim: Accidentally removed bufresize at some point 2025-09-12 02:21:12 +02:00
e10de143eb zsh: Update Oh-My-Zsh 2025-09-08 12:32:27 +02:00
e22f0c594c zsh: Added completion autosuggest strategy as fallback 2025-09-07 05:58:48 +02:00
b22739cb71 zsh: Add additional completions 2025-09-07 05:37:11 +02:00
a9163907be zsh: Generate text objects for quotes and brackets 2025-09-07 05:29:17 +02:00
59b2334253 readme: Added more tools 2025-09-07 05:26:23 +02:00
17a23eb7e4 zsh: Disable dirhistory plugin as I never used it 2025-09-07 05:26:20 +02:00
9a76b5071e git: Further improvements to git fixup 2025-09-07 05:26:17 +02:00
02d298a163 zsh: Configure fzf
It is now setup to look very similar to telescope.
It now uses fd for finding files.

There is a shell function `pi` to search for packages using fzf and to
then install them with paru
2025-09-07 05:26:13 +02:00
87359588e0 zsh: Added zoxide 2025-09-07 05:26:08 +02:00
98aa0593c9 Added syntax highlighting to shell 2025-09-07 04:23:04 +02:00
f96eb0e234 Turn on update-refs by default 2025-09-05 04:46:20 +02:00
026e3f9fc2 Turn on autosquash and autostash 2025-09-05 04:34:50 +02:00
b15b68fa5d Added useful fixup alias to make ammending old commits easier 2025-09-05 04:34:50 +02:00
c906025f68 Update nvim plugins 2025-09-05 04:34:12 +02:00
c1b73e5822 Added README that lists some useful tools 2025-09-05 04:34:12 +02:00
a60d4a8246 Increase tmux histroy size 2025-09-04 02:34:44 +02:00
d59b067075 Ros patch is now in upstream 2025-06-11 16:23:44 +02:00
4daa29ada3 Added more default installed treesitter parsers and enabled auto install 2025-06-11 14:44:32 +02:00
a041084bef Use prettierd for formatting json instead of jq as it does not support fake json files properly 2025-06-11 14:37:55 +02:00
5b97d37ed3 Install new version of node on legacy ubuntu 2025-06-11 14:37:13 +02:00
35803b0b03 Added comments explaining legacy ubuntu helper scripts a bit more 2025-06-11 14:36:42 +02:00
f7cc6a8c51 Fixup gitconfig inside of devcontainer 2025-06-04 11:38:53 +02:00
5d16b49967 Fixed escape delay 2025-06-04 10:39:07 +02:00
f19466063a Run nvim in devcontainer through bash in order to get the correct env 2025-06-04 10:38:52 +02:00
2f1c1460a6 Added npm to legacy ubuntu nvim 2025-06-04 02:15:56 +02:00
27d2c14665 Create .config folder if it does not exist for legacy ubuntu helper 2025-06-04 02:09:45 +02:00
73d4fbbbfb Added xclip for clipboard support in legacy ubuntu nvim 2025-06-04 01:44:21 +02:00
c146ff0f95 Make nvim pane switching work when inside devcontainer 2025-06-04 01:22:31 +02:00
d755aa90f5 Added keybindings to quickly select tmux window 2025-06-03 23:54:26 +02:00
7be1fa7a21 Added helper script for setting up neovim in legacy ubuntu devcontainer 2025-06-03 22:08:27 +02:00
90fb7736cf Turn down basedpyright strictness 2025-06-03 21:57:55 +02:00
0458cb0825 Only enable rust_analyer if it is installed 2025-06-03 21:56:19 +02:00
da7c214afe Fixed tmux stow ignore 2025-06-03 16:06:28 +02:00
ffeb4d6f45 Only install goimports if go is available 2025-06-03 15:47:18 +02:00
8026ec51d9 Fixed ALTEN gitconfig 2025-06-03 15:23:01 +02:00
b11e2ec42c Improved default less behavior 2025-06-03 13:44:03 +02:00
8d676a1e5e Specify neotree branch correctly 2025-06-03 13:43:59 +02:00
535ad35ded Added actions preview plugin 2025-06-03 13:43:57 +02:00
b4dfc6cfc0 Use delta for git diffs 2025-06-03 13:43:54 +02:00
3e786561ab Slight git config reorganization 2025-06-03 13:43:43 +02:00
c33133f7c9 Alias cat to bat if installed and use gruvbox theme 2025-06-03 02:55:16 +02:00
bcce589cc1 Adjusted font size 2025-06-02 15:23:05 +02:00
dccea7b3fd Disable todo comments signs 2025-06-02 03:16:20 +02:00
6ee3f0e346 Switch to smart open 2025-06-02 03:05:30 +02:00
322fc37df0 Switch from fzf to fzy 2025-06-02 03:04:21 +02:00
b6c9f2db01 Added eyeline 2025-06-02 02:34:18 +02:00
c8d442912f Use opts properly for gruvbox 2025-06-02 02:31:16 +02:00
b696b9addd Fixed mason tool installer startup 2025-06-01 21:50:07 +02:00
55e28be32c Handle big files better 2025-06-01 21:46:51 +02:00
320d742b41 Telescope plugins should be loaded _after_ telescope 2025-06-01 21:46:48 +02:00
5c946599bc Fixed mason-lspconfig load event 2025-06-01 20:32:24 +02:00
0505c877fe Use indent from snacks 2025-06-01 20:32:20 +02:00
6c5e5bb8c0 Inform lsp of neotree file rename 2025-06-01 19:43:50 +02:00
707010aadc Use bufdel from snacks 2025-06-01 19:43:28 +02:00
3be9780454 Added snacks.nvim 2025-06-01 19:42:41 +02:00
2bbf10c370 Added scroll eof plugin 2025-06-01 14:45:26 +02:00
39f538418b Remove symbol outline plugin 2025-05-31 05:12:20 +02:00
01cca08739 Update lazy lock 2025-05-31 05:09:48 +02:00
633df0af60 Tell blink we are using normal nerd font not mono 2025-05-31 05:09:40 +02:00
525e9099e4 Cleanup in blink config 2025-05-31 05:09:16 +02:00
1c42119291 Disable ros commands as they won't work outside the devcontainer 2025-05-31 05:07:36 +02:00
7723d66cbf Improve startup speed by properly lazy loading 2025-05-31 05:06:46 +02:00
649653ef8c Use builtin yamlls schemastore 2025-05-31 03:03:48 +02:00
18f15c5ab3 Switch back to main repo for todo comments 2025-05-31 03:03:48 +02:00
5c774bbdfb Cursor sticks to character during surround operations 2025-05-31 03:03:47 +02:00
e61c059de6 Proper lazy load fix for colorizer 2025-05-31 03:03:47 +02:00
82f6744c2f Setup treesitter folds in treesitter plugin init 2025-05-31 03:03:47 +02:00
2e4796d7a7 Moved LSP configs to new lsp/ folder, moved lsp config to seperate fiel, and simplified mason tool installer config 2025-05-31 03:03:47 +02:00
6c49b81f5a Add lua type annotation and make sure to use opts where possible 2025-05-31 03:03:43 +02:00
d2a4babb2e Remove unused whitespace plugin 2025-05-31 00:21:17 +02:00
a2335bfd1b Exit snippet when leaving insert mode 2025-05-30 21:28:30 +02:00
3efe02f0ab Disable change detection notification 2025-05-30 17:55:11 +02:00
651f32bdaf Update lazy lock 2025-05-30 17:46:57 +02:00
900e844835 More random cleanup 2025-05-30 17:46:57 +02:00
f8ad93746b Split mason configs 2025-05-30 17:46:54 +02:00
644edc8b2e Use schemastore plugin for yamlls 2025-05-30 17:38:17 +02:00
3f9ec6a29f Switch from yaml-companion to schema-companion 2025-05-30 05:59:01 +02:00
7d71427f28 Auto run geuss indent 2025-05-29 22:08:57 +02:00
a96448db09 Stay in insert mode when snippet is active 2025-05-29 22:08:57 +02:00
244c1929a3 Adjusted git keymaps to be easier to use 2025-05-29 22:08:53 +02:00
3291fb8111 Adjusted lsp based keymaps 2025-05-29 21:45:11 +02:00
9d72215ac6 Small gitsigns cleanup and made sure that git blame shows before everything else 2025-05-29 20:17:35 +02:00
e6a7dd6af5 Change how luvit is loaded in lazydev 2025-05-29 20:16:23 +02:00
dedbe6f2c8 Adjusted incremental selection keybinds 2025-05-29 20:15:34 +02:00
a5695d1e32 Adjusted git sign styling 2025-05-28 21:23:25 +02:00
703c0bb087 Highlight linenumber for diagnostics instead of using signs, switched to non-mono font to allow for larger icons 2025-05-28 21:14:01 +02:00
0c074e2aec Use treesitter to set folds 2025-05-28 19:23:06 +02:00
92f62551d9 Switched to different auto pair plugin 2025-05-28 19:07:37 +02:00
a11d93f6f4 Update ohmyzsh and zsh-autosuggestions 2025-05-28 19:07:37 +02:00
30d26ce769 Added zsh autopair plugin 2025-05-28 19:07:37 +02:00
637c15299b Removed old resize keymap 2025-05-28 19:07:02 +02:00
66d933cbb3 Adjusted diagnostic config 2025-05-28 17:58:57 +02:00
1ff53112ae Added ros plugin 2025-05-27 17:21:20 +02:00
38561b7dcc Fixed treesitter tag autoclose (#3) 2025-05-27 16:50:57 +02:00
7e46d955c7 Downgrade treesitter as the new version was causing issues (#1, #3, #4) 2025-05-27 16:50:52 +02:00
89 changed files with 1579 additions and 986 deletions

9
.gitmodules vendored
View File

@@ -7,3 +7,12 @@
[submodule "tmux/tpm"]
path = tmux/tpm
url = https://github.com/tmux-plugins/tpm
[submodule "zsh/custom/plugins/zsh-autopair"]
path = zsh/custom/plugins/zsh-autopair
url = https://github.com/hlissner/zsh-autopair
[submodule "zsh/custom/plugins/fast-syntax-highlighting"]
path = zsh/custom/plugins/fast-syntax-highlighting
url = https://github.com/zdharma-continuum/fast-syntax-highlighting.git
[submodule "zsh/custom/plugins/zsh-completions"]
path = zsh/custom/plugins/zsh-completions
url = https://github.com/zsh-users/zsh-completions.git

20
README.md Normal file
View File

@@ -0,0 +1,20 @@
## Tools
### Core tools
```
bat
fd
fzf
git-delta
paru
rg
zoxide
```
### Useful
```
jq
git-cliff
```

View File

@@ -3,10 +3,10 @@
TERM = "xterm-256color"
[font]
size = 9.8
size = 10
[font.normal]
family = "Hack Nerd Font Mono"
family = "Hack Nerd Font"
[window]
decorations = "none"

View File

@@ -1,3 +1,4 @@
[include]
path = ~/.dotfiles/git/profiles/common
path = ~/.dotfiles/git/profiles/ALTEN
path = ~/.dotfiles/git/configs/common.gitconfig
path = ~/.dotfiles/git/profiles/ALTEN.gitconfig

1
git-alten/dot-local Symbolic link
View File

@@ -0,0 +1 @@
../git/dot-local

View File

@@ -1,2 +1,3 @@
gitignore
profiles
configs

View File

@@ -1,3 +1,7 @@
[include]
path = ~/.dotfiles/git/configs/lfs.gitconfig
path = ~/.dotfiles/git/configs/delta.gitconfig
[push]
default = simple
@@ -20,4 +24,9 @@
tool = nvimdiff
[init]
defaultBranch = master
defaultBranch = main
[rebase]
autosquash = true
autostash = true
updateRefs = true

View File

@@ -0,0 +1,54 @@
[delta "gruvmax-fang"]
# author: https://github.com/maxfangx
# Modified by: Dreaded_X
# General appearance
dark = true
syntax-theme = gruvbox-dark
# File
file-style = "#FFFFFF" bold
file-added-label = [+]
file-copied-label = [==]
file-modified-label = [*]
file-removed-label = [-]
file-renamed-label = [->]
file-decoration-style = "#434C5E" ul
file-decoration-style = "#84786A" ul
# No hunk headers
hunk-header-style = omit
# Line numbers
line-numbers = true
line-numbers-left-style = "#84786A"
line-numbers-right-style = "#84786A"
line-numbers-minus-style = "#A02A11"
line-numbers-plus-style = "#479B36"
line-numbers-zero-style = "#84786A"
line-numbers-left-format = " {nm:>3} │"
line-numbers-right-format = " {np:>3} │"
# Diff contents
inline-hint-style = syntax
minus-non-emph-style = syntax auto
plus-non-emph-style = syntax auto
whitespace-error-style = "#FB4934" reverse
# Blame
blame-code-style = syntax
# Merge conflicts
merge-conflict-begin-symbol = ⌃
merge-conflict-end-symbol = ⌄
merge-conflict-ours-diff-header-style = "#FABD2F" bold
merge-conflict-theirs-diff-header-style = "#FABD2F" bold overline
merge-conflict-ours-diff-header-decoration-style = ''
merge-conflict-theirs-diff-header-decoration-style = ''
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
features = gruvmax-fang
navigate = true
side-by-side = true
[merge]
conflictstyle = zdiff3

View File

@@ -0,0 +1,5 @@
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f

View File

@@ -1,11 +1,7 @@
[include]
path = ~/.dotfiles/git/profiles/common
path = ~/.dotfiles/git/profiles/Dreaded_X
path = ~/.dotfiles/git/configs/common.gitconfig
path = ~/.dotfiles/git/profiles/Dreaded_X.gitconfig
[includeIf "gitdir:~/Projects/ALTEN/"]
path = ~/.dotfiles/git/profiles/ALTEN
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
path = ~/.dotfiles/git/profiles/ALTEN.gitconfig

19
git/dot-local/bin/git-fixup Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
TARGET=$1
if [ -z "$TARGET" ]; then
if hash fzf 2>/dev/null; then
TARGET=$(git log -n 50 --pretty=format:'%h %s' --no-merges | fzf --border-label=' Select commit ' | cut -c -7 )
else
echo "Not installed: fzf"
exit -1
fi
fi
if [ -z "$TARGET" ]; then
echo "No target specified"
exit -1
fi
git commit --fixup=$TARGET ${@:2} && GIT_SEQUENCE_EDITOR=true git rebase -i --autostash --autosquash $TARGET^

24
helpers/legacy_ubuntu_nvim.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
set -e
# Install additional dependencies
sudo apt-get install fuse libfuse2 unzip ripgrep python3-venv xclip -y --no-install-recommends
# Install new version of node
curl -fsSL https://deb.nodesource.com/setup_23.x -o /tmp/nodesource_setup.sh
sudo -E bash /tmp/nodesource_setup.sh
sudo apt-get install -y nodejs
# Install new version of neovim
sudo rm -rf /usr/local/bin/nvim
sudo wget https://github.com/neovim/neovim-releases/releases/download/v0.11.1/nvim-linux-x86_64.appimage -O /usr/local/bin/nvim
sudo chmod +x /usr/local/bin/nvim
# Get latest version of dotfiles
rm -rf ~/.dotfiles
git clone https://git.huizinga.dev/Dreaded_X/dotfiles ~/.dotfiles
mkdir -p ~/.config
ln -s ~/.dotfiles/nvim/dot-config/nvim ~/.config/nvim
# Remove include paths from copied host gitconfig
sed -i '/path = /d' ~/.gitconfig

View File

@@ -1,8 +1,3 @@
-- Basic vim config stuff
require("keymaps")
require("options")
require("autocmds")
-- Install lazy package manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
@@ -17,6 +12,13 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
-- Setup
require("keymaps")
require("options")
require("autocmds")
require("lsp")
-- Configure plugins
require("lazy").setup({
{ import = "themes" },
{ import = "plugins" },
@@ -26,6 +28,9 @@ require("lazy").setup({
"gruvbox",
},
},
change_detection = {
notify = false,
},
rocks = {
enabled = false,
},
@@ -34,24 +39,3 @@ require("lazy").setup({
backdrop = 100,
},
})
local lsp = require("tools.lsp")
for _, tool in pairs(lsp) do
if type(tool) == "table" then
local name = tool[1]
-- Apply additional config if specified
local config = tool[2]
if config ~= nil then
vim.lsp.config(name, config)
end
-- System LSP are not managed by mason and need to be enabled manually
if
(type(tool.system) == "boolean" and tool.system and vim.fn.executable(name) > 0)
or (type(tool.system) == "string" and vim.fn.executable(tool.system) > 0)
then
vim.lsp.enable(name)
end
end
end

View File

@@ -1,47 +1,51 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" },
"actions-preview.nvim": { "branch": "master", "commit": "36513ad213855d497b7dd3391a24d1d75d58e36f" },
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
"conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
"crates.nvim": { "branch": "main", "commit": "afcd1cc3eeceb5783676fc8464389b9216a29d05" },
"eyeliner.nvim": { "branch": "main", "commit": "8f197eb30cecdf4c2cc9988a5eecc6bc34c0c7d6" },
"fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "8b729e489f1475615dc6c9737da917b3bc163605" },
"gruvbox.nvim": { "branch": "main", "commit": "00e38a379bab3389e187b3953566d67d494dfddd" },
"gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
"inc-rename.nvim": { "branch": "main", "commit": "2eaff20526ff6101337b84f4b0d238c11f47d7f4" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"kubernetes.nvim": { "branch": "main", "commit": "1a08abc6c0694f0d1f5d6725bfa7a88daf0f7246" },
"inc-rename.nvim": { "branch": "main", "commit": "8ae25b35ae16ca4bd5de3d3c472eec3b574018d4" },
"kubernetes.nvim": { "branch": "main", "commit": "44daf998345628a1a7034e3aaa31f4e05e4dde7c" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" },
"luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" },
"mason-conform.nvim": { "branch": "main", "commit": "f3b96fa2217fcb1513301eefbe10ea0e765e33eb" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "d24b3f1612e53f9d54d866b16bedab51813f2bf1" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "75d60a8f928decd8b38897f80849768b7c540a5b" },
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
"neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
"nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" },
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
"nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" },
"nvim-colorizer.lua": { "branch": "master", "commit": "517df88cf2afb36652830df2c655df2da416a0ae" },
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "7f9a39fcd2ac6e979001f857727d606888f5909c" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "f1deac7ecec88c28a250d890ba7bb35843e69cbd" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-colorizer.lua": { "branch": "master", "commit": "51cf7c995ed1eb6642aecf19067ee634fa1b6ba2" },
"nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-lspconfig": { "branch": "master", "commit": "3ea99227e316c5028f57a4d86a1a7fd01dd876d0" },
"nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" },
"nvim-treesitter": { "branch": "main", "commit": "c1dfc39285e4a11983dfbe556fb0be7f2a749977" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "fa32a45fdbab9c9c3bda9ecec9b12dddb221b927" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" },
"nvim-surround": { "branch": "main", "commit": "a868c256c861044beb9794b4dd126480dcdfbdad" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"schemastore.nvim": { "branch": "main", "commit": "0098dde21296a454ae1426f9ac47340dd38c27ce" },
"smart-splits.nvim": { "branch": "master", "commit": "5ef94ca23b28148187846fc46f10184aad4d17b0" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"ros-nvim": { "branch": "main", "commit": "1ad64cd3a1e144dfea67890845f9da2e82d96900" },
"schema-companion.nvim": { "branch": "main", "commit": "e94f5f8439705d772363817c9d2c6c9fc7562bd0" },
"schemastore.nvim": { "branch": "main", "commit": "d522e3ed6ed2c7bed7ebe1e42615e79b3aabfe65" },
"scrollEOF.nvim": { "branch": "master", "commit": "aeedfad14e4a0cfa31b44b531c1ad8fd4696b551" },
"smart-open.nvim": { "branch": "0.3.x", "commit": "e7f27218bd43de5262d3e8e3e84a135737ca6942" },
"smart-splits.nvim": { "branch": "master", "commit": "51e400b0bb6cbfd48e56d1baca250f34028cf1d3" },
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
"sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"todo-comments.nvim": { "branch": "main", "commit": "f8bd47e4bc15e3aa7c784b12e68b6dd6e97caea2" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
"yaml-companion.nvim": { "branch": "main", "commit": "131b0d67bd2e0f1a02e0daf2f3460482221ce3c0" }
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "74163ac321c7d208a5bb9cdf8964114c7064d6c7" },
"undotree": { "branch": "master", "commit": "fe9a9d0645f0f5532360b5e5f5c550d7bb4f1869" },
"which-key.nvim": { "branch": "winborder-support", "commit": "ab1a3b0d3005a95507ba6c18b96531d430370885" }
}

View File

@@ -0,0 +1,9 @@
return {
settings = {
basedpyright = {
analysis = {
typeCheckingMode = "standard",
},
},
},
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "clangd", "--offset-encoding=utf-16", "--clang-tidy" },
}

View File

@@ -0,0 +1,16 @@
return require("schema-companion").setup_client(
require("schema-companion").adapters.jsonls.setup({
sources = {
require("schema-companion").sources.lsp.setup(),
require("schema-companion").sources.none.setup(),
},
}),
{
settings = {
json = {
validate = { enable = true },
schemas = require("schemastore").json.schemas(),
},
},
}
)

View File

@@ -0,0 +1,23 @@
return {
settings = {
Lua = {
workspace = {
checkThirdParty = false,
library = {
"./definitions",
},
},
telemetry = { enable = false },
type = {
checkTableShape = true,
},
diagnostics = {
neededFileStatus = {
-- ["no-unknown"] = "Opened",
-- ["incomplete-signature-doc"] = "Opened",
-- ["await-in-sync"] = "Opened",
},
},
},
},
}

View File

@@ -0,0 +1,9 @@
return {
settings = {
["rust-analyzer"] = {
check = {
command = "clippy",
},
},
},
}

View File

@@ -0,0 +1,9 @@
return require("schema-companion").setup_client(
require("schema-companion").adapters.taplo.setup({
sources = {
require("schema-companion").sources.lsp.setup(),
require("schema-companion").sources.none.setup(),
},
}),
{}
)

View File

@@ -0,0 +1,5 @@
return {
init_options = {
diagnosticSeverity = "Hint",
},
}

View File

@@ -0,0 +1,10 @@
return require("schema-companion").setup_client(
require("schema-companion").adapters.yamlls.setup({
sources = {
require("matchers.kubernetes").setup({}),
require("schema-companion").sources.lsp.setup(),
require("schema-companion").sources.none.setup(),
},
}),
{}
)

View File

@@ -1,5 +1,3 @@
local window = require("symbols.window")
-- Highlight on yank
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
@@ -26,136 +24,3 @@ vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
end
end,
})
-- Setup lsp keybindings
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(event)
-- Symbols
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Goto definition" })
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "Goto declaration" })
vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, { desc = "Type definition" })
if pcall(require, "telescope") then
vim.keymap.set("n", "gr", require("telescope.builtin").lsp_references, { desc = "Goto references" })
vim.keymap.set(
"n",
"gI",
require("telescope.builtin").lsp_implementations,
{ desc = "Goto implementation" }
)
vim.keymap.set(
"n",
"<leader>ds",
require("telescope.builtin").lsp_document_symbols,
{ desc = "Document symbols" }
)
vim.keymap.set(
"n",
"<leader>ws",
require("telescope.builtin").lsp_dynamic_workspace_symbols,
{ desc = "Workspace symbols" }
)
end
-- Diagnostics
vim.keymap.set("n", "[d", function()
vim.diagnostic.jump({ count = -1 })
end, { desc = "Go to previous diagnostic message" })
vim.keymap.set("n", "]d", function()
vim.diagnostic.jump({ count = 1 })
end, { desc = "Go to next diagnostic message" })
-- vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
vim.keymap.set("n", "<leader>e", function()
if vim.diagnostic.config().virtual_lines then
vim.diagnostic.config({ virtual_lines = false })
else
vim.diagnostic.config({
virtual_lines = {
current_line = true,
format = vim.diagnostic.config().virtual_text.format,
},
})
end
end, { desc = "Show virtual diagnostic line" })
-- Helpers
vim.keymap.set("n", "<leader>rn", function()
return ":IncRename " .. vim.fn.expand("<cword>")
end, { buffer = event.buf, expr = true, desc = "Rename" })
vim.keymap.set(
"n",
"<leader>ca",
vim.lsp.buf.code_action,
{ buffer = event.buf, desc = "Code actions", remap = true }
)
-- Documentation
-- vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, { desc = "Signature Documentation" })
end,
})
-- Setup cursor hover symbol highlight
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(event)
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
local lsp_hover_hl = vim.api.nvim_create_augroup("LspHoverHighlight", { clear = false })
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
buffer = event.buf,
group = lsp_hover_hl,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
buffer = event.buf,
group = lsp_hover_hl,
callback = vim.lsp.buf.clear_references,
})
vim.api.nvim_create_autocmd("LspDetach", {
group = vim.api.nvim_create_augroup("LspHoverHighlightDetach", { clear = true }),
callback = function(event2)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds({ group = lsp_hover_hl, buffer = event2.buf })
end,
})
end
end,
})
-- Disable lsp based syntax highlighting
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(event)
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client.server_capabilities.semanticTokensProvider then
client.server_capabilities.semanticTokensProvider = nil
end
end,
})
--
vim.api.nvim_create_autocmd("CursorMoved", {
callback = function()
vim.diagnostic.config({ virtual_lines = false })
end,
})
-- Auto install treesitter parser and start them
vim.api.nvim_create_autocmd("FileType", {
desc = "Enable Treesitter",
group = vim.api.nvim_create_augroup("enable_treesitter", {}),
callback = function(event)
local has_treesitter, treesitter = pcall(require, "nvim-treesitter")
if has_treesitter then
local language = vim.treesitter.language.get_lang(event.match)
treesitter.install(language):await(function()
if pcall(vim.treesitter.start) then
-- Use Treesitter indentation and folds.
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
end
end)
end
end,
})

View File

@@ -7,12 +7,6 @@ vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { noremap = true, silent = true
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
-- Keybinds for resizing windows
vim.keymap.set("n", "<S-Up>", "<cmd>resize +2<CR>")
vim.keymap.set("n", "<S-Down>", "<cmd>resize -2<CR>")
vim.keymap.set("n", "<S-Left>", "<cmd>vertical resize -2<CR>")
vim.keymap.set("n", "<S-Right>", "<cmd>vertical resize +2<CR>")
-- Some nice adjustments
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
@@ -21,3 +15,16 @@ vim.keymap.set("n", "N", "Nzz")
-- Clear search highlight by pressing esc
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
vim.api.nvim_create_autocmd("FileType", {
pattern = { "rust" },
callback = function(args)
local command = {
rust = "cargo run",
}
vim.keymap.set("n", "<F5>", function()
vim.system({ "tmux", "send-keys", "-t", ":shell", "c-u", command[args.match], "Enter" })
vim.system({ "tmux", "select-window", "-t", ":shell" })
end, { buffer = true })
end,
})

View File

@@ -0,0 +1,157 @@
local diagnostic = require("symbols.diagnostic")
local methods = vim.lsp.protocol.Methods
local map = function(keys, func, desc, mode, bufnr)
mode = mode or "n"
vim.keymap.set(mode, keys, func, { desc = desc, buffer = bufnr })
end
-- General keymaps
map("[d", function()
vim.diagnostic.jump({ count = -1 })
end, "Go to previous diagnostic message")
map("]d", function()
vim.diagnostic.jump({ count = 1 })
end, "Go to next diagnostic message")
map("[e", function()
vim.diagnostic.jump({ count = -1, severity = vim.diagnostic.severity.ERROR })
end, "Go to previous error message")
map("]e", function()
vim.diagnostic.jump({ count = 1, severity = vim.diagnostic.severity.ERROR })
end, "Go to next error message")
map("<leader>e", vim.diagnostic.open_float, "Open floating diagnostic message")
map("<leader>th", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, "Toggle inlay hints")
map("gra", function()
require("actions-preview").code_actions()
end, "Code actions", { "n", "x" })
map("grD", vim.lsp.buf.declaration, "Goto declaration")
map("grd", function()
require("telescope.builtin").lsp_definitions({ jump_type = "never" })
end, "Goto definition")
map("grt", function()
require("telescope.builtin").lsp_type_definitions()
end, "Type definition")
map("grr", function()
require("telescope.builtin").lsp_references()
end, "Goto references")
map("gri", function()
require("telescope.builtin").lsp_implementations()
end, "Goto implementation")
map("<leader>ss", function()
require("telescope.builtin").lsp_document_symbols()
end, "Document symbols")
map("<leader>sS", function()
require("telescope.builtin").lsp_dynamic_workspace_symbols()
end, "Workspace symbols")
-- Provide a placeholder rename keymap, otherwise the rename appears to works until you hit enter at which point it will fail
map("grn", function()
vim.api.nvim_echo({ { "Rename are not available in current buffer" } }, true, { err = true })
end, "Rename")
---@param client vim.lsp.Client
---@param bufnr integer
local function on_attach(client, bufnr)
-- Setup actual rename keymap if it is available
if client:supports_method(methods.textDocument_rename, bufnr) then
vim.keymap.set("n", "grn", function()
return ":IncRename " .. vim.fn.expand("<cword>")
end, { buffer = bufnr, expr = true, desc = "Rename" })
end
-- Disable lsp based syntax highlighting, I don't like it
-- TODO: Switch to this once it is available
-- vim.lsp.document_color.enable(false, bufnr)
if client.server_capabilities.semanticTokensProvider then
client.server_capabilities.semanticTokensProvider = nil
end
-- Highlight references under cursor
if client:supports_method(methods.textDocument_documentHighlight) then
local lsp_hover_hl = vim.api.nvim_create_augroup("LspHoverHighlight", { clear = false })
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
buffer = bufnr,
group = lsp_hover_hl,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
buffer = bufnr,
group = lsp_hover_hl,
callback = vim.lsp.buf.clear_references,
})
end
end
vim.diagnostic.config({
severity_sort = true,
signs = {
numhl = {
[vim.diagnostic.severity.ERROR] = "DiagnosticNumError",
[vim.diagnostic.severity.WARN] = "DiagnosticNumWarn",
[vim.diagnostic.severity.HINT] = "DiagnosticNumHint",
[vim.diagnostic.severity.INFO] = "DiagnosticNumInfo",
},
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.HINT] = "",
[vim.diagnostic.severity.INFO] = "",
},
},
float = {
severity_sort = false,
header = "",
suffix = function(d)
local code = d.code and string.format(" (%s)", d.code) or ""
return string.format("%s [%s]", code, d.source), "NormalFloat"
end,
},
virtual_text = {
prefix = function(d)
return diagnostic[d.severity]
end,
virt_text_pos = "eol_right_align",
},
})
local register_capability = vim.lsp.handlers[methods.client_registerCapability]
vim.lsp.handlers[methods.client_registerCapability] = function(err, res, ctx)
local client = vim.lsp.get_client_by_id(ctx.client_id)
if not client then
return
end
on_attach(client, vim.api.nvim_get_current_buf())
return register_capability(err, res, ctx)
end
vim.api.nvim_create_autocmd("LspAttach", {
desc = "Configure LSP keymaps",
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if not client then
return
end
on_attach(client, args.buf)
end,
})
-- Manually enable lsps, if installed
if vim.fn.executable("rust_analyzer") then
vim.lsp.enable("rust_analyzer")
end
if vim.fn.executable("vtsls") then
vim.lsp.enable("vtsls")
end

View File

@@ -0,0 +1,57 @@
---@class schema_companion.Source
local M = {}
M.name = "Kubernetes"
M.config = {}
---@param config {}
---@return schema_companion.Source
function M.setup(config)
setmetatable(M, {})
M.config = vim.tbl_deep_extend("force", {}, M.config, config)
return M
end
function M:match(_, bufnr)
local resources = {}
local current = {}
for _, line in pairs(vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)) do
local _, _, group, version = line:find([[^apiVersion:%s*["']?([^%s"'/]*)/?([^%s"']*)]])
local _, _, kind = line:find([[^kind:%s*["']?([^%s"'/]*)]])
if group and group ~= "" then
current.group = group
end
if version and version ~= "" then
current.version = version
end
if kind and kind ~= "" then
current.kind = kind
end
if current.group and current.kind then
table.insert(resources, current)
current = {}
end
end
local schemas = {}
for _, resource in pairs(resources) do
local api = resource.version and ("%s/%s"):format(resource.group, resource.version) or resource.group
local schema = {
name = ("%s@%s"):format(resource.kind, api),
source = M.name,
uri = require("kubernetes").yamlls_schema(),
}
if schema then
table.insert(schemas, schema)
end
end
return schemas
end
return M

View File

@@ -1,4 +1,3 @@
local diagnostic = require("symbols.diagnostic")
local window = require("symbols.window")
-- Set highlight on search
@@ -70,22 +69,3 @@ vim.o.foldlevelstart = 99
-- Windows borders
vim.o.winborder = window.border
-- LSP config
vim.diagnostic.config({
severity_sort = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = diagnostic.error,
[vim.diagnostic.severity.WARN] = diagnostic.warn,
[vim.diagnostic.severity.HINT] = diagnostic.hint,
[vim.diagnostic.severity.INFO] = diagnostic.info,
},
},
virtual_text = {
virt_text_pos = "eol_right_align",
format = function(d)
return ("%s [%s]"):format(d.message, d.source)
end,
},
})

View File

@@ -0,0 +1,28 @@
-- https://github.com/aznhe21/actions-preview.nvim
--- @module "lazy"
--- @type LazySpec
return {
"aznhe21/actions-preview.nvim",
opts = function()
local hl = require("actions-preview.highlight")
return {
backend = { "telescope" },
highlight_command = {
hl.delta(),
},
telescope = {
sorting_strategy = "ascending",
layout_strategy = "vertical",
layout_config = {
width = 0.8,
height = 0.9,
prompt_position = "top",
preview_cutoff = 20,
preview_height = function(_, _, max_lines)
return max_lines - 15
end,
},
},
}
end,
}

View File

@@ -1,6 +1,31 @@
-- https://github.com/windwp/nvim-autopairs
-- https://github.com/altermo/ultimate-autopair.nvim
--- @module "lazy"
--- @type LazySpec
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
"altermo/ultimate-autopair.nvim",
event = { "InsertEnter", "CmdlineEnter" },
branch = "v0.6",
--- @module "ultimate-autopair"
--- @type prof.def.conf
opts = {
fastwarp = {
faster = true,
},
-- Fix single quotes in rust
config_internal_pairs = {
{
"'",
"'",
multiline = false,
nft = {},
suround = true,
cond = function(fn)
if fn.get_ft() ~= "rust" then
return true
end
return not fn.in_node({ "bounded_type", "reference_type", "type_arguments", "type_parameters" })
end,
},
},
},
}

View File

@@ -1,20 +1,19 @@
-- https://github.com/saghen/blink.cmp
--- @module "lazy"
--- @type LazySpec
return {
"saghen/blink.cmp",
-- optional: provides snippets for the snippet source
dependencies = { "rafamadriz/friendly-snippets" },
event = "InsertEnter",
-- use a release tag to download pre-built binaries
version = "1.*",
---@module 'blink.cmp'
---@type blink.cmp.Config
--- @module "blink-cmp"
--- @type blink.cmp.Config
opts = {
-- See :h blink-cmp-config-keymap for defining your own keymap
-- keymap = { preset = "default" },
keymap = {
preset = "default",
-- ["<C-u>"] = {function(cmp) cmp.scroll_documentation_up(4) end},
-- ["<C-d>"] = {function(cmp) cmp.scroll_documentation_down(4) end},
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
["<C-u>"] = { "scroll_documentation_up" },
["<C-d>"] = { "scroll_documentation_down" },
@@ -24,9 +23,11 @@ return {
function(cmp)
if cmp.is_visible() then
cmp.cancel()
if cmp.get_selected_item_idx() ~= nil then
if cmp.get_selected_item_idx() ~= nil or cmp.snippet_active() then
return true
end
elseif cmp.snippet_active() then
vim.snippet.stop()
end
end,
"fallback",
@@ -39,17 +40,13 @@ return {
["<C-p>"] = { "select_prev", "fallback_to_mappings" },
["<C-n>"] = { "select_next", "fallback_to_mappings" },
-- TODO: Does not appear to work?
["<C-k>"] = { "show_signature", "hide_signature", "fallback" },
},
appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- Adjusts spacing to ensure icons are aligned
nerd_font_variant = "mono",
nerd_font_variant = "normal",
},
-- (Default) Only show the documentation popup when manually triggered
completion = {
ghost_text = {
enabled = true,
@@ -57,9 +54,6 @@ return {
list = {
selection = {
preselect = false,
-- preselect = function(ctx)
-- return vim.bo.filetype ~= "markdown"
-- end,
},
},
documentation = {
@@ -94,8 +88,6 @@ return {
},
},
-- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
default = {
"lazydev",
@@ -108,17 +100,15 @@ return {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
-- make lazydev completions top priority (see `:h blink.cmp`)
score_offset = 100,
},
},
},
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
--
-- See the fuzzy documentation for more information
cmdline = {
enabled = false,
},
fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },

View File

@@ -1,23 +0,0 @@
-- https://github.com/ojroques/nvim-bufdel
return {
"ojroques/nvim-bufdel",
cmd = { "BufDel", "BuffDelOthers" },
keys = {
{
"<leader>bd",
function()
require("bufdel").delete_buffer_expr(nil, false)
end,
silent = true,
desc = "Buffer delete",
},
{
"<leader>bD",
function()
require("bufdel").delete_buffer_others(false)
end,
silent = true,
desc = "Buffer delete others",
},
},
}

View File

@@ -2,60 +2,53 @@
local diagnostic = require("symbols.diagnostic")
local file = require("symbols.file")
--- @module "lazy"
--- @type LazySpec
return {
"akinsho/bufferline.nvim",
dependencies = {
"ojroques/nvim-bufdel",
--- @module "bufferline"
--- @type bufferline.UserConfig
opts = {
options = {
show_buffer_icons = false,
show_buffer_close_icons = false,
diagnostics = "nvim_lsp",
separator_style = "thick",
left_trunc_marker = "",
right_trunc_marker = "",
sort_by = "insert_at_end",
indicator = {
style = "none",
},
modified_icon = file.modified,
---@diagnostic disable-next-line: unused-local
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local s = " "
for e, n in pairs(diagnostics_dict) do
local sym = e == "error" and diagnostic.error .. " "
or (e == "warning" and diagnostic.warn .. " ")
or (e == "info" and diagnostic.info .. " " or diagnostic.hint .. " ")
s = s .. n .. sym
end
return s
end,
},
},
config = function()
-- Enable mousemoveevent if possible
vim.o.mousemoveevent = true
local bufferline = require("bufferline")
init = function()
-- Setup keybinds to move between buffers
vim.keymap.set("n", "<tab>", function()
bufferline.cycle(1)
require("bufferline").cycle(1)
end, { silent = true, desc = "Goto next buffer" })
vim.keymap.set("n", "<S-tab>", function()
bufferline.cycle(-1)
require("bufferline").cycle(-1)
end, { silent = true, desc = "Goto previous buffer" })
-- Setup keybinds to move buffers around
vim.keymap.set("n", "<leader>b[", function()
bufferline.move(-1)
require("bufferline").move(-1)
end, { silent = true, desc = "Move buffer to left" })
vim.keymap.set("n", "<leader>b]", function()
bufferline.move(1)
require("bufferline").move(1)
end, { silent = true, desc = "Move buffer to right" })
bufferline.setup({
options = {
show_buffer_icons = false,
show_buffer_close_icons = false,
diagnostics = "nvim_lsp",
-- close_command = "BufDel %d",
-- right_mouse_command = "BufDel %d",
separator_style = "thick",
left_trunc_marker = "",
right_trunc_marker = "",
sort_by = "insert_at_end",
indicator = {
style = "none",
},
modified_icon = file.modified,
---@diagnostic disable-next-line: unused-local
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local s = " "
for e, n in pairs(diagnostics_dict) do
local sym = e == "error" and diagnostic.error .. " "
or (e == "warning" and diagnostic.warn .. " ")
or (e == "info" and diagnostic.info .. " " or diagnostic.hint .. " ")
s = s .. n .. sym
end
return s
end,
},
})
end,
}

View File

@@ -1,4 +1,6 @@
-- https://github.com/kwkarlwang/bufresize.nvim
--- @module "lazy"
--- @type LazySpec
return {
"kwkarlwang/bufresize.nvim",
opts = {},

View File

@@ -1,8 +1,10 @@
-- https://github.com/NvChad/nvim-colorizer.lua
--- @module "lazy"
--- @type LazySpec
return {
"NvChad/nvim-colorizer.lua",
event = "VeryLazy",
opts = {
lazy_load = true,
filetypes = {
"*", -- Enable color highlighting for all files
"!neo-tree", -- Exclude neo-tree
@@ -17,16 +19,4 @@ return {
names = false,
},
},
-- Fix lazy loading: https://github.com/NvChad/nvim-colorizer.lua
config = function(_, opts)
local colorizer = require("colorizer")
colorizer.setup(opts)
-- nvim-colorizer doesn't work on the initial buffer if we lazy load, so force it to attach
-- on load.
local bufnr = vim.api.nvim_get_current_buf()
if bufnr and not colorizer.is_buffer_attached(bufnr) then
colorizer.attach_to_buffer(bufnr)
end
end,
}

View File

@@ -1,6 +1,17 @@
-- https://github.com/numToStr/Comment.nvim
--- @module "lazy"
--- @type LazySpec
return {
'numToStr/Comment.nvim',
"numToStr/Comment.nvim",
event = "VeryLazy",
opts = {},
--- @module "Comment"
--- @type CommentConfig
opts = {
toggler = {
block = "gBc",
},
opleader = {
block = "gB",
},
},
}

View File

@@ -1,5 +1,26 @@
-- https://github.com/stevearc/conform.nvim
local slow_format_filetypes = {}
local formatters_by_ft = {
c = { "clang-format" },
cpp = { "clang-format" },
go = { "goimports" },
python = { "ruff_organize_imports", "ruff_format" },
rust = { "rustfmt" },
javascript = { "prettier" },
javascriptreact = { "prettier" },
typescript = { "prettier" },
typescriptreact = { "prettier" },
css = { "prettier" },
markdown = { "prettier" },
yaml = { "prettier" },
lua = { "stylua" },
json = { "prettier" },
toml = { "taplo" },
-- ["*"] = { "injected" },
["_"] = { "trim_whitespace", "trim_newlines" },
}
--- @module "lazy"
--- @type LazySpec
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
@@ -12,53 +33,21 @@ return {
require("conform").format({ async = true, lsp_fallback = true })
end,
mode = "",
desc = "[F]ormat buffer",
desc = "Format buffer",
},
},
--- @module "conform"
--- @type conform.setupOpts
opts = {
formatters_by_ft = (function()
local formatters = require("tools.format")
local formatters_by_ft = {}
for lang, formatter in pairs(formatters) do
formatters_by_ft[lang] = {}
if type(formatter) == "table" then
for _, tool in ipairs(formatter) do
if type(tool) == "table" then
table.insert(formatters_by_ft[lang], tool[1])
else
table.insert(formatters_by_ft[lang], tool)
end
end
end
end
return formatters_by_ft
end)(),
formatters_by_ft = formatters_by_ft,
notify_on_error = false,
format_on_save = function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
local function on_format(err)
if err and err:match("timeout$") then
slow_format_filetypes[vim.bo[bufnr].filetype] = true
end
end
return { timeout_ms = 200, lsp_fallback = true }, on_format
--- @type conform.FormatOpts
return { lsp_format = "fallback" }
end,
format_after_save = function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if not slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
return { lsp_fallback = true }
end,
-- log_level = vim.log.levels.DEBUG,
},
init = function()
vim.api.nvim_create_user_command("FormatDisable", function(args)
@@ -72,6 +61,7 @@ return {
desc = "Disable autoformat-on-save",
bang = true,
})
vim.api.nvim_create_user_command("FormatEnable", function()
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false

View File

@@ -0,0 +1,21 @@
-- https://github.com/Saecki/crates.nvim
--- @module "lazy"
--- @type LazySpec
return {
"Saecki/crates.nvim",
event = { "BufRead Cargo.toml" },
tag = "stable",
--- @type crates.UserConfig
opts = {
popup = {
hide_on_select = true,
border = require("symbols.window").border,
},
lsp = {
enabled = true,
actions = true,
completion = true,
hover = true,
},
},
}

View File

@@ -1,6 +1,9 @@
-- https://github.com/mfussenegger/nvim-dap
--- @module "lazy"
--- @type LazySpec
return {
{
enabled = false,
"mfussenegger/nvim-dap",
config = function()
local dap = require("dap")
@@ -86,6 +89,7 @@ return {
end,
},
{
enabled = false,
"theHamsta/nvim-dap-virtual-text",
dependencies = {
"mfussenegger/nvim-dap",

View File

@@ -0,0 +1,20 @@
-- https://github.com/jinh0/eyeliner.nvim
--- @module "lazy"
--- @type LazySpec
return {
"jinh0/eyeliner.nvim",
dependencies = {
{
"ellisonleao/gruvbox.nvim",
opts = {
overrides = {
EyelinerPrimary = { bold = true, underline = true },
EyelinerSecondary = { underline = true },
},
},
},
},
opts = {
highlight_on_key = true,
},
}

View File

@@ -1,5 +1,9 @@
-- https://github.com/j-hui/fidget.nvim
--- @module "lazy"
--- @type LazySpec
return {
"j-hui/fidget.nvim",
event = "LspAttach",
opts = {
notification = {
window = {

View File

@@ -1,6 +1,12 @@
-- https://github.com/lewis6991/gitsigns.nvim
--- @module "lazy"
--- @type LazySpec
return {
-- Adds git related signs to the gutter, as well as utilities for managing changes
"lewis6991/gitsigns.nvim",
event = { "BufWritePost", "BufReadPre" },
--- @module "gitsigns"
--- @type Gitsigns.Config
opts = {
signs = {
add = { text = "+" },
@@ -20,27 +26,42 @@ return {
},
attach_to_untracked = true,
current_line_blame_opts = {
virt_text_pos = "right_align",
virt_text_pos = "eol",
virt_text_priority = 1,
delay = 200,
priority = 9999,
},
},
init = function()
vim.keymap.set("n", "<leader>gs", require("gitsigns.actions").stage_hunk, { desc = "Stage hunk" })
vim.keymap.set("v", "<leader>gs", function()
vim.keymap.set("n", "gs", function()
require("gitsigns.actions").stage_hunk()
end, { desc = "(Un)stage hunk" })
vim.keymap.set("n", "gS", function()
require("gitsigns.actions").stage_buffer()
end, { desc = "Stage buffer" })
vim.keymap.set("v", "gs", function()
require("gitsigns.actions").stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, { desc = "Stage selection" })
end, { desc = "(Un)stage selection" })
vim.keymap.set("n", "<leader>gS", require("gitsigns.actions").undo_stage_hunk, { desc = "Undo stage hunk" })
vim.keymap.set("n", "gd", function()
require("gitsigns.actions").preview_hunk()
end, { desc = "Diff hunk" })
vim.keymap.set("n", "<leader>gd", require("gitsigns.actions").preview_hunk, { desc = "Diff hunk" })
vim.keymap.set("n", "<leader>tb", function()
require("gitsigns.actions").toggle_current_line_blame()
end, { desc = "Line blame" })
vim.keymap.set("n", "gb", function()
require("gitsigns.actions").blame_line()
end, { desc = "View blame" })
vim.keymap.set("n", "<leader>gb", require("gitsigns.actions").toggle_current_line_blame, { desc = "Blame" })
vim.keymap.set("n", "<leader>gr", require("gitsigns.actions").reset_hunk, { desc = "Reset hunk" })
vim.keymap.set("n", "<leader>gr", function()
require("gitsigns.actions").reset_hunk()
end, { desc = "Reset hunk" })
vim.keymap.set("n", "<leader>gR", function()
require("gitsigns.actions").reset_buffer()
end, { desc = "Reset buffer" })
vim.keymap.set("v", "<leader>gr", function()
require("gitsigns.actions").reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, { desc = "Reset selection" })
end, { desc = "Git reset selection" })
vim.keymap.set("n", "]g", function()
require("gitsigns.actions").nav_hunk("next")

View File

@@ -1,12 +1,11 @@
-- https://github.com/NMAC427/guess-indent.nvim
--- @module "lazy"
--- @type LazySpec
return {
-- Adds a command to automatically detect the indentation settings
-- Prefer to use .editorconfig for projects and modeline for files
"NMAC427/guess-indent.nvim",
keys = {
{ "<leader>gi", "<cmd>GuessIndent<cr>", desc = "Guess indentation" },
},
opts = {
auto_cmd = false,
},
cmd = "GuessIndent",
event = { "BufReadPre" },
--- @module "guess-indent"
--- @type GuessIndentConfig
opts = {},
}

View File

@@ -1,6 +1,13 @@
-- https://github.com/smjonas/inc-rename.nvim
--- @module "lazy"
--- @type LazySpec
return {
"smjonas/inc-rename.nvim",
cmd = "IncRename",
-- We can't load on just the command otherwise the preview does not work
event = "LspAttach",
--- @module "inc_rename"
--- @type inc_rename.UserConfig
opts = {
preview_empty_name = true,
},

View File

@@ -1,14 +0,0 @@
-- https://github.com/lukas-reineke/indent-blankline.nvim
return {
-- Add indentation guides even on blank lines
"lukas-reineke/indent-blankline.nvim",
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
main = "ibl",
opts = {
indent = {
char = "¦",
},
scope = { enabled = true, show_start = false, show_end = false },
},
}

View File

@@ -1,5 +1,9 @@
-- https://github.com/diogo464/kubernetes.nvim
--- @module "lazy"
--- @type LazySpec
return {
"diogo464/kubernetes.nvim",
ft = "yaml",
opts = {
schema_strict = true,
schema_generate_always = false,

View File

@@ -1,13 +1,16 @@
-- https://github.com/folke/lazydev.nvim
--- @module "lazy"
--- @type LazySpec
return {
{
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
{ path = "luvit-meta/library", words = { "vim%.uv" } },
},
"folke/lazydev.nvim",
ft = "lua",
--- @module "lazydev"
--- @type lazydev.Config
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" } },
},
},
{ "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings
}

View File

@@ -0,0 +1,7 @@
-- https://github.com/neovim/nvim-lspconfig
--- @module "lazy"
--- @type LazySpec
return {
"neovim/nvim-lspconfig",
cmd = { "LspInfo", "LspStart", "LspStop", "LspRestart" },
}

View File

@@ -1,13 +1,19 @@
-- https://github.com/nvim-lualine/lualine.nvim
local function get_schema()
local schema = require("yaml-companion").get_buf_schema(0)
if schema.result[1].name == "none" then
if not (vim.bo.filetype == "yaml" or vim.bo.filetype == "json" or vim.bo.filetype == "toml") then
return ""
end
return schema.result[1].name
local schema = (require("schema-companion").get_current_schemas() or "none")
if schema == "none" then
return ""
end
return schema
end
--- @module "lazy"
--- @type LazySpec
return {
"nvim-lualine/lualine.nvim",
opts = {
@@ -37,7 +43,9 @@ return {
"encoding",
{ "fileformat", icons_enabled = false },
"filetype",
get_schema,
{
get_schema,
},
},
},
inactive_sections = {

View File

@@ -0,0 +1,15 @@
-- https://github.com/mason-org/mason-lspconfig.nvim
--- @module "lazy"
--- @type LazySpec
return {
"mason-org/mason-lspconfig.nvim",
cmd = { "LspInstall", "LspUninstall" },
event = { "BufNewFile", "BufReadPre" },
--- @module "mason-lspconfig"
--- @type MasonLspconfigSettings
opts = {},
dependencies = {
"mason-org/mason.nvim",
"neovim/nvim-lspconfig",
},
}

View File

@@ -0,0 +1,50 @@
--- https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim
local ensure_installed = {
-- LSP
"typos_lsp",
"clangd",
"basedpyright",
"lua_ls",
{
"gopls",
condition = function()
return vim.fn.executable("go") > 0
end,
},
"jsonls",
"yamlls",
"taplo",
"neocmake",
-- Formatter
"clang-format",
{
"goimports",
condition = function()
return vim.fn.executable("go") > 0
end,
},
"ruff",
"prettier",
"stylua",
"eslint",
}
--- @module "lazy"
--- @type LazySpec
return {
"WhoIsSethDaniel/mason-tool-installer.nvim",
dependencies = {
"mason-org/mason.nvim",
},
event = "VeryLazy",
opts = {
ensure_installed = ensure_installed,
auto_update = true,
},
config = function(_, opts)
require("mason-tool-installer").setup(opts)
-- VeryLazy happens _after_ VimEnter, so we have to manually call this
require("mason-tool-installer").run_on_start()
end,
}

View File

@@ -1,96 +1,10 @@
-- https://github.com/mason-org/mason.nvim
--- @module "lazy"
--- @type LazySpec
return {
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
dependencies = {
{ "mason-org/mason.nvim", opts = {} },
"mason-org/mason-lspconfig.nvim",
"zapling/mason-conform.nvim",
},
config = function()
local lsp = require("tools.lsp")
-- Convert lsp entries to consistent format
local tools = {}
for _, tool in pairs(lsp) do
if type(tool) == "table" then
local name = tool[1]
local entry = {}
-- Make a copy and strip out name and lsp config
for k, v in pairs(tool) do
if k ~= 1 and k ~= 2 then
entry[k] = v
end
end
tools[name] = entry
else
tools[tool] = {}
end
end
-- Convert formatters to same format and merge on top of the lsps
local formatters_by_ft = require("conform").formatters_by_ft
local mapping = require("mason-conform.mapping")
for _, formatter in pairs(formatters_by_ft) do
if type(formatter) == "table" then
for _, tool in ipairs(formatter) do
local entry = {}
local name = nil
if type(tool) == "table" then
name = mapping.conform_to_package[tool[1]]
-- Make a copy and strip out name
for k, v in pairs(tool) do
if k ~= 1 then
entry[k] = v
end
end
else
name = mapping.conform_to_package[tool]
end
if name ~= nil then
tools[name] = vim.tbl_extend("error", tools[name] or {}, entry)
end
end
end
end
local ensure_installed = vim.iter(tools)
:map(function(name, tool)
if type(tool) == "table" then
if tool.system then
return nil
end
local entry = {
[1] = name,
}
for k, v in pairs(tool) do
entry[k] = v
end
return entry
end
return tool
end)
:totable()
require("mason-tool-installer").setup({
ensure_installed = ensure_installed,
auto_update = true,
debounde_hours = 24,
})
end,
},
{
"mason-org/mason-lspconfig.nvim",
opts = {},
dependencies = {
{ "mason-org/mason.nvim", opts = {} },
"neovim/nvim-lspconfig",
},
},
"mason-org/mason.nvim",
cmd = { "Mason", "MasonUpdate", "MasonInstall", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
--- @module "mason"
--- @type MasonSettings
opts = {},
}

View File

@@ -2,9 +2,11 @@
local fold = require("symbols.fold")
local file = require("symbols.file")
--- @module "lazy"
--- @type LazySpec
return {
"nvim-neo-tree/neo-tree.nvim",
version = "v3.x",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
@@ -15,85 +17,86 @@ return {
},
-- netrw hijack does not work when lazy loading
lazy = false,
config = function()
require("neo-tree").setup({
close_if_last_window = true,
popup_border_style = require("symbols.window").border,
source_selector = {
winbar = true,
show_scrolled_off_parent_node = true,
sources = {
{
source = "filesystem",
display_name = " Files ",
},
{
source = "buffers",
display_name = " Buffers ",
},
{
source = "git_status",
display_name = " Git ",
},
--- @module "neo-tree"
--- @type neotree.Config
opts = {
close_if_last_window = true,
popup_border_style = require("symbols.window").border,
source_selector = {
winbar = true,
show_scrolled_off_parent_node = true,
sources = {
{
source = "filesystem",
display_name = " Files ",
},
show_separator_on_edge = true,
},
default_component_configs = {
diagnostics = {
highlights = {
hint = "DiagnosticHint",
info = "DiagnosticInfo",
warn = "DiagnosticWarn",
error = "DiagnosticError",
},
{
source = "buffers",
display_name = " Buffers ",
},
icon = {
folder_closed = fold.closed,
folder_open = fold.open,
folder_empty = fold.empty,
default = file.icon,
},
modified = {
symbol = file.modified,
},
name = {
use_git_status_colors = false,
},
git_status = {
symbols = require("symbols.git"),
},
type = {
enabled = false,
},
last_modified = {
enabled = false,
},
symlink_target = {
enabled = true,
{
source = "git_status",
display_name = " Git ",
},
},
filesystem = {
follow_current_file = {
enabled = true,
},
hijack_netrw_behavior = "open_current",
use_libuv_file_watcher = true,
scan_mode = "deep",
},
window = {
popup = {
title = function(state)
return ""
end,
},
position = "float",
mappings = {
["<C-c>"] = "close_window",
["<esc>"] = "close_window",
["<tab>"] = "next_source",
["<S-tab>"] = "prev_source",
show_separator_on_edge = true,
},
default_component_configs = {
diagnostics = {
highlights = {
hint = "DiagnosticHint",
info = "DiagnosticInfo",
warn = "DiagnosticWarn",
error = "DiagnosticError",
},
},
})
end,
icon = {
folder_closed = fold.closed,
folder_open = fold.open,
folder_empty = fold.empty,
folder_empty_open = fold.open,
default = file.icon,
},
modified = {
symbol = file.modified,
},
name = {
use_git_status_colors = false,
},
git_status = {
symbols = require("symbols.git"),
},
type = {
enabled = false,
},
last_modified = {
enabled = false,
},
symlink_target = {
enabled = true,
},
},
filesystem = {
follow_current_file = {
enabled = true,
},
hijack_netrw_behavior = "open_current",
use_libuv_file_watcher = true,
scan_mode = "deep",
},
window = {
popup = {
title = function()
return ""
end,
},
position = "float",
mappings = {
["<C-c>"] = "close_window",
["<esc>"] = "close_window",
["<tab>"] = "next_source",
["<S-tab>"] = "prev_source",
},
},
},
}

View File

@@ -1,4 +1,6 @@
-- https://github.com/toppair/peek.nvim
--- @module "lazy"
--- @type LazySpec
return {
"toppair/peek.nvim",
build = "deno task --quiet build:fast",

View File

@@ -0,0 +1,17 @@
-- https://github.com/tadachs/ros-nvim
--- @module "lazy"
--- @type LazySpec
return {
"tadachs/ros-nvim",
event = { "BufRead", "BufNewFile" },
opts = {
commands = {
enabled = false,
},
},
build = ":TSInstall ros",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
}

View File

@@ -0,0 +1,26 @@
-- https://github.com/cenk1cenk2/schema-companion.nvim
--- @module "schema-companion"
--- @type schema_companion.Matcher
--- @module "lazy"
--- @type LazySpec
return {
"cenk1cenk2/schema-companion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"diogo464/kubernetes.nvim",
},
keys = {
{
"<leader>ys",
function()
require("schema-companion").select_schema()
end,
desc = "Yaml schema",
ft = "yaml",
},
},
--- @module "schema-companion"
--- @type schema_companion.Config
opts = {},
}

View File

@@ -1,13 +1,7 @@
-- https://github.com/b0o/schemastore.nvim
--- @module "lazy"
--- @type LazySpec
return {
"b0o/schemastore.nvim",
config = function()
vim.lsp.config("jsonls", {
settings = {
json = {
validate = { enable = true },
schemas = require("schemastore").json.schemas(),
},
},
})
end
lazy = true,
}

View File

@@ -0,0 +1,8 @@
-- https://github.com/Aasim-A/scrollEOF.nvim
--- @module "lazy"
--- @type LazySpec
return {
"Aasim-A/scrollEOF.nvim",
event = { "CursorMoved", "WinScrolled" },
opts = {},
}

View File

@@ -1,25 +1,53 @@
-- https://github.com/mrjones2014/smart-splits.nvim
--- @module "lazy"
--- @type LazySpec
return {
"mrjones2014/smart-splits.nvim",
config = function()
vim.keymap.set("n", "<M-h>", require("smart-splits").move_cursor_left)
vim.keymap.set("n", "<M-j>", require("smart-splits").move_cursor_down)
vim.keymap.set("n", "<M-k>", require("smart-splits").move_cursor_up)
vim.keymap.set("n", "<M-l>", require("smart-splits").move_cursor_right)
event = "VeryLazy",
--- @module "smart-splits"
--- @type SmartSplitsConfig
opts = {
at_edge = "stop",
cursor_follows_swapped_bufs = true,
},
init = function()
vim.keymap.set("n", "<M-h>", function()
require("smart-splits").move_cursor_left()
end)
vim.keymap.set("n", "<M-j>", function()
require("smart-splits").move_cursor_down()
end)
vim.keymap.set("n", "<M-k>", function()
require("smart-splits").move_cursor_up()
end)
vim.keymap.set("n", "<M-l>", function()
require("smart-splits").move_cursor_right()
end)
vim.keymap.set("n", "<C-w>h", require("smart-splits").swap_buf_left, { desc = "Swap buffer to the left" })
vim.keymap.set("n", "<C-w>j", require("smart-splits").swap_buf_down, { desc = "Swap buffer to the bottom" })
vim.keymap.set("n", "<C-w>k", require("smart-splits").swap_buf_up, { desc = "Swap buffer to the top" })
vim.keymap.set("n", "<C-w>l", require("smart-splits").swap_buf_right, { desc = "Swap buffer to the right" })
vim.keymap.set("n", "<C-w>h", function()
require("smart-splits").swap_buf_left()
end, { desc = "Swap buffer to the left" })
vim.keymap.set("n", "<C-w>j", function()
require("smart-splits").swap_buf_down()
end, { desc = "Swap buffer to the bottom" })
vim.keymap.set("n", "<C-w>k", function()
require("smart-splits").swap_buf_up()
end, { desc = "Swap buffer to the top" })
vim.keymap.set("n", "<C-w>l", function()
require("smart-splits").swap_buf_right()
end, { desc = "Swap buffer to the right" })
vim.keymap.set("n", "<M-left>", require("smart-splits").resize_left, { desc = "Resize buffer to the left" })
vim.keymap.set("n", "<M-down>", require("smart-splits").resize_down, { desc = "Resize buffer to the bottom" })
vim.keymap.set("n", "<M-up>", require("smart-splits").resize_up, { desc = "Resize buffer to the top" })
vim.keymap.set("n", "<M-right>", require("smart-splits").resize_right, { desc = "Resize buffer to the right" })
require("smart-splits").setup({
at_edge = "stop",
cursor_follows_swapped_bufs = true,
})
vim.keymap.set("n", "<M-left>", function()
require("smart-splits").resize_left()
end, { desc = "Resize buffer to the left" })
vim.keymap.set("n", "<M-down>", function()
require("smart-splits").resize_down()
end, { desc = "Resize buffer to the bottom" })
vim.keymap.set("n", "<M-up>", function()
require("smart-splits").resize_up()
end, { desc = "Resize buffer to the top" })
vim.keymap.set("n", "<M-right>", function()
require("smart-splits").resize_right()
end, { desc = "Resize buffer to the right" })
end,
}

View File

@@ -0,0 +1,73 @@
-- https://github.com/folke/snacks.nvim
--- @module "lazy"
--- @type LazySpec
return {
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
--- @module "snacks"
--- @type snacks.Config
opts = {
bigfile = {
enabled = true,
---@param ctx {buf: number, ft:string}
setup = function(ctx)
-- Disable treesitter
vim.treesitter.stop(ctx.buf)
vim.schedule(function()
if vim.api.nvim_buf_is_valid(ctx.buf) then
vim.bo[ctx.buf].syntax = ctx.ft
end
end)
end,
},
indent = {
enabled = true,
indent = {
char = "¦",
},
animate = {
enabled = false,
},
scope = {
char = "¦",
only_current = true,
},
},
},
keys = {
{
"<leader>bd",
function()
Snacks.bufdelete.delete()
end,
silent = true,
desc = "Buffer delete",
},
{
"<leader>bD",
function()
Snacks.bufdelete.other()
end,
silent = true,
desc = "Buffer delete others",
},
},
},
{
"nvim-neo-tree/neo-tree.nvim",
opts = function(_, opts)
local function on_move(data)
Snacks.rename.on_rename_file(data.source, data.destination)
end
local events = require("neo-tree.events")
opts.event_handlers = opts.event_handlers or {}
vim.list_extend(opts.event_handlers, {
{ event = events.FILE_MOVED, handler = on_move },
{ event = events.FILE_RENAMED, handler = on_move },
})
end,
},
}

View File

@@ -1,6 +1,12 @@
-- https://github.com/kylechui/nvim-surround
--- @module "lazy"
--- @type LazySpec
return {
"kylechui/nvim-surround",
event = "VeryLazy",
config = true,
--- @module "nvim-surround"
--- @type user_options
opts = {
move_cursor = "sticky",
},
}

View File

@@ -1,15 +0,0 @@
-- https://github.com/simrat39/symbols-outline.nvim
return {
enabled = false,
"simrat39/symbols-outline.nvim",
keys = {
{
"<F5>",
function()
require("symbols-outline").toggle_outline()
end,
desc = "Toggle symbols outline",
},
},
opts = {},
}

View File

@@ -1,97 +1,149 @@
-- https://github.com/nvim-telescope/telescope.nvim
local window = require("symbols.window")
-- TODO: Ensure installed ripgrep
--- @module "lazy"
--- @type LazySpec
return {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope.nvim",
cmd = { "Telescope" },
lazy = false,
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = function()
return {
pickers = {
find_files = {
hidden = true,
},
},
defaults = {
file_ignore_patterns = {
".git/",
},
mappings = {
n = {
["<Tab>"] = "move_selection_worse",
["<S-Tab>"] = "move_selection_better",
},
i = {
["<Tab>"] = "move_selection_worse",
["<S-Tab>"] = "move_selection_better",
},
},
borderchars = window.borderchars,
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown(),
},
smart_open = {
match_algorithm = "fzf",
},
},
}
end,
init = function()
vim.keymap.set("n", "<leader>.", function()
require("telescope.builtin").oldfiles()
end, { desc = "Find recently opened files" })
vim.keymap.set("n", "<leader>sb", function()
require("telescope.builtin").buffers()
end, { desc = "Buffers" })
vim.keymap.set("n", "<leader>/", function()
require("telescope.builtin").current_buffer_fuzzy_find({
-- Show matches in the order they appear in the document
sorting_strategy = "ascending",
})
end, { desc = "Fuzzily search in current buffer" })
vim.keymap.set("n", "<leader>s/", function()
require("telescope.builtin").live_grep({
grep_open_files = true,
prompt_title = "Live Grep in Open Files",
})
end, { desc = "Grep in open files" })
vim.keymap.set("n", "<leader><space>", function()
require("telescope").extensions.smart_open.smart_open()
end, { desc = "Find files" })
vim.keymap.set("n", "<leader>sh", function()
require("telescope.builtin").help_tags()
end, { desc = "Help" })
vim.keymap.set("n", "<leader>sw", function()
require("telescope.builtin").grep_string({
-- Show matches in the order they appear in the document
sorting_strategy = "ascending",
})
end, { desc = "Current word" })
vim.keymap.set("n", "<leader>sg", function()
require("telescope.builtin").live_grep()
end, { desc = "Grep" })
vim.keymap.set("n", "<leader>sd", function()
require("telescope.builtin").diagnostics()
end, { desc = "Diagnostics" })
vim.keymap.set("n", "<leader>sr", function()
require("telescope.builtin").resume()
end, { desc = "Resume" })
vim.keymap.set("n", "<leader>sk", function()
require("telescope.builtin").keymaps()
end, { desc = "Keymaps" })
vim.keymap.set("n", "<leader>sn", function()
require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") })
end, { desc = "Neovim files" })
-- HACK: Workaround until new borders are fixed in telescope
vim.api.nvim_create_autocmd("User", {
pattern = "TelescopeFindPre",
callback = function()
vim.opt_local.winborder = "none"
vim.api.nvim_create_autocmd("WinLeave", {
once = true,
callback = function()
vim.opt_local.winborder = window.border
end,
})
end,
})
end,
},
{
"nvim-telescope/telescope-ui-select.nvim",
{
dependencies = {
"nvim-telescope/telescope.nvim",
},
config = function()
require("telescope").load_extension("ui-select")
end,
},
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
dependencies = {
"nvim-telescope/telescope.nvim",
},
config = function()
require("telescope").load_extension("fzf")
end,
},
{
"danielfalk/smart-open.nvim",
branch = "0.3.x",
config = function()
require("telescope").load_extension("smart_open")
end,
dependencies = {
"kkharji/sqlite.lua",
"nvim-telescope/telescope.nvim",
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
cond = function()
return vim.fn.executable("make") == 1
end,
{
"ellisonleao/gruvbox.nvim",
opts = function(_, opts)
local palette = require("gruvbox").palette
opts.overrides.Directory = { fg = palette.neutral_blue, bold = false }
end,
},
},
},
config = function()
require("telescope").setup({
pickers = {
find_files = {
hidden = true,
},
},
defaults = {
file_ignore_patterns = {
".git/",
},
mappings = {
n = {
["<Tab>"] = "move_selection_worse",
["<S-Tab>"] = "move_selection_better",
},
i = {
["<Tab>"] = "move_selection_worse",
["<S-Tab>"] = "move_selection_better",
},
},
borderchars = window.borderchars,
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown(),
},
},
})
-- HACK: Workaround until new borders are fixed in telescope
vim.api.nvim_create_autocmd("User", {
pattern = "TelescopeFindPre",
callback = function()
vim.opt_local.winborder = "none"
vim.api.nvim_create_autocmd("WinLeave", {
once = true,
callback = function()
vim.opt_local.winborder = window.border
end,
})
end,
})
require("telescope").load_extension("fzf")
require("telescope").load_extension("ui-select")
vim.keymap.set("n", "<leader>.", require("telescope.builtin").oldfiles, { desc = "Find recently opened files" })
vim.keymap.set("n", "<leader>sb", require("telescope.builtin").buffers, { desc = "Buffers" })
vim.keymap.set("n", "<leader>/", function()
require("telescope.builtin").current_buffer_fuzzy_find({
-- Show matches in the order they appear in the document
sorting_strategy = "ascending",
})
end, { desc = "Fuzzily search in current buffer" })
vim.keymap.set("n", "<leader>s/", function()
require("telescope.builtin").live_grep({
grep_open_files = true,
prompt_title = "Live Grep in Open Files",
})
end, { desc = "Grep in open files" })
vim.keymap.set("n", "<leader><space>", require("telescope.builtin").find_files, { desc = "Find files" })
vim.keymap.set("n", "<leader>sh", require("telescope.builtin").help_tags, { desc = "Help" })
vim.keymap.set("n", "<leader>sw", function()
require("telescope.builtin").grep_string({
-- Show matches in the order they appear in the document
sorting_strategy = "ascending",
})
end, { desc = "Current word" })
vim.keymap.set("n", "<leader>sg", require("telescope.builtin").live_grep, { desc = "Grep" })
vim.keymap.set("n", "<leader>sd", require("telescope.builtin").diagnostics, { desc = "Diagnostics" })
vim.keymap.set("n", "<leader>sr", require("telescope.builtin").resume, { desc = "Resume" })
vim.keymap.set("n", "<leader>sk", require("telescope.builtin").keymaps, { desc = "Keymaps" })
vim.keymap.set("n", "<leader>sn", function()
require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") })
end, { desc = "Neovim files" })
end,
}

View File

@@ -1,14 +1,51 @@
-- https://github.com/folke/todo-comments.nvim
local diagnostic = require("symbols.diagnostic")
--- @module "lazy"
--- @type LazySpec
return {
-- 'folke/todo-comments.nvim',
-- NOTE: This fork highlights the entire matched word, not just the keyword.
"doongjohn/todo-comments.nvim",
"folke/todo-comments.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
event = "VeryLazy",
opts = {
signs = false,
keywords = {
-- FIX: Fix
FIX = { icon = diagnostic.bug },
-- TODO: Todo
TODO = { icon = diagnostic.todo },
-- HACK: Hack
HACK = { icon = diagnostic.hack },
-- WARN: Warn
WARN = { icon = diagnostic.warn },
-- PERF: Perf
PERF = { icon = diagnostic.performance },
-- NOTE: Note
NOTE = { icon = diagnostic.note },
-- TEST: Test
TEST = { icon = diagnostic.test },
},
highlight = {
-- TODO: Have multiline, but end when %p (punctuation) is at the end of a line
multiline = false,
before = "fg",
pattern = [[(KEYWORDS)\s*(\([^\)]*\))?:]],
},
search = {
pattern = [[\b(KEYWORDS)(\(.*\))?:]],
},
colors = {
error = { "TodoCommentError" },
warning = { "TodoCommentWarning" },
info = { "TodoCommentInfo" },
hint = { "TodoCommentHint" },
test = { "TodoCommentTest" },
default = { "TodoCommentDefault" },
},
},
init = function()
vim.keymap.set("n", "]t", function()
require("todo-comments").jump_next()
end, { desc = "Next todo comment" })
@@ -17,49 +54,12 @@ return {
require("todo-comments").jump_prev()
end, { desc = "Previous todo comment" })
if pcall(require, "trouble") then
-- TODO: Use cwd to only show todo's in the current file
-- vim.keymap.set("n", "<F4>", "<cmd>TroubleToggle todo cwd=%<cr>", { desc = "Next todo comment" })
vim.keymap.set("n", "<F4>", "<cmd>TroubleToggle todo<cr>", { desc = "Next todo comment" })
end
if pcall(require, "telescope") then
vim.keymap.set("n", "<leader>st", "<cmd>TodoTelescope<cr>", { desc = "Search todo" })
end
-- -- TODO: Use cwd to only show todo's in the current file
-- -- vim.keymap.set("n", "<F4>", "<cmd>TroubleToggle todo cwd=%<cr>", { desc = "Next todo comment" })
-- vim.keymap.set("n", "<F4>", "<cmd>TroubleToggle todo<cr>", { desc = "Next todo comment" })
require("todo-comments").setup({
keywords = {
-- FIX: Fix
FIX = { icon = diagnostic.bug },
-- TODO: Todo
TODO = { icon = diagnostic.todo },
-- HACK: Hack
HACK = { icon = diagnostic.hack },
-- WARN: Warn
WARN = { icon = diagnostic.warning },
-- PERF: Perf
PERF = { icon = diagnostic.performance },
-- NOTE: Note
NOTE = { icon = diagnostic.note },
-- TEST: Test
TEST = { icon = diagnostic.test },
},
highlight = {
-- TODO: Have multiline, but end when %p (punctuation) is at the end of a line
multiline = false,
before = "fg",
pattern = [[(KEYWORDS)\s*(\([^\)]*\))?:]],
},
search = {
pattern = [[\b(KEYWORDS)(\(.*\))?:]],
},
colors = {
error = { "TodoCommentError" },
warning = { "TodoCommentWarning" },
info = { "TodoCommentInfo" },
hint = { "TodoCommentHint" },
test = { "TodoCommentTest" },
default = { "TodoCommentDefault" },
},
})
vim.keymap.set("n", "<leader>st", function()
require("telescope").extensions["todo-comments"].todo()
end, { desc = "Search todo" })
end,
}

View File

@@ -1,26 +1,54 @@
-- https://github.com/nvim-treesitter/nvim-treesitter
--- @module "lazy"
--- @type LazySpec
return {
{
-- Highlight, edit, and navigate code
"nvim-treesitter/nvim-treesitter",
dependencies = {
{ "nvim-treesitter/nvim-treesitter-textobjects", branch = "main" },
"windwp/nvim-ts-autotag",
{ "nvim-treesitter/nvim-treesitter-textobjects", branch = "master" },
{ "windwp/nvim-ts-autotag", opts = {} },
},
lazy = false,
branch = "main",
branch = "master",
build = ":TSUpdate",
main = "nvim-treesitter.configs",
init = function()
vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
end,
--- @module "nvim-treesitter"
--- @type TSConfig
opts = {
ensure_installed = require("tools.highlight"),
ensure_installed = {
"c",
"cpp",
"go",
"lua",
"python",
"rust",
"tsx",
"typescript",
"vimdoc",
"vim",
"markdown",
"markdown_inline",
"bash",
"sql",
"xml",
"cmake",
"json",
"yaml",
},
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<c-space>",
node_incremental = "<c-space>",
scope_incremental = "<c-s>",
node_decremental = "<M-space>",
init_selection = "<M-o>",
node_incremental = "<M-o>",
node_decremental = "<M-i>",
},
},
textobjects = {
@@ -70,9 +98,6 @@ return {
},
},
},
autotag = {
enable = true,
},
},
},
}

View File

@@ -1,19 +1,21 @@
-- https://github.com/folke/trouble.nvim
local fold = require("symbols.fold")
--- @module "lazy"
--- @type LazySpec
return {
"folke/trouble.nvim",
cmd = { "Trouble", "TroubleToggle" },
keys = {
{ "<F3>", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Goto previous buffer" },
},
config = function()
require("trouble").setup({
icons = false,
auto_close = true,
fold_open = fold.open, -- icon used for open folds
fold_closed = fold.close, -- icon used for closed folds
use_diagnostic_signs = true,
})
end,
--- @module "trouble"
--- @type trouble.Config
opts = {
icons = false,
auto_close = true,
fold_open = fold.open, -- icon used for open folds
fold_closed = fold.close, -- icon used for closed folds
use_diagnostic_signs = true,
},
}

View File

@@ -1,7 +1,9 @@
-- https://github.com/mbbill/undotree
--- @module "lazy"
--- @type LazySpec
return {
'mbbill/undotree',
"mbbill/undotree",
keys = {
{ '<F6>', vim.cmd.UndotreeToggle, desc = 'Toggle undotree' },
{ "<F6>", vim.cmd.UndotreeToggle, desc = "Toggle undotree" },
},
}

View File

@@ -1,13 +1,21 @@
-- https://github.com/folke/which-key.nvim
local window = require("symbols.window")
--- @module "lazy"
--- @type LazySpec
return {
"folke/which-key.nvim",
-- "folke/which-key.nvim",
"cameronr/which-key.nvim",
branch = "winborder-support",
event = "VeryLazy",
--- @module "which-key"
--- @type wk.Opts
opts = {
preset = "modern",
delay = function(ctx)
return ctx.plugin and 0 or 500
end,
win = {
border = "single",
border = window.border,
padding = { 1, 1 },
title = false,
},
@@ -43,14 +51,13 @@ return {
},
expand = 1,
sort = { "alphanum" },
},
init = function()
-- TODO: Only make a category show up if there actually are any keybinds under it
require("which-key").add({
spec = {
{ "<leader>b", group = "Buffer" },
{ "<leader>d", group = "Document" },
{ "<leader>d", group = "Doument" },
{ "<leader>g", group = "Git" },
{ "<leader>t", group = "Toggle" },
{ "<leader>s", group = "Search" },
})
end,
{ "gr", group = "LSP" },
},
},
}

View File

@@ -1,19 +0,0 @@
return {
enabled = false,
"johnfrankmorgan/whitespace.nvim",
config = function()
require("whitespace-nvim").setup({
-- configuration options and their defaults
-- `highlight` configures which highlight is used to display
-- trailing whitespace
highlight = "CursorLine",
-- `ignored_filetypes` configures which filetypes to ignore when
-- displaying trailing whitespace
ignored_filetypes = { "TelescopePrompt", "Trouble", "help" },
})
-- remove trailing whitespace with a keybinding
vim.keymap.set("n", "<Leader>t", require("whitespace-nvim").trim, { desc = "Remove trailing whitespace" })
end,
}

View File

@@ -1,19 +0,0 @@
return {
"someone-stole-my-name/yaml-companion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"nvim-telescope/telescope.nvim",
"diogo464/kubernetes.nvim",
},
config = function()
require("telescope").load_extension("yaml_schema")
vim.lsp.config("yamlls", require("yaml-companion").setup({
builtin_matchers = {
kubernetes = { enabled = false },
kubernetes_custom = { enabled = true },
},
}))
end,
}

View File

@@ -1,9 +1,13 @@
-- Symbols to use for diagnostics
return {
-- LSP Status symbols
error = "",
warn = "",
info = "",
[vim.diagnostic.severity.ERROR] = " ",
[vim.diagnostic.severity.WARN] = " ",
[vim.diagnostic.severity.INFO] = " ",
[vim.diagnostic.severity.HINT] = "󰌵",
error = "",
warn = "",
info = "",
hint = "󰌵",
-- Comment type symbols
bug = "󰃤",

View File

@@ -1,16 +1,25 @@
-- https://github.com/ellisonleao/gruvbox.nvim
--- @module "lazy"
--- @type LazySpec
return {
"ellisonleao/gruvbox.nvim",
priority = 1000,
config = function()
config = function(_, opts)
require("gruvbox").setup(opts)
-- Load the colorscheme
vim.cmd.colorscheme("gruvbox")
end,
opts = function()
local palette = require("gruvbox").palette
require("gruvbox").setup({
return {
background = "dark",
italic = {
strings = false,
},
overrides = {
CursorLineNr = { fg = palette.light4, bg = palette.dark1, bold = true },
YankHighlight = { fg = palette.bright_blue, bg = palette.dark0, reverse = true },
Search = { fg = palette.bright_aqua },
IncSearch = { link = "Search" },
@@ -43,12 +52,12 @@ return {
TodoCommentHint = { fg = palette.bright_aqua },
TodoCommentTest = { fg = palette.bright_purple },
TodoCommentDefault = { fg = palette.bright_blue },
GitSignsAdd = { link = "GruvboxGreenSign" },
GitSignsStagedAdd = { fg = palette.dark_green, bg = palette.dark1 },
GitSignsChange = { link = "GruvboxAquaSign" },
GitSignsStagedChange = { fg = palette.dark_aqua, bg = palette.dark1 },
GitSignsDelete = { link = "GruvboxRedSign" },
GitSignsStagedDelete = { fg = palette.dark_red, bg = palette.dark1 },
GitSignsAdd = { fg = palette.bright_green, bold = true },
GitSignsStagedAdd = { fg = palette.dark_green, bold = true },
GitSignsChange = { fg = palette.bright_aqua, bold = true },
GitSignsStagedChange = { fg = palette.dark_aqua, bold = true },
GitSignsDelete = { fg = palette.bright_red, bold = true },
GitSignsStagedDelete = { fg = palette.dark_red, bold = true },
GitSignsCurrentLineBlame = { link = "GruvboxFg4" },
NeoTreeGitAdded = { link = "GruboxGreen" },
NeoTreeGitModified = { link = "GruvboxAqua" },
@@ -68,10 +77,12 @@ return {
NeoTreeFileIcon = { fg = palette.light1 },
NeoTreeFilterTerm = { fg = palette.bright_aqua, bold = true },
NeoTreeSymbolicLinkTarget = { fg = palette.bright_aqua, bold = true },
DiagnosticNumError = { fg = palette.dark0, bg = palette.bright_red, bold = true },
DiagnosticNumWarn = { fg = palette.dark0, bg = palette.bright_yellow, bold = true },
DiagnosticNumHint = { fg = palette.dark0, bg = palette.bright_aqua, bold = true },
DiagnosticNumInfo = { fg = palette.dark0, bg = palette.bright_blue, bold = true },
SnacksIndentScope = { fg = palette.light4 },
},
})
-- Load the colorscheme
vim.cmd.colorscheme("gruvbox")
}
end,
}

View File

@@ -1,19 +0,0 @@
return {
c = { "clang-format" },
cpp = { "clang-format" },
go = { "goimports", "gofmt" },
python = { "ruff_organize_imports", "ruff_format" },
rust = { { "rustfmt", system = true } },
javascript = { "prettierd" },
javascriptreact = { "prettierd" },
typescript = { "prettierd" },
typescriptreact = { "prettierd" },
css = { "prettierd" },
markdown = { "prettierd" },
yaml = { "prettierd" },
lua = { "stylua" },
json = { "jq" },
toml = { "taplo" },
-- ["*"] = { "injected" },
["_"] = { "trim_whitespace", "trim_newlines" },
}

View File

@@ -1,16 +0,0 @@
return {
"c",
"cpp",
"go",
"lua",
"python",
"rust",
"tsx",
"typescript",
"vimdoc",
"vim",
"markdown",
"markdown_inline",
"bash",
"sql",
}

View File

@@ -1,45 +0,0 @@
return {
{
"rust_analyzer",
{
settings = {
["rust-analyzer"] = {
check = {
command = "clippy",
},
},
},
},
system = "rust-analyzer",
},
{ "typos_lsp", {
init_options = {
diagnosticSeverity = "Hint",
},
} },
{ "clangd", {
cmd = { "clangd", "--offset-encoding=utf-16", "--clang-tidy" },
} },
"basedpyright",
{
"lua_ls",
{
settings = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
},
},
{
"gopls",
condition = function()
return vim.fn.executable("go") > 0
end,
},
"jsonls",
"yamlls",
"taplo",
"neocmake",
}

View File

@@ -1,35 +0,0 @@
local M = {}
local api = vim.api
local uri = require("kubernetes").yamlls_schema()
local schema = {
name = "Kubernetes",
uri = uri,
}
M.match = function(bufnr)
local lines = api.nvim_buf_get_lines(bufnr, 0, -1, false)
local kind = false
local api_version = false
for _, line in ipairs(lines) do
if kind or vim.regex("^kind: .*$"):match_str(line) then
kind = true
end
if api_version or vim.regex("^apiVersion: .*$"):match_str(line) then
api_version = true
end
if kind and api_version then
return schema
end
end
end
M.handles = function()
return { schema }
end
return M

1
sesh/.stow-local-ignore Normal file
View File

@@ -0,0 +1 @@
setup

View File

@@ -0,0 +1,25 @@
# Hide all scratch sessions
blacklist = ["scratch-*"]
# Scratch sessions rename themselves to something unique and are hidden from the overview
[[session]]
name = "scratch"
startup_command = "tmux rename-session scratch-$(echo -n $(date) | sha256sum | cut -c1-4) && tmux set detach-on-destroy on && clear"
[[session]]
name = "automation_rs"
path = "~/Projects/rust/automation_rs/"
startup_command = "nvim"
windows = ["shell"]
[[session]]
name = "olympus"
startup_command = "ssh olympus && exit"
[[session]]
name = "niestern_sander"
path = "~/Projects/ALTEN/niestern_sander/"
startup_command = "$DOTFILES/sesh/setup/niestern_sander.sh"
[[window]]
name = "shell"

17
sesh/dot-local/bin/sesh-select Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env zsh
exec </dev/tty
exec <&1
local session
session=$(sesh list -i | fzf-tmux -p 70%,60% \
--no-sort --ansi --border-label ' Select session ' --prompt '⚡ ' \
--header ' ^a all ^t tmux ^g configs ^x zoxide ^d tmux kill ^f find' \
--bind 'btab:down,tab:up' \
--bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list -i)' \
--bind 'ctrl-t:change-prompt(🪟 )+reload(sesh list -t -i)' \
--bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c -i)' \
--bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z -i)' \
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
--bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list -i)')
[[ -z "$session" ]] && return
sesh connect $session

15
sesh/setup/niestern_sander.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
if ! systemctl is-active --quiet docker; then
echo "Starting docker..."
systemctl start docker
fi
devcontainer up --workspace-folder .
tmux rename-window nvim
tmux new-window -n "ros" "devcontainer exec --workspace-folder . bash"
tmux new-window -n "shell"
tmux select-window -t :-2
devcontainer exec --workspace-folder . nvim

View File

@@ -1,2 +1,2 @@
gruvbox.conf
tpm/
tpm

View File

@@ -1,12 +1,18 @@
# Plugins
set -g @plugin 'mrjones2014/smart-splits.nvim'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'wfxr/tmux-fzf-url'
# Settings
set -ag terminal-overrides ",xterm-256color:RGB"
setw -g monitor-activity on
setw -g automatic-rename on
set-window-option -g xterm-keys on
set -sg escape-time 0
set -g history-limit 5000
set -g detach-on-destroy off # don't exit from tmux when closing a session
# Setup vi-mode with better keybindings
# TODO: Escape does not work properly for leaving
@@ -58,3 +64,20 @@ wg_is_keys_off="#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'TRUE' )
source-file "$DOTFILES/tmux/gruvbox.conf"
run "$DOTFILES/tmux/tpm/tpm"
set -g base-index 1
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
bind-key -n M-0 select-window -t 10
bind-key "a" run-shell "sesh-select"
bind-key x kill-pane
bind-key X kill-session

View File

@@ -22,10 +22,10 @@ plugins=(
# Disabled because the highlighting conflicts with autosuggestions
# history-substring-search
vi-mode
tmux
colored-man-pages
command-not-found
dirhistory
zsh-autopair
fast-syntax-highlighting
)
bindkey -M vicmd "k" up-line-or-beginning-search
@@ -35,18 +35,19 @@ HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="fg=yellow"
HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND="fg=red"
HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT=3
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true
VI_MODE_SET_CURSOR=true
# Might cause issues?
KEYTIMEOUT=1
ZSH_TMUX_AUTOSTART=true
ZSH_TMUX_AUTOCONNECT=false
ZSH_TMUX_FIXTERM=true
source $ZSH/oh-my-zsh.sh
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
autoload -U compinit && compinit
source "$ZSH/oh-my-zsh.sh"
less_termcap[so]="${fg_bold[black]}${bg[white]}"
export LESS="-F -R -i --incsearch -M"
export PATH="${HOME}/.local/bin:${HOME}/.cargo/bin:$PATH"
export EDITOR=nvim
@@ -54,14 +55,27 @@ export EDITOR=nvim
alias cl="clear"
if hash devcontainer 2>/dev/null; then
if (( $+commands[bat] )); then
export BAT_THEME="gruvbox-dark"
alias cat=bat
fi
if (( $+commands[devcontainer] )); then
dc() {
ORIG_DIR="$PWD"
while [[ "$PWD" != / ]] ; do
if find "$PWD"/ -maxdepth 1 -type d -name ".devcontainer" | grep -q ".devcontainer"; then
WORKSPACE_FOLDER="$PWD"
builtin cd "$ORIG_DIR"
devcontainer exec --workspace-folder "$WORKSPACE_FOLDER" $@
if [[ "$1" == "nvim" ]]; then
tmux set-option -pt 0 @pane-is-vim 1
devcontainer exec --workspace-folder "$WORKSPACE_FOLDER" bash -c "$@"
tmux set-option -pt 0 @pane-is-vim 0
else
devcontainer exec --workspace-folder "$WORKSPACE_FOLDER" $@
fi
return 0
else
builtin cd ..
@@ -73,10 +87,67 @@ if hash devcontainer 2>/dev/null; then
}
fi
if hash pnpm 2>/dev/null; then
export PNPM_HOME="/home/tim/.local/share/pnpm"
export PNPM_HOME="/home/tim/.local/share/pnpm"
if [ -d "$PNPM_HOME" ]; then
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
else
unset PNPM_HOME
fi
export FZF_DEFAULT_OPTS='--tmux'
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
--color=fg:-1,fg+:#83a598,bg:-1,bg+:#262626
--color=hl:bold:#8ec07c,hl+:#8ec07c,marker:#cc241d
--color=prompt:#fb4934,spinner:#af5fff,pointer:#83a598,header:#87afaf
--color=border:#7c6f64,label:#7c6f64
--border="sharp" --border-label-pos="0" --preview-window="border-sharp"
--prompt="> " --marker="◆" --pointer=">" --separator="─"
--scrollbar="│" --info="right"'
if (( $+commands[fd] )); then
export FZF_DEFAULT_COMMAND="fd --type f --strip-cwd-prefix"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
fi
if (( $+commands[fzf] )); then
source <(fzf --zsh)
if (( $+commands[paru] )); then
function pi {
paru -Slq | fzf -q "$1" --border-label=" Install package " --multi --preview 'paru -Si {1} --color=always' | xargs -ro paru -S
}
fi
fi
export _ZO_FZF_OPTS="--tmux"
if (( $+commands[zoxide] )); then
eval "$(zoxide init zsh --cmd cd)"
fi
# Generate missing text objects
autoload -Uz select-bracketed select-quoted
zle -N select-quoted
zle -N select-bracketed
for km in viopp visual; do
bindkey -M $km -- '-' vi-up-line-or-history
for c in {a,i}${(s..)^:-\'\"\`\|,./:;=+@}; do
bindkey -M $km $c select-quoted
done
for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do
bindkey -M $km $c select-bracketed
done
done
ZSH_TMUX_AUTOSTART=true
if (( $+commands[tmux] )); then
if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z "$EMACS" && -z "$VIM" && -z "$INTELLIJ_ENVIRONMENT_READER" && -z "$ZED_TERM" ]]; then
if (( $+commands[sesh] )) && (( $+commands[sesh-select] )); then
sesh-select
else
tmux new-session
fi
exit
fi
fi