Compare commits

...

3 Commits

Author SHA1 Message Date
14eba6a324 bad formatter 2023-07-17 14:09:55 -05:00
7db9f7a784 stuf 2023-07-17 14:06:51 -05:00
fb83c79450 Fix relatedfiles 2023-07-14 15:16:35 -05:00
11 changed files with 171 additions and 354 deletions

View File

@ -1,34 +1,37 @@
{
"LuaSnip": { "branch": "master", "commit": "105b5f7f72c13e682a3aa5d29eac2408ae513b22" },
"LuaSnip": { "branch": "master", "commit": "c7984d1cca3d8615e4daefc196597872a0b8d590" },
"aerial.nvim": { "branch": "master", "commit": "fb1f08c9f90e8b0c04b2f2c5d95d06288a14c5b2" },
"ai.nvim": { "branch": "main", "commit": "d7391d4782b90ad3501f6f716f2b308092981787" },
"asyncrun.vim": { "branch": "master", "commit": "7191d0c30dd105e5d7f897b9a6ee19cabe734466" },
"auto-session": { "branch": "main", "commit": "21033c6815f249a7839c3a85fc8a6b44d74925c9" },
"auto-session": { "branch": "main", "commit": "7afbb149f87be279778689596c781882014f7eef" },
"calendar-vim": { "branch": "master", "commit": "a7e73e02c92566bf427b2a1d6a61a8f23542cc21" },
"catppuccin": { "branch": "main", "commit": "3ffd2f511f3dc6c01258923d7170ccaf1445634b" },
"ciderlsp-nvim": { "branch": "main", "commit": "45ee3634c6d4224c6981825da5bde39804addc71" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-calc": { "branch": "main", "commit": "50792f34a628ea6eb31d2c90e8df174671e4e7a0" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
"cmp-nvim-ciderlsp": { "branch": "main", "commit": "e1b0015a0c090e20d1cbb34e5639e6dd145d3f3e" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" },
"cmp-tabnine": { "branch": "main", "commit": "b93f82ef5150e578677fc2e2b4b328b19eed77e1" },
"cmp-treesitter": { "branch": "master", "commit": "389eadd48c27aa6dc0e6b992644704f026802a2e" },
"cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"conflict-marker.vim": { "branch": "master", "commit": "11a4d42244755505b66b15cd4496a150432eb5e3" },
"crates.nvim": { "branch": "main", "commit": "1dffccc0a95f656ebe00cacb4de282473430c5a1" },
"formatter.nvim": { "branch": "master", "commit": "fa4f2729cc2909db599169f22d8e55632d4c8d59" },
"friendly-snippets": { "branch": "main", "commit": "6153166d5a3dcc7e2809ea4f17f9edb34d026026" },
"friendly-snippets": { "branch": "main", "commit": "ca668b7a4a2913ad1109b5e4aaf0013651956b13" },
"fzf": { "branch": "master", "commit": "547e101f1d6bf326d286bac0fb3272738a92a67f" },
"fzf.vim": { "branch": "master", "commit": "1dcdb21db618055134cd611f4f5918f6d00a5df0" },
"git-conflict.nvim": { "branch": "main", "commit": "8d962d83cae924a314965f738ed1e05a4000d682" },
"gitsigns.nvim": { "branch": "main", "commit": "48c3ae8ec74cb83f9570ceb0c5ab8217db7a2220" },
"go.nvim": { "branch": "master", "commit": "6550ddf5ce491d17af009c397aceb25310566eaa" },
"guihua.lua": { "branch": "master", "commit": "ab8b1f09603cc268770efd057115035dc6cfa83d" },
"hg": { "branch": "main", "commit": "1c4bdf80174ec840ba76c4dc7032c4313db62199" },
"java-syntax.vim": { "branch": "master", "commit": "9a3d76a8c6cd7765ba93a7bdd9280594167e3f1b" },
"kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" },
"lazy.nvim": { "branch": "main", "commit": "14d76aac4bd3ff07c1fca074c210f28f766a931e" },
@ -39,6 +42,7 @@
"lsp_lines.nvim": { "branch": "main", "commit": "f53af96d4789eef39a082dbcce078d2bfc384ece" },
"lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
"luasnip-google.nvim": { "branch": "main", "commit": "5fd7feb144de0ecea837618c9c9e1bbecc0e3243" },
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "796008869e67ef27a5aa5ac44c08ce2a60b89f55" },
"mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" },
@ -48,13 +52,14 @@
"nui.nvim": { "branch": "main", "commit": "d146966a423e60699b084eeb28489fe3b6427599" },
"null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" },
"nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" },
"nvim-lightbulb": { "branch": "master", "commit": "6166029a136afd56cf23384fc31e8ba203a6e102" },
"nvim-lspconfig": { "branch": "master", "commit": "f88fc62d9770e70faab132ddfed680e49fb012f3" },
"nvim-lightbulb": { "branch": "master", "commit": "bb9ec720aa998252951627f811e8f39b76789e0a" },
"nvim-lspconfig": { "branch": "master", "commit": "deade69789089c3da15237697156334fb3e943f0" },
"nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" },
"nvim-osc52": { "branch": "main", "commit": "3e96035d62290183fe7a11418db2b254fcfcaee3" },
"nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" },
"nvim-treesitter": { "branch": "master", "commit": "575f5a4b1fcb60c1ac4f560c46a5171454d674ca" },
"nvim-web-devicons": { "branch": "master", "commit": "9ab9b0b894b2388a9dbcdee5f00ce72e25d85bf9" },
"nvim_figtree": { "branch": "main", "commit": "9bc3025f46e34732382da1019e256a9d8bec1e55" },
"plenary.nvim": { "branch": "master", "commit": "bda256fab0eb66a15e8190937e417e6a14ee5d72" },
"refactoring.nvim": { "branch": "master", "commit": "56b747d1be0aa5cecddf85e6f3ca2aed6797edef" },
"registers.nvim": { "branch": "main", "commit": "2ab8372bb837f05fae6b43091f10a0b725d113ca" },
@ -62,12 +67,16 @@
"telekasten.nvim": { "branch": "main", "commit": "4a5e57eee9c5154ed77423bb7fa6619fdb0784cd" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "e03ff55962417b69c85ef41424079bb0580546ba" },
"telescope.nvim": { "branch": "master", "commit": "276362a8020c6e94c7a76d49aa00d4923b0c02f3" },
"telescope_citc": { "branch": "main", "commit": "d6421d5bfe058915ece0daec55e488f8ea05f207" },
"telescope_codesearch": { "branch": "main", "commit": "a26077ad3c68cf897ae1c31da903d6516ebb9c92" },
"telescope_fig": { "branch": "main", "commit": "90150e1aa368b49a5125689b3a6da573a99e2bda" },
"trouble.nvim": { "branch": "main", "commit": "d99e2abd10808ef91738ce98a5c767e6a51df449" },
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
"vcscommand.vim": { "branch": "master", "commit": "2fb32681361f37533455d20aaa7fc6eb11b0fa4b" },
"vim-bazel": { "branch": "master", "commit": "31b0d5e4f51da1aeb56d65bf505a744e6de405de" },
"vim-better-whitespace": { "branch": "master", "commit": "1b22dc57a2751c7afbc6025a7da39b7c22db635d" },
"vim-dirdiff": { "branch": "master", "commit": "84bc8999fde4b3c2d8b228b560278ab30c7ea4c9" },
"vim-imp": { "branch": "main", "commit": "394e926ce62010443731f3923031e5afa1279f3e" },
"vim-indent-guides": { "branch": "master", "commit": "a1e1390c0136e63e813d051de2003bf0ee18ae30" },
"vim-maktaba": { "branch": "master", "commit": "fe95bb10f6bb250943a44632107f6a3d76ce5f28" },
"vim-matchup": { "branch": "master", "commit": "17cc05867cb3314761e4baa20115a27120f8e82c" },

