Coc.nvim how to disable auto complete suggestions in markdown files? - vim

I am trying to setup Neovim with Coc for writing markdown. I have Coc working with javascript and other file types.
What I am trying to do is disable the autocomplete suggestions only for markdown files. I have found that if I run :CocDisable that more or less gets the job done but I would like to keep markdown-lint enabled.
Is there a way to disable autocomplete suggestions in Coc only for markdown files?
A picture of the autocomplete suggestions popping up in markdown

autocmd FileType markdown let b:coc_suggest_disable = 1
This will disable completion suggestions only.

A bit late here, but I believe the best method is to edit CocConfig file by putting "suggest.autoTrigger": "none".
This more or less does the job OP is asking for.
Edit: typo, see reply 1

You could write something like autocmd FileType markdown :call CocDisable() in your .vimrc

Related

set nofoldenable not working in my vim - why?

Every time I open one of my markdown (.md extension) files in my MacVim, they automatically fold lots of lines, which is a pathetically frustrating feature in almost all cases. And even after I added set nofoldenable in my ~/.vimrc, it doesn't disable the feature at all. Writing in ~/.gvimrc doesn't work, either.
So is it feasible to disable it? And what am I missing?
I also wonder why the depressing folding feature only functions in my markdown files. As far as I know, all the other extension I use don't conform to the functionality.
I use OS-X default Vim 7.3 and Mavericks 10.9.1.
Have you tried with
au FileType markdown setlocal nofoldenable

How to create your own TComment syntax in vim

