2

I've set this on my .vimrc:

let g:clang_snippets=1
let g:clang_snippets_engine='clang_complete'
let g:clang_conceal_snippets=1
set conceallevel=2 concealcursor=inv

I don't know how conceal is expected to work, maybe the clang_complete's docs should have a tip for a specific setting to hide the snippets adorns.

How do I hide it? I'm using MacVim built with +conceal, but it's not working. This is my messy .vimrc by now.

NOTE: I'm sticking with g:clang_snippets_engine='clang_complete' because it seems to be more smart than the snipMate parameter completion, switching to NORMAL mode is a wiser choice to navigate between parameters since I can use SuperTab completion for params in INSERT mode while being able to navigate through them with the same tab at NORMAL mode. snipMate engine was acting weird to me sometimes too, sometimes it switched to a parameter after a completion, sometimes not.

Also, I'm missing a final tab to go after the last parameter, right after the function call (snipMate does that), so I can just insert ; and hit Enter.

Disclaimer: This question is related with the issue at https://github.com/Rip-Rip/clang_complete/issues/176.

EDIT:

My problem was with this line at my .vimrc:

au BufNewFile,BufRead *.cpp set syntax=cpp11

I'm using C++11 Syntax Support and @xaizek has discovered and pointed it out as the problem in the comments bellow in the accepted response, it seems the root cause is the use of the syntax clear command in it.

Peeter Joot
  • 7,848
  • 7
  • 48
  • 82
oblitum
  • 11,380
  • 6
  • 54
  • 120

1 Answers1

3

According to :help 'concealcursor':

Sets the modes in which text in the cursor line can also be concealed.
When the current mode is listed then concealing happens just like in
other lines.
  n     Normal mode
  v     Visual mode
  i     Insert mode
  c     Command line editing, for 'incsearch'

So with concealcursor=iv you asked Vim to hide concealed text in insert and visual modes, but show it in normal mode. So just do:

:set concealcursor=inv
xaizek
  • 5,098
  • 1
  • 34
  • 60
  • I've edited my question, currently my .vimrc is with `set conceallevel=2 concealcursor=inv`, but still, nothing is being hidden. – oblitum Jul 28 '12 at 20:18
  • I know this can sound stupid, but anyway. Did you restarted Vim? And do you see text that should be concealed in all modes (try insert and visual)? Did you try to do `:set concealcursor? conceallevel?` inside a buffer with code? – xaizek Jul 28 '12 at 20:24
  • I've reloaded it, for sure. I've not tried to set is live for a buffer. – oblitum Jul 28 '12 at 20:25
  • Option with a question mark at the end will show you its value, to check if it's correct. – xaizek Jul 28 '12 at 20:26
  • It's just like it should be... concealcursor=inv conceallevel=2 – oblitum Jul 28 '12 at 20:28
  • That's strange. And what is the output of `:syntax list Conceal`? – xaizek Jul 28 '12 at 20:32
  • just a title --- Syntax items --- and nothing bellow, only Press Enter or type a command to continue – oblitum Jul 28 '12 at 20:36
  • Try to reproduce this on a C file. I think you're using C++ buffers and `set syntax=cpp11` is the reason of the issue. – xaizek Jul 28 '12 at 20:39
  • bang! working fine with C. I think it should work with C++? I just need to remove the cpp11 sintax support? – oblitum Jul 28 '12 at 20:42
  • Yes, or modify it to make it work (I see `syntax clear` command in it, but it shouldn't be called). – xaizek Jul 28 '12 at 20:44