How to get rid of this hit-enter prompt

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get rid of this hit-enter prompt

Antun  Karlovac

Hi all,

I've got the following set of functions to format some text (the
shortcuts won't work). I get the press-enter message, after hitting
Ctrl+H then pressing 1 or two and then enter. I want to avoid this
message altogether:

function! MakeHeading1()
    :normal ^O72i=jo72i=k?EURO kb:ce
jj6^
endfunction MakeHeading2

function! MakeHeading2()
    :normal ^O72i-jo72i-k?EURO kb:ce
jj6^
endfunction MakeHeading2

function! SetHeadingLevel()
    let hl = inputlist(['Select heading level:',
                        \'1. Heading Level 1',
                        \'2. Heading Level 2'])
    if hl == 1
        call MakeHeading1()
    elseif hl == 2
        call MakeHeading2()
    endif
    echo v:scrollstart
endfunction " SetHeadingLevel()
map <C-h> :call SetHeadingLevel()<CR>

I've tried setting noshowcmd, which didn't do anything in my case, and
increasing cmdheight, but I don't want to lose lines to the command.

Is there any way of preventing this message from happening, or writing
in a manual "Enter" confirmation?

It's caused by the inputlist() function call.

Thanks,

Antun


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


Reply | Threaded
Open this post in threaded view
|

Re: How to get rid of this hit-enter prompt

Tony Mechelynck

Antun Karlovac wrote:

> Hi all,
>
> I've got the following set of functions to format some text (the
> shortcuts won't work). I get the press-enter message, after hitting
> Ctrl+H then pressing 1 or two and then enter. I want to avoid this
> message altogether:
>
> function! MakeHeading1()
>     :normal ^O 72i= jo 72i= k?EURO kb:ce
> jj6 ^
> endfunction MakeHeading2
>
> function! MakeHeading2()
>     :normal ^O 72i- jo 72i- k?EURO kb:ce
> jj6 ^
> endfunction MakeHeading2
>
> function! SetHeadingLevel()
>     let hl = inputlist(['Select heading level:',
>                         \'1. Heading Level 1',
>                         \'2. Heading Level 2'])
>     if hl == 1
>         call MakeHeading1()
>     elseif hl == 2
>         call MakeHeading2()
>     endif
>     echo v:scrollstart
> endfunction " SetHeadingLevel()
> map <C-h> :call SetHeadingLevel()<CR>
>
> I've tried setting noshowcmd, which didn't do anything in my case, and
> increasing cmdheight, but I don't want to lose lines to the command.

Try ":set nomore". But you may miss some messages then, if they are removed
before you have the time to see them.

>
> Is there any way of preventing this message from happening, or writing
> in a manual "Enter" confirmation?
>
> It's caused by the inputlist() function call.
>
> Thanks,
>
> Antun


Best regards,
Tony.
--
Expense Accounts, n.:
        Corporate food stamps.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


Reply | Threaded
Open this post in threaded view
|

Re: How to get rid of this hit-enter prompt

Antun  Karlovac

Thanks, but that didn't seem to have any effect. I tried manually
calling ":set nomore", as well as adding it to the _vimrc file. I
restarted Vim too.



On Jul 20, 1:20 pm, Tony Mechelynck <[hidden email]>
wrote:

>
> Try ":set nomore". But you may miss some messages then, if they are removed
> before you have the time to see them.
>
>
>
>
> Best regards,
> Tony.
> --
> Expense Accounts, n.:
>         Corporate food stamps.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---