Skip to content

Commit

Permalink
Move stuff into custom + Java + Copilot (#3)
Browse files Browse the repository at this point in the history
* Move LspDetach handler near kickstart-lsp-highlight group (nvim-lua#900)

Moved to make sure the kickstart-lsp-highlight group exists when
the LspDetach handler is invoked. The LspDetach handler is used
to clean up any lsp highlights that were enabled by CursorHold
if the LSP is stopped or crashed.

* Add diff to treesitter's ensure_installed languages (nvim-lua#908)

* Added github copilot

* Added Java plugin

* custom plugins

* Just pushing it

* Just pushing it

---------

Co-authored-by: Damjan 9000 <damjan.9000@gmail.com>
Co-authored-by: Richard Macklin <1863540+rmacklin@users.noreply.github.com>
  • Loading branch information
3 people committed May 6, 2024
1 parent b3f8ca0 commit 3dfd75f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
34 changes: 9 additions & 25 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ require('lazy').setup({
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },

'github/copilot.vim',
{ 'pocco81/auto-save.nvim' },
-- Here is a more advanced example where we pass configuration
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
-- require('gitsigns').setup({ ... })
Expand Down Expand Up @@ -414,15 +412,6 @@ require('lazy').setup({
end, { desc = '[S]earch [N]eovim files' })
end,
},
{
'ibhagwan/fzf-lua',
-- optional for icon support
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
-- calling `setup` is optional for customization
require('fzf-lua').setup {}
end,
},
{ -- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
Expand Down Expand Up @@ -541,6 +530,14 @@ require('lazy').setup({
group = highlight_augroup,
callback = vim.lsp.buf.clear_references,
})

vim.api.nvim_create_autocmd('LspDetach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
callback = function(event2)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
end,
})
end

-- The following autocommand is used to enable inlay hints in your
Expand All @@ -555,14 +552,6 @@ require('lazy').setup({
end,
})

vim.api.nvim_create_autocmd('LspDetach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
callback = function(event)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event.buf }
end,
})

-- LSP servers and clients are able to communicate to each other what features they support.
-- By default, Neovim doesn't support everything that is in the LSP specification.
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
Expand Down Expand Up @@ -883,7 +872,7 @@ require('lazy').setup({
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
opts = {
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim' },
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
Expand Down Expand Up @@ -911,11 +900,6 @@ require('lazy').setup({
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
end,
},
-- {
-- 'mrcjkb/rustaceanvim',
-- version = '^4', -- Recommended
-- lazy = false, -- This plugin is already lazy
-- },
-- 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
-- place them in the correct locations.
Expand Down
15 changes: 14 additions & 1 deletion lua/custom/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,17 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}

return {
{ 'pocco81/auto-save.nvim' },
'github/copilot.vim',
{
'ibhagwan/fzf-lua',
-- optional for icon support
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
-- calling `setup` is optional for customization
require('fzf-lua').setup {}
end,
},
}

0 comments on commit 3dfd75f

Please sign in to comment.