Neovim: Key bindings and shortcuts in my daily life ver. 33

Last Updated on September 16, 2022 by shibatau

The red parts are added.

I. My Environments

Computer 1: macOS on iMac

Computer 2: Kali Linux on MacBook Air

1. Kitty

kitty – is the fast, feature-rich, cross-platform, GPU based terminal.

Installing and customizing the Kitty terminal emulator on Mac

2.Fish

Fish – is a smart and user-friendly command line shell for Linux, macOS, and the rest of the family.

Installing Fish Shell

3.Oh-My-Posh

Oh-My-Posh – is a prompt theme engine for any shell.

Installing Fish Shell

4.Neovim

Neovim is a project that seeks to aggressively refactor Vim in order to:

How to set up Neovim with Lua

5.qutebrowser

qutebrowser is a keyboard-focused browser with a minimal GUI.

6.Brave browser for watching Youtube and Netflix

Brave browser is a fast, private and secure web browser for PC, Mac and mobile.

7.Google Colaboratory for Python and R

Colaboratory allows you to write and execute Python in your browser.

8.plottext for Python

plotext plots directly on terminal

9.RStudio for Python and R

RStudio IDE is a set of integrated tools designed to help you be more productive with R and Python.

10.Krita for drawing

Krita is a professional FREE and open source painting program.

II. nvim-tree.lua + zk.nvm(journal) + terminal(plotext)

You can move windows with CTRL + w +w.

You can split a window with :split.

You can create a new tab with :tabnew.

You can open the terminal with :term.

You can quit Python in the terminal with quit().

You can quit the terminal with <Ctrl + \> and <Ctrl + n>.

III. Shortcuts, Keybindings and Commands

Here are the shortcuts often used. They include not only Neovim shortcus but also other shortcuts that I use for my daily note taking.

1.Kitty

Open fish
fish
Move to the my-note directory
my-notes/
Close Kitty
Ctrl + d
Open Nvim
nvim

Tab

Open a new tab
Ctrl + shift + t

Close a tab
Ctrl + shift + q

Move to the right tab
Ctrl + shift + right arrow

Move to the left tab
 ctrl + shift + left arrow

Open a new window
Ctrl + shift + enter

Close a window
Ctrl + shift + w

Move to the next window
Ctrl + shift + ] 

