-
Notifications
You must be signed in to change notification settings - Fork 2
Text Editor
Lưu Cao Hoàng edited this page Nov 30, 2025
·
3 revisions
- every linux have nano, if not install yet (very rare), usually in distroless docker image
sudo apt-get install nano- Create new file without touch
nano hehe.txt- Create a file name hihi.txt with some text
echo "first line" > hihi.txt- Append a text to end of file
# Redirection operator
echo "first line" >> hihi.txt- Cut/Delete a line
Ctrl + K- Copy, paste selected line
Ctrl + 6 #Mark set
Alt + 6 #Copy selected
Ctrl + U #Paste- Moving a line
Ctrl + K
Ctrl + UInstall neovim aka nvim (https://neovim.io/doc/install/)
# Pre-built archives
# The Releases page provides pre-built binaries for Linux systems.
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
sudo rm -rf /opt/nvim-linux-x86_64
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz- Then add this to your shell config (~/.bashrc, ~/.zshrc, …):
export PATH="$PATH:/opt/nvim-linux-x86_64/bin"- Install Lazyvim (https://www.lazyvim.org/installation)
- LazyVim require v10 above to install
- Bug:
Error detected while processing User Autocommands for "VeryLazy":
No C compiler found! "cc", "gcc", "clang", "cl", "zig" are not executable.sudo apt install build-essential
-
Vim has 3 modes:
Normal,Insert,Visual -
Default Nvim/Vim start with
NormalMode, we switch toInsertMode by type any text on keyboard one time, vice versa we need to typeEsckeyboard -
VisualMode is used to select text, we can switch toVisualMode by typevon keyboard
- h and l (Move the current cursor to
left or rightone position) - j and k (Move the current cursor to
down or upone position)
-
Alt + j (Move the current line
down) -
Alt + k (Move the current line
up) -
dd: delete one line
-
u: undo ~ Ctrl + Z
-
:bprev
-
:bnext