Code Monkey home page Code Monkey logo

Comments (5)

hrsh7th avatar hrsh7th commented on August 29, 2024

I think we should implement vsnip#jump(direction).

I will implement it.

BTW, Your setting is very interesting. I couldn't think to use vsnip and ultisnips both.

I was just curious, Why you use both?

from vim-vsnip.

 avatar commented on August 29, 2024

Oh, that sounds great.

Why you use both?

I prepare two kinds of snippets,

  • Basic minimal snippets (such as if, class)
  • My extended snippets that are long or for niche purposes, thus usual snippets library doesn't support (such as erase a certain char from string, dfs) (example)

I use Ultisnips and vim-snippets as former, and your vsnip as latter.

The reason why I chose your vsnip is that I had always tried to share snippets with vscode and vim, but it was a hell of tasks. There was a once time that I gave up and move all snippets into Alfred, but not my like. Then I found your plugin really great and this is what I've been looking for.

from vim-vsnip.

 avatar commented on August 29, 2024

UPDATE:

I accomplished without changing. When I created an issue, I didn't know how to exec plug command at insert mode.

let g:ulti_expand_or_jump_res = 0
let g:UltiSnipsExpandTrigger='<NUL>'
let g:UltiSnipsJumpForwardTrigger='<Tab>'
let g:UltiSnipsJumpBackwardTrigger='<S-Tab>'
fun! DeoEnter()
        if pumvisible()
                if vsnip#available(1)
                        call vsnip#expand()
                        return "\<C-y>"
                endif

                call UltiSnips#ExpandSnippetOrJump()
                if g:ulti_expand_or_jump_res > 0
                        return ""
                endif

                return "\<C-y>"
        endif

        return "\n"
endfun
ino <CR> <C-R>=DeoEnter()<CR>
fun! DeoTab()
        if vsnip#available(1)
                return "\<Plug>(vsnip-jump-next)"
        endif

        if pumvisible()
                return "\<C-n>"
        endif

        return "\<Tab>"
endfun
imap <expr> <Tab> DeoTab()
smap <expr> <Tab> DeoTab()
fun! DeoShiftTab()
        if vsnip#available(-1)
                return "\<Plug>(vsnip-jump-prev)"
        endif

        if pumvisible()
                return "\<C-p>"
        endif

        return "\<S-Tab>"
endfun
imap <expr> <Tab> DeoShiftTab()
smap <expr> <Tab> DeoShiftTab()

from vim-vsnip.

hrsh7th avatar hrsh7th commented on August 29, 2024

Sorry for my delay...

It's nice that the problem has been fixed.

from vim-vsnip.

 avatar commented on August 29, 2024

No way, it's just my personal want and really kind of you to say that. Thank you very much again.

from vim-vsnip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.