View File

@ -11,20 +11,21 @@ windows:
- other:
- hgd gmscore
- experimental:
- experiments:
layout: main-horizontal
panes:
- main:
- hgd experimental
- hgd experiments
- vim
- other:
- hgd experimental
- hgd experiments
- notes:
panes:
- main:
- cd ~/zettelkasten
- vim ~/zettelkasten/Todo.md
- dotfiles:
layout: main-horizontal
panes:

View File

@ -1,71 +0,0 @@
vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
local colors = require("catppuccin.palettes").get_palette()
require("catppuccin").setup({
flavour = "macchiato",
integrations = {
cmp = true,
-- coc_nvim = false,
dashboard = true,
-- fern = false,
fidget = true,
gitgutter = true,
gitsigns = true,
-- hop = false,
-- illuminate = false,
-- leap = false,
-- lightspeed = false,
-- lsp_saga = false,
lsp_trouble = true,
mason = true,
markdown = true,
-- neogit = false,
-- neotest = false,
neotree = true,
notify = true,
-- nvimtree = true,
-- overseer = false,
-- pounce = false,
symbols_outline = true,
telescope = true,
treesitter = true,
treesitter_context = false,
-- ts_rainbow = false,
-- vim_sneak = false,
-- vimwiki = false,
which_key = true,
-- Special integrations, see https://github.com/catppuccin/nvim#special-integrations
dap = {
enabled = false,
enable_ui = false,
},
indent_blankline = {
enabled = true,
colored_indent_levels = false,
},
native_lsp = {
enabled = true,
virtual_text = {
errors = { "italic" },
hints = { "italic" },
warnings = { "italic" },
information = { "italic" },
},
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
},
},
},
custom_highlights = {
Identifier = { fg = colors.lavender },
Statement = { fg = colors.rosewater },
-- Identifier = { fg = colors.sapphire },
Function = { fg = colors.mauve },
},
})
vim.api.nvim_command("colorscheme catppuccin")

