Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Property research: maximum line length

chemodax edited this pageDec 31, 2023 ·22 revisions

This page includes research for two options discussed in issue#89.

Option for displaying a vertical rules

A new option will force editors to show a vertical rules at certain column(s).

Option for setting a maximum length for each line

Amax_line_length option (or similarly named option) will force either hard or soft line wrapping after the amount of characters specified.

Behavior

  1. The editor should display vertical rulers at the given rulers columns.
  2. When typing, the editor automatically wraps the current word to a new line if it reaches the given limit.

Naming ideas

For the first item:

  • rulers
  • line_width

For the second item:

  • text_width
  • line_width
  • wrap_width
  • max_line_length
  • right_margin

Concerns

  • How should line length be set when tabs are used?
  • Should line be wrapped immediately once length is hit or once line is left/Enter is pressed?
  • Should this be disable-able by the user in case they want to control this manually?

Support in Editors

Sublime Text 2

The setting iswrap_width.

Therulers setting allows you to provide an array of column numbers at which a vertical ruler will be displayed.

Vim

The setting istextwidth.

Maximum width of text that is being inserted.  A longer line will bebroken after white space to get this width.  A zero value disablesthis. 'textwidth' is set to 0 when the 'paste' option is set.  When'textwidth' is zero, 'wrapmargin' may be used. See also'formatoptions' and ins-textwidth.When 'formatexpr' is set it will be used to break the line.NOTE: This option is set to 0 when 'compatible' is set.

The settingcolorcolumn just displays a vertical line but doesn't enforce the width.

'colorcolumn' is a comma separated list of screen columns that arehighlighted with ColorColumn hl-ColorColumn.  Useful to aligntext.  Will make screen redrawing slower.The screen column can be an absolute number, or a number preceded with'+' or '-', which is added to or subtracted from 'textwidth'.

Emacs

  • Variablefill-column: "Column beyond which automatic line-wrapping should happen."
  • Used byM-x fill-paragraph andauto-fill-mode among others.
  • Theauto-fill-mode minor mode wraps long lines automatically when the user types a newline. It's possible for a script to enableauto-fill-mode on the user's behalf, but IIRC this is frowned upon in the Emacs community.
  • Although not included in Emacs itself, there is also thefill-column-indicator package in ELPA and Debian.

Geany

  • Document, Line Breaking: enables line breaking at boundary.
  • Edit, Preferences, Editor, Features, Line breaking column: sets where the boundary is
  • Edit, Preferences, Editor, Display, Column: sets at what column a vertical line indicator should be

Notepad++

Not possible. Can be manually done by TextFX plugin to rewrap selected text. (TextFX ->TextFX Edit ->ReWrap Text to (72 or clipboard) width )

Notepad++ has a setting to display (multiple) "rulers" i.e. visual indicator(s) by means of a colored line. SeeSettings >Preferences... >Margins/Border/Edge >Vertical Edge Settings:Add your column marker by indicating its position with a decimal number. You can define several column markers by using white space to separate the different numbers.

Gedit

Has a "Display right margin at column:" preference to display what width we want the text to be. It doesn't support a mode to enforce that width though. Maybe trough plugins.

jEdit

SetmaxLineLen to the line max width, andwrap tohard for real line break. See these buffer local propertieshere.

Code::Blocks

Not possible.

Settings, Editor, Margins and caret, right margin hint: visible line & hint column

TextMate

TODO

Visual Studio

EditorConfig Guidelinesextension adds support forguidelines .editorconfig property.

Visual Studio Code

Set a value (e.g., 100) in "editor.rulers": [ 100 ]

The wiki is disabled from public edits due to spams. If you would like to request a change in wiki, please open anew discussion.

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp