From 18382fe334bfcb5cd53bd5a677f00060a6b31bee Mon Sep 17 00:00:00 2001 From: Zakaria Fadli Date: Mon, 4 Nov 2024 10:50:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20chore(i3=5Ftips.md):=20rename=20?= =?UTF-8?q?file=20from=20'tips.md'=20to=20'i3=5Ftips.md'=20for=20better=20?= =?UTF-8?q?organization=20=E2=9E=95=20feat(shell=5Ftips.md):=20add=20compr?= =?UTF-8?q?ehensive=20list=20of=20shell=20tips=20and=20commands=20for=20ba?= =?UTF-8?q?sic=20and=20advanced=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit πŸ”₯ refactor(tips.sh): remove outdated and irrelevant tips and commands from tips.sh file 🧹 chore(tips.sh): clean up and organize the remaining tips and commands in tips.sh file ✨ feat(tips): add tmux tips to tmux_tips.md file πŸ”„ refactor(tips): move tmux tips from tips.md to tmux_tips.md πŸ”„ refactor(tips): rename tips.md to vim_tips.md for better organization --- i3/tips.md => tips/i3_tips.md | 1 - tips/shell_tips.md | 145 +++++++++++++++++++ tips/tips.sh | 262 ---------------------------------- tips/tmux_tips.md | 52 +++++++ tips/{tips.md => vim_tips.md} | 85 ----------- 5 files changed, 197 insertions(+), 348 deletions(-) rename i3/tips.md => tips/i3_tips.md (99%) create mode 100644 tips/shell_tips.md delete mode 100644 tips/tips.sh create mode 100644 tips/tmux_tips.md rename tips/{tips.md => vim_tips.md} (72%) diff --git a/i3/tips.md b/tips/i3_tips.md similarity index 99% rename from i3/tips.md rename to tips/i3_tips.md index 4488abe..2c1cb4e 100644 --- a/i3/tips.md +++ b/tips/i3_tips.md @@ -6,4 +6,3 @@ No desktop with nautilus: gsettings set org.gnome.desktop.background show-deskto xmodmap -pke OR xev - diff --git a/tips/shell_tips.md b/tips/shell_tips.md new file mode 100644 index 0000000..497d92b --- /dev/null +++ b/tips/shell_tips.md @@ -0,0 +1,145 @@ +# Shell Tips + +## Basic Commands + +- `which` - shows where the binary for a command is located +- `whereis` - similar to `which` but also looks in packages +- `type` - shows if a command is an alias, builtin, etc. +- `eval` - evaluates a string as a command +- `exec` - replaces the current shell with the specified command +- `command` - runs the specified command, ignoring shell functions and aliases +- `file` - shows the type of a file (e.g., `file /usr/bin/python3.4` says it's an ELF 64-bit executable) +- `ls -i` - shows inode numbers +- `shutdown now` - shuts down the system immediately (`-r` to reboot, can specify a delay) +- `tee` - takes the output from a command and saves it to a file while also sending it to standard output (e.g., `ls -l | tee newfile`) +- `tac` - concatenates and prints files in reverse +- `tail` and `head` - show the last or first lines of a file (`tail -n 15 file` for the last 15 lines, `tail -f file` to follow new lines added to a file) +- `touch -t 03201600 myfile` - sets the date of a file +- `rm -i` - interactive removal, useful when using patterns +- `PS1` - sets the terminal prompt +- `man` and `info` - provide information on commands +- `help` - provides information on built-in shell commands + +## Advanced Commands + +### AWK, SED, GREP, FIND + +- `AWK` - for advanced data extraction + - `awk '{ print $0 }' /etc/passwd` - print entire file + - `awk -F: '{ print $1 }' /etc/passwd` - print first field of every line + - `awk -F: '{ print $1 $7 }' /etc/passwd` - print first and seventh fields of every line + +- `SED` - for simple text manipulation, mostly search and replace + - `sed s/pattern/replace_string/ file` - substitute first occurrence of pattern in a line + - `sed s/pattern/replace_string/g file` - substitute all occurrences of pattern in a line + - `sed 1,3s/pattern/replace_string/g file` - substitute all occurrences of pattern between lines 1 and 3 + - `sed -i s/pattern/replace_string/g file` - save changes for string substitution in the same file + +- `GREP` - for searching text using patterns + - `grep [pattern] ` - search for a pattern in a file and print all matching lines + - `grep [0-9] ` - print lines that contain numbers 0 through 9 + - `grep -r [pattern] [path]` - recursive search in directories + - `grep -v [pattern] [path]` - print lines that do NOT match the pattern + - `grep -C n [pattern] [path]` - print lines with a context of n lines + +- `FIND` - for searching files and directories + - `find [where] -name [pattern]` - search for files matching the pattern + - `find [where] -iname [pattern]` - case-insensitive search + - `find [where] -name "*.swp" -exec rm {} \;` - delete all files matching the pattern + - `find / -ctime 3` - find all files changed 3 minutes ago + - `find / -size +10M -exec rm {} \;` - delete files larger than 10M + +- `LOCATE` - for finding files using a database + - `locate [pattern]` - search for files matching the pattern + - `locate -b [pattern]` - search using globbing pattern + - `locate --regex [pattern]` - search using regex + +### File Types + +- `-` : regular file +- `d` : directory +- `c` : character device file +- `b` : block device file +- `s` : local socket file +- `p` : named pipe +- `l` : symbolic link + +## Programming + +### Opening Binary Files + +- `hexdump -C x.bin` - shows the strings in the binary +- `strings x.bin` - shows the strings only, can show library calls +- `objdump -d x.bin` - disassembles the whole binary +- `objdump -x x.bin` - shows the sections and other interesting info +- `nm x.bin` - dumps the symbols +- `readelf -a x.bin` - like objdump but better for ELF files +- `strace x.bin` - shows all syscalls made by the program +- `ltrace x.bin` - shows all dynamic library calls +- `gdb x.bin` - GNU Debugger +- `r2 x.bin` - radare2 (type `aaa` at first to analyze the program, a lot of cool stuff like `VV` for visual disassembly mode) + +## Processes + +### Managing Processes + +- `ps` - shows processes associated with the invoking terminal +- `ps -elf` - shows all threads (not only processes) +- `pstree` - shows the process tree +- `w` or `top` or `htop` - shows load on CPU of each process +- `kill -SIGKILL ` - forcefully kill a process +- `kill -9 ` - forcefully kill a process +- `CTRL-Z` - suspend a process (in foreground) +- `jobs` - shows processes in the background of a terminal + +### Process Types + +- Interactive Processes - need to be started by a user (e.g., `bash`, `firefox`, `top`) +- Batch Processes - automatic processes scheduled and disconnected from the terminal (e.g., `updatedb`) +- Daemons - server processes that run continuously (e.g., `httpd`, `xinetd`, `sshd`) +- Threads - lightweight processes that share memory and resources (e.g., `firefox`, `gnome-terminal-server`) +- Kernel Threads - kernel tasks that users have little control over (e.g., `kthreadd`, `migration`, `ksoftirqd`) + +### Fork and Exec + +- `fork` - creates a new process (child process) with the same environment as the parent process +- `exec` - replaces the contents of the currently running process with the information from a program binary + +## Web Networking + +### HTTP + +- `wget` - downloads a webpage (e.g., `wget http://example.com`) + +### TCP + +- `netcat` - TCP tool + - `echo 'HEAD / HTTP/1.1\r\nHost: www.google.com\r\n\r\n' | nc www.google.com 80` - send HTTP request with netcat + - `nc -l 3333` - plain TCP server listening on port 3333 + - `nc localhost 3333` - connect to the TCP server on port 3333 + +- `tcpdump` - network packet analyzer + - `tcpdump -n host 8.8.8.8` - show ICMP ping packets + - `tcpdump -n port 53` - show DNS packets + - `tcpdump -n port 80` - show HTTP packets + +### DNS + +- `nslookup` or `host` or `dig` - perform a DNS lookup +- `dig` - provides more details on how the DNS query was resolved + +### IP/Subnetting + +- `ip addr show` or `ifconfig` - show network interfaces +- `traceroute hostname` or `traceroute ip_address` or `mtr hostname` - show the routes traffic might take +- `ping` - gives round trip time (RTT) +- `ethtool ` - shows the capabilities of the network hardware +- `arp` - shows MAC addresses of recent devices in the network +- `netstat -s` - network status information and statistics +- `netstat -t -n` - shows current TCP connections +- `netstat -t -n -l` - shows only listening TCP connections + +### Firewall + +- Common configuration: drop any incoming traffic except traffic to (host, port) pairs that are supposed to be receiving connections from the Internet + diff --git a/tips/tips.sh b/tips/tips.sh deleted file mode 100644 index 115f3b3..0000000 --- a/tips/tips.sh +++ /dev/null @@ -1,262 +0,0 @@ - - -##############TRY ME OUT##################### -tips=" - -$which - showhs where's the binary for a command -$whereis - same but looks also in packages - -$type - shows if command is an lias or builtin etc.. - -$eval evalutes string as a command -$exec ?? -$command ?? -FIXME what is exec and command? difference? - -$file shows type of a file like file /usr/bin/python3.4 says it's an elf 64 bit exec (which means it's coded in c?) - -$ls -i - shows symbolic links - -$shutdown now (-r to reboot, can give any x minutes) (better than halt powerOff reboot) - -tee takes the output from any command, and, while sending it to standard output, it also saves it to a file. -$ls -l | tee newfile -$tac (cat backwards) - -$tail and head (only 10 last or first lines) -$tail -n 15 file for last 15 line -$tail -f file to follow any new lines added to file (useful for logs) - -$touch -t 03201600 myfile (sets date to file) -$rm -i (interactive, use it when givin a pattern) -$PS1 is terminal prompt (you can wwrite to it) -$man $ info give information on commands -$help for built in shell commands -" - -advanced_commands=" AWK SED GREP FIND - -REGEX for pattern definition (to use with awk, sed, vim, find, grep, python..) -!= from WILDCARDS(globbing characters) (used in bash files search) -see cheatsheet - -$AWK (for advanced data extraction) -The input file is read one line at a time, and, for each line, awk matches the given pattern in the given order and performs the requested action. - The -F option allows you to specify a particular field separator character. - For example, the /etc/passwd file uses ":" to separate the fields, so the -F: option is used with the /etc/passwd file. - The command/action in awk needs to be surrounded with apostrophes (or single-quote) -awk '{ print $0 }' /etc/passwd Print entire file -awk -F: '{ print $1 }' /etc/passwd Print first field (column) of every line, separated by a space -awk -F: '{ print $1 $7 }' /etc/passwd Print first and seventh field of every line - -$SED (like awk but for simple stuff, mostly search and replace in directory) -sed can filter text, as well as perform substitutions in data streams, working like a churn-mill. -$sed s/pattern/replace_string/ file Substitute first string occurrence in a line -$sed s/pattern/replace_string/g file Substitute all string occurrences in a line (g for globally) -$sed 1,3s/pattern/replace_string/g file Substitute all string occurrences btw lines 1 and 3 -$sed -i s/pattern/replace_string/g file Save changes for string substitution in the same file --e options to pass multiple commands, can also pass script with -f - -$GREP [options] PATTERN [PATH] -grep [pattern] Search for a pattern in a file and print all matching lines -example: grep [0-9] Print the lines that contain the numbers 0 through 9 --r for recursive in directories --v for all lines that do NOT match pattern --C n with a context of N - -AG faster, but only limited regex (subset, no flag needed) //FIXME make sure of this - - -$FIND WHERE -name PATTERN -$FIND WHERE -iname PATTERN (case insensitive) -$FIND -name "*.swp" -exec rm {} ’;’ (delete all files that match pattern, The {} is a place holder that will be filled with all the file names that result from the find expression, and the preceding command will be run on each one individually. you have to end the command with either β€˜;’ (including the single-quotes) or "\;". Both forms are fine.) -When no arguments are given, find lists all files in the current directory and all of its subdirectories. --ok option behaves the same as -exec, except that find will prompt you for permission before executing. -$FIND / -ctime 3 >>>> (finds all files in / changes 3 minutes ago) -$FIND / -size +10M -exec rm {} ’;’ >>> deletes files over 10M - -$LOCATE PATTERN (takes globbing pattern if flag -b, can use regex by --regex) -just lists database of all files (generated by (sudo) updatedb which can be called) -why -b ? see https://stackoverflow.com/questions/17262827/bash-locate-command-with-pattern - -Wildcard Result -? Matches any single character -* Matches any string of characters -[set] Matches any character in the set of characters, for example [adf] will match any occurrence of a, d, or f -[!set] Matches any character not in the set of characters - -FILE TYPES: -- : regular file -d : directory -c : character device file -b : block device file -s : local socket file -p : named pipe -l : symbolic link -" - -programming=" -for opening binary files: -$hexdump -C x.bin (shows the strings in the binary too) -$stings (shows the strings only, can show lib library calls) -$objdump -d x.bin (disassembles the whole binary) -$objdump -x x.bin (shows the sections and other interesting info) -$nm dumps the symbols -$readelf like objdump but better for elf file -$nm reads symbols (FIXME but does it really?) -$strace shows all syscalls made by program -$ltrace shows all dynamic libraries calls&& -$gdb -$r2 x.bin (radare2)( type aaa at first to analyse program), a lot of cool stuff like VV for visual disassemby mode (graph)) -" -syscalls=" - - - -" -processes=" -PROCESSES -$ ps (only assosiated to invoking terminal) -$ ps -elf to show all threads (not only processes) -$ pstree (shows ofr processes tree) -$ w or top or htop (shows load on cpu of each process) -$ kill -SIGKILL -$ kill -9 -CTRL-Z to suspend a ps (in foreground) -$ jobs shows process in backgroundof a terminal - -Process Type Description Example -Interactive Processes Need to be started by a user, either at a command line or through a graphical interface such as an icon or a menu selection. bash, firefox, top -Batch Processes Automatic processes which are scheduled from and then disconnected from the terminal. These tasks are queued and work on a FIFO (First In, First Out) basis. updatedb -Daemons Server processes that run continuously. Many are launched during system startup and then wait for a user or system request indicating that their service is required. httpd, xinetd, sshd -threads Lightweight processes. These are tasks that run under the umbrella of a main process, sharing memory and other resources, but are scheduled and run by the system on an individual basis. An individual thread can end without terminating the whole process and a process can create new threads at any time. Many non-trivial programs are multi-threaded. firefox, gnome-terminal-server -Kernel Threads Kernel tasks that users neither start nor terminate and have little control over. These may perform actions like moving a thread from one CPU to another, or making sure input/output operations to disk are completed. kthreadd, migration, ksoftirqd - -$EXEC -To understand exec you need to first understand fork. I am trying to keep it short. - -When you come to a fork in the road you generally have two options. Linux programs reach this fork in the road when they hit a fork() system call. - -Normal programs are system commands that exist in a compiled form on your system. When such a program is executed, a new process is created. This child process has the same - environment as its parent, only the process ID number is different. This procedure is called forking. - -Forking provides a way for an existing process to start a new one. However, there may be situations where a child process is not the part of the same program as parent process. - In this case exec is used. exec will replace the contents of the currently running process with the information from a program binary. -After the forking process, the address space of the child process is overwritten with the new process data. This is done through an exec call to the system. -" - -web_networking=" - -$HTTP -the headersg - -$TCP - -The six basic TCP flags - The original TCP packet format has six flags. Two more optional flags have since been standardized, but they are much less important to the basic functioning of TCP. For each packet, tcpdump will show you which flags are set on that packet. - SYN (synchronize) [S] β€” This packet is opening a new TCP session and contains a new initial sequence number. - FIN (finish) [F] β€” This packet is used to close a TCP session normally. The sender is saying that they are finished sending, but they can still receive data from the other endpoint. - PSH (push) [P] β€” This does TWO THINGS: The sending application informs TCP that data should be sent immediately. the PSH flag in the TCP header informs the receiving host that the data should be pushed up to the receiving application immediately. This packet is the end of a chunk of application data, such as an HTTP request.so - RST (reset) [R] β€” This packet is a TCP error message; the sender has a problem and wants to reset (abandon) the session. - ACK (acknowledge) [.] β€” This packet acknowledges that its sender has received data from the other endpoint. Almost every packet except the first SYN will have the ACK flag set. - URG (urgent) [U] β€” This packet contains data that needs to be delivered to the application out-of-order. Not used in HTTP or most other current applications. The urgent pointer field is to be checked by receiver when the flag is set to know how much is urgent. -Three-way handshake - The first packet sent to initiate a TCP session always has the SYN flag set. This initial SYN packet is what a client sends to a server to start opening a TCP connection. This is the first packet you see in the sample tcpdump data, with Flags [S]. This packet also contains a new, randomized sequence number (seq in tcpdump output). - If the server accepts the connection, it sends a packet back that has the SYN and ACK flags, and acknowledges the initial SYN. This is the second packet in the sample data, with Flags [S.]. This contains a different initial sequence number. - (If the server doesn't want to accept the connection, it may not send anything at all. Or it may send a packet with the RST flag.) - Finally, the client acknowledges receiving the SYN|ACK packet by sending an ACK packet of its own. - This exchange of three packets is usually called the TCP three-way handshake. In addition to sequence numbers, the two endpoints also exchange other information used to set up the connection. -Four-way teardown - When either endpoint is done sending data into the connection, it can send a FIN packet to indicate that it is finished. The other endpoint will send an ACK to indicate that it has received the FIN. - In the example HTTP data, the client sends its FIN first, as soon as it is done sending the HTTP request. This is the first packet containing Flags [F.]. - Eventually the other endpoint will be done sending as well, and will send a FIN of its own. Then the first endpoint will send an ACK. - -In between - In a long-running connection, there will be many packets exchanged back and forth. Some of them will contain application data; others may be only acknowledgments with no data (length 0). However, all TCP packets in a connection except the initial SYN will contain an acknowledgment of all the data that the sender has received so far. Therefore, they will all have the ACK flag set. (This is why tcpdump depicts the ACK flag with just a dot: it's really common.) - -ICMP and DNS don't have TCP flags - If you look at tcpdump data for pings or basic DNS lookups, you will not see flags. This is because ping uses ICMP, and basic DNS lookups use $UDP. These protocols do not have TCP flags or sequence numbers. - -my notes on TCP - serverless protocol (no client and server) - each side uses sequences numbers on packet (to maintain order and acking) - all packets have an ack. - no pure ack packets (acks are embedded into data sending from the acking/nacking side), - if the client or server has nothing to send it will send stuff with len=0 while incrementing its sequence number - example : - client will send packet 3 THEN server will send pcket 5001 with ACK 4 (received all up to 4 not included and sending my packet 5001) - client will then ack 5002 when sendting its packet 4 etc.. - -$netcat is a TCP tool : (sends the exact strings you give it) - client send HTTP request with netcat : $echo 'HEAD / HTTP/1?1\r\nHost www.google.com\r\n\r\n' | $nc www.google.com 80 - plain TCP server listen on port 3333 : $nc -l 3333 (listen on socket 3333, you can connect to it with 'nc localhost 33333') - connection is then full duplexed (you can write on server side and it appers on client side) - highest port number 65535 - 1-1023 reserved ports (can only be listened to with root privileges unless someone is already listening on it) - - $tcpdump -n host 8.8.8.8 can show the ICMP ping packets (the protocol that implements ping at top of layer 3 since it uses IP) - $tcpdump -n port 53 : shows the DNS packets (port 53 is used by DNS) - $tcpdump -n port 80 : shows the HTTP packets (port 53 is used by DNS) - - Connection : - - - - -$DNS -$nslookup or $host or $dig to do a dns lookup, $dig to get more details on how the ds query went. -there's different types of DNS records (CNAME = canocal name = alias (www.machin.com); 1 = IP4; AAAA = ipv6; NS = DNS name server) -an A record for www.googl.come is found in the NS for google.com which is found in the NS server of ".com" -first DNS server to receive query is the closest caching DNS server (so we the request never needs to go all the way to the NS server of the domain.. -BUT DNS entries have TimeToLive so they expire in case we need to change them.) -the "www" in host names is not always necessary because hostnames dedicated to webtraffic www.example.com is set only as a CNAME to example.com. - -$IP/$SUBNETTING -IP adresses are 32 bits, with 255.255.255.0 mask, you have 8 bits for host adressing 24bits for network adress it will be written as /24 -only two machines on same sub network can talk directly (IP layer checks if target IP * subnet mask matches own subnet) -if not on same subnet, message is sent to default gateway, then default gateway etc.. until it goes to ISP routers that know where the routers (with routing tables) actually are. -private IP adresses are not accesbile on the net cause not unique. (NAT is mandatory for outgoing comunnication andport forwarding to have a server always accessible from outside) -private adresses netbloccks are 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 -$ip addr show or $ifconfig to see the network interfaces - -$traceroute hostname; $traceroute ip_adress; $mtr hostname -borh show the the routes traffic might take -hostnames of some of the hops have nearby airpots codes in them. -it uses the fact that routers sends back ICMP error messages when TTL of a massage exprires, so traceroute sends packets with TTL=0, TTL=1 ..etc and sees which routes reported that they expired until it's the destination host - - - -$ping gives RTT (round trip time) -$latency is limited by number of hos and speed of light -$bandiwith (bits.s) / $latency = $amount of data in transit (in bits) - - -The most common configuration for a firewall is to drop any incoming traffic except traffic to (host, port) pairs that are supposed to be receiving connections from the Internet. -This lets the network administrator be sure that other machines on the network β€” like backend databases or administrative systems β€” aren’t going to get direct ttacks from outside. - - -$ethtool : -shows the capabilities of our networl hardware -ethtool -S eth0: gives stat on hardware level for eth0 -ethtool -s eth0 speed 1000 duplex full: sets the speed and duplex - -$arp: - (runs in background to resolve ip adresses) -shows all mac adresses of recent devices in network i talked to. -arp -n: no nicknames - -$wget: -just downlads the webpage if given http:// ip adress of a web server. - -$netstat -s: -option -n no nicknames. -network status information and satistics -$netstat -t -n shows the current tcp connections -$netstat -t -n -l shows only listening ones -if 0.0.0.0:someport means anyone can speak to my listening port -if 127.0.0.1: means only locally listening, only me can talk to me - -$less /etc/services: shows the ports of commons applications -$less /etc/protocols: shows the protocol numbers -" - diff --git a/tips/tmux_tips.md b/tips/tmux_tips.md new file mode 100644 index 0000000..daa50d2 --- /dev/null +++ b/tips/tmux_tips.md @@ -0,0 +1,52 @@ +# TMUX + +Start session +> tmux + +- Named session +> tmux new -s gdb_sess +CTRL-B ? -> helP + +- Detach from session +CTRL-B d + +- Close session: +CTRL-D + +- list sessions +> tmux ls + +- attach to session +> tmuch attach-session -t + +- Attach to last session: +> tmux a +> tmux attach + +CTRL-B w -> Sow all sessions with all their windows +CTRL-B ( -> Next session +CTRL-B ) -> Previous session + +CTRL-B ? -> help + +Windows: + +CTRL-B , -> Rename current window +CTRL-B & -> Close window +CTRL-B p -> Pervious Window +CTRL-B n -> Next Window +CTRL-B l -> Next Window + + +1 window can contain multiple panes + +- Pane creation / modification +CTRL-B % -> New Pane on the right +CTRL-B " -> New Pane on the bottom +CTRL-B { -> Move pane right +CTRL-B } -> Move pane left + +CTRL-B Arrows -> Move between panes +CTRL-B ; -> Last active pane +CTRL-B x -> Close current pane +CTRL-B z -> Zoom on pane diff --git a/tips/tips.md b/tips/vim_tips.md similarity index 72% rename from tips/tips.md rename to tips/vim_tips.md index b2f8e73..7d5036b 100644 --- a/tips/tips.md +++ b/tips/vim_tips.md @@ -117,88 +117,3 @@ CTRL-A align Input string (/[lrc]+\*{0,2}/) stick_to_left { 'stick_to_left': 1, 'left_margin': 0 } stick_to_left { 'stick_to_left': 0, 'left_margin': 1 } *_margin { 'left_margin': 0, 'right_margin': 0 } - - -# TMUX - -Start session -> tmux - -- Named session -> tmux new -s gdb_sess -CTRL-B ? -> helP - -- Detach from session -CTRL-B d - -- Close session: -CTRL-D - -- list sessions -> tmux ls - -- attach to session -> tmuch attach-session -t - -- Attach to last session: -> tmux a -> tmux attach - -CTRL-B w -> Sow all sessions with all their windows -CTRL-B ( -> Next session -CTRL-B ) -> Previous session - -CTRL-B ? -> help - -Windows: - -CTRL-B , -> Rename current window -CTRL-B & -> Close window -CTRL-B p -> Pervious Window -CTRL-B n -> Next Window -CTRL-B l -> Next Window - - -1 window can contain multiple panes - -- Pane creation / modification -CTRL-B % -> New Pane on the right -CTRL-B " -> New Pane on the bottom -CTRL-B { -> Move pane right -CTRL-B } -> Move pane left - -CTRL-B Arrows -> Move between panes -CTRL-B ; -> Last active pane -CTRL-B x -> Close current pane -CTRL-B z -> Zoom on pane - -## Vim Autocompletion - -CTRL-P CTRL-N previos and next completion -When con templating a completion use CTRL-b CTRL-f to scroll doc -CTRL-SPACE force completion list showing (insert mode only) -CTRL-e exit completion - confirm completion -TODO describe how snippet engine are configure - -snippet completion: -For a snippet use tab to move between sniffet fields to fill ($1, $2, $3 ...) - -## Vim explorer -g? - opens help -f - live filtering -F - Clear live filter - -## Copilot - -#### Insert mode -accept = "", -accept_word = "", -accept_line = "", -next = "", -prev = "", -dismiss = "", -panel = "", or "cp" in normal mode - -# Search -\ matches bar but neither foobar nor barbaz nor foobarbaz.