Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wrapping]

Vim is able to wrap lines when they are longer than the width of the window or than a user-defined width. Questions about how to customize this behavior.

0
votes
0answers
20 views

Modeline setting of textwidth overridden

In my .vimrc I have the following line autocmd FileType markdown setlocal textwidth=78 which is what I want to be the case generally but I have a certain Markdown with the modeline <!-- vim:set ...
0
votes
1answer
24 views

xml ftplugin overrides textwidth

I would like to hard wrap XML files during editing. In every other filetype my set textwidth=80 works fine. But in XML something overrides the insertion of line breaks. I tried adding t to ...
2
votes
0answers
25 views

Extending the true line width to enable screen readers to see what blind users cannot

Vim is outstanding. It holds a lot of potential for blind users. I still have one out-of-the-box problem when using vim with screen readers (tested with both NVDA and System Access). But that surely ...
0
votes
1answer
48 views

Is there anyway to let cursorline take care of the visual tabs generated by 'breakindent'?

now the cursorline leaves a hideous gap between the number column and the wrapped text, is there any way or trick to make the cursorline take care of the whole part of the wrapped line including the ...
3
votes
1answer
83 views

Using `gq` to correctly wrap function arguments

Consider editing the code foo = long_function_name(var_one, var_two, var_three, var_four) where the textwidth 'column' occurs just after var_two. I would like to be able to press gqq on the line ...
1
vote
0answers
25 views

Do not wrap certain environments [duplicate]

I am using neovim. When editing a .tex file I don't want to wrap the lines within certain environments like equation or align and some others. \begin{equation} % very long line I don't want to ...
4
votes
0answers
47 views

Syntax-aware line wrapping

Is there a way to make the automatic line wrapping of vim aware of the syntax of the file instead of just wrapping at the closest whitespace? I am specifically interested in Python but I guess it ...
1
vote
1answer
71 views

formatoptions for hybrid (short markup + long paragraphs) content

