Vim Notes

There are several modes in VIM. NORMAL, INSERT, VISUAL are most common ones. The Most Used Default Key Bindings :q: quit VIM. :wq: save the current buffer and quit. :q! discard unsaved changes and quit h, j, k, l: Movement. Example: 8k - move 8 lines up :99: jump to the line 99 w: move one word forward b: move one word backward $: move to the end of the current line 0: move to the beginning of the current line o: insert a new line below and go insert mode O: insert a new line above and go insert mode A: go insert mode at the end of the current line y: yank (copy) selected text p: paste the yanked text d: delete the selected text dd: delete the current line x: delete the cursor character v: select the cursor character V: select the current line :sp: split the screen horizontally :vs: split the screen vertically /john: search for “john” in the current file buffer n: jump to the next search result N: jump to the previous search result gg: jump to the top of the current file G: jump to the bottom of the current file %: jump to the closing/opening pair bracket :%s/abc/xyz/g: replace every “abc” with “xyz” in the current file :vimgrep: search current directory, see the help for more info :help: open VIM help Vim “leader” Key <leader> key is a vim tool that can be used to create personalized shortcuts.

How to Use Multiple Github Accounts With SSH Keys on the Same Machine

There might be a chance that you need to create and use a separate github(or bitbucket) account other than your personal one in your workplace. And Github(Bitbucket or Gitlab will do the same I believe) doesn’t allow to share a ssh key between different accounts for authentication. That’s the case we are going to figure out below. First of all, create a new ssh key pair on your machine. 1 2 3 ssh-keygen -t ed25519 -C "your_email@example.

Test Doubles in Unit Testing

“Test Double” is a generic term for any case where you replace a production object for testing purposes. I believe the following description provides a more intuitive understanding of the concept. A Test Double is an object that stands in for a real object in a test, similar to how a stunt double stands in for an actor in a movie. There are various kinds of test doubles: Dummies, Stubs, Mocks, Spies, Fakes.

Python Development Environment Setup - an Excellent Way

Install pyenv to manage multiple python versions This gist self-explains how to install pyenv and use it to manage multiple python versions on your machine Manage virtual envs A virtual env is where dependencies live without polluting the global space of the current python version, preventing dependency version conflicts between different projects on the same machine. Install virtualenv package: pip install virtualenv virtualenv --version It’s common that .gitignore file excludes virtual env directories named venv, env, .

Setup Neovim with vim-plug on Windows 11

I love to use vim everywhere. Almost all the linux distros and macOS come with Vim pre-installed, but what about Windows? You can stick to the vim within the Windows Git Bash(you should know git because that’s what makes you a developer :D) with a Linux-like configuration, but you may notice that :w command lags for some reason. So why not use Neovim(nvim) on Windows? Let’s get to it! Open powershell and run the command below to install Neovim on your system.