folding

PHP text formating: Detecting several symbols in a row

I have a kind of strange thing that I really nead for my text formating. Don't ask me please why I did this strange thing! ;-) So, my PHP script replaces all line foldings "\n" with one of the speacial symbol like "|". When I insert text data to database, the PHP script replaces all line foldings with the symbol "|" and when the script ...

PHP: Ajax ignores line foldings in the text

I don't understand why my AJAX script ignores all line foldings. I first type text to the textarea and then put onclick to send button. Here is my AJAX realization: // creating ajax object // ==================== function createRequestObject(){ try { return new XMLHttpRequest() } catch(e) { try { return new ActiveXObject('Msxml2.XMLHTT...

How-to handle errors in Vim Script ?

In my .vimrc file, I have the following function, which folds the licensing information on the top of some .hpp and .cpp files: " Skip license function! FoldLicense() if !exists("b:foldedLicense") let b:foldedLicense = 1 1;/\*\//fold endif endfunction au BufRead *.hpp call FoldLicense() au BufRead *.cpp call Fo...

foldmethod=indent gets confused

Normally a great boon to humanity, on occasion vim's indent-based folding will get confused and need a reset via :set foldmethod=indent. Symptoms include the appearance of consecutive folded lines in the window. Is there a way to avoid having this happen? Is it just me? update Although I'm pretty sure at this point that I've ID'd a ...

auto-fold Oracle inline views in Vim using .vimrc

I've seen magical Vim commands before that you could add to your .vimrc to have folds created upon opening a particular type of file. I remember having such code that would create the folds, upon opening the file, at every Ruby method and class. Then, with one command, I could collapse all those method folds. Does anyone know how to d...

Implicit Folding in TEXTAREA with Javascript

Hi there, I'd like to be able to create a type of folding in xhtml textareas using Javascript/jQuery. For example, given the following text: ABC [123] DEF I'd like to have [123] reduce to [] when the cursor is not over it - i.e. for a cursor |: ABC [] DEF| AB|C [] DEF ABC [|123] DEF ABC [12|3] DEF I want the content within the br...

Custom folding for CSS in Vim

I came upon this custom folding for CSS in Vim and inspired by it I was trying to make my own with slightly different result in mind. I had to give up as I couldn't make search patterns work in folding function. No surprise to me as I'm rather a Vim beginner :) Any help to achieve the following will be much appreciated. I use empty li...

How can I fold YAML items in VIM?

I have a YAML formatted text file, and would like to define custom folding for VIM, but I'm not sure how to go about it (despite reading the VIM documentation for folding). The file consists of YAML "documents", like so: --- title: My Title attr1: value1 attr2: value2 --- title: Next Item attr1: value3 --- title: One More Item ... I ...

Enable folding in long header fields in email messages(RFC 5322)

I have a C# web app that sends out mails but I ran into an issue with email subject lengths. In Outlook and Firebird a tab is inserted at about every 78 characters. After googling this is what I found:"Each header field is logically a single line of characters comprising the field name, the colon, and the field body. For convenience howe...

vim folding messes up syntax highlighting

I'm using vim for LaTeX and I'm using latex-suite. It gives me nice syntax highlighting and folding, but in large files syntax highlighting gets "confused". If I open all folds, the syntax highlighting turns OK. I would like it to "just work" all the time though. I seem to recall an option that would increase the number of lines that is...

Exporting Vim folds?

How can I export vim folds from a file, so that I can transfer it to a different machine? For example say I create the folds in a file and save it on a local machine - where does the "folding" metadata go? Can I just copy it to another machine, or must I manually recreate the folds again? EDIT: Hm, I've noticed this might be a duplicat...

Feature request for a text-editor with support for literate programming

This is a feature request for the writers of Visual Studio and any other programmer's editor. Consider a literate program as follows: /* File Name: LiterateProgram.h */ // \begin{comment} #pragma once #include "myHeader.h" /* \end{comment} %\bigskip \begin{lstlisting} % */ class CSomeClass : public CSomeBase { public: float som...

How to fold all occurrences of a regex in vim?

A colleague of mine is using a horrible source code editor that leaves strange comments all over the code. In Visual Studio, I created a macro, that simply folds all those comment blocks so I don't have to see them. Now I would like to do the very same thing in vim. This regex matches every one of those blocks: /^.*\/\* EasyCODE.*\(\(...

Vim: how to highlite folds with cursorline?

Is there a possibility to highlite current line with cursorline over folding highlite? ...

notepad++ user defined regions with folding

I can't figure out how to configure notepad++ to display regions for specific user defined keywords. I have i big trace file which show the start and the end of a procedure. The trace file looks like this: Beginn abc.def; ... Beginn ghi.jkl; ... Ende ghi.jkl; ... Ende abc.def; I would like to fold those regions like th...

How to collapse concealed text ?

The problem is as follows : 1) This is about a plain .txt file 2) I have enabled the conceal feature and created this syntax file : set conceallevel=3 syn region cTest conceal start='€£' end='£€' hi cTest ctermfg=DarkYellow 3) I write first a summary/skeleton of what I want to say, and put it in between €£ and £€. Then, in the same...

Vim folding on syntax for R

I'm working with vim on my linux machine and need code folding to work for R. I have the Vim-R-plusing2 installed to enable passing code from vim into an R session, but the folding does not work when foldmethod=syntax. How do I get folding for R working? ...

Vim trifling question : different colors for folds and subfolds

Is it possible to have different set of colors for folds and subfolds, eg : blue fg on grey bg for fold level 1 (default) black fg on darkyellow bg for fold level 2 etc... (although going further down would seem a bit excessive) Thanks ThG ...