update pre nchad

This commit is contained in:
Omixxx 2023-04-21 11:58:14 +02:00
parent 0ae1cf0a07
commit e23eec9c6e
8 changed files with 219 additions and 33 deletions

130
ftplugin/java.lua Normal file
View File

@ -0,0 +1,130 @@
local home = os.getenv('HOME')
local jdtls = require('jdtls')
-- File types that signify a Java project's root directory. This will be
-- used by eclipse to determine what constitutes a workspace
local root_markers = { 'gradlew', 'mvnw', '.git' }
local root_dir = require('jdtls.setup').find_root(root_markers)
-- eclipse.jdt.ls stores project specific data within a folder. If you are working
-- with multiple different projects, each project must use a dedicated data directory.
-- This variable is used to configure eclipse to use the directory name of the
-- current project found using the root_marker as the folder for project specific data.
local workspace_folder = home .. "/.local/share/nvim/eclipse/" .. vim.fn.fnamemodify(root_dir, ":p:h:t")
-- Helper function for creating keymaps
function nnoremap(rhs, lhs, bufopts, desc)
bufopts.desc = desc
vim.keymap.set("n", rhs, lhs, bufopts)
end
local config = {
flags = {
debounce_text_changes = 80,
},
on_attach = on_attach, -- We pass our on_attach keybindings to the configuration map
root_dir = root_dir, -- Set the root directory to our found root_marker
-- Here you can configure eclipse.jdt.ls specific settings
-- These are defined by the eclipse.jdt.ls project and will be passed to eclipse when starting.
-- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
-- for a list of options
settings = {
java = {
format = {
settings = {
-- Use Google Java style guidelines for formatting
-- To use, make sure to download the file from https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml
-- and place it in the ~/.local/share/eclipse directory
url = home .. ".local/share/nvim/eclipse/eclipse-java-google-style.xml",
profile = "GoogleStyle",
},
},
signatureHelp = { enabled = true },
contentProvider = { preferred = 'fernflower' }, -- Use fernflower to decompile library code
-- Specify any completion options
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.*"
},
filteredTypes = {
"com.sun.*",
"io.micrometer.shaded.*",
"java.awt.*",
"jdk.*", "sun.*",
},
},
-- Specify any options for organizing imports
sources = {
organizeImports = {
starThreshold = 9999,
staticStarThreshold = 9999,
},
},
-- How code generation should act
codeGeneration = {
toString = {
template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}"
},
hashCodeEquals = {
useJava7Objects = true,
},
useBlocks = true,
},
-- If you are developing in projects with different Java versions, you need
-- to tell eclipse.jdt.ls to use the location of the JDK for your Java version
-- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
-- And search for `interface RuntimeOption`
-- The `name` is NOT arbitrary, but must match one of the elements from `enum ExecutionEnvironment` in the link above
configuration = {
runtimes = {
{
name = "JavaSE-17",
path = home .. "/.jkds/corretto-17.0.6",
},
}
}
}
},
-- cmd is the command that starts the language server. Whatever is placed
-- here is what is passed to the command line to execute jdtls.
-- Note that eclipse.jdt.ls must be started with a Java version of 17 or higher
-- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line
-- for the full list of options
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',
'-Xmx4g',
'--add-modules=ALL-SYSTEM',
'--add-opens', 'java.base/java.util=ALL-UNNAMED',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
-- If you use lombok, download the lombok jar and place it in ~/.local/share/eclipse
'-javaagent:' .. home .. '/.local/share/nvim/mason/plugins/jdtls/lombok.jar',
-- The jar file is located where jdtls was installed. This will need to be updated
-- to the location where you installed jdtls
'-jar',
vim.fn.glob(home ..
'.local/share/nvim/mason/packages/jdtls/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar'),
-- The configuration for jdtls is also placed where jdtls was installed. This will
-- need to be updated depending on your environment
'-configuration', home .. '.local/share/nvim/mason/packages/jdtls/config_linux',
-- Use the workspace_folder defined above to store data for this project
'-data', workspace_folder,
},
}
-- Finally, start jdtls. This will run the language server using the configuration we specified,
-- setup the keymappings, and attach the LSP client to the current buffer
jdtls.start_or_attach(config)