I am trying to write my PhD thesis in vim using LaTeX So the documents will have two distinct types of content - markups that are relatively short, and paragraph text that is rather long. \begin{...
0
votes
1answer
43 views

How can I soft-wrap a word to a new line?

Using textwidth (tw=74) a word will be moved to the next line (with an indent usually) with a newline character at the end of the line avoiding over-length. This is a hard wrap, and resizing the ...
4
votes
1answer
143 views

How do I wrap the location-list by default (without turning on wrap for files)?

I think this should be a quick answer, but I can't figure it out from :help location-list and my Google searches seem to highlight that I may not know the correct terms to look for. For the sake of ...
2
votes
0answers
196 views

The indent of wrapped lines

My vimrc about wrap is set like this: set wrap "Wrap lines set breakindent " indent after line wrapped But the wrapped lines are not equal in length, such as: line 1: some contents ..... <end&...
2
votes
1answer
204 views

What is the standard way of creating new Vim Commands?

I was recently going through a tutorial on configuring the Vimrc file to make it behave more like traditional text editors. In that tutorial, I came across the following line: command! -nargs=* Wrap ...
3
votes
1answer
73 views

Break line even if it fits the screen

I think everyone knows that vim can't display multiline messages in quickfix (yes, I know that it can parse them and show them as one big line). I thought about ways to workaround this and thought ...
4
votes
2answers
462 views

Configure which column `gq` wraps at?

By default, using gq with a movement command hard-wraps the text described by the movement command to 79 columns. (I'm relatively new to vi/vim so I don't know the correct terminology.) How can I ...
0
votes
0answers
33 views

How to make `:set wrap linebreak` work for splits that are *not* in focus

I have two files open in vertical splits. Each one is set to "wrap" and "linebreak" and it works fine for the split that's in focus, but only for that split. The non-focused split will not wrap ...
2
votes
0answers
86 views

Prevent Vim from breaking up inline code blocks in (r)markdown

I edit R-markdown files a lot, and this entails writing inline code blocks, such as `r sum(mylongvectorname)` I usually have my text hard-wrapped at 80 chars, and this causes problems for the ...
1
vote
0answers
37 views

How do I reformat a paragraph using a different value for textwidth than the default one?

Sometimes I want to reformat a paragraph using gq but with a different value than the one set in my configuration for this filetype. Since this happens only occasionally within a buffer of such type (...
2
votes
1answer
62 views

Delete wrapped lines?

How to delete wrapped lines? I imagined something like gdd and gD but they did not work as expected, in a similar fashion to gj and gk to move through wrapped lines. It would be really useful to ...
3
votes
0answers
102 views

Possible to exclude comments from textwidth?

I recently discovered the textwidth setting, which lets me configure vim to insert a "smart" whitespace-delimited carriage return as I'm typing when my line of text exceeds my specified limit. Is ...
1
vote
2answers
120 views

Full width Vim help text

Is it possible to view the help in Vim at a text width greater than 77 characters? Can Vim reflow the help text?
0
votes
0answers
19 views

How can I show all of a long line, even if it wraps off the bottom of the screen? [duplicate]

If I have a really long line, vim truncates it with set nowrap. If I set wrap, I can see all of the text, unless (after wrapping) it is too long to show all of it on the screen. For example, if the ...
0
votes
1answer
111 views

Visual indication that lines have been truncated

I recently went through and cleaned up my vimrc. In so doing, I inadvertently removed some code or a plugin that inserted a bluish > character at the end of lines that were truncated because they ...
0
votes
1answer
453 views

How to break long line of xml files only on display not in the actual code [closed]

I have an xml file with some text which is so long, that it does not fit into the normal line of my editor. Is there an xml-specific way to insert a newline just for formatting, i.e. ignored by a ...
8
votes
0answers
325 views

Is there a setting to force a hanging indent on bulleted/numbered lists WITHOUT hard wrapping?

Basically, I'd like to have long entries for bulleted / numbered lists that automatically indent like so: 1. Congress shall make no law respecting an establishment of religion, or prohibiting the ...
2
votes
1answer
320 views

How to go to the end of the line even in on a wrapped line?

I would like to map <End> and <Home> to go to the end or beginning of the current line (not the screen), even if the cursor is on a wrapped line: |1 First line. | |2 This is some ...
4
votes
0answers
565 views

What is the best practice in vim8 for wrapping with indentation aka breakindent

To have proper paragraph wrapping with indentation in vim (after vim7.4) we could use this: " Wrap the text with identation isntead of the old way set breakindent set showbreak=\ \\_ Since vim8 ...
4
votes
2answers
71 views

Permission dependent behavior

I would like to set some options for all things I will read but not modify. That is special settings for read-only files (and files in vim view mode). Particularly I'm interested in setlocal wrap ...
4
votes
1answer
80 views

Go to the last wrapped line with G

In Vim pressing G takes you to the last physical line. But, if the last line is wrapped around G puts the cursor on the first wrapped line in that last line, not the last wrapped line. So, is there ...
6
votes
2answers
513 views

soft linewrap width

When wrapping text in GVim, the wrap occurs at the right side of the GVim window. I would prefer to have it wrap at column 80 however. A solution I have found is to :set columns=80, but this shrinks ...
1
vote
1answer
70 views

wrap breaks when using delete or change word type commands

Using these options set wrap linebreak nolist set showbreak=~ "adds specified character after wrap set breakindent "forces word wrap to start at last lines indentation level set display=lastline "...
6
votes
3answers
594 views

Vim wrap only current line

I've enabled set nowrap since I find that line wrapping makes it harder for me to quickly scan a document. It's also annoying having to scroll right to see the entire line that I am working on. I'm ...
3
votes
1answer
75 views

automatic text wrapping messed up with parenthesis

I like to wrap my text to 80 characters all the time, even when I am editing Markdown. I have a problem when I open parentheses: it doesn't wrap right anymore. Since it is hard for me to explain it, ...
4
votes
1answer
55 views

exclude a line from wrap

I often use the sequence gqap to hard wrap the current paragraph. However I'd like some line to be excluded from the process. Example Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ...
0
votes
2answers
308 views

How to remove line breaks in xml tags?

I often have to write XML where text-width has been manually set by another editor: <context> <p>Here is a paragraph about some stuff that happened and someone did a nice ...
2
votes
1answer
188 views

How to disable extends/precedes charaters in nowrap

I want to view a big blob of text (ascii-graphics), but when I use :set nowrap some < and > symbols appears at the left and right borders of the buffer window. They are kinda annoying and I ...
6
votes
1answer
79 views

Autoformatting LaTeX: how to add characters in front of a wrapped line

When writing LaTeX, I like a newline between every sentence as it helps me jump around more easily. Additionally, I put two spaces at the start of lines where sentences don't start. For example: This ...
3
votes
1answer
270 views

How can I force a page break in MacVim's printed output?

I've discovered the :hardcopy command, which is the equivalent of the Command-P command in MacVim. I've also found that it accepts ranges. For instance, in my markdown file, I can split the sections ...
5
votes
2answers
843 views

How can I make vim's flowing aware of email replies?

Problem summary I use vim to edit emails that I send with mutt. I also use format=flowed, which "reflows" text. That is, lines are limited to a fixed number of characters, and a "soft wrap" is ...
6
votes
0answers
35 views

Expand strings into multiline strings on line wrap [duplicate]

This is a feature in Eclipse that I would love to find a solution for in Vim. I have Vim set up with tw=80 so that the lines wrap at 80 columns. When I'm in the middle of a string, and the line ...
5
votes
2answers
374 views

How do I make Vim respect Markdown headers when formating text?

I want to use the combination gggqG to go to the top of the file and format the whole file from there, so that it fits into my 80 col textwidth border. But when I do, vim ignores my markdown headers. ...
4
votes
0answers
123 views

Set line breaks, word wraps and word searching for Thai and other non-latin languages

I can set the text width and can manually line break imported paragraphs with the following as an example. set textwidth=72 gqq I can also navigate English text files with the standard 'w' 'b' 'e' '*...
1
vote
1answer
312 views

Autocomplete popup menu with autoindent and hard wrap in insert mode

I have set autoindent and set tw=90 and set fo=t. Additionally I have working autocompletion that means when I type one character a popup menu come in. Because of popup menu in some situations, where ...
4
votes
1answer
80 views

Hard wrapping a range to textwidth with an ex command

Also asking how to apply an ex range to a normal command. In a file of some 125k lines with a preamble followed by 8 columns of 10 character wide text, the contents of the column are 8 characters of ...
4
votes
2answers
106 views

Apply formating with a script, or have ftplugin format particular text based on syntax

When I am writting a Latex document I generally like to keep an 80 column line width to keep things easy to read. However I don't like to use text wrapping because it can get in the way of typing ...
2
votes
0answers
70 views

Dividing long paragraphs across pages

By default, vim will not split long paragraphs (or any paragraphs (= long lines)) across pages. Instead of showing the first part of a paragraph that does not fit into the page entirely, it leaves out ...
0
votes
2answers
67 views

How can I soft wrap the gundo preview?

As the title. Basically I want to apply set linebreak to the gundo window.
2
votes
4answers
521 views

Is there a vimscript function to wrap text

Is there a vimscript function that wraps text in a similar manner like gqgq does? For example, if I have the following string variable: let txt = 'One foo, two bars and three bazes went up the hill' ...
4
votes
2answers
359 views

Relative Numbers sidepanel with wrapped lines

I love the relative numbers side-column in vim but when I have wrapped lines it becomes inaccurate (or less usable since I can't use that number directly in a j/k command). I have nnoremap j gj in my ...
8
votes
1answer
85 views

change meaning of “paragraph” for TeX input?

I'm writing LaTeX code which has a lot of sections like this \begin{definition} blah blah blah ... ... \end{definition} In normal text, I'm very fond of gq] to rewrap everything nicely. Inside a ...
3
votes
0answers
158 views

Why does the vim-jedi popup have weird line wrapping?

When I'm nearing the right-hand side of my vim window, the vim-jedi's pop has some weird line-wrapping behavior: Is this normal behavior? How can I get the popup window to be shifted leftwards and ...