Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9230363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:48:26+00:00 2026-06-18T05:48:26+00:00

I would like the normal-mode command tilde ~ , in addition to changing the

  • 0

I would like the normal-mode command tilde ~, in addition to changing the case of letters, to also be able to change the text == to != and != to ==.

I find that I do this quite often and I’d like a shortcut that still uses the tilde.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:48:27+00:00Added an answer on June 18, 2026 at 5:48 am

    This is fairly simple to do in vimscript.
    Add the following to your .vimrc or source this code from a different file.

    " ----------------------
    "  Tilde switches ==/!=
    " ----------------------
    function! TildeSwitch()
      " Gets the pair of characters under the cursor, before and behind.
      let cur_pair = getline(".")[col(".") - 2 : col(".") - 1]
      let next_pair = getline(".")[col(".") - 1 : col(".")]
    
      if cur_pair == "=="
        normal! "_ch!
        normal! l
      elseif next_pair == "=="
        normal! r!
      elseif cur_pair == "!="
        normal! "_ch=
        normal! l
      elseif next_pair == "!="
        normal! r=
      else
        " If == and != are not found, simply use the regular tilde.
        normal! ~
      endif
    endfunction
    
    nnoremap <silent> ~ :silent call TildeSwitch()<cr>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would also like to reset the font-size of <small> tag too normal HTML
I'm having trouble finding the command that would match % in normal mode. Or
I would like to remap d in normal mode to _d so that it
I don't like to have to press ESC to change to normal mode, so
I would like to validate the DNF (Disjunctive normal form) which looks like this
I would like to create a regular expression that will replace a normal space
I would like to create a vector with the entries filled with normal distribution
I'd like to convert a normal link tag into an image tag, How would
Would like to be able to set colors of headings and such, different font
I want to create mapping that would be trgiiger in normal mode by pressing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.