Giter Club home page Giter Club logo

Comments (2)

junegunn avatar junegunn commented on June 3, 2024

this plugin currently has no way to declare the plugin configuration between plug#begin() and plug#end()

You can put plugin configuration anywhere in your Vim configuration file because most Vim plugins are configured via global variables (i.e. let g:something_something = ...). Here is an excerpt from my configuration. I'm using an extra indentation level to clarify the structure.

Plug 'tpope/vim-commentary'
  map  gc  <Plug>Commentary
  nmap gcc <Plug>CommentaryLine

Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' }
  let g:undotree_WindowLayout = 2
  nnoremap U :UndotreeToggle<CR>

Plug 'inkarkat/vim-ReplaceWithRegister'

Plug 'AndrewRadev/splitjoin.vim'
  let g:splitjoin_split_mapping = ''
  let g:splitjoin_join_mapping = ''
  nnoremap gss :SplitjoinSplit<cr>
  nnoremap gsj :SplitjoinJoin<cr>

Plug 'AndrewRadev/switch.vim'
  let g:switch_mapping = '-'
  let g:switch_custom_definitions = [
  \   ['MON', 'TUE', 'WED', 'THU', 'FRI']
  \ ]

Plug 'sgur/vim-editorconfig'

" Browsing
Plug 'Yggdroot/indentLine', { 'on': 'IndentLinesEnable' }
  autocmd! User indentLine doautocmd indentLine Syntax
  let g:indentLine_color_term = 239
  let g:indentLine_color_gui = '#616161'

But if your plugin is configured via an autoload function (i.e. call something#setup(...)), the function is not available before plug#end(). in that case you can circumvent the limitation using autoload VimEnter.

Plug 'junegunn/vim-after-object'
  autocmd VimEnter * silent! call after_object#enable('=', ':', '#', ' ', '|')

from vim-plug.

YuFei29 avatar YuFei29 commented on June 3, 2024

I tried your reply, it works.
I always thought that it is not possible to put statements between plug#begin() and plug#end().
Thank you!

from vim-plug.

Related Issues (20)

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.