⚡️ (loading times): Optimize loading sequences
This commit is contained in:
parent
9087e563d8
commit
65baac297f
@ -16,8 +16,10 @@ map('', '<A-H>', '<C-w>H', {})
|
|||||||
map('', '<A-J>', '<C-w>J', {})
|
map('', '<A-J>', '<C-w>J', {})
|
||||||
map('', '<A-K>', '<C-w>K', {})
|
map('', '<A-K>', '<C-w>K', {})
|
||||||
map('', '<A-L>', '<C-w>L', {})
|
map('', '<A-L>', '<C-w>L', {})
|
||||||
map('', '<A->>', '<C-w>>', {})
|
map('', '<M-S-.>', '<C-w>>', {})
|
||||||
map('', '<A-<>', '<C-w><', {})
|
map('', '<M-S-,>', '<C-w><', {})
|
||||||
|
map('', '<M-S-=>', '<C-w>+', {})
|
||||||
|
map('', '<M-->', '<C-w>-', {})
|
||||||
map('', '<A-T>', '<C-w>T', {})
|
map('', '<A-T>', '<C-w>T', {})
|
||||||
|
|
||||||
-- undo to the last , . or !
|
-- undo to the last , . or !
|
||||||
@ -28,13 +30,11 @@ map('i', '?', '?<c-g>u', {noremap = true})
|
|||||||
|
|
||||||
-- plugin mappings
|
-- plugin mappings
|
||||||
-- gitsigns
|
-- gitsigns
|
||||||
map('', '<leader>gs', ':Gitsigns toggle_signs<cr>',
|
map('', '<leader>gs', ':Gitsigns toggle_signs<cr>', {silent = true})
|
||||||
{silent = true})
|
|
||||||
-- lsp stuff
|
-- lsp stuff
|
||||||
vim.api.nvim_buf_set_keymap(0, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>',
|
vim.api.nvim_buf_set_keymap(0, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>',
|
||||||
{noremap = true})
|
{noremap = true})
|
||||||
map('', '<leader>K',
|
map('', '<leader>K', '<cmd>lua vim.diagnostic.open_float()<CR>',
|
||||||
'<cmd>lua vim.diagnostic.open_float()<CR>',
|
|
||||||
{noremap = true})
|
{noremap = true})
|
||||||
map('', '<leader>qf',
|
map('', '<leader>qf',
|
||||||
'<cmd>lua vim.diagnostic.setqflist({open = false})<cr><cmd>Telescope quickfix<cr>',
|
'<cmd>lua vim.diagnostic.setqflist({open = false})<cr><cmd>Telescope quickfix<cr>',
|
||||||
@ -52,19 +52,17 @@ map('', '<leader>fm', ':Neoformat<cr>', {silent = true})
|
|||||||
-- toggle Hop
|
-- toggle Hop
|
||||||
map('', '<leader>b', ':HopWordBC<cr>', {silent = true})
|
map('', '<leader>b', ':HopWordBC<cr>', {silent = true})
|
||||||
map('', '<leader>w', ':HopWordAC<cr>', {silent = true})
|
map('', '<leader>w', ':HopWordAC<cr>', {silent = true})
|
||||||
map('', '<leader>l', ':HopWordCurrentLine<cr>',
|
map('', '<leader>l', ':HopWordCurrentLine<cr>', {silent = true})
|
||||||
{silent = true})
|
|
||||||
|
|
||||||
-- telescope stuff
|
-- telescope stuff
|
||||||
map('', '<leader>fd', ':Telescope fd<cr>', {silent = true})
|
map('', '<leader>fd', ':Telescope fd<cr>', {silent = true})
|
||||||
map('', '<leader>tb', ':Telescope buffers<cr>',
|
map('', '<leader>tb', ':Telescope buffers<cr>', {silent = true})
|
||||||
{silent = true})
|
|
||||||
|
|
||||||
-- Barbar controls
|
-- Barbar controls
|
||||||
local opts = {noremap = true, silent = true}
|
local opts = {noremap = true, silent = true}
|
||||||
-- Move to previous/next
|
-- Move to previous/next
|
||||||
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
|
map('n', 'gT', '<Cmd>BufferPrevious<CR>', opts)
|
||||||
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
|
map('n', 'gt', '<Cmd>BufferNext<CR>', opts)
|
||||||
-- Re-order to previous/next
|
-- Re-order to previous/next
|
||||||
map('n', '<A-P>', '<Cmd>BufferMovePrevious<CR>', opts)
|
map('n', '<A-P>', '<Cmd>BufferMovePrevious<CR>', opts)
|
||||||
map('n', '<A-N>', '<Cmd>BufferMoveNext<CR>', opts)
|
map('n', '<A-N>', '<Cmd>BufferMoveNext<CR>', opts)
|
||||||
|
@ -4,9 +4,9 @@ vim.cmd [[packadd packer.nvim]]
|
|||||||
require('packer').init {
|
require('packer').init {
|
||||||
display = {
|
display = {
|
||||||
open_fn = function()
|
open_fn = function()
|
||||||
return require("packer.util").float {border = "single"}
|
return require('packer.util').float {border = 'single'}
|
||||||
end,
|
end,
|
||||||
prompt_border = "single"
|
prompt_border = 'single'
|
||||||
},
|
},
|
||||||
git = {
|
git = {
|
||||||
clone_timeout = 600 -- Timeout, in seconds, for git clones
|
clone_timeout = 600 -- Timeout, in seconds, for git clones
|
||||||
@ -26,61 +26,63 @@ return require('packer').startup(function(use)
|
|||||||
vim.g.serenade_enable_italic = 1
|
vim.g.serenade_enable_italic = 1
|
||||||
vim.g.serenade_sign_column_background = 'none'
|
vim.g.serenade_sign_column_background = 'none'
|
||||||
vim.g.serenade_better_performance = 1
|
vim.g.serenade_better_performance = 1
|
||||||
vim.cmd("colorscheme serenade")
|
vim.cmd('colorscheme serenade')
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
use {'kyazdani42/nvim-web-devicons'}
|
use {'kyazdani42/nvim-web-devicons'}
|
||||||
use {
|
use {
|
||||||
'nvim-lualine/lualine.nvim',
|
'nvim-lualine/lualine.nvim',
|
||||||
after = {'serenade', 'nvim-web-devicons'},
|
after = {'serenade', 'nvim-web-devicons'},
|
||||||
config = function() require "plugins.statusline" end
|
config = function() require 'plugins.statusline' end
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'romgrk/barbar.nvim',
|
'romgrk/barbar.nvim',
|
||||||
requires = {'kyazdani42/nvim-web-devicons'},
|
requires = {'kyazdani42/nvim-web-devicons'},
|
||||||
event = 'BufAdd',
|
event = 'BufAdd',
|
||||||
after = {'nvim-web-devicons', 'serenade'},
|
after = {'nvim-web-devicons', 'serenade'},
|
||||||
config = function() require "plugins.barbar" end
|
config = function() require 'plugins.barbar' end
|
||||||
}
|
}
|
||||||
|
|
||||||
-- lsp stuff
|
-- lsp stuff
|
||||||
use {'neovim/nvim-lspconfig', event = "UIEnter"}
|
use {'neovim/nvim-lspconfig', event = 'UIEnter'}
|
||||||
use {
|
use {
|
||||||
'williamboman/nvim-lsp-installer',
|
'williamboman/nvim-lsp-installer',
|
||||||
config = function() require "plugins.lspinstall" end,
|
after = 'nvim-lspconfig',
|
||||||
after = 'nvim-lspconfig'
|
config = function() require 'plugins.lspinstall' end
|
||||||
}
|
}
|
||||||
|
use {'hrsh7th/cmp-nvim-lsp', after = 'nvim-lsp-installer'}
|
||||||
use {
|
use {
|
||||||
"ray-x/lsp_signature.nvim",
|
'ray-x/lsp_signature.nvim',
|
||||||
after = "nvim-lsp-installer",
|
after = 'nvim-lsp-installer',
|
||||||
config = function() require "plugins.lsp-signature" end
|
config = function() require 'plugins.lsp-signature' end
|
||||||
}
|
}
|
||||||
|
|
||||||
-- tree sitter
|
-- tree sitter
|
||||||
use {
|
use {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
event = "UIEnter",
|
event = 'UIEnter',
|
||||||
config = function() require "plugins.treesitter" end,
|
config = function() require 'plugins.treesitter' end,
|
||||||
run = ':TSUpdate'
|
run = ':TSUpdate'
|
||||||
}
|
}
|
||||||
|
|
||||||
-- completer
|
-- completer
|
||||||
use {'L3MON4D3/LuaSnip', event = "UIEnter"}
|
use {'L3MON4D3/LuaSnip', event = 'UIEnter'}
|
||||||
use {
|
use {
|
||||||
event = "InsertEnter",
|
'hrsh7th/nvim-cmp',
|
||||||
after = {'nvim-lsp-installer', 'nvim-treesitter', 'LuaSnip'},
|
event = 'InsertEnter',
|
||||||
"hrsh7th/nvim-cmp",
|
after = {'LuaSnip', 'cmp-nvim-lsp', 'nvim-treesitter'},
|
||||||
config = function() require "plugins.cmp" end,
|
config = function() require 'plugins.cmp' end,
|
||||||
requires = {
|
requires = {
|
||||||
-- local
|
-- local
|
||||||
{'hrsh7th/cmp-cmdline', after = 'nvim-cmp'},
|
{'hrsh7th/cmp-cmdline', after = 'nvim-cmp'},
|
||||||
{'hrsh7th/cmp-buffer', after = 'nvim-cmp'},
|
{'hrsh7th/cmp-buffer', after = 'nvim-cmp'},
|
||||||
{'hrsh7th/cmp-path', after = 'nvim-cmp'},
|
{'hrsh7th/cmp-path', after = 'nvim-cmp'}, {
|
||||||
{'petertriho/cmp-git', after = 'nvim-cmp'}, -- end
|
'petertriho/cmp-git',
|
||||||
|
after = 'nvim-cmp',
|
||||||
|
config = function() require("cmp_git").setup() end
|
||||||
|
}, {'delphinus/cmp-ctags', after = 'nvim-cmp'}, -- end
|
||||||
-- lsp
|
-- lsp
|
||||||
{'hrsh7th/cmp-nvim-lsp-document-symbol', after = 'nvim-cmp'},
|
{'hrsh7th/cmp-nvim-lsp-document-symbol', after = 'nvim-cmp'}, -- TS
|
||||||
{'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp'}, -- end
|
|
||||||
-- TS
|
|
||||||
{'ray-x/cmp-treesitter', after = 'nvim-cmp'}, -- end
|
{'ray-x/cmp-treesitter', after = 'nvim-cmp'}, -- end
|
||||||
-- Snip
|
-- Snip
|
||||||
{'saadparwaiz1/cmp_luasnip', after = {'nvim-cmp', 'LuaSnip'}}
|
{'saadparwaiz1/cmp_luasnip', after = {'nvim-cmp', 'LuaSnip'}}
|
||||||
@ -89,21 +91,21 @@ return require('packer').startup(function(use)
|
|||||||
|
|
||||||
-- formating and editing
|
-- formating and editing
|
||||||
use {
|
use {
|
||||||
"windwp/nvim-autopairs",
|
'windwp/nvim-autopairs',
|
||||||
after = 'nvim-cmp',
|
after = 'nvim-cmp',
|
||||||
config = function() require("plugins.nvim-autopairs") end
|
config = function() require('plugins.nvim-autopairs') end
|
||||||
}
|
}
|
||||||
use {"sbdchd/neoformat", cmd = "Neoformat"}
|
use {'sbdchd/neoformat', cmd = 'Neoformat'}
|
||||||
use {
|
use {
|
||||||
"mattn/emmet-vim",
|
'mattn/emmet-vim',
|
||||||
ft = {'html', 'htmldjango', 'css', 'markdown'},
|
ft = {'html', 'htmldjango', 'css', 'markdown'},
|
||||||
setup = function() require "plugins.emmet" end
|
setup = function() require 'plugins.emmet' end
|
||||||
}
|
}
|
||||||
use {"machakann/vim-sandwich", event = "UIEnter"}
|
use {'machakann/vim-sandwich', event = 'UIEnter'}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
'numToStr/Comment.nvim',
|
'numToStr/Comment.nvim',
|
||||||
event = "UIEnter",
|
event = 'UIEnter',
|
||||||
config = function() require('Comment').setup() end
|
config = function() require('Comment').setup() end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,12 +114,12 @@ return require('packer').startup(function(use)
|
|||||||
'kyazdani42/nvim-tree.lua',
|
'kyazdani42/nvim-tree.lua',
|
||||||
cmd = 'NvimTreeToggle',
|
cmd = 'NvimTreeToggle',
|
||||||
requires = 'kyazdani42/nvim-web-devicons',
|
requires = 'kyazdani42/nvim-web-devicons',
|
||||||
config = function() require("plugins.nvim-tree") end
|
config = function() require('plugins.nvim-tree') end
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'andymass/vim-matchup',
|
'andymass/vim-matchup',
|
||||||
after = 'nvim-treesitter',
|
after = 'nvim-treesitter',
|
||||||
config = function() require "plugins.matchup" end
|
config = function() require 'plugins.matchup' end
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'abecodes/tabout.nvim',
|
'abecodes/tabout.nvim',
|
||||||
@ -126,14 +128,14 @@ return require('packer').startup(function(use)
|
|||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
requires = {{'nvim-lua/plenary.nvim'}},
|
event = 'UIEnter',
|
||||||
config = function() require "plugins.telescope" end,
|
requires = {'nvim-lua/plenary.nvim'},
|
||||||
event = "UIEnter"
|
config = function() require 'plugins.telescope' end
|
||||||
}
|
}
|
||||||
use {'preservim/tagbar', cmd = 'TagbarToggle'}
|
use {'preservim/tagbar', cmd = 'TagbarToggle'}
|
||||||
use {
|
use {
|
||||||
'phaazon/hop.nvim',
|
'phaazon/hop.nvim',
|
||||||
event = "UIEnter",
|
event = 'UIEnter',
|
||||||
as = 'hop',
|
as = 'hop',
|
||||||
config = function()
|
config = function()
|
||||||
require'hop'.setup {keys = 'etovxqpdygfblzhckisuran'}
|
require'hop'.setup {keys = 'etovxqpdygfblzhckisuran'}
|
||||||
@ -142,23 +144,24 @@ return require('packer').startup(function(use)
|
|||||||
|
|
||||||
-- eye-candy
|
-- eye-candy
|
||||||
use {
|
use {
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
after = {"nvim-treesitter"},
|
after = {'nvim-treesitter'},
|
||||||
config = function() require "plugins.indent-blankline" end
|
config = function() require 'plugins.indent-blankline' end
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
|
event = 'UIEnter',
|
||||||
requires = {'nvim-lua/plenary.nvim'},
|
requires = {'nvim-lua/plenary.nvim'},
|
||||||
config = function() require "plugins.gitsigns" end
|
config = function() require 'plugins.gitsigns' end
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'p00f/nvim-ts-rainbow',
|
'p00f/nvim-ts-rainbow',
|
||||||
after = "nvim-treesitter",
|
after = 'nvim-treesitter',
|
||||||
config = function() require "plugins.nvim-ts-rainbow" end
|
config = function() require 'plugins.nvim-ts-rainbow' end
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'nvim-treesitter/nvim-treesitter-context',
|
'nvim-treesitter/nvim-treesitter-context',
|
||||||
after = "nvim-treesitter",
|
after = 'nvim-treesitter',
|
||||||
config = function()
|
config = function()
|
||||||
require'treesitter-context'.setup {
|
require'treesitter-context'.setup {
|
||||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||||
@ -178,27 +181,28 @@ return require('packer').startup(function(use)
|
|||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'winston0410/range-highlight.nvim',
|
'winston0410/range-highlight.nvim',
|
||||||
event = "CmdlineEnter",
|
event = 'CmdlineEnter',
|
||||||
config = function() require("range-highlight").setup {} end,
|
config = function() require('range-highlight').setup {} end,
|
||||||
requires = 'winston0410/cmd-parser.nvim'
|
requires = 'winston0410/cmd-parser.nvim'
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'norcalli/nvim-colorizer.lua',
|
'norcalli/nvim-colorizer.lua',
|
||||||
event = "BufEnter",
|
event = 'BufEnter',
|
||||||
config = function() require "plugins.nvim-colorizer" end
|
config = function() require 'plugins.nvim-colorizer' end
|
||||||
}
|
}
|
||||||
|
|
||||||
-- integrations
|
-- integrations
|
||||||
use {"tpope/vim-fugitive", cmd = "G"}
|
use {'tpope/vim-fugitive', cmd = 'G'}
|
||||||
use {
|
use {
|
||||||
"mickael-menu/zk-nvim",
|
'mickael-menu/zk-nvim',
|
||||||
requires = {"nvim-telescope/telescope.nvim"},
|
requires = {'nvim-telescope/telescope.nvim'},
|
||||||
after = {"telescope.nvim"},
|
event = 'UIEnter',
|
||||||
|
after = {'telescope.nvim'},
|
||||||
ft = {'markdown'},
|
ft = {'markdown'},
|
||||||
config = function() require "plugins.zk" end
|
config = function() require 'plugins.zk' end
|
||||||
}
|
}
|
||||||
|
|
||||||
-- fixes and misc. stuff
|
-- fixes and misc. stuff
|
||||||
use {"antoinemadec/FixCursorHold.nvim", event = "UIEnter"}
|
use {'antoinemadec/FixCursorHold.nvim', event = 'UIEnter'}
|
||||||
end)
|
end)
|
||||||
-- vim:set shiftwidth=4 tabstop=4:
|
-- vim:set shiftwidth=4 tabstop=4:
|
||||||
|
@ -29,8 +29,8 @@ require'bufferline'.setup {
|
|||||||
icon_custom_colors = true,
|
icon_custom_colors = true,
|
||||||
|
|
||||||
-- Configure icons on the bufferline.
|
-- Configure icons on the bufferline.
|
||||||
icon_separator_active = '▎',
|
icon_separator_active = '│',
|
||||||
icon_separator_inactive = '▎',
|
icon_separator_inactive = '|',
|
||||||
icon_close_tab = '',
|
icon_close_tab = '',
|
||||||
icon_close_tab_modified = '●',
|
icon_close_tab_modified = '●',
|
||||||
icon_pinned = '車',
|
icon_pinned = '車',
|
||||||
@ -61,31 +61,3 @@ require'bufferline'.setup {
|
|||||||
-- where X is the buffer number. But only a static string is accepted here.
|
-- where X is the buffer number. But only a static string is accepted here.
|
||||||
no_name_title = nil
|
no_name_title = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
-- nvim-tree integration
|
|
||||||
local nvim_tree_events = require('nvim-tree.events')
|
|
||||||
local bufferline_state = require('bufferline.state')
|
|
||||||
|
|
||||||
-- track the window id of nvim-tree
|
|
||||||
local id
|
|
||||||
|
|
||||||
local function get_tree_size() return vim.api.nvim_win_get_width(id) end
|
|
||||||
|
|
||||||
nvim_tree_events.on_tree_open(function()
|
|
||||||
id = vim.api.nvim_eval('win_getid()')
|
|
||||||
bufferline_state.set_offset(get_tree_size())
|
|
||||||
end)
|
|
||||||
|
|
||||||
nvim_tree_events.on_tree_resize(function()
|
|
||||||
if id ~= nil then
|
|
||||||
if vim.api.nvim_eval('win_gettype(' .. id .. ')') ~= 'unknown' then
|
|
||||||
bufferline_state.set_offset(get_tree_size())
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
nvim_tree_events.on_tree_close(function()
|
|
||||||
id = nil
|
|
||||||
bufferline_state.set_offset(0)
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
@ -49,9 +49,9 @@ cmp.setup({
|
|||||||
end
|
end
|
||||||
end, {"i", "s"})
|
end, {"i", "s"})
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({{name = 'nvim_lsp'}}, {{name = 'treesitter'}},
|
||||||
{name = 'nvim_lsp'}, {name = 'treesitter'}, {name = 'luasnip'} -- For luasnip users.
|
{{name = 'luasnip'}},
|
||||||
}, {{name = 'buffer'}, {name = 'path'}})
|
{{name = 'buffer'}, {name = 'path'}})
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||||
@ -68,12 +68,6 @@ cmp.setup.cmdline(':', {
|
|||||||
|
|
||||||
-- Set configuration for specific filetype.
|
-- Set configuration for specific filetype.
|
||||||
cmp.setup.filetype('gitcommit', {
|
cmp.setup.filetype('gitcommit', {
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({{name = 'git'}},
|
||||||
{name = 'cmp_git'} -- You can specify the `cmp_git` source if you were installed it.
|
{{name = 'buffer'}})
|
||||||
}, {{name = 'buffer'}})
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Set config for neovim config file
|
|
||||||
cmp.setup.filetype('lua', {
|
|
||||||
sources = cmp.config.sources({{name = 'plugins'}}, {{name = 'buffer'}})
|
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user