App-Cheats

 view release on metacpan or  search on metacpan

cheats.txt  view on Meta::CPAN

# Get info about current xterm window
xdpyinfo

# Get size info of a named xterm window
xwininfo -name omsGUI_0_3

# Get info about an xterm window
xprop -id <window_id>
xprop -id 0x2400022

# Get position of the cursor
perl -e '$/ = "R";' -e 'print "\033[6n";my $x=<STDIN>;my($n, $m)=$x=~m/(\d+)\;(\d+)/;print "Current position: $m, $n\n";'

# Print how many columns and rows an xterm window uses for its screen size
tput cols
tput lines
reset

# Change fond/colors of an xterm window
RESTORE='\033[0m'
RED='\033[00;31m'

cheats.txt  view on Meta::CPAN


# Delete all tab completions (Bash,Tab,auto)
complete -r

# Use existing autocompletions
complete -p | grep ls      # finds _longopt
complete -F _longopt my_function

# Bash autocomplete special variables
# COMP_WORDS is an array containing all individual words in the current command line.
# COMP_CWORD is an index of the word containing the current cursor position.
# COMPREPLY is an array variable from which Bash reads the possible completions.

# Tab completions source of bash commands (Bash,Tab,auto)
vi /etc/bash_completion
vi /usr/share/bash-completion/bash_completion

# Generate autocompletion for own scripts (Bash,Tab)
bash_autotab(){
#  COMPREPLY=( $(compgen -W "$*" -- "${COMP_WORDS[COMP_CWORD]}") )
#

cheats.txt  view on Meta::CPAN

# CSS for the loading spinner
.center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.loading-svg {
  width:  5.7375rem;
  height: 2.23125rem;
  cursor: pointer;
}
.loading-svg svg > path, .loading-svg svg > ellipse, .loading-svg svg > rect {
  fill: #888;
}
.loading-svg svg > .thicker {
  fill: #888;
}
.loading-svg svg > .thinner {
  fill: #777;
}

cheats.txt  view on Meta::CPAN


# Reduce blinking (pi)
sudo vi /boot/config.txt
/ hdmi_mode=82				# Original
# https://elinux.org/RPiconfig
82		1080p		60Hz	Original
83		1600x900        	Reduced blanking. Too small. Must scroll, plus keyboard is mostly gone)
84		2048x1152       	Reduced blanking. Double size. Unreadable
85		720p		60Hz	Good. But need to scroll

# Smart toggle (enable/disable) mouse cursor (pi)
# Remove/add "-nocursor" to this line:
# MUST first mount / then restart
sudo mount -o remount,rw /
sudo vi /etc/lightdm/lightdm.conf
/ xserver-command=X -nocursor
sudo reboot


#############################################################
## PI - Shortcuts
#############################################################

# Open Terminal on Linux (pi)
Control + Alt + T

cheats.txt  view on Meta::CPAN


# Allow writing to flash drives
sudo chown $USER:$USER /media/<USER>-srto/ -R


#############################################################
## Ubuntu - Update Error
N#############################################################

# Problem: Did a partial upgrade,
# 	Ubuntu restarted to a black screen and a blinking cursor.
# Fix:
Control + Alt + F2	# At the same time
#
# Login to PC
#
# Finish upgrade
sudo apt update
sudo apt dist-upgrade
sudo startx

cheats.txt  view on Meta::CPAN

+
+ endfunction
+
+ :command! -nargs=1 E call CustomEdit(<f-args>)


#############################################################
## Vim Inserting Text
#############################################################

# Insert before cursor (Vim)
i

# Insert before line (Vim)
I

# Append after cursor (Vim)
a

# Append after line (Vim)
A

# Open a new line after current line (Vim)
o

# Open a new line before current line (Vim)
O

cheats.txt  view on Meta::CPAN

lb

# Select again the last visual selection (Vim)
gv


#############################################################
## Vim Deleting Text
#############################################################

# Delete character to the right of cursor (Vim)
x

# Delete character to the left of cursor (Vim)
X

# Delete to the end of the line (Vim)
D

# Delete current line (Vim)
dd

# Delete current line (Vim)
:d

cheats.txt  view on Meta::CPAN

# Allow folding of perl code (Vim)
let perl_fold=1

# Can put in rc file. related to folding. not sure (Vim)
:setlocal foldmethod=syntax
inoremap <F9> <C-O>za
nnoremap <F9> za
onoremap <F9> <C-C>za
vnoremap <F9> zf

# Close a fold (depends on cursor) (Vim)
zc

# Close all fold (depends on cursor) (Vim)
zC

# Open a fold (depends on cursor) (Vim)
zo

# Open all fold (depends on cursor)
zO

# Toggle/Alternate a fold (depends on cursor) (Vim)
za

# Toggle/Alternate all fold (depends on cursor) (Vim)
zA

# Open a single level of folds (depends on cursor) (Vim)
zr

# Open all more level of folds (seems similar to zA) (Vim)
zR

# Close a single level of folds (Vim)
zm

# Close all more level of folds (seems similar to zC) (Vim)
zM

cheats.txt  view on Meta::CPAN

# Create a tags file (Vim)
sudo apt-get install exuberant-ctags
ctags <c_file>
ctags -f $tag -R $source --totals

# Create tags of all OMS functions  (Vim)
sudo apt-get install exuberant-ctags
ctags `find ~/omspp/trunk/ -type f -name "*.[ch]" -o -name "*.cpp"`
ctags -f $tag_file $(find $oms_tree -type f -name "*.[ch]" -o -name "*.cpp")

# Jump to the tag/function underneath the cursor (Vim)
<Control> + ]
:tag

# Search for a particular tag (Vim)
:ts <tag>

# Go to the next definition for the last tag (Vim)
:tn

# Go to the previous definition for the last tag (Vim)

cheats.txt  view on Meta::CPAN

" this is a comment

# Name of file that is opened in vim
let _curfile = expand("%:t")

# Show line numbers in vim (vimrc)
set number

# Vim resource (vimrc) file. other features.
set nowrap
set cursorline
hi CursorLine term=bold cterm=bold guibg=Grey40
set cursorcolumn

# Do not go past the end of the file when searching (Vim)
set nowrapscan

# View the current file type of a Vim file
:set filetype?

# Check the file type (Vim,xterm,shell)
file ~/bin/enter_ui.sh

cheats.txt  view on Meta::CPAN


# Toggle upp and lower case (Vim)
~

# Toggle case of the next three characters (Vim)
3~

# Toggle case of the next three words (Vim)
g~3w

# Toggle case of the current word (inner word - cursor anywhere in word (Vim)
g~iw

# Toggle case of all characters to end of line (Vim)
g~$

# Toggle case of the current line (Vim)
g~~
V~

# Uppercase the visually-selected text (Vim)



( run in 0.230 second using v1.01-cache-2.11-cpan-4d50c553e7e )