View File

@ -1,206 +0,0 @@
local map = require("utils").map
map("n", "<leader>db", ":lua require'dap'.toggle_breakpoint()<CR>")
map("n", "<leader>dsi", ":lua require'dap'.step_into()<CR>")
map("n", "<leader>dso", ":lua require'dap'.step_over()<CR>")
map("n", "<leader>di", ":lua require'dap'.repl.open()<CR>")
local on_attach = function(client, bufnr)
require("jdtls.setup").add_commands()
require("jdtls").setup_dap()
require("lsp-status").register_progress()
-- require'lspkind'.init()
-- require'lspsaga'.init_lsp_saga()
-- Kommentary
vim.api.nvim_set_keymap("n", "<leader>/", "<plug>kommentary_line_default", {})
vim.api.nvim_set_keymap("v", "<leader>/", "<plug>kommentary_visual_default", {})
vim.api.nvim_exec(
[[
augroup FormatAutogroup
autocmd!
autocmd BufWritePost *.java FormatWrite
augroup end
]],
true
)
local function buf_set_keymap(...)
vim.api.nvim_buf_set_keymap(bufnr, ...)
end
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
-- Mappings.
local opts = { noremap = true, silent = true }
-- buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
-- buf_set_keymap('n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
-- buf_set_keymap('n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
-- buf_set_keymap('n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
-- buf_set_keymap('n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
-- buf_set_keymap('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
-- buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references() && vim.cmd("copen")<CR>', opts)
-- buf_set_keymap('n', '<leader>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
-- buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
-- buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
-- buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
-- Java specific
-- buf_set_keymap("n", "<leader>di", "<Cmd>lua require'jdtls'.organize_imports()<CR>", opts)
-- buf_set_keymap("n", "<leader>dt", "<Cmd>lua require'jdtls'.test_class()<CR>", opts)
-- buf_set_keymap("n", "<leader>dn", "<Cmd>lua require'jdtls'.test_nearest_method()<CR>", opts)
buf_set_keymap("v", "<leader>de", "<Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>", opts)
buf_set_keymap("n", "<leader>de", "<Cmd>lua require('jdtls').extract_variable()<CR>", opts)
buf_set_keymap("v", "<leader>dm", "<Esc><Cmd>lua require('jdtls').extract_method(true)<CR>", opts)
vim.api.nvim_exec(
[[
hi LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
hi LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
hi LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
augroup lsp_document_highlight
autocmd!
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]],
false
)
end
local root_markers = { "gradlew", "pom.xml", "BUILD" }
local root_dir = require("jdtls.setup").find_root(root_markers)
local home = os.getenv("HOME")
local capabilities = {
workspace = {
configuration = true,
},
textDocument = {
completion = {
completionItem = {
snippetSupport = true,
},
},
},
}
local workspace_folder = home .. "/.workspace" .. vim.fn.fnamemodify(root_dir, ":p:h:t")
local config = {
flags = {
allow_incremental_sync = true,
},
capabilities = capabilities,
on_attach = on_attach,
}
config.settings = {
["java.format.settings.url"] = home .. "/.config/nvim/language-servers/java-google-formatter.xml",
["java.format.settings.profile"] = "GoogleStyle",
java = {
signatureHelp = { enabled = true },
contentProvider = { preferred = "fernflower" },
completion = {
favoriteStaticMembers = {
"org.hamcrest.MatcherAssert.assertThat",
"org.hamcrest.Matchers.*",
"org.hamcrest.CoreMatchers.*",
"org.junit.jupiter.api.Assertions.*",
"java.util.Objects.requireNonNull",
"java.util.Objects.requireNonNullElse",
"org.mockito.Mockito.*",
},
},
sources = {
organizeImports = {
starThreshold = 9999,
staticStarThreshold = 9999,
},
},
codeGeneration = {
toString = {
template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}",
},
},
configuration = {
runtimes = {
{
name = "JavaSE-11",
path = home .. "/.sdkman/candidates/java/11.0.10-open/",
},
{
name = "JavaSE-14",
path = home .. "/.sdkman/candidates/java/14.0.2-open/",
},
{
name = "JavaSE-15",
path = home .. "/.sdkman/candidates/java/15.0.1-open/",
},
},
},
},
}
config.cmd = { "javalsp", workspace_folder }
config.on_attach = on_attach
config.on_init = function(client, _)
client.notify("workspace/didChangeConfiguration", { settings = config.settings })
end
local extendedClientCapabilities = require("jdtls").extendedClientCapabilities
extendedClientCapabilities.resolveAdditionalTextEditsSupport = true
config.init_options = {
-- bundles = bundles;
extendedClientCapabilities = extendedClientCapabilities,
}
-- UI
local finders = require("telescope.finders")
local sorters = require("telescope.sorters")
local actions = require("telescope.actions")
local pickers = require("telescope.pickers")
require("jdtls.ui").pick_one_async = function(items, prompt, label_fn, cb)
local opts = {}
pickers
.new(opts, {
prompt_title = prompt,
finder = finders.new_table({
results = items,
entry_maker = function(entry)
return {
value = entry,
display = label_fn(entry),
ordinal = label_fn(entry),
}
end,
}),
sorter = sorters.get_generic_fuzzy_sorter(),
attach_mappings = function(prompt_bufnr)
actions.goto_file_selection_edit:replace(function()
local selection = actions.get_selected_entry(prompt_bufnr)
actions.close(prompt_bufnr)
cb(selection.value)
end)
return true
end,
})
:find()
end
local dap = require("dap")
dap.configurations.java = {
{
type = "java",
request = "attach",
name = "Debug (Attach) - Remote",
hostName = "127.0.0.1",
port = 5005,
},
}
-- Server
require("jdtls").start_or_attach(config)

View File

@ -94,15 +94,6 @@ return {
require("libp").setup()
end,
},
{
"catppuccin/nvim",
name = "catppuccin",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
require("config.catppuccin")
end,
},
{
"ojroques/nvim-osc52",
config = function()

View File

@ -0,0 +1,79 @@
return {
"catppuccin/nvim",
name = "catppuccin",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
local colors = require("catppuccin.palettes").get_palette()
require("catppuccin").setup({
flavour = "macchiato",
integrations = {
cmp = true,
-- coc_nvim = false,
dashboard = true,
-- fern = false,
fidget = true,
gitgutter = true,
gitsigns = true,
-- hop = false,
-- illuminate = false,
-- leap = false,
-- lightspeed = false,
-- lsp_saga = false,
lsp_trouble = true,
mason = true,
markdown = true,
-- neogit = false,
-- neotest = false,
neotree = true,
notify = true,
-- nvimtree = true,
-- overseer = false,
-- pounce = false,
symbols_outline = true,
telescope = true,
treesitter = true,
treesitter_context = false,
-- ts_rainbow = false,
-- vim_sneak = false,
-- vimwiki = false,
which_key = true,
-- Special integrations, see https://github.com/catppuccin/nvim#special-integrations
dap = {
enabled = false,
enable_ui = false,
},
indent_blankline = {
enabled = true,
colored_indent_levels = false,
},
native_lsp = {
enabled = true,
virtual_text = {
errors = { "italic" },
hints = { "italic" },
warnings = { "italic" },
information = { "italic" },
},
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
},
},
},
custom_highlights = {
Identifier = { fg = colors.lavender },
Statement = { fg = colors.rosewater },
-- Identifier = { fg = colors.sapphire },
Function = { fg = colors.mauve },
},
})
vim.api.nvim_command("colorscheme catppuccin")
end,
}

View File

@ -46,8 +46,8 @@ return {
local conditionalSources = cmp.config.sources({
{ name = "nvim_lsp", priority = 6 },
{ name = "nvim_lsp_signature_help", priority = 7 },
{ name = "luasnip", priority = 8 },
{ name = "nvim_lsp_signature_help", priority = 6 },
{ name = "luasnip", priority = 7 },
{ name = "calc" },
{ name = "crates" },
{ name = "nvim_lua" },
@ -69,7 +69,7 @@ return {
if use_google() then
require("cmp_nvim_ciderlsp").setup()
table.insert(conditionalSources, { name = "analysislsp" })
table.insert(conditionalSources, { name = "nvim_ciderlsp", priority = 9 })
table.insert(conditionalSources, { name = "nvim_ciderlsp", priority = 8 })
else
table.insert(conditionalSources, { name = "cmp_tabnine" })
end
@ -140,7 +140,7 @@ return {
sorting = {
comparators = {
cmp.config.compare.priority,
-- cmp.config.compare.priority,
cmp.config.compare.offset,
cmp.config.compare.exact,
cmp.config.compare.score,
@ -160,6 +160,8 @@ return {
formatting = {
format = lspkind.cmp_format({
with_text = true,
-- mode = "symbol_text",
-- before = function(entry, vim_item)
-- if entry.source.name == "nvim_ciderlsp" then
@ -172,7 +174,7 @@ return {
-- end
-- return vim_item
-- end,
maxwidth = 40, -- half max width
maxwidth = 50, -- half max width
menu = {
nvim_ciderlsp = "",
buffer = "",

View File

@ -1,44 +0,0 @@
return {
"mhartington/formatter.nvim",
config = function()
-- Utilities for creating configurations
local util = require("formatter.util")
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
require("formatter").setup({
-- Enable or disable logging
logging = true,
-- Set the log level
log_level = vim.log.levels.WARN,
-- All formatter configurations are opt-in
filetype = {
-- 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
},
})
vim.cmd([[
augroup FormatAutogroup
autocmd!
autocmd BufWritePost * FormatWrite
augroup END
]])
end,
}

View File

@ -44,15 +44,30 @@ return {
{
name = "relatedfiles",
dir = "/usr/share/vim/google/relatedfiles",
dependencies = { "maktaba", "glaive" },
dependencies = { "glaive" },
config = function()
vim.cmd([[ Glaive relatedfiles plugin[mappings] ]])
vim.cmd([[Glaive relatedfiles]])
end,
keys = {
{
"<leader>rb",
":exec relatedfiles#selector#JumpToBuild()<CR>",
},
{
"<leader>rt",
":exec relatedfiles#selector#JumpToTestFile()<CR>",
},
{
"<leader>rc",
":exec relatedfiles#selector#JumpToCodeFile()<CR>",
},
},
},
{
name = "codefmt",
dir = "/usr/share/vim/google/codefmt",
dependencies = { "maktaba", "glaive" },
dependencies = { "glaive" },
config = function()
vim.cmd(
[[Glaive codefmt ktfmt_executable=`["/google/bin/releases/kotlin-google-eng/ktfmt/ktfmt_deploy.jar", "--google-style"]`]]
@ -62,7 +77,7 @@ return {
{
name = "imp-google",
dir = "/usr/share/vim/google/imp-google",
dependencies = { "maktaba", "vim-imp", "glaive" },
dependencies = { "vim-imp", "glaive" },
config = function()
require("config.imp-google")
end,

View File

@ -44,6 +44,7 @@ return {
configs.ast_grep = {
default_config = {
cmd = { "sg", "lsp" },
offset_encoding = "utf-8",
filetypes = {
"c",
"cpp",
@ -70,6 +71,7 @@ return {
"--tooltag=nvim-cmp",
"--forward_sync_responses",
},
offset_encoding = "utf-8",
filetypes = {
"c",
"cpp",
@ -98,6 +100,7 @@ return {
"--lint_on_save=false",
"--max_qps=10",
},
offset_encoding = "utf-8",
filetypes = {
"c",
"cpp",

View File

@ -12,9 +12,6 @@ return {
-- Catch insensitive, inconsiderate writing.
null_ls.builtins.diagnostics.alex,
-- buildifier is a tool for formatting and linting bazel BUILD, WORKSPACE, and .bzl files.
null_ls.builtins.diagnostics.buildifier,
-- Codespell finds common misspellings in text files.
null_ls.builtins.diagnostics.codespell,
-- null_ls.builtins.diagnostics.cspell, null_ls.builtins.code_actions.cspell,
@ -26,9 +23,33 @@ return {
null_ls.builtins.formatting.google_java_format,
-- XML
null_ls.builtins.diagnostics.tidy,
-- null_ls.builtins.formatting.xmlformat
-- null_ls.builtins.diagnostics.tidy,
-- null_ls.builtins.formatting.xmlformat,
-- null_ls.builtins.formatting.xq,
-- null_ls.builtins.formatting.xmllint.with({ extra_args = { "--pretty", "2" } }),
null_ls.builtins.formatting.tidy.with({
filetypes = { "xml" },
args = {
"-xml",
"-quiet",
"-wrap",
"--tidy-mark",
"no",
"--indent",
"yes",
"--indent-spaces",
"2",
"--indent-attributes",
"yes",
"--sort-attributes",
"alpha",
"--wrap-attributes",
"yes",
"--vertical-space",
"yes",
"-",
},
}),
null_ls.builtins.formatting.stylua,
}
@ -48,8 +69,25 @@ return {
})
end
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup({
on_init = function(new_client, _)
new_client.offset_encoding = "utf-8"
end,
sources = sources,
-- you can reuse a shared lspconfig on_attach callback here
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ async = false })
end,
})
end
end,
})
end,
}