notes

Personal notes
git clone git://git.laack.co/notes.git
Log | Files | Refs

nvim.md (1376B)


      1 # nvim (neovim)
      2 
      3 **Source:** [https://github.com/neovim/neovim/](https://github.com/neovim/neovim/)
      4 
      5 **Definition:** Neovim is a modal text editor based on vim, but extended to have a Lua plugin system, and other useful features. 
      6 
      7 ## Plugins
      8 
      9 ### Structure
     10 
     11 #### Basic Directory Structure
     12 
     13 ```
     14 │ flashcards.nvim
     15 ├── lua
     16 │   └── flashcards
     17 │       └── init.lua
     18 │       └── other.lua
     19 └── plugin
     20     └── init.lua
     21 ```
     22 
     23 plugin/init.lua, and any other .lua files in the plugin directory, will be executed on startup if the plugin directory is added to the runtimepath.
     24 
     25 To execute anything in the lua/ directory it must be called using a "require()" statement. In the case of the flashcard plugin, assuming the plugin is on the runtimepath, we can run:
     26 
     27 `lua require"flashcards"`
     28 
     29 The `init.lua` filename is special as it is implied by specifying a directory name on the runtimepath, but we can be explicit in calling it using:
     30 
     31 `lua require"flashcards.init`
     32 
     33 There isn't a reason to do that though. In the case of the `other.lua` file we require it as follows:
     34 
     35 `lua require"flashcards.other`
     36 
     37 The specification of the keyword `lua` at the beginning of the above commands is only necessary when executed from within neovim. If it is being called from another lua function the keyword should be dropped.
     38 
     39 ## Links
     40 
     41 - [Lua](Lua.md)