Vim Useful Commands List - 1

Vim Useful Commands List - 1 Command Description i insert - insert new text before cursor x delete current character X backspace delete previous character i insert - insert new text before cursor x delete current character X backspace delete previous character u undo Escape change to command mode o new line below O new line above dd cut current line dw cut current word p paste before P paste after /[search_string] find [search_string] n next result N previous result /( find next opening parentesis % jump to matching parentesis ci( change all text inside brackets () di( delete all text inside brackets () w next word Ctrl-D move down a page (around 15 lines) Ctrl-U move up a page (around 15 lines) :new [filename] open a new [filename] to edit (can {tab} to see list) Ctrl-w w switch down between windows / buffers Ctrl-w W switch up between windows / buffers Ctrl-w N Convert terminal into a “normal mode” buffer :ls list opened buffers / files opened for edit :wa write all - save all opened files :bd buffer delete - to close current buffer :term opens terminal in separate window yw yank / copy word yy yank / copy line

April 12, 2024 · 1 min

Bash Prompt and ls Alias

Prompt: [2020-03-13][23:49:21] [pi@raspberry:~] Add at the end of ~/.profile ##### modify standard command prompt # \n = new line; \u = current username; \w = current working dir (home = ~) ##### Colors # Black 0;30 Dark Gray 1;30 # Blue 0;34 Light Blue 1;34 # Green 0;32 Light Green 1;32 # Cyan 0;36 Light Cyan 1;36 # Red 0;31 Light Red 1;31 # Purple 0;35 Light Purple 1;35 # Brown 0;33 Yellow 1;33 # Light Gray 0;37 White 1;37 export PS1="\[\033[0;33m\][\D{%Y-%m-%d}][\t]\[\033[0;36m\] [\u\[\033[0;37m\]@\[\033[0;36m\]\h:\[\033[0;32m\]\w]\[\033[0m\] \n$ " ##### Modify default ls command # -G colorizes output # -h makes sizes human readable # -F throws a / after a directory, * after an executable, and a @ after a symlink # -l listing format (as opposed to default wide) # -a shows all files (even hidden) alias ls='ls -laGFh'

March 13, 2020 · 1 min

Check Speed of Dns Servers wtih Dig

Check the speed of OpenDNS and Google Public DNS servers OpenDNS Server addresses: 208.67.222.222 208.67.220.220 Google Public DNS Server addresses: 8.8.8.8 8.8.4.4 Test Server: brooklyn-chess.com echo OpenDNS ... ; dig @208.67.222.222 brooklyn-chess.com | grep Query; dig @208.67.220.220 brooklyn-chess.com | grep Query; echo Google DNS ... ; dig @8.8.8.8 brooklyn-chess.com | grep Query; dig @8.8.4.4 brooklyn-chess.com | grep Query;

November 16, 2019 · 1 min

Bash Profile Settings 1

Color Prompt for Bash [2017-04-14][20:52:25] [myusername@mypcname:~] $ Modify .bash_profile, .profile, or .bashrc (if using bash) $ cat .bash_profile ##### modify standard command prompt # \n = new line; \u = current username; \w = current working dir (home = ~) ##### Colors # Black 0;30 Dark Gray 1;30 # Blue 0;34 Light Blue 1;34 # Green 0;32 Light Green 1;32 # Cyan 0;36 Light Cyan 1;36 # Red 0;31 Light Red 1;31 # Purple 0;35 Light Purple 1;35 # Brown 0;33 Yellow 1;33 # Light Gray 0;37 White 1;37 export PS1="\[\033[0;35m\][$(date +%H:%M)]\[\033[0;36m\] [\u\[\033[0;37m\]@\[\033[0;36m\]\h:\[\033[0;32m\]\w]\[\033[0m\] \n$ " # or # export PS1="\[\033[0;33m\][\D{%Y-%m-%d}][\t]\[\033[0;36m\] [\u\[\033[0;37m\]@\[\033[0;36m\]\h:\[\033[0;32m\]\w]\[\033[0m\] \n$ " ##### Modify default ls command # -G colorizes output # -h makes sizes human readable # -F throws a / after a directory, * after an executable, and a @ after a symlink # -l listing format (as opposed to default wide) # -a shows all files (even hidden) alias ls='ls -laGFh' ##### add ~/scripts/wicked to the path export PATH="$PATH:$HOME/scripts/wicked"

April 14, 2017 · 1 min