spacemacs各种问题修复方法

快捷键操作时报 tr不是内部命令

------说明是缺少tr命令,win10可以安装coreutils for gnuwin32工具集,然后把bin目录加到系统path路径即可

没有ispell, flycheck error

------缺少ispell命令,windows下面用aspell替换,需要安装msys2的mingw64,然后用pacman安装aspell,然后在.spacemacs文件中修改

user-config,添加一下内容(或者把mingw64安装目录的etc/mingw64/bin加入path环境变量)

(add-to-list 'exec-path "d:/software/msys2/mingw64/bin")
  (setq ispell-program-name "aspell")
  (setq ispell-personal-dictionary "d:/software/msys2/mingw64/lib/aspell-0.60/en_GB")
打开.spacemacs里面的layers里面的org后启动emacs报org错误

------找到.emacs.d目录,然后删除elpa目录里面的projectile-xxxxxx文件夹,然后重启emacs即可

wrong type value: commandb, helm-do-xxx

------将msys2\usr\bin路径加入Path环境变量,需要用bin里面的grep命令

no such file or directory: helm-org

------   dotspacemacs-additional-packages '(helm-org)   增加helm-org包

invalid coding system utf-8 specified

------ (define-coding-system-alias 'UTF-8 'utf-8) 加入到.spacemacs的user-config中

将c编辑器的tab修改为4个空格

------ 在.spacemacs的user-config中加入

(setq c-basic-offset 4)

  1. warning:spacemacs默认字体”Source Code Pro”不存在。

    解决方法如下:将 Source Code Pro 改为 Courier New 即可


    推荐方法是:

    首先是下载Source Code Pro字体,github上的比较慢,下面网址的很快

    http://www.fontsquirrel.com/

    然后/usr/share/fonts/ 下新建一个目录

    sudo mkdir /usr/share/fonts/opentype

    接着解压下载的字体到该目录下,然后执行

    sudo fc-cache -f -v       使字体生效

  2. win10缺少clang支持
    LLVM Download Page,安装即可

  3. 符号定义和引用跳转缺失
    开启gtags layer,创建default的tags即可

  4. 修复spacemacs打开文件慢的问题
    (setq inhibit-compacting-font-caches t)

  5. projectile打开文件列表慢的问题(spc p f)
    (setq projectile-enable-caching t) 从第二次开始就会变快,第一次需要初始化缓存

  6. projectile忽略不需要的文件目录的办法,避免文件过多查找慢
    官方添加ignore files的方法:在工程根目录添加一个.projectile文件,然后在里面添加
    -/log -/tmp -/vendor -/public/uploads 官方文档如下: http://projectile.readthedocs.io/en/latest/usage/ 31

  7. 工程比较大的时候spc s p会比较慢,还会卡死
    搜索工具会按照这个优先级使用搜索命令,默认ag是不安装的,
    需要安装silverxxx-ag工具来添加ag命令。ag比grep要快很多,如果ag的速度还不够,需要改用rg,rg可以使用color-rg,
    速度比ag还要快,下载地址:https://github.com/manateelazycat/color-rg,下载后放在private目录

    或者更改到develop分支,develop分支的search-tools最高优先级为rg

  8. emacs源更新慢,卡在启动下载界面

    master 分支

    添加下面的代码到.spacemacsdotspacemacs/user-init()

    (setq configuration-layer--elpa-archives
        '(("melpa-cn" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")
          ("org-cn"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/org/")
          ("gnu-cn"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")))
    

    develop 分支

    使用 configuration-layer-elpa-archives 代替原来的 configuration-layer--elpa-archives-- 换成 -

    (setq configuration-layer-elpa-archives
        '(("melpa-cn" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")
          ("org-cn"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/org/")
          ("gnu-cn"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")))
    

  9. 工程比较大的时候,spc p f显示文件列表很慢,是因为用git或者find慢,加速方法
    使用spc f L, 用locate命令helm-locate. helm-projectile-find-file有native和alien两种方式,如果工程根目录下有.git目录并且仅有这一个,那么默认用git命令,并且可以忽略gitignore和.projectile里面忽略的目录文件;否则会用find命令查找,前面的忽略方式就没用了

  10. 启动emacs时报错:symbol is xxxx(函数名)
    一般出现这种问题是.emacs.d elpa目录下的某些xx.elc文件跟当前的emacs版本不匹配, 可以找到类似名称的elc文件删掉, 或者暴力删掉所有的elc文件,之后重启

  11. emacs内部无法切换系统的中文输入法
    在/etc/environment文件中追加export LC_CTYPE="zh_CN.UTF-8"
    执行sudo locale-gen
    重启
    或者用另一个方法:在~/.profile里面添加export LC_CTYPE=zh_CN.UTF-8 保存即可

  12. windows平台用spacemacs develop分支, 报ls-lisp-use-insert-directory-program is nil
    在.spacemacs文件中的defun dotspacemacs/init () 的 setq-default 中添加 ls-lisp-use-insert-directory-program t 即可

  13. 安装cmake-language-server:
    需要python3    

    python3 -m pip install <pkg>

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值