Compare commits
10 Commits
master
...
fdf22f0c0a
| Author | SHA1 | Date | |
|---|---|---|---|
|
fdf22f0c0a
|
|||
|
e048faa1ed
|
|||
|
dfd668ad67
|
|||
|
8db068747b
|
|||
|
7b8b2d3f57
|
|||
|
335b8c110c
|
|||
|
33a931e88f
|
|||
|
88acc39619
|
|||
|
b788e6d393
|
|||
|
92b70bab19
|
12
.gitmodules
vendored
12
.gitmodules
vendored
@@ -7,15 +7,3 @@
|
||||
[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
|
||||
[submodule "zsh/custom/plugins/zsh-vi-mode"]
|
||||
path = zsh/custom/plugins/zsh-vi-mode
|
||||
url = https://github.com/jeffreytse/zsh-vi-mode
|
||||
|
||||
20
README.md
20
README.md
@@ -1,20 +0,0 @@
|
||||
## Tools
|
||||
|
||||
### Core tools
|
||||
|
||||
```
|
||||
bat
|
||||
fd
|
||||
fzf
|
||||
git-delta
|
||||
paru
|
||||
rg
|
||||
zoxide
|
||||
```
|
||||
|
||||
### Useful
|
||||
|
||||
```
|
||||
jq
|
||||
git-cliff
|
||||
```
|
||||
@@ -1,12 +1,13 @@
|
||||
import = ["/home/tim/.config/alacritty/gruvbox_dark.toml"]
|
||||
|
||||
[env]
|
||||
TERM = "xterm-256color"
|
||||
|
||||
[font]
|
||||
size = 10
|
||||
size = 12.0
|
||||
|
||||
[font.normal]
|
||||
family = "Hack Nerd Font"
|
||||
family = "SauceCodePro Nerd Font Mono"
|
||||
|
||||
[window]
|
||||
decorations = "none"
|
||||
@@ -17,6 +18,3 @@ resize_increments = true
|
||||
[window.dimensions]
|
||||
columns = 80
|
||||
lines = 24
|
||||
|
||||
[general]
|
||||
import = ["/home/tim/.config/alacritty/gruvbox_dark.toml"]
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
[include]
|
||||
path = ~/.dotfiles/git/configs/common.gitconfig
|
||||
|
||||
path = ~/.dotfiles/git/profiles/aim-robotics.gitconfig
|
||||
|
||||
[includeIf "gitdir:~/.dotfiles/"]
|
||||
path = ~/.dotfiles/git/profiles/Dreaded_X.gitconfig
|
||||
|
||||
; I don't have my private key on work machines
|
||||
[commit]
|
||||
gpgsign = false
|
||||
@@ -1 +0,0 @@
|
||||
../git/dot-local
|
||||
@@ -1,11 +0,0 @@
|
||||
[include]
|
||||
path = ~/.dotfiles/git/configs/common.gitconfig
|
||||
|
||||
path = ~/.dotfiles/git/profiles/ALTEN.gitconfig
|
||||
|
||||
[includeIf "gitdir:~/.dotfiles"]
|
||||
path = ~/.dotfiles/git/profiles/Dreaded_X.gitconfig
|
||||
|
||||
; I don't have my private key on work machines
|
||||
[commit]
|
||||
gpgsign = false
|
||||
@@ -1 +0,0 @@
|
||||
../git/dot-local
|
||||
@@ -1,3 +1,2 @@
|
||||
gitignore
|
||||
profiles
|
||||
configs
|
||||
gitconfig
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
[include]
|
||||
path = ~/.dotfiles/git/configs/lfs.gitconfig
|
||||
path = ~/.dotfiles/git/configs/delta.gitconfig
|
||||
|
||||
[push]
|
||||
default = simple
|
||||
autoSetupRemote = true
|
||||
|
||||
[core]
|
||||
excludesfile = ~/.dotfiles/git/gitignore
|
||||
|
||||
[color]
|
||||
ui = true
|
||||
|
||||
[credential]
|
||||
helper = store
|
||||
|
||||
[pull]
|
||||
; If we pull we only want to fast forward, if that is not possible we should not allow pull to work
|
||||
; Instead use fetch and then either rebase or merge
|
||||
ff = only
|
||||
; rebase = false
|
||||
|
||||
[diff]
|
||||
tool = nvimdiff
|
||||
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
[rebase]
|
||||
autosquash = true
|
||||
autostash = true
|
||||
updateRefs = true
|
||||
@@ -1,54 +0,0 @@
|
||||
[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
|
||||
@@ -1,5 +0,0 @@
|
||||
[filter "lfs"]
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
@@ -1,10 +1,28 @@
|
||||
[include]
|
||||
path = ~/.dotfiles/git/configs/common.gitconfig
|
||||
[user]
|
||||
name = Dreaded_X
|
||||
email = tim@huizinga.dev
|
||||
signingkey = CD17A34CBFB21DE9A73D47EB76BDEC4E165D8AD9
|
||||
|
||||
path = ~/.dotfiles/git/profiles/Dreaded_X.gitconfig
|
||||
[push]
|
||||
default = simple
|
||||
|
||||
[core]
|
||||
excludesfile = ~/.dotfiles/git/gitignore
|
||||
|
||||
[color]
|
||||
ui = true
|
||||
|
||||
[credential]
|
||||
helper = store
|
||||
[pull]
|
||||
; If we pull we only want to fast forward, if that is not possible we should not allow pull to work
|
||||
; Instead use fetch and then either rebase or merge
|
||||
ff = only
|
||||
; rebase = false
|
||||
[init]
|
||||
defaultBranch = master
|
||||
[commit]
|
||||
gpgsign = true
|
||||
|
||||
[includeIf "gitdir:~/Projects/ALTEN/"]
|
||||
path = ~/.dotfiles/git/profiles/ALTEN.gitconfig
|
||||
|
||||
[includeIf "gitdir:~/Projects/aim-robotics/"]
|
||||
path = ~/.dotfiles/git/profiles/aim-robotics.gitconfig
|
||||
path = ~/.dotfiles/git/gitconfig/ALTEN
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/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^
|
||||
@@ -1,6 +1,3 @@
|
||||
[user]
|
||||
name = Tim Huizinga
|
||||
email = tim.huizinga@alten.nl
|
||||
|
||||
[commit]
|
||||
gpgsign = false
|
||||
@@ -1,7 +0,0 @@
|
||||
[user]
|
||||
name = Dreaded_X
|
||||
email = tim@huizinga.dev
|
||||
signingkey = CD17A34CBFB21DE9A73D47EB76BDEC4E165D8AD9
|
||||
|
||||
[commit]
|
||||
gpgsign = true
|
||||
@@ -1,6 +0,0 @@
|
||||
[user]
|
||||
name = Tim Huizinga
|
||||
email = th@aimrobotics.nl
|
||||
|
||||
[commit]
|
||||
gpgsign = false
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# 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
|
||||
@@ -1,3 +1,8 @@
|
||||
-- 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
|
||||
@@ -12,13 +17,6 @@ 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" },
|
||||
@@ -28,12 +26,6 @@ require("lazy").setup({
|
||||
"gruvbox",
|
||||
},
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
rocks = {
|
||||
enabled = false,
|
||||
},
|
||||
ui = {
|
||||
border = require("symbols.window").border,
|
||||
backdrop = 100,
|
||||
|
||||
@@ -1,54 +1,49 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"actions-preview.nvim": { "branch": "master", "commit": "cb938c25edaac38d362555f19244a9cb85d561e8" },
|
||||
"blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "243893ba9d5d1049dd451a25cab32ec7f8f67bcf" },
|
||||
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
|
||||
"conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" },
|
||||
"crates.nvim": { "branch": "main", "commit": "afcd1cc3eeceb5783676fc8464389b9216a29d05" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"eyeliner.nvim": { "branch": "main", "commit": "8f197eb30cecdf4c2cc9988a5eecc6bc34c0c7d6" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"gitlab.nvim": { "branch": "develop", "commit": "3d2828a9504b87fc36ee2aca1b0f36cf75003edd" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "334d5fd49fc8033f26408425366c66c6390c57bb" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
||||
"inc-rename.nvim": { "branch": "main", "commit": "0074b551a17338ccdcd299bd86687cc651bcb33d" },
|
||||
"kubernetes.nvim": { "branch": "main", "commit": "44daf998345628a1a7034e3aaa31f4e05e4dde7c" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a676ab7282da8d651e175118bcf54483ca11e46d" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
|
||||
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||
"multicolumn.nvim": { "branch": "master", "commit": "a363bdfd422abf26256f343dac4df183031f8e94" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "9d6826582a3e8c84787bd7355df22a2812a1ad59" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "ef211089af881bea206c7aa3f2693a81feee7e90" },
|
||||
"nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "0203a9608d63eda57679b01e69f33a7b4c34b0d1" },
|
||||
"nvim-surround": { "branch": "main", "commit": "61319d4bd1c5e336e197defa15bd104c51f0fb29" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"conform.nvim": { "branch": "master", "commit": "a6965ac128eba75537ec2bc5ddd5d5e357062bdc" },
|
||||
"document-color.nvim": { "branch": "main", "commit": "74c487f0e5accfaae033755451b9e367220693fd" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "52f8da33cc0cadbf1164c4a91c8bfd6895533d67" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" },
|
||||
"inc-rename.nvim": { "branch": "main", "commit": "5e03e986625961d1fac296d1bf332a6510c3add6" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },
|
||||
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "b129892f783740e6cf741f2ea09fa5dd512aa584" },
|
||||
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "b529fb2ae9206ca1d84ee72b596deecbc088ac59" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
|
||||
"nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
|
||||
"nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" },
|
||||
"nvim-cmp-lsp-rs": { "branch": "main", "commit": "cb7681abf20b615a7ec33e3f49df3b5a382711a4" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9266dc26862d8f3556c2ca77602e811472b4c5b8" },
|
||||
"nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "3e10cffbb2a022cd8e2aaea9f4fffb514065e77c" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "c24a7a6dc5fde325af844d165323aa6f7082866e" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
|
||||
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"ros-nvim": { "branch": "main", "commit": "1ad64cd3a1e144dfea67890845f9da2e82d96900" },
|
||||
"schema-companion.nvim": { "branch": "main", "commit": "9a8cbeb9429958524331f49a4bd9c25cfbc2c208" },
|
||||
"schemastore.nvim": { "branch": "main", "commit": "27f7d753990c8d79bdefe75be0094e7e86eabf16" },
|
||||
"scrollEOF.nvim": { "branch": "master", "commit": "e462b9a07b8166c3e8011f1dcbc6bf68b67cd8d7" },
|
||||
"smart-open.nvim": { "branch": "0.3.x", "commit": "918c97cac0c33f7a116a822df144bc5bbefa4490" },
|
||||
"smart-splits.nvim": { "branch": "master", "commit": "25bf40abf79720ebfa98e09259b7c42942055f4c" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "9912042fc8bca2209105526ac7534e9a0c2071b2" },
|
||||
"sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
|
||||
"schemastore.nvim": { "branch": "main", "commit": "f660f74bcaae950a77c69dda91270063c8cbd692" },
|
||||
"smart-splits.nvim": { "branch": "master", "commit": "e11caebbe3ce8fb70aced281931f73519a060e0a" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "72e160cb1ce8c0db2ac4315f77d97420a2f4223d" },
|
||||
"undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" },
|
||||
"which-key.nvim": { "branch": "winborder-support", "commit": "ab1a3b0d3005a95507ba6c18b96531d430370885" }
|
||||
"telescope.nvim": { "branch": "master", "commit": "d00d9df48c00d8682c14c2b5da78bda7ef06b939" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "a736bbe08c8eff370dfa60701f1e669816d4e3c8" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
|
||||
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
local function uv_script_interpreter(script_path)
|
||||
local result = vim.system({ "uv", "python", "find", "--script", script_path }, { text = true }):wait()
|
||||
if result.code == 0 then
|
||||
return vim.fn.trim(result.stdout)
|
||||
end
|
||||
end
|
||||
|
||||
local function uv_interpreter()
|
||||
local result = vim.system({ "uv", "python", "find" }, { text = true }):wait()
|
||||
if result.code == 0 then
|
||||
return vim.fn.trim(result.stdout)
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
settings = {
|
||||
basedpyright = {
|
||||
analysis = {
|
||||
typeCheckingMode = "standard",
|
||||
},
|
||||
},
|
||||
python = {},
|
||||
},
|
||||
before_init = function(_, config)
|
||||
local script = vim.api.nvim_buf_get_name(0)
|
||||
local python = uv_script_interpreter(script)
|
||||
if not python then
|
||||
python = uv_interpreter()
|
||||
end
|
||||
config.settings.python.pythonPath = python
|
||||
end,
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
return {
|
||||
cmd = { "clangd", "--offset-encoding=utf-16", "--clang-tidy" },
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
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(),
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
@@ -1,23 +0,0 @@
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
return {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
check = {
|
||||
command = "clippy",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
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(),
|
||||
},
|
||||
}),
|
||||
{}
|
||||
)
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
init_options = {
|
||||
diagnosticSeverity = "Hint",
|
||||
},
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
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(),
|
||||
},
|
||||
}),
|
||||
{}
|
||||
)
|
||||
@@ -1,11 +1,15 @@
|
||||
-- Highlight on yank
|
||||
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
callback = function()
|
||||
vim.highlight.on_yank({ higroup = "YankHighlight" })
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = "*",
|
||||
})
|
||||
|
||||
-- show cursor line only in active window
|
||||
local cursor_group = vim.api.nvim_create_augroup("ActiveCursor", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, {
|
||||
callback = function()
|
||||
local ok, cl = pcall(vim.api.nvim_win_get_var, 0, "auto-cursorline")
|
||||
@@ -14,6 +18,8 @@ vim.api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, {
|
||||
vim.api.nvim_win_del_var(0, "auto-cursorline")
|
||||
end
|
||||
end,
|
||||
group = cursor_group,
|
||||
pattern = "*",
|
||||
})
|
||||
vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
|
||||
callback = function()
|
||||
@@ -23,4 +29,6 @@ vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
|
||||
vim.wo.cursorline = false
|
||||
end
|
||||
end,
|
||||
group = cursor_group,
|
||||
pattern = "*",
|
||||
})
|
||||
|
||||
@@ -7,6 +7,17 @@ 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>")
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
|
||||
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
|
||||
|
||||
-- Some nice adjustments
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
@@ -15,16 +26,3 @@ 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,
|
||||
})
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
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
|
||||
@@ -1,57 +0,0 @@
|
||||
---@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
|
||||
@@ -1,5 +1,3 @@
|
||||
local window = require("symbols.window")
|
||||
|
||||
-- Set highlight on search
|
||||
vim.o.hlsearch = true
|
||||
|
||||
@@ -41,7 +39,7 @@ vim.o.termguicolors = true
|
||||
|
||||
-- Default tab settings
|
||||
-- Tab settings are automatically detected by vim-sleuth
|
||||
-- Can be overridden by .editorconfig and modeline
|
||||
-- Can be overriden by .editorconfig and modeline
|
||||
vim.o.tabstop = 4
|
||||
vim.o.softtabstop = 4
|
||||
vim.o.shiftwidth = 4
|
||||
@@ -59,13 +57,3 @@ vim.o.showmode = false
|
||||
|
||||
-- Minimum number of screen lines above and below the cursor
|
||||
vim.o.scrolloff = 10
|
||||
|
||||
-- Highlight tabs and trailing whitespace
|
||||
vim.o.listchars = "trail:~,tab:¦⁃,nbsp:␣"
|
||||
vim.o.list = true
|
||||
|
||||
-- Fold settings
|
||||
vim.o.foldlevelstart = 99
|
||||
|
||||
-- Windows borders
|
||||
vim.o.winborder = window.border
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
-- 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,
|
||||
}
|
||||
@@ -1,31 +1,6 @@
|
||||
-- https://github.com/altermo/ultimate-autopair.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
return {
|
||||
"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,
|
||||
},
|
||||
},
|
||||
},
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = true,
|
||||
}
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
-- https://github.com/saghen/blink.cmp
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
event = "InsertEnter",
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = "1.*",
|
||||
|
||||
--- @module "blink-cmp"
|
||||
--- @type blink.cmp.Config
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "default",
|
||||
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
|
||||
["<C-u>"] = { "scroll_documentation_up" },
|
||||
["<C-d>"] = { "scroll_documentation_down" },
|
||||
|
||||
["<CR>"] = { "accept", "fallback" },
|
||||
["<Esc>"] = {
|
||||
function(cmp)
|
||||
if cmp.is_visible() then
|
||||
cmp.cancel()
|
||||
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",
|
||||
},
|
||||
|
||||
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
|
||||
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
|
||||
["<Up>"] = { "select_prev", "fallback" },
|
||||
["<Down>"] = { "select_next", "fallback" },
|
||||
["<C-p>"] = { "select_prev", "fallback_to_mappings" },
|
||||
["<C-n>"] = { "select_next", "fallback_to_mappings" },
|
||||
|
||||
["<C-k>"] = { "show_signature", "hide_signature", "fallback" },
|
||||
},
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = "normal",
|
||||
},
|
||||
|
||||
completion = {
|
||||
ghost_text = {
|
||||
enabled = true,
|
||||
},
|
||||
list = {
|
||||
selection = {
|
||||
preselect = false,
|
||||
},
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 0,
|
||||
},
|
||||
menu = {
|
||||
auto_show = true,
|
||||
draw = {
|
||||
columns = {
|
||||
{ "label", "label_description", gap = 1 },
|
||||
{ "kind", "source_name", gap = 1 },
|
||||
},
|
||||
components = {
|
||||
source_name = {
|
||||
text = function(ctx)
|
||||
if ctx.source_id ~= "snippets" then
|
||||
return "[" .. ctx.source_name .. "]"
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
signature = {
|
||||
enabled = true,
|
||||
trigger = {
|
||||
show_on_accept = true,
|
||||
show_on_insert = true,
|
||||
},
|
||||
},
|
||||
|
||||
sources = {
|
||||
default = {
|
||||
"lazydev",
|
||||
"lsp",
|
||||
"path",
|
||||
"snippets",
|
||||
"buffer",
|
||||
},
|
||||
providers = {
|
||||
lazydev = {
|
||||
name = "LazyDev",
|
||||
module = "lazydev.integrations.blink",
|
||||
score_offset = 100,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
cmdline = {
|
||||
enabled = false,
|
||||
},
|
||||
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
}
|
||||
23
nvim/dot-config/nvim/lua/plugins/bufdel.lua
Normal file
23
nvim/dot-config/nvim/lua/plugins/bufdel.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
-- 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 = '[B]uffer [d]elete'
|
||||
},
|
||||
{
|
||||
'<leader>bD',
|
||||
function()
|
||||
require('bufdel').delete_buffer_others(false)
|
||||
end,
|
||||
silent = true,
|
||||
desc = '[B]uffer [D]elete others'
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -2,17 +2,41 @@
|
||||
local diagnostic = require("symbols.diagnostic")
|
||||
local file = require("symbols.file")
|
||||
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
--- @module "bufferline"
|
||||
--- @type bufferline.UserConfig
|
||||
opts = {
|
||||
version = "v3.*",
|
||||
dependencies = {
|
||||
"ojroques/nvim-bufdel",
|
||||
},
|
||||
config = function()
|
||||
-- Enable mousemoveevent if possible
|
||||
vim.o.mousemoveevent = true
|
||||
|
||||
local bufferline = require("bufferline")
|
||||
|
||||
-- Setup keybinds to move between buffers
|
||||
vim.keymap.set("n", "<tab>", function()
|
||||
bufferline.cycle(1)
|
||||
end, { silent = true, desc = "Goto next buffer" })
|
||||
vim.keymap.set("n", "<S-tab>", function()
|
||||
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)
|
||||
end, { silent = true, desc = "[B]uffer to the [ left" })
|
||||
vim.keymap.set("n", "<leader>b]", function()
|
||||
bufferline.move(1)
|
||||
end, { silent = true, desc = "[B]uffer to the ] right" })
|
||||
|
||||
bufferline.setup({
|
||||
options = {
|
||||
show_buffer_icons = false,
|
||||
show_buffer_close_icons = false,
|
||||
show_buffer_close_icons = true,
|
||||
diagnostics = "nvim_lsp",
|
||||
close_command = "BufDel %d",
|
||||
right_mouse_command = "BufDel %d",
|
||||
separator_style = "thick",
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
@@ -33,22 +57,6 @@ return {
|
||||
return s
|
||||
end,
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
-- Setup keybinds to move between buffers
|
||||
vim.keymap.set("n", "<tab>", function()
|
||||
require("bufferline").cycle(1)
|
||||
end, { silent = true, desc = "Goto next buffer" })
|
||||
vim.keymap.set("n", "<S-tab>", function()
|
||||
require("bufferline").cycle(-1)
|
||||
end, { silent = true, desc = "Goto previous buffer" })
|
||||
|
||||
-- Setup keybinds to move buffers around
|
||||
vim.keymap.set("n", "<leader>b[", function()
|
||||
require("bufferline").move(-1)
|
||||
end, { silent = true, desc = "Move buffer to left" })
|
||||
vim.keymap.set("n", "<leader>b]", function()
|
||||
require("bufferline").move(1)
|
||||
end, { silent = true, desc = "Move buffer to right" })
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
-- https://github.com/kwkarlwang/bufresize.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"kwkarlwang/bufresize.nvim",
|
||||
opts = {},
|
||||
|
||||
115
nvim/dot-config/nvim/lua/plugins/cmp.lua
Normal file
115
nvim/dot-config/nvim/lua/plugins/cmp.lua
Normal file
@@ -0,0 +1,115 @@
|
||||
-- https://github.com/hrsh7th/nvim-cmp
|
||||
return {
|
||||
{
|
||||
-- Autocompletion
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
"onsails/lspkind-nvim",
|
||||
|
||||
-- Improve sorting order for rust
|
||||
"zjp-CN/nvim-cmp-lsp-rs",
|
||||
|
||||
-- Snippets
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
local border = require("symbols.window").border
|
||||
|
||||
local cmp_rs = require("cmp_lsp_rs")
|
||||
local comparators = cmp_rs.comparators
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = { completeopt = "menu,menuone,noinsert" },
|
||||
window = {
|
||||
completion = cmp.config.window.bordered({
|
||||
border = border,
|
||||
winhighlight = "CursorLine:CmpSelection",
|
||||
}),
|
||||
documentation = cmp.config.window.bordered({ border = border }),
|
||||
},
|
||||
-- Include the source of the cmp entry
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = "text",
|
||||
menu = {
|
||||
nvim_lsp = "LSP",
|
||||
luasnip = "LuaSnip",
|
||||
path = "Path",
|
||||
},
|
||||
}),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete({}),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
select = true,
|
||||
}),
|
||||
["<Esc>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.abort()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sorting = {
|
||||
comparators = {
|
||||
comparators.inherent_import_inscope,
|
||||
comparators.sort_by_label_but_underscore_last,
|
||||
},
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
build = function()
|
||||
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
|
||||
return
|
||||
end
|
||||
return "make install_jsregexp"
|
||||
end,
|
||||
config = function()
|
||||
require("luasnip").config.setup()
|
||||
-- require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
dependencies = {
|
||||
-- "rafamadriz/friendly-snippets",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
-- 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
|
||||
@@ -15,12 +13,20 @@ return {
|
||||
"!popup",
|
||||
},
|
||||
always_update = true,
|
||||
options = {
|
||||
parsers = {
|
||||
names = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
user_default_options = {
|
||||
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,
|
||||
}
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
-- https://github.com/numToStr/Comment.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
'numToStr/Comment.nvim',
|
||||
event = "VeryLazy",
|
||||
--- @module "Comment"
|
||||
--- @type CommentConfig
|
||||
opts = {
|
||||
toggler = {
|
||||
block = "gBc",
|
||||
},
|
||||
opleader = {
|
||||
block = "gB",
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
}
|
||||
|
||||
@@ -1,28 +1,11 @@
|
||||
-- https://github.com/stevearc/conform.nvim
|
||||
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
|
||||
local slow_format_filetypes = {}
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
@@ -33,21 +16,35 @@ return {
|
||||
require("conform").format({ async = true, lsp_fallback = true })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "Format buffer",
|
||||
desc = "[F]ormat buffer",
|
||||
},
|
||||
},
|
||||
--- @module "conform"
|
||||
--- @type conform.setupOpts
|
||||
opts = {
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
notify_on_error = false,
|
||||
formatters_by_ft = require("tools").formatters,
|
||||
format_on_save = function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
--- @type conform.FormatOpts
|
||||
return { lsp_format = "fallback" }
|
||||
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
|
||||
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)
|
||||
@@ -61,7 +58,6 @@ 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
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
-- 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,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
-- https://github.com/mfussenegger/nvim-dap
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
{
|
||||
enabled = false,
|
||||
"mfussenegger/nvim-dap",
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
dap.adapters.cppdbg = {
|
||||
id = "cppdbg",
|
||||
type = "executable",
|
||||
command = "OpenDebugAD7",
|
||||
}
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch file",
|
||||
type = "cppdbg",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
-- stopAtEntry = true,
|
||||
},
|
||||
-- {
|
||||
-- name = "Attach to gdbserver :1234",
|
||||
-- type = "cppdbg",
|
||||
-- request = "launch",
|
||||
-- MIMode = "gdb",
|
||||
-- miDebuggerServerAddress = "localhost:1234",
|
||||
-- miDebuggerPath = "/usr/bin/gdb",
|
||||
-- cwd = "${workspaceFolder}",
|
||||
--
|
||||
-- program = function()
|
||||
-- return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
-- end,
|
||||
-- },
|
||||
}
|
||||
|
||||
dap.configurations.c = dap.configurations.cpp
|
||||
dap.configurations.rust = dap.configurations.cpp
|
||||
|
||||
dap.defaults.fallback.force_external_terminal = true
|
||||
dap.defaults.fallback.external_terminal = {
|
||||
command = "tmux",
|
||||
args = { "new-window" },
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "<F5>", function()
|
||||
require("dap").continue()
|
||||
end, { desc = "Continue" })
|
||||
vim.keymap.set("n", "<F10>", function()
|
||||
require("dap").step_over()
|
||||
end, { desc = "Step over" })
|
||||
vim.keymap.set("n", "<F11>", function()
|
||||
require("dap").step_into()
|
||||
end, { desc = "Step into" })
|
||||
vim.keymap.set("n", "<F12>", function()
|
||||
require("dap").step_out()
|
||||
end, { desc = "Step out" })
|
||||
vim.keymap.set("n", "<Leader>bp", function()
|
||||
require("dap").toggle_breakpoint()
|
||||
end, { desc = "Breakpoint" })
|
||||
-- vim.keymap.set("n", "<Leader>lp", function()
|
||||
-- require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: "))
|
||||
-- end)
|
||||
vim.keymap.set("n", "<Leader>dr", function()
|
||||
require("dap").repl.open()
|
||||
end, { desc = "Debug repl" })
|
||||
-- vim.keymap.set("n", "<Leader>dl", function()
|
||||
-- require("dap").run_last()
|
||||
-- end)
|
||||
vim.keymap.set({ "n", "v" }, "<Leader>dh", function()
|
||||
require("dap.ui.widgets").hover()
|
||||
end, { desc = "Debug hover" })
|
||||
vim.keymap.set("n", "<Leader>df", function()
|
||||
local widgets = require("dap.ui.widgets")
|
||||
widgets.centered_float(widgets.frames)
|
||||
end, { desc = "Debug frames" })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "dap-float",
|
||||
callback = function()
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "q", "<cmd>close!<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
enabled = false,
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
},
|
||||
opts = {
|
||||
virt_text_pos = "eol",
|
||||
only_first_definition = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,412 +0,0 @@
|
||||
-- https://github.com/sindrets/diffview.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"sindrets/diffview.nvim",
|
||||
opts = function()
|
||||
local actions = require("diffview.actions")
|
||||
|
||||
return {
|
||||
use_icons = false,
|
||||
-- Disable default keymaps just so we can change <leader>e -> <leader>f
|
||||
keymaps = {
|
||||
disable_defaults = true,
|
||||
view = {
|
||||
-- The `view` bindings are active in the diff buffers, only when the current
|
||||
-- tabpage is a Diffview.
|
||||
{
|
||||
"n",
|
||||
"<tab>",
|
||||
actions.select_next_entry,
|
||||
{ desc = "Open the diff for the next file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<s-tab>",
|
||||
actions.select_prev_entry,
|
||||
{ desc = "Open the diff for the previous file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"[F",
|
||||
actions.select_first_entry,
|
||||
{ desc = "Open the diff for the first file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"]F",
|
||||
actions.select_last_entry,
|
||||
{ desc = "Open the diff for the last file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"gf",
|
||||
actions.goto_file_edit,
|
||||
{ desc = "Open the file in the previous tabpage" },
|
||||
},
|
||||
{ "n", "<C-w><C-f>", actions.goto_file_split, { desc = "Open the file in a new split" } },
|
||||
{ "n", "<C-w>gf", actions.goto_file_tab, { desc = "Open the file in a new tabpage" } },
|
||||
{ "n", "<leader>f", actions.focus_files, { desc = "Bring focus to the file panel" } },
|
||||
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel." } },
|
||||
{
|
||||
"n",
|
||||
"g<C-x>",
|
||||
actions.cycle_layout,
|
||||
{ desc = "Cycle through available layouts." },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"[x",
|
||||
actions.prev_conflict,
|
||||
{ desc = "In the merge-tool: jump to the previous conflict" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"]x",
|
||||
actions.next_conflict,
|
||||
{ desc = "In the merge-tool: jump to the next conflict" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>co",
|
||||
actions.conflict_choose("ours"),
|
||||
{ desc = "Choose the OURS version of a conflict" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>ct",
|
||||
actions.conflict_choose("theirs"),
|
||||
{ desc = "Choose the THEIRS version of a conflict" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>cb",
|
||||
actions.conflict_choose("base"),
|
||||
{ desc = "Choose the BASE version of a conflict" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>ca",
|
||||
actions.conflict_choose("all"),
|
||||
{ desc = "Choose all the versions of a conflict" },
|
||||
},
|
||||
{ "n", "dx", actions.conflict_choose("none"), { desc = "Delete the conflict region" } },
|
||||
{
|
||||
"n",
|
||||
"<leader>cO",
|
||||
actions.conflict_choose_all("ours"),
|
||||
{ desc = "Choose the OURS version of a conflict for the whole file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>cT",
|
||||
actions.conflict_choose_all("theirs"),
|
||||
{ desc = "Choose the THEIRS version of a conflict for the whole file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>cB",
|
||||
actions.conflict_choose_all("base"),
|
||||
{ desc = "Choose the BASE version of a conflict for the whole file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>cA",
|
||||
actions.conflict_choose_all("all"),
|
||||
{ desc = "Choose all the versions of a conflict for the whole file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"dX",
|
||||
actions.conflict_choose_all("none"),
|
||||
{ desc = "Delete the conflict region for the whole file" },
|
||||
},
|
||||
},
|
||||
file_panel = {
|
||||
{
|
||||
"n",
|
||||
"j",
|
||||
actions.next_entry,
|
||||
{ desc = "Bring the cursor to the next file entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<down>",
|
||||
actions.next_entry,
|
||||
{ desc = "Bring the cursor to the next file entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"k",
|
||||
actions.prev_entry,
|
||||
{ desc = "Bring the cursor to the previous file entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<up>",
|
||||
actions.prev_entry,
|
||||
{ desc = "Bring the cursor to the previous file entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<cr>",
|
||||
actions.select_entry,
|
||||
{ desc = "Open the diff for the selected entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"o",
|
||||
actions.select_entry,
|
||||
{ desc = "Open the diff for the selected entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"l",
|
||||
actions.select_entry,
|
||||
{ desc = "Open the diff for the selected entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<2-LeftMouse>",
|
||||
actions.select_entry,
|
||||
{ desc = "Open the diff for the selected entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"-",
|
||||
actions.toggle_stage_entry,
|
||||
{ desc = "Stage / unstage the selected entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"s",
|
||||
actions.toggle_stage_entry,
|
||||
{ desc = "Stage / unstage the selected entry" },
|
||||
},
|
||||
{ "n", "S", actions.stage_all, { desc = "Stage all entries" } },
|
||||
{ "n", "U", actions.unstage_all, { desc = "Unstage all entries" } },
|
||||
{
|
||||
"n",
|
||||
"X",
|
||||
actions.restore_entry,
|
||||
{ desc = "Restore entry to the state on the left side" },
|
||||
},
|
||||
{ "n", "L", actions.open_commit_log, { desc = "Open the commit log panel" } },
|
||||
{ "n", "zo", actions.open_fold, { desc = "Expand fold" } },
|
||||
{ "n", "h", actions.close_fold, { desc = "Collapse fold" } },
|
||||
{ "n", "zc", actions.close_fold, { desc = "Collapse fold" } },
|
||||
{ "n", "za", actions.toggle_fold, { desc = "Toggle fold" } },
|
||||
{ "n", "zR", actions.open_all_folds, { desc = "Expand all folds" } },
|
||||
{ "n", "zM", actions.close_all_folds, { desc = "Collapse all folds" } },
|
||||
{ "n", "<c-b>", actions.scroll_view(-0.25), { desc = "Scroll the view up" } },
|
||||
{ "n", "<c-f>", actions.scroll_view(0.25), { desc = "Scroll the view down" } },
|
||||
{
|
||||
"n",
|
||||
"<tab>",
|
||||
actions.select_next_entry,
|
||||
{ desc = "Open the diff for the next file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<s-tab>",
|
||||
actions.select_prev_entry,
|
||||
{ desc = "Open the diff for the previous file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"[F",
|
||||
actions.select_first_entry,
|
||||
{ desc = "Open the diff for the first file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"]F",
|
||||
actions.select_last_entry,
|
||||
{ desc = "Open the diff for the last file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"gf",
|
||||
actions.goto_file_edit,
|
||||
{ desc = "Open the file in the previous tabpage" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<C-w><C-f>",
|
||||
actions.goto_file_split,
|
||||
{ desc = "Open the file in a new split" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<C-w>gf",
|
||||
actions.goto_file_tab,
|
||||
{ desc = "Open the file in a new tabpage" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"i",
|
||||
actions.listing_style,
|
||||
{ desc = "Toggle between 'list' and 'tree' views" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"f",
|
||||
actions.toggle_flatten_dirs,
|
||||
{ desc = "Flatten empty subdirectories in tree listing style" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"R",
|
||||
actions.refresh_files,
|
||||
{ desc = "Update stats and entries in the file list" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>f",
|
||||
actions.focus_files,
|
||||
{ desc = "Bring focus to the file panel" },
|
||||
},
|
||||
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel" } },
|
||||
{ "n", "g<C-x>", actions.cycle_layout, { desc = "Cycle available layouts" } },
|
||||
{ "n", "[x", actions.prev_conflict, { desc = "Go to the previous conflict" } },
|
||||
{ "n", "]x", actions.next_conflict, { desc = "Go to the next conflict" } },
|
||||
{ "n", "g?", actions.help("file_panel"), { desc = "Open the help panel" } },
|
||||
{
|
||||
"n",
|
||||
"<leader>cO",
|
||||
actions.conflict_choose_all("ours"),
|
||||
{ desc = "Choose the OURS version of a conflict for the whole file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>cT",
|
||||
actions.conflict_choose_all("theirs"),
|
||||
{ desc = "Choose the THEIRS version of a conflict for the whole file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>cB",
|
||||
actions.conflict_choose_all("base"),
|
||||
{ desc = "Choose the BASE version of a conflict for the whole file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<leader>cA",
|
||||
actions.conflict_choose_all("all"),
|
||||
{ desc = "Choose all the versions of a conflict for the whole file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"dX",
|
||||
actions.conflict_choose_all("none"),
|
||||
{ desc = "Delete the conflict region for the whole file" },
|
||||
},
|
||||
},
|
||||
file_history_panel = {
|
||||
{ "n", "g!", actions.options, { desc = "Open the option panel" } },
|
||||
{
|
||||
"n",
|
||||
"<C-A-d>",
|
||||
actions.open_in_diffview,
|
||||
{ desc = "Open the entry under the cursor in a diffview" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"y",
|
||||
actions.copy_hash,
|
||||
{ desc = "Copy the commit hash of the entry under the cursor" },
|
||||
},
|
||||
{ "n", "L", actions.open_commit_log, { desc = "Show commit details" } },
|
||||
{
|
||||
"n",
|
||||
"X",
|
||||
actions.restore_entry,
|
||||
{ desc = "Restore file to the state from the selected entry" },
|
||||
},
|
||||
{ "n", "zo", actions.open_fold, { desc = "Expand fold" } },
|
||||
{ "n", "zc", actions.close_fold, { desc = "Collapse fold" } },
|
||||
{ "n", "h", actions.close_fold, { desc = "Collapse fold" } },
|
||||
{ "n", "za", actions.toggle_fold, { desc = "Toggle fold" } },
|
||||
{ "n", "zR", actions.open_all_folds, { desc = "Expand all folds" } },
|
||||
{ "n", "zM", actions.close_all_folds, { desc = "Collapse all folds" } },
|
||||
{
|
||||
"n",
|
||||
"j",
|
||||
actions.next_entry,
|
||||
{ desc = "Bring the cursor to the next file entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<down>",
|
||||
actions.next_entry,
|
||||
{ desc = "Bring the cursor to the next file entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"k",
|
||||
actions.prev_entry,
|
||||
{ desc = "Bring the cursor to the previous file entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<up>",
|
||||
actions.prev_entry,
|
||||
{ desc = "Bring the cursor to the previous file entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<cr>",
|
||||
actions.select_entry,
|
||||
{ desc = "Open the diff for the selected entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"o",
|
||||
actions.select_entry,
|
||||
{ desc = "Open the diff for the selected entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"l",
|
||||
actions.select_entry,
|
||||
{ desc = "Open the diff for the selected entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"<2-LeftMouse>",
|
||||
actions.select_entry,
|
||||
{ desc = "Open the diff for the selected entry" },
|
||||
},
|
||||
{ "n", "<c-b>", actions.scroll_view(-0.25), { desc = "Scroll the view up" } },
|
||||
{ "n", "<c-f>", actions.scroll_view(0.25), { desc = "Scroll the view down" } },
|
||||
{ "n", "<tab>", actions.select_next_entry, { desc = "Open the diff for the next file" } },
|
||||
{
|
||||
"n",
|
||||
"<s-tab>",
|
||||
actions.select_prev_entry,
|
||||
{ desc = "Open the diff for the previous file" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"[F",
|
||||
actions.select_first_entry,
|
||||
{ desc = "Open the diff for the first file" },
|
||||
},
|
||||
{ "n", "]F", actions.select_last_entry, { desc = "Open the diff for the last file" } },
|
||||
{
|
||||
"n",
|
||||
"gf",
|
||||
actions.goto_file_edit,
|
||||
{ desc = "Open the file in the previous tabpage" },
|
||||
},
|
||||
{ "n", "<C-w><C-f>", actions.goto_file_split, { desc = "Open the file in a new split" } },
|
||||
{ "n", "<C-w>gf", actions.goto_file_tab, { desc = "Open the file in a new tabpage" } },
|
||||
{ "n", "<leader>f", actions.focus_files, { desc = "Bring focus to the file panel" } },
|
||||
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel" } },
|
||||
{ "n", "g<C-x>", actions.cycle_layout, { desc = "Cycle available layouts" } },
|
||||
{ "n", "g?", actions.help("file_history_panel"), { desc = "Open the help panel" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
-- 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,
|
||||
},
|
||||
}
|
||||
@@ -1,9 +1,5 @@
|
||||
-- https://github.com/j-hui/fidget.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"j-hui/fidget.nvim",
|
||||
event = "LspAttach",
|
||||
opts = {
|
||||
notification = {
|
||||
window = {
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
local window = require("symbols.window")
|
||||
-- https://github.com/harrisoncramer/gitlab.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"harrisoncramer/gitlab.nvim",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"sindrets/diffview.nvim",
|
||||
},
|
||||
cond = function()
|
||||
return vim.fn.executable("go") > 0
|
||||
end,
|
||||
build = function()
|
||||
require("gitlab.server").build(true)
|
||||
end, -- Builds the Go binary
|
||||
opts = {
|
||||
discussion_tree = {
|
||||
draft_mode = true,
|
||||
},
|
||||
popup = {
|
||||
border = window.border,
|
||||
},
|
||||
discussion_signs = {
|
||||
virtual_text = true,
|
||||
},
|
||||
keymaps = {
|
||||
discussion_tree = {
|
||||
toggle_node = "za",
|
||||
toggle_all_discussions = "zA",
|
||||
},
|
||||
popup = {
|
||||
perform_action = "w",
|
||||
discard_changes = "<esc>",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,12 +1,6 @@
|
||||
-- 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 = "+" },
|
||||
@@ -14,60 +8,38 @@ return {
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
untracked = { text = "|" },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
untracked = { text = "|" },
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text_pos = "eol",
|
||||
virt_text_priority = 1,
|
||||
delay = 200,
|
||||
},
|
||||
},
|
||||
init = 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()
|
||||
vim.keymap.set("n", "<leader>gs", require("gitsigns.actions").stage_hunk, { desc = "[G]it [S]tage hunk" })
|
||||
vim.keymap.set("v", "<leader>gs", function()
|
||||
require("gitsigns.actions").stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end, { desc = "(Un)stage selection" })
|
||||
end, { desc = "[G]it [S]tage selection" })
|
||||
|
||||
vim.keymap.set("n", "gd", function()
|
||||
require("gitsigns.actions").preview_hunk()
|
||||
end, { desc = "Diff hunk" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>gS",
|
||||
require("gitsigns.actions").undo_stage_hunk,
|
||||
{ desc = "[G]it undo [S]tage 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>gd",
|
||||
require("gitsigns.actions").preview_hunk_inline,
|
||||
{ desc = "[G]it [D]iff 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("n", "<leader>gr", require("gitsigns.actions").reset_hunk, { desc = "[G]it [R]eset hunk" })
|
||||
vim.keymap.set("v", "<leader>gr", function()
|
||||
require("gitsigns.actions").reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end, { desc = "Git reset selection" })
|
||||
end, { desc = "[G]it [R]eset selection" })
|
||||
|
||||
vim.keymap.set("n", "]g", function()
|
||||
require("gitsigns.actions").nav_hunk("next")
|
||||
end, { desc = "Next hunk" })
|
||||
end, { desc = "Go to next hunk" })
|
||||
vim.keymap.set("n", "[g", function()
|
||||
require("gitsigns.actions").nav_hunk("prev")
|
||||
end, { desc = "Previous hunk" })
|
||||
end, { desc = "Go to previous hunk" })
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
-- https://github.com/NMAC427/guess-indent.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"NMAC427/guess-indent.nvim",
|
||||
cmd = "GuessIndent",
|
||||
event = { "BufReadPre" },
|
||||
--- @module "guess-indent"
|
||||
--- @type GuessIndentConfig
|
||||
opts = {},
|
||||
-- Adds a command to automatically detect the identation settings
|
||||
-- Prefer to use .editorconfig for projects and modeline for files
|
||||
'NMAC427/guess-indent.nvim',
|
||||
keys = {
|
||||
{ "<leader>gi", "<cmd>GuessIndent<cr>", desc = "[G]uess [I]ndentation" },
|
||||
},
|
||||
opts = {
|
||||
auto_cmd = false,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
-- 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,
|
||||
},
|
||||
|
||||
14
nvim/dot-config/nvim/lua/plugins/indent-blankline.lua
Normal file
14
nvim/dot-config/nvim/lua/plugins/indent-blankline.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
-- 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 },
|
||||
},
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
-- https://github.com/diogo464/kubernetes.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"diogo464/kubernetes.nvim",
|
||||
ft = "yaml",
|
||||
opts = {
|
||||
schema_strict = true,
|
||||
schema_generate_always = false,
|
||||
},
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
-- https://github.com/folke/lazydev.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"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" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
123
nvim/dot-config/nvim/lua/plugins/lsp.lua
Normal file
123
nvim/dot-config/nvim/lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,123 @@
|
||||
return {
|
||||
-- LSP Configuration & Plugins
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
|
||||
-- Some of the lsp keybindings rely on telescope
|
||||
"nvim-telescope/telescope.nvim",
|
||||
-- Set capabilities from cmp
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
|
||||
-- Add document color
|
||||
"mrshmllow/document-color.nvim",
|
||||
|
||||
"b0o/schemastore.nvim",
|
||||
|
||||
-- Rename with immediate visual feedback
|
||||
},
|
||||
config = function()
|
||||
local border = require("symbols.window").border
|
||||
|
||||
-- Set borders
|
||||
local handlers = {
|
||||
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }),
|
||||
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border }),
|
||||
}
|
||||
|
||||
require("lspconfig.ui.windows").default_options = {
|
||||
border = border,
|
||||
}
|
||||
|
||||
vim.diagnostic.config({
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
-- Create the signs for diagnostic symbols
|
||||
local diagnostic = require("symbols.diagnostic")
|
||||
local signs = {
|
||||
Error = diagnostic.error,
|
||||
Warn = diagnostic.warn,
|
||||
Hint = diagnostic.hint,
|
||||
Info = diagnostic.info,
|
||||
}
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("LspAttach", { clear = true }),
|
||||
callback = function(event)
|
||||
local map = function(keys, func, desc)
|
||||
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP:" .. desc })
|
||||
end
|
||||
|
||||
map("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
|
||||
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
|
||||
map("<leader>D", vim.lsp.buf.type_definition, "Type [D]efinition")
|
||||
map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]symbols")
|
||||
map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]symbols")
|
||||
|
||||
vim.keymap.set("n", "<leader>rn", function()
|
||||
return ":IncRename " .. vim.fn.expand("<cword>")
|
||||
end, { buffer = event.buf, expr = true, desc = "LSP: [R]e[N]ame" })
|
||||
|
||||
-- TODO: Do we need this to work in visal mode?
|
||||
vim.keymap.set(
|
||||
{ "v", "n" },
|
||||
"<leader>ca",
|
||||
vim.lsp.buf.code_action,
|
||||
{ buffer = event.buf, desc = "LSP: [C]ode [A]ction", remap = true }
|
||||
)
|
||||
|
||||
-- Signature help
|
||||
map("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||
map("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
-- Turn of lsp based syntax highlighting
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
if client and client.server_capabilities.documentHighlightProvider then
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = event.buf,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
buffer = event.buf,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- TODO: Only do this is cmp_nvim_lsp is enabled
|
||||
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities())
|
||||
capabilities.textDocument.colorProvider = {
|
||||
dynamicRegistration = true,
|
||||
}
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
handlers = {
|
||||
function(server_name)
|
||||
local server = require("tools").servers[server_name] or {}
|
||||
server.capabilities = vim.tbl_deep_extend("force", capabilities, server.capabilities or {})
|
||||
server.handlers = handlers
|
||||
|
||||
require("lspconfig")[server_name].setup(server)
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
14
nvim/dot-config/nvim/lua/plugins/lsp_signature.lua
Normal file
14
nvim/dot-config/nvim/lua/plugins/lsp_signature.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
-- https://github.com/ray-x/lsp_signature.nvim
|
||||
return {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
opts = {
|
||||
hint_enable = false,
|
||||
handler_opts = {
|
||||
border = require("symbols.window").border,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
-- https://github.com/neovim/nvim-lspconfig
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
cmd = { "LspInfo", "LspStart", "LspStop", "LspRestart" },
|
||||
}
|
||||
@@ -1,28 +1,4 @@
|
||||
-- https://github.com/nvim-lualine/lualine.nvim
|
||||
|
||||
local function get_schema()
|
||||
if not (vim.bo.filetype == "yaml" or vim.bo.filetype == "json" or vim.bo.filetype == "toml") then
|
||||
return ""
|
||||
end
|
||||
|
||||
-- The provided get_current_schema function returns nonenil when no schema is known.
|
||||
-- Instead we use a custom implemention that does not do that.
|
||||
-- Also has the added benefit of giving more control over formatting
|
||||
local schemas = require("schema-companion").get_matching_schemas()
|
||||
if schemas == nil or #schemas == 0 then
|
||||
return ""
|
||||
end
|
||||
|
||||
schema = schemas[1]
|
||||
if schema.name == "none" then
|
||||
return ""
|
||||
end
|
||||
|
||||
return ("%s%s"):format(schema.name, #schemas > 1 and (" (+%d)"):format(#schemas - 1) or "")
|
||||
end
|
||||
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = {
|
||||
@@ -52,9 +28,6 @@ return {
|
||||
"encoding",
|
||||
{ "fileformat", icons_enabled = false },
|
||||
"filetype",
|
||||
{
|
||||
get_schema,
|
||||
},
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
-- 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",
|
||||
},
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
--- 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,
|
||||
}
|
||||
@@ -1,10 +1,29 @@
|
||||
-- https://github.com/mason-org/mason.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"mason-org/mason.nvim",
|
||||
cmd = { "Mason", "MasonUpdate", "MasonInstall", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
|
||||
--- @module "mason"
|
||||
--- @type MasonSettings
|
||||
opts = {},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ui = {
|
||||
border = require("symbols.window").border,
|
||||
height = 0.8,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
config = function()
|
||||
local tools = require("tools")
|
||||
local ensure_installed = vim.tbl_keys(tools.servers)
|
||||
ensure_installed =
|
||||
vim.list_extend(ensure_installed, require("util.mason").process_formatters(tools.formatters))
|
||||
ensure_installed = vim.list_extend(ensure_installed, tools.extra)
|
||||
|
||||
require("mason-tool-installer").setup({
|
||||
ensure_installed = ensure_installed,
|
||||
auto_update = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
-- https://github.com/aznhe21/fmbarina/multicolumn.nvim
|
||||
local function enforced(rulers, scope)
|
||||
return {
|
||||
rulers = rulers,
|
||||
scope = scope or "window",
|
||||
full_column = false,
|
||||
to_line_end = true,
|
||||
bg_color = "#691b1b",
|
||||
fg_color = "#ffd8ad",
|
||||
}
|
||||
end
|
||||
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"fmbarina/multicolumn.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
base_set = {
|
||||
full_column = true,
|
||||
},
|
||||
sets = {
|
||||
python = enforced({ 89 }),
|
||||
rust = enforced({ 101 }),
|
||||
gitcommit = function(_, win)
|
||||
local T = function(c, x, y)
|
||||
if c then
|
||||
return x
|
||||
else
|
||||
return y
|
||||
end
|
||||
end
|
||||
|
||||
return enforced(
|
||||
{ T(vim.fn.line(".", win) == 1, 51, 73) },
|
||||
T(vim.fn.line(".", win) == 1, "line", "window")
|
||||
)
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -2,59 +2,31 @@
|
||||
local fold = require("symbols.fold")
|
||||
local file = require("symbols.file")
|
||||
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
version = "v2.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
cmd = { "Neotree" },
|
||||
keys = {
|
||||
{ "<F2>", "<cmd>Neotree toggle reveal<cr>", desc = "Open floating Neo-tree window" },
|
||||
{ "<F2>", "<cmd>Neotree toggle reveal filesystem float<cr>", desc = "Open floating Neo-tree window" },
|
||||
},
|
||||
-- netrw hijack does not work when lazy loading
|
||||
lazy = false,
|
||||
--- @module "neo-tree"
|
||||
--- @type neotree.Config
|
||||
opts = {
|
||||
config = function()
|
||||
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
||||
|
||||
require("neo-tree").setup({
|
||||
close_if_last_window = true,
|
||||
popup_border_style = require("symbols.window").border,
|
||||
enable_diagnostics = true,
|
||||
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 ",
|
||||
},
|
||||
},
|
||||
show_separator_on_edge = true,
|
||||
},
|
||||
default_component_configs = {
|
||||
diagnostics = {
|
||||
highlights = {
|
||||
hint = "DiagnosticHint",
|
||||
info = "DiagnosticInfo",
|
||||
warn = "DiagnosticWarn",
|
||||
error = "DiagnosticError",
|
||||
},
|
||||
},
|
||||
icon = {
|
||||
folder_closed = fold.closed,
|
||||
folder_open = fold.open,
|
||||
folder_empty = fold.empty,
|
||||
folder_empty_open = fold.open,
|
||||
default = file.icon,
|
||||
},
|
||||
modified = {
|
||||
@@ -66,37 +38,30 @@ return {
|
||||
git_status = {
|
||||
symbols = require("symbols.git"),
|
||||
},
|
||||
type = {
|
||||
enabled = false,
|
||||
},
|
||||
last_modified = {
|
||||
enabled = false,
|
||||
},
|
||||
symlink_target = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
filesystem = {
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
filtered_items = {
|
||||
hide_dotfiles = false,
|
||||
hide_by_name = {
|
||||
".git",
|
||||
},
|
||||
},
|
||||
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",
|
||||
},
|
||||
},
|
||||
buffers = {
|
||||
window = {
|
||||
mappings = {
|
||||
["bd"] = nil,
|
||||
["<C-d>"] = "buffer_delete",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
-- https://github.com/toppair/peek.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"toppair/peek.nvim",
|
||||
build = "deno task --quiet build:fast",
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
-- 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",
|
||||
},
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
-- 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()
|
||||
local schemas = require("schema-companion").get_matching_schemas()
|
||||
if schemas == nil or #schemas == 0 or (#schemas == 1 and schemas[1].name == "none") then
|
||||
print("No matching schemas")
|
||||
else
|
||||
require("schema-companion").select_matching_schema()
|
||||
end
|
||||
end,
|
||||
desc = "Select schema",
|
||||
},
|
||||
},
|
||||
--- @module "schema-companion"
|
||||
--- @type schema_companion.Config
|
||||
opts = {},
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
-- https://github.com/b0o/schemastore.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"b0o/schemastore.nvim",
|
||||
lazy = true,
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
-- https://github.com/Aasim-A/scrollEOF.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"Aasim-A/scrollEOF.nvim",
|
||||
event = { "CursorMoved", "WinScrolled" },
|
||||
opts = {},
|
||||
}
|
||||
@@ -1,53 +1,34 @@
|
||||
-- https://github.com/mrjones2014/smart-splits.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"mrjones2014/smart-splits.nvim",
|
||||
event = "VeryLazy",
|
||||
--- @module "smart-splits"
|
||||
--- @type SmartSplitsConfig
|
||||
opts = {
|
||||
dependencies = {
|
||||
"kwkarlwang/bufresize.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)
|
||||
|
||||
vim.keymap.set("n", "<C-w>r", require("smart-splits").start_resize_mode, { desc = "Enter resize mode" })
|
||||
|
||||
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" })
|
||||
|
||||
require("smart-splits").setup({
|
||||
at_edge = "stop",
|
||||
cursor_follows_swapped_bufs = true,
|
||||
resize_mode = {
|
||||
silent = true,
|
||||
hooks = {
|
||||
on_enter = function()
|
||||
vim.notify("Entering resize mode...")
|
||||
end,
|
||||
on_leave = require("bufresize").register,
|
||||
},
|
||||
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", 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>", 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,
|
||||
}
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
-- 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,
|
||||
},
|
||||
}
|
||||
@@ -1,12 +1,6 @@
|
||||
-- https://github.com/kylechui/nvim-surround
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"kylechui/nvim-surround",
|
||||
event = "VeryLazy",
|
||||
--- @module "nvim-surround"
|
||||
--- @type user_options
|
||||
opts = {
|
||||
move_cursor = "sticky",
|
||||
},
|
||||
config = true,
|
||||
}
|
||||
|
||||
15
nvim/dot-config/nvim/lua/plugins/symbols-outline.lua
Normal file
15
nvim/dot-config/nvim/lua/plugins/symbols-outline.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
-- 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 = {},
|
||||
}
|
||||
@@ -1,17 +1,21 @@
|
||||
-- https://github.com/nvim-telescope/telescope.nvim
|
||||
local window = require("symbols.window")
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
-- TODO: Ensure installed ripgrep
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
cmd = { "Telescope" },
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
cond = function()
|
||||
return vim.fn.executable("make") == 1
|
||||
end,
|
||||
},
|
||||
opts = function()
|
||||
return {
|
||||
},
|
||||
config = function()
|
||||
require("telescope").setup({
|
||||
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true,
|
||||
@@ -23,127 +27,66 @@ return {
|
||||
},
|
||||
mappings = {
|
||||
n = {
|
||||
["<Tab>"] = "move_selection_worse",
|
||||
["<S-Tab>"] = "move_selection_better",
|
||||
["<S-Tab>"] = "move_selection_next",
|
||||
["<Tab>"] = "move_selection_previous",
|
||||
},
|
||||
i = {
|
||||
["<Tab>"] = "move_selection_worse",
|
||||
["<S-Tab>"] = "move_selection_better",
|
||||
["<S-Tab>"] = "move_selection_next",
|
||||
["<Tab>"] = "move_selection_previous",
|
||||
},
|
||||
},
|
||||
borderchars = window.borderchars,
|
||||
borderchars = require("symbols.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" })
|
||||
})
|
||||
|
||||
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><space>",
|
||||
require("telescope.builtin").buffers,
|
||||
{ desc = "[ ] Find existing 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" })
|
||||
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" })
|
||||
end, { desc = "[S]earch [/] 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>sf", require("telescope.builtin").find_files, { desc = "[S]earch [F]iles" })
|
||||
vim.keymap.set("n", "<leader>sh", require("telescope.builtin").help_tags, { desc = "[S]earch [H]elp" })
|
||||
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" })
|
||||
end, { desc = "[S]earch current [W]ord" })
|
||||
vim.keymap.set("n", "<leader>sg", require("telescope.builtin").live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", require("telescope.builtin").diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
vim.keymap.set("n", "<leader>sr", require("telescope.builtin").resume, { desc = "[S]earch [R]esume" })
|
||||
vim.keymap.set("n", "<leader>sk", require("telescope.builtin").keymaps, { desc = "[S]earch [K]eymaps" })
|
||||
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, { desc = "[S]earch [N]eovim files" })
|
||||
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",
|
||||
{
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
opts = function(_, opts)
|
||||
local palette = require("gruvbox").palette
|
||||
|
||||
opts.overrides.Directory = { fg = palette.neutral_blue, bold = false }
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,16 +1,32 @@
|
||||
-- https://github.com/folke/todo-comments.nvim
|
||||
local diagnostic = require("symbols.diagnostic")
|
||||
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
-- 'folke/todo-comments.nvim',
|
||||
-- NOTE: This fork highlights the entire matched word, not just the keyword.
|
||||
"doongjohn/todo-comments.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
signs = false,
|
||||
config = function()
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("todo-comments").jump_next()
|
||||
end, { desc = "Next todo comment" })
|
||||
|
||||
vim.keymap.set("n", "[t", function()
|
||||
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 = "[S]earch [T]odo" })
|
||||
end
|
||||
|
||||
require("todo-comments").setup({
|
||||
keywords = {
|
||||
-- FIX: Fix
|
||||
FIX = { icon = diagnostic.bug },
|
||||
@@ -19,7 +35,7 @@ return {
|
||||
-- HACK: Hack
|
||||
HACK = { icon = diagnostic.hack },
|
||||
-- WARN: Warn
|
||||
WARN = { icon = diagnostic.warn },
|
||||
WARN = { icon = diagnostic.warning },
|
||||
-- PERF: Perf
|
||||
PERF = { icon = diagnostic.performance },
|
||||
-- NOTE: Note
|
||||
@@ -44,22 +60,6 @@ return {
|
||||
test = { "TodoCommentTest" },
|
||||
default = { "TodoCommentDefault" },
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("todo-comments").jump_next()
|
||||
end, { desc = "Next todo comment" })
|
||||
|
||||
vim.keymap.set("n", "[t", function()
|
||||
require("todo-comments").jump_prev()
|
||||
end, { desc = "Previous todo comment" })
|
||||
|
||||
-- -- 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" })
|
||||
|
||||
vim.keymap.set("n", "<leader>st", function()
|
||||
require("telescope").extensions["todo-comments"].todo()
|
||||
end, { desc = "Search todo" })
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
-- 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 = "master" },
|
||||
{ "windwp/nvim-ts-autotag", opts = {} },
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
lazy = false,
|
||||
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 = {
|
||||
-- Add languages to be installed here that you want installed for treesitter
|
||||
ensure_installed = {
|
||||
"c",
|
||||
"cpp",
|
||||
@@ -34,11 +24,9 @@ return {
|
||||
"markdown_inline",
|
||||
"bash",
|
||||
"sql",
|
||||
"xml",
|
||||
"cmake",
|
||||
"json",
|
||||
"yaml",
|
||||
},
|
||||
|
||||
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
||||
auto_install = true,
|
||||
|
||||
highlight = { enable = true },
|
||||
@@ -46,9 +34,10 @@ return {
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<M-o>",
|
||||
node_incremental = "<M-o>",
|
||||
node_decremental = "<M-i>",
|
||||
init_selection = "<c-space>",
|
||||
node_incremental = "<c-space>",
|
||||
scope_incremental = "<c-s>",
|
||||
node_decremental = "<M-space>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
@@ -98,6 +87,19 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
require("nvim-treesitter.install").update({ with_sync = true })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
opts = {
|
||||
separator = require("symbols.window").borderchars[3],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
-- 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" },
|
||||
},
|
||||
--- @module "trouble"
|
||||
--- @type trouble.Config
|
||||
opts = {
|
||||
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,
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
-- 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' },
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,63 +1,23 @@
|
||||
-- https://github.com/folke/which-key.nvim
|
||||
local window = require("symbols.window")
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
-- "folke/which-key.nvim",
|
||||
"cameronr/which-key.nvim",
|
||||
branch = "winborder-support",
|
||||
event = "VeryLazy",
|
||||
--- @module "which-key"
|
||||
--- @type wk.Opts
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
preset = "modern",
|
||||
delay = function(ctx)
|
||||
return ctx.plugin and 0 or 500
|
||||
window = {
|
||||
border = "single",
|
||||
margin = { 1, 5, 2, 3 },
|
||||
padding = { 0, 0, 0, 0 },
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
-- TODO: Only make a category show up if there actually are any keybinds under it
|
||||
require("which-key").register({
|
||||
["<leader>g"] = { name = "[G]it", _ = "which_key_ignore" },
|
||||
["<leader>b"] = { name = "[B]buffer", _ = "which_key_ignore" },
|
||||
["<leader>s"] = { name = "[S]earch", _ = "which_key_ignore" },
|
||||
["<leader>c"] = { name = "[C]ode", _ = "which_key_ignore" },
|
||||
["<leader>d"] = { name = "[D]ocument", _ = "which_key_ignore" },
|
||||
["<leader>w"] = { name = "[W]orkspace", _ = "which_key_ignore" },
|
||||
["<leader>r"] = { name = "[R]e[N]ame", _ = "which_key_ignore" },
|
||||
})
|
||||
end,
|
||||
win = {
|
||||
border = window.border,
|
||||
padding = { 1, 1 },
|
||||
title = false,
|
||||
},
|
||||
icons = {
|
||||
mappings = false,
|
||||
colors = false,
|
||||
keys = {
|
||||
Up = "<u> ",
|
||||
Down = "<d> ",
|
||||
Left = "<l> ",
|
||||
Right = "<r> ",
|
||||
C = "<c> ",
|
||||
M = "<m> ",
|
||||
S = "<s> ",
|
||||
CR = "<cr> ",
|
||||
Esc = "<esc> ",
|
||||
BS = "<bs>",
|
||||
Space = "<space> ",
|
||||
Tab = "<tab> ",
|
||||
F1 = "<F1> ",
|
||||
F2 = "<F2> ",
|
||||
F3 = "<F3> ",
|
||||
F4 = "<F4> ",
|
||||
F5 = "<F5> ",
|
||||
F6 = "<F6> ",
|
||||
F7 = "<F7> ",
|
||||
F8 = "<F8> ",
|
||||
F9 = "<F9> ",
|
||||
F10 = "<F10> ",
|
||||
F11 = "<F11> ",
|
||||
F12 = "<F12> ",
|
||||
},
|
||||
},
|
||||
expand = 1,
|
||||
sort = { "alphanum" },
|
||||
spec = {
|
||||
{ "<leader>b", group = "Buffer" },
|
||||
{ "<leader>d", group = "Doument" },
|
||||
{ "<leader>g", group = "Git" },
|
||||
{ "<leader>t", group = "Toggle" },
|
||||
{ "<leader>s", group = "Search" },
|
||||
{ "gr", group = "LSP" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
19
nvim/dot-config/nvim/lua/plugins/whitespace.lua
Normal file
19
nvim/dot-config/nvim/lua/plugins/whitespace.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
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,
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
-- Symbols to use for diagnostics
|
||||
return {
|
||||
-- LSP Status symbols
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
[vim.diagnostic.severity.HINT] = "",
|
||||
error = "",
|
||||
warn = "",
|
||||
info = "",
|
||||
|
||||
@@ -4,11 +4,11 @@ return {
|
||||
added = '✚',
|
||||
modified = '●',
|
||||
deleted = '✖',
|
||||
renamed = '',
|
||||
renamed = '',
|
||||
-- Status type
|
||||
untracked = '',
|
||||
ignored = '',
|
||||
unstaged = '',
|
||||
staged = '',
|
||||
ignored = '',
|
||||
unstaged = '',
|
||||
staged = '',
|
||||
conflict = '',
|
||||
}
|
||||
|
||||
@@ -1,31 +1,21 @@
|
||||
-- https://github.com/ellisonleao/gruvbox.nvim
|
||||
--- @module "lazy"
|
||||
--- @type LazySpec
|
||||
return {
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
priority = 1000,
|
||||
config = function(_, opts)
|
||||
require("gruvbox").setup(opts)
|
||||
|
||||
-- Load the colorscheme
|
||||
vim.cmd.colorscheme("gruvbox")
|
||||
end,
|
||||
opts = function()
|
||||
config = function()
|
||||
local palette = require("gruvbox").palette
|
||||
|
||||
return {
|
||||
require("gruvbox").setup({
|
||||
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" },
|
||||
NormalFloat = { bg = palette.dark0 },
|
||||
FloatBorder = { fg = palette.dark4 },
|
||||
LspInfoBorder = { link = "FloatBorder" },
|
||||
TelescopePromptTitle = { fg = palette.light4 },
|
||||
TelescopePromptBorder = { link = "FloatBorder" },
|
||||
TelescopePromptPrefix = { fg = palette.bright_red },
|
||||
@@ -36,14 +26,12 @@ return {
|
||||
TelescopeMatching = { fg = palette.bright_aqua, bold = true },
|
||||
TelescopeSelection = { fg = palette.bright_blue },
|
||||
TelescopeSelectionCaret = { link = "TelescopeSelection" },
|
||||
BlinkCmpMenu = { fg = palette.dark2 },
|
||||
BlinkCmpMenuBorder = { fg = palette.dark4 },
|
||||
BlinkCmpDocBorder = { fg = palette.dark4 },
|
||||
BlinkCmpDocSeparator = { fg = palette.dark4 },
|
||||
BlinkCmpSignatureHelpBorder = { fg = palette.dark4 },
|
||||
BlinkCmpKindFunction = { fg = palette.bright_red },
|
||||
BlinkCmpMenuSelection = { fg = palette.dark0, bg = palette.bright_blue },
|
||||
LspReferenceText = { bg = palette.dark1 },
|
||||
CmpItemAbbrMatch = { fg = palette.bright_aqua, bold = true },
|
||||
CmpItemAbbrMatchFuzzy = { link = "CmpItemAbbrMatch" },
|
||||
CmpItemMenu = { fg = palette.dark2 },
|
||||
CmpItemKindFunction = { fg = palette.bright_red },
|
||||
CmpSelection = { fg = palette.dark0, bg = palette.bright_blue },
|
||||
LspReferenceText = { fg = palette.dark0, bg = palette.neutral_purple },
|
||||
LspReferenceRead = { link = "LspReferenceText" },
|
||||
LspReferenceWrite = { link = "LspReferenceText" },
|
||||
TodoCommentError = { fg = palette.bright_red },
|
||||
@@ -52,37 +40,10 @@ return {
|
||||
TodoCommentHint = { fg = palette.bright_aqua },
|
||||
TodoCommentTest = { fg = palette.bright_purple },
|
||||
TodoCommentDefault = { fg = palette.bright_blue },
|
||||
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" },
|
||||
NeoTreeGitDelete = { link = "GruboxRed" },
|
||||
NeoTreeFloatTitle = { link = "TelescopePromptTitle" },
|
||||
NeoTreeTabActive = { fg = palette.dark0, bg = palette.bright_blue },
|
||||
NeoTreeTabInactive = { fg = palette.light4, bg = palette.dark2 },
|
||||
NeoTreeTabSeparatorActive = { link = "NeoTreeTabActive" },
|
||||
NeoTreeTabSeparatorInactive = { link = "NeoTreeTabInactive" },
|
||||
WhichKey = { fg = palette.bright_aqua, bold = true },
|
||||
WhichKeyDesc = { fg = palette.light1 },
|
||||
WhichKeyGroup = { fg = palette.neutral_blue, bold = true },
|
||||
NeoTreeBufferNumber = { fg = palette.bright_green, bold = true },
|
||||
NeoTreeDirectoryName = { fg = palette.neutral_blue, bold = true },
|
||||
NeoTreeRootName = { fg = palette.neutral_blue, bold = true },
|
||||
NeoTreeDirectoryIcon = { fg = palette.neutral_blue },
|
||||
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,
|
||||
}
|
||||
|
||||
75
nvim/dot-config/nvim/lua/tools.lua
Normal file
75
nvim/dot-config/nvim/lua/tools.lua
Normal file
@@ -0,0 +1,75 @@
|
||||
local tools = {}
|
||||
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
tools.servers = {
|
||||
clangd = {},
|
||||
gopls = {},
|
||||
pyright = {},
|
||||
rust_analyzer = {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
check = {
|
||||
command = "clippy",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
jsonls = {
|
||||
settings = {
|
||||
json = {
|
||||
validate = { enable = true },
|
||||
-- schemas = require("schemastore").json.schemas(),
|
||||
},
|
||||
},
|
||||
},
|
||||
yamlls = {
|
||||
settings = {
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
enable = false,
|
||||
url = "",
|
||||
},
|
||||
-- schemas = require("schemastore").yaml.schemas(),
|
||||
},
|
||||
},
|
||||
},
|
||||
taplo = {},
|
||||
neocmake = {},
|
||||
nil_ls = {},
|
||||
typos_lsp = {
|
||||
init_options = {
|
||||
diagnosticSeverity = "Hint",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- https://github.com/stevearc/conform.nvim
|
||||
tools.formatters = require("util.conform").assign_formatters({
|
||||
{ { "c", "cpp" }, { "clang-format" } },
|
||||
go = { "goimports", "gofmt" },
|
||||
python = { "ruff_format" },
|
||||
rust = { "rustfmt" },
|
||||
{
|
||||
{ "javascript", "typescript", "typescriptreact", "javascriptreact", "css", "markdown", "yaml" },
|
||||
{ "prettierd" },
|
||||
},
|
||||
lua = { "stylua" },
|
||||
json = { "jq" },
|
||||
toml = { "taplo" },
|
||||
nix = { "nixfmt" },
|
||||
["*"] = { "injected" },
|
||||
["_"] = { "trim_whitespace", "trim_newlines" },
|
||||
})
|
||||
|
||||
-- https://mason-registry.dev/registry/list
|
||||
tools.extra = {}
|
||||
|
||||
return tools
|
||||
18
nvim/dot-config/nvim/lua/util/conform.lua
Normal file
18
nvim/dot-config/nvim/lua/util/conform.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
-- Helper function for assigning formatters to multiple languages at the same time
|
||||
local M = {}
|
||||
|
||||
function M.assign_formatters(input)
|
||||
local table = {}
|
||||
for k, v in pairs(input) do
|
||||
if type(k) == "number" then
|
||||
for _, lang in pairs(v[1]) do
|
||||
table[lang] = v[2]
|
||||
end
|
||||
else
|
||||
table[k] = v
|
||||
end
|
||||
end
|
||||
return table
|
||||
end
|
||||
|
||||
return M
|
||||
162
nvim/dot-config/nvim/lua/util/mason.lua
Normal file
162
nvim/dot-config/nvim/lua/util/mason.lua
Normal file
@@ -0,0 +1,162 @@
|
||||
-- Based on: https://github.com/zapling/mason-conform.nvim
|
||||
-- conform formatter to mason package mapping
|
||||
-- https://mason-registry.dev/registry/list
|
||||
local conform_to_mason = {
|
||||
-- alejandra
|
||||
["asmfmt"] = "asmfmt",
|
||||
["ast-grep"] = "ast-grep",
|
||||
-- astyle
|
||||
-- auto_optional
|
||||
-- autocorrect
|
||||
["autoflake"] = "autoflake",
|
||||
["autopep8"] = "autopep8",
|
||||
-- awk
|
||||
-- bean-format
|
||||
["beautysh"] = "beautysh",
|
||||
["bibtex-tidy"] = "bibtex-tidy",
|
||||
-- biome-check
|
||||
["biome"] = "biome",
|
||||
["black"] = "black",
|
||||
["blade-formatter"] = "blade-formatter",
|
||||
["blue"] = "blue",
|
||||
["buf"] = "buf",
|
||||
["buildifier"] = "buildifier",
|
||||
["cbfmt"] = "cbfmt",
|
||||
["clang-format"] = "clang-format",
|
||||
-- cljstyle
|
||||
["cmake_format"] = "cmakelang",
|
||||
["codespell"] = "codespell",
|
||||
["csharpier"] = "csharpier",
|
||||
-- cue_fmt
|
||||
["darker"] = "darker",
|
||||
-- dart_format
|
||||
["deno_fmt"] = "deno",
|
||||
-- dfmt
|
||||
["djlint"] = "djlint",
|
||||
["dprint"] = "dprint",
|
||||
["easy-coding-standard"] = "easy-coding-standard",
|
||||
["elm_format"] = "elm-format",
|
||||
-- erb_format
|
||||
["eslint_d"] = "eslint_d",
|
||||
["fantomas"] = "fantomas",
|
||||
-- fish_indent
|
||||
["fixjson"] = "fixjson",
|
||||
-- fnlfmt
|
||||
["fourmolu"] = "fourmolu",
|
||||
["gci"] = "gci",
|
||||
["gdformat"] = "gdtoolkit",
|
||||
["gersemi"] = "gersemi",
|
||||
-- gn
|
||||
-- gofmt
|
||||
["gofumpt"] = "gofumpt",
|
||||
["goimports-reviser"] = "goimports-reviser",
|
||||
["goimports"] = "goimports",
|
||||
["golines"] = "golines",
|
||||
["google-java-format"] = "google-java-format",
|
||||
["htmlbeautifier"] = "htmlbeautifier",
|
||||
-- indent
|
||||
-- init
|
||||
-- injected
|
||||
["isort"] = "isort",
|
||||
["joker"] = "joker",
|
||||
["jq"] = "jq",
|
||||
["jsonnetfmt"] = "jsonnetfmt",
|
||||
-- just
|
||||
["ktlint"] = "ktlint",
|
||||
["latexindent"] = "latexindent",
|
||||
["markdown-toc"] = "markdown-toc",
|
||||
["markdownlint-cli2"] = "markdownlint-cli2",
|
||||
["markdownlint"] = "markdownlint",
|
||||
["mdformat"] = "mdformat",
|
||||
["mdslw"] = "mdslw",
|
||||
-- mix
|
||||
-- nixfmt
|
||||
["nixpkgs_fmt"] = "nixpkgs-fmt",
|
||||
["ocamlformat"] = "ocamlformat",
|
||||
-- opa_fmt
|
||||
-- packer_fmt
|
||||
-- pangu
|
||||
-- perlimports
|
||||
-- perltidy
|
||||
-- pg_format
|
||||
["php_cs_fixer"] = "php-cs-fixer",
|
||||
["phpcbf"] = "phpcbf",
|
||||
-- phpinsights
|
||||
["pint"] = "pint",
|
||||
["prettier"] = "prettier",
|
||||
["prettierd"] = "prettierd",
|
||||
["pretty-php"] = "pretty-php",
|
||||
-- puppet-lint
|
||||
["reorder-python-imports"] = "reorder-python-imports",
|
||||
-- rescript-format
|
||||
["rubocop"] = "rubocop",
|
||||
["rubyfmt"] = "rubyfmt",
|
||||
-- ruff
|
||||
["ruff_fix"] = "ruff",
|
||||
["ruff_format"] = "ruff",
|
||||
["rufo"] = "rufo",
|
||||
-- NOTE: Should install through rustup instead
|
||||
-- ["rustfmt"] = "rustfmt",
|
||||
["rustywind"] = "rustywind",
|
||||
-- scalafmt
|
||||
["shellcheck"] = "shellcheck",
|
||||
["shellharden"] = "shellharden",
|
||||
["shfmt"] = "shfmt",
|
||||
["sql_formatter"] = "sql-formatter",
|
||||
["sqlfluff"] = "sqlfluff",
|
||||
["sqlfmt"] = "sqlfmt",
|
||||
-- squeeze_blanks
|
||||
["standardjs"] = "standardjs",
|
||||
["standardrb"] = "standardrb",
|
||||
["stylelint"] = "stylelint",
|
||||
-- styler
|
||||
["stylua"] = "stylua",
|
||||
-- swift_format
|
||||
-- swiftformat
|
||||
["taplo"] = "taplo",
|
||||
["templ"] = "templ",
|
||||
-- terraform_fmt
|
||||
-- terragrunt_hclfmt
|
||||
["tlint"] = "tlint",
|
||||
-- trim_newlines
|
||||
-- trim_whitespace
|
||||
-- twig-cs-fixer
|
||||
["typos"] = "typos",
|
||||
-- typstfmt
|
||||
-- uncrustify
|
||||
["usort"] = "usort",
|
||||
["xmlformat"] = "xmlformatter",
|
||||
-- xmllint
|
||||
["yamlfix"] = "yamlfix",
|
||||
["yamlfmt"] = "yamlfmt",
|
||||
["yapf"] = "yapf",
|
||||
["yq"] = "yq",
|
||||
-- zigfmt
|
||||
["zprint"] = "zprint",
|
||||
}
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.process_formatters(formatters_by_ft)
|
||||
local formatters_to_install = {}
|
||||
for _, formatters in pairs(formatters_by_ft) do
|
||||
for _, formatter in pairs(formatters) do
|
||||
if type(formatter) == "table" then
|
||||
for _, f in pairs(formatter) do
|
||||
local package = conform_to_mason[f]
|
||||
if package ~= nil then
|
||||
formatters_to_install[package] = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
local package = conform_to_mason[formatter]
|
||||
if package ~= nil then
|
||||
formatters_to_install[package] = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return vim.tbl_keys(formatters_to_install)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -1,4 +1,3 @@
|
||||
; extends
|
||||
(macro_invocation
|
||||
(scoped_identifier
|
||||
path: (identifier) @path (#eq? @path "sqlx")
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
; extends
|
||||
; Dockerfile snippets for AIM pipeline
|
||||
(block_mapping_pair
|
||||
key: (flow_node) @_template
|
||||
(#eq? @_template "template")
|
||||
value: (block_node
|
||||
(block_scalar) @injection.content
|
||||
(#set! injection.language "dockerfile")
|
||||
(#offset! @injection.content 0 1 0 0)))
|
||||
|
||||
(block_mapping_pair
|
||||
key: (flow_node) @_template
|
||||
(#eq? @_template "entrypoint")
|
||||
value: (block_node
|
||||
(block_scalar) @injection.content
|
||||
(#set! injection.language "bash")
|
||||
(#offset! @injection.content 0 1 0 0)))
|
||||
@@ -1 +0,0 @@
|
||||
setup
|
||||
@@ -1,22 +0,0 @@
|
||||
# Scratch sessions rename themselves to something unique
|
||||
[[session]]
|
||||
name = "scratch"
|
||||
startup_command = "tmux rename-session scratch-$(echo -n $(date) | sha256sum | cut -c1-4) && 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"
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/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
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/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
|
||||
@@ -1,2 +1,2 @@
|
||||
gruvbox.conf
|
||||
tpm
|
||||
tpm/
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
# Plugins
|
||||
set -g @plugin 'mrjones2014/smart-splits.nvim'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'wfxr/tmux-fzf-url'
|
||||
|
||||
# Settings
|
||||
set -g default-terminal "xterm-256color"
|
||||
set -ag terminal-overrides ",xterm-256color:RGB"
|
||||
setw -g monitor-activity on
|
||||
setw -g aggressive-resize on
|
||||
setw -g automatic-rename on
|
||||
set -s escape-time 0
|
||||
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
|
||||
|
||||
set -g @fzf-url-fzf-options '-p'
|
||||
set-option -g focus-events on
|
||||
|
||||
# Setup vi-mode with better keybindings
|
||||
# TODO: Escape does not work properly for leaving
|
||||
@@ -28,27 +20,29 @@ unbind C-b
|
||||
set -g prefix C-a
|
||||
|
||||
# Improve navigation between tmux and nvim
|
||||
set -g @smart-splits_no_wrap '' # to disable wrapping. (any value disables wrapping)
|
||||
# TODO: Disable pane selection wrap
|
||||
bind-key -n M-h if -F "#{@pane-is-vim}" 'send-keys M-h' "run '#{select_pane_no_wrap} L'"
|
||||
bind-key -n M-j if -F "#{@pane-is-vim}" 'send-keys M-j' "run '#{select_pane_no_wrap} D'"
|
||||
bind-key -n M-k if -F "#{@pane-is-vim}" 'send-keys M-k' "run '#{select_pane_no_wrap} U'"
|
||||
bind-key -n M-l if -F "#{@pane-is-vim}" 'send-keys M-l' "run '#{select_pane_no_wrap} R'"
|
||||
|
||||
set -g @smart-splits_move_left_key 'M-h' # key-mapping for navigation.
|
||||
set -g @smart-splits_move_down_key 'M-j' # --"--
|
||||
set -g @smart-splits_move_up_key 'M-k' # --"--
|
||||
set -g @smart-splits_move_right_key 'M-l' # --"--
|
||||
|
||||
set -g @smart-splits_resize_left_key 'M-left' # key-mapping for resizing.
|
||||
set -g @smart-splits_resize_down_key 'M-down' # --"--
|
||||
set -g @smart-splits_resize_up_key 'M-up' # --"--
|
||||
set -g @smart-splits_resize_right_key 'M-right' # --"--
|
||||
bind-key -T copy-mode-vi 'M-h' select-pane -L
|
||||
bind-key -T copy-mode-vi 'M-j' select-pane -D
|
||||
bind-key -T copy-mode-vi 'M-k' select-pane -U
|
||||
bind-key -T copy-mode-vi 'M-l' select-pane -R
|
||||
|
||||
# Custom keybinds
|
||||
bind s split-window -c "#{pane_current_path}"
|
||||
bind v split-window -h -c "#{pane_current_path}"
|
||||
bind '"' split-window -c "#{pane_current_path}"
|
||||
bind % split-window -h -c "#{pane_current_path}"
|
||||
bind -n C-j new-window -c "#{pane_current_path}"
|
||||
bind -n C-h prev
|
||||
bind -n C-l next
|
||||
bind -n C-M-l swap-window -t +1 \; next
|
||||
bind -n C-M-h swap-window -t -1 \; prev
|
||||
|
||||
# Keybind for reloading config
|
||||
bind r source-file $DOTFILES/tmux/dot-tmux.conf \; display-message "Config reloaded..."
|
||||
|
||||
bind -T root F12 \
|
||||
set prefix None \;\
|
||||
set key-table off \;\
|
||||
@@ -65,21 +59,6 @@ wg_is_keys_off="#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'TRUE' )
|
||||
# Load theme
|
||||
source-file "$DOTFILES/tmux/gruvbox.conf"
|
||||
|
||||
set -g @plugin "dalejung/tmux-select-pane-no-wrap"
|
||||
|
||||
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
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
ohmyzsh
|
||||
custom
|
||||
fzf-git.sh
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#compdef tula
|
||||
|
||||
_tula_completion() {
|
||||
eval $(env _TYPER_COMPLETE_ARGS="${words[1,$CURRENT]}" _TULA_COMPLETE=complete_zsh tula)
|
||||
}
|
||||
|
||||
compdef _tula_completion tula
|
||||
Submodule zsh/custom/plugins/fast-syntax-highlighting deleted from 3d574ccf48
Submodule zsh/custom/plugins/zsh-autopair deleted from 449a7c3d09
Submodule zsh/custom/plugins/zsh-autosuggestions updated: 85919cd1ff...c3d4e576c9
Submodule zsh/custom/plugins/zsh-completions deleted from b48b5de9d8
Submodule zsh/custom/plugins/zsh-vi-mode deleted from 08bd1c0452
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user