Compare commits

...

3 Commits

Author SHA1 Message Date
dc788b1c00 fix mason 2023-02-04 17:25:37 +01:00
4027ba20a2 disable stuff 2023-02-04 16:46:27 +01:00
057b357f05 update nvim 2023-02-03 16:08:09 +01:00
28 changed files with 246 additions and 64 deletions

View File

@@ -1,4 +0,0 @@
return {
fg = "#abb2bf",
bg = "#1e222a",
}

View File

@@ -1,13 +0,0 @@
return function(hl) -- or a function that returns a new table of colors to set
local C = require "default_theme.colors"
hl.Normal = { fg = C.fg, bg = C.bg }
-- New approach instead of diagnostic_style
hl.DiagnosticError.italic = true
hl.DiagnosticHint.italic = true
hl.DiagnosticInfo.italic = true
hl.DiagnosticWarn.italic = true
return hl
end

View File

@@ -1,21 +0,0 @@
return {
aerial = true,
beacon = false,
bufferline = true,
cmp = true,
dashboard = true,
highlighturl = true,
hop = false,
indent_blankline = true,
lightspeed = false,
["neo-tree"] = true,
notify = true,
["nvim-tree"] = false,
["nvim-web-devicons"] = true,
rainbow = true,
symbols_outline = false,
telescope = true,
treesitter = true,
vimwiki = false,
["which-key"] = true,
}

4
heirline/attributes.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
-- styling choices for each heirline element, check possible attributes with `:h attr-list`
git_branch = { bold = true }, -- bold the git branch statusline component
}

4
heirline/colors.lua Normal file
View File

@@ -0,0 +1,4 @@
return function(colors)
colors.git_branch_fg = astronvim.get_hlgroup("Conditional").fg
return colors
end

View File

@@ -0,0 +1,8 @@
return {
breadcrumbs = false, -- LSP symbols in the breadcrumbs
file_icon = {
winbar = false, -- Filetype icon in the winbar inactive windows
statusline = true, -- Filetype icon in the statusline
tabline = true, -- Filetype icon in the tabline
},
}

5
heirline/separators.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
breadcrumbs = " > ",
tab = { "", "" },
}

9
lazy.lua Normal file
View File

@@ -0,0 +1,9 @@
return {
defaults = { lazy = true },
performance = {
rtp = {
-- customize default disabled vim plugins
disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin", "matchparen" },
},
},
}

6
lsp/config/denols.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
denols = function(opts)
opts.root_dir = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc")
return opts
end,
}

6
lsp/config/eslint.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
eslint = function(opts)
opts.root_dir = require("lspconfig.util").root_pattern("package.json", ".eslintrc.json", ".eslintrc.js")
return opts
end,
}

53
lsp/config/jdtls.lua Normal file
View File

@@ -0,0 +1,53 @@
return {
jdtls = function(opts)
-- use this function notation to build some variables
local root_markers = { ".git", "mvnw", "gradlew", "pom.xml", "build.gradle" }
local root_dir = require("jdtls.setup").find_root(root_markers)
-- calculate workspace dir
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
local workspace_dir = vim.fn.stdpath "data" .. "/site/java/workspace-root/" .. project_name
os.execute("mkdir " .. workspace_dir)
-- get the mason install path
local install_path = require("mason-registry").get_package("jdtls"):get_install_path()
-- get the current OS
local os
print(os)
if vim.fn.has "macunix" then
os = "mac"
elseif vim.fn.has "win32" then
os = "win"
else
os = "linux"
end
-- return the server config
return {
cmd = {
"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",
"-javaagent:" .. install_path .. "/lombok.jar",
"-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(install_path .. "/plugins/org.eclipse.equinox.launcher_*.jar"),
"-configuration",
install_path .. "/config_" .. os,
"-data",
workspace_dir,
},
root_dir = root_dir,
}
end,
}

