update config
This commit is contained in:
parent
4e52af7dec
commit
d50d533dd9
@ -19,10 +19,8 @@ keymap('n', '<leader>jt', "<Cmd>lua require'jdtls'.test_nearest_method()<CR>", o
|
||||
keymap('n', '<leader>jT', "<Cmd>lua require'jdtls'.test_class()<CR>", opts)
|
||||
keymap('n', '<leader>ju', '<Cmd>JdtUpdateConfig<CR>', opts)
|
||||
|
||||
keymap('v', '<leader>jv', "<Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>",
|
||||
opts)
|
||||
keymap('v', '<leader>jc', "<Esc><Cmd>lua require('jdtls').extract_constant(true)<CR>",
|
||||
opts)
|
||||
keymap('v', '<leader>jv', "<Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>", opts)
|
||||
keymap('v', '<leader>jc', "<Esc><Cmd>lua require('jdtls').extract_constant(true)<CR>", opts)
|
||||
keymap('v', '<leader>jm', "<Esc><Cmd>lua require('jdtls').extract_method(true)<CR>", opts)
|
||||
|
||||
vim.opt_local.shiftwidth = 2
|
||||
@ -83,10 +81,7 @@ local bundles = {
|
||||
|
||||
vim.list_extend(
|
||||
bundles,
|
||||
vim.split(
|
||||
vim.fn.glob(home ..
|
||||
'/.local/share/nvim/mason/packages/java-test/extension/server/*.jar'),
|
||||
'\n')
|
||||
vim.split(vim.fn.glob(home .. '/.local/share/nvim/mason/packages/java-test/extension/server/*.jar'), '\n')
|
||||
)
|
||||
|
||||
local config = {
|
||||
@ -103,9 +98,9 @@ local config = {
|
||||
'-Declipse.product=org.eclipse.jdt.ls.core.product',
|
||||
'-Dlog.protocol=true',
|
||||
'-Dlog.level=ALL',
|
||||
'-javaagent:' ..
|
||||
home .. '/.local/share/nvim/mason/packages/jdtls/lombok.jar',
|
||||
'-Xms1g',
|
||||
'-javaagent:' .. home .. '/.local/share/nvim/mason/packages/jdtls/lombok.jar',
|
||||
'-Xmx512m',
|
||||
'-Xms100m',
|
||||
'--add-modules=ALL-SYSTEM',
|
||||
'--add-opens',
|
||||
'java.base/java.util=ALL-UNNAMED',
|
||||
@ -114,8 +109,7 @@ local config = {
|
||||
|
||||
-- 💀
|
||||
'-jar',
|
||||
vim.fn.glob(home ..
|
||||
'/.local/share/nvim/mason/packages/jdtls/plugins/org.eclipse.equinox.launcher_*.jar'),
|
||||
vim.fn.glob(home .. '/.local/share/nvim/mason/packages/jdtls/plugins/org.eclipse.equinox.launcher_*.jar'),
|
||||
-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
|
||||
-- Must point to the Change this to
|
||||
-- eclipse.jdt.ls installation the actual version
|
||||
@ -186,8 +180,7 @@ local config = {
|
||||
},
|
||||
codeGeneration = {
|
||||
toString = {
|
||||
template =
|
||||
'${object.className}{${member.name()}=${member.value}, ${otherMembers}}',
|
||||
template = '${object.className}{${member.name()}=${member.value}, ${otherMembers}}',
|
||||
},
|
||||
useBlocks = true,
|
||||
},
|
||||
|
@ -10,8 +10,8 @@ vim.api.nvim_create_autocmd({ 'FileType' }, {
|
||||
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
||||
pattern = { 'cpp', 'cc', 'hpp', 'hh', 'md', 'markdown', 'java' },
|
||||
callback = function()
|
||||
vim.opt.ts = 2
|
||||
vim.opt.sw = 2
|
||||
vim.opt.ts = 4
|
||||
vim.opt.sw = 4
|
||||
vim.opt.expandtab = true
|
||||
end,
|
||||
})
|
||||
@ -73,3 +73,10 @@ vim.cmd [[
|
||||
au ExitPre * :set guicursor=a:hor90
|
||||
augroup END
|
||||
]]
|
||||
|
||||
-- Fixes Autocomment
|
||||
vim.api.nvim_create_autocmd({ 'BufWinEnter' }, {
|
||||
callback = function()
|
||||
vim.cmd 'set formatoptions-=cro'
|
||||
end,
|
||||
})
|
||||
|
@ -270,7 +270,7 @@ local mappings = {
|
||||
},
|
||||
l = {
|
||||
name = 'LSP',
|
||||
l = { '<cmd>Lazy load lsp <bar> LspStart <cr>', 'Start LSP' },
|
||||
l = { '<cmd>Lazy load none-ls.nvim lsp <bar> LspStart <cr>', 'Start LSP' },
|
||||
f = { '<cmd>lua vim.lsp.buf.format { async = true }<cr>', 'Format' },
|
||||
i = 'Lsp Info',
|
||||
a = 'Code action',
|
||||
|
@ -4,7 +4,7 @@ local opt = vim.opt
|
||||
g.mapleader = ' '
|
||||
g.tex_flavor = 'latex'
|
||||
g.c_syntax_for_h = true
|
||||
vim.cmd([[
|
||||
vim.cmd [[
|
||||
let g:VM_default_mappings = 0
|
||||
let g:VM_mouse_mappings = 1
|
||||
let g:VM_leader = {'default': ',', 'visual': ',', 'buffer': ','}
|
||||
@ -32,7 +32,7 @@ let g:nvimgdb_config_override = {
|
||||
\ 'key_breakpoint': 'b',
|
||||
\ 'set_tkeymaps': "NvimGdbNoTKeymaps",
|
||||
\ }
|
||||
]])
|
||||
]]
|
||||
|
||||
opt.termguicolors = true
|
||||
opt.mouse = 'nv'
|
||||
@ -59,6 +59,7 @@ opt.grepprg = 'rg --vimgrep --no-heading --smart-case --hidden'
|
||||
opt.grepformat = '%f:%l:%c:%m'
|
||||
opt.cursorline = true
|
||||
opt.cursorlineopt = 'number'
|
||||
vim.opt.formatoptions:remove("c")
|
||||
|
||||
vim.api.nvim_create_user_command('Cd', 'lcd %:p:h', { nargs = 0 })
|
||||
vim.api.nvim_create_user_command('Grep', 'silent grep! <args> | TroubleToggle quickfix', { nargs = '+' })
|
||||
|
@ -8,12 +8,12 @@ return {
|
||||
{ 'mg979/vim-visual-multi', event = 'VeryLazy' },
|
||||
{ 'rush-rs/tree-sitter-asm', ft = 'asm' },
|
||||
{ 'jghauser/mkdir.nvim', lazy = false },
|
||||
{
|
||||
'jakewvincent/mkdnflow.nvim',
|
||||
dependencies = 'nvim-lua/plenary.nvim',
|
||||
ft = 'markdown',
|
||||
opts = {},
|
||||
},
|
||||
-- {
|
||||
-- 'jakewvincent/mkdnflow.nvim',
|
||||
-- dependencies = 'nvim-lua/plenary.nvim',
|
||||
-- ft = 'markdown',
|
||||
-- opts = {},
|
||||
-- },
|
||||
{
|
||||
'glepnir/dbsession.nvim',
|
||||
cmd = { 'SessionSave', 'SessionDelete', 'SessionLoad' },
|
||||
|
58
lua/plugins/none-ls.lua
Normal file
58
lua/plugins/none-ls.lua
Normal file
@ -0,0 +1,58 @@
|
||||
return {
|
||||
'nvimtools/none-ls.nvim',
|
||||
config = function()
|
||||
local null_ls = require 'null-ls'
|
||||
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||
local formatting = null_ls.builtins.formatting
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
|
||||
null_ls.setup {
|
||||
debug = false,
|
||||
sources = {
|
||||
formatting.prettier.with { extra_args = { '--no-semi', '--single-quote', '--jsx-single-quote' } },
|
||||
formatting.black.with { extra_args = { '--fast' } },
|
||||
formatting.stylua.with { extra_args = { '--quote-style=AutoPreferSingle', '--call-parentheses=None' } },
|
||||
-- formatting.clang_format.with {
|
||||
-- filetypes = { 'c' },
|
||||
-- extra_args = {
|
||||
-- '--style',
|
||||
-- '{BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, BreakBeforeBraces: Linux, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, AlwaysBreakAfterReturnType: AllDefinitions}',
|
||||
-- -- '{AccessModifierOffset : -2, AllowShortIfStatementsOnASingleLine : Never, AlignConsecutiveMacros : true, AllowShortLoopsOnASingleLine : false, AlwaysBreakTemplateDeclarations : true, Standard : c++20, NamespaceIndentation : All, IndentWidth : 4, TabWidth : 4, BreakBeforeBraces : Linux, AllowShortFunctionsOnASingleLine : Empty, AllowShortBlocksOnASingleLine : Never, FixNamespaceComments : true, PointerAlignment : Right, ColumnLimit : 120, ContinuationIndentWidth : 2, UseTab : Always }',
|
||||
-- },
|
||||
-- },
|
||||
-- formatting.clang_format.with {
|
||||
-- filetypes = { 'cpp' },
|
||||
-- extra_args = {
|
||||
-- '--style',
|
||||
-- 'google',
|
||||
-- },
|
||||
-- },
|
||||
formatting.beautysh,
|
||||
formatting.latexindent,
|
||||
formatting.goimports,
|
||||
formatting.gofumpt,
|
||||
formatting.sql_formatter,
|
||||
diagnostics.golangci_lint.with {
|
||||
extra_args = {
|
||||
'-E',
|
||||
'revive',
|
||||
'-E',
|
||||
'errcheck',
|
||||
'-E',
|
||||
'gosec',
|
||||
'-E',
|
||||
'nilerr',
|
||||
'-E',
|
||||
'nlreturn',
|
||||
},
|
||||
},
|
||||
formatting.asmfmt.with {
|
||||
filetypes = { 'asm', 's' },
|
||||
},
|
||||
-- diagnostics.flake8
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
Loading…
Reference in New Issue
Block a user