Compare commits

...

11 Commits

Author SHA1 Message Date
741e2bc207 search command history keymap 2024-04-29 09:13:21 +02:00
d5adb82437 Merge remote-tracking branch 'modular/master' 2024-04-29 08:04:51 +02:00
Damjan 9000
60d893f8c5 Merge 'upstream' README: add clipboard tool dependency 2024-04-28 10:02:23 +02:00
Damjan 9000
b7d5cc8f42
README: add clipboard tool dependency (#886)
Fixes: #884
Neovim requires an external tool for proper system clipboard integration.
Some systems install this already by default:
- on Fedora xsel is already installed by default
- on Windows using the choko install the win32yank is alredy installed
This is not installed by default on ubuntu or debian so adding that
to the dependencies list and to the install instructions snippets.
2024-04-27 16:40:27 -04:00
Damjan 9000
77dbcfaaf7 Merge 'upstream' fix: highlight group clear on each attach, README 2024-04-22 23:48:46 +02:00
Adolfo Gante
8df3deb6fe
Update README.md (#875)
Line 102. Placed 'also' before the 'includes'.

"That includes also examples of adding popularly requested plugins." ---> "That also includes examples of adding popularly requested plugins."
2024-04-22 17:15:42 -04:00
Francis Belanger
942b26184c
fix: highlight group clear on each attach (#874) 2024-04-22 15:53:45 -04:00
Damjan 9000
b939e2f5a1 Merge 'upstream' Fix highlight errors when lsp crash or stop 2024-04-22 18:07:12 +02:00
Francis Belanger
81f270a704
Fix highlight errors when lsp crash or stop (#864)
* Fix highlight errors when lsp crash or stop

It adds a check wether the client is still available before
highlighting.

If the client is not there anymore it returns `true` to unregister the
autocommand

This fix the
`method textDocument/documentHighlight is not supported by any of the servers registered for the current buffer`
errors when doing a LspRestart or the server crashes

* Delete the highlight autocommands in the LspDetatch event

* Only delete autocmds for the current buffer with the group name

* Simplify clearing the autocommands

---------

Co-authored-by: Francis Belanger <francis.belanger@ubisoft.com>
2024-04-22 11:43:10 -04:00
Damjan 9000
74136a1db7 Merge 'upstream' Fix deprecation notice of inlay hints 2024-04-22 14:01:50 +02:00
Vladislav Grechannik
f92fb11d68
Fix deprecation notice of inlay hints (#873) 2024-04-22 07:27:13 -04:00
3 changed files with 17 additions and 4 deletions

View File

@ -18,6 +18,7 @@ If you are experiencing issues, please make sure you have the latest versions.
External Requirements: External Requirements:
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation) - [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
- Clipboard tool (xclip/xsel/win32yank or other depending on platform)
- A [Nerd Font](https://www.nerdfonts.com/): provides various icons - A [Nerd Font](https://www.nerdfonts.com/): provides various icons
- Language utils: `rustup`, `npm`, `dotnet`, `python` - Language utils: `rustup`, `npm`, `dotnet`, `python`
- Optionally, install [Alacritty](https://github.com/alacritty/alacritty#installation) - Optionally, install [Alacritty](https://github.com/alacritty/alacritty#installation)
@ -152,7 +153,7 @@ wsl --install
wsl wsl
sudo add-apt-repository ppa:neovim-ppa/unstable -y sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update sudo apt update
sudo apt install make gcc ripgrep unzip neovim sudo apt install make gcc ripgrep unzip git xclip neovim
``` ```
</details> </details>
@ -162,14 +163,14 @@ sudo apt install make gcc ripgrep unzip neovim
``` ```
sudo add-apt-repository ppa:neovim-ppa/unstable -y sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update sudo apt update
sudo apt install make gcc ripgrep unzip git neovim sudo apt install make gcc ripgrep unzip git xclip neovim
``` ```
</details> </details>
<details><summary>Debian Install Steps</summary> <details><summary>Debian Install Steps</summary>
``` ```
sudo apt update sudo apt update
sudo apt install make gcc ripgrep unzip git curl sudo apt install make gcc ripgrep unzip git xclip curl
# Now we install nvim # Now we install nvim
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz

View File

@ -108,13 +108,16 @@ return {
-- When you move your cursor, the highlights will be cleared (the second autocommand). -- When you move your cursor, the highlights will be cleared (the second autocommand).
local client = vim.lsp.get_client_by_id(event.data.client_id) local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client.server_capabilities.documentHighlightProvider then if client and client.server_capabilities.documentHighlightProvider then
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
buffer = event.buf, buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.document_highlight, callback = vim.lsp.buf.document_highlight,
}) })
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
buffer = event.buf, buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.clear_references, callback = vim.lsp.buf.clear_references,
}) })
end end
@ -125,12 +128,20 @@ return {
-- This may be unwanted, since they displace some of your code -- This may be unwanted, since they displace some of your code
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
map('<leader>th', function() map('<leader>th', function()
vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled()) vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, '[T]oggle Inlay [H]ints') end, '[T]oggle Inlay [H]ints')
end end
end, 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. -- 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. -- 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. -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.

View File

@ -113,6 +113,7 @@ return {
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
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>sc', builtin.command_history, { desc = '[S]earch [C]ommand History' })
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' }) vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
-- Telescope live_grep in git root -- Telescope live_grep in git root