update
This commit is contained in:
parent
9b2c407172
commit
6260524b90
|
|
@ -0,0 +1,157 @@
|
||||||
|
-- JDTLS (Java LSP) configuration
|
||||||
|
local home = vim.env.HOME -- Get the home directory
|
||||||
|
|
||||||
|
local jdtls = require 'jdtls'
|
||||||
|
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')
|
||||||
|
local workspace_dir = home .. '/jdtls-workspace/' .. project_name
|
||||||
|
|
||||||
|
local system_os = ''
|
||||||
|
|
||||||
|
-- Determine OS
|
||||||
|
if vim.fn.has 'mac' == 1 then
|
||||||
|
system_os = 'mac'
|
||||||
|
elseif vim.fn.has 'unix' == 1 then
|
||||||
|
system_os = 'linux'
|
||||||
|
elseif vim.fn.has 'win32' == 1 or vim.fn.has 'win64' == 1 then
|
||||||
|
system_os = 'win'
|
||||||
|
else
|
||||||
|
print "OS not found, defaulting to 'linux'"
|
||||||
|
system_os = 'linux'
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Needed for debugging
|
||||||
|
local bundles = {
|
||||||
|
vim.fn.glob(home .. '/.local/share/nvim/mason/share/java-debug-adapter/com.microsoft.java.debug.plugin.jar'),
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Needed for running/debugging unit tests
|
||||||
|
vim.list_extend(bundles, vim.split(vim.fn.glob(home .. '/.local/share/nvim/mason/share/java-test/*.jar', 1), '\n'))
|
||||||
|
|
||||||
|
-- See `:help vim.lsp.start_client` for an overview of the supported `config` options.
|
||||||
|
local config = {
|
||||||
|
-- The command that starts the language server
|
||||||
|
-- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line
|
||||||
|
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:' .. home .. '/.local/share/nvim/mason/share/jdtls/lombok.jar',
|
||||||
|
'-Xmx4g',
|
||||||
|
'--add-modules=ALL-SYSTEM',
|
||||||
|
'--add-opens',
|
||||||
|
'java.base/java.util=ALL-UNNAMED',
|
||||||
|
'--add-opens',
|
||||||
|
'java.base/java.lang=ALL-UNNAMED',
|
||||||
|
|
||||||
|
-- Eclipse jdtls location
|
||||||
|
'-jar',
|
||||||
|
home .. '/.local/share/nvim/mason/share/jdtls/plugins/org.eclipse.equinox.launcher.jar',
|
||||||
|
'-configuration',
|
||||||
|
home .. '/.local/share/nvim/mason/packages/jdtls/config_' .. system_os,
|
||||||
|
'-data',
|
||||||
|
workspace_dir,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- This is the default if not provided, you can remove it. Or adjust as needed.
|
||||||
|
-- One dedicated LSP server & client will be started per unique root_dir
|
||||||
|
root_dir = require('jdtls.setup').find_root { '.git', 'mvnw', 'pom.xml', 'build.gradle' },
|
||||||
|
|
||||||
|
-- Here you can configure eclipse.jdt.ls specific settings
|
||||||
|
-- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
|
||||||
|
settings = {
|
||||||
|
java = {
|
||||||
|
-- TODO Replace this with the absolute path to your main java version (JDTLS requires JDK 21 or higher)
|
||||||
|
home = '/usr/lib/jvm/java-21-openjdk',
|
||||||
|
eclipse = {
|
||||||
|
downloadSources = true,
|
||||||
|
},
|
||||||
|
configuration = {
|
||||||
|
updateBuildConfiguration = 'interactive',
|
||||||
|
-- TODO Update this by adding any runtimes that you need to support your Java projects and removing any that you don't have installed
|
||||||
|
-- The runtimes' name parameter needs to match a specific Java execution environments. See https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request and search "ExecutionEnvironment".
|
||||||
|
runtimes = {
|
||||||
|
{
|
||||||
|
name = 'JavaSE-21',
|
||||||
|
path = '/usr/lib/jvm/java-21-openjdk',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'JavaSE-25',
|
||||||
|
path = '/usr/lib/jvm/java-25-openjdk',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
maven = {
|
||||||
|
downloadSources = true,
|
||||||
|
},
|
||||||
|
implementationsCodeLens = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
referencesCodeLens = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
references = {
|
||||||
|
includeDecompiledSources = true,
|
||||||
|
},
|
||||||
|
signatureHelp = { enabled = true },
|
||||||
|
format = {
|
||||||
|
enabled = true,
|
||||||
|
-- Formatting works by default, but you can refer to a specific file/URL if you choose
|
||||||
|
-- settings = {
|
||||||
|
-- url = "https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml",
|
||||||
|
-- profile = "GoogleStyle",
|
||||||
|
-- },
|
||||||
|
},
|
||||||
|
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.*',
|
||||||
|
},
|
||||||
|
importOrder = {
|
||||||
|
'java',
|
||||||
|
'javax',
|
||||||
|
'com',
|
||||||
|
'org',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
organizeImports = {
|
||||||
|
starThreshold = 9999,
|
||||||
|
staticStarThreshold = 9999,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
codeGeneration = {
|
||||||
|
toString = {
|
||||||
|
template = '${object.className}{${member.name()}=${member.value}, ${otherMembers}}',
|
||||||
|
},
|
||||||
|
useBlocks = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Needed for auto-completion with method signatures and placeholders
|
||||||
|
capabilities = require('blink-cmp').get_lsp_capabilities(),
|
||||||
|
flags = {
|
||||||
|
allow_incremental_sync = true,
|
||||||
|
},
|
||||||
|
init_options = {
|
||||||
|
-- References the bundles defined above to support Debugging and Unit Testing
|
||||||
|
bundles = bundles,
|
||||||
|
extendedClientCapabilities = jdtls.extendedClientCapabilities,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Needed for debugging
|
||||||
|
config['on_attach'] = function(client, bufnr)
|
||||||
|
jdtls.setup_dap { hotcodereplace = 'auto' }
|
||||||
|
require('jdtls.dap').setup_dap_main_class_configs()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- This starts a new client & server, or attaches to an existing client & server based on the `root_dir`.
|
||||||
|
jdtls.start_or_attach(config)
|
||||||
1
init.lua
1
init.lua
|
|
@ -513,7 +513,6 @@ rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- [[ Configure and install plugins ]]
|
-- [[ Configure and install plugins ]]
|
||||||
require('lazy').setup({
|
require('lazy').setup({
|
||||||
|
|
||||||
{ import = 'kickstart.plugins' },
|
{ import = 'kickstart.plugins' },
|
||||||
{ import = 'kickstart.plugins.lsp' },
|
{ import = 'kickstart.plugins.lsp' },
|
||||||
{ import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,29 @@
|
||||||
{
|
{
|
||||||
"LazyVim": { "branch": "main", "commit": "b9d38f692015fecaa72d55282b74a3d601e4c9fa" },
|
|
||||||
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
||||||
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
||||||
"conform.nvim": { "branch": "master", "commit": "c64cc754ace603e185ab30113aaef174187eacf8" },
|
"conform.nvim": { "branch": "master", "commit": "fbcb4fa7f34bfea9be702ffff481a8e336ebf6ed" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
|
"fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" },
|
"gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" },
|
||||||
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
||||||
|
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
"lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
|
||||||
"lazydev.nvim": { "branch": "main", "commit": "258d2a5ef4a3e3d6d9ba9da72c9725c53e9afcbd" },
|
"lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" },
|
||||||
"lazygit.nvim": { "branch": "main", "commit": "2305deed25bc61b866d5d39189e9105a45cf1cfb" },
|
"lazygit.nvim": { "branch": "main", "commit": "2305deed25bc61b866d5d39189e9105a45cf1cfb" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
|
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "155eac5d8609a2f110041f8ac3491664cc126354" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" },
|
||||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "86389a3dd687cfaa647b6f44731e492970034baa" },
|
"mason-nvim-dap.nvim": { "branch": "main", "commit": "c971971f881d1be90252d281f384054d9d53e745" },
|
||||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
|
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "a83eabdc8c49c0c93bf5bb162fa3b57404a9d095" },
|
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||||
"matteblack.nvim": { "branch": "main", "commit": "3bfd406f3b2e41eb3458fe735e06447c08b67d03" },
|
"mini.nvim": { "branch": "main", "commit": "8a7cf7eee8d89bd1b83f6d72f7f3b5598e7ae2cb" },
|
||||||
"mini.nvim": { "branch": "main", "commit": "126ce3328c78399dcff58272f6f540a373b62a75" },
|
"nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
"nvim-dap": { "branch": "master", "commit": "6782b097af2417a4c3e33849b0a26ae2188bd7ea" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "7367cec8e8f7a0b1e4566af9a7ef5959d11206a7" },
|
|
||||||
"nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" },
|
"nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" },
|
||||||
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||||
"nvim-lint": { "branch": "master", "commit": "335a6044be16d7701001059cba9baa36fbeef422" },
|
"nvim-jdtls": { "branch": "master", "commit": "380ac148f989e1291aac002dc959ecc68c5243d0" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "db8fef885009fdec0daeff3e5dda92e1f539611e" },
|
"nvim-lint": { "branch": "master", "commit": "9da1fb942dd0668d5182f9c8dee801b9c190e2bb" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" },
|
||||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
|
@ -32,16 +32,17 @@
|
||||||
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
|
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
|
||||||
"oil-git-status.nvim": { "branch": "main", "commit": "4b5cf53842c17a09420919e655a6a559da3112d7" },
|
"oil-git-status.nvim": { "branch": "main", "commit": "4b5cf53842c17a09420919e655a6a559da3112d7" },
|
||||||
"oil.nvim": { "branch": "master", "commit": "919e155fdf38e9148cdb5304faaaf53c20d703ea" },
|
"oil.nvim": { "branch": "master", "commit": "71948729cda5fc1b761d6ae60ff774b5525f1d50" },
|
||||||
"oklch-color-picker.nvim": { "branch": "master", "commit": "ae318113cd7d0e4988b6b059327c2778911f1187" },
|
"oklch-color-picker.nvim": { "branch": "master", "commit": "da958405624e31336cc76ca0075f4a255e6c448a" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||||
"tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "29315861711f11daf75e1cf0953ab92ec1a3e69f" },
|
"tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "1cb11cc658ee24a9826e3b909ca0b0f5e60597c7" },
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
"todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" },
|
||||||
"trouble.nvim": { "branch": "main", "commit": "f176232e7759c4f8abd923c21e3e5a5c76cd6837" },
|
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" },
|
||||||
|
"trouble.nvim": { "branch": "main", "commit": "c098362fe603d3922095e7db595961e020bdf2d0" },
|
||||||
"vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" },
|
"vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" }
|
"which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,45 @@
|
||||||
-- transparent background
|
-- transparent background
|
||||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "FloatBorder", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'FloatBorder', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "Pmenu", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'Pmenu', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "Terminal", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'Terminal', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "EndOfBuffer", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'EndOfBuffer', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "FoldColumn", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'FoldColumn', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "Folded", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'Folded', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "SignColumn", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'SignColumn', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NormalNC', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "WhichKeyFloat", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'WhichKeyFloat', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "TelescopeBorder", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'TelescopeBorder', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "TelescopeNormal", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'TelescopeNormal', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "TelescopePromptBorder", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'TelescopePromptBorder', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "TelescopePromptTitle", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'TelescopePromptTitle', { bg = 'none' })
|
||||||
|
|
||||||
-- transparent background for neotree
|
-- transparent background for neotree
|
||||||
vim.api.nvim_set_hl(0, "NeoTreeNormal", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NeoTreeNormal', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NeoTreeNormalNC", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NeoTreeNormalNC', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NeoTreeVertSplit", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NeoTreeVertSplit', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NeoTreeWinSeparator", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NeoTreeWinSeparator', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NeoTreeEndOfBuffer", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NeoTreeEndOfBuffer', { bg = 'none' })
|
||||||
|
|
||||||
-- transparent background for nvim-tree
|
-- transparent background for nvim-tree
|
||||||
vim.api.nvim_set_hl(0, "NvimTreeNormal", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NvimTreeNormal', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NvimTreeVertSplit", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NvimTreeVertSplit', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NvimTreeEndOfBuffer", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NvimTreeEndOfBuffer', { bg = 'none' })
|
||||||
|
|
||||||
-- transparent notify background
|
-- transparent notify background
|
||||||
vim.api.nvim_set_hl(0, "NotifyINFOBody", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyINFOBody', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyERRORBody", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyERRORBody', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyWARNBody", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyWARNBody', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyTRACEBody", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyTRACEBody', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyDEBUGBody", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyDEBUGBody', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyINFOTitle", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyINFOTitle', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyERRORTitle", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyERRORTitle', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyWARNTitle", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyWARNTitle', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyTRACETitle", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyTRACETitle', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyDEBUGTitle", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyDEBUGTitle', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyINFOBorder", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyINFOBorder', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyERRORBorder", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyERRORBorder', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyWARNBorder", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyWARNBorder', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyTRACEBorder", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyTRACEBorder', { bg = 'none' })
|
||||||
vim.api.nvim_set_hl(0, "NotifyDEBUGBorder", { bg = "none" })
|
vim.api.nvim_set_hl(0, 'NotifyDEBUGBorder', { bg = 'none' })
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
return {
|
||||||
|
'ThePrimeagen/harpoon',
|
||||||
|
cmd = 'Harpoon',
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
'<leader>hh',
|
||||||
|
'<cmd>lua require("harpoon.ui").toggle_quick_menu()<cr>',
|
||||||
|
desc = 'Toggle Harpoon Quick Menu',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>ha',
|
||||||
|
'<cmd>lua require("harpoon.mark").add_file()<cr>',
|
||||||
|
desc = 'Mark Current File',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>hr',
|
||||||
|
'<cmd>lua require("harpoon.mark").clear_file()<cr>',
|
||||||
|
desc = 'Remove Current File',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>hn',
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_next()<cr>',
|
||||||
|
desc = 'Next Harpoon',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>hp',
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_prev()<cr>',
|
||||||
|
desc = 'Previous Harpoon',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>h&',
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_file(1)<cr>',
|
||||||
|
desc = 'Go to 1st Mark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>hé',
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_file(2)<cr>',
|
||||||
|
desc = 'Go to 2nd Mark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>h"',
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_file(3)<cr>',
|
||||||
|
desc = 'Go to 3rd Mark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>h'",
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_file(4)<cr>',
|
||||||
|
desc = 'Go to 4th Mark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>h(',
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_file(5)<cr>',
|
||||||
|
desc = 'Go to 5th Mark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>h§',
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_file(6)<cr>',
|
||||||
|
desc = 'Go to 6th Mark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>hè',
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_file(7)<cr>',
|
||||||
|
desc = 'Go to 7th Mark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>h!',
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_file(8)<cr>',
|
||||||
|
desc = 'Go to 8th Mark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>hç',
|
||||||
|
'<cmd>lua require("harpoon.ui").nav_file(9)<cr>',
|
||||||
|
desc = 'Go to 9th Mark',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
return {
|
|
||||||
-- lazy.nvim
|
|
||||||
{
|
|
||||||
'rcarriga/nvim-notify',
|
|
||||||
event = 'VeryLazy',
|
|
||||||
opts = {},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
return {
|
||||||
|
'rcarriga/nvim-notify',
|
||||||
|
event = 'VeryLazy',
|
||||||
|
config = function()
|
||||||
|
local notify = require 'notify'
|
||||||
|
notify.setup {
|
||||||
|
merge_duplicates = true,
|
||||||
|
background_colour = '#000000',
|
||||||
|
render = 'default',
|
||||||
|
timeout = 5000,
|
||||||
|
stages = 'fade',
|
||||||
|
icons = {
|
||||||
|
ERROR = '',
|
||||||
|
WARN = '',
|
||||||
|
INFO = '',
|
||||||
|
DEBUG = '',
|
||||||
|
TRACE = '✎',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
vim.notify = notify
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
@ -58,7 +58,6 @@ return {
|
||||||
vim.api.nvim_create_autocmd('User', {
|
vim.api.nvim_create_autocmd('User', {
|
||||||
pattern = 'OilEnter',
|
pattern = 'OilEnter',
|
||||||
callback = vim.schedule_wrap(function(args)
|
callback = vim.schedule_wrap(function(args)
|
||||||
local oil = require 'oil'
|
|
||||||
if vim.api.nvim_get_current_buf() == args.data.buf and oil.get_cursor_entry() then
|
if vim.api.nvim_get_current_buf() == args.data.buf and oil.get_cursor_entry() then
|
||||||
oil.open_preview()
|
oil.open_preview()
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,16 @@ return {
|
||||||
'<cmd>Trouble quickfix toggle<cr>',
|
'<cmd>Trouble quickfix toggle<cr>',
|
||||||
desc = 'Toggle Quickfix List',
|
desc = 'Toggle Quickfix List',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'<leader>qn',
|
||||||
|
'<cmd>cnext<cr>',
|
||||||
|
desc = 'Diagnostic Next',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>qp',
|
||||||
|
'<cmd>cprevious<cr>',
|
||||||
|
desc = 'Diagnostic Previous',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'<leader>ql',
|
'<leader>ql',
|
||||||
'<cmd>Trouble loclist toggle<cr>',
|
'<cmd>Trouble loclist toggle<cr>',
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
-- Elixir snippets
|
||||||
|
|
||||||
|
local ls = require 'luasnip'
|
||||||
|
local s = ls.snippet
|
||||||
|
local i = ls.insert_node
|
||||||
|
|
||||||
|
local fmt = require('luasnip.extras.fmt').fmt
|
||||||
|
|
||||||
|
ls.add_snippets('elixir', {
|
||||||
|
s('el', fmt('<%= {} %>{}', { i(1), i(0) })),
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
-- Kotlin snippets
|
||||||
|
|
||||||
|
local ls = require 'luasnip'
|
||||||
|
local s = ls.snippet
|
||||||
|
local i = ls.insert_node
|
||||||
|
local t = ls.text_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local c = ls.choice_node
|
||||||
|
local d = ls.dynamic_node
|
||||||
|
|
||||||
|
local fmt = require('luasnip.extras.fmt').fmt
|
||||||
|
|
||||||
|
ls.add_snippets('kotlin', {
|
||||||
|
s(
|
||||||
|
'comp',
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
@Composable
|
||||||
|
fun []([]) {
|
||||||
|
[]
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
i(1, 'name'),
|
||||||
|
i(2, 'params'),
|
||||||
|
i(3, 'body'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
delimiters = '[]',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
@ -4,29 +4,7 @@ return {
|
||||||
event = 'VimEnter',
|
event = 'VimEnter',
|
||||||
version = '1.*',
|
version = '1.*',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Snippet Engine
|
'L3MON4D3/LuaSnip',
|
||||||
{
|
|
||||||
'L3MON4D3/LuaSnip',
|
|
||||||
version = '2.*',
|
|
||||||
build = (function()
|
|
||||||
-- Build Step is needed for regex support in snippets.
|
|
||||||
-- This step is not supported in many windows environments.
|
|
||||||
-- Remove the below condition to re-enable on windows.
|
|
||||||
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
return 'make install_jsregexp'
|
|
||||||
end)(),
|
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
'rafamadriz/friendly-snippets',
|
|
||||||
config = function()
|
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
opts = {},
|
|
||||||
},
|
|
||||||
'folke/lazydev.nvim',
|
'folke/lazydev.nvim',
|
||||||
},
|
},
|
||||||
--- @module 'blink.cmp'
|
--- @module 'blink.cmp'
|
||||||
|
|
@ -83,7 +61,7 @@ return {
|
||||||
},
|
},
|
||||||
|
|
||||||
sources = {
|
sources = {
|
||||||
default = { 'lsp', 'path', 'snippets', 'lazydev' },
|
default = { 'lsp', 'path', 'snippets', 'lazydev', 'buffer' },
|
||||||
providers = {
|
providers = {
|
||||||
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
|
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,14 @@ return { -- Autoformat
|
||||||
-- have a well standardized coding style. You can add additional
|
-- have a well standardized coding style. You can add additional
|
||||||
-- languages here or re-enable it for the disabled ones.
|
-- languages here or re-enable it for the disabled ones.
|
||||||
local disable_filetypes = { c = true, cpp = true }
|
local disable_filetypes = { c = true, cpp = true }
|
||||||
|
local slow_filetypes = { kotlin = true }
|
||||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||||
return nil
|
return nil
|
||||||
|
elseif slow_filetypes[vim.bo[bufnr].filetype] then
|
||||||
|
return {
|
||||||
|
timeout_ms = 2500,
|
||||||
|
lsp_format = 'fallback',
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return {
|
return {
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
|
|
@ -54,6 +60,8 @@ return { -- Autoformat
|
||||||
sh = { 'shellcheck' },
|
sh = { 'shellcheck' },
|
||||||
go = { 'gofmt', 'goimports', 'goimports_reviser' },
|
go = { 'gofmt', 'goimports', 'goimports_reviser' },
|
||||||
xml = { 'xmllint' },
|
xml = { 'xmllint' },
|
||||||
|
c = { 'clang-format' },
|
||||||
|
python = { 'black' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
-- Java LSP
|
||||||
|
return {
|
||||||
|
'mfussenegger/nvim-jdtls',
|
||||||
|
ft = { 'java', 'kotlin', 'kt' },
|
||||||
|
}
|
||||||
|
|
@ -16,83 +16,23 @@ return {
|
||||||
'saghen/blink.cmp',
|
'saghen/blink.cmp',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Brief aside: **What is LSP?**
|
|
||||||
--
|
|
||||||
-- LSP is an initialism you've probably heard, but might not understand what it is.
|
|
||||||
--
|
|
||||||
-- LSP stands for Language Server Protocol. It's a protocol that helps editors
|
|
||||||
-- and language tooling communicate in a standardized fashion.
|
|
||||||
--
|
|
||||||
-- In general, you have a "server" which is some tool built to understand a particular
|
|
||||||
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
|
|
||||||
-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
|
|
||||||
-- processes that communicate with some "client" - in this case, Neovim!
|
|
||||||
--
|
|
||||||
-- LSP provides Neovim with features like:
|
|
||||||
-- - Go to definition
|
|
||||||
-- - Find references
|
|
||||||
-- - Autocompletion
|
|
||||||
-- - Symbol Search
|
|
||||||
-- - and more!
|
|
||||||
--
|
|
||||||
-- Thus, Language Servers are external tools that must be installed separately from
|
|
||||||
-- Neovim. This is where `mason` and related plugins come into play.
|
|
||||||
--
|
|
||||||
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
|
|
||||||
-- and elegantly composed help section, `:help lsp-vs-treesitter`
|
|
||||||
|
|
||||||
-- This function gets run when an LSP attaches to a particular buffer.
|
|
||||||
-- That is to say, every time a new file is opened that is associated with
|
|
||||||
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
|
|
||||||
-- function will be executed to configure the current buffer
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
-- NOTE: Remember that Lua is a real programming language, and as such it is possible
|
|
||||||
-- to define small helper and utility functions so you don't have to repeat yourself.
|
|
||||||
--
|
|
||||||
-- In this case, we create a function that lets us more easily define mappings specific
|
|
||||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
|
||||||
local map = function(keys, func, desc, mode)
|
local map = function(keys, func, desc, mode)
|
||||||
mode = mode or 'n'
|
mode = mode or 'n'
|
||||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Rename the variable under your cursor.
|
|
||||||
-- Most Language Servers support renaming across files, etc.
|
|
||||||
map('grn', vim.lsp.buf.rename, '[R]e[n]ame')
|
map('grn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||||
|
|
||||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
|
||||||
-- or a suggestion from your LSP for this to activate.
|
|
||||||
map('gca', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
|
map('gca', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
|
||||||
|
|
||||||
-- Find references for the word under your cursor.
|
|
||||||
map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
|
||||||
|
|
||||||
-- Jump to the implementation of the word under your cursor.
|
|
||||||
-- Useful when your language has ways of declaring types without an actual implementation.
|
|
||||||
map('gi', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
|
||||||
|
|
||||||
-- Jump to the definition of the word under your cursor.
|
|
||||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
|
||||||
-- To jump back, press <C-t>.
|
|
||||||
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
|
||||||
|
|
||||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
|
||||||
-- For example, in C this would take you to the header.
|
|
||||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||||
|
|
||||||
-- Jump to the type of the word under your cursor.
|
map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||||
-- Useful when you're not sure what type a variable is and you want to see
|
map('gi', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||||
-- the definition of its *type*, not where it was *defined*.
|
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||||
map('gt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
map('gt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
||||||
|
|
||||||
-- Fuzzy find all the symbols in your current document.
|
|
||||||
-- Symbols are things like variables, functions, types, etc.
|
|
||||||
map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols')
|
map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols')
|
||||||
|
|
||||||
-- Fuzzy find all the symbols in your current workspace.
|
|
||||||
-- Similar to document symbols, except searches over your entire project.
|
|
||||||
map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols')
|
map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols')
|
||||||
|
|
||||||
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
||||||
|
|
@ -137,10 +77,6 @@ return {
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The following code creates a keymap to toggle inlay hints in your
|
|
||||||
-- code, if the language server you are using supports them
|
|
||||||
--
|
|
||||||
-- This may be unwanted, since they displace some of your code
|
|
||||||
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
|
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
|
||||||
map('<leader>th', function()
|
map('<leader>th', function()
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
|
||||||
|
|
@ -185,17 +121,8 @@ return {
|
||||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
local util = require 'lspconfig/util'
|
local util = require 'lspconfig/util'
|
||||||
|
|
||||||
-- Enable the following language servers
|
|
||||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
|
||||||
--
|
|
||||||
-- Add any additional override configuration in the following tables. Available keys are:
|
|
||||||
-- - cmd (table): Override the default command used to start the server
|
|
||||||
-- - filetypes (table): Override the default list of associated filetypes for the server
|
|
||||||
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
|
|
||||||
-- - settings (table): Override the default settings passed when initializing the server.
|
|
||||||
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
|
||||||
local servers = {
|
local servers = {
|
||||||
-- clangd = {},
|
clangd = {},
|
||||||
gopls = {
|
gopls = {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
cmd = { 'gopls' },
|
cmd = { 'gopls' },
|
||||||
|
|
@ -211,7 +138,7 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- pyright = {},
|
pyright = {},
|
||||||
rust_analyzer = {},
|
rust_analyzer = {},
|
||||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||||
--
|
--
|
||||||
|
|
@ -224,7 +151,10 @@ return {
|
||||||
},
|
},
|
||||||
vue_ls = {},
|
vue_ls = {},
|
||||||
eslint = {},
|
eslint = {},
|
||||||
--
|
yamlls = {},
|
||||||
|
html = {
|
||||||
|
filetypes = { 'html', 'htmldjango', 'htmldjango-template', 'htmljinja', 'htmlmin' },
|
||||||
|
},
|
||||||
|
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
-- cmd = { ... },
|
-- cmd = { ... },
|
||||||
|
|
@ -236,28 +166,42 @@ return {
|
||||||
callSnippet = 'Replace',
|
callSnippet = 'Replace',
|
||||||
},
|
},
|
||||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||||
|
diagnostics = {
|
||||||
|
globals = { 'vim' },
|
||||||
|
},
|
||||||
-- diagnostics = { disable = { 'missing-fields' } },
|
-- diagnostics = { disable = { 'missing-fields' } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
kotlin_language_server = {
|
||||||
|
settings = {
|
||||||
|
kotlin = {
|
||||||
|
enabled = true,
|
||||||
|
debug = true,
|
||||||
|
languageVersion = '2.0',
|
||||||
|
jvmTarget = '21',
|
||||||
|
includeNonDeclarations = true,
|
||||||
|
noStdlib = false,
|
||||||
|
noReflect = false,
|
||||||
|
incremental = true,
|
||||||
|
buildServerMode = false,
|
||||||
|
compilerOptions = {
|
||||||
|
jvmTarget = '21',
|
||||||
|
apiVersion = '1.8',
|
||||||
|
languageVersion = '2.0',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Ensure the servers and tools above are installed
|
-- Ensure the servers and tools above are installed
|
||||||
--
|
|
||||||
-- To check the current status of installed tools and/or manually install
|
|
||||||
-- other tools, you can run
|
|
||||||
-- :Mason
|
|
||||||
--
|
|
||||||
-- You can press `g?` for help in this menu.
|
|
||||||
--
|
|
||||||
-- `mason` had to be setup earlier: to configure its options see the
|
|
||||||
-- `dependencies` table for `nvim-lspconfig` above.
|
|
||||||
--
|
|
||||||
-- You can add other tools here that you want Mason to install
|
|
||||||
-- for you, so that they are available from within Neovim.
|
|
||||||
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, {
|
||||||
'stylua', -- Used to format Lua code
|
'stylua', -- Used to format Lua code
|
||||||
|
'jdtls',
|
||||||
|
'java-debug-adapter',
|
||||||
|
'java-test',
|
||||||
})
|
})
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
||||||
|
|
@ -266,14 +210,29 @@ return {
|
||||||
automatic_installation = false,
|
automatic_installation = false,
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
|
-- Don't call setup for jdtls, it's already setup in the jdtls.lua file
|
||||||
local server = servers[server_name] or {}
|
local server = servers[server_name] or {}
|
||||||
-- This handles overriding only values explicitly passed
|
-- This handles overriding only values explicitly passed
|
||||||
-- by the server configuration above. Useful when disabling
|
-- by the server configuration above. Useful when disabling
|
||||||
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
||||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||||
require('lspconfig')[server_name].setup(server)
|
vim.lsp.config(server_name, server)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Non Mason LSP servers
|
||||||
|
-- vim.lsp.enable 'kotlin_lsp'
|
||||||
|
-- vim.lsp.config('kotlin_lsp', {
|
||||||
|
-- capabilities = capabilities,
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- Globally configure all LSP floating preview popups (like hover, signature help, etc)
|
||||||
|
local open_floating_preview = vim.lsp.util.open_floating_preview
|
||||||
|
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||||
|
opts = opts or {}
|
||||||
|
opts.border = opts.border or 'rounded' -- Set border to rounded
|
||||||
|
return open_floating_preview(contents, syntax, opts, ...)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ return {
|
||||||
config = function()
|
config = function()
|
||||||
require('lualine').setup {
|
require('lualine').setup {
|
||||||
options = {
|
options = {
|
||||||
theme = 'tokyonight',
|
theme = vim.g.colors_name or 'auto',
|
||||||
component_separators = '',
|
component_separators = '',
|
||||||
section_separators = { left = '', right = '' },
|
section_separators = { left = '', right = '' },
|
||||||
disabled_filetypes = {
|
disabled_filetypes = {
|
||||||
|
|
|
||||||
|
|
@ -2,24 +2,9 @@
|
||||||
return {
|
return {
|
||||||
'echasnovski/mini.nvim',
|
'echasnovski/mini.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
-- Better Around/Inside textobjects
|
|
||||||
--
|
|
||||||
-- Examples:
|
|
||||||
-- - va) - [V]isually select [A]round [)]paren
|
|
||||||
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
|
|
||||||
-- - ci' - [C]hange [I]nside [']quote
|
|
||||||
require('mini.ai').setup { n_lines = 500 }
|
require('mini.ai').setup { n_lines = 500 }
|
||||||
|
|
||||||
-- Add/delete/replace surroundings (brackets, quotes, etc.)
|
|
||||||
--
|
|
||||||
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
|
|
||||||
-- - sd' - [S]urround [D]elete [']quotes
|
|
||||||
-- - sr)' - [S]urround [R]eplace [)] [']
|
|
||||||
require('mini.surround').setup()
|
require('mini.surround').setup()
|
||||||
|
require('mini.move').setup()
|
||||||
-- Simple and easy statusline.
|
|
||||||
-- You could remove this setup call if you don't like it,
|
|
||||||
-- and try some other statusline plugin
|
|
||||||
local statusline = require 'mini.statusline'
|
local statusline = require 'mini.statusline'
|
||||||
-- set use_icons to true if you have a Nerd Font
|
-- set use_icons to true if you have a Nerd Font
|
||||||
statusline.setup { use_icons = vim.g.have_nerd_font }
|
statusline.setup { use_icons = vim.g.have_nerd_font }
|
||||||
|
|
@ -31,8 +16,5 @@ return {
|
||||||
statusline.section_location = function()
|
statusline.section_location = function()
|
||||||
return '%2l:%-2v'
|
return '%2l:%-2v'
|
||||||
end
|
end
|
||||||
|
|
||||||
-- ... and there is more!
|
|
||||||
-- Check out: https://github.com/echasnovski/mini.nvim
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
return {
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
event = 'VimEnter',
|
||||||
|
version = '2.*',
|
||||||
|
build = (function()
|
||||||
|
-- Build Step is needed for regex support in snippets.
|
||||||
|
-- This step is not supported in many windows environments.
|
||||||
|
-- Remove the below condition to re-enable on windows.
|
||||||
|
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return 'make install_jsregexp'
|
||||||
|
end)(),
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
'rafamadriz/friendly-snippets',
|
||||||
|
config = function()
|
||||||
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local ls = require 'luasnip'
|
||||||
|
ls.config.set_config {
|
||||||
|
history = false,
|
||||||
|
updateevents = 'TextChanged,TextChangedI',
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, ft_path in ipairs(vim.api.nvim_get_runtime_file('lua/custom/snippets/*lua', true)) do
|
||||||
|
loadfile(ft_path)()
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set({ 'i', 's' }, '<c-k>', function()
|
||||||
|
if ls.expand_or_jumpable() then
|
||||||
|
ls.expand_or_jump()
|
||||||
|
end
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
vim.keymap.set({ 'i', 's' }, '<c-j>', function()
|
||||||
|
if ls.jumpable(-1) then
|
||||||
|
ls.jump(-1)
|
||||||
|
end
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
vim.keymap.set({ 'i', 's' }, '<c-l>', function()
|
||||||
|
if ls.jumpable(1) then
|
||||||
|
ls.jump(1)
|
||||||
|
end
|
||||||
|
end, { silent = true })
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
@ -26,11 +26,23 @@ return { -- Highlight, edit, and navigate code
|
||||||
'go',
|
'go',
|
||||||
'typescript',
|
'typescript',
|
||||||
'javascript',
|
'javascript',
|
||||||
|
'kotlin',
|
||||||
|
'yaml',
|
||||||
|
'html',
|
||||||
|
'json',
|
||||||
|
'jsonc',
|
||||||
|
'markdown',
|
||||||
|
'markdown_inline',
|
||||||
|
'python',
|
||||||
|
'rust',
|
||||||
|
'toml',
|
||||||
|
'yaml',
|
||||||
},
|
},
|
||||||
-- Autoinstall languages that are not installed
|
-- Autoinstall languages that are not installed
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
disable = { 'python' }, -- list of language that will be disabled
|
||||||
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
|
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
|
||||||
-- If you are experiencing weird indenting issues, add the language to
|
-- If you are experiencing weird indenting issues, add the language to
|
||||||
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
|
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue