Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ Thumbs.db

# Profiling output
profile.json

# Devenv
.devenv*
devenv.local.nix
devenv.local.yaml

# direnv
.direnv
File renamed without changes.
65 changes: 65 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1789928656,
"narHash": "sha256-D7RNclo2qbp+r3wR1ac5zR+rD6eTe5LUbdVtO/jJvuA=",
"owner": "cachix",
"repo": "devenv",
"rev": "c5ee672098ceb23c694fd89fdb1ff7478ee386fa",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"nixpkgs": {
"inputs": {
"nixpkgs-src": "nixpkgs-src"
},
"locked": {
"lastModified": 1789506231,
"narHash": "sha256-vNkJbtmqyBfFhn/HnzQo4ROuoyYWuy/allqTfJb4kMY=",
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "c2f38fe7f9e04d9aadd354d380f2bd40531d9737",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-src": {
"flake": false,
"locked": {
"lastModified": 1789370336,
"narHash": "sha256-6RSEDHIWQtesQKWSu5qRai8L2h4KgCgMEfJHstW99G4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c7def046b9a883d46974757852106483d741586f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
46 changes: 46 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{ pkgs, lib, config, inputs, ... }:

{
# https://devenv.sh/basics/
env.GREET = "devenv";

# https://devenv.sh/packages/
packages = [ pkgs.git ];

# https://devenv.sh/languages/
# languages.rust.enable = true;

# https://devenv.sh/processes/
# processes.dev.exec = "${lib.getExe pkgs.watchexec} -n -- ls -la";

# https://devenv.sh/services/
# services.postgres.enable = true;

# https://devenv.sh/scripts/
scripts.hello.exec = ''
echo hello from $GREET
'';

# https://devenv.sh/basics/
enterShell = ''
hello # Run scripts directly
git --version # Use packages
'';

# https://devenv.sh/tasks/
# tasks = {
# "myproj:setup".exec = "mytool build";
# "devenv:enterShell".after = [ "myproj:setup" ];
# };

# https://devenv.sh/tests/
enterTest = ''
echo "Running tests"
git --version | grep --color=auto "${pkgs.git.version}"
'';

# https://devenv.sh/git-hooks/
# git-hooks.hooks.shellcheck.enable = true;

# See full reference at https://devenv.sh/reference/options/
}
18 changes: 18 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling

# If you're using non-OSS software, you can set allowUnfree to true.
# allowUnfree: true

# If you're not willing to allow unsupported packages:
# allowUnsupportedSystem: false

# If you're willing to use a package that's vulnerable
# permittedInsecurePackages:
# - "openssl-1.1.1w"

# If you have more than one devenv you can merge them
#imports:
# - ./backend
3 changes: 3 additions & 0 deletions lua/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ end, "Copy full file path")
map("n", "<leader>td", function()
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
end, "Toggle diagnostics")
map("n", "<leader>th", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = 0 }), { bufnr = 0 })
end, "Toggle inlay hints")

