1
0
Fork 0

fmt(neovim): stylua

This commit is contained in:
Jeremy Kaplan 2025-10-26 15:23:15 -04:00
commit 97b2bb0d4f
11 changed files with 1190 additions and 1117 deletions

View file

@ -1,19 +1,19 @@
vim.o.shell = '/bin/sh'
vim.o.shell = "/bin/sh"
vim.g.python3_host_prog = vim.fn.expand("~/.virtualenvs/neovim3/bin/python")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" })
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" })
end
vim.opt.rtp:prepend(lazypath)
-- Load from ./lua/plugins/*.lua
require("lazy").setup("plugins", {
change_detection = {
-- Disable automatic reloading of config files.
enabled = false,
}
change_detection = {
-- Disable automatic reloading of config files.
enabled = false,
},
})
theme = "jdkaplan-temp"
@ -45,11 +45,11 @@ vim.keymap.set("", "k", "gk", { silent = true })
vim.o.list = false
vim.o.wrapmargin = 0
vim.opt.listchars = {
tab = ">-",
extends = ">",
precedes = "<",
nbsp = "+",
trail = "-",
tab = ">-",
extends = ">",
precedes = "<",
nbsp = "+",
trail = "-",
}
vim.o.ignorecase = true
@ -74,23 +74,23 @@ vim.o.secure = true
vim.keymap.set("", "<Space>w", "<C-w>", { remap = true })
vim.keymap.set("", '<Space>w"', ":split<CR>")
vim.keymap.set("", '<Space>w%', ":vsplit<CR>")
vim.keymap.set("", "<Space>w%", ":vsplit<CR>")
vim.keymap.set("", '<Leader>w', ":w<CR>")
vim.keymap.set("", "<Leader>w", ":w<CR>")
vim.keymap.set("n", "<C-w>]", function()
if vim.api.nvim_win_get_width(0) > 2 * 80 then
vim.cmd('vertical wincmd ]')
else
vim.cmd('horizontal wincmd ]')
end
if vim.api.nvim_win_get_width(0) > 2 * 80 then
vim.cmd("vertical wincmd ]")
else
vim.cmd("horizontal wincmd ]")
end
end)
-- TODO: Delete these ; fake-leader bindings
vim.keymap.set("", ';w', ":w<CR>")
vim.keymap.set("", ";w", ":w<CR>")
-- TODO: Delete these ; fake-leader bindings
vim.keymap.set("", ';;', ";")
vim.keymap.set("", ";;", ";")
vim.keymap.set("", "<Space><Space>", ":nohlsearch<CR>")
@ -128,27 +128,35 @@ vim.opt.spellcapcheck = ""
-- CTRL-L usually clears and redraws the screen. Might as well use it to reset
-- the colorscheme too!
vim.keymap.set("n", "<C-l>", function()
vim.cmd.colorscheme(theme)
vim.cmd.redraw()
vim.cmd.colorscheme(theme)
vim.cmd.redraw()
end)
vim.diagnostic.config({ jump = { float = true } })
function auto_correct(mode, old, new, scale, limit, cmd)
delay = scale
delay = scale
vim.keymap.set(mode, old, function()
vim.print("You should use " .. new)
vim.cmd.sleep(delay .. "m")
cmd()
delay = math.min(delay + scale, limit)
end)
vim.keymap.set(mode, old, function()
vim.print("You should use " .. new)
vim.cmd.sleep(delay .. "m")
cmd()
delay = math.min(delay + scale, limit)
end)
end
auto_correct("n", ';"', '<C-w>s', 100, 1000, vim.cmd.split)
auto_correct("n", ';%', '<C-w>v', 100, 1000, vim.cmd.vsplit)
auto_correct("n", ';0', '<C-w>c', 100, 1000, vim.cmd.close)
auto_correct("n", ";h", "<C-w>h", 10, 500, function() vim.cmd.wincmd("h") end)
auto_correct("n", ";j", "<C-w>j", 10, 500, function() vim.cmd.wincmd("j") end)
auto_correct("n", ";k", "<C-w>k", 10, 500, function() vim.cmd.wincmd("k") end)
auto_correct("n", ";l", "<C-w>l", 10, 500, function() vim.cmd.wincmd("l") end)
auto_correct("n", ';"', "<C-w>s", 100, 1000, vim.cmd.split)
auto_correct("n", ";%", "<C-w>v", 100, 1000, vim.cmd.vsplit)
auto_correct("n", ";0", "<C-w>c", 100, 1000, vim.cmd.close)
auto_correct("n", ";h", "<C-w>h", 10, 500, function()
vim.cmd.wincmd("h")
end)
auto_correct("n", ";j", "<C-w>j", 10, 500, function()
vim.cmd.wincmd("j")
end)
auto_correct("n", ";k", "<C-w>k", 10, 500, function()
vim.cmd.wincmd("k")
end)
auto_correct("n", ";l", "<C-w>l", 10, 500, function()
vim.cmd.wincmd("l")
end)