6
lsp/config/tsserver.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
tsserver = function(opts)
opts.root_dir = require("lspconfig.util").root_pattern "package.json"
return opts
end,
}

17
lsp/setup_handlers.lua Normal file
View File

@@ -0,0 +1,17 @@
return {
-- keys for a specific server name will be used for that LSP
--jdtls = function(server, opts)
-- -- custom sumneko_lua setup handler
-- require("lspconfig")["sumneko_lua"].setup(opts)
--end,
rust_analyzer = function(_, opts) require("rust-tools").setup { server = opts } end,
jdtls = function(_, opts)
vim.api.nvim_create_autocmd("Filetype", {
pattern = "java", -- autocmd to start jdtls
callback = function()
if opts.root_dir and opts.root_dir ~= "" then require("jdtls").start_or_attach(opts) end
end,
})
end,
}

View File

@@ -9,6 +9,9 @@ return {
["<leader>bt"] = { "<cmd>BufferLineSortByTabs<cr>", desc = "Sort by tabs" },
-- quick save
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
["<leader>b"] = { name = "Buffer" },
["<leader>P"] = { "<cmd>Telescope projects<cr>", desc = "projects" },
["<leader>."] = { "<cmd>Ranger<cr>", desc = "ranger" },
},
t = {
-- setting a mapping to false will disable it

View File

@@ -17,14 +17,14 @@ return {
autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
ui_notifications_enabled = true, -- disable notifications when toggling UI elements
heirline_bufferline = true, -- enable new heirline based bufferline (requires :PackerSync after changing)
--heirline_bufferline = true, -- enable new heirline based bufferline (requires :PackerSync after changing)
vim_markdown_folding_disabled = 1,
vim_markdown_conceal = 1,
tex_conceal = "",
vim_markdown_math = 1,
vim_markdown_frontmatter = 1,
vim_markdown_toml_frontmatter = 1,
vim_markdown_json_frontmatter = 1,
--vim_markdown_folding_disabled = 1,
--vim_markdown_conceal = 1,
--tex_conceal = "",
--vim_markdown_math = 1,
--vim_markdown_frontmatter = 1,
--vim_markdown_toml_frontmatter = 1,
--vim_markdown_json_frontmatter = 1,
},
}

4
plugins/crates-nvim.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
"Saecki/crates.nvim",
config = function() require("crates").setup() end,
}

8
plugins/heirline.lua Normal file
View File

@@ -0,0 +1,8 @@
return {
"rebelot/heirline.nvim",
opts = function(_, opts)
opts.tabline[2] =
astronvim.status.heirline.make_buflist(astronvim.status.component.tabline_file_info { close_button = false })
return opts
end,
}

View File

@@ -1,7 +1,7 @@
return {
"williamboman/mason-lspconfig.nvim",
opts = {
ensure_installed = { "sumneko_lua", "rust_analyzer", "gopls", "yamlls", "tsserver", "terraformls" },
automatic_installation = true,
ensure_installed = { "sumneko_lua", "gopls", "yamlls", "tsserver", "terraformls", "jsonls", "jdtls" },
automatic_installation = { exclude = { "rust_analyzer" } },
},
}

View File

@@ -1,4 +1,36 @@
return { -- overrides `require("mason-null-ls").setup(...)`
"jay-babu/mason-null-ls.nvim",
opts = { ensure_installed = { "prettier", "stylua" } },
config = function(_, opts)
local mason_null_ls = require("mason-null-ls")
local null_ls = require "null-ls"
mason_null_ls.setup(opts)
mason_null_ls.setup_handlers { -- setup custom handlers
prettier = function()
require("null-ls").register(null_ls.builtins.formatting.prettier.with {
condition = function(utils)
return utils.root_has_file "package.json"
or utils.root_has_file ".prettierrc"
or utils.root_has_file ".prettierrc.json"
or utils.root_has_file ".prettierrc.js"
end,
})
end,
-- For prettierd:
-- prettierd = function()
-- require("null-ls").register(require("null-ls").builtins.formatting.prettierd.with({
-- condition = function(utils)
-- return utils.root_has_file("package.json") or utils.root_has_file(".prettierrc") or utils.root_has_file(".prettierrc.json") or utils.root_has_file(".prettierrc.js")
-- end
-- }))
-- end,
-- For eslint_d:
-- eslint_d = function()
-- require("null-ls").register(require("null-ls").builtins.diagnostics.eslint_d.with({
-- condition = function(utils)
-- return utils.root_has_file("package.json") or utils.root_has_file(".eslintrc.json") or utils.root_has_file(".eslintrc.js")
-- end
-- }))
-- end,
}
end,
}

