Quellcode durchsuchen

Add Lua configuration example

Close #1258
Junegunn Choi vor 1 Jahr
Ursprung
Commit
e07c18608f
1 geänderte Dateien mit 47 neuen und 0 gelöschten Zeilen
  1. 47 0
      README.md

+ 47 - 0
README.md

@@ -145,6 +145,53 @@ call plug#end()
 
 Reload .vimrc and `:PlugInstall` to install plugins.
 
+#### Example (Lua configuration file for Neovim)
+
+In Neovim, you can write your configuration in a Lua script file named
+`init.lua`. The following code is the Lua script equivalent to the VimScript
+example above.
+
+```lua
+local vim = vim
+local Plug = vim.fn['plug#']
+
+vim.call('plug#begin')
+
+-- Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
+Plug('junegunn/vim-easy-align')
+
+-- Any valid git URL is allowed
+Plug('https://github.com/junegunn/vim-github-dashboard.git')
+
+-- Multiple Plug commands can be written in a single line using ; separators
+Plug('SirVer/ultisnips'); Plug('honza/vim-snippets')
+
+-- On-demand loading
+Plug('preservim/nerdtree', { ['on'] = 'NERDTreeToggle' })
+Plug('tpope/vim-fireplace', { ['for'] = 'clojure' })
+
+-- Using a non-default branch
+Plug('rdnetto/YCM-Generator', { ['branch'] = 'stable' })
+
+-- Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
+Plug('fatih/vim-go', { ['tag'] = '*' })
+
+-- Plugin options
+Plug('nsf/gocode', { ['tag'] = 'v.20150303', ['rtp'] = 'vim' })
+
+-- Plugin outside ~/.vim/plugged with post-update hook
+Plug('junegunn/fzf', { ['dir'] = '~/.fzf', ['do'] = './install --all' })
+
+-- Unmanaged plugin (manually installed and updated)
+Plug('~/my-prototype-plugin')
+
+vim.call('plug#end')
+```
+
+More examples can be found in:
+
+* https://gitlab.com/sultanahamer/dotfiles/-/blob/master/nvim/lua/plugins.lua?ref_type=heads
+
 ### Commands
 
 | Command                             | Description                                                        |