Convert Figma logo to code with AI

Shougo logodein.vim

:zap: Dark powered Vim/Neovim plugin manager

3,414
197
3,414
2

Top Related Projects

33,891

:hibiscus: Minimalist Vim Plugin Manager

Vundle, the plug-in manager for Vim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config

13,952

💤 A modern plugin manager for Neovim

Quick Overview

Dein.vim is a powerful plugin manager for Vim and Neovim. It allows users to easily manage, install, and update plugins, providing a flexible and efficient way to customize their Vim environment. Dein.vim is designed to be fast and lightweight, with a focus on asynchronous operations.

Pros

  • Fast and lightweight, with minimal impact on Vim startup time
  • Supports lazy loading of plugins for improved performance
  • Offers flexible configuration options and plugin management
  • Compatible with both Vim and Neovim

Cons

  • Steeper learning curve compared to some other plugin managers
  • Configuration requires writing Vim script, which may be challenging for beginners
  • Documentation can be sparse or unclear in some areas

Getting Started

To get started with Dein.vim, follow these steps:

  1. Install Dein.vim:
curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
sh ./installer.sh ~/.cache/dein
  1. Add the following to your ~/.vimrc (Vim) or ~/.config/nvim/init.vim (Neovim):
if &compatible
  set nocompatible
endif

" Add the dein installation directory into runtimepath
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim

if dein#load_state('~/.cache/dein')
  call dein#begin('~/.cache/dein')

  call dein#add('~/.cache/dein/repos/github.com/Shougo/dein.vim')
  " Add your plugins here, for example:
  " call dein#add('Shougo/deoplete.nvim')

  call dein#end()
  call dein#save_state()
endif

filetype plugin indent on
syntax enable
  1. Launch Vim/Neovim and run :call dein#install() to install plugins.

Code Examples

  1. Adding a plugin:
call dein#add('tpope/vim-fugitive')

This line adds the vim-fugitive plugin to your configuration.

  1. Lazy loading a plugin:
call dein#add('scrooloose/nerdtree', {'on_cmd': 'NERDTreeToggle'})

This example lazy loads the NERDTree plugin, only loading it when the NERDTreeToggle command is executed.

  1. Configuring plugin options:
call dein#add('junegunn/fzf.vim', {'merged': 0})
call dein#add('junegunn/fzf', {
    \ 'build': './install --all',
    \ 'merged': 0
    \ })

This example adds the fzf.vim plugin and its dependency, fzf, with specific configuration options.

Competitor Comparisons

33,891

:hibiscus: Minimalist Vim Plugin Manager

Pros of vim-plug

  • Simpler configuration and usage, making it more beginner-friendly
  • Faster plugin installation and updates due to parallel downloads
  • Extensive documentation and active community support

Cons of vim-plug

  • Less flexible for advanced customization compared to dein.vim
  • Lacks some advanced features like lazy loading and on-demand loading

Code Comparison

vim-plug:

call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'junegunn/seoul256.vim'
call plug#end()

dein.vim:

call dein#begin('~/.cache/dein')
call dein#add('Shougo/dein.vim')
call dein#add('tpope/vim-sensible')
call dein#add('junegunn/seoul256.vim')
call dein#end()

Both vim-plug and dein.vim are popular plugin managers for Vim and Neovim. vim-plug is known for its simplicity and ease of use, making it a great choice for beginners and those who prefer a straightforward setup. It offers faster plugin installation due to parallel downloads and has extensive documentation.

On the other hand, dein.vim provides more advanced features and flexibility, making it suitable for users who require fine-grained control over their plugin management. It offers lazy loading and on-demand loading capabilities, which can lead to improved startup times and performance.

The code comparison shows that vim-plug has a slightly more concise syntax, while dein.vim requires an additional line to add the plugin manager itself. Both managers use similar patterns for adding plugins, making it relatively easy to switch between them if needed.

Vundle, the plug-in manager for Vim

Pros of Vundle.vim

  • Simpler configuration and easier to set up for beginners
  • Lightweight and doesn't require additional dependencies
  • Well-established with a large user base and community support

Cons of Vundle.vim

  • Slower plugin installation and updates compared to dein.vim
  • Lacks advanced features like lazy loading and on-demand loading
  • No built-in cache mechanism, which can impact performance

Code Comparison

Vundle.vim configuration:

set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Add plugins here
call vundle#end()
filetype plugin indent on

dein.vim configuration:

set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
if dein#load_state('~/.cache/dein')
  call dein#begin('~/.cache/dein')
  call dein#add('~/.cache/dein/repos/github.com/Shougo/dein.vim')
  " Add plugins here
  call dein#end()
  call dein#save_state()
endif
filetype plugin indent on
syntax enable

While Vundle.vim offers a simpler setup and is more beginner-friendly, dein.vim provides advanced features like lazy loading and better performance. The code comparison shows that dein.vim requires a slightly more complex configuration but offers more flexibility and optimization options.

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config

Pros of packer.nvim

  • Written in Lua, offering better performance and integration with Neovim
  • Supports lazy loading and conditional loading out of the box
  • Provides a more declarative configuration syntax