View File

@@ -0,0 +1,31 @@
return {
"jay-babu/mason-nvim-dap.nvim",
config = function(_, opts)
-- do more configuration as needed
local mason_nvim_dap = require "mason-nvim-dap"
mason_nvim_dap.setup(opts)
mason_nvim_dap.setup_handlers {
python = function(source_name)
local dap = require "dap"
dap.adapters.python = {
type = "executable",
command = "/usr/bin/python3",
args = {
"-m",
"debugpy.adapter",
},
}
dap.configurations.python = {
{
type = "python",
request = "launch",
name = "Launch file",
program = "${file}", -- This configuration will launch the current file if used.
},
}
end,
}
end,
}

24
plugins/nvim-cmp.lua Normal file
View File

@@ -0,0 +1,24 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-emoji", -- add cmp source as dependency of cmp
},
-- override the options table that is used in the `require("cmp").setup()` call
opts = function(_, opts)
-- opts parameter is the default options table
-- the function is lazy loaded so cmp is able to be required
local cmp = require "cmp"
-- modify the sources part of the options table
opts.sources = cmp.config.sources {
{ name = "nvim_lsp", priority = 1000 },
{ name = "luasnip", priority = 750 },
{ name = "buffer", priority = 500 },
{ name = "path", priority = 250 },
{ name = "emoji", priority = 700 }, -- add new source
{ name = "crates", priority = 1000 },
}
-- return the new table to be used
return opts
end,
}

3
plugins/nvim-jdtls.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"mfussenegger/nvim-jdtls", -- load jdtls on module
}

4
plugins/nvim-metals.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
"scalameta/nvim-metals",
dependencies = { "nvim-lua/plenary.nvim" },
}

View File

@@ -1,5 +1,6 @@
return {
after = "telescope.nvim",
"pwntester/octo.nvim",
event = "UIEnter",
config = function() require("octo").setup() end,
}

View File

@@ -1,4 +1,5 @@
return {
"kjuulh/ranger.nvim",
event = "UIEnter",
config = function() require("ranger").setup {} end,
}

3
plugins/rust-tools.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"simrat39/rust-tools.nvim",
}

View File

@@ -1,11 +1,12 @@
return {
remote = "origin", -- remote to use
--remote = "origin", -- remote to use
--channel = "stable", -- "stable" or "nightly"
channel = "nightly", -- "stable" or "nightly"
--version = "v2.11.7", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
--version="latest",
branch = "v3", -- branch name (NIGHTLY ONLY)
--commit = nil, -- commit hash (NIGHTLY ONLY)
pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
--pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
skip_prompts = false, -- skip prompts about breaking changes
show_changelog = true, -- show the changelog after performing an update
auto_reload = false, -- automatically reload and sync packer after a successful update

View File

@@ -1,13 +0,0 @@
return {
-- first key is the mode, n == normal mode
n = {
-- second key is the prefix, <leader> prefixes
["<leader>"] = {
-- third key is the key to bring up next level and its displayed
-- group name in which-key top level menu
["b"] = { name = "Buffer" },
["P"] = { "<cmd>Telescope projects<cr>", "projects" },
["."] = { "<cmd>Ranger<cr>", "ranger" },
},
},
}