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
3
votes
2 answers

Emacs mode-line highlight during macro definition

Is there as simple way to have a clear indicator when I'm defining a keyboard macro (kmacro-start-macro-or-insert-counter), e.g. by changing the mode-line background or something similar? The "Def" indicator is hard to parse out and sometimes not…
user673592
  • 2,090
  • 1
  • 22
  • 37
3
votes
1 answer

Truncation in Emacs Powerline (mode line)

Is there a way to get some elements truncated in the (excellent) Emacs Powerline? I'm thinking, in particular, at the which-func-mode section in the default mode line. It'd be good to see only the first N characters of a function name or section…
user3341592
  • 1,419
  • 1
  • 17
  • 36
3
votes
2 answers

Is it possible to add keyword in a vim modeline

For example, my file looks like: #! /bin/bash verbose() { [ "$VERBOSE_FLAG" == 'yes' ] && { [ $# == 0 ] || echo $@ return 0 } || return 1 } verbose display in verbose mode # make verbose highlight as a keyword # vim:…
wener
  • 7,191
  • 6
  • 54
  • 78
3
votes
2 answers

How to make multi-line mode line in Emacs 23?

I am using Emacs 23. This comes with OS and I can not change it for some reasons. Few files I open have long pathnames which are eating all the space and I can not see enabled modes or current line/column. Is there any way to make the mode line…
Jagadeesh N M
  • 625
  • 1
  • 5
  • 9
3
votes
2 answers

Notify out-of-date buffers in the mode-line

Sometimes I use an alternative method (usually sed) to edit a file that's already being edited by Emacs. Later, if I try to edit the file in Emacs without reverting the changes first, I get an error message and a prompt asking me what to do. That's…
Malabarba
  • 4,473
  • 2
  • 30
  • 49
3
votes
3 answers

Vim equivalent of emacs major-mode tag

I'm still very new to vim but I've noticed that files with -*- mode: {lang} -*- as the first or second line turn on the syntax highlighting for that language. It's tough searching for -*- when Google ignores punctuation but after a couple hours, I…
Rob Tomson
  • 33
  • 2
2
votes
1 answer

Is it possible to have a complicated Emacs command as modeline?

I have used the Emacs modeline for a while in my sources, to use tabs instead of spaces. For example, /* -*- indent-tabs-mode: t -*- */ For many uses (C++) this is not enough as Emacs insists in using tabulation for alignment. (See here: Modeline…
alfC
  • 14,261
  • 4
  • 67
  • 118
2
votes
2 answers

How do I turn on vim syntax highlighting via modeline?

In my .vimrc file I have syntax off Suppose I want to turn on syntax highlighting on a case-by-case basis via vim's modeline? I've tried many combinations, like: # vim: syntax on: but I still can't get it to work. What do I need to do in the…
blippy
  • 1,490
  • 1
  • 13
  • 22
2
votes
2 answers

Vim bash syntax highlighting with modeline

According to much online documentation (e.g.), I should be able to enable bash syntax highlighting via modelines by adding a line like: # vim:let g:is_bash=1:set filetype=sh: And in .vimrc: filetype plugin indent on syntax on set modeline set…
Alex Harvey
  • 14,494
  • 5
  • 61
  • 97
2
votes
2 answers

Minor Mode Mode-Line Menu

How do I make the entry in the mode-line popup a minor mode menu when clicked? For reference see this discussion https://github.com/flycheck/flycheck/issues/365#issuecomment-38386558
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
2
votes
1 answer

How to display compilation status in modified mode-line?

I modified my mode-line to appear cleaner. Sadly this prevents compilation buffers from displaying their exit status. Normaly a failed compilation would display something like: (Compilation:exit [1]) Through my modifications the the compilation…
edt_devel
  • 523
  • 1
  • 8
  • 16
2
votes
1 answer

What information does the bottom bar in emacs convey?

I've started using emacs recently and am liking it. I've noticed that it always has this bottom area displaying some information about the buffer I have open. A normal appearence might be: --:--- bufferName All L3…
user1854496
  • 622
  • 1
  • 8
  • 22
2
votes
1 answer

Find from elisp if Emacs buffer is modified

I'm customizing mode line and i want to put a string "Unsaved" on it, if the file is modified. How to find out directly from elisp, whether the current buffer in Emacs is modified?
Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166
1
vote
1 answer

Emacs - Mode Line Update

I customized my mode-line on my laptop (emacs 23.3) and it works perfect. But when I tried to get it to work on my desktop at school (emacs 21.4) it doesn't update when using Ctrl-f, Ctrl-b, Ctrl-a, etc. unless I actually modify the buffer. I made a…
Yuuta
  • 414
  • 2
  • 13
1
vote
1 answer

Emacs insert true tabs by default

After a long time looking for solutions to force Emacs to use tab as real characters in C++ code, I realized that the only robust solution is to insert tabs using the "CTRL+Q TAB" key sequence. See https://stackoverflow.com/a/5146702/225186 . Is…
alfC
  • 14,261
  • 4
  • 67
  • 118