6
1
I have configured Tab as Omnicompetion in VIM 7.3:
inoremap <Tab> <C-n>
This is convenient, but I would really like to have regular tab back at the beginning of a line! Is there any way to check if the preceding character is whitespace or a line beginning, and if so to insert a Tab character rather than omnicomplete?
Thanks!
Thank you, this is exactly what I was looking for! Apparently I am not the first! – dotancohen – 2012-05-12T19:22:20.443
What is the
\k
? – dotancohen – 2012-05-12T19:24:27.8171It matches a 'keyword' character. See ":help /\k". – Heptite – 2012-05-12T23:51:19.040
Thank you, I have never seen the Character Classes help section. – dotancohen – 2012-05-13T07:30:54.273
I don't know why it doesn't work for me!! Can you help? – Wazery – 2014-05-20T07:48:01.920
BTW, it's an idea of Gary Bernhardt. – Wazery – 2014-05-20T07:49:38.543
@Wazery: I need to know more than "it doesn't work" to help you. – Heptite – 2014-05-20T19:31:15.790
Tell me what do you want to know, I am using Macvim and I inserted this snippet into my vimrc, restarted Macvim and tried to write a keyword then hitting tab, but it didn't autocomplete it. If you need a specific detail tell me. Here is my complete vimrc file http://codeshare.io/zUqRP.
– Wazery – 2014-05-21T08:16:59.117Does the keyword already exist within the file or files "included"? Do you get an error? Do you get a beep? Do you get a tab character? Basically, never just say "it doesn't work." Tell people what you expect, and what you are getting, and what you have tried to resolve it. Include details of your "input" or dataset or whatever is applicable, etc. – Heptite – 2014-05-21T08:54:59.243