repos / dotfiles

my dotfiles

commit
039c04b
parent
1e427f3
author
Eric Bower
date
2025-09-23 21:02:06 -0400 EDT
chore(nvim): rearrange code
1 files changed,  +10, -9
M dot_config/nvim/init.lua
+10, -9
 1@@ -40,10 +40,6 @@ vim.diagnostic.config({
 2 	severity_sort = true,
 3 })
 4 
 5-vim.api.nvim_create_user_command("Qf", function(opts)
 6-	cqf(opts.args, false)
 7-end, { nargs = "+", desc = "convert command to quickfix" })
 8-
 9 local opts = { silent = true }
10 local map = vim.keymap.set
11 map("t", "<Esc>", [[<C-\><C-n>]], opts) -- exit terminal mode
12@@ -54,7 +50,13 @@ map("n", "<C-h>", "<cmd>wincmd h<cr>", opts)
13 map("n", "<C-l>", "<cmd>wincmd l<cr>", opts)
14 map("n", "<leader>t", "<cmd>bd!<cr>", opts)
15 map("n", "<leader>f", "<cmd>term fish<cr>", opts)
16+map("n", "<leader>b", ":b ")
17+map({ "n", "v" }, "<leader>u", "<cmd>GitLink<cr>", opts)
18 map("n", "<leader>e", vim.diagnostic.open_float, opts)
19+map("n", "<leader>l", function() -- https://github.com/shell-pool/shpool/issues/240#issuecomment-3097566679
20+	io.stdout:write("\027[?2048h")
21+end, opts)
22+
23 map("n", "<leader>r", function()
24 	local loclist_win = vim.fn.getloclist(0, { winid = 0 }).winid
25 	if loclist_win > 0 then
26@@ -63,8 +65,6 @@ map("n", "<leader>r", function()
27 		vim.diagnostic.setloclist({ open = true })
28 	end
29 end, opts)
30-map("n", "<leader>b", ":b ")
31-map({ "n", "v" }, "<leader>u", "<cmd>GitLink<cr>", opts)
32 map("n", "<leader>y", function() -- copy relative filepath to clipboard
33 	vim.fn.setreg("+", vim.fn.expand("%"))
34 end)
35@@ -89,9 +89,6 @@ map("n", "<leader>s", function() -- fuzzy match files into quickfix
36 		cqf(string.format("fd -t f | fzf -f %s", file), true)
37 	end)
38 end)
39-map("n", "<leader>l", function() -- https://github.com/shell-pool/shpool/issues/240#issuecomment-3097566679
40-	io.stdout:write("\027[?2048h")
41-end, opts)
42 
43 local augroup = vim.api.nvim_create_augroup("erock.cfg", { clear = true })
44 local autocmd = vim.api.nvim_create_autocmd
45@@ -193,6 +190,10 @@ require("treesitter-context").setup({ max_lines = 3, separator = ">", mode = "to
46 require("neoscroll").setup({ duration_multiplier = 0.3 })
47 require("gitlinker").setup()
48 
49+vim.api.nvim_create_user_command("Qf", function(opts)
50+	cqf(opts.args, false)
51+end, { nargs = "+", desc = "convert command to quickfix" })
52+
53 ---Attempts to convert a command that returns a list of filepaths into a quickfix.
54 ---It assumes the filepaths are in the first column without spaces.
55 ---@param cmd string The system command to run