Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SnipMate interacts poorly with Vim autoformatting #173

Open
llinfeng opened this issue Nov 7, 2014 · 3 comments
Open

SnipMate interacts poorly with Vim autoformatting #173

llinfeng opened this issue Nov 7, 2014 · 3 comments
Assignees

Comments

@llinfeng
Copy link

llinfeng commented Nov 7, 2014

I admit it is bad habit to use long variable names. This leads to long variable names and auto-completion becomes a must for me.

Snipmate does not like my autocompletion. I am not using anything fancy, but just plain <C-N> and <C-P>. However, whenever I touch these two key-strokes, snipmate stops to function after that point. It completes the word, but will distort the rest of the line at which it automatically updates. Here is the snippet that I have trouble:

    eststo: qui areg ${1:LHS} \$${2:Dfdn_traits}, absorb(${3:FE}) cluster(${4:clustering_variable}) 
    foreach j of varlist $2 {
        disp "\`j'"
            eststo: qui  areg $1  \`j', absorb($3) cluster($4) 
    }
    esttab using $Tex/05_ScreeningADA_yearlyIV_monthly_FE.tex, replace se
    eststo clear

Another problem is that: Snipmate does not like auto-linebreak, when it "syncs" the $1's. When I reach 80 characters at the first line, with my long variable name, I will get a hard wrap at that point. When I reach such point, the line where $4 is located is also distorted in a way that the "filling-in" of characters from $4 defined above just stops, leaving an incomplete variable name in this line.

Both of the two obstacles distorts the experience with using snipmate.

As a way around, I now type the full variable names and have turned off the hard-wrapping at 80 characters.

Thanks again for making Snipmate possible for Vimmers.

@ajzafar
Copy link
Collaborator

ajzafar commented Nov 9, 2014

For your second problem, indeed SnipMate currently interacts poorly with Vim's text formatting. For the time being I'm afraid there's little option besides disabling the formatting while you're expanding/editing a snippet.

I'm not sure I understand your first problem. (GitHub seems to have eaten a few characters in your message. GitHub uses Markdown, so be sure to separate code with backticks like so: <C-X>.) If you mean problems occur when you use Vim's regular insert mode completion with <C-N> and <C-P>, then be sure to leave select mode before hitting either key. Neither does completion in select mode, and both do in fact seem to cause problems. I will look into what can be done about that soon. In any case, work around this by going to insert mode before trying to use insert mode completion.

@ajzafar
Copy link
Collaborator

ajzafar commented Jan 23, 2015

@llinfeng I am no longer able to reproduce your first problem in the just-pushed master.

@llinfeng
Copy link
Author

Yeah, I confirm that the snipmate is working well now with <C-N> and <C-P> expansions. Thank you for making this possible.

All the best,

-Linfeng

@ajzafar ajzafar changed the title Is snipmate "typer" effecient only? SnipMate interacts poorly with Vim autoformatting Mar 1, 2015
@ajzafar ajzafar self-assigned this Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants