I am using IntelliJ IDE for my projects and just installed ideamvim plugin. In the .ideavimrc
I added this property
set rnu
with this property I get relative line numbers in my files in intellij which is amazing. But can I ALSO get absolute line numbers? In my vscode, I have both absolute line numbers and relative line numbers, so I was wondering if it was possible to get the same behavior in intellij?
I am fine even if I have to install a new plugin in Intellij for this feature to work.
Thanks
Included In IdeaVim Bundle. Vim emulation plugin for IntelliJ Platform-based IDEs. IdeaVim supports many Vim features including normal/insert/visual modes, motion keys, deletion/changing, marks, registers, some Ex commands, Vim regexps, configuration via ~/. ideavimrc, macros, Vim plugins, etc.
Put the relative-line-numbers.jar file into Contents/plugins folder Restart your IntelliJ or Android Studio (or other JetBrains IDEs) Find the Relative Line Numbers plugins in the bundled plugin area Just enable it! more ... Loved this plugin.
Use RltvNmbr.vim to display the relative numbers, and use Vim to display the absolute ones: Show activity on this post. Vim 7.4 (Patch 7.3.787) will show the absolute line number instead of "0", when both "relativenumber" and "number" are set. When setting this option, 'number' is reset.
If you’re on Vim 7.4 or newer, and you have both absolute line numbering enabled and relative numbering, then you’ll get hybrid line numbering. That is, the number on your current line will be its absolute line number, instead of 0.
You can turn it on through the standard vim commands: You can also set these in your ~/.ideavimrc file, which you need to create if it doesn't already exist. Thanks! I actually figured it out (sorry for not updating over here) but you IdeaVim actually has a vimrc.
You can do both set relativenumber
and set number
. This will give you absolute line number for the current line, but relative line numbers for everything else. You can't have two sets of numbers side by side.
You can download and install manual this plugin: https://plugins.jetbrains.com/plugin/7414-relative-line-numbers/versions
And:
It worked at IntelliJ IDEA 2021.2.2 and windows 11
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With