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.

Filter by
Sorted by
Tagged with
1
vote
1answer
33 views

Why `textwidth` gives me the same effect as `linebreak`?

Could anybody explain, why textwidth works gives me the same effect as linebreak? Example 1. If I type aaaaaaaaaaaaaaaaaaa several times, the last aaa... is wrapped to the next line. linebreak is off, ...
2
votes
1answer
36 views

Reformatting comments with gq, using spaces in 'comments'

I'm using Prettier to automatically reformat JavaScript (well, TypeScript, but same deal in this situation) source-code. It enforces a comment-style like this, with leading spaces replaced with ·: ···/...
0
votes
1answer
28 views

Is there a soft/visual textwrap equivalent option? [duplicate]

I like textwidth, except that it inserts EOL characters, and that breaks what I consider to be a sentence. I'd like to go back to having a long sentence be a long sentence, but I want it visually ...
3
votes
1answer
50 views

LaTeX: turn off text wrap and auto indent in maths environments

I use vim with vim-latex for editing latex files. I always have hard wrapping enabled using set tw=80. I also have the default vim-latex auto indent settings enabled. I wonder if there is a way to ...
0
votes
0answers
32 views

How do you get Vim/Neovim to stop hard wrapping comments?

I thought that with formatoptions-=c, vim wont automatically format comments, but for some reason with setlocal formatoptions=ant and textwidth=80, neovim is still hard wrapping markdown comments (<...
2
votes
1answer
143 views

In nowrap mode, is it possible to add a ">" sign to signal there's text rightward that hasn't been displayed?

So currently I'm disabling wrap in my vim, but I remember in vim when wrap is disabled and the line is too long to display, it would add a ">" at the end of the line so you know the line ...
0
votes
1answer
20 views

Hard-wrap multiple lines without selecting them?

To hard-wrap a single line, we can use gqq, and to hard-wrap multiple lines, we can select them in visual mode and then use the same gqq command. However, I suppose that there is probably a smarter ...
0
votes
1answer
27 views

nowrap option on a file opened in split window

I use set nowrap option in my config file, but when I open a file in a vertical split it has no effect. If I redo set nowrap after open the file (in the split windows) it takes effect Why? I try with ...
2
votes
1answer
42 views

Showing showbreak character at the end of the line that is wrapping

Is there a way to show showbreak character at the end of the line that is wrapping, not at the beginning of the next one? 1. Lorem ipsum dolor sit amet, consectetur \ adipiscing elit, sed do ...
2
votes
1answer
82 views

How to soft wrap at column number greater than window width?

Imagine a 30-character line shown in a 20-character wide window. How can I soft wrap it at the 25th column? With :set nowrap |01234567890123456789|0123456789 | window | After scrolling ...
3
votes
1answer
92 views

How do I show a special symbol at the beginning of show lines (which are in the middle of logical lines) when wrap is on?

The screenshot of vim-gitgutter clearly shows its author uses some kind of continuation line character when wrap is on. How do I get that? I thought I could find it listed in :help 'listchars', but it'...
1
vote
1answer
44 views

Using cindent and/or `gq` to wrap long function arguments to one-per-line

When a line becomes too long, I would like to wrap the function call with a "one argument per line" syntax: For the example: :set textwidth=50. Given: long_function_name(argument_one, ...
1
vote
1answer
50 views

How to have l and h at the boundary of the window shift only one column, when wrap is off?

How can I have h and l move the viewport only by one column when they go beyond the left and right borders when nowrap is active?
0
votes
1answer
109 views

Vim keeps auto wrapping lines when in insert mode, how can we change this?

I'm not sure why this started to happen but recently vim seems to have begun autowrapping lines when in insert mode. It's pretty annoying. I use the following modules 'vim-ruby/vim-ruby' 'rodjek/vim-...
1
vote
0answers
40 views

How to make Vim not be a line editor

Vim is famously (or infamously) a child of line-based editing. For many cases this is acceptable. But I wish to use it primarily as an academic tool with large amounts of text. I want the experience ...
5
votes
4answers
615 views

Join all non-blank lines

When editing markdown and other text files, I like to use textwidth/wrapmargin to insert line breaks at fixed intervals. (The advantage of this is that each visual line is a Vim "line" - ...
3
votes
1answer
147 views

Only wrap line when it becomes greater than 80 characters after previously being below 80

set tw=80 wraps lines after they reach 80 characters. Sometimes when I'm coding, writing notes, etc, I want some--but not all---lines to be longer than 80, so after it wraps, I join the line back with ...
0
votes
1answer
46 views

have text longer than a vim windows displayed on several lines

I'm trying to have text longer than a vim windows displayed on several lines. For this, I tried to follow the advice of this blog by entering set wrap in the .vimrc file but nothing changes and the ...
0
votes
0answers
18 views

Wrap specific lines in buffer

is it possible to set nowrap to a line range in the active buffer and set wrap to everything else? I edit LaTeX files. I want to see everything after \begin{document}. but only see the general ...
6
votes
1answer
474 views

prevent line wrap in terminal buffer

I can easily see the output of a command in a split using vim's terminal For example, I use :vertical terminal make re a lot. This example is also stated in the help (h :terminal): Or to run build ...
0
votes
0answers
21 views

display visual lastline instead of whole line with 'wrap' on [duplicate]

With set wrap, is there any way to not show the whole logical line when scrolling after the last line or before the first with gj and gk, but only the visual line? The goal is to prevent jerky ...
1
vote
0answers
22 views

Navigating wrapped paragraph as multiple lines [duplicate]

Vim wraps text around as most other text editors, but does not allow the same kind of navigation within wrapped lines. Take for instance a piece of text composed of several long paragraphs. If the ...
2
votes
1answer
127 views

How can I wrap text from the indentation level rather than the beginning of the line

This is better shown than explained. The first image shows how line wrapping works in VScode, and the second in vim. In VScode the wrapped line continues at the indentation level of the line, rather ...
2
votes
1answer
65 views

gw text wrapping for LaTeX

Is there an easy way to wrap LaTeX source? Using gwip is great for individual paragraphs, Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore ...
3
votes
0answers
123 views

Treating lines wrapped with `linebreak` as separate lines

I know the linebreak option can be used to soft-wrap lines within vim (without inserting any newlines into the file being edited). However, I often need to navigate over long lines that have been ...
2
votes
1answer
200 views

Keeping indent (like breakindent) when using hard wrap with textwidth

I know the breakindent option works with linebreak to preserve indent on wrapped lines. However, when I want to hard wrap lines (using the textwidth option so <EOL> is inserted when a line ...
3
votes
1answer
679 views

How to navigate long lines like separate lines?

When I have a very long line in vim it will be shown on the screen as multiple lines, like this: line no. | content | 100 | this is a very ...
1
vote
0answers
24 views

Wrap matches shown by You Complete Me

Is it possible to wrap the matches shown by YCM ? My current workaround is to decrease font size till I am able to see it and then increase font size. This is tedious and painful. Is there any other ...
2
votes
1answer
591 views

How to wrap lines on hotkey but not automatically?

A bit of context: I'm trying to use NeoVim after Spacemacs. In Spacemacs, there is gql key combination that hard wraps current long line of text into multiple short lines. It is useful if I want to ...
0
votes
1answer
71 views

Is it possible to disable the "nowrap" option on pymode?

I installed pymode plugin but it overrides my default setting (set wrap). According to :verbose set wrap?, the option is set by pymode. However, I'm not sure if it is possible to override the setting....
3
votes
1answer
737 views

Show / hide horizontal scrollbar depending on "wrap" option

I'm trying to show / hide horizontal scrollbar conditionally, depending on wrap option: with wrap - show horizontal scrollbar with nowrap - hide Here is what I tried, but for some reason it doesn't ...
1
vote
2answers
4k views

Automatic wraping to new line?

Instead of wrapping lines visually, I want vim to wrap with a linebreak regardless of my the window dimensions. How can I set this automatically
1
vote
1answer
216 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
55 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
83 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 ...
4
votes
1answer
293 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
28 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 ...
3
votes
0answers
65 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
159 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
216 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
303 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
1answer
822 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
3k 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
186 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 ...
11
votes
2answers
3k 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 ...
3
votes
0answers
146 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
46 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
178 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 ...
2
votes
0answers
217 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
213 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?