Skip to content

Commit 352c43b

Browse files
committed
Merge branch 'master' into customized
2 parents 038e02c + 34e7d29 commit 352c43b

3 files changed

Lines changed: 78 additions & 24 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: 69 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,22 @@ require('lazy').setup({
237237
-- with the first argument being the link and the following
238238
-- keys can be used to configure plugin behavior/loading/etc.
239239
--
240-
-- Use `opts = {}` to force a plugin to be loaded.
240+
-- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
241241
--
242242

243+
-- Alternatively, use `config = function() ... end` for full control over the configuration.
244+
-- If you prefer to call `setup` explicitly, use:
245+
-- {
246+
-- 'lewis6991/gitsigns.nvim',
247+
-- config = function()
248+
-- require('gitsigns').setup({
249+
-- -- Your gitsigns configuration here
250+
-- })
251+
-- end,
252+
-- }
253+
--
243254
-- Here is a more advanced example where we pass configuration
244-
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
245-
-- require('gitsigns').setup({ ... })
255+
-- options to `gitsigns.nvim`.
246256
--
247257
-- See `:help gitsigns` to understand what the configuration keys do
248258
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
@@ -555,13 +565,26 @@ require('lazy').setup({
555565
-- For example, in C this would take you to the header.
556566
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
557567

568+
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
569+
---@param client vim.lsp.Client
570+
---@param method vim.lsp.protocol.Method
571+
---@param bufnr? integer some lsp support methods only in specific files
572+
---@return boolean
573+
local function client_supports_method(client, method, bufnr)
574+
if vim.fn.has 'nvim-0.11' == 1 then
575+
return client:supports_method(method, bufnr)
576+
else
577+
return client.supports_method(method, { bufnr = bufnr })
578+
end
579+
end
580+
558581
-- The following two autocommands are used to highlight references of the
559582
-- word under your cursor when your cursor rests there for a little while.
560583
-- See `:help CursorHold` for information about when this is executed
561584
--
562585
-- When you move your cursor, the highlights will be cleared (the second autocommand).
563586
local client = vim.lsp.get_client_by_id(event.data.client_id)
564-
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
587+
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
565588
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
566589
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
567590
buffer = event.buf,
@@ -588,23 +611,42 @@ require('lazy').setup({
588611
-- code, if the language server you are using supports them
589612
--
590613
-- This may be unwanted, since they displace some of your code
591-
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
614+
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
592615
map('<leader>th', function()
593616
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
594617
end, '[T]oggle Inlay [H]ints')
595618
end
596619
end,
597620
})
598621

599-
-- Change diagnostic symbols in the sign column (gutter)
600-
if vim.g.have_nerd_font then
601-
local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
602-
local diagnostic_signs = {}
603-
for type, icon in pairs(signs) do
604-
diagnostic_signs[vim.diagnostic.severity[type]] = icon
605-
end
606-
vim.diagnostic.config { signs = { text = diagnostic_signs } }
607-
end
622+
-- Diagnostic Config
623+
-- See :help vim.diagnostic.Opts
624+
vim.diagnostic.config {
625+
severity_sort = true,
626+
float = { border = 'rounded', source = 'if_many' },
627+
underline = { severity = vim.diagnostic.severity.ERROR },
628+
signs = vim.g.have_nerd_font and {
629+
text = {
630+
[vim.diagnostic.severity.ERROR] = '󰅚 ',
631+
[vim.diagnostic.severity.WARN] = '󰀪 ',
632+
[vim.diagnostic.severity.INFO] = '󰋽 ',
633+
[vim.diagnostic.severity.HINT] = '󰌶 ',
634+
},
635+
} or {},
636+
virtual_text = {
637+
source = 'if_many',
638+
spacing = 2,
639+
format = function(diagnostic)
640+
local diagnostic_message = {
641+
[vim.diagnostic.severity.ERROR] = diagnostic.message,
642+
[vim.diagnostic.severity.WARN] = diagnostic.message,
643+
[vim.diagnostic.severity.INFO] = diagnostic.message,
644+
[vim.diagnostic.severity.HINT] = diagnostic.message,
645+
}
646+
return diagnostic_message[diagnostic.severity]
647+
end,
648+
},
649+
}
608650

609651
-- LSP servers and clients are able to communicate to each other what features they support.
610652
-- By default, Neovim doesn't support everything that is in the LSP specification.
@@ -672,6 +714,8 @@ require('lazy').setup({
672714
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
673715

674716
require('mason-lspconfig').setup {
717+
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
718+
automatic_installation = false,
675719
handlers = {
676720
function(server_name)
677721
local server = servers[server_name] or {}
@@ -764,6 +808,7 @@ require('lazy').setup({
764808
-- into multiple repos for maintenance purposes.
765809
'hrsh7th/cmp-nvim-lsp',
766810
'hrsh7th/cmp-path',
811+
'hrsh7th/cmp-nvim-lsp-signature-help',
767812
},
768813
config = function()
769814
-- See `:help cmp`
@@ -840,6 +885,7 @@ require('lazy').setup({
840885
{ name = 'nvim_lsp' },
841886
{ name = 'luasnip' },
842887
{ name = 'path' },
888+
{ name = 'nvim_lsp_signature_help' },
843889
},
844890
}
845891
end,
@@ -860,11 +906,18 @@ require('lazy').setup({
860906
'telescope',
861907
},
862908
priority = 1000, -- Make sure to load this before all the other start plugins.
863-
init = function()
909+
config = function()
910+
---@diagnostic disable-next-line: missing-fields
911+
require('tokyonight').setup {
912+
styles = {
913+
comments = { italic = false }, -- Disable italics in comments
914+
},
915+
}
916+
864917
-- Load the colorscheme here.
865918
-- Like many other themes, this one has different styles, and you could load
866919
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
867-
vim.cmd.colorscheme 'material'
920+
vim.cmd.colorscheme 'tokyonight-night'
868921

869922
-- You can configure highlights by doing something like:
870923
vim.cmd.hi 'Comment gui=none'

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)