我正在使用spacemacs:https : //github.com/syl20bnr/spacemacs
我已经尝试了两个用户钩子位置来覆盖cmd-k kill-buffer而不是delete-window。但是,当我重新启动时,两者均无效。
(defun dotspacemacs/user-init ()
"Initialization function for user code.
It is called immediately after `dotspacemacs/init'. You are free to put any
user code."
(defun dotspacemacs/user-init ()
(global-set-key (kbd "s-k") 'kill-buffer)
)
)
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
(global-set-key (kbd "s-k") 'kill-buffer)
)
Run Code Online (Sandbox Code Playgroud)
调试此问题的最佳方法是什么?
我使用 spacemacs 和 Flycheck-eslint 作为 linter 来检查我的 React 代码。
这是我的项目.eslintrc,
{
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"semi": [0, "never"],
"eqeqeq": 2,
"no-console": 1,
"no-unused-vars": [1, {"vars": "all", "args": "after-used"}],
"comma-spacing": [2, {"before": false, "after": true}],
"react/prop-types": [2, {
"ignore": ["dispatch"]
}]
},
"globals": {
"__DEV_MODE__": true,
"__API_SERVER__": true
} …Run Code Online (Sandbox Code Playgroud) 几乎就是标题所说的.无论出于何种原因projectile-invalidate-cache,不会从射弹的缓存中删除死文件,或者至少不会从它呈现给我的结果中移除死文件.我正在使用Spacemacs,它是Emacs的扩展,但我相信这个问题是针对抛射物的.
重新启动编辑器无法解决问题.
我可以在spacemacs中打开外壳程序吗(在我的代码窗口旁边的单独窗口中,我可以切换到它并发出命令)?就像打开python解释器,运行测试或我可以在终端上完成的任何简单任务一样。
我正在使用Spacemacs在Clojure中编写程序.我希望能够折叠docstrings.我已经尝试选择文档字符串并按下z a,但最终会折叠整个函数体.
具体来说,我希望能够解决这个问题:
(defn flip-and-vectorize
"Returns a vector with the arguments flipped so that
`(flip-and-vectorize 1 2)`
returns the following vector
`[2 1]`"
[a b]
[b a])
Run Code Online (Sandbox Code Playgroud)
变成类似于此的东西
(defn flip-and-vectorize
"..."
[a b]
[b a])
Run Code Online (Sandbox Code Playgroud)
编辑:
即使能够折叠任意线也是可以接受的; 意味着上面函数的折叠版本看起来像这样:
(defn flip-and-vectorize
...
[a b]
[b a])
Run Code Online (Sandbox Code Playgroud)
这意味着折叠逻辑不需要理解"文档字符串"是什么,而只是折叠选定的行.
我最近在Windows上安装了Spacemacs。“智能搜索”命令SPC /不起作用。当我按SPC /我得到错误:
Wrong type argument: commandp, helm-do-grep
似乎有一些问题提到了这个-https://github.com/syl20bnr/spacemacs/issues/8463
有人知道怎么回事吗?
免责声明:我对 spacemacs 和 emacs 很陌生,所以我可能遗漏了一些非常明显的东西。每当我尝试在 javascript 文件(使用 js2-mode)中使用自动完成功能时,我都会收到以下消息:
Error running timer `ac-update-greedy': (error "js2-name-node-name accessing a non-js2-name-node")
Error running timer `ac-show-menu': (error "js2-name-node-name accessing a non-js2-name-node")
Run Code Online (Sandbox Code Playgroud)
这是我的 ~/.spacemacs 文件:
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
;; or `spacemacs'. (default 'spacemacs)
dotspacemacs-distribution 'spacemacs
;; …Run Code Online (Sandbox Code Playgroud) 我的 spacemacs 是 0.200.3@25.1.1
每次启动spacemacs时都会收到警告,如何解决?
警告: -
dotspacemacs-configuration-layers' was changed outside ofdotspacemacs/layers'。
我想在spacemacs工作更漂亮.
我(prettier-js :location (recipe :url "https://raw.githubusercontent.com/prettier/prettier/master/editors/emacs/prettier-js.el" :fetcher url))有点工作,但然后在消息我看到
Contacting host: raw.githubusercontent.com:443
Wrote /Users/travis/.emacs.d/.cache/quelpa/build/prettier-js/prettier-js.el
File: /Users/travis/.emacs.d/.cache/quelpa/build/prettier-js/prettier-js.stamp
Error getting PACKAGE-DESC: (search-failed ;;; prettier-js.el ends here)
Cannot load prettier-js
Run Code Online (Sandbox Code Playgroud)
我不知道有足够的emacs知道PACKAGE-DESC的功能,或者我是否需要它来加载更漂亮.
我试图在私有层中执行此操作
文档说:
将其添加到您的init
(require 'prettier-js)
(add-hook 'js-mode-hook
(lambda ()
(add-hook 'before-save-hook 'prettier-before-save)))
Run Code Online (Sandbox Code Playgroud)
我想我应该有类似的东西:
(defun myJS/post-init-prettier-js ()
"Initialize prettier-js"
(use-package prettier-js)
:defer t
:init
(progn
(add-hook 'before-save-hook 'prettier-before-save)
)
)
Run Code Online (Sandbox Code Playgroud)
在我的图层中
spacemacs ×10
emacs ×4
clojure ×1
code-editor ×1
code-folding ×1
flycheck ×1
highlight ×1
javascript ×1
prettier ×1
projectile ×1
yellow ×1