Git Product home page Git Product logo

Comments (4)

now avatar now commented on May 18, 2024

Yes, it should and it does. The 'e' in indentkeys does just that. If it’s not working for you I would bet a lot that it’s either your syntax that’s broken or your configuration. Something as basic as that would have been caught a long time ago (I hope). I’m closing this, awaiting an actual example that breaks the indentation function.

The value of indentkeys is correct and why should be obvious from the documentation. If it isn’t, I suggest that you post to vim-dev and ask them (Bram) to clarify the documentation. To answer your question, however, the 0* are there to indent the character listed when it appears as the first non-indent character in the line.

from vim-ruby.

rosenfeld avatar rosenfeld commented on May 18, 2024

Indeed. The culprit is the neocomplcache plugin in my configuration files. Here is what I use:

let g:neocomplcache_enable_at_startup = 1
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS 
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags 
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS 
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete 
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
"let g:neocomplcache_enable_auto_select = 1 
" Enable heavy omni completion. 
if !exists('g:neocomplcache_omni_patterns') 
  let g:neocomplcache_omni_patterns = {} 
endif
let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete

The interesting part is that it works if '=else' is added to indentkeys :)

Regarding the 0* in indentkeys, could you please provide me some simple use case of how can I test them so that I could understand them better?

Best regards!

from vim-ruby.

now avatar now commented on May 18, 2024

Well, simply type one of the characters at the start of a line.

The { is there to align the start of hash literals, the } is there to align the end of hash literals and blocks, the ) is there to align the end of method argument lists and other kinds of parenthesis-delimited blocks, and the ] is there to indent the ending of an array literal. I can’t remember why [ isn’t in that list, but I’m sure there was a reason.

[
 1,
 2,
 3
].map{ |i|
  i * 2
}

from vim-ruby.

rosenfeld avatar rosenfeld commented on May 18, 2024

Ok, now I could understand. My tests were failing because of neocomplcache. I've disabled all my user plugins and did see most of the indentkeys options working. The only thing that didn't make any difference is the '0{'. Could you test if there is any situation it helps for you? Try just deleting the '0{' from indentkeys and see the results.

Maybe that is the reason why '0[' is not necessary...
Thank you again!

from vim-ruby.

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.