nvim: lazy: reorder plugins

This commit is contained in:
He4eT 2024-04-04 01:03:46 +02:00
commit 32b0ea1b7a

View file

@ -123,7 +123,6 @@ vim.keymap.set({ 'n' }, '<BS>', ':nohl<CR>', { desc = 'Turn off highlight' })
vim.keymap.set({ 'n' }, '<ESC>', ':nohl<CR>', { desc = 'Turn off highlight' }) vim.keymap.set({ 'n' }, '<ESC>', ':nohl<CR>', { desc = 'Turn off highlight' })
-- [[ Highlight on yank ]] -- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', { vim.api.nvim_create_autocmd('TextYankPost', {
callback = function() callback = function()
@ -136,7 +135,6 @@ vim.api.nvim_create_autocmd('TextYankPost', {
-- [[ Lazy ]] -- [[ Lazy ]]
-- Install package manager -- Install package manager
-- https://github.com/folke/lazy.nvim -- https://github.com/folke/lazy.nvim
-- See `:help lazy.nvim.txt` for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system { vim.fn.system {
@ -153,8 +151,50 @@ vim.opt.rtp:prepend(lazypath)
require('lazy').setup({ require('lazy').setup({
-- Detect tabstop and shiftwidth automatically -- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth', 'tpope/vim-sleuth',
-- Backup mainstream colorscheme inspired by Atom -- Color highlighter
'navarasu/onedark.nvim', 'norcalli/nvim-colorizer.lua',
{ -- `gc` to comment visual regions/lines
'numToStr/Comment.nvim',
opts = {},
},
{ -- Leap motion plugin
'ggandor/leap.nvim',
dependencies = {
'tpope/vim-repeat',
},
config = function ()
local leap = require('leap')
leap.add_default_mappings()
leap.opts.highlight_unlabeled_phase_one_targets = true
leap.opts.safe_labels = {}
end
},
{ -- Set lualine as statusline
'nvim-lualine/lualine.nvim',
opts = {
options = {
icons_enabled = false,
component_separators = '|',
section_separators = '',
globalstatus = true,
},
},
},
{ -- Adds git releated signs to the gutter
'lewis6991/gitsigns.nvim',
opts = {
signs = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '' },
},
preview_config = {
border = 'solid',
},
},
},
{ -- Main colorscheme { -- Main colorscheme
'He4eT/desolate.nvim', 'He4eT/desolate.nvim',
config = function() config = function()
@ -183,24 +223,8 @@ require('lazy').setup({
'rktjmp/lush.nvim', 'rktjmp/lush.nvim',
}, },
}, },
-- Color highlighter -- Backup mainstream colorscheme inspired by Atom
'norcalli/nvim-colorizer.lua', 'navarasu/onedark.nvim',
{ -- `gc` to comment visual regions/lines
'numToStr/Comment.nvim',
opts = {},
},
{ -- Leap motion plugin
'ggandor/leap.nvim',
dependencies = {
'tpope/vim-repeat',
},
config = function ()
local leap = require('leap')
leap.add_default_mappings()
leap.opts.highlight_unlabeled_phase_one_targets = true
leap.opts.safe_labels = {}
end
},
{ -- FZF { -- FZF
'ibhagwan/fzf-lua', 'ibhagwan/fzf-lua',
dependencies = { dependencies = {
@ -313,34 +337,6 @@ require('lazy').setup({
'saadparwaiz1/cmp_luasnip', 'saadparwaiz1/cmp_luasnip',
}, },
}, },
{ -- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
opts = {
-- See `:help gitsigns.txt`
signs = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '' },
},
preview_config = {
border = 'solid',
},
},
},
{ -- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = false,
component_separators = '|',
section_separators = '',
globalstatus = true,
},
},
},
{ -- Highlight, edit, and navigate code { -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
dependencies = { dependencies = {
@ -348,9 +344,7 @@ require('lazy').setup({
}, },
build = ':TSUpdate', build = ':TSUpdate',
config = function () config = function ()
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { ensure_installed = {
'vim', 'vim',
'vimdoc', 'vimdoc',
@ -381,7 +375,6 @@ require('lazy').setup({
enable = true, enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = { keymaps = {
-- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer', ['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner', ['ia'] = '@parameter.inner',
['af'] = '@function.outer', ['af'] = '@function.outer',
@ -502,7 +495,7 @@ local on_attach = function(_, bufnr)
-- LSP keymaps -- LSP keymaps
-- See `:help K` for why this keymap -- Hover Documentation
nmap('K', vim.lsp.buf.hover, 'Hover Documentation') nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation') nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
@ -528,15 +521,10 @@ local on_attach = function(_, bufnr)
end, { desc = 'Format current buffer with LSP' }) end, { desc = 'Format current buffer with LSP' })
end end
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- Enable the following language servers -- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. They will be passed to
-- the `settings` field of the server config. You must look up that documentation yourself.
local servers = { local servers = {
lua_ls = { lua_ls = {
settings = { settings = {
@ -569,8 +557,7 @@ local servers = {
}, },
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }, filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
handlers = { handlers = {
-- Usually gets called after a code action -- Usually gets called after another code action
-- like in moving an anonymous function to outer scope
-- https://github.com/jose-elias-alvarez/typescript.nvim/issues/17 -- https://github.com/jose-elias-alvarez/typescript.nvim/issues/17
['_typescript.rename'] = function(_, result) ['_typescript.rename'] = function(_, result)
return result return result
@ -651,6 +638,4 @@ cmp.setup {
} }
-- npx @johnnymorganz/stylua-bin ./init.lua -- npx @johnnymorganz/stylua-bin ./init.lua
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et