Move to the previous window
Ctrl + shift + [

2.Fish

Tutorial

3.trash_cli

trash files and directories
trash-put
empty the trashcan(s)
trash-empty
list trashed files
trash-list
restore a trashed file
trash-restore
remove individual files from the trashcan
trash-rm

trash_cli

4.Vim key bindings

Remove the number setting
:setlocal nonumber norelativenumber

Set absolute line number
:set nu

Set relative line number
:set rnu

Go to line 10
:10

Start writing at end of line
Shift-A

Delete everything from cursor onwards and start writing
Shift-C

Undo
u

Redo
Ctrl + r

Move down in a long line
gi

Move up in a long line
gk

Find and replace (to replace a with b)

:%s/a/b/gci

notes:

To search and replace the pattern in the entire file, use the percentage character

To replace all occurrences of the search pattern in the current line, add the g flag:

To substitute text, but want a confirmation every time you do it, you can use the c in the substitute command.

To ignore case for the search pattern, use the i flag:

Paste from system clipboard
“p or “+p

Paste to system clipboard
“*y or “+y

Moving to another window
Ctrl + w + w
Enter normal mode
Esc
Save the file
:w
Close the window
:q
Close all the buffers
:qa!

Open the terminal
:term

Quit the terminal
<CTRL + \><CTRL + n>

Enable spell check
:set spell

Correct spell errors
[s or ]s

Select a word
:viw (on the word)

Insert date and time on Unix-based systems
:r !date

Buffers

Show all the buffers

:ls 

Open a file in the list of buffers (you can use Tab key)

:buffer filename 

Open a file in a new buffer

:edit filename

Open a buffer

:bufferN (N is buffer number)

Go to next buffer

:bnext

Go back to the previous fuffer

:bprev

Tabs

Show all the tabs
:tabs

Open file.txt in a new tab
:tabnew file.txt

Close current tab
:tabclose

Go to next tab

:tabnext 

Go to previous tab
:tabprev

Windows

Split window horizontally
:split
:split filename

Split window vertically
:vsplit
:vsplit filename

Create new window
:new filename

Close a window
<Ctrl-w> + c

Move the cursor to left/bottom/top/right
<Ctrl-w> + h/j/k/l

Move the cursor to another window
<Ctrl-w> + w

You can learn more:

Find and Replace with yanked texts

Vim cheatsheet

Tips You Wish You Knew While Learning Vim

5.Neovim

zk-nvim

Create a new note
:ZkNew {title = “Class”, dir = “Python”}
Show the link of links
:ZkLinks
Show the list of notes
:ZkNotes
Create a new journal daily
:ZkNew {group = “journal”, dir = “journal/daily”}
Put the present date and time
!!date
Open NvimTree
:NvimTreeToggle
Split window
:split
Bold
**bold**
Italic
*italic*

nvim-tree.lua

Open Nvim Tree Toggle
:NvmTreeToggle or , + n

Rename or Move
r
Copy the name
y
Copy the relative path
Y
Copy the absolute path
gy
Delete the file
d
Open the file with default system application
s
Open the file in a vertical split
<Ctrl + v>
Open the file in a horizontal split
<Ctrl + x>
Open the file in a new tab
<Ctrl + t>
Open the file as a preview (keeping the cursor in the tree)
<Tab>
Refresh the tree
R

Telescope.nvim

You can see the key mappings here:

https://github.com/nvim-telescope/telescope.nvim

todo.nvim

Start texts
TODO:
FIX:
WARN:
NOTE:
Show all TODOs in your project
:TODOQucikfixList

6. qutebrowser

Go to a new webpage
o, then type a url, then press Enter. Use O to open the url in a new tab.

Switch between tabs
J (next tab) and K (previous tab)

Close the current tab
d (and press u to undo closing a tab)

Go back and forth in the history
H and L to go back and forth in the history
Click on something without using the mouse
f to show the hints, then type the keys next to what you want to click on (if that sounds weird, then just try pressing f and see what happens)
Show the command line
:
Search in a page
/, then type the phrase to search for, then press Enter. Use n and N to go back and forth through the matches, and press Esc to stop doing the search.

Copy URL
:yank or :yy

Close qutebrowser
:q, or :wq to save the currently open tabs and quit (note that in the settings you can make qutebrowser always save the currently open tabs)

You can learn more:

https://qutebrowser.org/doc/quickstart.html

https://qutebrowser.org/doc/help/commands.html

7.Brave Browser

Open another tap
Command + Tab
Move to the next tab
Ctrl + Tab
Open a new tab
Command + t
Close the tab
Command + w
Reopen the last closed tab
Command + Shift + t
Highlight the URL

Command + l

8.Mac

Open Spotlight
Command + Space bar
Change applications
Command + Tab
Close application
Command + q
Search in the page
Command + f
Highlight URL
Command + l

9.Terminal

Mac

Moves the cursor to the beginning of the line
Ctrl + a
Moves the cursor to the end of the line
Ctrl + e
Moves the cursor backward one character
Ctrl + b
Moves the cursor forward one character
Ctrl + f
Cut the line from the cursor to the end of the line to the clipboard. The command name is called kill-line. You can use CTRL + y to paste (kill-line).
Ctrl + k
Clear the line
Ctrl + u
You can learn more here:

Linux/Unix

Learning Linux/Unix terminal commands

Master Mac/Linux Terminal Shortcuts Like a Ninja

10.Ranger

Open Ranger with the following command in the terminal when Ranger often freeze
ranger –clean

Shows or hides the floating window
:RnvimrToggle (in Neovim)

Go to the top of the list

gg

Preview file

i

Open file

r

View hidden files

zh

Rename current file

cw

Copy file

yy

Cut file

dd

Undo

u

Change settings

z

Delete file

dD

You can learn more here:

Ranger on Linux – A Complete Terminal File Manager For Linux

11.RStudio

Comment / Uncomment codes
Ctrl + Shift + C

Add the Pipe |>
Ctrl + Shift + M

Insert The Assignment Operator <-
Alt + –

Select a Rectangular Block

ALT – click & drag

Show a keyboard shortcut cheat Sheet
Alt + Shift + K

12.vimwiki

  • <Leader>ww — Open default wiki index file.
  • <Leader>wt — Open default wiki index file in a new tab.
  • <Leader>ws — Select and open wiki index file.
  • <Leader>wd — Delete wiki file you are in.
  • <Leader>wr — Rename wiki file you are in.
  • <Enter> — Follow/Create wiki link.
  • <Shift-Enter> — Split and follow/create wiki link.
  • <Ctrl-Enter> — Vertical split and follow/create wiki link.
  • <Backspace> — Go back to parent(previous) wiki link.
  • <Tab> — Find next wiki link.
  • <Shift-Tab> — Find previous wiki link.

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.

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