View File

@ -1,6 +1,6 @@
--[[ --[[
===================================================================== a=====================================================================
==================== READ THIS BEFORE CONTINUING ==================== ===================================================================== ==================== READ THIS BEFORE CONTINUING ==================== =====================================================================
Kickctart.nvim is *not* a distribution. Kickctart.nvim is *not* a distribution.
@ -98,7 +98,6 @@ require('lazy').setup({
'folke/neodev.nvim', 'folke/neodev.nvim',
}, },
}, },
{ {
-- Autocompletion -- Autocompletion
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
@ -128,8 +127,6 @@ require('lazy').setup({
}, },
}, },
}, },
{ {
-- Add indentation guides even on blank lines -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim', 'lukas-reineke/indent-blankline.nvim',
@ -174,6 +171,9 @@ require('lazy').setup({
end, end,
}, },
{
'mfussenegger/nvim-jdtls',
},
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository. -- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them. -- Uncomment any of the lines below to enable them.
@ -188,11 +188,12 @@ require('lazy').setup({
-- --
-- An additional note is that if you only copied in the `init.lua`, you can just comment this line -- An additional note is that if you only copied in the `init.lua`, you can just comment this line
-- to get rid of the warning telling you that there are not plugins in `lua/custom/plugins/`. -- to get rid of the warning telling you that there are not plugins in `lua/custom/plugins/`.
-- //wait mason initialize all plugins before import the custom plugins
--
{ import = 'custom.plugins' }, { import = 'custom.plugins' },
}, {}) }, {})
-- Load custom treesitter grammar for org filetype
require('orgmode').setup_ts_grammar()
-- Treesitter configuration -- Treesitter configuration
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
@ -207,17 +208,12 @@ require('nvim-treesitter.configs').setup {
ensure_installed = { 'org' }, -- Or run :TSUpdate org ensure_installed = { 'org' }, -- Or run :TSUpdate org
} }
require('orgmode').setup({
org_agenda_files = { '~/Notes/org/*', '~/my-orgs/**/*' },
org_default_notes_file = '~/Notes/org/refile.org',
})
-- [[ Setting options ]] -- [[ Setting options ]]
-- See `:help vim.o` -- See `:help vim.o`
-- Set highlight on search -- Set highlight on search
vim.o.hlsearch = true vim.o.hlsearch = true
vim.cmd [[highlight Search guifg=#292e42 guibg=#bb9af7]]
-- Make line numbers default -- Make line numbers default
vim.wo.number = true vim.wo.number = true
@ -333,6 +329,11 @@ vim.api.nvim_set_keymap('i', '<C-k>', '<C-W>', { noremap = true, desc = "delete
vim.api.nvim_set_keymap('n', '<leader>ol', ":!zathura <C-r>-expand('%:r')<cr>.pdf &<cr>", vim.api.nvim_set_keymap('n', '<leader>ol', ":!zathura <C-r>-expand('%:r')<cr>.pdf &<cr>",
{ noremap = true, silent = true, desc = "[O]pen [L]atex" }) { noremap = true, silent = true, desc = "[O]pen [L]atex" })
vim.api.nvim_set_keymap('n', '<leader>k', "", { noremap = true, silent = true, desc = "" })
vim.api.nvim_set_keymap('i', '<C-BS>', "<Esc>hdiwi", { noremap = true, silent = true, desc = "" })
vim.api.nvim_set_keymap('n', ':wq', "<Cmd>wqa<CR>", { noremap = true, silent = true, desc = "" })
-- trucco sul relplace. -- trucco sul relplace.
-- selezionare la sezione in cui si vuole rimpiazzare una parola (si puo anche non -- selezionare la sezione in cui si vuole rimpiazzare una parola (si puo anche non
@ -562,6 +563,7 @@ local servers = {
-- Setup neovim lua configuration -- Setup neovim lua configuration
require('neodev').setup() require('neodev').setup()
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers -- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
@ -632,6 +634,28 @@ cmp.setup {
{ name = 'luasnip' }, { name = 'luasnip' },
{ name = 'orgmode' }, { name = 'orgmode' },
}, },
require('neorg').setup {
load = {
["core.defaults"] = {},
["core.norg.dirman"] = {
config = {
workspaces = {
work = "~/notes/work",
home = "~/notes/home",
}
},
["core.norg.concealer"] = {},
["core.norg.completion"] = {
config = {
engine = "nvim-cmp"
}
},
["core.norg.esupports.hop"] = {},
["core.norg.esupports.neorglink"] = {},
}
}
}
} }

View File

@ -3,13 +3,13 @@ return {
'lervag/vimtex', 'lervag/vimtex',
'sirver/ultisnips', 'sirver/ultisnips',
'KeitaNakamura/tex-conceal.vim', 'KeitaNakamura/tex-conceal.vim',
config = function() -- config = function()
vim.g.UltiSnipsExpandTrigger = '<tab>' -- vim.g.UltiSnipsExpandTrigger = '<tab>'
vim.g.UltiSnipsJumpForwardTrigger = '<tab>' -- vim.g.UltiSnipsJumpForwardTrigger = '<tab>'
vim.g.UltiSnipsJumpBackwardTrigger = '<s-tab>' -- vim.g.UltiSnipsJumpBackwardTrigger = '<s-tab>'
vim.g.tex_flavor = 'latex' -- vim.g.tex_flavor = 'latex'
vim.g.vimtex_view_method = 'zathura' -- vim.g.vimtex_view_method = 'zathura'
vim.g.vimtex_quickfix_mode = 0 -- vim.g.vimtex_quickfix_mode = 0
vim.g.tex_conceal = 'abdmg', -- vim.g.tex_conceal = 'abdmg',
end -- end
} }

View File

@ -5,6 +5,14 @@ return {
vim.keymap.set('n', 's', function() vim.keymap.set('n', 's', function()
local current_window = vim.fn.win_getid() local current_window = vim.fn.win_getid()
require('leap').leap { target_windows = { current_window } } require('leap').leap { target_windows = { current_window } }
require('leap').init_highlight(true)
end) end)
require('leap').opts = {
}
end end
} }

View File

@ -0,0 +1,3 @@
return {
"jbyuki/nabla.nvim"
}

View File

@ -0,0 +1,18 @@
return {
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
opts = {
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.norg.concealer"] = {}, -- Adds pretty icons to your documents
["core.norg.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
notes = "~/notes",
},
},
},
},
},
dependencies = { { "nvim-lua/plenary.nvim" } },
}

