feat: more stuf
This commit is contained in:
parent
24b6fdb455
commit
828352781f
14 changed files with 84 additions and 39 deletions
|
|
@ -128,7 +128,6 @@ function M.foldexpr()
|
|||
return tostring(max_level)
|
||||
end
|
||||
|
||||
|
||||
function M.setup()
|
||||
vim.opt.fillchars:append({
|
||||
fold = ' ',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
return {
|
||||
setup = function()
|
||||
vim.o.statusline = '%!v:lua.require("config.lines.statusline").statusline()'
|
||||
vim.o.statusline =
|
||||
'%!v:lua.require("config.lines.statusline").statusline()'
|
||||
vim.o.statuscolumn =
|
||||
'%!v:lua.require("config.lines.statuscolumn").statuscolumn()'
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,13 @@ return {
|
|||
local relnum = vim.v.relnum
|
||||
local hl = relnum == 0 and 'CursorLineNr' or 'LineNr'
|
||||
|
||||
local marks = vim.api.nvim_buf_get_extmarks(0, -1, { lnum - 1, 0 }, { lnum - 1, 0 }, { details = true })
|
||||
local marks = vim.api.nvim_buf_get_extmarks(
|
||||
0,
|
||||
-1,
|
||||
{ lnum - 1, 0 },
|
||||
{ lnum - 1, 0 },
|
||||
{ details = true }
|
||||
)
|
||||
for _, mark in ipairs(marks) do
|
||||
if mark[4] and mark[4].number_hl_group then
|
||||
hl = mark[4].number_hl_group
|
||||
|
|
|
|||
|
|
@ -79,16 +79,12 @@ function M.on_attach(client, bufnr)
|
|||
end
|
||||
end
|
||||
|
||||
function M.format(opts)
|
||||
local ok, ft_handler = pcall(require, 'guard.filetype')
|
||||
if ok then
|
||||
local conf = ft_handler[vim.bo.filetype]
|
||||
if conf and conf.formatter and #conf.formatter > 0 then
|
||||
require('guard').fmt()
|
||||
return
|
||||
end
|
||||
function M.format()
|
||||
if pcall(require, 'guard.filetype') then
|
||||
vim.cmd.Guard('fmt')
|
||||
else
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end
|
||||
vim.lsp.buf.format(opts or { async = true })
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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' },
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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' },
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue