feat: more stuf

This commit is contained in:
Barrett Ruth 2026-02-16 21:27:03 -05:00
parent 24b6fdb455
commit 828352781f
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
14 changed files with 84 additions and 39 deletions

View file

@ -73,7 +73,8 @@ local cpp_single = cpp_base .. [[ solve();
return 0;
} // }}}]]
local cpp_multi = cpp_base .. [[ u32 tc = 1;
local cpp_multi = cpp_base
.. [[ u32 tc = 1;
std::cin >> tc;
for (u32 t = 0; t < tc; ++t) {
solve();
@ -211,10 +212,10 @@ return {
require('cp.helpers').clearcol(buf)
end,
before_run = function(_)
require('config.lsp').format({ async = true })
require('config.lsp').format()
end,
before_debug = function(_)
require('config.lsp').format({ async = true })
require('config.lsp').format()
end,
setup_code = function(state)
vim.opt_local.winbar = ''
@ -234,9 +235,13 @@ return {
local platform = state.get_platform()
insert_template(buf, lang, platform)
local clang_format_path = vim.fn.getcwd() .. '/.clang-format'
local clang_format_path = vim.fn.getcwd()
.. '/.clang-format'
if vim.fn.filereadable(clang_format_path) == 0 then
vim.fn.writefile(vim.split(clang_format, '\n'), clang_format_path)
vim.fn.writefile(
vim.split(clang_format, '\n'),
clang_format_path
)
end
end,
},

View file

@ -185,7 +185,8 @@ return {
{
'<leader>go',
with_forge(function(forge)
local branch = vim.trim(vim.fn.system('git branch --show-current'))
local branch =
vim.trim(vim.fn.system('git branch --show-current'))
forge.browse(file_loc(), branch)
end),
mode = { 'n', 'v' },

View file

@ -10,18 +10,26 @@ return {
lsp_as_default_formatter = true,
}
end,
keys = {
{ 'gF', '<cmd>Guard fmt<CR>', mode = { 'n', 'x' } },
},
config = function()
local ft = require('guard.filetype')
ft('python'):fmt({
cmd = 'isort',
args = { '--profile', 'black', '-' },
stdin = true,
}):append('black'):lint('mypy')
ft('python')
:fmt({
cmd = 'isort',
args = { '--profile', 'black', '-' },
stdin = true,
})
:append('black')
:lint('mypy')
ft('lua'):fmt('stylua'):lint('selene')
ft('javascript,javascriptreact,typescript,typescriptreact'):fmt('prettierd'):lint('eslint_d')
ft('javascript,javascriptreact,typescript,typescriptreact')
:fmt('prettierd')
:lint('eslint_d')
ft('css,graphql,html,json,jsonc,mdx,yaml'):fmt('prettierd')
ft('sh,bash,zsh'):fmt({

View file

@ -1,6 +1,7 @@
return {
{
'barrettruth/midnight.nvim',
dir = '~/dev/midnight.nvim',
enabled = true,
config = function()
vim.cmd.colorscheme('midnight')
@ -305,15 +306,15 @@ return {
},
},
{ 'tpope/vim-abolish', event = 'VeryLazy' },
{ 'tpope/vim-sleuth', event = 'BufReadPost' },
{ 'tpope/vim-sleuth', event = 'BufReadPost' },
{
'kylechui/nvim-surround',
config = true,
keys = {
{ 'cs', mode = 'n' },
{ 'ds', mode = 'n' },
{ 'ys', mode = 'n' },
{ 'yS', mode = 'n' },
{ 'cs', mode = 'n' },
{ 'ds', mode = 'n' },
{ 'ys', mode = 'n' },
{ 'yS', mode = 'n' },
{ 'yss', mode = 'n' },
{ 'ySs', mode = 'n' },
},