Cons of packer.nvim

  • Limited compatibility with Vim (primarily designed for Neovim)
  • Smaller ecosystem and community compared to dein.vim
  • Steeper learning curve for users not familiar with Lua

Code Comparison

dein.vim configuration:

call dein#add('Shougo/deoplete.nvim')
call dein#add('vim-airline/vim-airline')
call dein#add('tpope/vim-fugitive')

packer.nvim configuration:

use 'neovim/nvim-lspconfig'
use 'hrsh7th/nvim-cmp'
use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'}

Both dein.vim and packer.nvim are popular plugin managers for Vim/Neovim. dein.vim, written in Vimscript, offers broader compatibility with both Vim and Neovim. It has a larger user base and a more extensive ecosystem. packer.nvim, on the other hand, is tailored for Neovim and leverages Lua for improved performance and a more modern configuration approach. While packer.nvim provides built-in lazy loading and a cleaner syntax, it may be less accessible for users who prefer Vimscript or require Vim compatibility.

13,952

💤 A modern plugin manager for Neovim

Pros of lazy.nvim

  • Faster startup and loading times due to its lazy-loading approach
  • More modern and actively maintained, with frequent updates and improvements
  • Built-in profiling and debugging tools for easier plugin management

Cons of lazy.nvim

  • Newer project with potentially less stability compared to dein.vim
  • Steeper learning curve for users transitioning from traditional plugin managers
  • Limited compatibility with older Neovim versions

Code Comparison

lazy.nvim configuration:

require("lazy").setup({
  "folke/which-key.nvim",
  { "folke/neoconf.nvim", cmd = "Neoconf" },
  "folke/neodev.nvim",
})

dein.vim configuration:

call dein#add('Shougo/deoplete.nvim')
call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')

Both plugin managers offer efficient ways to manage Neovim plugins, but lazy.nvim focuses on lazy-loading and modern Lua-based configuration, while dein.vim provides a more traditional Vimscript approach. lazy.nvim is gaining popularity among Neovim users due to its performance benefits and active development, while dein.vim remains a reliable choice for those comfortable with Vimscript and seeking a well-established plugin manager.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Dein.vim

Gitter GitHub release (latest by date) GitHub issues

Dein.vim is a dark powered Vim/Neovim plugin manager.

Note: Active developement on dein.vim has stopped. The only future changes will be bug fixes.

Please see Dpp.vim

To learn more details, visit here.

Table of contents

Features

  • Fast - Faster than NeoBundle.
  • Simple - Function API and familiar patterns, without commands or dependency hell.
  • Async - Clean asynchronous installation supported.
  • Extendable - Supports plugins from local or remote sources, and also Non-Github plugins.
  • Consistent - Go-like directory structure (eg. github.com/{author}/{repository})
  • Practical - Automatically merge plugins directories to avoid long runtimepath

Getting started

Prerequisites

  • Vim (v8.2 or higher) or NeoVim (v0.8.0 or higher)
  • Git should be installed (v2.4.11 or higher)

Basic installation

You can install dein.vim by your vimrc/init.vim.

let $CACHE = expand('~/.cache')
if !($CACHE->isdirectory())
  call mkdir($CACHE, 'p')
endif
if &runtimepath !~# '/dein.vim'
  let s:dir = 'dein.vim'->fnamemodify(':p')
  if !(s:dir->isdirectory())
    let s:dir = $CACHE .. '/dein/repos/github.com/Shougo/dein.vim'
    if !(s:dir->isdirectory())
      execute '!git clone https://github.com/Shougo/dein.vim' s:dir
    endif
  endif
  execute 'set runtimepath^='
        \ .. s:dir->fnamemodify(':p')->substitute('[/\\]$', '', '')
endif

Command line installation

Please use dein-installer.vim.

Config example

Show a UNIX installation example using "~/.cache/dein" as the base path location.
" Ward off unexpected things that your distro might have made, as
" well as sanely reset options when re-sourcing .vimrc
set nocompatible

" Set dein base path (required)
let s:dein_base = '~/.cache/dein/'

" Set dein source path (required)
let s:dein_src = '~/.cache/dein/repos/github.com/Shougo/dein.vim'

" Set dein runtime path (required)
execute 'set runtimepath+=' .. s:dein_src

" Call dein initialization (required)
call dein#begin(s:dein_base)

call dein#add(s:dein_src)

" Your plugins go here:
"call dein#add('Shougo/neosnippet.vim')
"call dein#add('Shougo/neosnippet-snippets')

" Finish dein initialization (required)
call dein#end()

" Attempt to determine the type of a file based on its name and possibly its
" contents. Use this to allow intelligent auto-indenting for each filetype,
" and for plugins that are filetype specific.
filetype indent plugin on

" Enable syntax highlighting
if has('syntax')
  syntax on
endif

" Uncomment if you want to install not-installed plugins on startup.
"if dein#check_install()
" call dein#install()
"endif

Q&A

Dein has an user interface like vim-plug?

Feedback

Tasks

This is where Dein future plans or TODOS are listed:

  • Other types support (zip, svn, hg, ...)
  • Metadata repository support
  • Require neovim 0.10+ or Vim 9.0+(to use interpolated-string)

License

Licensed under the MIT license.