• Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About
    • About CSEstack
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • LeaderBoard
CSEstack

What do you want to Learn Today?

  • Programming
    • Tutorial- C/C++
    • Tutorial- Django
    • Tutorial- Git
    • Tutorial- HTML & CSS
    • Tutorial- Java
    • Tutorial- MySQL
    • Tutorial- Python
    • Competitive Coding Challenges
  • CSE Subject
    • (CD) Compiler Design
    • (CN) Computer Network
    • (COA) Computer Organization & Architecture
    • (DBMS) Database Management System
    • (DS) Data Structure
    • (OS) Operating System
    • (ToA) Theory of Automata
    • (WT) Web Technology
  • Interview Questions
    • Interview Questions- Company Wise
    • Interview Questions- Coding Round
    • Interview Questions- Python
    • Interview Questions- REST API
    • Interview Questions- Web Scraping
    • Interview Questions- HR Round
    • Aptitude Preparation Guide
  • GATE 2022
  • Linux
  • Trend
    • Full Stack Development
    • Artificial Intelligence (AI)
    • BigData
    • Cloud Computing
    • Machine Learning (ML)
  • Write for Us
    • Submit Article
    • Submit Source Code or Program
    • Share Your Interview Experience
  • Tools
    • IDE
    • CV Builder
    • Other Tools …
  • Jobs

Vim Case-Insensitive Search in Linux [Step-By-Step Commands]

Aniruddha Chaudhari/11637/2
Linux

As you are reading this article, it is obvious, you are using Linux as your operating system. If you are a programmer, you mostly using Vi/Vim as your coding playground.

Vim is the simple text editor with a powerful bundle of features for coding. From highlighting the syntax in Vi/Vim editor to auto-completion of the variable names. Vi/Vim has all that. But, very few of us know these features.

Because of not having a better UI interface, many of the programmers are not aware of these features. Linux is known for its powerful set of commands and so the Vim editor.

Before making Vim case-insensitive search, let’s start learning from the beginning to search the text in Vim editor file.

How to Search text in Vim editor for Linux (Ubuntu)?

You have written long programming code and now you want to search all the occurrences of the particular variable.

  1. Open the file in Vim editor.
vim textFile
  1. Press ctrl+c
  2. Press : and enter the term you want to search.
:<string_to_be_search>

Example:

:strName

This will highlight all the occurrences of variable name strName.

This is case sensitive search. So it will not highlight “strname” or “STRNAME” or all other variants of upper and lower case characters.

How to run Set Command for Vim Case-Insensitive Search in Linux?

You can use set command for case sensitive search in vim editor.

Follow the steps given below.

  1. Open VIM editor
vim textFile
  1. Press ctrl+c
  2. Use set command for case-insensitive search
:set ignorecase

This command is easy to remember as it sounds “ignore case” which is more meaningful here.

  1. Now all the searches will highlight all the case-insensitive occurrences.
:<string_to_be_search>

Example:

:strName

What if you want to go back to case-sensitive search?

Case-sensitive Search in Vim: [Undo Case-Insensitive]

You can enable the case-sensitive search again with a simple command.

:set noignorecase

Now, every time you search in Vim, it will be case-sensitive search.

This is all from this simple set command that helps you for Vim case-insensitive search.

Do you want to know my favorite editor? You can read all the different editors I personally use for different projects and OS.

I have tested all the commands on my Ubuntu Linux system.

For more such simple and powerful Linux commands, stay tuned.

linuxlinux cmdvim
Aniruddha Chaudhari
I am complete Python Nut, love Linux and vim as an editor. I hold a Master of Computer Science from NIT Trichy. I dabble in C/C++, Java too. I keep sharing my coding knowledge and my own experience on CSEstack.org portal.

Your name can also be listed here. Got a tip? Submit it here to become an CSEstack author.

Comments

  • Reply
    Roshani
    June 14, 2018 at 4:06 pm

    If I have enabled case insensitive search and now I want to go back to case sensitive search?

    How to revert the changes?

    • Reply
      Aniruddha Chaudhari
      June 17, 2018 at 1:32 pm

      Thanks for posting your query. I missed covering that.

      You can use the following command to enable case-sensitive search.

      :set noignorecase

      PS: Updated post

Leave a Reply Cancel reply

Make Your Linux Run Faster

Linux- Remove Old Kernels

Linux- Auto-Remove Unused Packages

Linux Commands

Linux- Most Useful Commands

Linux- LS command [Tool]

Linux- 7 Hostname Commands

Linux- Text Search in Terminal

Linux- File Permission [Chmod Calculator]

Linux- Check Free Memory in Ubuntu

Linux- Find Total Size of the Directory

Linux- Mount/Umount USB Drive

Linux- Change VNC Password

Linux- Get Serial Number (dmidecode)

Linux- Execute Shell Script

Linux Tools

5 Free Linux screenshot tools

Vim Editor Tricks

Vim- Setting Vim of Programming

Vim- 6 Commands to Edit File

Vim- Case-Sensitive Search

Vim- How to Create Function?

© 2022 – CSEstack.org. All Rights Reserved.

  • Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About
    • About CSEstack
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • LeaderBoard