0

The command :LongLines comes from the plugin manu-mannattil/vim-longlines. How can I include it in my Neovim config, so it is executed every time the program starts?

1 Answer 1

1

I would do:

autocmd VimEnter * LongLines

You can't simply add LongLines to your .vimrc since the plugin is not loaded at that moment and that is why you need a autocomand.

But in my tests with the long lines plugin it seems that the long line status is more a buffer attribute than a global attribute and to make it work by default to the buffer the following settings works better:

autocmd VimEnter * LongLines
autocmd FileType * LongLines

The total should be something like:

call plug#begin()
Plug 'manu-mannattil/vim-longlines'
call plug#end()

autocmd VimEnter * LongLines
autocmd FileType * LongLines
5
  • Many thanks, it works!
    – Kolya
    Feb 4, 2023 at 12:24
  • Thanks for the feedback, Welcome to Vim :-) If the answer solves your problem mark it as accepted by using the v button next to the arrow voting buttons. Feb 4, 2023 at 13:01
  • May I ask, why did you use au in the first line and autocmd in the second?
    – Kolya
    Feb 18, 2023 at 23:00
  • It is strange but these settings do not work. " Plugin to help navigate through long soft-wrapped lines Plug 'manu-mannattil/vim-longlines' au VimEnter * LongLines autocmd FileType * LongLines. When I manually type :LongLines, the setting begins to work in all buffers, though.
    – Kolya
    Feb 18, 2023 at 23:03
  • au is a shortcut forautocmd Feb 19, 2023 at 1:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.