Fix: Whitespaces begone or something
This commit is contained in:
parent
7545885942
commit
4d66a5e231
11 changed files with 94 additions and 28 deletions
|
@ -3,7 +3,7 @@
|
||||||
# Main Bindings
|
# Main Bindings
|
||||||
#
|
#
|
||||||
# Foot, you done goofed
|
# Foot, you done goofed
|
||||||
bind=ALT,RETURN,exec,foot
|
bind=ALT,RETURN,exec,footclient
|
||||||
#bind=ALT,RETURN,exec,kitty
|
#bind=ALT,RETURN,exec,kitty
|
||||||
|
|
||||||
bind=ALT,Q,killactive,
|
bind=ALT,Q,killactive,
|
||||||
|
|
|
@ -50,6 +50,72 @@ map("n", "<leader>e", function()
|
||||||
require("neo-tree.command").execute({ action = "show", position = "right", toggle = true, dir = vim.loop.cwd() })
|
require("neo-tree.command").execute({ action = "show", position = "right", toggle = true, dir = vim.loop.cwd() })
|
||||||
end, { desc = "Open Neotree", remap = true })
|
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
|
-- 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-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 = "Hide Terminal" })
|
||||||
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
|
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
{
|
{
|
||||||
description = "System Configuration Flake";
|
description = "System Configuration Flake";
|
||||||
|
|
||||||
|
|
||||||
outputs = inputs@{
|
outputs = inputs@{
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
nixpkgs-xr,
|
nixpkgs-xr,
|
||||||
|
|
Loading…
Reference in a new issue