1

I recently switched from bash to zsh and now the tabstops in my Ultisnips-snippets aren't working properly anymore.

I didn't change anything in my snippet files and after I encountered the problem for the first time, I went back to bash, started vim from there and the snippets worked as intended again.

I have these to snippets

snippet ( iA
($1)$0
endsnippet

snippet mk wA
$$1$$0
endsnippet

If I run vim from bash and type mk, it will expand to

$Cursor$

(I will denote the cursor position by Cursor). Then I can type f( and it will expand to

$f(Cursor)$

If I press x and then tab it will take me to

$f(x)Cursor$

(I will call this previous step S). Pressing tab again I will arrive at

$f(x)$Cursor

Running vim from zsh however, I can still do the steps until S but if I then press tab, it will stay at

$f(x)Cursor$

and start inserting tabs after that. If I only do mk however and type something else without brackets, for example ab

$abCursor$

and then press tab, it will work as expected and get me to

$ab$Cursor

Does anybody have an idea what's going on here? What can I do if I want to keep using zsh and Ultisnips? If I run bash -c 'vim file.txt', vim will work really slowly and lag a lot, so that is not really an option. Any help would be appreciated.

Edit: Apparently the problem has something to do with what version of vim I'm using. I use macOS and the problem I described happens when I use the default vim version. If I use a custom-compiled version of vim, it works as expected. And as it turns out I have some config file that tells bash to use the custom-compiled version, whereas zsh still uses the default one. I also tried it on my PC (running Ubuntu) and with the vim version installed there, it also worked. So I guess, I'll use my custom-compiled vim to avoid this problem...

But does anybody know, what vim setting could be responsible for this? If I'm not mistaken my custom-compiled version is just the huge-feature version of vim.

n7kvz
  • 111
  • 2
  • I can only assume you have some `vim`-specific setup in a `bash` configuration file that doesn't appear in your `zsh` configuration files. – chepner Oct 30 '19 at 12:46
  • @chepner I get the same behavior with `.bashrc` and `.zshrc` empty – n7kvz Oct 30 '19 at 12:51
  • Is the value of `$TERM` the same in both shells? I can't really think of anything about `zsh` that would affect the behavior of `vim`. – chepner Oct 30 '19 at 13:04
  • @chepner Yes, it is `xterm-256color` – n7kvz Oct 30 '19 at 13:08
  • @chepner You were right with your first comment, that it is some vim-specific option that is different in my bash and zsh config. It wasn't set in my standard bash config file though. That is why I didn't see it at first. – n7kvz Oct 30 '19 at 13:58

0 Answers0