Fix: Whitespaces begone or something

This commit is contained in:
stitchy 2024-11-27 10:41:47 +00:00
parent 7545885942
commit 4d66a5e231
Signed by: stitchy
SSH key fingerprint: SHA256:yz2SoxdnY67tfY5Jzb0f2v8f5W3o/IF359kbcquWip8
11 changed files with 94 additions and 28 deletions

View file

@ -3,7 +3,7 @@
# Main Bindings
#
# Foot, you done goofed
bind=ALT,RETURN,exec,foot
bind=ALT,RETURN,exec,footclient
#bind=ALT,RETURN,exec,kitty
bind=ALT,Q,killactive,

View file

@ -50,6 +50,72 @@ map("n", "<leader>e", function()
require("neo-tree.command").execute({ action = "show", position = "right", toggle = true, dir = vim.loop.cwd() })
end, { desc = "Open Neotree", remap = true })
-- Conform Formatting
map({ "n", "v" }, "<leader>mp", function()
require("conform").format({
lsp_fallback = true,
async = false,
timeout_ms = 500,
})
end, { desc = "Format file or range (in visual mode)" })
-- diagnostic
---@param next "f"|"b"
---@param severity "ERROR"|"WARN"?
local diagnostic_goto = function(next, severity)
local go = (next == "f") and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
local severity_index = severity and vim.diagnostic.severity[severity] or nil
return function()
go({ severity = severity_index })
end
end
map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
map("n", "]d", diagnostic_goto("f"), { desc = "Next Diagnostic" })
map("n", "[d", diagnostic_goto("b"), { desc = "Prev Diagnostic" })
map("n", "]e", diagnostic_goto("f", "ERROR"), { desc = "Next Error" })
map("n", "[e", diagnostic_goto("b", "ERROR"), { desc = "Prev Error" })
map("n", "]w", diagnostic_goto("f", "WARN"), { desc = "Next Warning" })
map("n", "[w", diagnostic_goto("b", "WARN"), { desc = "Prev Warning" })
----
-- Plugins
----
-- Telescope (fuzzy finder)
local function telescope_git_fallback()
vim.fn.system("git rev-parse --is-inside-work-tree")
local is_git_repo = vim.v.shell_error == 0
if is_git_repo then
require("telescope.builtin").git_files()
else
require("telescope.builtin").find_files()
end
end
local function telescope_files()
require("telescope.builtin").find_files({ cwd = vim.uv.cwd() })
end
local function telescope_oldfiles()
require("telescope.builtin").oldfiles({ cwd = vim.uv.cwd() })
end
local function telescope_live_grep()
vim.fn.system("git rev-parse --is-inside-work-tree")
local is_git_repo = vim.v.shell_error == 0
local git_root = vim.fn.fnamemodify(vim.fn.finddir(".git", ".;"), ":h")
require("telescope.builtin").live_grep({
cwd = is_git_repo and git_root or vim.uv.cwd(),
})
end
map("n", "<leader><space>", telescope_git_fallback, { desc = "Find files (git/fallback, cwd)" })
map("n", "<leader>ff", telescope_files, { desc = "Find files (cwd)" })
map("n", "<leader>fo", telescope_oldfiles, { desc = "Find files (cwd)" })
map("n", "<leader>/", telescope_live_grep, { desc = "Live grep (cwd)" })
map("n", "<leader>,", require("telescope.builtin").buffers, { desc = "Find buffers" })
map("n", "<leader>\"", require("telescope.builtin").registers, { desc = "Find registers" })
----
-- Fixes
----
@ -80,3 +146,5 @@ map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to upper window" })
map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to right window" })
map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })

View file

@ -1,7 +1,5 @@
{
description = "System Configuration Flake";
outputs = inputs@{
nixpkgs,
nixpkgs-xr,