Skip to content

Commit ee60df3

Browse files
committed
Merge branch 'master' into codemedic-customisations
* master: feat: add basic function signature help (nvim-lua#1358) perf: load tokyonight.nvim in the intended way (nvim-lua#1360) feat(diagnostic): add diagnostic config (nvim-lua#1335) fix: arguments for the `vim.lsp.Client.supports_method` method (nvim-lua#1356) Add a blurb about installing missing emoji on Ubuntu fix (nvim-lua#1319): gitsigns deprecated functions (nvim-lua#1321) docs: clarify using opts = {} vs config = function() ... require('plu… (nvim-lua#1316) chore(docs): Update README.md (nvim-lua#1344)
2 parents 1dae36e + 282cbb9 commit ee60df3

3 files changed

Lines changed: 63 additions & 26 deletions

File tree

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ External Requirements:
2727
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
2828
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
2929
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
30+
- Emoji fonts (Ubuntu only, and only if you want emoji!) `sudo apt install fonts-noto-color-emoji`
3031
- Language Setup:
3132
- If you want to write Typescript, you need `npm`
3233
- If you want to write Golang, you will need `go`
@@ -212,14 +213,14 @@ sudo apt update
212213
sudo apt install make gcc ripgrep unzip git xclip curl
213214
214215
# Now we install nvim
215-
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
216-
sudo rm -rf /opt/nvim-linux64
217-
sudo mkdir -p /opt/nvim-linux64
218-
sudo chmod a+rX /opt/nvim-linux64
219-
sudo tar -C /opt -xzf nvim-linux64.tar.gz
216+
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
217+
sudo rm -rf /opt/nvim-linux-x86_64
218+
sudo mkdir -p /opt/nvim-linux-x86_64
219+
sudo chmod a+rX /opt/nvim-linux-x86_64
220+
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
220221
221222
# make it available in /usr/local/bin, distro installs to /usr/bin
222-
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
223+
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
223224
```
224225
</details>
225226
<details><summary>Fedora Install Steps</summary>

init.lua

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,22 @@ require('lazy').setup({
245245
-- with the first argument being the link and the following
246246
-- keys can be used to configure plugin behavior/loading/etc.
247247
--
248-
-- Use `opts = {}` to force a plugin to be loaded.
248+
-- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
249249
--
250250

251+
-- Alternatively, use `config = function() ... end` for full control over the configuration.
252+
-- If you prefer to call `setup` explicitly, use:
253+
-- {
254+
-- 'lewis6991/gitsigns.nvim',
255+
-- config = function()
256+
-- require('gitsigns').setup({
257+
-- -- Your gitsigns configuration here
258+
-- })
259+
-- end,
260+
-- }
261+
--
251262
-- Here is a more advanced example where we pass configuration
252-
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
253-
-- require('gitsigns').setup({ ... })
263+
-- options to `gitsigns.nvim`.
254264
--
255265
-- See `:help gitsigns` to understand what the configuration keys do
256266
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
@@ -570,7 +580,7 @@ require('lazy').setup({
570580
--
571581
-- When you move your cursor, the highlights will be cleared (the second autocommand).
572582
local client = vim.lsp.get_client_by_id(event.data.client_id)
573-
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
583+
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
574584
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
575585
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
576586
buffer = event.buf,
@@ -597,23 +607,42 @@ require('lazy').setup({
597607
-- code, if the language server you are using supports them
598608
--
599609
-- This may be unwanted, since they displace some of your code
600-
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
610+
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
601611
map('<leader>th', function()
602612
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
603613
end, '[T]oggle Inlay [H]ints')
604614
end
605615
end,
606616
})
607617

608-
-- Change diagnostic symbols in the sign column (gutter)
609-
-- if vim.g.have_nerd_font then
610-
-- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
611-
-- local diagnostic_signs = {}
612-
-- for type, icon in pairs(signs) do
613-
-- diagnostic_signs[vim.diagnostic.severity[type]] = icon
614-
-- end
615-
-- vim.diagnostic.config { signs = { text = diagnostic_signs } }
616-
-- end
618+
-- Diagnostic Config
619+
-- See :help vim.diagnostic.Opts
620+
vim.diagnostic.config {
621+
severity_sort = true,
622+
float = { border = 'rounded', source = 'if_many' },
623+
underline = { severity = vim.diagnostic.severity.ERROR },
624+
signs = vim.g.have_nerd_font and {
625+
text = {
626+
[vim.diagnostic.severity.ERROR] = '󰅚 ',
627+
[vim.diagnostic.severity.WARN] = '󰀪 ',
628+
[vim.diagnostic.severity.INFO] = '󰋽 ',
629+
[vim.diagnostic.severity.HINT] = '󰌶 ',
630+
},
631+
} or {},
632+
virtual_text = {
633+
source = 'if_many',
634+
spacing = 2,
635+
format = function(diagnostic)
636+
local diagnostic_message = {
637+
[vim.diagnostic.severity.ERROR] = diagnostic.message,
638+
[vim.diagnostic.severity.WARN] = diagnostic.message,
639+
[vim.diagnostic.severity.INFO] = diagnostic.message,
640+
[vim.diagnostic.severity.HINT] = diagnostic.message,
641+
}
642+
return diagnostic_message[diagnostic.severity]
643+
end,
644+
},
645+
}
617646

618647
-- LSP servers and clients are able to communicate to each other what features they support.
619648
-- By default, Neovim doesn't support everything that is in the LSP specification.
@@ -788,6 +817,8 @@ require('lazy').setup({
788817
-- into multiple repos for maintenance purposes.
789818
'hrsh7th/cmp-nvim-lsp',
790819
'hrsh7th/cmp-path',
820+
'hrsh7th/cmp-path',
821+
'htsh7th/cmp-nvim-lsp-signature-help',
791822
},
792823
config = function()
793824
-- See `:help cmp`
@@ -886,6 +917,7 @@ require('lazy').setup({
886917
{ name = 'nvim_lsp' },
887918
{ name = 'luasnip' },
888919
{ name = 'path' },
920+
{ name = 'nvim_lsp_signature_help' },
889921
},
890922
}
891923
end,
@@ -898,14 +930,18 @@ require('lazy').setup({
898930
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
899931
'folke/tokyonight.nvim',
900932
priority = 1000, -- Make sure to load this before all the other start plugins.
901-
init = function()
933+
config = function()
934+
---@diagnostic disable-next-line: missing-fields
935+
require('tokyonight').setup {
936+
styles = {
937+
comments = { italic = false }, -- Disable italics in comments
938+
},
939+
}
940+
902941
-- Load the colorscheme here.
903942
-- Like many other themes, this one has different styles, and you could load
904943
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
905944
vim.cmd.colorscheme 'tokyonight-night'
906-
907-
-- You can configure highlights by doing something like:
908-
vim.cmd.hi 'Comment gui=none'
909945
end,
910946
},
911947

lua/kickstart/plugins/gitsigns.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ return {
4444
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
4545
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
4646
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
47-
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
47+
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
4848
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
4949
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
5050
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
@@ -54,7 +54,7 @@ return {
5454
end, { desc = 'git [D]iff against last commit' })
5555
-- Toggles
5656
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
57-
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
57+
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
5858
end,
5959
},
6060
},

0 commit comments

Comments
 (0)