Skip to content

Commit

Permalink
feat(nvim): neotest
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Jan 26, 2024
1 parent 3576fbb commit 6a0e91d
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .config/nix/modules/ghostty.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ let
in
{
# https://github.com/mitchellh/ghostty/blob/main/src/config/Config.zig

# TODO: Colors and config for different color schemes
# https://github.com/mitchellh/ghostty/issues/809
# TODO: Splits
# https://github.com/mitchellh/ghostty/issues/601
xdg.configFile."ghostty/config".text = ''
copy-on-select = "clipboard"
Expand Down
1 change: 1 addition & 0 deletions .config/nix/modules/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
g = "git";
hm = "home-manager";
home = "cd ~";
i = "iex";
lsd = "eza -d .*";
m = "mix";
p = "pnpm";
Expand Down
4 changes: 4 additions & 0 deletions .config/nvim/TODO.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# TODO

neotree current file bg color
nix
noice popupmenu background

## Plugins

- keymaps https://www.lazyvim.org/keymaps#general
- https://github.com/LazyVim/LazyVim/blob/a50f92f7550fb6e9f21c0852e6cb190e6fcd50f5/lua/lazyvim/config/autocmds.lua#L53-L76
- https://github.com/mfussenegger/nvim-dap
- copilot <CR> when trying to add parens/brackets
- https://github.com/neovim/nvim-lspconfig/#suggested-configuration

Expand Down
98 changes: 94 additions & 4 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ require("lazy").setup({
{ "<leader>gd", "<cmd>Gitsigns diffthis<cr>", desc = "Diff" },
{ "<leader>ghs", "<cmd>Gitsigns stage_hunk<cr>", desc = "Stage" },
{ "<leader>ghr", "<cmd>Gitsigns reset_hunk<cr>", desc = "Reset" },
{ "<leader>tgb", "<cmd>Gitsigns toggle_current_line_blame<cr>", desc = "Toggle Blame" },
{ "<leader>tgd", "<cmd>Gitsigns toggle_deleted<cr>", desc = "Toggle Deleted" },
{ "<leader>ugb", "<cmd>Gitsigns toggle_current_line_blame<cr>", desc = "Toggle Blame" },
{ "<leader>ugd", "<cmd>Gitsigns toggle_deleted<cr>", desc = "Toggle Deleted" },
},
opts = {
current_line_blame_opts = { delay = 500 },
Expand Down Expand Up @@ -522,6 +522,8 @@ require("lazy").setup({
component_separators = "",
disabled_filetypes = {
"neo-tree",
"neotest-output-panel",
"neotest-summary",
},
globalstatus = false,
icons_enabled = true,
Expand Down Expand Up @@ -658,6 +660,90 @@ require("lazy").setup({
},
},

-- neotest (https://github.com/nvim-neotest/neotest)
{
"nvim-neotest/neotest",
dependencies = {
"antoinemadec/FixCursorHold.nvim",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
-- adapters
"jfpedroza/neotest-elixir",
"marilari88/neotest-vitest",
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-elixir"),
require("neotest-vitest"),
},
output = { open_on_run = true },
status = {
signs = false,
virtual_text = true,
},
})
end,
keys = {
{
"<leader>tt",
function()
require("neotest").run.run(vim.fn.expand("%"))
end,
desc = "Run File",
},
{
"<leader>tT",
function()
require("neotest").run.run(vim.loop.cwd())
end,
desc = "Run All Test Files",
},
{
"<leader>tr",
function()
require("neotest").run.run()
end,
desc = "Run Nearest",
},
{
"<leader>tl",
function()
require("neotest").run.run_last()
end,
desc = "Run Last",
},
{
"<leader>ts",
function()
require("neotest").summary.toggle()
end,
desc = "Toggle Summary",
},
{
"<leader>to",
function()
require("neotest").output.open({ enter = true, auto_close = true })
end,
desc = "Show Output",
},
{
"<leader>tO",
function()
require("neotest").output_panel.toggle()
end,
desc = "Toggle Output Panel",
},
{
"<leader>tS",
function()
require("neotest").run.stop()
end,
desc = "Stop",
},
},
},

-- neo-tree.nvim (https://github.com/nvim-neo-tree/neo-tree.nvim)
{
"nvim-neo-tree/neo-tree.nvim",
Expand Down Expand Up @@ -958,6 +1044,7 @@ require("lazy").setup({
local servers = {
elixirls = {
settings = {
-- https://github.com/elixir-lsp/elixir-ls#elixirls-configuration-settings
elixirLS = {
fetchDeps = false,
},
Expand Down Expand Up @@ -1100,8 +1187,10 @@ require("lazy").setup({
"c",
"css",
"elixir",
"eex",
"fish",
"gitignore",
"heex",
"html",
"javascript",
"jsdoc",
Expand Down Expand Up @@ -1409,15 +1498,16 @@ require("lazy").setup({
},
c = { name = "+code" },
f = {
name = "+file",
name = "+file/find",
n = { "<cmd>enew<cr>", "New File" },
},
g = {
name = "+git",
h = { name = "+hunk" },
},
s = { name = "+search" },
t = {
t = { name = "+test" },
u = {
name = "toggle",
f = {
lsp.toggle_format,
Expand Down
5 changes: 4 additions & 1 deletion .config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
Expand All @@ -21,12 +22,14 @@
"mini.bufremove": { "branch": "main", "commit": "020243bfed8c8b941f2c20626faf3ea39c0c0e1b" },
"mini.nvim": { "branch": "main", "commit": "910e49d2d45e9d32c815d16cce6cea7c3b43cecf" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" },
"neotest": { "branch": "master", "commit": "73043d666780e35185a77589e01bec96a52db910" },
"neotest-elixir": { "branch": "master", "commit": "3117ca5442c02998847131c39551b76a6ceac9d7" },
"neotest-vitest": { "branch": "main", "commit": "87e91bfd9419a8c74bf0d105e2ae31b9692daf0b" },
"noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" },
"none-ls.nvim": { "branch": "main", "commit": "e64f03f3f77bd6854c3b3c5cfffcc806a0c0f66a" },
"nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" },
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
"nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
"nvim-notify": { "branch": "master", "commit": "80b67b265530632505193553d05127ae7fe09ddd" },
"nvim-treesitter": { "branch": "master", "commit": "4a4dbe1cb1da34d87fc42a40aaf8e218af4cfe0f" },
"nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" },
Expand Down

0 comments on commit 6a0e91d

Please sign in to comment.