Comments (9)
I'm sorry, but I'll need more information if I'm to help. First off, from the startup trace you've provided, it's not clear that packer
is responsible for the slow speed of loading init.vim
- you source a lot of modules in core.lua
, and your parse_config
function is also doing nontrivial synchronous operations, which could easily be slowing you down.
Specifically to packer
, I'll point out that you don't need to load packer
at all/call use
unless you want to do plugin management operations. That is, if you want to install, update, clean, or sync, you need packer
loaded and your plugin specifications added with use
. Otherwise, you do not.
If you can provide more detailed timing information/explain why you think the slow speed is packer
's fault, I'd be happy to help. Otherwise, there's not much I can do - my entire config, using packer
and some ~65 plugins, loads in ~40-50ms.
from packer.nvim.
Thank you for your reply. Check out my master branch. The only difference between it and the packer branch is that the plugin management uses packer. The other modules are basically the same. Using lua to configure neovim can not view the startup time of the script through startuptime, so it is difficult to see anything from the startuptime command. This is the startup speed of my master branch.
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.008 000.008: --- NVIM STARTING ---
000.901 000.893: locale set
001.488 000.587: inits 1
001.512 000.024: window checked
001.516 000.003: parsing arguments
001.720 000.204: expanding arguments
001.787 000.067: inits 2
002.503 000.716: init highlight
002.505 000.001: waiting for UI
006.289 003.784: done waiting for UI
006.325 000.036: initialized screen early for UI
010.593 000.356 000.356: sourcing /Users/stephen/.cache/vim/dein/repos/github.com/Shougo/dein.vim/autoload/dein.vim
013.531 000.046 000.046: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/ftoff.vim
014.111 003.152 003.106: sourcing /Users/stephen/.cache/vim/dein/state_nvim.vim
024.530 000.231 000.231: sourcing /Users/stephen/.cache/vim/dein/.cache/init.vim/.dein/ftdetect/ftdetect.vim
024.818 010.543 010.312: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/filetype.vim
025.070 000.063 000.063: sourcing /Users/stephen/.cache/vim/dein/.cache/init.vim/.dein/ftplugin.vim
025.179 000.023 000.023: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/ftplugin.vim
025.411 000.064 000.064: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/indent.vim
026.239 000.350 000.350: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/syntax/syncolor.vim
026.475 000.745 000.395: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/syntax/synload.vim
026.524 000.961 000.217: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/syntax/syntax.vim
026.930 000.257 000.257: sourcing /Users/stephen/.cache/vim/dein/repos/github.com/Shougo/dein.vim/autoload/dein/autoload.vim
027.740 000.629 000.629: sourcing /Users/stephen/.cache/vim/dein/repos/github.com/Shougo/dein.vim/autoload/dein/util.vim
030.999 000.237 000.237: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/syntax/syncolor.vim
031.863 000.229 000.229: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/syntax/syncolor.vim
033.063 000.233 000.233: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/syntax/syncolor.vim
034.675 027.951 011.204: sourcing /Users/stephen/.config/nvim/init.vim
034.685 000.410: sourcing vimrc file(s)
035.445 000.096 000.096: sourcing /Users/stephen/.config/nvim/plugin/bufkill.vim
035.610 000.106 000.106: sourcing /Users/stephen/.config/nvim/plugin/cursorhold_nvim.vim
035.787 000.114 000.114: sourcing /Users/stephen/.config/nvim/plugin/difftools.vim
036.005 000.160 000.160: sourcing /Users/stephen/.config/nvim/plugin/hlsearch.vim
036.278 000.210 000.210: sourcing /Users/stephen/.config/nvim/plugin/whitespace.vim
037.062 000.245 000.245: sourcing /Users/stephen/.cache/vim/dein/.cache/init.vim/.dein/plugin/dadbod.vim
037.458 000.318 000.318: sourcing /Users/stephen/.cache/vim/dein/.cache/init.vim/.dein/plugin/dashboard.vim
040.843 003.316 003.316: sourcing /Users/stephen/.cache/vim/dein/.cache/init.vim/.dein/plugin/webdevicons.vim
041.990 000.036 000.036: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/gzip.vim
042.099 000.027 000.027: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/health.vim
042.276 000.102 000.102: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/man.vim
043.483 000.042 000.042: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
043.570 001.202 001.160: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/matchit.vim
043.661 000.027 000.027: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/matchparen.vim
043.755 000.031 000.031: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/netrwPlugin.vim
044.801 000.602 000.602: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/autoload/remote/host.vim
045.722 000.390 000.390: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/autoload/remote/define.vim
046.133 002.083 001.090: sourcing /Users/stephen/.local/share/nvim/rplugin.vim
046.144 002.326 000.243: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/rplugin.vim
046.384 000.163 000.163: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/shada.vim
046.544 000.045 000.045: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/spellfile.vim
046.653 000.031 000.031: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/tarPlugin.vim
046.749 000.026 000.026: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/tohtml.vim
046.862 000.034 000.034: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/tutor.vim
046.960 000.033 000.033: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/plugin/zipPlugin.vim
047.052 003.719: loading plugins
047.263 000.210: loading packages
047.448 000.185: loading after plugins
047.462 000.014: inits 3
050.861 003.398: reading ShaDa
052.478 001.617: opening buffers
052.534 000.056: BufEnter autocommands
052.537 000.003: editing files in windows
053.472 000.269 000.269: sourcing /Users/stephen/.cache/vim/dein/.cache/init.vim/.dein/autoload/dashboard.vim
053.785 000.039 000.039: sourcing /Users/stephen/.cache/vim/dein/.cache/init.vim/.dein/autoload/dashboard/utils.vim
057.979 003.619 003.619: sourcing /Users/stephen/.cache/vim/dein/.cache/init.vim/.dein/autoload/dashboard/header.vim
059.149 000.162 000.162: sourcing /Users/stephen/.cache/vim/dein/.cache/init.vim/.dein/autoload/dashboard/section.vim
060.647 000.324 000.324: sourcing /usr/local/Cellar/neovim/HEAD-753a86c/share/nvim/runtime/autoload/provider/clipboard.vim
063.129 000.117 000.117: sourcing /Users/stephen/.cache/vim/dein/.cache/init.vim/.dein/syntax/dashboard.vim
063.808 006.743: VimEnter autocommands
063.811 000.003: UIEnter autocommands
063.815 000.003: before starting main loop
065.867 002.053: first screen update
065.881 000.013: --- NVIM STARTED ---
from packer.nvim.
@wbthomason got a new error
from packer.nvim.
In dein I can use on_map
to bind the keymap like n = <Plug>
, but in packer keys just support {mode,map}
or key map string like - { repo: rhysd/accelerated-jk, on_map: { n: <Plug> } }
, bind j and k for this plugin. when i use j or k load this plugin. In packer {'rhysd/accelerated-jk', keys = 'j'}
or keys = {{'n','j'},{'n','k'}}
It's too troublesome..
from packer.nvim.
The only difference between it and the packer branch is that the plugin management uses packer. The other modules are basically the same.
I will note that your parse_config
function is different in both as well, and the python you (may?) execute in the packer
branch is likely slower than the find
command you use in master
.
Using lua to configure neovim can not view the startup time of the script through startuptime, so it is difficult to see anything from the startuptime command.
Yes, this is an unfortunate shortcoming of startuptime
. If you would like to do more fine-grained profiling, I suggest using the reltime()
function, built-in to Neovim. Using this, for example, I can see that requiring packer
and calling packer.init()
and packer.reset()
takes ~7ms on my machine.
@wbthomason got a new error
The only time this error happens (that I'm aware of) is when there's an issue with your config, e.g. #59 (there, there was an autocommand that was triggering and setting the update buffer to nonmodifiable
when packer
was trying to write to it).
In dein I can use on_map to bind the keymap like n = , but in packer keys just support {mode,map} or key map string like - { repo: rhysd/accelerated-jk, on_map: { n: } } , bind j and k for this plugin. when i use j or k load this plugin. In packer {'rhysd/accelerated-jk', keys = 'j'} or keys = {{'n','j'},{'n','k'}}
PRs are always welcome! I would definitely merge something adding dein
's keymap shortcuts.
It's too troublesome..
I'm sorry you find packer
difficult to use. You're welcome to use (or not use) whatever plugin manager you would like, and PRs to improve packer
are always welcome.
from packer.nvim.
from packer.nvim.
bug of keys keyword. j
doesn't work..
{rhysd/accelerated-jk,keys={'n','j'}`
nmap <silent> j <Plug>(accelerated_jk_gj)
nmap <silent> k <Plug>(accelerated_jk_gk)
To be honest, packer is a good direction, but there are many missing features and some problems. I have done a lot of work to make packer suitable for me, but I failed.. If I have time, maybe I will improve packer, but my currently job is to fix neovim-lsp bugs and implement new functions to nvim-lua/lsp_extension, so I don’t have much time to check packer. Here is what I have done to packer may be helpful to you here, you may refer to dein about keys https://github.com/Shougo/dein.vim/blob/master/autoload/dein/parse.vim#L313
best wishes
from packer.nvim.
I'll note that your keys example is not a bug, but is just the dein
feature you mention being absent.
I'm sorry packer
didn't work out for you this time. Please feel free to file issues requesting features you'd like to see added.
from packer.nvim.
Okay, maybe I don’t understand the meaning of keys. My understanding is that the plugin will only be loaded when the key is triggered. It’s strange. When I do this, my j
can’t work properly. Check verbose nmap j
I got no mapping:) In addition, the packer also lacks some functions, but I think I can hack, but I still don’t understand how some packages are loaded. For example, if I install the plugin like this, defx-git and defx-icon did not work..I spent too much time in packer... so I am going to do other things.. But when I have time ,I will retry packer.
{'Shougo/defx.nvim',
cmd = 'Defx',
setup = function()
vim.api.nvim_command('autocmd FileType defx setlocal nonumber | setlocal norelativenumber')
end,
requires = {{'kristijanhusak/defx-icons',opt = true},{'kristijanhusak/defx-git',opt = true }},
config = function()
vim.g.defx_icons_column_length = 1
vim.g.defx_icons_mark_icon = ''
vim.g.defx_icons_parent_icon = ""
vim.fn['defx#custom#option']('_', {
resume = 1,
winwidth = 30,
split = 'vertical',
direction = 'topleft',
show_ignored_files = 0,
columns =' mark:indent:git:icons:filename',
root_marker = '[in]: ',
})
vim.fn['defx#custom#column']('git', {
indicators = {
Modified = '•',
Staged = '✚',
Untracked = 'ᵁ',
Renamed = '≫',
Unmerged = '≠',
Ignored = 'ⁱ',
Deleted = '✖',
Unknown = '⁇'}
})
vim.fn['defx#custom#column']('mark', { readonly_icon= '', selected_icon = '' })
vim.api.nvim_command([[
" Events
" ---
augroup user_plugin_defx
autocmd!
" Define defx window mappings
autocmd FileType defx call <SID>defx_mappings()
" Delete defx if it's the only buffer left in the window
autocmd WinEnter * if &filetype == 'defx' && winnr('$') == 1 | bdel | endif
" Move focus to the next window if current buffer is defx
autocmd TabLeave * if &filetype == 'defx' | wincmd w | endif
augroup END
" Internal functions
" ---
function! s:jump_dirty(dir) abort
" Jump to the next position with defx-git dirty symbols
let l:icons = get(g:, 'defx_git_indicators', {})
let l:icons_pattern = join(values(l:icons), '\|')
if ! empty(l:icons_pattern)
let l:direction = a:dir > 0 ? 'w' : 'bw'
return search(printf('\(%s\)', l:icons_pattern), l:direction)
endif
endfunction
function! s:defx_toggle_tree() abort
" Open current file, or toggle directory expand/collapse
if defx#is_directory()
return defx#do_action('open_or_close_tree')
endif
return defx#do_action('multi', ['drop'])
endfunction
function! s:defx_mappings() abort
" Defx window keyboard mappings
setlocal signcolumn=no expandtab
nnoremap <silent><buffer><expr> <CR> defx#do_action('drop')
nnoremap <silent><buffer><expr> l <sid>defx_toggle_tree()
nnoremap <silent><buffer><expr> h defx#async_action('cd', ['..'])
nnoremap <silent><buffer><expr> st defx#do_action('multi', [['drop', 'tabnew'], 'quit'])
nnoremap <silent><buffer><expr> s defx#do_action('open', 'botright vsplit')
nnoremap <silent><buffer><expr> i defx#do_action('open', 'botright split')
nnoremap <silent><buffer><expr> P defx#do_action('preview')
nnoremap <silent><buffer><expr> K defx#do_action('new_directory')
nnoremap <silent><buffer><expr> N defx#do_action('new_multiple_files')
nnoremap <silent><buffer><expr> dd defx#do_action('remove_trash')
nnoremap <silent><buffer><expr> r defx#do_action('rename')
nnoremap <silent><buffer><expr> x defx#do_action('execute_system')
nnoremap <silent><buffer><expr> . defx#do_action('toggle_ignored_files')
nnoremap <silent><buffer><expr> yy defx#do_action('yank_path')
nnoremap <silent><buffer><expr> ~ defx#async_action('cd')
nnoremap <silent><buffer><expr> q defx#do_action('quit')
nnoremap <silent><buffer><expr> <Tab> winnr('$') != 1 ?
\ ':<C-u>wincmd w<CR>' :
\ ':<C-u>Defx -buffer-name=temp -split=vertical<CR>'
" Defx's buffer management
nnoremap <silent><buffer><expr> q defx#do_action('quit')
nnoremap <silent><buffer><expr> se defx#do_action('save_session')
nnoremap <silent><buffer><expr> <C-r> defx#do_action('redraw')
nnoremap <silent><buffer><expr> <C-g> defx#do_action('print')
" File/dir management
nnoremap <silent><buffer><expr><nowait> c defx#do_action('copy')
nnoremap <silent><buffer><expr><nowait> m defx#do_action('move')
nnoremap <silent><buffer><expr><nowait> p defx#do_action('paste')
nnoremap <silent><buffer><expr><nowait> r defx#do_action('rename')
nnoremap <silent><buffer><expr> dd defx#do_action('remove_trash')
nnoremap <silent><buffer><expr> K defx#do_action('new_directory')
nnoremap <silent><buffer><expr> N defx#do_action('new_multiple_files')
" Jump
nnoremap <silent><buffer> [g :<C-u>call <SID>jump_dirty(-1)<CR>
nnoremap <silent><buffer> ]g :<C-u>call <SID>jump_dirty(1)<CR>
" Change directory
nnoremap <silent><buffer><expr><nowait> \ defx#do_action('cd', getcwd())
nnoremap <silent><buffer><expr><nowait> & defx#do_action('cd', getcwd())
nnoremap <silent><buffer><expr> <BS> defx#async_action('cd', ['..'])
nnoremap <silent><buffer><expr> ~ defx#async_action('cd')
nnoremap <silent><buffer><expr> u defx#do_action('cd', ['..'])
nnoremap <silent><buffer><expr> 2u defx#do_action('cd', ['../..'])
nnoremap <silent><buffer><expr> 3u defx#do_action('cd', ['../../..'])
nnoremap <silent><buffer><expr> 4u defx#do_action('cd', ['../../../..'])
" Selection
nnoremap <silent><buffer><expr> * defx#do_action('toggle_select_all')
nnoremap <silent><buffer><expr><nowait> <Space>
\ defx#do_action('toggle_select') . 'j'
nnoremap <silent><buffer><expr> S defx#do_action('toggle_sort', 'Time')
nnoremap <silent><buffer><expr> C
\ defx#do_action('toggle_columns', 'indent:mark:filename:type:size:time')
endfunction
]])
end
}
from packer.nvim.
Related Issues (20)
- Cannot retry in PackerSync
- Lazy loading suddenly not working on new machine with same config
- Way to run a lua function after all packages are loaded HOT 1
- a strange return in the bootstrapping example? HOT 1
- Running :PackerSync with vimtex causes neovim to crash HOT 1
- Proper step-by-step installation tutorial for initial Packer installation and configuration, with proper and full dependencies
- packer Failed to update preservim/nerdtree HOT 1
- Windows - Errors when setting up, please help HOT 1
- Disabling a plugin also disables all of its dependencies, even if an enabled plugin has the same dependency
- Make quick start documentation correct/usable
- LuaJIT is required for Luarocks functionality HOT 2
- PackerSync fails to clone repository - x11-ssh-askpass doesn't work either HOT 2
- packer.nvim: Error running config for dracula.nvim: [string "..."]:0: attempt to call a nil value HOT 1
- Packer wants to delete itself HOT 2
- packer.nvim/lua/packer.lua:110: module 'packer.luarocks' not found:
- Symlink Git repository at Vim package path
- Failed to install hererocks HOT 2
- installation from full URL fails on windows
- Fresh Install Of Neovim and Packer: Not Able to PackerSync
- error parsing script expected (to close '(' at line 2) near while
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packer.nvim.