Code Monkey home page Code Monkey logo

thinpl's Introduction

thinpl plugin manager for Vim 8

thinpl is a simple and thin plugin manager for Vim 8

Required

  • Vim 8
    • +packages
    • +job

Installation

mkdir -p ~/.vim/pack/thinpl/start
git clone https://github.com/tokorom/thinpl ~/.vim/pack/thinpl/start/thinpl
vim ~/.vim/plugins.vim
# and edit plugins.vim

Simple usage

  • ~/.vim/plugins.vim
" add a plugin to ~/.vim/pack/thinpl/opt and packadd
" 常に使うpluginならaddするだけ
call thinpl#add('w0ng/vim-hybrid')

" call this at the end!
" pluginを追加し終わったら最後にこれを呼ぶ
call thinpl#setup_plugins()

Many options

  • ~/.vim/plugins.vim
" Use a local plugin
" リモートからcloneせずにローカルのものも使えます
let plugin = thinpl#add('swift_vim')
let plugin.repository = ''
let plugin.local_location = '~/repos/apple/swift/utils/vim'

" This plugin loads when becomes specific filetypes
" 特定のfiletypeのときだけpluginを読み込むこともできます
let plugin = thinpl#add('swift-dict.vim')
let plugin.filetype = ['swift']

" This plugin loads specific autocmds as a trigger
" autocmdをトリガーにpluginを読み込むこともできます
let plugin = thinpl#add('kana/vim-smartinput')
let plugin.autocmd = ["InsertEnter"]

" This plugin loads specific commands as a trigger
" 特定のcommandを実行しようとしたときに読み込むこともできます
let plugin = thinpl#add('sjl/gundo.vim')
let plugin.command = ['Gundo*']

" This plugin loads specific functions as a trigger"
" 特定のfunctionを呼ぼうとしたときに読み込ませることもできます
let plugin = thinpl#add('tokorom/foo')
let plugin.function = ['foo#*']

" Use prepare function
" prepare()を定義するとVim起動時にこれが呼ばれます
let plugin = thinpl#add('tokorom/bar')
function! plugin.prepare() abort
  let g:bar#base_dir = '~/bar'
endfunction

" Use will_load function
" will_load()を定義するとpluginが読み込まれる前に呼ばれます
let plugin = thinpl#add('ale')
function! plugin.will_load() abort
  let g:ale_lint_on_save = 1
  let g:ale_lint_on_text_changed = 0
endfunction

" Use did_load function
" did_load()を定義するとpluginが読み込まれた後に呼ばれます
let plugin = thinpl#add('airblade/vim-gitgutter')
let plugin.autocmd = ['BufWrite']
function! plugin.did_load() abort
  call gitgutter#all(1)
endfunction

Sample plugins.vim

Override plugin options

Change plugins.vim

" this is default value
let g:thinpl#plugins_file = '~/.vim/plugins.vim'

Change git clone location

" this is default value
let g:thinpl#git_clone_location = '~/thinpl/repos'

Change pack location

" this is default value
let g:thinpl#packname = 'thinpl'
" ~/.vim/pack/thinpl/opt

Limitations

  • Do not support Windows
  • Do not support Vim 7 or less

thinpl's People

Contributors

tokorom avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.