Compare commits

...

3 commits

Author SHA1 Message Date
Alex Selimov
12b25aa2b4
Fix markdown errors when opening java files 2025-09-03 11:39:49 -04:00
Alex Selimov
66f4f32dc6
Pull out java version into environment variable 2025-09-03 11:36:49 -04:00
Alex Selimov
762c673365
Fix java configuration 2025-09-03 11:21:58 -04:00
4 changed files with 32 additions and 5 deletions

View file

@ -1 +1,4 @@
vim.opt_local.shiftwidth = 2
vim.opt_local.tabstop = 2
vim.opt_local.tw = 180
vim.opt_local.colorcolumn = "+1"

View file

@ -1 +0,0 @@
set tw=120

View file

@ -13,7 +13,7 @@ return {
"godlygeek/tabular", "godlygeek/tabular",
"tpope/vim-sleuth", "tpope/vim-sleuth",
"norcalli/nvim-colorizer.lua", "norcalli/nvim-colorizer.lua",
"ixru/nvim-markdown", { "ixru/nvim-markdown", ft = "markdown" },
"KeitaNakamura/tex-conceal.vim", "KeitaNakamura/tex-conceal.vim",
"skywind3000/asyncrun.vim", "skywind3000/asyncrun.vim",
"airblade/vim-gitgutter", "airblade/vim-gitgutter",

View file

@ -3,6 +3,7 @@
return { return {
{ {
"mfussenegger/nvim-jdtls", "mfussenegger/nvim-jdtls",
ft = "java",
config = function() config = function()
local jdtls = require("jdtls") local jdtls = require("jdtls")
@ -12,8 +13,31 @@ return {
-- Path to your exported Eclipse/IntelliJ style xml -- Path to your exported Eclipse/IntelliJ style xml
local style_path = vim.fn.expand("~/.config/nvim/GoogleStyle.xml") local style_path = vim.fn.expand("~/.config/nvim/GoogleStyle.xml")
local java_home = os.getenv("NVIM_JDTLS_JAVA_HOME")
local config = { local config = {
cmd = { "jdtls" }, -- or path to your startup script cmd = {
java_home .. "/bin/java",
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
"-Dosgi.bundles.defaultStartLevel=4",
"-Declipse.product=org.eclipse.jdt.ls.core.product",
"-Dlog.protocol=true",
"-Dlog.level=ALL",
"-Xms1g",
"--add-modules=ALL-SYSTEM",
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang=ALL-UNNAMED",
"-jar",
vim.fn.glob(
vim.fn.stdpath("data") .. "/mason/packages/jdtls/plugins/org.eclipse.equinox.launcher_*.jar"
),
"-configuration",
vim.fn.glob(vim.fn.stdpath("data") .. "/mason/packages/jdtls/config_mac"),
"-data",
vim.fn.expand("~/.cache/jdtls-workspace/") .. "/" .. root_dir:gsub(":", "_"),
},
root_dir = root_dir, root_dir = root_dir,
settings = { settings = {
java = { java = {
@ -163,6 +187,7 @@ return {
local ensure_installed = vim.tbl_keys(servers or {}) local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, { vim.list_extend(ensure_installed, {
"jdtls",
"stylua", "stylua",
"black", "black",
"clang-format", "clang-format",
@ -190,4 +215,4 @@ return {
}) })
end, end,
}, },
} }