doc updates
This commit is contained in:
@@ -1,3 +1,194 @@
|
||||
To improve your CLI skills, focusing on efficiency and mastery of shell commands, here are some tips and techniques:
|
||||
|
||||
1. **Use Aliases:**
|
||||
Create aliases for commonly used commands to save time. For example:
|
||||
```sh
|
||||
alias cdp='cd ..'
|
||||
alias ll='ls -la'
|
||||
alias v='vim'
|
||||
```
|
||||
Add these to your `~/.bashrc` or `~/.zshrc` file.
|
||||
|
||||
2. **Navigation Shortcuts:**
|
||||
- Use `cd -` to quickly switch to the previous directory.
|
||||
- Use `cd` with shortcuts like `..` for parent directories or `~` for the home directory.
|
||||
- Implement `pushd` and `popd` for managing directory stack:
|
||||
```sh
|
||||
pushd /path/to/directory
|
||||
popd
|
||||
```
|
||||
|
||||
3. **Tab Completion:**
|
||||
Leverage tab completion to quickly fill in file and directory names.
|
||||
|
||||
4. **Search Command History:**
|
||||
Use `Ctrl + r` to reverse search through your command history.
|
||||
|
||||
5. **Bash/Zsh Shortcuts:**
|
||||
- `Ctrl + a` moves to the beginning of the line.
|
||||
- `Ctrl + e` moves to the end of the line.
|
||||
- `Ctrl + w` deletes the word before the cursor.
|
||||
- `Ctrl + u` deletes from the cursor to the beginning of the line.
|
||||
- `Ctrl + k` deletes from the cursor to the end of the line.
|
||||
|
||||
6. **Scripting:**
|
||||
Write simple scripts for repetitive tasks. For example, to navigate to a commonly used directory and open a file:
|
||||
```sh
|
||||
#! /bin/bash
|
||||
cd ~/repos/the_information_nexus/tech_docs/linux
|
||||
vim vim.md
|
||||
```
|
||||
Save this as `edit_vim_docs.sh` and run it with `./edit_vim_docs.sh`.
|
||||
|
||||
7. **Combine Commands with && and ;:**
|
||||
Combine commands on a single line to streamline workflows:
|
||||
```sh
|
||||
cd ~/repos/the_information_nexus/projects && vim The-Digital-Pulse-Series.md
|
||||
```
|
||||
|
||||
8. **Use `find` and `grep`:**
|
||||
Search for files and content within files efficiently:
|
||||
```sh
|
||||
find . -name '*.md'
|
||||
grep -r 'search_term' .
|
||||
```
|
||||
|
||||
9. **Keyboard Macros:**
|
||||
Use `Ctrl + x` followed by `(` and `)` to start and end a keyboard macro in bash, which can be used to repeat a sequence of commands.
|
||||
|
||||
10. **Automation with `Makefile`:**
|
||||
Use Makefiles to define commands you often run, simplifying complex workflows:
|
||||
```makefile
|
||||
edit_vim_docs:
|
||||
cd ~/repos/the_information_nexus/tech_docs/linux && vim vim.md
|
||||
```
|
||||
|
||||
11. **Learning Resources:**
|
||||
- **Books:**
|
||||
- "The Linux Command Line" by William Shotts
|
||||
- "Learning the bash Shell" by Cameron Newham
|
||||
- **Online Courses:**
|
||||
- Codecademy's Command Line course
|
||||
- Udemy's Linux Command Line Basics
|
||||
|
||||
12. **Experiment with Shell Customization:**
|
||||
Customize your shell prompt to include useful information like the current directory, Git branch, etc. For example, using `oh-my-zsh`:
|
||||
```sh
|
||||
ZSH_THEME="agnoster"
|
||||
```
|
||||
|
||||
Implementing these tips will help you become more efficient and powerful with your command-line skills.
|
||||
|
||||
---
|
||||
|
||||
Sure, let's start from the beginning and set up Vim with syntax highlighting support for Markdown, Python, and JavaScript on your Debian 12 system.
|
||||
|
||||
### Step-by-Step Guide
|
||||
|
||||
#### Step 1: Install Vim
|
||||
|
||||
1. **Open your terminal.**
|
||||
2. **Update your package list:**
|
||||
```sh
|
||||
sudo apt update
|
||||
```
|
||||
3. **Install Vim:**
|
||||
```sh
|
||||
sudo apt install vim
|
||||
```
|
||||
|
||||
#### Step 2: Install Vim-Plug (Plugin Manager)
|
||||
|
||||
1. **Install Vim-Plug:**
|
||||
```sh
|
||||
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
```
|
||||
|
||||
#### Step 3: Configure `.vimrc` File
|
||||
|
||||
1. **Create or open your `.vimrc` file:**
|
||||
```sh
|
||||
vim ~/.vimrc
|
||||
```
|
||||
|
||||
2. **Add the following configuration to your `.vimrc` file:**
|
||||
|
||||
```vim
|
||||
" Enable syntax highlighting
|
||||
syntax on
|
||||
|
||||
" Set line numbers
|
||||
set number
|
||||
|
||||
" Enable filetype detection and plugins
|
||||
filetype plugin on
|
||||
filetype indent on
|
||||
|
||||
" Set basic editing settings
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set expandtab
|
||||
set autoindent
|
||||
set smartindent
|
||||
|
||||
" Enable mouse support
|
||||
set mouse=a
|
||||
|
||||
" Initialize Vim-Plug
|
||||
call plug#begin('~/.vim/plugged')
|
||||
|
||||
" Markdown plugin for syntax highlighting
|
||||
Plug 'plasticboy/vim-markdown'
|
||||
|
||||
" Python syntax highlighting
|
||||
Plug 'vim-python/python-syntax'
|
||||
|
||||
" JavaScript syntax highlighting
|
||||
Plug 'pangloss/vim-javascript'
|
||||
|
||||
call plug#end()
|
||||
|
||||
" Disable folding for Markdown files
|
||||
let g:vim_markdown_folding_disabled = 1
|
||||
```
|
||||
|
||||
3. **Save and exit the `.vimrc` file:**
|
||||
Press `Esc`, then type `:wq` and hit `Enter`.
|
||||
|
||||
#### Step 4: Install the Plugins
|
||||
|
||||
1. **Open Vim:**
|
||||
```sh
|
||||
vim
|
||||
```
|
||||
|
||||
2. **Install the plugins by running the following command in Vim:**
|
||||
```vim
|
||||
:PlugInstall
|
||||
```
|
||||
|
||||
#### Step 5: Verify Syntax Highlighting
|
||||
|
||||
1. **Open a Markdown file to check syntax highlighting:**
|
||||
```sh
|
||||
vim yourfile.md
|
||||
```
|
||||
|
||||
2. **Open a Python file to check syntax highlighting:**
|
||||
```sh
|
||||
vim yourfile.py
|
||||
```
|
||||
|
||||
3. **Open a JavaScript file to check syntax highlighting:**
|
||||
```sh
|
||||
vim yourfile.js
|
||||
```
|
||||
|
||||
By following these steps, you should have Vim installed with syntax highlighting support for Markdown, Python, and JavaScript. The configuration ensures that your `.vimrc` is properly set up to use Vim-Plug for managing plugins, and you can enjoy enhanced editing features for these file types.
|
||||
|
||||
---
|
||||
|
||||
In Vim, to move to the top of the document, select all text, and then either delete or yank (copy) it, you'll use different sequences of commands depending on what you want to accomplish. Here are the steps for each action:
|
||||
|
||||
1. **Move to the Top and Select All Text**:
|
||||
|
||||
Reference in New Issue
Block a user