I want to input this.
and get this->
in c++-mode.
I tried abbrev-mode
and yasnippet
, but failed.
In abbrev-mode, I defined an abbrev this
to get this
using .
as a trigger key, but soon as I typed this.
I got this->.
.
In yasnippet, I defined a snippet
# -*- mode: snippet -*-
# name: this
# key: this
# binding: .
# condition: (eq 0 (string-match "this" (buffer-substring (- (point) 4) (point))))
# --
this->
but got thisthis->
after input this.
.
If I remove the this
in the last line of the snippet
# -*- mode: snippet -*-
# name: this
# key: this
# binding: .
# condition: (eq 0 (string-match "this" (buffer-substring (- (point) 4) (point))))
# --
->
everything seems fine but why we don't need this
here ? Also, under this situation, the expansion broke the completion of company-irony
even I've added yas-expand
to irony-completion-trigger-commands
.
What is the simplest way to achieve this ? Thanks !