nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.
https://nvim-orgmode.github.io/
MIT License
3.04k stars 134 forks source link

Support / docs / newbie question: Where does the require statement go? #52

Closed mlncn closed 3 years ago

mlncn commented 3 years ago

Where does the require('orgmode').setup({ etc statement documented under Setup get placed?

Tried it in ~/.vimrc and got:

Error detected while processing /home/mlncn/Projects/mlncn/scripts/.vimrc:
line   78:
E492: Not an editor command: require('orgmode').setup({
line   79:
E492: Not an editor command:   org_agenda_files = {'~/Dropbox/org/*', '~/my-orgs
/**/*'},
line   80:
E492: Not an editor command:   org_default_notes_file = '~/Dropbox/org/refile.or
g',
line   81:
E492: Not an editor command: })

Using the kristijanhusak/vim-packager installation approach.

Hmm, same for the chain completion too.

Error detected while processing /home/mlncn/Projects/mlncn/scripts/.vimrc:
line   78:
E220: Missing }.
"completion_chain_complete_list" [New]
Cannot open file "completion_chain_complete_list"

Thanks!

kristijanhusak commented 3 years ago

Seems like you are using Vim. This is a neovim plugin. It requires latest neovim version (0.5). Setup is done in lua.

kristijanhusak commented 3 years ago

Closing this due to inactivity.

hellquist commented 3 years ago

Seems like you are using Vim. This is a neovim plugin. It requires latest neovim version (0.5). Setup is done in lua.

Hi! Just to add that the instructions could be clarified. Example (for code snippet under Setup heading): adding a commented out line in the code sample clarifying in what file the setup lines go, and also where in that file if it already exists.

I have the same thing. I most definitely am using Neovim 0.5 though. Thanks to this thread I now know I probably need to add those lines in a lua file somewhere (like the OP I tried "the other regular places", such as ~/.config/nvim/init.vim and also created a ~/.vimrc, both without luck of course), but I don't know where that file is and if those lines should go at the top/bottom, or after an init of some kind, as all the lua files I can find in the orgmode.vim folder (which are the only lua files I have) look rather "busy" already. Have tried a couple of options I thought could be logical, but so far no luck.

For those "who already know" this is most likely a silly n00b thing, but for those who are new to this plug, like me (and OP) it is very difficult to know what we don't know.

It would be a quick fix to just add that info to the readme info, IMHO.

kristijanhusak commented 3 years ago

For the OP's issue, I think there's enough information that this is a Neovim specific plugin, by few things:

I'm assuming he just missed it.

Installation instructions doesn't have the note that this needs to go into ~/.config/nvim/init.vim (which doesn't apply for Windows though), but it's a fair assumption that anyone having a Neovim knows where to put the setup. If it would require any specific place where it needs to be put (beginning, end, different file, or anything else like that), that would be noted. Putting it literally anywhere in your init.vim should make it work without any issues.

I'm open for Readme and Docs improvement PRs, so feel free to add what you think it's missing. I'm an advanced user so it's hard for me to figure these things out.

hellquist commented 3 years ago

Right. Then I truly am more confused.

I agree that setup/install instructions that go in to the "usual" default files don't need further specification. However, when I add those lines to my ~/.config/nvim/init.vim I get the error messages described by OP. I thought that would be the logical place to put any configuration that isn't otherwise specified, but alas, I get:

Error detected while processing /Users/mathiashellquist/.config/nvim/init.vim:
line   88:
E492: Not an editor command: require('orgmode').setup({
line   89:
E492: Not an editor command:   org_agenda_files = {'~/git/inbox/org/*', '~/my-orgs/**/*'},
line   90:
E492: Not an editor command:   org_default_notes_file = '~/git/inbox/org/refile.org',
line   91:
E492: Not an editor command: })

Neovim installed on macOS via Homebrew.

I'm a long time vim user that decided to try out Neovim after briefly exploring Spacemacs (and deciding to look for other options), and thus ended up here.

kristijanhusak commented 3 years ago

I updated the setup section to explain how to set up from init.vim. All other sections assume you are using init.lua instead of init.vim.

I suggest to read more about Neovim lua functionality here https://github.com/nanotee/nvim-lua-guide, since it has basics explained. Hope this helps.

hellquist commented 3 years ago

Perfect! It worked great, thanks!