Questions tagged [modeline]

The mode line is a feature of some text editors and source control systems. It provides useful summary or contextual information for an associated buffer or file.

Overview

The mode line is a feature of some text editors and source control systems.

It provides useful summary or contextual information for an associated buffer or file.

Vim modeline

In Vim, the modeline is an annotation at the beginning or end of a text document to configure the editor for that document

Emacs modeline

In Emacs, the modeline is shown in the window, including its name and current modes. It is located at the bottom of every Emacs Window aside from MiniBuffer windows.

Here is a screenshot that shows a windows with it's mode line (the gray bar at the bottom):

The mode-line

For complete information on the contents of mode lines, see mode line in the EmacsManual. The information in a mode line usually includes the following:

  1. Whether or not the buffer has been modified:
  • ** – modified since last save
  • -- – not modified since last save
  • %* – read-only, but modified
  • %% – read-only, not modified
  1. Buffer name.

  2. The name of one or more MajorModes or MinorModes of the buffer

  3. Line number of the TextCursor (and Point), and perhaps the column number.

  4. Position in buffer:

  • Top – the beginning of the buffer is shown in the window
  • Bot – the end of the buffer is shown in the window
  • All – all of the buffer is shown in the window
  • a percentage – percentage of the buffer above the top of the window.
  1. Coding system of the buffer.

  2. End-of-line translation.


Sources: ModeLine | Emacs Wiki

51 questions
87
votes
3 answers

Embed vim settings in file

In some files I can see a commented line, usually the last, with vim settings. Does vim read these settings? If it does, are any limitations of what kind of settings man can put there?
kfl62
  • 2,434
  • 4
  • 29
  • 40
20
votes
1 answer

How do I display the total number of lines in the Emacs modeline

The default Emacs modeline only shows the current line number and its percentage in relation to the total line numbers. How do I make it show the line total as well?
dkiyatkin
  • 614
  • 7
  • 11
10
votes
2 answers

Add button with dynamic menu to emacs's modeline?

I'm making my own minor mode for emacs. Now I want to add button to modeline. Click on this button must сause pop-up menu appear. The items of this menu depend on user's actions. I know that there is a way to add a function button to modeline with…
Bad_ptr
  • 593
  • 3
  • 15
7
votes
2 answers

How to fixate value on the right side of the modeline?

Is there a way to position a value on the the right end of the modeline? From my understanding currently the modeline "pushes" its values farther right if the values increase in size. I would prefer it if some values would start on the right side…
edt_devel
  • 523
  • 1
  • 8
  • 16
7
votes
1 answer

Emacs 24: Mode-Line Style

I am trying to change the styling of the modeline in emacs 24. I want to add an overline and an underline. Underline works fine, but overline is not working for some reason. Here is my code so far (added to .emacs): (set-face-attribute 'mode-line…
BIOS
  • 1,655
  • 5
  • 20
  • 36
6
votes
1 answer

Changing the position of modeline

Is it possible to change the position of modeline so that it appears at the top of the buffer instead of at the bottom of the main buffers? If so, how can I do it?
sawa
  • 165,429
  • 45
  • 277
  • 381
6
votes
3 answers

Vim: read modeline after opening the file?

I work on a variety of projects and many of them set file-specific vim settings. I have been asked to not have modelines set in .vimrc; is there a way after loading the file to load the modelines settings? So if I open tmp.c with vim: int main(int…
Levi Morrison
  • 19,116
  • 7
  • 65
  • 85
6
votes
2 answers

Change Emacs Mode-Line color based on major-mode

I like to see if there is a way to change the mode-link foreground and background color base on the major-mode, I was thinking to add the logic in the (add-hook 'after-change-major-mode-hook But, I do not have all the emacs lisp experience to make…
TX T
  • 817
  • 2
  • 16
  • 25
6
votes
2 answers

How does Emacs select which minor modes to list in the mode line?

I plan to customize mode line in Emacs in near future, and i don't understand the algorithm behind listing minor modes in the mode line. In section «1.3 The Mode Line» of Emacs manual it says: «MINOR is a list of some of the enabled "minor…
Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166
5
votes
1 answer

Setting fonts to parts of modeline

How can I use multiple fonts in the modeline? For example, If want it to look like Line: 23 Size: 3000 with Line and Size in a different font than the modeline font, how should (setq-default mode-line-format '( "Line: %l Size: %i" )) be…
sawa
  • 165,429
  • 45
  • 277
  • 381
4
votes
1 answer

How to get the height of the emacs mode line?

Actually, I want to generate a XPM-format image and draw it on the mode line using display attribute of a text string. However, the height of mode line turns to be different as the result of different fontset. That means I need to know the height…
winterTTr
  • 1,739
  • 1
  • 10
  • 30
4
votes
1 answer

easily display useful information in custom emacs minor mode -- mode-line woes

Background: I'm creating a minor mode that gives the user "hints" about whether the buffer they're visiting uses tabs or spaces for indentation (simply by examining the first character of each line in the buffer). Some features I plan to add include…
mgalgs
  • 15,671
  • 11
  • 61
  • 74
4
votes
2 answers

Subversion Branch in Mode-Line

If a file lies in a directory backed by a Subversion repo ending with either trunk or branches/X how do I make the trunk or X show up in the mode-line as SVN-trunk or SVN-X similar to what is shown in Git-backed files typically as Git-master.
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
4
votes
1 answer

How to add :autocmd to vim modeline?

I am trying to add :autocmd BufWrite * make to modeline in vim, but it is not triggered. I see that the help says only set can be used in modelines. Is there a way to achieve this effect, where I write a file to run make.
shoban
  • 650
  • 1
  • 9
  • 14
3
votes
2 answers

How can I hide all major / minor modes from the mode line without a package?

After coming from Spacemacs where the performance was a bit slow, I'm rebuilding my config from scratch atm with a focus on performance and was wondering, how can I hide all major and minor modes from the modeline without installing additional…
irregular
  • 1,437
  • 3
  • 20
  • 39
1
2 3 4