Posts

How to center a div?

2 min readTo center a div element horizontally on a web page, you can use the margin: auto and display: block CSS properties. Here’s an example of how you can do this: Alternatively, you can use the text-align: center property to center the div element. Here’s an example of how you can do this: To center a…

Read More

How to copy to clipboard in vim?

< 1 min readTo copy text to the clipboard in Vim, you can use the y key followed by a motion command. The y key stands for “yank” and will copy the text to the clipboard. The motion command specifies the range of text that you want to copy. For example, to copy a single line, you can…

Read More

How to comment uncomment lines in vim?

< 1 min readTo comment out one or more lines in Vim, you can use the : command followed by the s command and a search pattern. For example, to comment out all lines that contain the word “hello”, you can use the following command: This will replace every occurrence of the word “hello” with # hello. To…

Read More

How to duplicate a line in vim?

2 min readVim is one of the most powerful text editors, loved by developers, sysadmins, and Linux enthusiasts. But when you’re new, even simple tasks like duplicating a line can feel confusing. The good news: there are several quick ways to copy and paste lines in Vim. This article will walk you through basic, advanced, and time-saving…

Read More

How to search in vim?

< 1 min readTo search for a specific word or phrase in Vim, you can use the / key followed by the search term and then press Enter. For example, to search for the word “hello”, you would type /hello and press Enter. This will highlight all occurrences of the word “hello” in the document. You can also…

Read More