View File

@ -1,7 +0,0 @@
return {
'nvim-orgmode/orgmode',
ft = { 'org' },
config = function()
require('orgmode').setup {}
end
}

View File

@ -1,9 +1,9 @@
return { return {
{ {
'folke/tokyonight.nvim', 'folke/tokyonight.nvim',
priority = 1000, priority = 1000,
config = function() config = function()
vim.cmd.colorscheme 'tokyonight'
end, end,
}, },
@ -25,17 +25,27 @@ return {
invert_signs = false, invert_signs = false,
invert_tabline = false, invert_tabline = false,
invert_intend_guides = false, invert_intend_guides = false,
inverse = true, -- invert background for search, diffs, statuslines and errors inverse = false, -- invert background for search, diffs, statuslines and errors
contrast = "hard", -- can be "hard", "soft" or empty string contrast = "hard", -- can be "hard", "soft" or empty string
palette_overrides = {}, palette_overrides = {
},
overrides = { overrides = {
SignColumn = { bg = "#1d2021" } SignColumn = { bg = "#1d2021" },
LspDiagnosticsSignError = { fg = "#cc241d" },
LspDiagnosticsSignWarning = { fg = "#d79921" },
LspDiagnosticsSignInformation = { fg = "#458588" },
LspDiagnosticsSignHint = { fg = "#b16286" },
TSAnnotation = { fg = "#A12568" },
javaAnnotation = { fg = "#A12568" },
}, },
dim_inactive = false, dim_inactive = false,
transparent_mode = false, transparent_mode = false,
}) })
vim.o.background = "dark"
vim.cmd.colorscheme 'gruvbox' -- vim.cmd [[highlight Search guifg=#292e42 guibg=#bb9af7]]
-- vim.o.background = "dark"
-- vim.cmd.colorscheme 'gruvbox'
end, end,
}, },
{ {