Giter VIP home page Giter VIP logo

vim-plug-config's Introduction

vim-plug-config

Manage the configs for each vim-plugged plugin in a separate file.

screenshot

Requirements

What it does

  • Automatically load configs for each plugin.
  • Help you manage the config files of the plugins.
  • Supports both Vim Script and Lua config files.

Installation

Plug 'ouuan/vim-plug-config'

You'd better add this as the first plugin in your plug list to prevent setting configs for other plugins after they are loaded.

Alternatively, you can load the configs on the VimEnter event:

let g:plug_config_autoload = 0
autocmd VimEnter * PlugConfigLoadAll

Commands

  • PlugConfigLoad <plug-name>: Load the config of <plug-name>.
  • PlugConfigLoadAll: Load the configs of all plugged plugins. By default, it is executed when vim-plug-config is loaded.
  • PlugConfigEdit <plug-name>: Edit the config of <plug-name>. e.g. :PlugConfigEdit 'vim-plug-config'
  • PlugConfigEditUnderCuror: Edit the plug under the cursor (if there's a Plug 'owner/repo' command in the current line). It does nothing if there's no plugged plugin under the cursor.
  • PlugConfigAll: Show all plugin configs in a single file. It is useful for looking for a certain setting or restore to a single-file config.
  • PlugConfigClean: Delete empty config files and the config files for unplugged plugins.

Configs

Note: These variables shouldn't be set in the plug-config file of vim-plug-config itself. i.e. you need to set them in your init.vim.

Keymaps

It's recommended to map a key to PlugConfigEditUnderCursor so that you can use it to jump to the config file on the Plug 'owner/repo' line.

nnoremap gp :PlugConfigEditUnderCursor<CR>

let g:plug_config_autoload

  • Default: 1
  • Whether to auto-load all configs at startup.

let g:plug_config_vim_dir

  • Default: stdpath("config") . "/plug-config" (e.g. ~/.config/nvim/plug-config)
  • Where the Vim Script config files are stored.

let g:plug_config_lua_dir

  • Default: stdpath("config") . "/plug-config" (e.g. ~/.config/nvim/plug-config)
  • Where the Lua config files are stored.

let g:plug_config_edit_command

  • Default: edit
  • The command used to edit the config file. e.g. edit, split, vsplit.

let g:plug_config_default_type

  • Default: smart
  • The language of the config files. There are four possible options:
    1. vim: always use Vim Script.
    2. lua: always use Lua.
    3. both: always use both of Vim Script and Lua.
    4. smart: use Lua if there's a lua directory in the plugin, otherwise use Vim Script.

let g:plug_config_all_header

  • Default: 'Configs for plug: {plug}'
  • The header comment of the config of each plugin shown in PlugConfigAll. {plug} will be replaced by the name of the plugin.

vim-plug-config's People

Contributors

imgbot[bot] avatar ouuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vim-plug-config's Issues

Vim help file

We need a help file that can be read inside Vim by :help vim-plug-config.

lua dofile takes ~4ms

Now it's very slow to load a Lua config file because lua dofile takes ~4ms. Maybe we need to rewrite this plugin in Lua.

Undefined variable: g:plug_config_lua_dir

I've setup the other g:plug_config_vim_dir variable, as i only have vimscript configuration. the plugin still raises a a long thread of this Undefined variable ... error messages. I guess this is a bug, as i guess only one configuration should suffice i.e. vimrc file in this case.
I'm hoping this plugin isn't confined to neovim (event though it's stated as neovim being a requirement, but i'll try my luck in here)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.