Neovim: Find and Replace with yanked texts ver. 2

Last Updated on May 17, 2022 by shibatau

I. What will you learn?

Let’s take an example. You have copied the following line on a webpage, run it on Google Colaboratory.

url=’https://www.accuweather.com/en/in/surat/202441/daily-weather-forecast/202441’

Surely, you would get an error because ’ is different from ‘. You should use the latter sign for Python codes. You can confirm the difference between them at What Unicode character is this ?

II. Replacing ’ with ‘ in Nvim

1.Yank ’ in Visual Mode

2.Run the following command in Command Mode. You can paste ’ in Command Mode with CTRL+r then .

:%s/’/'/gci

You can learn the details here:

How to Find and Replace Text in Vim

How to paste yanked text into the Vim command line

About shibatau

I was born and grown up in Kyoto. I studied western philosophy at the University and specialized in analytic philosophy, especially Ludwig Wittgenstein at the postgraduate school. I'm interested in new technology, especially machine learning and have been learning R language for two years and began to learn Python last summer. Listening toParamore, Sia, Amazarashi and MIyuki Nakajima. Favorite movies I've recently seen: "FREEHELD". Favorite actors and actresses: Anthony Hopkins, Denzel Washington, Ellen Page, Meryl Streep, Mia Wasikowska and Robert DeNiro. Favorite books: Fyodor Mikhailovich Dostoyevsky, "The Karamazov Brothers", Shinran, "Lamentations of Divergences". Favorite phrase: Salvation by Faith. Twitter: @shibatau

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.