|
|
|
|
@@ -16,8 +16,8 @@ vim.o.cursorline = true -- Highlight current line
|
|
|
|
|
vim.o.winborder = "single" -- Borders around popups like when you press leader for keybinds
|
|
|
|
|
vim.opt.signcolumn =
|
|
|
|
|
'yes' -- TEST: Prohibit layout shifting by always showing the sign column (left of line numbers), you should see an icon there on this row.
|
|
|
|
|
vim.o.updatetime = 250
|
|
|
|
|
vim.o.timeoutlen = 300
|
|
|
|
|
vim.o.updatetime = 250 -- Speed up the CursorHold autocmd event
|
|
|
|
|
vim.o.timeoutlen = 300 -- Speed up completion of key event
|
|
|
|
|
-- SECTION: Globals
|
|
|
|
|
vim.g.mapleader = ' ' -- Mapping leader to space.
|
|
|
|
|
vim.g.maplocalleader = ' ' -- Mapping leader to space.
|
|
|
|
|
@@ -47,6 +47,9 @@ vim.keymap.set('n', '<leader>sf', function()
|
|
|
|
|
require('mini.pick').builtin.files()
|
|
|
|
|
end, { desc = "Search files" })
|
|
|
|
|
vim.keymap.set('n', '<leader>sg', ":Pick grep_live<CR>", { desc = "Search file contents" })
|
|
|
|
|
vim.keymap.set('n', '<leader>sh', ":Pick help<CR>", { desc = "Search help pages" })
|
|
|
|
|
vim.keymap.set('n', '<leader>sr', ":Pick resume<CR>", { desc = "Resume last search" })
|
|
|
|
|
vim.keymap.set('n', '<leader>sb', ":Pick buffers<CR>", { desc = "Search buffers" })
|
|
|
|
|
|
|
|
|
|
-- Get help with keybinds
|
|
|
|
|
vim.keymap.set('n', '<leader>?', ":WhichKey<CR>", { desc = "Show keybinds" })
|
|
|
|
|
@@ -63,6 +66,9 @@ vim.pack.add({
|
|
|
|
|
'https://github.com/nvim-mini/mini.completion', -- Autocomplete, needs snippets and icons
|
|
|
|
|
'https://github.com/nvim-mini/mini.snippets', -- Snippets
|
|
|
|
|
'https://github.com/nvim-mini/mini.icons', -- Icons
|
|
|
|
|
'https://github.com/nvim-mini/mini.cursorword', -- Highlight word under cursor
|
|
|
|
|
'https://github.com/nvim-mini/mini.hipatterns', -- Highlight todos and rgb colors
|
|
|
|
|
'https://github.com/nvim-mini/mini.statusline', -- Statusline at the bottom
|
|
|
|
|
'https://github.com/neovim/nvim-lspconfig', -- Language servers
|
|
|
|
|
'https://github.com/mason-org/mason.nvim', -- LSP deps installer
|
|
|
|
|
'https://github.com/mason-org/mason-lspconfig.nvim', -- Lets you install mason tooling using lsp names
|
|
|
|
|
@@ -70,7 +76,6 @@ vim.pack.add({
|
|
|
|
|
'https://github.com/folke/lazydev.nvim', -- Automatically resolve vim api paths.
|
|
|
|
|
'https://github.com/folke/which-key.nvim', -- Shortcut hints (bar at the bottom when pressing space)
|
|
|
|
|
'https://github.com/nvim-lua/plenary.nvim', -- Helper lua functions, dep of todo-comments.
|
|
|
|
|
'https://github.com/folke/todo-comments.nvim', -- Helper lua functions, dep of todo-comments.
|
|
|
|
|
'https://github.com/nvim-treesitter/nvim-treesitter', -- Syntax highlighting
|
|
|
|
|
'https://github.com/stevearc/oil.nvim', -- File explorer
|
|
|
|
|
})
|
|
|
|
|
@@ -90,14 +95,15 @@ wk.add({
|
|
|
|
|
{ '<leader>o', group = 'Source current file', mode = { 'n' } },
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
require('todo-comments').setup({
|
|
|
|
|
keywords = {
|
|
|
|
|
SECTION = {
|
|
|
|
|
icon = " ",
|
|
|
|
|
color = "hint",
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
-- require('todo-comments').setup({
|
|
|
|
|
-- keywords = {
|
|
|
|
|
-- SECTION = {
|
|
|
|
|
-- icon = " ",
|
|
|
|
|
-- color = "hint",
|
|
|
|
|
-- }
|
|
|
|
|
-- }
|
|
|
|
|
-- })
|
|
|
|
|
|
|
|
|
|
-- Mini
|
|
|
|
|
local MiniPicker = require('mini.pick').setup({
|
|
|
|
|
@@ -112,7 +118,16 @@ require('mini.icons').setup()
|
|
|
|
|
MiniIcons.tweak_lsp_kind()
|
|
|
|
|
require('mini.snippets').setup()
|
|
|
|
|
require('mini.completion').setup()
|
|
|
|
|
|
|
|
|
|
require('mini.cursorword').setup()
|
|
|
|
|
require('mini.hipatterns').setup({
|
|
|
|
|
highlighters = {
|
|
|
|
|
todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' },
|
|
|
|
|
section = { pattern = '%f[%w]()SECTION()%f[%W]', group = 'MiniHipatternsNote' },
|
|
|
|
|
warning = { pattern = '%f[%w]()WARNING()%f[%W]', group = 'MiniHipatternsHack' },
|
|
|
|
|
error = { pattern = '%f[%w]()ERROR()%f[%W]', group = 'MiniHipatternsTodo' },
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
require('mini.statusline').setup()
|
|
|
|
|
require('oil').setup()
|
|
|
|
|
|
|
|
|
|
require('nvim-treesitter').setup({
|
|
|
|
|
@@ -123,7 +138,12 @@ require('nvim-treesitter').setup({
|
|
|
|
|
require("mason").setup()
|
|
|
|
|
require("mason-lspconfig").setup({
|
|
|
|
|
-- Install lsp deps here
|
|
|
|
|
ensure_installed = { 'lua_ls', 'ts_ls', 'ansiblels', 'eslint' },
|
|
|
|
|
ensure_installed = {
|
|
|
|
|
'lua_ls',
|
|
|
|
|
'ts_ls',
|
|
|
|
|
'ansiblels',
|
|
|
|
|
'eslint'
|
|
|
|
|
},
|
|
|
|
|
automatic_enable = true
|
|
|
|
|
})
|
|
|
|
|
require("mason-tool-installer").setup({
|
|
|
|
|
@@ -170,30 +190,6 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|
|
|
|
})
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Highlight the word you are standing on after a little while
|
|
|
|
|
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, ev.buf) then
|
|
|
|
|
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
|
|
|
|
|
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
|
|
|
|
buffer = ev.buf,
|
|
|
|
|
group = highlight_augroup,
|
|
|
|
|
callback = vim.lsp.buf.document_highlight,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
|
|
|
|
buffer = ev.buf,
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
-- Swap out the icons in the leftmost column and show inlay hints
|
|
|
|
|
vim.diagnostic.config {
|
|
|
|
|
severity_sort = true,
|
|
|
|
|
|