Week 36: Cut/copy/paste in vim and use prettyDOM to debug failing tests in react-testing-library

Cut/copy/paste in vim

I'm continuing to learn more keys for cut/copy/paste in vim

Navigation Combination
Cut dd - entire line
Copy yy - entire line
Paste p - paste below the current line
P - paste at the current line

You can also use these keys along with numbers. eg: :3 - will simply take you 3rd line. We can add d or y based on whether we need to copy or cut/delete.

Since I'm using ESC key for switching modes, I remapped the caps lock key to be ESC within vim.

Debugging in react-testing-library

While debugging the failing tests in a different repo, I learnt about prettyDOM, which is an effective way to debug the HTML code that gets rendered.

    import { prettyDOM } from '@testing-library/dom';

    const div = document.createElement('div');
    div.innerHTML = '

HTML Element

'; console.log(prettyDOM(div)); //<div> //<h1>HTML Element</h1> //</div>