Compare commits

...
16 Commits
12 changed files with 302 additions and 34 deletions

No files matched your search

+25
View File
@@ -8,4 +8,29 @@ vim.g.blamer_template = "<author>, <committer-time> • <summary>" -- Example: C
vim.g.blamer_relative_time = true
vim.g.blamer_enabled = true
vim.g.blamer_show_in_visual_modes = 0
vim.opt.shell = "bash"
vim.opt.termguicolors = true
-- Create a custom :term command that passes Kitty's custom environment variables
vim.api.nvim_create_user_command("Term", function()
-- 1. Grab Kitty's installation path from your current terminal environment
local kitty_install = os.getenv("KITTY_INSTALLATION_DIR")
-- 2. Build the manual injection loader path Kitty requires
local kitty_bash_injection = kitty_install and (kitty_install .. "/shell-integration/bash/kitty.bash") or ""
-- 3. Open a clean terminal, tell Kitty it is safe to interact, and map it
if kitty_install ~= nil and kitty_install ~= "" then
-- Run Bash but explicitly inject the environment loader before anything else handles it
vim.cmd(string.format("terminal env KITTY_SHELL_INTEGRATION=enabled bash --rcfile %s -i", kitty_bash_injection))
else
-- Fallback safe method if Kitty environment path variables are empty
vim.cmd("terminal bash -il")
end
end, { force = true })
-- Make sure lowercase ':term' also maps to our special alignment function
vim.cmd([[cabbrev term Term]])
require("config.lazy")
+11 -8
View File
@@ -1,28 +1,30 @@
{
"Aquavium.nvim": { "branch": "main", "commit": "d007badfa5920cb50e136d30a3edf4342093d6b5" },
"alpha-nvim": { "branch": "main", "commit": "4ba26e41990c11620c96c0e1cff20eab65efde4a" },
"alpha-nvim": { "branch": "main", "commit": "6c6a89d5b068b5251c8bdf0dd57bb921bcfeeb09" },
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
"blamer.nvim": { "branch": "master", "commit": "e0d43c11697300eb68f00d69df8b87deb0bf52dc" },
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
"bluloco.nvim": { "branch": "main", "commit": "294aa5ac5e639f36ab5db9729ac7583c37d896dc" },
"codecompanion.nvim": { "branch": "main", "commit": "dfc13a20214b825d867ae69b8497eed723cf026d" },
"codecompanion.nvim": { "branch": "main", "commit": "d4c00c29ffa49a9eda117099916168e32aa12e09" },
"conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" },
"contextfiles.nvim": { "branch": "main", "commit": "d5d0525c32777366e5c415fdb682444ce9f753f8" },
"csvview.nvim": { "branch": "main", "commit": "f190de76d2eca0380ddcb2425cd582d740699b55" },
"dracula.nvim": { "branch": "main", "commit": "ae752c13e95fb7c5f58da4b5123cb804ea7568ee" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"everforest-nvim": { "branch": "main", "commit": "a0e9edc57379e8feafc6ba207c26dbb12fc1b6d8" },
"farba.nvim": { "branch": "main", "commit": "a15528695f38a44ba2974b9aae5d6ddf8c694ea2" },
"fidget.nvim": { "branch": "main", "commit": "9e0201673e08e997e7cf52afca5565c70bd117f3" },
"friendly-snippets": { "branch": "main", "commit": "a5a73e586521fe5c12d751ad81a0db67649a94ed" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"fzf-lua": { "branch": "main", "commit": "05e44d38de0a79c11fba5f7bf8138791b1dbdd1e" },
"gitsigns.nvim": { "branch": "main", "commit": "f2421c550618d257048afa650413d9e542ddbe67" },
"gitsigns.nvim": { "branch": "main", "commit": "5be654f2232c10ddcad19c1607a67b6b4b78fc29" },
"gruvbox-material": { "branch": "master", "commit": "11d779b26a9ab2b3db8c22c6ac9fb6e8ed4fea79" },
"indent-blankline.nvim": { "branch": "master", "commit": "f1e186e44d3b7f9ae918008e2c28ce37c6023d2d" },
"indent-blankline.nvim": { "branch": "master", "commit": "3b1ee1854c1067c34cad2423eb78e280d4069e01" },
"kanagawa.nvim": { "branch": "master", "commit": "bb85e4bfc8d89b0e62c8fa53ccdd13d12e2f77b3" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" },
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
"lush.nvim": { "branch": "main", "commit": "9c60ec2279d62487d942ce095e49006af28eed6e" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "b5576cd62899a1a478d0e67ef3d378ee55dba82d" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "40276c4df7e6bdce6801d6c035c6227f9115a855" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
@@ -36,15 +38,16 @@
"nvim-dap": { "branch": "master", "commit": "c9a0738e45f1bd41d792a126941348dce661cf9b" },
"nvim-dap-ui": { "branch": "master", "commit": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-lspconfig": { "branch": "master", "commit": "ac9d2f7c4757db6320cab6697fe73e5e8adb2457" },
"nvim-lspconfig": { "branch": "master", "commit": "85e732c62ac59ab7c12df71ddd020baa87948390" },
"nvim-nio": { "branch": "master", "commit": "edcc181a875301dd21840189aa2f2f9ad69fc172" },
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
"nvim-treesitter": { "branch": "main", "commit": "d4d59cb369da46b95699bd2200efbcffc6dadb3b" },
"nvim-treesitter": { "branch": "main", "commit": "427e9222363d07c32d6db6169e4049c28d58d141" },
"nvim-web-devicons": { "branch": "master", "commit": "5f032a85be210cd1c6ac98861eb3b187ff3bd5eb" },
"oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"render-markdown.nvim": { "branch": "main", "commit": "4663eb3ecd538bd5062628fb6d95bbe6bdca78f6" },
"telescope.nvim": { "branch": "master", "commit": "40aedd8a68c78a656a10a8d62d80c54af59420fb" },
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
"venv-selector.nvim": { "branch": "main", "commit": "cc4bb3975de8835291f9bb45889e96c6b2795fc4" },
"vesper.nvim": { "branch": "main", "commit": "1717b1ad657c94bec3fc2bdebb0c55452d9fe46d" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
+13
View File
@@ -8,6 +8,19 @@ vim.keymap.set("n", "<Leader>h", "<cmd>:noh<CR>", {desc = "Remove current highli
-- Exit terminal mode easily with Escape
vim.keymap.set('t', '<Esc>', [[<C-\><C-n>]], { desc = 'Exit terminal mode' })
-- In lazygit, keep every key inside the terminal so only Ctrl+C (handled by
-- lazygit itself) can close it -- no nvim key drops you into normal mode.
vim.api.nvim_create_autocmd("TermOpen", {
callback = function()
if vim.fn.expand("%"):match("lazygit") then
-- let <Esc> pass through to lazygit instead of exiting terminal mode
vim.keymap.set('t', '<Esc>', '<Esc>', { buffer = true })
-- disable the built-in exit-terminal-mode chord
vim.keymap.set('t', [[<C-\><C-n>]], '<nop>', { buffer = true })
end
end,
})
vim.keymap.set("v", "<Leader>y", '"+y', {desc='Yank to "+ register for external copy/paste'})
--CODE/LSP
+3
View File
@@ -45,6 +45,9 @@ require("lazy").setup({
})
vim.cmd("colorscheme " .. colScheme.name);
vim.api.nvim_set_hl(0, "alphaheader", {fg = "#3661cf" })
if (colScheme.name == "rose-pine") then
vim.api.nvim_set_hl(0, "NotifyBackground", { bg = "#232136" })
end
--setup colour indents
local highlight = {
+25 -10
View File
@@ -1,14 +1,5 @@
local opts = {
name = "everforest",
opts = {
everforest,
kanagawa,
marterial,
}
}
local everforest = {
name = "everforest",
transparent = 0,--0, 1 or 2, least to most transparent
}
@@ -16,10 +7,34 @@ local kanagawa = {
transparent = true,
}
local marterial = {
local material = {
disable = {
background = true,
}
}
local rosepine = {
styles = {
transparency = true,
}
}
local gruvbox = {
transparent = 1,
}
local tokyonight = {
}
local opts = {
name = "rose-pine",
opts = {
everforest=everforest,
kanagawa=kanagawa,
material=material,
rosepine=rosepine,
gruvbox=gruvbox,
}
}
return opts
+21 -10
View File
@@ -10,7 +10,7 @@ local material = {
--vim.g.material_style = "palenight"
material.setup({
lualine_style = "default", -- Lualine style ( can be 'stealth' or 'default' )
disable = ignores[1],
disable = ignores.opts.material.disable,
custom_highlights = {
Comment = { fg = "#b7b0bf" },
LineNr = { fg = "#b7b0bf" },
@@ -54,7 +54,7 @@ local kanagawa = {
theme = "lotus",
compile = true,
commentStyle = { italic = true },
transparent = ignores.transparent,
transparent = ignores.opts.kanagawa.transparent,
colors = {
--palette = {
-- -- change all usages of these colors
@@ -96,7 +96,7 @@ local everforest = {
local ignore = require('ignoreConfig.colourConfig');
everforest.setup({
background = "hard",
transparent_background_level = ignore.transparent,
transparent_background_level = ignore.opts.everforest.transparent,
italics = true,
});
@@ -113,17 +113,18 @@ local rosepine = {
lazy = true,
config = function()
local rosepine = require("rose-pine");
local ignore = require('ignoreConfig.colourConfig');
rosepine.setup({
variant = "moon", -- Options: "main", "moon", "dawn"
dark_variant = "moon",
bold_vert_split = false,
dim_nc_background = false,
disable_background = false,
disable_float_background = false,
disable_italics = false,
styles = {
bold = true,
italic = true,
transparency = ignore.opts.rosepine.styles.transparency,
},
groups = {
background = "base",
--background = "base",
panel = "surface",
border = "highlight_low",
comment = "muted",
@@ -299,13 +300,22 @@ local gruvbox = {
lazy = false,
priority = 1000,
config = function()
local ignores = require('ignoreConfig.colourConfig')
-- Optionally configure and load the colorscheme
-- directly inside the plugin declaration.
vim.g.gruvbox_material_transparent_background = ignores.opts.gruvbox.transparent
vim.g.gruvbox_material_enable_italic = true
--vim.cmd.colorscheme('gruvbox-material')
end
}
local tokyonight = {
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opts = {
},
}
return {
material,
@@ -318,5 +328,6 @@ return {
bluloco,
farba,
wisteria,
gruvbox
gruvbox,
tokyonight
}
+2 -1
View File
@@ -9,5 +9,6 @@ return {
-- timeout_ms = 500,
-- lsp_format = "fallback",
--},
},
--},
}
}
+37
View File
@@ -0,0 +1,37 @@
return {
"hat0uma/csvview.nvim",
config = function()
local csvview = require("csvview")
-- Optional setup configurations
csvview.setup({
view = {
display_mode = "border", -- Options: "border", "key", "simple"
},
parser = { comments = { "#", "//" } },
keymaps = {
-- Text objects for selecting fields
textobject_field_inner = { "if", mode = { "o", "x" } },
textobject_field_outer = { "af", mode = { "o", "x" } },
-- Excel-like navigation:
-- Use <Tab> and <S-Tab> to move horizontally between fields.
-- Use <Enter> and <S-Enter> to move vertically between rows and place the cursor at the end of the field.
-- Note: In terminals, you may need to enable CSI-u mode to use <S-Tab> and <S-Enter>.
--jump_next_field_end = { "<Tab>", mode = { "n", "v" } },
--jump_prev_field_end = { "<S-Tab>", mode = { "n", "v" } },
--jump_next_row = { "<Enter>", mode = { "n", "v" } },
--jump_prev_row = { "<S-Enter>", mode = { "n", "v" } },
},
})
-- Auto-enable for csv and tsv filetypes
vim.api.nvim_create_autocmd("FileType", {
pattern = { "csv", "tsv" },
desc = "Enable CSV View on relevant filetypes",
callback = function()
csvview.enable()
end,
})
end,
}
+92 -5
View File
@@ -124,6 +124,22 @@ return {
dapui.setup()
require("nvim-dap-virtual-text").setup()
-- The dap-ui "disconnect" control (the plug icon) and dap.disconnect in
-- general send a DAP `disconnect` request. With the codelldb server
-- adapter that path crashes the adapter
-- (STATUS_ACCESS_VIOLATION / 0xC0000005, see dap.log) while the inferior
-- is still attached, and on Windows that takes Neovim down with it.
--
-- The `terminate` request path (the square Stop button / <leader>cdt)
-- tears the inferior down cleanly first, so codelldb's crash on the way
-- out is harmless. Route the disconnect control through terminate too.
-- (_G._dapui is created when dapui.controls is required; force-load it so
-- the override is in place before the controls winbar renders.)
require("dapui.controls")
_G._dapui.disconnect = function()
dap.terminate()
end
-- Automatically manage debugger installations via Mason
require("mason-nvim-dap").setup({
ensure_installed = { "codelldb", "cppdbg" }, -- Auto-installs CodeLLDB
@@ -170,7 +186,10 @@ return {
executable = {
command = codelldb_path,
args = {"--port", "${port}"},
detached = false,
-- Keep the spawned server (and any inferior it launches) off
-- Neovim's console group so terminating a session can't take
-- Neovim down on Windows. Matches the cppvsdbg adapter above.
detached = true,
}
}
@@ -187,14 +206,26 @@ return {
},
}
-- Route MSVC `cppvsdbg` launch configs (as VS/msbuild launch.json
-- generates) to codelldb. We deliberately do NOT use Microsoft's vsdbg:
-- its license permits use only within Visual Studio / VS Code. codelldb
-- is LLVM/LLDB-based (Apache-2.0) and has a native PDB reader, so it can
-- debug MSVC/msbuild binaries without that restriction.
--
-- codelldb is a TCP `server` adapter, so terminating/disconnecting
-- talks over a socket and can't broadcast a console CTRL event to
-- Neovim the way the gdb-backed cppdbg path does. detached=true keeps
-- the spawned server (and the inferior it launches) off Neovim's
-- console group too -- the original `detached = false` is what still
-- let a disconnect take Neovim down.
dap.adapters.cppvsdbg = {
type = 'server',
type = "server",
port = "${port}",
executable = {
command = codelldb_path,
args = {"--port", "${port}"},
detached = false,
}
args = { "--port", "${port}" },
detached = true,
},
}
-- 3. Platform-agnostic Launcher Configuration
@@ -237,6 +268,62 @@ return {
end
dap.configurations.c = dap.configurations.cpp
-- Unity (Mono soft debugger) via Unity's MIT-licensed vscode-unity-debug
-- adapter, extracted from its .vsix into stdpath("data")/unity-debug.
-- Avoids vstuc, whose license (like vsdbg's) is VS Code only.
--
-- UnityDebug.exe is patched by unity-debug/install.sh (see patch.cs there;
-- original kept as UnityDebug.exe.orig): stock, it only matches editor
-- processes named exactly "Unity"/"Unity Editor", but Unity Hub launches
-- the editor as "unityhub-unity-editor-<version>". The patch makes it a
-- case-insensitive "Unity" prefix match, covering both launch methods and
-- any version. Helper processes (UnityPackageManager, import workers...)
-- match too, so the adapter picks the real editor by the process_id in
-- EditorInstance.json -- which needs the config name to contain "Editor".
local unity_debug_exe = vim.fn.stdpath("data") .. "/unity-debug/extension/bin/UnityDebug.exe"
local unity_debug_install = vim.fn.stdpath("config") .. "/unity-debug/install.sh"
dap.adapters.unity = function(callback)
if vim.fn.filereadable(unity_debug_exe) == 0 then
vim.notify("Installing Unity debug adapter...")
local result = vim.system({ unity_debug_install }, { text = true }):wait()
if result.code ~= 0 then
vim.notify("Unity debug adapter install failed:\n" .. result.stderr, vim.log.levels.ERROR)
return
end
end
callback({
type = "executable",
command = "mono",
args = { unity_debug_exe },
-- The adapter strips the leading "/" from `path` (a Windows-ism)
-- before reading it, so run it from / for the now-relative path
-- to resolve.
options = { cwd = "/" },
})
end
-- Library/EditorInstance.json only exists while the editor is open; the
-- adapter reads the editor PID from it to derive the debugger port.
-- The Unity project may sit in a repo subfolder, so search upward from
-- the buffer first, then downward from cwd.
local function unity_editor_instance()
local root = vim.fs.root(0, "ProjectSettings")
if root then
return root .. "/Library/EditorInstance.json"
end
local found = vim.fs.find("EditorInstance.json", { path = vim.fn.getcwd(), type = "file", limit = 1 })
return found[1]
end
dap.configurations.cs = {
{
name = "Unity Editor",
type = "unity",
request = "launch", -- unity-debug attaches to the running editor despite "launch"
path = unity_editor_instance,
},
}
end
}
+24
View File
@@ -20,5 +20,29 @@ return {
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
-- Enable the textobjects extension
textobjects = {
move = {
enable = true,
set_jumps = true, -- Add jumps to the jumplist (:h jumplist)
goto_next_start = {
["]]"] = { query = "@function.outer", desc = "Next function definition start" },
["]c"] = { query = "@class.outer", desc = "Next class definition start" },
},
goto_previous_start = {
["[["] = { query = "@function.outer", desc = "Previous function definition start" },
["[c"] = { query = "@class.outer", desc = "Previous class definition start" },
},
goto_next_end = {
["]f"] = { query = "@function.outer", desc = "Next function definition end" },
},
goto_previous_end = {
["[f"] = { query = "@function.outer", desc = "Previous function definition end" },
},
},
},
},
}
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Installs Unity's MIT-licensed vscode-unity-debug adapter for nvim-dap and
# patches it to find editors however they were launched (see patch.cs).
# Re-runnable: always re-extracts and re-patches from the pristine .vsix.
set -euo pipefail
VERSION=3.0.1
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DEST="${1:-${XDG_DATA_HOME:-$HOME/.local/share}/nvim/unity-debug}"
BIN="$DEST/extension/bin"
for cmd in curl unzip mono mcs; do
command -v "$cmd" >/dev/null || { echo "unity-debug install: missing '$cmd'" >&2; exit 1; }
done
mkdir -p "$DEST"
VSIX="$DEST/unity-debug-$VERSION.vsix"
[ -f "$VSIX" ] || curl -fsSL -o "$VSIX" \
"https://github.com/Unity-Technologies/vscode-unity-debug/releases/download/Version-$VERSION/unity-debug-$VERSION.vsix"
rm -rf "$DEST/extension"
unzip -qo "$VSIX" -d "$DEST"
TMP="$(mktemp -d)"
trap 'rm -rf "$TMP"' EXIT
mcs "$HERE/patch.cs" -r:"$BIN/Mono.Cecil.dll" -out:"$TMP/patch.exe"
cp "$BIN/UnityDebug.exe" "$BIN/UnityDebug.exe.orig"
MONO_PATH="$BIN" mono "$TMP/patch.exe" "$BIN/UnityDebug.exe.orig" "$TMP/UnityDebug.exe"
cp "$TMP/UnityDebug.exe" "$BIN/UnityDebug.exe"
echo "unity-debug installed and patched in $DEST"
+20
View File
@@ -0,0 +1,20 @@
// Patches vscode-unity-debug's UnityProcessDiscovery.GetUnityEditorProcesses to
// prefix-match process names instead of requiring an exact "Unity"/"Unity Editor".
// The comparison is OrdinalIgnoreCase, so the "Unity" prefix then matches editors
// launched directly ("Unity") and via Unity Hub ("unityhub-unity-editor-<version>").
// Extra matches (UnityPackageManager etc.) are fine: with a config name containing
// "Editor", the adapter picks the editor by process_id from EditorInstance.json.
using System; using System.Linq; using Mono.Cecil;
class Patch {
static int Main(string[] a) {
var asm = AssemblyDefinition.ReadAssembly(a[0]);
var m = asm.MainModule.Types.SelectMany(t => t.Methods).Single(x => x.Name == "GetUnityEditorProcesses");
var startsWith = asm.MainModule.ImportReference(typeof(string).GetMethod("StartsWith", new[] { typeof(string), typeof(StringComparison) }));
int c = 0;
foreach (var i in m.Body.Instructions)
if (i.Operand is MethodReference r && r.DeclaringType.FullName == "System.String" && r.Name == "Equals" && r.Parameters.Count == 2) { i.Operand = startsWith; c++; }
if (c != 1) { Console.Error.WriteLine($"expected 1 string.Equals call in {m.Name}, found {c}"); return 1; }
asm.Write(a[1]);
return 0;
}
}