Is there a way to make your own comment syntax in TComment because I'm currently studying laravel
and its native templating which is called blade has a syntax for comment which looks like this
{{--Hello i'm a comment--}}
I would like to be able to toggle with this particular comment syntax when i'm editing a file which has an extension of .blade.php
Thanks in advance. If there's a native vim way it would help also. :)
Update:
I'm skimming through the help page of Tcomment and i've stumbled upon this function
tcomment#Comment(beg, end, ...), but i don't know how to implement it since i haven't dealt with vimscript yet. Even a small snippet of how this command is implemented could help
If the other suggestion (using an ftplugin, which is preferable since it provides info for other vim features) doesn't work, you could do (in .vimrc):
call tcomment#DefineType('blade', '{{--%s--}}')
You'd then have to find a way to set the filetype to blade, e.g. (in ~/.vim/filetype.vim)
au BufNewFile,BufRead *.blade.php setf blade
Here is a Solution that works for me:
I create a syntax file for the exotic programming language (my language called HRDT).
If I open a file called .script vim change the file type to HRDT.
My .vimrc contains is line:
autocmd FileType hrdt set commentstring=\\%s
This line automatically change the commentstring from standard *some Text*\ to \some Text .
For commenting I use the very famous NerdCommenter.
It might be that all you need to do is set 'commentstring'. In your case:
setlocal commentstring={{--%s--}}
This would probably go in a filetype plugin/ftplugin.

How can I configure VIM so that files with extension .less are edited with zen-coding?

How can I configure VIM so that files with extension .less are edited with zen-coding?
I can use within the zencoding notepad + + on windows normally. But now I want to use the same way inside vim.
ZenCoding is probably activated on a per-filetype basis, if that's the case, just type :set filetype=css.
If you want this setting to stick, add this line to your .vimrc:
autocmd BufRead,BufNewFile *.less set filetype=css
If you want to retain the normal features that go with .less files (if any) you can do :set ft=less.css but some plugins don't like that.
I first tried to write a comment, but found then something that could be an answer.
So I think the question is: How can I configure VIM so that files with extension .less are edited with zen-coding?
At the official site for zen-coding, there are lists of editors that support zen-coding:
Official
third-party
Unofficial
There for VIM, the following sites are mentioned:
Sparkup
Zen Coding for VIM
I have read into both, and both seem to expand shortcuts to HTML code, not to less-code. But perhaps I have misunderstood the question.
I didn't know you could use Zencoding for css. I use it in Vim for html.It s great!I started using Less and I was wondering an hour ago ,If something like this existed. I guess it's something to work on.

Autocompletion in Vim

I'm having trouble with autocompletion. How can I get a code suggestion while I'm typing?
I usually develop in PHP, Ruby, HTML, C and CSS.
Use Ctrl-N to get a list of word suggestions while in insert mode. Type :help i_CTRL-N to see Vim's documentation on this functionality.
Here is an example of importing the Python dictionary into Vim.
You can use a plugin like AutoComplPop to get automatic code completion as you type.
2015 Edit: I personally use YouCompleteMe now.
If you are using VIM version 8+, just type Ctrl + n or Ctrl + p.
You can start from built-in omnifunc setting.
Just put:
filetype plugin on
au FileType php setl ofu=phpcomplete#CompletePHP
au FileType ruby,eruby setl ofu=rubycomplete#Complete
au FileType html,xhtml setl ofu=htmlcomplete#CompleteTags
au FileType c setl ofu=ccomplete#CompleteCpp
au FileType css setl ofu=csscomplete#CompleteCSS
on the bottom of your .vimrc, then type <Ctrl-X><Ctrl-O> in insert mode.
I always rely on this CSS completion.
There is also https://github.com/Valloric/YouCompleteMe and it includes things like Jedi and also has fuzzy match. So far I found YCM to be the fastest among what I have tried.
Edit: There also exists some new ones like https://github.com/maralla/completor.vim
Another option is coc.nvim.
It's really fast and the completion is great as it uses intellisense the same autocompletion as VScode has.
It also has linting capabilities. So it shows you were you might have a bug.
It supports a multitude of languages.
It might take a bit to set up and configure but I think it is the best autocompletion engine for vim out there.
I've used neocomplcache for about half a year. It is a plugin that collects a cache of words in all your buffers and then provides them for you to auto-complete with.
There is an array of screenshots on the project page in the previous link. Neocomplcache also has a ton of configuration options, of which there are basic examples on the project page as well.
If you need more depth, you can look at the relevant section in my vimrc - just search for the word neocomplcache.
Here is link! for PHP.
press the Ctrl + x followed by Ctrl + o keys while writing some PHP functions.
Thanks to Oseems Solutions for the tutorial
If you only wanna auto-completion from cache of your current buffers, supertab is easier to install than neocomplete, can work on Mac pre-installed vim out of box without the need of MacVim.
You can check other alternatives at vim awesome.
For PHP, Padawan with Deoplete are great solutions for having a robust PHP autocompletion in Neovim. I tried a lot of things and Padawan work like a charm!
For Vim you can use Neocomplete instead of Deoplete.
I wrote an article how to make a Vim PHP IDE if somebody is interested. Of course Padawan is part of it.
I recently discovered a project called OniVim, which is an electron-based front-end for NeoVim that comes with very nice autocomplete for several languages out of the box, and since it's basically just a wrapper around NeoVim, you have the full power of vim at your disposal if the GUI doesn't meet your needs. It's still in early development, but it is rapidly improving and there is a really active community around it. I have been using vim for over 10 years and started giving Oni a test drive a few weeks ago, and while it does have some bugs here and there it hasn't gotten in my way. I would strongly recommend it to new vim users who are still getting their vim-fingers!
OniVim: https://www.onivim.io/

Vim: SnipMate Plugin: how i can change a .snippet and update it on the fly?

does anyone know how to edit a dot snippet file and reload into (g)vim without closing and re-open the program? it would be great to do that with this excellent plugin.
greetings
If you have the latest version of snipmate you can use the following command from vim to reload all the snippets :call ReloadAllSnippets() or better you can map it to a key
I am currently on a promoting tour for UltiSnips on StackOverflow. UltiSnips will watch your snippet files for change, so all you have to do is save your .snippets file and the changes are immediately available in Vim. There is also a handy :UltiSnipsEdit command that will open the correct snippets file right away.
A conversion script for snipMate snippets is shipped with UltiSnips, so switching is easy.
Have a look at the following discussion

Resources