feat: personal versions
This commit is contained in:
parent
66e2a5a425
commit
dab19ab080
|
@ -0,0 +1,34 @@
|
||||||
|
local root_markers = { 'gradlew', 'pom.xml' }
|
||||||
|
local root_dir = require('jdtls.setup').find_root(root_markers)
|
||||||
|
local home = os.getenv 'HOME'
|
||||||
|
|
||||||
|
local workspace_folder = home .. '/.workspace' .. vim.fn.fnamemodify(root_dir, ':p:h:t')
|
||||||
|
local config = {}
|
||||||
|
|
||||||
|
config.cmd = {
|
||||||
|
'/Users/joshua/.jabba/jdk/amazon-corretto@1.17.0-0.35.1/Contents/Home/bin/java',
|
||||||
|
'-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044',
|
||||||
|
'-javaagent:/Users/joshua/.config/jdtls/jars/lombok.jar',
|
||||||
|
|
||||||
|
'-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',
|
||||||
|
'-Xmx1g',
|
||||||
|
'--add-modules=ALL-SYSTEM',
|
||||||
|
'--add-opens',
|
||||||
|
'java.base/java.util=ALL-UNNAMED',
|
||||||
|
'--add-opens',
|
||||||
|
'java.base/java.lang=ALL-UNNAMED',
|
||||||
|
'-jar',
|
||||||
|
'/Users/joshua/.config/jdtls/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar',
|
||||||
|
'-configuration',
|
||||||
|
'/Users/joshua/.config/jdtls/config_mac',
|
||||||
|
|
||||||
|
'-data',
|
||||||
|
workspace_folder,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Server
|
||||||
|
require('jdtls').start_or_attach(config)
|
123
init.lua
123
init.lua
|
@ -99,7 +99,7 @@ vim.g.have_nerd_font = false
|
||||||
-- For more options, you can see `:help option-list`
|
-- For more options, you can see `:help option-list`
|
||||||
|
|
||||||
-- Make line numbers default
|
-- Make line numbers default
|
||||||
vim.opt.number = true
|
-- vim.opt.number = true
|
||||||
-- You can also add relative line numbers, for help with jumping.
|
-- You can also add relative line numbers, for help with jumping.
|
||||||
-- Experiment for yourself to see if you like it!
|
-- Experiment for yourself to see if you like it!
|
||||||
-- vim.opt.relativenumber = true
|
-- vim.opt.relativenumber = true
|
||||||
|
@ -134,7 +134,7 @@ vim.opt.timeoutlen = 300
|
||||||
|
|
||||||
-- Configure how new splits should be opened
|
-- Configure how new splits should be opened
|
||||||
vim.opt.splitright = true
|
vim.opt.splitright = true
|
||||||
vim.opt.splitbelow = true
|
vim.opt.splitbelow = false
|
||||||
|
|
||||||
-- Sets how neovim will display certain whitespace in the editor.
|
-- Sets how neovim will display certain whitespace in the editor.
|
||||||
-- See `:help 'list'`
|
-- See `:help 'list'`
|
||||||
|
@ -151,11 +151,18 @@ vim.opt.cursorline = true
|
||||||
-- Minimal number of screen lines to keep above and below the cursor.
|
-- Minimal number of screen lines to keep above and below the cursor.
|
||||||
vim.opt.scrolloff = 10
|
vim.opt.scrolloff = 10
|
||||||
|
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.softtabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.smarttab = true
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
|
||||||
-- [[ Basic Keymaps ]]
|
-- [[ Basic Keymaps ]]
|
||||||
-- See `:help vim.keymap.set()`
|
-- See `:help vim.keymap.set()`
|
||||||
|
|
||||||
-- Set highlight on search, but clear on pressing <Esc> in normal mode
|
-- Set highlight on search, but clear on pressing <Esc> in normal mode
|
||||||
vim.opt.hlsearch = true
|
vim.opt.hlsearch = true
|
||||||
|
vim.keymap.set('i', '<C-c>', '<Esc>')
|
||||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||||
|
|
||||||
-- Diagnostic keymaps
|
-- Diagnostic keymaps
|
||||||
|
@ -192,7 +199,7 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
||||||
|
|
||||||
-- Highlight when yanking (copying) text
|
-- Highlight when yanking (copying) text
|
||||||
-- Try it with `yap` in normal mode
|
-- Try it with `yap` in normal mode
|
||||||
-- See `:help vim.highlight.on_yank()`
|
-- See `:help vim.highlight.
|
||||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
desc = 'Highlight when yanking (copying) text',
|
desc = 'Highlight when yanking (copying) text',
|
||||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||||
|
@ -373,6 +380,7 @@ require('lazy').setup({
|
||||||
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
||||||
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||||
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
||||||
|
vim.keymap.set('n', '<C-p>', builtin.git_files, { desc = '[ ] Find Git Files' })
|
||||||
|
|
||||||
-- Slightly advanced example of overriding default behavior and theme
|
-- Slightly advanced example of overriding default behavior and theme
|
||||||
vim.keymap.set('n', '<leader>/', function()
|
vim.keymap.set('n', '<leader>/', function()
|
||||||
|
@ -532,18 +540,11 @@ require('lazy').setup({
|
||||||
-- - settings (table): Override the default settings passed when initializing the server.
|
-- - 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/
|
-- 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 = {},
|
||||||
-- pyright = {},
|
rust_analyzer = {},
|
||||||
-- rust_analyzer = {},
|
jdtls = {},
|
||||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
tsserver = {},
|
||||||
--
|
|
||||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
|
||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
|
||||||
--
|
|
||||||
-- But for many setups, the LSP (`tsserver`) will work just fine
|
|
||||||
-- tsserver = {},
|
|
||||||
--
|
|
||||||
|
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
-- cmd = {...},
|
-- cmd = {...},
|
||||||
|
@ -619,7 +620,9 @@ require('lazy').setup({
|
||||||
--
|
--
|
||||||
-- You can use a sub-list to tell conform to run *until* a formatter
|
-- You can use a sub-list to tell conform to run *until* a formatter
|
||||||
-- is found.
|
-- is found.
|
||||||
-- javascript = { { "prettierd", "prettier" } },
|
javascript = { 'prettier' },
|
||||||
|
typescript = { 'prettier' },
|
||||||
|
go = { 'gofmt', 'goimports', 'golines', 'gofumpt' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -674,6 +677,8 @@ require('lazy').setup({
|
||||||
--
|
--
|
||||||
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
||||||
mapping = cmp.mapping.preset.insert {
|
mapping = cmp.mapping.preset.insert {
|
||||||
|
['<Tab>'] = nil,
|
||||||
|
['<S-Tab>'] = nil,
|
||||||
-- Select the [n]ext item
|
-- Select the [n]ext item
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||||
-- Select the [p]revious item
|
-- Select the [p]revious item
|
||||||
|
@ -722,15 +727,13 @@ require('lazy').setup({
|
||||||
-- change the command in the config to whatever the name of that colorscheme is
|
-- change the command in the config to whatever the name of that colorscheme is
|
||||||
--
|
--
|
||||||
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`
|
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`
|
||||||
'folke/tokyonight.nvim',
|
'catppuccin/nvim',
|
||||||
|
name = 'catppuccin',
|
||||||
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
||||||
priority = 1000, -- make sure to load this before all the other start plugins
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
config = function()
|
config = function()
|
||||||
-- Load the colorscheme here.
|
-- Load the colorscheme here
|
||||||
-- Like many other themes, this one has different styles, and you could load
|
vim.cmd.colorscheme 'catppuccin-mocha'
|
||||||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
|
||||||
vim.cmd.colorscheme 'tokyonight-night'
|
|
||||||
|
|
||||||
-- You can configure highlights by doing something like
|
-- You can configure highlights by doing something like
|
||||||
vim.cmd.hi 'Comment gui=none'
|
vim.cmd.hi 'Comment gui=none'
|
||||||
end,
|
end,
|
||||||
|
@ -783,7 +786,6 @@ require('lazy').setup({
|
||||||
config = function()
|
config = function()
|
||||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||||
|
|
||||||
---@diagnostic disable-next-line: missing-fields
|
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
|
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
|
||||||
-- Autoinstall languages that are not installed
|
-- Autoinstall languages that are not installed
|
||||||
|
@ -800,6 +802,81 @@ require('lazy').setup({
|
||||||
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'tpope/vim-fugitive',
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set('n', '<leader>gs', vim.cmd.Git)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'theprimeagen/harpoon',
|
||||||
|
config = function()
|
||||||
|
local mark = require 'harpoon.mark'
|
||||||
|
local ui = require 'harpoon.ui'
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>a', mark.add_file)
|
||||||
|
vim.keymap.set('n', '<C-e>', ui.toggle_quick_menu)
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>j', function()
|
||||||
|
ui.nav_file(1)
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>k', function()
|
||||||
|
ui.nav_file(2)
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>l', function()
|
||||||
|
ui.nav_file(3)
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>;', function()
|
||||||
|
ui.nav_file(4)
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'mbbill/undotree',
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{ 'lewis6991/gitsigns.nvim' },
|
||||||
|
{
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
config = function()
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
require('nvim-tree').setup {
|
||||||
|
view = {
|
||||||
|
adaptive_size = true,
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<C-n>', ':NvimTreeFindFileToggle<CR>')
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{ 'nvim-tree/nvim-web-devicons' },
|
||||||
|
{ 'simrat39/symbols-outline.nvim' },
|
||||||
|
{ 'github/copilot.vim' },
|
||||||
|
{
|
||||||
|
'alexghergh/nvim-tmux-navigation',
|
||||||
|
config = function()
|
||||||
|
require('nvim-tmux-navigation').setup {
|
||||||
|
disable_when_zoomed = true, -- defaults to false
|
||||||
|
keybindings = {
|
||||||
|
left = '<C-h>',
|
||||||
|
down = '<C-j>',
|
||||||
|
up = '<C-k>',
|
||||||
|
right = '<C-l>',
|
||||||
|
last_active = '<C-\\>',
|
||||||
|
next = '<C-Space>',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{ 'mfussenegger/nvim-jdtls' },
|
||||||
|
|
||||||
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
||||||
-- init.lua. If you want these files, they are in the repository, so you can just download them and
|
-- init.lua. If you want these files, they are in the repository, so you can just download them and
|
||||||
|
|
Loading…
Reference in New Issue