gvim - omnicompletiton problems with html files

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

gvim - omnicompletiton problems with html files

simo zz
Hi,

In my ~/.vimrc setup I set the following function and autocmd

function! GuiSave()
   if has('gui_running')   
      if empty(bufname(''))
         browse confirm write
     else
         confirm write
      endif
   endif
endfunction

:vnoremap <silent> <C-s> :call GuiSave()<CR>
:nnoremap <silent> <C-s> :call GuiSave()<CR>
:inoremap <silent> <C-s> <C-O>:call GuiSave()<CR>

But when I have to edit some HTML file, after typing each word gvim returns 

E764: option 'omnifunc' is not set

or when I press C-s sometimes gvim prints the call to GuiSave(), for example

<h5>:call GuiSave()

which is quiet annoying.
Inserting the autocmd line 

autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags

does not solve the problem
What is the right way to solve this issue ? Honestly I am not interested in autocompletion at all.

Regards.
s.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: gvim - omnicompletiton problems with html files

Christian Brabandt

On Mo, 11 Jun 2018, simo zz wrote:

> But when I have to edit some HTML file, after typing each word gvim returns 
>
> E764: option 'omnifunc' is not set
>
> or when I press C-s sometimes gvim prints the call to GuiSave(), for example
>
> <h5>:call GuiSave()
>
> which is quiet annoying.
> Inserting the autocmd line 
>
> autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
>
> does not solve the problem
> What is the right way to solve this issue ? Honestly I am not interested in
> autocompletion at all.

What do you mean with "after typing each word"?

For the second problem, have a look at :h :map-<silent>

Best,
Christian
--
Je mehr der Mensch des ganzen Ernstes fähig ist, desto herzlicher kann
er lachen.
                -- Arthur Schopenhauer

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: gvim - omnicompletiton problems with html files

simo zz
Hi, 

I finally solved with 

: filetype plugin on 

in ~/.vimrc. Now gvim behaves correctly.
Regards,
s.

On Mon, Jun 11, 2018 at 9:40 PM, Christian Brabandt <[hidden email]> wrote:

On Mo, 11 Jun 2018, simo zz wrote:

> But when I have to edit some HTML file, after typing each word gvim returns 
>
> E764: option 'omnifunc' is not set
>
> or when I press C-s sometimes gvim prints the call to GuiSave(), for example
>
> <h5>:call GuiSave()
>
> which is quiet annoying.
> Inserting the autocmd line 
>
> autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
>
> does not solve the problem
> What is the right way to solve this issue ? Honestly I am not interested in
> autocompletion at all.

What do you mean with "after typing each word"?

For the second problem, have a look at :h :map-<silent>

Best,
Christian
--
Je mehr der Mensch des ganzen Ernstes fähig ist, desto herzlicher kann
er lachen.
                -- Arthur Schopenhauer

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.