# Sticky lines

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

The sticky lines feature pins key structural elements, such as class and method declarations, to the top of the editor as you scroll, keeping scopes visible for quick navigation in large files and codebases.

You can also click any of the sticky lines to scroll the editor to the corresponding declaration.

![RubyMine: Sticky lines in the editor](https://resources.jetbrains.com/help/img/idea/2026.3/rm_sticky_lines.png)

By default, the maximum number of sticky lines is set to 5.

Procedure: Configure number of sticky lines

* Right-click the sticky lines in the editor and click Configure Sticky Lines….

![Configure sticky lines](https://resources.jetbrains.com/help/img/idea/2026.3/rm_configure_sticky_lines.png)

* Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Meta+Comma` (TextMate), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Editor | General | Sticky Lines`.  Next to the Maximum number of lines field, enter the desired number of sticky lines.

![Configure the number of sticky lines](https://resources.jetbrains.com/help/img/idea/2026.3/rm_sticky_lines_settings.png)

## Disable sticky lines

By default, the Show sticky lines feature is enabled. You can choose to disable the feature for [all languages](#disable_sticky_lines_steps) or for [specific languages](#disable-sticky-lines-for-specific-languages).

Procedure: Disable sticky lines for all languages

* Right-click the sticky lines in the editor and click Disable.

![Disable Sticky Lines](https://resources.jetbrains.com/help/img/idea/2026.3/rm_disable_sticky_lines.png)

* Right-click the gutter, select Appearance, and then deselect Show Sticky Lines.

![Disable sticky lines from the gutter](https://resources.jetbrains.com/help/img/idea/2026.3/rm_disable_sticky_lines_gutter.png)

* Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Meta+Comma` (TextMate), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Editor | General | Sticky Lines`.  Clear the Show sticky lines while scrolling checkbox.

Procedure: Disable sticky lines for specific languages

* Right-click the sticky lines in the editor and click Disable for <language>. The option will list the language you are currently viewing.

![Disable sticky lines](https://resources.jetbrains.com/help/img/idea/2026.3/rm_disable_sticky_lines_language_specific.png)

* Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Meta+Comma` (TextMate), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Editor | General | Sticky Lines`.  In the Languages section, deselect the checkbox next to the language to disable sticky lines for it.

![Disable sticky lines for specific languages in the IDE settings](https://resources.jetbrains.com/help/img/idea/2026.3/rm_sticky_lines_settings_language_specific.png)

Procedure: Change sticky lines color settings

* Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Meta+Comma` (TextMate), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Editor | Color Scheme | General | Editor | Sticky Lines`.  Edit the color for the background, border, or hovered state.

![Sticky lines color scheme settings](https://resources.jetbrains.com/help/img/idea/2026.3/rm_sticky_lines_color_settings.png)

