clean and stuff

This commit is contained in:
Christian Nieves
2023-07-12 21:32:04 -05:00
parent ab28a85172
commit ff24d719b1
11 changed files with 66 additions and 388 deletions

View File

@ -0,0 +1,8 @@
return {
{
"bazelbuild/vim-bazel",
dependencies = {
"google/vim-maktaba",
},
},
}

View File

@ -12,63 +12,26 @@ return {
log_level = vim.log.levels.WARN,
-- All formatter configurations are opt-in
filetype = {
-- Formatter configurations for filetype "lua" go here
-- and will be executed in order
lua = {
-- "formatter.filetypes.lua" defines default configurations for the
-- "lua" filetype
-- require("formatter.filetypes.lua").stylua,
-- You can also define your own configuration
function()
-- Supports conditional formatting
if util.get_current_buffer_file_name() == "special.lua" then
return nil
end
-- Full specification of configurations is down below and in Vim help
-- files
return {
exe = "stylua",
args = {
"--search-parent-directories",
"--stdin-filepath",
util.escape_path(util.get_current_buffer_file_path()),
"--",
"-",
},
stdin = true,
}
end,
},
html = {
require("formatter.defaults").prettier,
},
xml = {
function()
return {
exe = "tidy",
args = {
"-quiet",
"-xml",
"--indent auto",
"--indent-spaces 2",
"--verical-space yes",
"--tidy-mark no",
},
stdin = true,
try_node_modules = true,
}
end,
},
-- xml = {
-- function()
-- return {
-- exe = "tidy",
-- args = {
-- "-quiet",
-- "-xml",
-- "--indent auto",
-- "--indent-spaces 2",
-- "--verical-space yes",
-- "--tidy-mark no",
-- },
-- stdin = true,
-- try_node_modules = true,
-- }
-- end,
-- },
--
-- Use the special "*" filetype for defining formatter configurations on
-- any filetype
["*"] = {
-- "formatter.filetypes.any" defines default configurations for any
-- filetype
require("formatter.filetypes.any").remove_trailing_whitespace,
},
},
})
vim.cmd([[

View File

@ -0,0 +1,24 @@
return {
{
"ray-x/go.nvim",
dependencies = { -- optional packages
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("go").setup()
local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.go",
callback = function()
require("go.format").goimport()
end,
group = format_sync_grp,
})
end,
event = { "CmdlineEnter" },
ft = { "go", "gomod" },
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
},
}

View File

@ -7,6 +7,8 @@ return {
local TableConcat = require("utils").TableConcat
local sources = {
-- *
null_ls.builtins.formatting.trim_whitespace,
-- Catch insensitive, inconsiderate writing.
null_ls.builtins.diagnostics.alex,
@ -22,6 +24,12 @@ return {
-- Reformats Java source code according to Google Java Style.
null_ls.builtins.formatting.google_java_format,
-- XML
null_ls.builtins.diagnostics.tidy,
-- null_ls.builtins.formatting.xmlformat
null_ls.builtins.formatting.stylua,
}
if not use_google then