Jump to content

Welcome to CodeNameJessica

โœจ Welcome to CodeNameJessica! โœจ

๐Ÿ’ป Where tech meets community.

Hello, Guest! ๐Ÿ‘‹
You're just a few clicks away from joining an exclusive space for tech enthusiasts, problem-solvers, and lifelong learners like you.

๐Ÿ” Why Join?
By becoming a member of CodeNameJessica, youโ€™ll get access to:
โœ… In-depth discussions on Linux, Security, Server Administration, Programming, and more
โœ… Exclusive resources, tools, and scripts for IT professionals
โœ… A supportive community of like-minded individuals to share ideas, solve problems, and learn together
โœ… Project showcases, guides, and tutorials from our members
โœ… Personalized profiles and direct messaging to collaborate with other techies

๐ŸŒ Sign Up Now and Unlock Full Access!
As a guest, you're seeing just a glimpse of what we offer. Don't miss out on the complete experience! Create a free account today and start exploring everything CodeNameJessica has to offer.

by: Abhishek Prakash
Wed, 04 Jun 2025 12:11:12 +0530


I hope I am not committing blasphemy but you can use the mouse in Vim.

Press Esc to go to command mode in Vim and use:

:set mouse=a

It will enable mouse mode immediately in all Vim modes, i.e. normal, insert and visual. To disable the mouse mode, use this:

:set mouse=

If you want to use mouse mode all the time, I am not judging you, add this entry to your ~/.vimrc file:

set mouse=a

Save, restart Vim, and your mouse now works for clicking, scrolling, and selecting text.

What does mouse mode do in Vim?

First thing first, the mouse mode has limited usage in Vim. Don't expect to get a notepad like experience just because you enabled mouse mode.

It does add some functionality and ease of use like:

  • Jump to exact locations without counting lines or using search
  • Wheel scrolling while dealing with long files
  • Easy text selection: double click to select a word, triple click to select an entire line, use mouse click and drag for the desired text selection
  • Click between panes and resize them easily while using split windows in Vim
  • While using tabs, click on other tabs to switch, click on X (should be visible at top right in mouse mode) to close a tab, double click on tab bar to create new empty files in new tabs
  • Use middle click to paste from system clipboard

The video below shows some of the above discussed featured in action:

0:00
/0:21

Vim Mouse Mode demonstration

Mouse mode doesn't replace Vim's keyboard efficiency - it complements it. Think of it as having both a sports car's manual controls and cruise control available.

๐Ÿ“‹
Mouse mode behavior varies by terminal and some terminal emulators may require specific settings. If you are using tmux, ensure both Vim and tmux have mouse mode enabled for proper interaction.

Understanding mouse mode Options

Vim's mouse configuration works like a permission system:

set mouse=a     " All modes (normal, visual, insert, command)
set mouse=n     " Normal mode only
set mouse=v     " Visual mode only  
set mouse=i     " Insert mode only
set mouse=c     " Command mode only
set mouse=nv    " Normal and visual modes

Mostly, you would want mouse=a - which is like having universal access rather than mode-specific restrictions.

๐Ÿ’ก
You can refer to Vim's official mouse documentation: :help mouse-using

Conclusion

I am not a Vim purist and I won't judge you if you use mouse in Vim, which is known for its keyboard-centric approach to productivity.

Mouse mode doesn't diminish Vim's keyboard efficiency - it provides additional options for specific scenarios.

If you feel too uncomfortable with Vim at the beginning, opt for the hybrid approach where you use mouse for navigation and positioning, keyboard for editing operations.

I welcome your comments.

0 Comments

Recommended Comments

There are no comments to display.

Guest
Add a comment...

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.