From 78aa03aef421436ddc5dcfd1a9321b8f491a2e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Fri, 5 Nov 2021 20:58:26 +0100 Subject: [PATCH] Speed up vim startup --- symlinks/config/nvim/init.lua | 6 ++++++ symlinks/config/nvim/lua/init/plugins.lua | 5 +++-- .../config/nvim/plugin/packer_compiled.lua | 20 ++++++++++++++----- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/symlinks/config/nvim/init.lua b/symlinks/config/nvim/init.lua index 873af79..f4ccb77 100644 --- a/symlinks/config/nvim/init.lua +++ b/symlinks/config/nvim/init.lua @@ -2,6 +2,12 @@ if require('init.first_load')() then return end +-- Allow `require('impatient')` to fail, in case plugins are not yet installed +_ = pcall(require, 'impatient') + +-- Speed up startup - quicker filetype.vim - should probably remove in future neovim versions +vim.g.did_load_filetypes = 1 + vim.cmd [[filetype plugin on]] vim.cmd [[filetype indent on]] vim.cmd [[syntax on]] diff --git a/symlinks/config/nvim/lua/init/plugins.lua b/symlinks/config/nvim/lua/init/plugins.lua index 41f6566..769f64f 100644 --- a/symlinks/config/nvim/lua/init/plugins.lua +++ b/symlinks/config/nvim/lua/init/plugins.lua @@ -22,7 +22,6 @@ return require('packer').startup { -- General improvements -- use 'airblade/vim-gitgutter' -- Git signs use 'godlygeek/tabular' -- Tabular command for alignment - -- use { 'Shougo/vimproc.vim', run = 'make' } -- Not really used use 'vim-scripts/utl.vim' -- Universal text linking use { -- 'mbbill/undotree', -- @@ -35,6 +34,8 @@ return require('packer').startup { use 'romainl/vim-qf' -- Quickfix list upgrades use 'romainl/vim-devdocs' -- Quick DevDocs.io search using :DD use 'gpanders/editorconfig.nvim' -- .editorconfig support + use 'nathom/filetype.nvim' -- Quicker filetype.nvim file + use 'lewis6991/impatient.nvim' -- Caching lua modules for faster startup -- Tools -- use 'direnv/direnv.vim' -- Integration with Direnv @@ -57,7 +58,6 @@ return require('packer').startup { end -- -- Language support -- - use 'sheerun/vim-polyglot' -- All popular languages use 'tpope/vim-rails' -- Enables all rails command through vim and integrates with projectionist use 'c-brenn/phoenix.vim' -- Similar to vim-rails, but for phoenix use 'tpope/vim-salve' -- Clojure integration with projectionist @@ -71,6 +71,7 @@ return require('packer').startup { use( -- Simpler keymaps for vim-sexp 'tpope/vim-sexp-mappings-for-regular-people' ) + use 'tridactyl/vim-tridactyl' -- Tridactyl config file support -- Treesitter -- use { -- diff --git a/symlinks/config/nvim/plugin/packer_compiled.lua b/symlinks/config/nvim/plugin/packer_compiled.lua index aecbbda..8bf0429 100644 --- a/symlinks/config/nvim/plugin/packer_compiled.lua +++ b/symlinks/config/nvim/plugin/packer_compiled.lua @@ -119,11 +119,21 @@ _G.packer_plugins = { path = "/home/ensar/.local/share/nvim/site/pack/packer/start/editorconfig.nvim", url = "https://github.com/gpanders/editorconfig.nvim" }, + ["filetype.nvim"] = { + loaded = true, + path = "/home/ensar/.local/share/nvim/site/pack/packer/start/filetype.nvim", + url = "https://github.com/nathom/filetype.nvim" + }, ["flutter-tools.nvim"] = { loaded = true, path = "/home/ensar/.local/share/nvim/site/pack/packer/start/flutter-tools.nvim", url = "https://github.com/akinsho/flutter-tools.nvim" }, + ["impatient.nvim"] = { + loaded = true, + path = "/home/ensar/.local/share/nvim/site/pack/packer/start/impatient.nvim", + url = "https://github.com/lewis6991/impatient.nvim" + }, ["lsp_extensions.nvim"] = { loaded = true, path = "/home/ensar/.local/share/nvim/site/pack/packer/start/lsp_extensions.nvim", @@ -332,11 +342,6 @@ _G.packer_plugins = { path = "/home/ensar/.local/share/nvim/site/pack/packer/start/vim-obsession", url = "https://github.com/tpope/vim-obsession" }, - ["vim-polyglot"] = { - loaded = true, - path = "/home/ensar/.local/share/nvim/site/pack/packer/start/vim-polyglot", - url = "https://github.com/sheerun/vim-polyglot" - }, ["vim-projectionist"] = { loaded = true, path = "/home/ensar/.local/share/nvim/site/pack/packer/start/vim-projectionist", @@ -407,6 +412,11 @@ _G.packer_plugins = { path = "/home/ensar/.local/share/nvim/site/pack/packer/start/vim-test", url = "https://github.com/vim-test/vim-test" }, + ["vim-tridactyl"] = { + loaded = true, + path = "/home/ensar/.local/share/nvim/site/pack/packer/start/vim-tridactyl", + url = "https://github.com/tridactyl/vim-tridactyl" + }, ["vim-unimpaired"] = { loaded = true, path = "/home/ensar/.local/share/nvim/site/pack/packer/start/vim-unimpaired",