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
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 ...
2
votes
1answer
37 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 ·: ···/...
2
votes
1answer
825 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&...
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, ...
7
votes
1answer
1k 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 ...
3
votes
1answer
51 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
33 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 ...
2
votes
1answer
43 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 ...
0
votes
1answer
28 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
84 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 ...
13
votes
2answers
895 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 ...
3
votes
1answer
95 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
47 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
110 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-...
37
votes
4answers
17k views

How can I easily create and maintain tables?

Here is (part of) a table I use in some documentation: +---------------+------------------------+---------------------------------------+ | TASK NAME | WHEN | DESCRIPTION ...
43
votes
6answers
18k views

Can I justify text in Vim?

The only reason why I'd ever edit a text file in Pico or Nano, and not in Vim was its "Justify" command ^J. It would reformat a paragraph of text, creating line breaks at word breaks so that the text ...
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 ...
1
vote
1answer
218 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 ...
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
5
votes
4answers
626 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
148 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 ...
6
votes
1answer
484 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
19 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 ...
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
133 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
125 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
207 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 ...
0
votes
1answer
72 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
693 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 ...
3
votes
1answer
614 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 ...
3
votes
1answer
741 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 ...
2
votes
0answers
57 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 ...
4
votes
2answers
99 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 ...
0
votes
1answer
84 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 ...
6
votes
2answers
830 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 ...
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 ...
4
votes
1answer
294 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
29 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 ...
1
vote
1answer
162 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
217 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
304 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 ...
6
votes
1answer
117 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 ...
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 ...