Compare commits

..

5 Commits

Author SHA1 Message Date
salomaestro
92840f428e Add searchable manpage command 2025-02-19 16:04:06 +01:00
salomaestro
fc5cf565d6 Add binds for searching wiki and navigating journal 2025-02-19 16:03:50 +01:00
salomaestro
5a9c788b08 Add vim-test plugin 2025-02-19 16:02:53 +01:00
salomaestro
3bb580b542 Restructure lspconfig 2025-02-19 16:02:32 +01:00
salomaestro
381fd0140c Change style 2025-02-19 15:59:50 +01:00
5 changed files with 115 additions and 16 deletions

View File

@@ -6,19 +6,25 @@
local M = {} local M = {}
M.base46 = { M.base46 = {
theme = "monekai", theme = "doomchad",
transparency = true,
-- hl_override = { hl_override = {
-- Comment = { italic = true }, Comment = { italic = true },
-- ["@comment"] = { italic = true }, ["@comment"] = { italic = true },
-- }, },
} }
-- M.nvdash = { load_on_startup = true } M.nvdash = { load_on_startup = true }
-- M.ui = { M.ui = {
-- tabufline = { tabufline = {
-- lazyload = false lazyload = false,
-- } },
--} telescope = { style = "borderless" },
statusline = {
theme = "minimal",
separator_style = "round",
}
}
return M return M

View File

@@ -1,11 +1,11 @@
-- load defaults i.e lua_lsp -- load defaults i.e lua_lsp
require("nvchad.configs.lspconfig").defaults() local nvlsp = require "nvchad.configs.lspconfig"
local lspconfig = require "lspconfig" local lspconfig = require "lspconfig"
nvlsp.defaults()
-- EXAMPLE -- EXAMPLE
local servers = { "html", "cssls", "ruff", "jedi_language_server", "yls", "lua_ls" } local servers = { "html", "cssls", "ruff", "jedi_language_server", "yls", "lua_ls" }
local nvlsp = require "nvchad.configs.lspconfig"
-- lsps with default config -- lsps with default config
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do

View File

@@ -139,3 +139,75 @@ end, { noremap = true, silent = true, desc = "Explain Selection" }
-- Expand 'cc' into 'CodeCompanion' in the command line -- Expand 'cc' into 'CodeCompanion' in the command line
vim.cmd([[cab cc CodeCompanion]]) vim.cmd([[cab cc CodeCompanion]])
-- mappings for wiki.vim
map("n", "<leader>iw", function ()
require("telescope.builtin").live_grep({
prompt_title = "Search Wiki",
cwd = vim.fn.expand("~/wiki"),
})
end, { desc = "Search Wiki" })
map("n", "<leader>jn", "<cmd>WikiJournalNext<cr>", { desc = "Next Journal" })
map("n", "<leader>jp", "<cmd>WikiJournalPrev<cr>", { desc = "Previous Journal" })
-- Mappings for Man using ripgrep
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
local previewers = require("telescope.previewers")
-- Define a custom previewer that runs 'man' in a terminal job:
local man_previewer = previewers.new_termopen_previewer({
get_command = function(entry)
-- 'entry.value' will be the man-topic, e.g. "ls"
if not entry or not entry.value then
return { "echo", "" }
end
-- The pager string (col -bx | bat -l man -p) must be passed as one argument
-- so that 'man' interprets it as a shell command for the pager:
return {
"man",
"-P", "col -bx | bat -l man -p", -- all as a single argument to -P
entry.value
}
end,
})
-- Create a mapping that invokes Telescope with our custom previewer
map("n", "<leader>mp", function()
require("telescope.builtin").find_files({
prompt_title = "Man Pages",
find_command = {
"bash", "-c",
table.concat({
-- Pipeline:
-- 1) 'rg --files /usr/share/man'
-- 2) strip directory paths (xargs basename)
-- 3) remove trailing .x or .x.gz (sed)
-- 4) sort + unique
"rg --files /usr/share/man",
"| xargs basename",
"| sed 's/\\.[^.]*$//'",
"| sort -u",
}, " ")
},
-- Provide our custom previewer
previewer = man_previewer,
-- 3) attach_mappings() lets us override what happens when we press <CR>
attach_mappings = function(prompt_bufnr, map_telescope)
local function open_man_page()
local selection = action_state.get_selected_entry()
actions.close(prompt_bufnr)
-- Actually open the man page inside Neovim:
vim.cmd("Man " .. selection.value)
end
-- Bind <CR> in insert + normal mode to open the man page
map_telescope("i", "<CR>", open_man_page)
map_telescope("n", "<CR>", open_man_page)
return true
end,
})
end, { desc = "Search manpages" })

View File

@@ -22,3 +22,13 @@ sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", num
sign("DapBreakpointCondition", { text = "", texthl = "DapBreakpointCondition", linehl = "", numhl = ""}) sign("DapBreakpointCondition", { text = "", texthl = "DapBreakpointCondition", linehl = "", numhl = ""})
sign("DapLogPoint", { text = "", texthl = "DapLogPoint", linehl = "", numhl = ""}) sign("DapLogPoint", { text = "", texthl = "DapLogPoint", linehl = "", numhl = ""})
sign('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' }) sign('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' })
vim.api.nvim_create_autocmd("QuickFixCmdPost", {
callback = function()
local qf = vim.fn.getqflist({ size = 0 })
if qf.size > 0 then
vim.cmd("copen")
end
end,
pattern = "*",
})

View File

@@ -15,6 +15,17 @@ return {
end, end,
}, },
{
"vim-test/vim-test",
lazy = false,
config = function()
vim.g["test#use_quickfix"] = 1
vim.g["test#strategy"] = "neovim_sticky"
vim.g["test#python#runner"] = "pytest"
vim.g["test#python#pytest#executable"] = "uv run pytest"
end,
},
{ {
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
lazy = true, lazy = true,