-- Vim Pack -------------------------------------------------------------------
map("n", "<leader>vu", ":lua vim.pack.update()<CR>", "Update plugins (no force)")
Expand Down
68 changes: 63 additions & 5 deletions nvim-pack-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"src": "https://github.com/L3MON4D3/LuaSnip",
"version": "2.0.0 - 3.0.0"
},
"atlas.nvim": {
"rev": "fb40953462ff922c1084f1338072588c6e0eb0bf",
"src": "https://github.com/emrearmagan/atlas.nvim"
},
"blink.cmp": {
"rev": "78336bc89ee5365633bcf754d93df01678b5c08f",
"src": "https://github.com/saghen/blink.cmp",
Expand Down Expand Up @@ -32,6 +36,11 @@
"src": "https://github.com/lewis6991/gitsigns.nvim",
"version": "'v2.1.0'"
},
"gopher.nvim": {
"rev": "f397bed1c35f29f4f85d60a210650e677a8c5cb4",
"src": "https://github.com/olexsmir/gopher.nvim",
"version": "0.0.0 - 1.0.0"
},
"image.nvim": {
"rev": "365e2ace0f619164ae6fd2f6f1d2807775dd6849",
"src": "https://github.com/3rd/image.nvim"
Expand All @@ -41,7 +50,7 @@
"src": "https://github.com/nvim-lualine/lualine.nvim"
},
"mason-lspconfig.nvim": {
"rev": "49b16d699f9ca83184330c6eb886737a27f23bdd",
"rev": "e17625cdc8c2650787467398e02c5d63a2cde966",
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
},
"mason.nvim": {
Expand All @@ -57,6 +66,16 @@
"rev": "23e7e9f883d01289ebd90e98025acc860ea26366",
"src": "https://github.com/danymat/neogen"
},
"neotest": {
"rev": "27bf921498043f7ecd821d6db68d05de244bbd02",
"src": "https://github.com/nvim-neotest/neotest",
"version": "5.0.0 - 6.0.0"
},
"neotest-golang": {
"rev": "05cd7bf89a146cf1fa2848a9fe277a1e68a3a51d",
"src": "https://github.com/fredrikaverpil/neotest-golang",
"version": "2.0.0 - 3.0.0"
},
"nvim": {
"rev": "edefef779ab08ce1a4a404713e3012b0d202bd35",
"src": "https://github.com/catppuccin/nvim"
Expand All @@ -66,21 +85,60 @@
"src": "https://github.com/windwp/nvim-autopairs",
"version": "'0.10.0'"
},
"nvim-coverage": {
"rev": "a939e425e363319d952a6c35fb3f38b34041ded2",
"src": "https://github.com/andythigpen/nvim-coverage"
},
"nvim-dap": {
"rev": "cfa2d58f4537aca6ca83e2de1a0d9f1491121264",
"src": "https://github.com/mfussenegger/nvim-dap"
},
"nvim-dap-go": {
"rev": "b4421153ead5d726603b02743ea40cf26a51ed5f",
"src": "https://github.com/leoluz/nvim-dap-go"
},
"nvim-dap-ui": {
"rev": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43",
"src": "https://github.com/rcarriga/nvim-dap-ui"
},
"nvim-dap-view": {
"rev": "210b2c0e4acc08aad23fbd5a7989dd0169f716d0",
"src": "https://github.com/igorlfs/nvim-dap-view",
"version": "1.0.0 - 2.0.0"
},
"nvim-dap-virtual-text": {
"rev": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6",
"src": "https://github.com/theHamsta/nvim-dap-virtual-text"
},
"nvim-lspconfig": {
"rev": "ffd261c09c3dabd0bf1a438f47a8ae3b22f3c3ff",
"rev": "6d27c288ff951e1e94cb5f91c800adeddf0dc0c2",
"src": "https://github.com/neovim/nvim-lspconfig"
},
"nvim-nio": {
"rev": "edcc181a875301dd21840189aa2f2f9ad69fc172",
"src": "https://github.com/nvim-neotest/nvim-nio",
"version": "1.0.0 - 2.0.0"
},
"nvim-treesitter": {
"rev": "f603a2f4da48728f80257fb5fbb90145fd1dc173",
"rev": "1a4f47b03dfe92d28de7d5654c67327ef008c9e6",
"src": "https://github.com/nvim-treesitter/nvim-treesitter",
"version": "'main'"
},
"nvim-treesitter-textobjects": {
"rev": "5c7b0263797dfd1bd6202f2b219f3b53a80b2187",
"src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects",
"version": "'main'"
},
"plenary.nvim": {
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
"src": "https://github.com/nvim-lua/plenary.nvim"
},
"pr-description.nvim": {
"rev": "d0af0074d6eec7af2b3724bc92c66163d82b29f3",
"rev": "b2737be4c1e167d3b4a2959ae40cec85fcb13865",
"src": "https://github.com/remoterabbit/pr-description.nvim"
},
"render-markdown.nvim": {
"rev": "640a3ec6d538bad17c328be373c7cad0293d9589",
"rev": "8e8795368391036643b622875a6da6a51bcd33f4",
"src": "https://github.com/MeanderingProgrammer/render-markdown.nvim"
},
"showkeys": {
Expand Down
18 changes: 18 additions & 0 deletions plugins/atlas.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
return {
src = "https://github.com/emrearmagan/atlas.nvim",
config = function()
require("atlas").setup({
ui = {
picker = "snacks",
},
providers = {
github = {},
},
keymaps = {
ui = {
submit = "<M-s>",
},
},
})
end,
}
85 changes: 85 additions & 0 deletions plugins/dap.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
--- Debugging: nvim-dap (client) + nvim-dap-go (delve adapter/configs) +
--- nvim-dap-view (UI: scopes, watches, breakpoints, threads, REPL, console).
---
--- Go: requires `dlv` on PATH (mason package `delve`, or `go install
--- github.com/go-delve/delve/cmd/dlv@latest`). Set a breakpoint with
--- <leader>Db, start with <leader>Dc and pick a configuration (Debug / Debug
--- Package / Debug test / Attach ...), or use <leader>Dt to debug the test
--- under the cursor. <leader>Ds enters step mode, where single keys
--- (n/i/o/c) step until <Esc>. The view opens/closes with the session.
---
--- Project-specific launch configs can go in `.vscode/launch.json`; nvim-dap
--- reads it automatically.
return {
{
src = "https://github.com/mfussenegger/nvim-dap",
},
{
src = "https://github.com/leoluz/nvim-dap-go",
},
{
src = "https://github.com/igorlfs/nvim-dap-view",
version = vim.version.range("1.*"),
config = function()
local dap = require("dap")

require("dap-view").setup({
auto_toggle = true,
-- Clickable play/step/stop buttons in the view's winbar.
winbar = { controls = { enabled = true } },
-- Show variable values inline in the source while stopped.
-- Long values (structs like *testing.T) are truncated; see the full
-- value in the Scopes pane or with <leader>Dw.
virtual_text = {
enabled = true,
format = function(variable)
local value = variable.value:gsub("%s+", " ")
return " " .. (#value > 50 and value:sub(1, 50) .. "…" or value)
end,
},
})
require("dap-go").setup()

vim.fn.sign_define("DapBreakpoint", { text = "●", texthl = "DiagnosticError" })
vim.fn.sign_define("DapBreakpointCondition", { text = "β—†", texthl = "DiagnosticWarn" })
vim.fn.sign_define("DapLogPoint", { text = "β—‰", texthl = "DiagnosticInfo" })
vim.fn.sign_define("DapStopped", { text = "β–Ά", texthl = "DiagnosticOk", linehl = "Visual" })

local function map(lhs, rhs, desc)
vim.keymap.set("n", lhs, rhs, { desc = desc })
end

map("<leader>Dc", dap.continue, "Start/continue")
map("<leader>Dn", dap.step_over, "Step over (next)")
map("<leader>Di", dap.step_into, "Step into")
map("<leader>Do", dap.step_out, "Step out")
-- Step mode: keeps the <leader>D menu open so stepping is one key per
-- step (n/i/o/c/b/...) until <Esc>.
map("<leader>Ds", function()
require("which-key").show({ keys = "<leader>D", loop = true })
end, "Step mode (repeat keys, <Esc> exits)")
map("<leader>Db", dap.toggle_breakpoint, "Toggle breakpoint")
map("<leader>DB", function()
dap.set_breakpoint(vim.fn.input("Condition: "))
end, "Conditional breakpoint")
map("<leader>Dl", function()
dap.set_breakpoint(nil, nil, vim.fn.input("Log message: "))
end, "Log point")
map("<leader>DC", dap.run_to_cursor, "Run to cursor")
map("<leader>Dr", dap.restart, "Restart session")
map("<leader>DL", dap.run_last, "Run last configuration")
map("<leader>Dq", dap.terminate, "Terminate session")
map("<leader>Dx", dap.clear_breakpoints, "Clear all breakpoints")
map("<leader>Du", function()
require("dap-view").toggle()
end, "Toggle debug view")
map("<leader>Dw", "<cmd>DapViewWatch<cr>", "Watch expression under cursor")
map("<leader>Dt", function()
require("dap-go").debug_test()
end, "Debug nearest Go test")
map("<leader>DT", function()
require("dap-go").debug_last_test()
end, "Debug last Go test")
end,
},
}
Loading
Loading