Giter Club home page Giter Club logo

Comments (9)

cohama avatar cohama commented on September 27, 2024 2

I made two mistakes.

  1. I could not handle plugin load order.

If you add your vimrc imap <CR>... but lexima will be loaded after the vimrc and overrides it. I will fix this but you can use a workaround as below.

" insert this line above imap
call lexima#init()
  1. I missed the example.

It is necessary to escape '<' to recognize '<CR>' as 4 characters.

inoremap <expr> <CR> someCondition() ? yourMapping() : lexima#expand('<LT>CR>', 'i')

from lexima.vim.

cohama avatar cohama commented on September 27, 2024

Thanks for your idea. I will try to implement but the current implementation is too complex to expose.
It needs to refactor.

from lexima.vim.

sebastianmarkow avatar sebastianmarkow commented on September 27, 2024

+1

from lexima.vim.

cohama avatar cohama commented on September 27, 2024

Hi.
I have added lexima#expand() function.
You can use it like below.

inoremap <expr> <CR> someCondition() ? yourMapping() : lexima#expand('<CR>', 'i')

Add this code after lexima#add_rule().
Please try it!

from lexima.vim.

sebastianmarkow avatar sebastianmarkow commented on September 27, 2024

Does not work in my setup, here's my modified vimrc (Line 465) for reference.

Let me know, if I can be of help somehow.

from lexima.vim.

cohama avatar cohama commented on September 27, 2024

Sorry I can not reproduce it.
Please send me the result of :imap.

from lexima.vim.

sebastianmarkow avatar sebastianmarkow commented on September 27, 2024

@cohama

Sorry, just recalled that I might have to disable automappings for <cr>. Am I right?

Here's the :imap output

i  <Esc>       *@<C-R>=lexima#insmode#escape()<CR><Esc>
i  <Plug>(neocomplete_auto_refresh) * <C-R>=neocomplete#mappings#refresh()<CR>
i  <Plug>(neocomplete_start_manual_complete) * <C-R>=neocomplete#mappings#manual_complete()<CR>
i  <Plug>(neocomplete_start_auto_complete) * <C-R>=neocomplete#mappings#auto_complete()<CR>
i  <Plug>(neocomplete_start_omni_complete) * <C-X><C-O>
i  <Plug>(neocomplete_start_unite_quick_match) * unite#sources#neocomplete#start_quick_match()
i  <Plug>(neocomplete_start_unite_complete) * unite#sources#neocomplete#start_complete()
i  <Plug>(neosnippet_start_unite_snippet) * unite#sources#neosnippet#start_complete()
i  <Plug>(neosnippet_jump) * neosnippet#mappings#jump_impl()
i  <Plug>(neosnippet_expand) * neosnippet#mappings#expand_impl()
i  <Plug>(neosnippet_jump_or_expand) * neosnippet#mappings#jump_or_expand_impl()
i  <Plug>(neosnippet_expand_or_jump) * neosnippet#mappings#expand_or_jump_impl()
i  <Plug>ISurround * <C-R>=<SNR>47_insert(1)<CR>
i  <Plug>Isurround * <C-R>=<SNR>47_insert()<CR>
i  <BS>        * lexima#expand('<BS>', 'i')
i  <Plug>(EasyAlign) * <C-O>:<C-U>call <SNR>2_lod_map('<Plug>(EasyAlign)', ['vim-easy-align'], "")<CR>
!  <D-v>         <C-R>*
i  <C-G>S        <Plug>ISurround
i  <C-G>s        <Plug>Isurround
i  <C-G>       * neocomplete#undo_completion()
i  <Tab>         pumvisible() ? "\<C-N>" : neosnippet#jumpable() ? "\<Plug>(neosnippet_jump)" : "\<Tab>"
i  <C-L>       * neocomplete#complete_common_string()
i  <CR>        * lexima#expand('<CR>', 'i')
i  <C-S>         <Plug>Isurround
i  <Esc><Esc>  * <Esc>
i  <Esc>       * pumvisible() ? neocomplete#cancel_popup() : "\<Esc>"
i  <Space>     * lexima#expand('<SPACE>', 'i')
i  "           * lexima#expand('"', 'i')
i  '           * lexima#expand('''', 'i')
i  (           * lexima#expand('(', 'i')
i  )           * lexima#expand(')', 'i')
i  [           * lexima#expand('[', 'i')
i  ]           * lexima#expand(']', 'i')
i  `           * lexima#expand('`', 'i')
i  {           * lexima#expand('{', 'i')
i  }           * lexima#expand('}', 'i')

from lexima.vim.

sebastianmarkow avatar sebastianmarkow commented on September 27, 2024

Works just fine. Thanks @cohama

from lexima.vim.

Murlocks avatar Murlocks commented on September 27, 2024

A very late thank you!

from lexima.vim.

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.