New answers tagged

1

Thats was a bug. Thanks to @ChristianBrabandt who solved it very quickly. https://github.com/chrisbra/vim-xml-runtime/issues/25


1

The options are called :h 'breakindent' and :h 'breakindentopt'. For example let [&l:bri, &l:briopt] = [v:true, 'shift:'..shiftwidth()] Note that all "linebreak"-related spaces are purely virtual. They are never written into a file.


2

@dedoswdi's answer was extremely helpful! I adapted it somewhat to produce the result for each line on the buffer. My adapted script can be found in this Gist. After applying it to the original C++ code, I got the results with both cinoptions= (none of them set) and cinoptions=N-s (which triggers the odd behavior with the second struct.) Here are the ...


4

" tell which cinoption take effect for current line com! WhichCinoption call s:which_cinoption() function s:which_cinoption() abort " test if cindent take effect if !empty(&indentexpr) echo "'indentexpr' exists, it overrides 'cindent'." return endif if !&cindent echo "'cindent' is currently disabled." return endif " ...


2

This is :h cino-+. It looks like get_c_indent() (from src/cindent.c) doesn't know about template and treats it like an ordinary expression split over several lines (here namespace serves as "a function" from :h cino-+). The relevant piece of code from src/cindent.c is 2831 else if (lookfor == LOOKFOR_UNTERM) 2832 { 2833 if (cont_amount > 0) 2834 ...


3

In the absence of a complete solution, I thought I'd just write a quick answer that shows one way you can achieve the first part of your question. Try the following mapping (for F3): nnoremap <F3> :s/%>%/&\r/g<CR>V``j=gv>> How it works Splitting the line First, it breaks the line on the pipes: :s/%>%/&\r/g :s/ #...


Top 50 recent answers are included