Compare commits
No commits in common. "main" and "migrate-to-lazy" have entirely different histories.
main
...
migrate-to
1 changed files with 86 additions and 26 deletions
112
init.lua
112
init.lua
|
|
@ -12,7 +12,7 @@ local opt = vim.opt
|
||||||
local workman = false
|
local workman = false
|
||||||
|
|
||||||
-- Set font
|
-- Set font
|
||||||
o.guifont = 'IosevkaTermSlab Nerd Font:h11:#e-subpixelantialias'
|
o.guifont = 'IosevkaTermSlab Nerd Font,IosevkaTerm Nerd Font,Iosevka Term Slab,Iosevka:h10:#e-subpixelantialias'
|
||||||
g.neovide_floating_z_height = 1
|
g.neovide_floating_z_height = 1
|
||||||
g.neovide_confirm_quit = true -- Confirm closing neovide window when changes are unsaved
|
g.neovide_confirm_quit = true -- Confirm closing neovide window when changes are unsaved
|
||||||
g.neovide_cursor_smooth_blink = true
|
g.neovide_cursor_smooth_blink = true
|
||||||
|
|
@ -337,21 +337,17 @@ require('lazy').setup({
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
'ojroques/nvim-bufdel',
|
'ojroques/nvim-bufdel',
|
||||||
'bullets-vim/bullets.vim',
|
|
||||||
{'stevearc/conform.nvim', config = function ()
|
{'stevearc/conform.nvim', config = function ()
|
||||||
require'conform'.setup {
|
require'conform'.setup {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
html = {"prettier"},
|
html = {"prettier"},
|
||||||
},
|
},
|
||||||
format_on_save = function()
|
format_on_save = {
|
||||||
if vim.g.format_on_save then
|
lsp_fallback = true,
|
||||||
return {
|
filter = function(client)
|
||||||
lsp_fallback = true
|
return client.name == 'rust-analyzer'
|
||||||
}
|
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
end,
|
}
|
||||||
}
|
}
|
||||||
vim.api.nvim_create_user_command(
|
vim.api.nvim_create_user_command(
|
||||||
'Conform',
|
'Conform',
|
||||||
|
|
@ -370,6 +366,10 @@ require('lazy').setup({
|
||||||
end},
|
end},
|
||||||
'direnv/direnv.vim',
|
'direnv/direnv.vim',
|
||||||
'jbyuki/instant.nvim',
|
'jbyuki/instant.nvim',
|
||||||
|
{'mizlan/iswap.nvim', config = function()
|
||||||
|
require'iswap'.setup {}
|
||||||
|
vim.keymap.set('', '<Leader>s', '<Cmd>ISwapWith<CR>', { desc = 'Swap' })
|
||||||
|
end},
|
||||||
{'windwp/nvim-projectconfig', opts = {
|
{'windwp/nvim-projectconfig', opts = {
|
||||||
-- Load project configuration when changing directory
|
-- Load project configuration when changing directory
|
||||||
autocmd = true,
|
autocmd = true,
|
||||||
|
|
@ -395,7 +395,7 @@ require('lazy').setup({
|
||||||
highlight = { enable = true, disable = {'rust', 'bash'} },
|
highlight = { enable = true, disable = {'rust', 'bash'} },
|
||||||
incremental_selection = { enable = true },
|
incremental_selection = { enable = true },
|
||||||
}, config = function(_, opts)
|
}, config = function(_, opts)
|
||||||
require'nvim-treesitter'.setup(opts)
|
require'nvim-treesitter.configs'.setup(opts)
|
||||||
end},
|
end},
|
||||||
'windwp/nvim-ts-autotag',
|
'windwp/nvim-ts-autotag',
|
||||||
{'kevinhwang91/nvim-ufo', dependencies = 'kevinhwang91/promise-async', config = function()
|
{'kevinhwang91/nvim-ufo', dependencies = 'kevinhwang91/promise-async', config = function()
|
||||||
|
|
@ -449,8 +449,6 @@ require('lazy').setup({
|
||||||
'jsonls',
|
'jsonls',
|
||||||
'lemminx',
|
'lemminx',
|
||||||
'lua_ls',
|
'lua_ls',
|
||||||
'nixd',
|
|
||||||
'ruff',
|
|
||||||
'ty',
|
'ty',
|
||||||
'vimls',
|
'vimls',
|
||||||
'yamlls',
|
'yamlls',
|
||||||
|
|
@ -535,6 +533,74 @@ require('lazy').setup({
|
||||||
},
|
},
|
||||||
}},
|
}},
|
||||||
{'Saghen/blink.compat', lazy = true, opts = {}},
|
{'Saghen/blink.compat', lazy = true, opts = {}},
|
||||||
|
{'mfussenegger/nvim-jdtls', dependencies = {'neovim/nvim-lspconfig'}, config = function()
|
||||||
|
au('FileType', {
|
||||||
|
pattern = 'java',
|
||||||
|
callback = function()
|
||||||
|
local jdtls = require 'jdtls'
|
||||||
|
jdtls.tests = require'jdtls.tests'
|
||||||
|
jdtls.dap = require'jdtls.dap'
|
||||||
|
_G.jdt = jdtls
|
||||||
|
local lspconfig = require'lspconfig'
|
||||||
|
|
||||||
|
local root_dir = jdtls.setup.find_root({'.git', 'mvnw', 'gradlew'})
|
||||||
|
|
||||||
|
local config = {
|
||||||
|
-- The command to launch jdtls with
|
||||||
|
cmd = {
|
||||||
|
'jdtls',
|
||||||
|
-- Enable logging
|
||||||
|
'--jvm-arg=-Dlog.level=ALL',
|
||||||
|
'--jvm-arg=-Dlog.protocol=true',
|
||||||
|
-- Enable lombok
|
||||||
|
'--jvm-arg=-javaagent:' .. mason_path('jdtls') .. '/lombok.jar',
|
||||||
|
-- Shut the warning up
|
||||||
|
'--jvm-arg=-XX:+EnableDynamicAgentLoading',
|
||||||
|
-- store workpace data in ~/.local/share/eclipse/<project-name>
|
||||||
|
'-data', vim.fn.expand('~/.local/share/eclipse/') .. vim.fn.fnamemodify(root_dir, ':p:h:t')
|
||||||
|
},
|
||||||
|
|
||||||
|
root_dir = root_dir,
|
||||||
|
|
||||||
|
capabilities = lspconfig.util.default_config.capabilities,
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
java = {
|
||||||
|
autobuild = { enabled = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
init_options = {
|
||||||
|
-- JDTLS plugins
|
||||||
|
bundles = (function()
|
||||||
|
-- add java-debug-adapter
|
||||||
|
local bundles = {
|
||||||
|
vim.fn.glob(mason_path'java-debug-adapter' .. '/extension/server/com.microsoft.java.debug.plugin-*.jar', true)
|
||||||
|
}
|
||||||
|
-- add java-test
|
||||||
|
vim.list_extend(bundles, vim.split(
|
||||||
|
vim.fn.glob(vim.fn.expand('~/.local/share/vscode-java-test/server') .. '/*.jar', true),
|
||||||
|
'\n'
|
||||||
|
))
|
||||||
|
|
||||||
|
return bundles
|
||||||
|
end)(),
|
||||||
|
},
|
||||||
|
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
jdtls.setup_dap()
|
||||||
|
vim.keymap.set('n', '<Leader>lo', jdtls.organize_imports, { desc = 'Organize imports', buffer = bufnr })
|
||||||
|
vim.keymap.set('n', '<Leader>Xm', jdtls.test_nearest_method, { desc = 'Test nearest method', buffer = bufnr })
|
||||||
|
vim.keymap.set('n', '<Leader>Xc', jdtls.test_class, { desc = 'Test class', buffer = bufnr })
|
||||||
|
vim.keymap.set('n', '<Leader>Xg', jdtls.tests.goto_subjects, { desc = 'Go to test', buffer = bufnr })
|
||||||
|
vim.keymap.set('n', '<Leader>Xb', 'JdtCompile full', { desc = 'Build', buffer = bufnr })
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
jdtls.start_or_attach(config)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end},
|
||||||
{'mrcjkb/rustaceanvim', config = function ()
|
{'mrcjkb/rustaceanvim', config = function ()
|
||||||
vim.g.rustaceanvim = {
|
vim.g.rustaceanvim = {
|
||||||
server = {
|
server = {
|
||||||
|
|
@ -845,7 +911,7 @@ require('lazy').setup({
|
||||||
{'lucaSartore/nvim-dap-exception-breakpoints', dependencies = {'mfussenegger/nvim-dap'}, config = function()
|
{'lucaSartore/nvim-dap-exception-breakpoints', dependencies = {'mfussenegger/nvim-dap'}, config = function()
|
||||||
vim.keymap.set('n', '<Leader>de', require'nvim-dap-exception-breakpoints', { desc = 'Exception breakpoints'})
|
vim.keymap.set('n', '<Leader>de', require'nvim-dap-exception-breakpoints', { desc = 'Exception breakpoints'})
|
||||||
end},
|
end},
|
||||||
{'dlyongemallo/diffview.nvim', opts = {
|
{'sindrets/diffview.nvim', opts = {
|
||||||
-- Use nicer highlighting for diffs
|
-- Use nicer highlighting for diffs
|
||||||
enhanced_diff_hl = true,
|
enhanced_diff_hl = true,
|
||||||
win_config = {
|
win_config = {
|
||||||
|
|
@ -896,6 +962,8 @@ require('lazy').setup({
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
{'tpope/vim-fugitive', lazy = false, dependencies = {'tpope/vim-rhubarb', 'shumphrey/fugitive-gitlab.vim'}, keys = {
|
{'tpope/vim-fugitive', lazy = false, dependencies = {'tpope/vim-rhubarb', 'shumphrey/fugitive-gitlab.vim'}, keys = {
|
||||||
|
{'<Leader>g', '<Cmd>vert Git<CR>', desc = 'Git status'},
|
||||||
|
{'<Leader>G', '<Cmd>tab Git<CR>', desc = 'Git status (tab)'},
|
||||||
}},
|
}},
|
||||||
{'harrisoncramer/gitlab.nvim', dependencies = {
|
{'harrisoncramer/gitlab.nvim', dependencies = {
|
||||||
'MunifTanjim/nui.nvim',
|
'MunifTanjim/nui.nvim',
|
||||||
|
|
@ -1002,7 +1070,6 @@ require('lazy').setup({
|
||||||
{'<Leader>g', '<Cmd>Neogit<CR>', { desc = 'Neogit' }}
|
{'<Leader>g', '<Cmd>Neogit<CR>', { desc = 'Neogit' }}
|
||||||
}},
|
}},
|
||||||
{'rcarriga/nvim-notify', dependencies = {'nvim-telescope/telescope.nvim'}, opts = {
|
{'rcarriga/nvim-notify', dependencies = {'nvim-telescope/telescope.nvim'}, opts = {
|
||||||
background_colour = '#FFFFFF',
|
|
||||||
stages = 'fade',
|
stages = 'fade',
|
||||||
render = 'compact',
|
render = 'compact',
|
||||||
}, config = function(_, opts)
|
}, config = function(_, opts)
|
||||||
|
|
@ -1010,11 +1077,6 @@ require('lazy').setup({
|
||||||
vim.notify = require'notify'
|
vim.notify = require'notify'
|
||||||
require'telescope'.load_extension('notify')
|
require'telescope'.load_extension('notify')
|
||||||
end},
|
end},
|
||||||
{'pwntester/octo.nvim', dependencies = {'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons'}, opts = {
|
|
||||||
picker = 'telescope',
|
|
||||||
-- Allow using :Octo without arguments
|
|
||||||
enable_builtin = true,
|
|
||||||
}},
|
|
||||||
{'stevearc/overseer.nvim', dependencies = {'folke/which-key.nvim'}, opts = {
|
{'stevearc/overseer.nvim', dependencies = {'folke/which-key.nvim'}, opts = {
|
||||||
task_list = {
|
task_list = {
|
||||||
bindings = {
|
bindings = {
|
||||||
|
|
@ -1040,9 +1102,6 @@ require('lazy').setup({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end},
|
end},
|
||||||
{'michaelb/sniprun', lazy = false, build = 'sh install.sh', keys = {
|
|
||||||
{'<Leader>p', '<Cmd>SnipRun<CR>', mode = {'v', 'n'}, desc = 'Run snippet'},
|
|
||||||
}},
|
|
||||||
{'mhinz/vim-startify', init = function()
|
{'mhinz/vim-startify', init = function()
|
||||||
-- Don't change working directory when opening files
|
-- Don't change working directory when opening files
|
||||||
g.startify_change_to_dir = 0
|
g.startify_change_to_dir = 0
|
||||||
|
|
@ -1162,12 +1221,13 @@ require('lazy').setup({
|
||||||
require'telescope'.load_extension('undo')
|
require'telescope'.load_extension('undo')
|
||||||
end},
|
end},
|
||||||
{'nvim-neotest/neotest', dependencies = {
|
{'nvim-neotest/neotest', dependencies = {
|
||||||
--'nvim-neotest/neotest-vim-test',
|
'nvim-neotest/neotest-vim-test',
|
||||||
|
'rouge8/neotest-rust',
|
||||||
}, config = function()
|
}, config = function()
|
||||||
require'neotest'.setup {
|
require'neotest'.setup {
|
||||||
adapters = {
|
adapters = {
|
||||||
--require'neotest-vim-test' { allow_file_types = {'java'} },
|
require'neotest-vim-test' { allow_file_types = {'java'} },
|
||||||
require'rustaceanvim.neotest'
|
require'neotest-rust' {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
require'which-key'.register {
|
require'which-key'.register {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue