unix editor notes (emacs and vi)

 
######################## 
####   emacs memo   #### 
######################## 
 
C-f    # next char 
C-b    # prev char 
alt-f  # next word 
alt-b  # prev word 
 
C-n    # next line 
C-p    # prev line 
C-v    # next page (page down) 
alt-v  # prev page (page up) 
 
alt-d  # delete word forward 
alt-[backspace]  # delete word backward 
 
C-a    # beginning of line 
C-e    # end of line 
C-k    # del the rest of line 
 
C-space # select 
C-w     # cut 
C-y     # paste 
 
C-x u  # undo 
C-g    # cancel 
 
C-s    # search 
C-r    # search (rev) 
 
alt-%  # search-string[ret] replace[ret]              # replace one-by-one 
alt-x  # replace-string[ret] oldstr[ret] newstr[ret]  # replace everything 
 
C-q C-j  #  newline 
 
alt-x  # toggle-truncate-lines  # no line wrapping 
 
C-x C-u # upper case 
C-x C-l # lower case 
 
alt-<   # beginning of file 
alt->   # end of file 
 
C-x 2   # vertical split 
C-x 3   # horizontal split 
C-x 0   # del the current window 
C-x 1   # del the other window 
C-x o   # move to other window 
 
C-x C-f # open a new file 
 
# cfg file location  ~/.emacs.d/init.el    ## formerly  ~/.emacs  or ~/.emacs.el 
 
## 
## how to change color in emacs 
## 
 
Alt-x (aka M-x) list-faces-display   ## this will open up a new window 
C-x o                                ## move to that window 
(Enter into the color that you wanna change) 
Enter onto [Choose] and [Apply and Save] and exit emacs. this will update ~/.emacs.d/init.el 
 
## 
##  prevent auto indent 
## 
 
(electric-indent-mode -1)   ;; prevent auto indent 
 
;; (ref) https://emacs.stackexchange.com/questions/3322/python-auto-indent-problem 
 
 
 
####################### 
####    vi memo    #### 
####################### 
 
h   left 
j   down 
k   up 
l   right 
 
esc   control mode 
i     edit mode 
 
dd    cut line 
yy    copy line 
0     beginning of line 
^     beginning of line 
$     end of line 
G     end of file 
p     paste 
x     delete 
u     undo 
e     end of word 
 
/hoge   # search for "hoge" 
 

  1. 2013-11-24 23:20:00 |
  2. Category : unix
  3. Page View:

Google Ads