Updates
This commit is contained in:
parent
c887a96ef2
commit
a6f2588d65
|
@ -4,4 +4,3 @@ test.sh
|
||||||
nvim
|
nvim
|
||||||
|
|
||||||
spell/
|
spell/
|
||||||
lazy-lock.json
|
|
||||||
|
|
146
init.lua
146
init.lua
|
@ -113,7 +113,7 @@ vim.opt.splitbelow = true
|
||||||
-- See `:help 'list'`
|
-- See `:help 'list'`
|
||||||
-- and `:help 'listchars'`
|
-- and `:help 'listchars'`
|
||||||
vim.opt.list = true
|
vim.opt.list = true
|
||||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
vim.opt.listchars = { tab = '» ', trail = '~', nbsp = '␣', extends = '>', precedes = '<', space = '·' }
|
||||||
|
|
||||||
-- Preview substitutions live, as you type!
|
-- Preview substitutions live, as you type!
|
||||||
vim.opt.inccommand = 'split'
|
vim.opt.inccommand = 'split'
|
||||||
|
@ -254,18 +254,55 @@ require('lazy').setup({
|
||||||
{ -- Useful plugin to show you pending keybinds.
|
{ -- Useful plugin to show you pending keybinds.
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||||
config = function() -- This is the function that runs, AFTER loading
|
opts = {
|
||||||
require('which-key').setup()
|
icons = {
|
||||||
|
-- set icon mappings to true if you have a Nerd Font
|
||||||
|
mappings = vim.g.have_nerd_font,
|
||||||
|
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
||||||
|
-- default whick-key.nvim defined Nerd Font icons, otherwise define a string table
|
||||||
|
keys = vim.g.have_nerd_font and {} or {
|
||||||
|
Up = '<Up> ',
|
||||||
|
Down = '<Down> ',
|
||||||
|
Left = '<Left> ',
|
||||||
|
Right = '<Right> ',
|
||||||
|
C = '<C-…> ',
|
||||||
|
M = '<M-…> ',
|
||||||
|
D = '<D-…> ',
|
||||||
|
S = '<S-…> ',
|
||||||
|
CR = '<CR> ',
|
||||||
|
Esc = '<Esc> ',
|
||||||
|
ScrollWheelDown = '<ScrollWheelDown> ',
|
||||||
|
ScrollWheelUp = '<ScrollWheelUp> ',
|
||||||
|
NL = '<NL> ',
|
||||||
|
BS = '<BS> ',
|
||||||
|
Space = '<Space> ',
|
||||||
|
Tab = '<Tab> ',
|
||||||
|
F1 = '<F1>',
|
||||||
|
F2 = '<F2>',
|
||||||
|
F3 = '<F3>',
|
||||||
|
F4 = '<F4>',
|
||||||
|
F5 = '<F5>',
|
||||||
|
F6 = '<F6>',
|
||||||
|
F7 = '<F7>',
|
||||||
|
F8 = '<F8>',
|
||||||
|
F9 = '<F9>',
|
||||||
|
F10 = '<F10>',
|
||||||
|
F11 = '<F11>',
|
||||||
|
F12 = '<F12>',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- Document existing key chains
|
-- Document existing key chains
|
||||||
require('which-key').register {
|
spec = {
|
||||||
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
||||||
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
{ '<leader>d', group = '[D]ocument' },
|
||||||
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
{ '<leader>r', group = '[R]ename' },
|
||||||
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
{ '<leader>s', group = '[S]earch' },
|
||||||
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
{ '<leader>w', group = '[W]orkspace' },
|
||||||
}
|
{ '<leader>t', group = '[T]oggle' },
|
||||||
end,
|
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- NOTE: Plugins can specify dependencies.
|
-- NOTE: Plugins can specify dependencies.
|
||||||
|
@ -391,6 +428,8 @@ require('lazy').setup({
|
||||||
-- Useful status updates for LSP.
|
-- Useful status updates for LSP.
|
||||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||||
{ 'j-hui/fidget.nvim', opts = {} },
|
{ 'j-hui/fidget.nvim', opts = {} },
|
||||||
|
-- Allows extra capabilities provided by nvim-cmp
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Brief Aside: **What is LSP?**
|
-- Brief Aside: **What is LSP?**
|
||||||
|
@ -481,17 +520,29 @@ require('lazy').setup({
|
||||||
-- See `:help CursorHold` for information about when this is executed
|
-- See `:help CursorHold` for information about when this is executed
|
||||||
--
|
--
|
||||||
-- 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.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) 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,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
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
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
@ -587,20 +638,43 @@ require('lazy').setup({
|
||||||
|
|
||||||
{ -- Autoformat
|
{ -- Autoformat
|
||||||
'stevearc/conform.nvim',
|
'stevearc/conform.nvim',
|
||||||
|
event = { 'BufWritePre' },
|
||||||
|
cmd = { 'ConformInfo' },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
'<leader>f',
|
||||||
|
function()
|
||||||
|
require('conform').format { async = true, lsp_format = 'fallback' }
|
||||||
|
end,
|
||||||
|
mode = '',
|
||||||
|
desc = '[F]ormat buffer',
|
||||||
|
},
|
||||||
|
},
|
||||||
opts = {
|
opts = {
|
||||||
notify_on_error = false,
|
notify_on_error = false,
|
||||||
format_on_save = {
|
format_on_save = function(bufnr)
|
||||||
timeout_ms = 500,
|
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||||
lsp_fallback = true,
|
-- have a well standardized coding style. You can add additional
|
||||||
},
|
-- languages here or re-enable it for the disabled ones.
|
||||||
|
local disable_filetypes = { c = true, cpp = true }
|
||||||
|
local lsp_format_opt
|
||||||
|
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||||
|
lsp_format_opt = 'never'
|
||||||
|
else
|
||||||
|
lsp_format_opt = 'fallback'
|
||||||
|
end
|
||||||
|
return {
|
||||||
|
timeout_ms = 500,
|
||||||
|
lsp_format = lsp_format_opt,
|
||||||
|
}
|
||||||
|
end,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
-- Conform can also run multiple formatters sequentially
|
-- Conform can also run multiple formatters sequentially
|
||||||
-- python = { "isort", "black" },
|
-- python = { "isort", "black" },
|
||||||
--
|
--
|
||||||
-- You can use a sub-list to tell conform to run *until* a formatter
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
-- is found.
|
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
-- javascript = { { "prettierd", "prettier" } },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -660,6 +734,10 @@ require('lazy').setup({
|
||||||
-- Select the [p]revious item
|
-- Select the [p]revious item
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||||
|
|
||||||
|
-- Scroll the documentation window [b]ack / [f]orward
|
||||||
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
|
||||||
-- Accept ([y]es) the completion.
|
-- Accept ([y]es) the completion.
|
||||||
-- This will auto-import if your LSP supports it.
|
-- This will auto-import if your LSP supports it.
|
||||||
-- This will expand snippets if the LSP sent a snippet.
|
-- This will expand snippets if the LSP sent a snippet.
|
||||||
|
@ -763,21 +841,39 @@ require('lazy').setup({
|
||||||
{ -- Highlight, edit, and navigate code
|
{ -- Highlight, edit, and navigate code
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
|
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||||
config = function()
|
config = function()
|
||||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||||
|
|
||||||
---@diagnostic disable-next-line: missing-fields
|
---@diagnostic disable-next-line: missing-fields
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
|
ensure_installed = {
|
||||||
|
'bash',
|
||||||
|
'c',
|
||||||
|
'javascript',
|
||||||
|
'python',
|
||||||
|
'svelte',
|
||||||
|
'elixir',
|
||||||
|
'go',
|
||||||
|
'diff',
|
||||||
|
'html',
|
||||||
|
'lua',
|
||||||
|
'markdown',
|
||||||
|
'vim',
|
||||||
|
'vimdoc',
|
||||||
|
},
|
||||||
-- Autoinstall languages that are not installed
|
-- Autoinstall languages that are not installed
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = { enable = true },
|
highlight = {
|
||||||
indent = { enable = true },
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = { 'ruby' },
|
||||||
|
},
|
||||||
|
indent = { enable = true, disable = { 'ruby', 'elixir' } },
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.api.nvim_set_option('foldenable', false)
|
vim.api.nvim_set_option_value('foldenable', false, {})
|
||||||
vim.api.nvim_set_option('foldmethod', 'expr')
|
vim.api.nvim_set_option_value('foldmethod', 'expr', {})
|
||||||
vim.api.nvim_set_option('foldexpr', 'nvim_treesitter#foldexpr()')
|
vim.api.nvim_set_option_value('foldexpr', 'nvim_treesitter#foldexpr()', {})
|
||||||
|
|
||||||
-- There are additional nvim-treesitter modules that you can use to interact
|
-- There are additional nvim-treesitter modules that you can use to interact
|
||||||
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
|
"conform.nvim": { "branch": "master", "commit": "40d4e98fcc3e6f485f0e8924c63734bc7e305967" },
|
||||||
|
"elixir-tools.nvim": { "branch": "main", "commit": "b465f6aff50257fa466de3886fc3e7de2dcff0de" },
|
||||||
|
"fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
|
||||||
|
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
|
"mini.nvim": { "branch": "main", "commit": "61e5d46fc0cf71306c51275383767d996f559a60" },
|
||||||
|
"nerdtree": { "branch": "master", "commit": "9b465acb2745beb988eff3c1e4aa75f349738230" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "39f31e178466e4ed23c8ea6fddd5b7a4d9699398" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "45386764cc9535200d2288cab929c5093d33660e" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "56f17def81478e406e3a8ec4aa727558e79786f3" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||||
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||||
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
|
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||||
|
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||||
|
"tokyonight.nvim": { "branch": "main", "commit": "2c85fad417170d4572ead7bf9fdd706057bd73d7" },
|
||||||
|
"vim-devicons": { "branch": "master", "commit": "71f239af28b7214eebb60d4ea5bd040291fb7e33" },
|
||||||
|
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
|
||||||
|
}
|
Loading…
Reference in New Issue