Closed nhatvan2231 closed 1 year ago
This is an error in setup
function, could you please send me your configuration?
This is what I have with skeletons directory contains python and latex folder and a file README.md.
--vim.loader.enable()
--Basic
require('settings')
require('autocmd')
require('plugins')
require('keybinds')
--Extra
require("esqueleto").setup(
{
-- Template directories
directories = {"~/.config/nvim/skeleton/"},
-- Patterns to match when creating new file
-- Can be either (i) file names or (ii) file types.
-- Exact file name match have priority
patterns = {"latex", "README.md", "python" },
-- whether to auto-use a template if it's the only one for a pattern
autouse = true,
advanced = {
-- List of files glob patterns to ignore
-- Or alternatively, a function that determines if a file should be ignored
ignored = {},
-- Ignore OS files like .DS_Store
-- Exhaustive list: https://www.toptal.com/developers/gitignore/api/windows,macos,linux
ignore_os_files = true,
},
})
I can't reproduce the error, could you add the version of nvim
you are using and an example of how you are using the plugin (please add template, template directory structure and command-line args you are using)
Also, if you are using an older version of the plugin, it will not recognize the new tables and throw an error (in theory). Could you check that also and comment?
Well I'm a newbie with neovim. So, this is my init.lua file and the plugins.lua and the whole config directory. Note python and README.md is empty.
.config/nvim
| init.lua
|___lua
| | autocmd.lua
| | keybinds.lua
| | plugins.lua
| | settings.lua
|
|___plugin
| | packer_compiled.lua
|
|___skeletons
| | python
| | README.md
| |___latex
| | default
init.lua
0 --vim.loader.enable()
1
2 --Basic
3 require('settings')
4 require('autocmd')
5 require('plugins')
6 require('keybinds')
7
8 --Extra
9 require("esqueleto").setup(
10 {
11 -- Template directories
12 directories = {"~/.config/nvim/skeletons/"},
13
14 -- Patterns to match when creating new file
15 -- Can be either (i) file names or (ii) file types.
16 -- Exact file name match have priority
17 patterns = {"latex"},
18
19 -- whether to auto-use a template if it's the only one for a pattern
20 autouse = true,
21
22 advanced = {
23 -- List of files glob patterns to ignore
24 -- Or alternatively, a function that determines if a file should be ignored
25 ignored = {},
26
27 -- Ignore OS files like .DS_Store
28 -- Exhaustive list: https://www.toptal.com/developers/gitignore/api/windows,macos,linux
29 ignore_os_files = true,
30 },
31 }
32 )
plugins.lua
0 local ensure_packer = function()
1 local fn = vim.fn
2 local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
3 if fn.empty(fn.glob(install_path)) > 0 then
4 fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_p ath})
5 vim.cmd [[packadd packer.nvim]]
6 return true
7 end
8 return false
9 end
10
11 vim.cmd([[
12 augroup packer_user_config
13 autocmd!
14 autocmd BufWritePost plugins.lua source <afile> | PackerCompile
15 augroup end
16 ]])
17
18 local packer_bootstrap = ensure_packer()
19
20 -- This file can be loaded by calling `lua require('plugins')` from your init.vim
21
22 -- Only required if you have packer configured as `opt`
23 vim.cmd [[packadd packer.nvim]]
24
25 return require('packer').startup(function(use)
26 -- Packer can manage itself
27 use 'wbthomason/packer.nvim'
28 ◃▹use 'cvigilv/esqueleto.nvim'
29 ◃▹
30 ◃▹-- Automatically set up your configuration after cloning packer.nvim
31 -- Put this at the end after all plugins
32 if packer_bootstrap then
33 require('packer').sync()
34 end
35 end)
Solve! I just need to update my neovim.
I have this error after following the README at "Usage & Configuration" step. I'm using packer.