Questions tagged [textwidth]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
135 views

Justify text with leading whitespace

To justify text on vim I use :set textwidth=77 and space+v to select and finally gq to justify the text. This is the result original: Most of the command-line options that you can use with GCC are ...
elbarna's user avatar
  • 179
1 vote
0 answers
72 views

textwidth not working on certain lines

I have textwidth set to 80. Result of :set tw? is textwidth=80. It works for most lines, but some lines are left with a width of 81 and sometimes 82, even after visually selecting and doing gq. This ...
MPA95's user avatar
  • 111
1 vote
2 answers
120 views

How to soft wrap text at column number lower than window width?

I developed prompter.vim, a vim plugin that autocomplete buffer text using LLMs completions. The completion is a multi-line text insertion appended at the end to the buffer. I would like to have ...
Giorgio Robino's user avatar
2 votes
2 answers
167 views

Command to set the window width

Using MacVim, I can manually drag the edge of the window (watching the numbers in the title bar) to whatever width I want. Is there a command that will just immediately set it to a desired width? I ...
RadlyEel's user avatar
  • 141
1 vote
1 answer
55 views

What is changing the textwidth on rust files?

This seems like a bizarre behavior to me. I've set the textwidth to 88, but I've noticed that, when editing a .rs file, something sets it to 99. At first I though it must be some plugin or formatting ...
videbar's user avatar
  • 13
1 vote
2 answers
260 views

How to format text with gq by cutting long lines but without joining shorter lines?

I don't understand what shall I set (I guess fo, but how?) for cutting lines that are longer than textwidth but without joining lines that are shorter. For example, assume that I have textwidth option ...
Barzi2001's user avatar
  • 536
0 votes
0 answers
54 views

UltiSnips Latex snippet does not work correctly when wrapped around due to textwidth setting

Given snippet: snippet mm "Inline Math" wA \\( $1 \\) $0 endsnippet which inserts inline math mode in LaTeX: \( | \) where cursor position is | and following .vimrc: "-------------Load ...
Tryer's user avatar
  • 247
2 votes
1 answer
57 views

How can make every line contain 80 characters when to insert lorem ipsum string?

set textwidth=80 in my .vimrc. I have written a function to create a lorem ipsum: function! Lorem(num) python3 << EOF import random num = int(vim.eval("a:num")) words = ['...
newview's user avatar
  • 291
0 votes
1 answer
156 views

How did gggqG format the file?

I have set textwidth in .vimrc: set tw=80 Format the sample file with gggqG: test ======================= :: words_en = ['exercitationem', 'perferendis', 'perspiciatis', 'laborum', 'eveniet', ...
newview's user avatar
  • 291
0 votes
0 answers
526 views

Text width not working in markdown files?

I use vim pencil which has a setting called vim.opt.textwidth = 80. I also have this in my init.vim (neovim): let g:pencil#textwidth = 80 But when I am writing in markdown files, the text takes up the ...
Vinn's user avatar
  • 731
1 vote
1 answer
42 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, ...
user90726's user avatar
  • 123
3 votes
1 answer
192 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 ·: ···/...
ELLIOTTCABLE's user avatar
3 votes
1 answer
195 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 ...
chaffdog's user avatar
  • 131
1 vote
0 answers
262 views

gvim vs. xterm: what's wrong with my guifont?

The 10x20 is the (alias for) font I use with xterm -- and I like it. Both for shell-commands and vi/vim. Yet, when I use the :set guifont=10x20, I get "w i d e l y" spaced characters for ...
Mikhail T.'s user avatar
0 votes
1 answer
342 views

Setting `colorcolumn` to the value of `textwidth` has no effect?

I want to mark the textwidthth column using colorcolumn and have used the following (since I have slightly different textwidths for different files) au FileType py set textwidth=80 (say line 98) au ...
First User's user avatar