local_vimrc icon indicating copy to clipboard operation
local_vimrc copied to clipboard

Add explanation to menu when opening vim

Open artfulrobot opened this issue 4 years ago • 3 comments

I opened a file in vim in a project that uses this and was confused as I was given a Yes/No/Always/Never prompt - but with no context? What is the question to which those are options?

image

After going through all of my plugins I found it was this one. I think the missing question is "Found _vimrm_local.vim, do you want to run it?"

artfulrobot avatar May 27 '21 09:05 artfulrobot

Sorry for my extremely late answer.

Do you remember whether you had multiple splits (windows)? Normally you should see the question in the command line and all the choices in the window status line. Which is not ideal :(

I should be able to improve the status line message by displaying the question there as well on

:echo lh#ui#confirm('Do you want to XXXXXX ?', "&Yes\n&No\n&Always\nNe&ver", 1)

LucHermitte avatar Aug 11 '21 12:08 LucHermitte

Thanks for getting back, no need to apologise, I'm grateful to you for your contribution to open sourceness!

I just reinstalled this plugin in nvim 0.5.0 with

Plug 'LucHermitte/lh-vim-lib'  
Plug 'LucHermitte/local_vimrc' 

Observations

  • opening with just vim: it does not find my _vimrc_local.vim
  • opening with a single file vim README.md: it says Do you want to recognize a local vimrc at "/home/xxx/_vimrc_local.vim"? Yes No Always Never which seems to work as expected
  • opening with multiple splits vim -o *.md: it gives me this option for every split. Then it seems to give me the options again for each split, but this time without a nice menu. This gets a bit cyclical.

Hope that's helpful

artfulrobot avatar Aug 11 '21 16:08 artfulrobot

opening with just vim: it does not find my _vimrc_local.vim

As this point this is somewhat normal as the local vimrc is sourced only on named buffers. I think it could be changed though.

opening with multiple splits vim -o *.md: it gives me this option for every split. Then it seems to give me the options again for each split, but this time without a nice menu. This gets a bit cyclical.

Indeed. 'Yes' choice should have remembered the choice for the current buffer at least. Only 'always' validates the local vimrc for all matching buffers.

EDIT: I've changed the default to "Always", and I've renamed "Yes" choice "Once"

LucHermitte avatar Aug 11 '21 23:08 LucHermitte