zoukankan      html  css  js  c++  java
  • 关于之前玩emacs记的些笔记

    移动
    C-v 向前翻页
    M-v 向后翻页
    C-l 当前行居中显示 继续按会依次到上,下,中
     
    C-x C-c 退出
    C-g    退出一个正在运行的命令,还可以取消数字参数和只输入到一半的命令
     
     
    光标控制
    C-p     previous
    C-n     next
    C-M-p    多行向上
    C-M-n    多行向下
    C-f    forward
    C-b    backward
    M-f    forward a word
    M-b    backward a word
    通常的惯例是:META 系 列组合键用来操作“由语言定义的单位(比如词、句子、段落)”,而 CONTROL 系列组合键用来操作“与语言无关的基本单位(比如字符、行等等)”。
    C-a
    C-e
    M-a
    M-e
    M-<        move to document begin
    M->        move to document end
    C-u 数字 命令    数字前缀,执行多少次
     
     
    窗口
    C-x 1 只保留当前一个窗口
     
    帮助
    C-h k 快捷键          查看快捷键详细文档  
    C-h t             打开tutorial
    C-h c 快捷键        查看命令定义
    C-h f 函数名
    C-h v            显示emacs变量的文档
    C-h a xxx        相关命令搜索
     
     
    插入与删除
    C-u 8 字符        insert how many chars
    <DEL>            删除光标前的字符
    C-d            删除光标指向的字符
    M-<DEL>        移除前一个单词
    M-d            移除光标后一个词
    C-k            移除到行尾
    M-k            移除到句尾
    C-<SPC>高亮文本,再C-w移除高亮文本            注意删除和移除不同
    C-y        恢复移除的文字
    M-y        循环之前移除的内容
     
    撤销
    C-/            等价于 C-x u
     
    文件
    C-x C-f 文件名        打开文件
    C-x C-s [文件名]             保存文件
    第一次存盘的时候 Emacs 会将原文 件重命名以备份。重命名的规则通常是在原文件名之后添加一个“~”字符。
    关掉文件备份可以用如下命令: M-x customize-variable <Return> make-backup-files <Return>】
     
    缓冲区
    C-x C-b    列出缓冲区
    C-x b 缓冲区名        切换缓冲区
    C-x s        保存多个缓冲区
     
    命令集扩展
    C-x     字符扩展,之后输入另一个字符或者组合键
    M-x    命令字扩展,之后输入一个命令名
    M-x repl s<Return>changed<Return>altered<Return>        替换文本
     
    自动保存
        Emacs 会定期将正在编 辑的文件写入一个“自动保存”文件中。自动保存文件的文件名的头尾各有一个 “#”字符,比如你正在编辑的文件叫“hello.c”,那么它的自动保存文件就叫 “#hello.c#”。这个文件会在正常存盘之后被 Emacs 删除。
        所以,假如不幸真的发生了,你大可以从容地打开原来的文件(注意不是自动保 存文件)然后输入 M-x recover file <Return> 来恢复你的自动保存文件。在 提示确认的时候,输入 yes<Return>。
     
    切换模式
    M-x text-mode
    M-x fundamental-mode
    C-h m                    查看模式的文档
    M-x auto-fill-mode     开启/关闭自动折行
    M-x linum-mode        开启行号
    M-x eval-buffer
    M-x load-theme         加载主题
    M-x package-list-packages          打开包管理系统
    i 安装
    u undo
    d 删除
    x 执行操作
    U    更新所有package
    M-x package-autoremove
    M-x custom-group        配置模式的配置
    M-x find-function        查看函数定义
    M-x find-variable
    M-x find-function-on-key
     
    搜索
    C-s
    C-r
     
    多窗格管理
    C-x 2         会分成上下两块
    C-x 3         会左右分割
    C-M-v        会滚动另一个窗格
    C-M-S-v        向上滚动另一个窗格
    C-x o        光标遍历窗格
    C-x 4 C-f     在新窗格打开文件    
     
    多窗口管理
    M-x make-frame        新建一个窗口
     
    三次ESC        比C-g的优点在于可以退出递归编辑
     
    M-<RET>        自动调整标号顺序 

    ---

    spacemacs

    SPC
    SPC     M-x
    TAB    last buffer
    '        open shell
    *        search current word in project
    /         search project
    1-9    select window
    ;        evil comment
    ?        show keybinding
    v        expand regions
    f1        helm apropos
     
    SPC a
    d    dired
    o    org mode
     
    SPC b
    b        list buffers
    d        kill this buffer
    e        safe erase buffer
    f        reveal in osx finder
    h        switch to home buffer
    m        switch to message buffer
    N n        new empty buffer
    x        kill buffer and window
    P        copy clipboard to whole buffer
    Y        copy whole buffer to clipboard
    C-d        kill other buffers
     
    SPC d
    d            dash at point
     
    SPC e
    l            flycheck error list 
     
    SPC f
    A            find file and repalce buffer
    C d/u        unix2dos/dos/2unix
    c            copy file
    E            sudo edit
    e d            find dotfile
    e R            sync configuration
    e U            update packages
    f            helm find files
    h            hexl find file 二进制打开文件 ,x ,X进行十六进制编辑
    i            insert file
    j            dired jump
    r            helm recentf
    s            save buffer
    y y            copy file path
     
    SPC g
    s            magit status        s添加staged        cc 提交commit
     
    SPC h
    SPC        helm spacemacs help
    d            help describe        
    l            helm spacemacs help layer
     
    SPC i
    l p        插入一段随机单词列表
    p            插入随机生成密码
    U        插入随机UUID
     
    SPC j
    i            helm jump in buffer   会列出函数,类定义等
    j            avy timer
    l            avy line
     
    SPC m (,)  -> python
    =            fotmat buffer
    c c            python execute file
    g a        find assignment
    g g        jump to definition
    g G        jump to definition other window
    g u         find references
    h d        helm pydoc
    t            test
    v            virtualenv
     
    SPC o
    y            有道词典查光标指定的词
     
    SPC p
    f        helm projectile find file
    p        helm switch project
     
    SPC q
    Q        kill emacs
    q         prompt exit emacs
    R        restart emacs
    s        save buffers kill emacs
     
    SPC s
    s            helm swoop
    p            search project
    c            clear search highlight
     
    SPC w
    -/s            split below
    / 或v            split right
    [            进入windows resize
    d            delete window
    M            swap window
    m            最大化当前buffer
    S            水平分割并移动焦点
    V            垂直分割并移动焦点
    w            other window
    x            kill buffer and window
     
    跳转总结
    SPC j j        屏幕内定位
    H M L        直接移动到屏幕头中底部
    SPC s s        buffer内定位
    /                buffer内定位
    SPC /            项目内定位
     
    z
    z            将当前行移动到屏幕中间
    a            toggle fold
    r            解开所有折叠
    m            折叠所有
     
    g
    d                jump to definition
    D                jump to definition other window
    y                copy and commit line
     
    SPC t
    l                toggle line wrap
     
     ----
    spacemacs dired 使用
    d        delete
    u        undelete
    x         punge
    =        file diff
    C        copy
    T        touch 修改时间戳,基于标记
    G        chgrp
    D        do delete 
    Z        压缩
    y        显示文件类型
    ^        上级目录 
    ------
    doom emacs
    SPC
    DEL            blink current line
    RET            create of jump to bookmarks
    SPC            find file in project
    '                resume last search
    *            search for symbol in project
    ,            switch to workspace buffer
    .            find file
    :            M-x
    ;                eval expression
    <                switch to buffer
    `            switch to last buffer
    x            pop up scratch buffer
    ~            toggle last popup
     
    SPC /
    k                look up in all docsets
    o                look up online
    b                search current buffer
    d                search current directory
    f                locate file
    i                jump to symbol
    p                search project
     
    SPC b
    k                kill buffer
     
    SPC c
    D                jump to reference
    d                jump to definition
    f                format buffer/region
    k                jump to documentation
    r                open REPL (python)
    x                list errors
    e                eval buffer/region
     
    SPC f
    .                find file
    / 或者 f                find file from here
    p             browser private config
    R                recent project file
    l               locate file
    r            recent file
    y                yank file name
     
    SPC g
    g                    magit status
     
    SPC i
    s                    insert snippet
     
    SPC o 
    -             dired
    e            open eshell 
    b            default browser (open)
    o            reveal in finder
     
    SPC p
    /                    find file in project
    p                    switch project
     
    SPC q
    q                quit emacs
    r                restart & restore emacs
     
    SPC w
    s                split window
    v                vsplit window
    c                delete window
    o                window enlarge
    h/j/k/l            move to left/down/up/right window
    r                rotate window
     
    文件跳转
    SPC SPC                jump to file in project
    SPC .                jump to file from current directory
     
    项目 搜索&替换
    SPC / b
    SPC / p
    SPC / d
    -----
    现在doom emacs 的配置 config.el
    ;;; .doom.d/config.el -*- lexical-binding: t; -*-
    
    ;; Place your private configuration here
    (after! org
      (dolist (face '(org-level-1
                      org-level-2 org-level-3
                      org-level-4 org-level-5
                      org-level-6 org-level-7
                      org-level-8))
        (set-face-attribute face nil :weight 'normal))
      )
    
    (setq doom-font (font-spec :family "DejaVuSansMono Nerd Font Mono" :size 13))
    ;; (set-face-attribute 'org-table nil :family “Inconsolata”)
    ;; (setq doom-font (font-spec :family "Sarasa Term SC" :size 15))
    
    (set-frame-position (selected-frame) 400 150)
    (pushnew! initial-frame-alist '(width . 100) '(height . 40))
    ;; (load-theme 'doom-gruvbox t)
    
    
    (def-package! pyim
      :ensure nil
      :demand t
      :config
      ;; 激活 basedict 拼音词库,五笔用户请继续阅读 README
      (use-package pyim-basedict
        :ensure nil
        :config (pyim-basedict-enable))
    
      (setq default-input-method "pyim")
    
      ;; 我使用全拼
      (setq pyim-default-scheme 'quanpin)
    
      ;; 设置 pyim 探针设置,这是 pyim 高级功能设置,可以实现 *无痛* 中英文切换 :-)
      ;; 我自己使用的中英文动态切换规则是:
      ;; 1. 光标只有在注释里面时,才可以输入中文。
      ;; 2. 光标前是汉字字符时,才能输入中文。
      ;; 3. 使用 M-j 快捷键,强制将光标前的拼音字符串转换为中文。
      (setq-default pyim-english-input-switch-functions
                    '(pyim-probe-dynamic-english
                      pyim-probe-isearch-mode
                      pyim-probe-program-mode
                      pyim-probe-org-structure-template))
    
      (setq-default pyim-punctuation-half-width-functions
                    '(pyim-probe-punctuation-line-beginning
                      pyim-probe-punctuation-after-punctuation))
    
      (setq pyim-punctuation-dict nil)
      ;; 开启拼音搜索功能
      ;; (pyim-isearch-mode 1)
    
      ;; 使用 pupup-el 来绘制选词框, 如果用 emacs26, 建议设置
      ;; 为 'posframe, 速度很快并且菜单不会变形,不过需要用户
      ;; 手动安装 posframe 包。
      (setq pyim-page-tooltip 'posframe)
    
      ;; 选词框显示5个候选词
      (setq pyim-page-length 5)
    
      :bind
      (("s-j" . pyim-convert-string-at-point) ;与 pyim-probe-dynamic-english 配合
    ))
    
    ;; (setq org-agenda-files (list "~/Documents/org/todo.org"))
    ;; (after! anaconda-mode (setq anaconda-mode-localhost-address "localhost"))
    
    (display-time-mode t)
    
    (map!
      :leader
      :g "j" 'avy-goto-char-timer)
    
    (after! avy
      (setq avy-timeout-seconds 5))
    
    ;; (toggle-truncate-lines)
    (+global-word-wrap-mode t)
    
    ;; (def-package! nov
    ;;   :ensure nil
    ;;   :config
    ;;   (add-to-list 'auto-mode-alist '("\.epub\'" . nov-mode)))
    ;;   (add-to-list 'auto-mode-alist '("\.epub\'" . nov-mode)))
    (add-to-list 'auto-mode-alist '("\.epub\'" . nov-mode))
     
  • 相关阅读:
    运算符
    数据类型
    试题汇总
    文件读写
    Python操作
    字符串常用函数 void
    向量叉乘求任意多边形面积,凹凸均可 void
    约瑟夫问题各种求解办法 void
    大数类相关计算(c语言版) void
    求解一元多次方程(迭代法) void
  • 原文地址:https://www.cnblogs.com/junmoxiao/p/11774740.html
Copyright © 2011-2022 走看看