/r/spacemacs
Subreddit for the Spacemacs project
Related Subreddits:
Related Links: * Emacs Stack Exchange
/r/spacemacs
The documentation is in there and it's been giving 404s for days.
Hi, I'm a .Net developer and I saw spacemacs in a blog so I liked it. so I decide to install and give it a try. I'm a Vim user so I choose Vim controls and when I start adding the c# layer there is an error appears whenever I try to open the .cs file:
csharp-mode is part of Emacs as of Emacs 29 spacemacs
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(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
;; Lazy installation of layers (i.e. layers are installed only when a file
;; with a supported type is opened). Possible values are \
all', `unused'`
;; and \
nil'. `unused' will lazy install only unused layers (i.e. layers`
;; not listed in variable \
dotspacemacs-configuration-layers'), `all' will`
;; lazy install any layer that support lazy installation even the layers
;; listed in \
dotspacemacs-configuration-layers'. `nil' disable the lazy`
;; installation feature and you have to explicitly list a layer in the
;; variable \
dotspacemacs-configuration-layers' to install it.`
;; (default 'unused)
dotspacemacs-enable-lazy-installation 'unused
;; If non-nil then Spacemacs will ask for confirmation before installing
;; a layer lazily. (default t)
dotspacemacs-ask-for-lazy-installation t
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (i.e. "~/.mycontribs/")
dotspacemacs-configuration-layer-path '()
;; List of configuration layers to load.
dotspacemacs-configuration-layers
'(
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press \
SPC f e R' (Vim style) or`
;; \
M-m f e R' (Emacs style) to install them.`
;; ----------------------------------------------------------------
;; auto-completion
;; better-defaults
emacs-lisp
omnisharp
;; git
helm
;; lsp
;; markdown
multiple-cursors
;; org
;; (shell :variables
;; shell-default-height 30
;; shell-default-position 'bottom)
;; spell-checking
;; syntax-checking
;; version-control
treemacs)
;; List of additional packages that will be installed without being wrapped
;; in a layer (generally the packages are installed only and should still be
;; loaded using load/require/use-package in the user-config section below in
;; this file). If you need some configuration for these packages, then
;; consider creating a layer. You can also put the configuration in
;; \
dotspacemacs/user-config'. To use a local version of a package, use the`
;; \
:location' property: '(your-package :location "~/path/to/your-package/")`
;; Also include the dependencies as they will not be resolved automatically.
dotspacemacs-additional-packages '()
;; A list of packages that cannot be updated.
dotspacemacs-frozen-packages '()
;; A list of packages that will not be installed and loaded.
dotspacemacs-excluded-packages '()
;; Defines the behaviour of Spacemacs when installing packages.
;; Possible values are \
used-only', `used-but-keep-unused' and `all'.`
;; \
used-only' installs only explicitly used packages and deletes any unused`
;; packages as well as their unused dependencies. \
used-but-keep-unused'`
;; installs only the used packages but won't delete unused ones. \
all'`
;; installs *all* packages supported by Spacemacs and never uninstalls them.
;; (default is \
used-only')`
dotspacemacs-install-packages 'used-only))
(defun dotspacemacs/init ()
"Initialization:
This function is called at the very beginning of Spacemacs startup,
before layer configuration.
It should only modify the values of Spacemacs settings."
;; This setq-default sexp is an exhaustive list of all the supported
;; spacemacs settings.
(setq-default
;; If non-nil then enable support for the portable dumper. You'll need to
;; compile Emacs 27 from source following the instructions in file
;; EXPERIMENTAL.org at to root of the git repository.
;;
;; WARNING: pdumper does not work with Native Compilation, so it's disabled
;; regardless of the following setting when native compilation is in effect.
;;
;; (default nil)
dotspacemacs-enable-emacs-pdumper nil
;; Name of executable file pointing to emacs 27+. This executable must be
;; in your PATH.
;; (default "emacs")
dotspacemacs-emacs-pdumper-executable-file "emacs"
;; Name of the Spacemacs dump file. This is the file will be created by the
;; portable dumper in the cache directory under dumps sub-directory.
;; To load it when starting Emacs add the parameter \
--dump-file'`
;; when invoking Emacs 27.1 executable on the command line, for instance:
;; ./emacs --dump-file=$HOME/.emacs.d/.cache/dumps/spacemacs-27.1.pdmp
;; (default (format "spacemacs-%s.pdmp" emacs-version))
dotspacemacs-emacs-dumper-dump-file (format "spacemacs-%s.pdmp" emacs-version)
;; Maximum allowed time in seconds to contact an ELPA repository.
;; (default 5)
dotspacemacs-elpa-timeout 5
;; Set \
gc-cons-threshold' and `gc-cons-percentage' when startup finishes.`
;; This is an advanced option and should not be changed unless you suspect
;; performance issues due to garbage collection operations.
;; (default '(100000000 0.1))
dotspacemacs-gc-cons '(100000000 0.1)
;; Set \
read-process-output-max' when startup finishes.`
;; This defines how much data is read from a foreign process.
;; Setting this >= 1 MB should increase performance for lsp servers
;; in emacs 27.
;; (default (* 1024 1024))
dotspacemacs-read-process-output-max (* 1024 1024)
;; If non-nil then Spacelpa repository is the primary source to install
;; a locked version of packages. If nil then Spacemacs will install the
;; latest version of packages from MELPA. Spacelpa is currently in
;; experimental state please use only for testing purposes.
;; (default nil)
dotspacemacs-use-spacelpa nil
;; If non-nil then verify the signature for downloaded Spacelpa archives.
;; (default t)
dotspacemacs-verify-spacelpa-archives t
;; If non-nil then spacemacs will check for updates at startup
;; when the current branch is not \
develop'. Note that checking for`
;; new versions works via git commands, thus it calls GitHub services
;; whenever you start Emacs. (default nil)
dotspacemacs-check-for-update nil
;; If non-nil, a form that evaluates to a package directory. For example, to
;; use different package directories for different Emacs versions, set this
;; to \
emacs-version'. (default 'emacs-version)`
dotspacemacs-elpa-subdirectory 'emacs-version
;; One of \
vim', `emacs' or `hybrid'.`
;; \
hybrid' is like `vim' except that `insert state' is replaced by the`
;; \
hybrid state' with `emacs' key bindings. The value can also be a list`
;; with \
:variables' keyword (similar to layers). Check the editing styles`
;; section of the documentation for details on available variables.
;; (default 'vim)
dotspacemacs-editing-style 'vim
;; If non-nil show the version string in the Spacemacs buffer. It will
;; appear as (spacemacs version)@(emacs version)
;; (default t)
dotspacemacs-startup-buffer-show-version t
;; Specify the startup banner. Default value is \
official', it displays`
;; the official spacemacs logo. An integer value is the index of text
;; banner, \
random' chooses a random text banner in `core/banners'`
;; directory. A string value must be a path to an image format supported
;; by your Emacs build.
;; If the value is nil then no banner is displayed. (default 'official)
dotspacemacs-startup-banner 'official
;; Scale factor controls the scaling (size) of the startup banner. Default
;; value is \
auto' for scaling the logo automatically to fit all buffer`
;; contents, to a maximum of the full image height and a minimum of 3 line
;; heights. If set to a number (int or float) it is used as a constant
;; scaling factor for the default logo size.
dotspacemacs-startup-banner-scale 'auto
;; List of items to show in startup buffer or an association list of
;; the form \
(list-type . list-size)`. If nil then it is disabled.`
;; Possible values for list-type are:
;; \
recents' `recents-by-project' `bookmarks' `projects' `agenda' `todos'.`
;; List sizes may be nil, in which case
;; \
spacemacs-buffer-startup-lists-length' takes effect.`
;; The exceptional case is \
recents-by-project', where list-type must be a`
;; pair of numbers, e.g. \
(recents-by-project . (7 . 5))', where the first`
;; number is the project limit and the second the limit on the recent files
;; within a project.
dotspacemacs-startup-lists '((recents . 5)
(projects . 7))
;; True if the home buffer should respond to resize events. (default t)
dotspacemacs-startup-buffer-responsive t
;; Show numbers before the startup list lines. (default t)
dotspacemacs-show-startup-list-numbers t
;; The minimum delay in seconds between number key presses. (default 0.4)
dotspacemacs-startup-buffer-multi-digit-delay 0.4
;; If non-nil, show file icons for entries and headings on Spacemacs home buffer.
;; This has no effect in terminal or if "all-the-icons" package or the font
;; is not installed. (default nil)
dotspacemacs-startup-buffer-show-icons nil
;; Default major mode for a new empty buffer. Possible values are mode
;; names such as \
text-mode'; and `nil' to use Fundamental mode.`
;; (default \
text-mode')`
dotspacemacs-new-empty-buffer-major-mode 'text-mode
;; Default major mode of the scratch buffer (default \
text-mode')`
dotspacemacs-scratch-mode 'text-mode
;; If non-nil, *scratch* buffer will be persistent. Things you write down in
;; *scratch* buffer will be saved and restored automatically.
dotspacemacs-scratch-buffer-persistent nil
;; If non-nil, \
kill-buffer' on scratch buffer`
;; will bury it instead of killing.
dotspacemacs-scratch-buffer-unkillable nil
;; Initial message in the scratch buffer, such as "Welcome to Spacemacs!"
;; (default nil)
dotspacemacs-initial-scratch-message nil
;; List of themes, the first of the list is loaded when spacemacs starts.
;; Press \
SPC T n' to cycle to the next theme in the list (works great`
;; with 2 themes variants, one dark and one light)
dotspacemacs-themes '(spacemacs-dark
spacemacs-light)
;; Set the theme for the Spaceline. Supported themes are \
spacemacs',`
;; \
all-the-icons', `custom', `doom', `vim-powerline' and `vanilla'. The`
;; first three are spaceline themes. \
doom' is the doom-emacs mode-line.`
;; \
vanilla' is default Emacs mode-line. `custom' is a user defined themes,`
;; refer to the DOCUMENTATION.org for more info on how to create your own
;; spaceline theme. Value can be a symbol or list with additional properties.
;; (default '(spacemacs :separator wave :separator-scale 1.5))
dotspacemacs-mode-line-theme '(spacemacs :separator wave :separator-scale 1.5)
;; If non-nil the cursor color matches the state color in GUI Emacs.
;; (default t)
dotspacemacs-colorize-cursor-according-to-state t
;; Default font or prioritized list of fonts. This setting has no effect when
;; running Emacs in terminal. The font set here will be used for default and
;; fixed-pitch faces. The \
:size' can be specified as`
;; a non-negative integer (pixel size), or a floating-point (point size).
;; Point size is recommended, because it's device independent. (default 10.0)
dotspacemacs-default-font '("Source Code Pro"
:size 10.0
:weight normal
:width normal)
;; The leader key (default "SPC")
dotspacemacs-leader-key "SPC"
;; The key used for Emacs commands \
M-x' (after pressing on the leader key).`
;; (default "SPC")
dotspacemacs-emacs-command-key "SPC"
;; The key used for Vim Ex commands (default ":")
dotspacemacs-ex-command-key ":"
;; The leader key accessible in \
emacs state' and `insert state'`
;; (default "M-m")
dotspacemacs-emacs-leader-key "M-m"
;; Major mode leader key is a shortcut key which is the equivalent of
;; pressing \
<leader> m`. Set it to `nil` to disable it. (default ",")`
dotspacemacs-major-mode-leader-key ","
;; Major mode leader key accessible in \
emacs state' and `insert state'.`
;; (default "C-M-m" for terminal mode, "<M-return>" for GUI mode).
;; Thus M-RET should work as leader key in both GUI and terminal modes.
;; C-M-m also should work in terminal mode, but not in GUI mode.
dotspacemacs-major-mode-emacs-leader-key (if window-system "<M-return>" "C-M-m")
;; These variables control whether separate commands are bound in the GUI to
;; the key pairs \
C-i', `TAB' and `C-m', `RET'.`
;; Setting it to a non-nil value, allows for separate commands under \
C-i'`
;; and TAB or \
C-m' and `RET'.`
;; In the terminal, these pairs are generally indistinguishable, so this only
;; works in the GUI. (default nil)
dotspacemacs-distinguish-gui-tab nil
;; Name of the default layout (default "Default")
dotspacemacs-default-layout-name "Default"
;; If non-nil the default layout name is displayed in the mode-line.
;; (default nil)
dotspacemacs-display-default-layout nil
;; If non-nil then the last auto saved layouts are resumed automatically upon
;; start. (default nil)
dotspacemacs-auto-resume-layouts nil
;; If non-nil, auto-generate layout name when creating new layouts. Only has
;; effect when using the "jump to layout by number" commands. (default nil)
dotspacemacs-auto-generate-layout-names nil
;; Size (in MB) above which spacemacs will prompt to open the large file
;; literally to avoid performance issues. Opening a file literally means that
;; no major mode or minor modes are active. (default is 1)
dotspacemacs-large-file-size 1
;; Location where to auto-save files. Possible values are \
original' to`
;; auto-save the file in-place, \
cache' to auto-save the file to another`
;; file stored in the cache directory and \
nil' to disable auto-saving.`
;; (default 'cache)
dotspacemacs-auto-save-file-location 'cache
;; Maximum number of rollback slots to keep in the cache. (default 5)
dotspacemacs-max-rollback-slots 5
;; If non-nil, the paste transient-state is enabled. While enabled, after you
;; paste something, pressing \
C-j' and `C-k' several times cycles through the`
;; elements in the \
kill-ring'. (default nil)`
dotspacemacs-enable-paste-transient-state nil
;; Which-key delay in seconds. The which-key buffer is the popup listing
;; the commands bound to the current keystroke sequence. (default 0.4)
dotspacemacs-which-key-delay 0.4
;; Which-key frame position. Possible values are \
right', `bottom' and`
;; \
right-then-bottom'. right-then-bottom tries to display the frame to the`
;; right; if there is insufficient space it displays it at the bottom.
;; It is also possible to use a posframe with the following cons cell
;; \
(posframe . position)' where position can be one of `center',`
;; \
top-center', `bottom-center', `top-left-corner', `top-right-corner',`
;; \
top-right-corner', `bottom-left-corner' or `bottom-right-corner'`
;; (default 'bottom)
dotspacemacs-which-key-position 'bottom
;; Control where \
switch-to-buffer' displays the buffer. If nil,`
;; \
switch-to-buffer' displays the buffer in the current window even if`
;; another same-purpose window is available. If non-nil, \
switch-to-buffer'`
;; displays the buffer in a same-purpose window even if the buffer can be
;; displayed in the current window. (default nil)
dotspacemacs-switch-to-buffer-prefers-purpose nil
;; Whether side windows (such as those created by treemacs or neotree)
;; are kept or minimized by \
spacemacs/toggle-maximize-window' (SPC w m).`
;; (default t)
dotspacemacs-maximize-window-keep-side-windows t
;; If nil, no load-hints enabled. If t, enable the \
load-hints' which will`
;; put the most likely path on the top of \
load-path' to reduce walking`
;; through the whole \
load-path'.`
dotspacemacs-enable-load-hints t
;; If non-nil a progress bar is displayed when spacemacs is loading. This
;; may increase the boot time on some systems and emacs builds, set it to
;; nil to boost the loading time. (default t)
dotspacemacs-loading-progress-bar t
;; If non-nil the frame is fullscreen when Emacs starts up. (default nil)
;; (Emacs 24.4+ only)
dotspacemacs-fullscreen-at-startup nil
;; If non-nil \
spacemacs/toggle-fullscreen' will not use native fullscreen.`
;; Use to disable fullscreen animations in OSX. (default nil)
dotspacemacs-fullscreen-use-non-native nil
;; If non-nil the frame is maximized when Emacs starts up.
;; Takes effect only if \
dotspacemacs-fullscreen-at-startup' is nil.`
;; (default t) (Emacs 24.4+ only)
dotspacemacs-maximized-at-startup t
;; If non-nil the frame is undecorated when Emacs starts up. Combine this
;; variable with \
dotspacemacs-maximized-at-startup' to obtain fullscreen`
;; without external boxes. Also disables the internal border. (default nil)
dotspacemacs-undecorated-at-startup nil
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's active or selected.
;; Transparency can be toggled through \
toggle-transparency'. (default 90)`
dotspacemacs-active-transparency 90
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's inactive or deselected.
;; Transparency can be toggled through \
toggle-transparency'. (default 90)`
dotspacemacs-inactive-transparency 90
;; A value from the range (0..100), in increasing opacity, which describes the
;; transparency level of a frame background when it's active or selected. Transparency
;; can be toggled through \
toggle-background-transparency'. (default 90)`
dotspacemacs-background-transparency 90
;; If non-nil show the titles of transient states. (default t)
dotspacemacs-show-transient-state-title t
;; If non-nil show the color guide hint for transient state keys. (default t)
dotspacemacs-show-transient-state-color-guide t
;; If non-nil unicode symbols are displayed in the mode line.
;; If you use Emacs as a daemon and wants unicode characters only in GUI set
;; the value to quoted \
display-graphic-p'. (default t)`
dotspacemacs-mode-line-unicode-symbols t
;; If non-nil smooth scrolling (native-scrolling) is enabled. Smooth
;; scrolling overrides the default behavior of Emacs which recenters point
;; when it reaches the top or bottom of the screen. (default t)
dotspacemacs-smooth-scrolling t
;; Show the scroll bar while scrolling. The auto hide time can be configured
;; by setting this variable to a number. (default t)
dotspacemacs-scroll-bar-while-scrolling t
;; Control line numbers activation.
;; If set to \
t', `relative' or `visual' then line numbers are enabled in all`
;; \
prog-mode' and `text-mode' derivatives. If set to `relative', line`
;; numbers are relative. If set to \
visual', line numbers are also relative,`
;; but only visual lines are counted. For example, folded lines will not be
;; counted and wrapped lines are counted as multiple lines.
;; This variable can also be set to a property list for finer control:
;; '(:relative nil
;; :visual nil
;; :disabled-for-modes dired-mode
;; doc-view-mode
;; markdown-mode
;; org-mode
;; pdf-view-mode
;; text-mode
;; :size-limit-kb 1000)
;; When used in a plist, \
visual' takes precedence over `relative'.`
;; (default nil)
dotspacemacs-line-numbers nil
;; Code folding method. Possible values are \
evil', `origami' and `vimish'.`
;; (default 'evil)
dotspacemacs-folding-method 'evil
;; If non-nil and \
dotspacemacs-activate-smartparens-mode' is also non-nil,`
;; \
smartparens-strict-mode' will be enabled in programming modes.`
;; (default nil)
dotspacemacs-smartparens-strict-mode nil
;; If non-nil smartparens-mode will be enabled in programming modes.
;; (default t)
dotspacemacs-activate-smartparens-mode t
;; If non-nil pressing the closing parenthesis \
)' key in insert mode passes`
;; over any automatically added closing parenthesis, bracket, quote, etc...
;; This can be temporary disabled by pressing \
C-q' before `)'. (default nil)`
dotspacemacs-smart-closing-parenthesis nil
;; Select a scope to highlight delimiters. Possible values are \
any',`
;; \
current', `all' or `nil'. Default is `all' (highlight any scope and`
;; emphasis the current one). (default 'all)
dotspacemacs-highlight-delimiters 'all
;; If non-nil, start an Emacs server if one is not already running.
;; (default nil)
dotspacemacs-enable-server nil
;; Set the emacs server socket location.
;; If nil, uses whatever the Emacs default is, otherwise a directory path
;; like \"~/.emacs.d/server\". It has no effect if
;; \
dotspacemacs-enable-server' is nil.`
;; (default nil)
dotspacemacs-server-socket-dir nil
;; If non-nil, advise quit functions to keep server open when quitting.
;; (default nil)
dotspacemacs-persistent-server nil
;; List of search tool executable names. Spacemacs uses the first installed
;; tool of the list. Supported tools are \
rg', `ag', `pt', `ack' and `grep'.`
;; (default '("rg" "ag" "pt" "ack" "grep"))
dotspacemacs-search-tools '("rg" "ag" "pt" "ack" "grep")
;; The backend used for undo/redo functionality. Possible values are
;; \
undo-fu', `undo-redo' and `undo-tree' see also `evil-undo-system'.`
;; Note that saved undo history does not get transferred when changing
;; your undo system. The default is currently \
undo-fu' as `undo-tree'`
;; is not maintained anymore and \
undo-redo' is very basic."`
dotspacemacs-undo-system 'undo-fu
;; Format specification for setting the frame title.
;; %a - the \
abbreviated-file-name', or `buffer-name'`
;; %t - \
projectile-project-name'`
;; %I - \
invocation-name'`
;; %S - \
system-name'`
;; %U - contents of $USER
;; %b - buffer name
;; %f - visited file name
;; %F - frame name
;; %s - process status
;; %p - percent of buffer above top of window, or Top, Bot or All
;; %P - percent of buffer above bottom of window, perhaps plus Top, or Bot or All
;; %m - mode name
;; %n - Narrow if appropriate
;; %z - mnemonics of buffer, terminal, and keyboard coding systems
;; %Z - like %z, but including the end-of-line format
;; If nil then Spacemacs uses default \
frame-title-format' to avoid`
;; performance issues, instead of calculating the frame title by
;; \
spacemacs/title-prepare' all the time.`
;; (default "%I@%S")
dotspacemacs-frame-title-format "%I@%S"
;; Format specification for setting the icon title format
;; (default nil - same as frame-title-format)
dotspacemacs-icon-title-format nil
;; Color highlight trailing whitespace in all prog-mode and text-mode derived
;; modes such as c++-mode, python-mode, emacs-lisp, html-mode, rst-mode etc.
;; (default t)
dotspacemacs-show-trailing-whitespace t
;; Delete whitespace while saving buffer. Possible values are \
all'`
;; to aggressively delete empty line and long sequences of whitespace,
;; \
trailing' to delete only the whitespace at end of lines, `changed' to`
;; delete only whitespace for changed lines or \
nil' to disable cleanup.`
;; The variable \
global-spacemacs-whitespace-cleanup-modes' controls`
;; which major modes have whitespace cleanup enabled or disabled
;; by default.
;; (default nil)
dotspacemacs-whitespace-cleanup nil
;; If non-nil activate \
clean-aindent-mode' which tries to correct`
;; virtual indentation of simple modes. This can interfere with mode specific
;; indent handling like has been reported for \
go-mode'.`
;; If it does deactivate it here.
;; (default t)
dotspacemacs-use-clean-aindent-mode t
;; Accept SPC as y for prompts if non-nil. (default nil)
dotspacemacs-use-SPC-as-y nil
;; If non-nil shift your number row to match the entered keyboard layout
;; (only in insert state). Currently supported keyboard layouts are:
;; \
qwerty-us', `qwertz-de' and `querty-ca-fr'.`
;; New layouts can be added in \
spacemacs-editing' layer.`
;; (default nil)
dotspacemacs-swap-number-row nil
;; Either nil or a number of seconds. If non-nil zone out after the specified
;; number of seconds. (default nil)
dotspacemacs-zone-out-when-idle nil
;; Run \
spacemacs/prettify-org-buffer' when`
;; visiting README.org files of Spacemacs.
;; (default nil)
dotspacemacs-pretty-docs nil
;; If nil the home buffer shows the full path of agenda items
;; and todos. If non-nil only the file name is shown.
dotspacemacs-home-shorten-agenda-source nil
;; If non-nil then byte-compile some of Spacemacs files.
dotspacemacs-byte-compile nil))
(defun dotspacemacs/user-env ()
"Environment variables setup.
This function defines the environment variables for your Emacs session. By
default it calls \
spacemacs/load-spacemacs-env' which loads the environment`
variables declared in \
/.spacemacs.env' or `/.spacemacs.d/.spacemacs.env'.`
See the header of this file for more information."
(spacemacs/load-spacemacs-env)
)
(defun dotspacemacs/user-init ()
"Initialization for user code:
This function is called immediately after \
dotspacemacs/init', before layer`
configuration.
It is mostly for variables that should be set before packages are loaded.
If you are unsure, try setting them in \
dotspacemacs/user-config' first."`
)
(defun dotspacemacs/user-load ()
"Library to load while dumping.
This function is called only while dumping Spacemacs configuration. You can
\
require' or `load' the libraries of your choice that will be included in the`
dump."
)
(defun dotspacemacs/user-config ()
"Configuration for user code:
This function is called at the very end of Spacemacs startup, after layer
configuration.
Put your configuration code here, except for variables that should be set
before packages are loaded."
)
;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.
I'm working on a huge project and helm-projectile-find-file delays for 1-2 secs before printing the files tree
Is there a way to speed it up? I was thinking maybe there's a way to change the backend to fzf somehow, haven't found any solutions though
I was also thinking about playing with projectile caching, but from what I understood cache invalidation might be a problem resulting in unwanted behaviour
Profiler
423,430,216 99% - command-execute
423,430,216 99% - funcall-interactively
330,351,405 77% - helm-projectile-find-file
330,287,309 77% - helm
330,284,213 77% - helm
330,284,213 77% - helm-internal
324,952,212 76% - helm-read-from-minibuffer
221,212,085 52% - helm-update
219,426,009 51% - helm--collect-matches
219,426,009 51% - helm-compute-matches
219,399,929 51% - helm-get-cached-candidates
219,399,929 51% - helm-get-candidates
219,399,929 51% - helm-interpret-value
219,399,929 51% - helm-apply-functions-from-source
218,351,321 51% + #<compiled 0x19d5000d8128a216>
17,632 0% + helm-process-filtered-candidate-transformer
8,448 0% + helm-take
641,448 0% + helm-render-source
573,342 0% + helm--update-move-first-line
568,190 0% + #<compiled 0x1b4a3b9d71e7886c>
3,096 0% + helm-update-source-p
100,792,576 23% + timer-event-handler
2,030,950 0% + redisplay_internal (C function)
203,959 0% + command-execute
53,552 0% + helm--update-header-line
39,930 0% + minibuffer-setup
12,104 0% + minibuffer-inactive-mode
7,600 0% + highlight-parentheses--initiate-highlight
6,762 0% + minibuffer-setup
6,512 0% + minibuffer-mode
6,480 0% + highlight-parentheses-minibuffer-setup
4,096 0% + thing-at-point
3,096 0% + winum--update
2,112 0% + helm-get-candidate-number
2,112 0% + winner-save-unconditionally
1,056 0% + global-spacemacs-leader-override-mode-check-buffers
1,056 0% + evil-mode-check-buffers
1,056 0% + global-origami-mode-check-buffers
1,056 0% + yas-global-mode-check-buffers
48 0% + run-hooks
Thanks for your tips in advance
Config:
(use-package nov
:config
(setq nov-text-width 80
shr-use-css nil) ;; Disable external CSS to allow Emacs faces to take precedence
;; Customize faces for code rendering
(defun my-nov-setup-shr-styles ()
"Customize faces for code blocks and inline code in nov.el."
;; Set monospace font and dark background for inline code
(set-face-attribute 'shr-code nil
:family "Courier New" ;; Preferred monospace font
:background "#333333" ;; Dark background
:foreground "#E5E5E5" ;; Light foreground
:weight 'normal)
;; Set monospace font and dark background for block code
(set-face-attribute 'shr-tag-pre nil
:family "Courier New" ;; Monospace font for block code
:background "#333333" ;; Dark background for block code
:foreground "#E5E5E5" ;; Light foreground
:weight 'normal
:height 1.0) ;; Adjust font size if needed
;; Ensure <code> tags are also styled
(set-face-attribute 'shr-tag-code nil
:family "Courier New"
:background "#333333"
:foreground "#E5E5E5"
:weight 'normal
:height 1.0)
;; Customize the LiteralGray span class for gray text in code blocks
(set-face-attribute 'font-lock-comment-face nil
:foreground "#A0A0A0") ;; Change this color as needed for readability
)
;; Apply the custom styling when nov-mode is activated
(add-hook 'nov-mode-hook 'my-nov-setup-shr-styles))
this will highlight inline code, but does nothing to code blocks. I have tested all kinds of variations but I cannot figure this out.
Here is a snippet of the source code for one epub-file:
<p class="CodeLabel"><b>src/main.rs</b></p>
<pre><code><span class="LiteralGray">fn main() {</span>
<span class="LiteralGray"> let number_list = vec![34, 50, 25, 100, 65];</span>
<span class="LiteralGray"> let mut largest = &number_list[0];</span>
<span class="LiteralGray"> for number in &number_list {</span>
<span class="LiteralGray"> if number > largest {</span>
<span class="LiteralGray"> largest = number;</span>
<span class="LiteralGray"> }</span>
<span class="LiteralGray"> }</span>
<span class="LiteralGray"> println!("The largest number is {largest}");</span>
let number_list = vec![102, 34, 6000, 89, 54, 2, 43, 8];
let mut largest = &number_list[0];
for number in &number_list {
if number > largest {
largest = number;
}
}
println!("The largest number is {largest}");
<span class="LiteralGray">}</span></code></pre>
Any ideas how to fix the config?
emacs --version
GNU Emacs 29.4
Copyright (C) 2024 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
OS: Arch Linux x86_64
Host: ASUS TUF Gaming A16 FA607PI_FA607PI (1.0)
Kernel: Linux 6.11.4-arch1-1
0.999.0@29.4 (spacemacs)
link img: https://imgur.com/a/vge3zpp
So I think I have all the stuff right, but only 1 or a few major mode icons are shown. The rest are squares with 4 numbers inside.
Can anyone tell me what I do wrong?
Hello
Following these instructions, I tried to installe llm-client layer to my spacemacs.
Spacemacs tells me "Unknown layer llm-client declared in dot file".
Have you any idea what to do ?
I was new to Emacs when I was introduced to Spacemacs - and that was 5 years ago. I have always used it to write code and Latex, without ever really getting too deep into the elisp world. I was just loading up Spacemacs for the first time on my new machine and can't seem to get everything working like it did.
Now, 5 years on there are different versions of literally everything - and I guess it is to be expected that some things won't work like they did back on my old machine (which was spacemacs 0.300 and emacs 26.1 or something). Now with spacemacs 0.999@29.3 I can't even get python jump-to-definition working within one git repo!
It's been days and at this point I am wondering if spacemacs' python layer is straight broke. I have fresh re-installed multiple times, but nothing works as simply as you think it would..
Struggling to keep the will the will to use spacemacs - probably because I don't understand how it really works and how to fix things. I just google endlessly (and ask ChatGPT these days).
How did you all learn? And how often do you find yourselves troubleshooting some tiny detail rather than actually working?
All I want, and all I had for 4 years, was auto-complete and yapfify mode on save, and "g d" taking me to whatever it was I wanted to see. That, and Latex mode auto completing the \cite{} calls I made. Nothing else matters to me.
sigh - I'm tired
Hi Spacers (Spacemacers? Spacemacsers?),
First off thank you so much for reading this post - here is a screenshot of my problem:
I have a fairly fresh installation of Spacemacs on my new machine (went from using 0.300 with Emacs 26.3 to 0.999 with the latest Emacs). Things have been alright with setup but re-building my virtual environment with a new python version has been tricky.
(I know I am supposed to ACTUALLY keep everything the same in a virtualenv, I'm just not an expert and my code is not all that complex. It's working with Python 3.12.3 even though its originally written in 3.8.)
Anyway, I have this issue where LSP is throwing a ton of errors - even though the code runs fine - and I'm not sure how to fix it.
For more detail, below is the pip list of my virutalenv (kinda long my apologies). I have mypy installed, which has given me issues in the past, but in my main environment my computer doesn't like me pip installing anything so I am trying not to (it literally doesn't let me do "pip install" outside a virtualenv and says "you can force me to do it but it might break your python entirely"...)
Any ideas here? I can also post my config file details or other stuff, this is my python layer config:
(python :variables
python-backend 'lsp
python-lsp-server 'pyright
python-test-runner 'pytest
python-formatter 'yapf
python-enable-yapf-format-on-save t
python-fill-column 80
python-sort-imports-on-save t
;; python-pipenv-activate t
)
Ok finally the pip list, and that it. Thanks for your help!!!
Package Version
astroid 3.2.4
asttokens 2.4.1
backcall 0.2.0
contourpy 1.1.1
cycler 0.12.1
decorator 5.1.1
dill 0.3.9
docstring-to-markdown 0.15
executing 2.1.0
flake8 7.1.1
fonttools 4.54.1
importlib_metadata 8.5.0
importlib_resources 6.4.5
ipython 8.12.3
isort 5.13.2
jedi 0.19.1
kiwisolver 1.4.7
matplotlib 3.7.5
matplotlib-inline 0.1.7
mccabe 0.7.0
mpmath 1.3.0
mypy 1.11.2
mypy-extensions 1.0.0
networkx 3.1
nodeenv 1.9.1
numpy 1.24.4
packaging 24.1
pandas 2.0.3
parso 0.8.4
pexpect 4.9.0
pickleshare 0.7.5
pillow 10.4.0
pip 24.0
platformdirs 4.3.6
pluggy 1.5.0
prompt_toolkit 3.0.48
ptyprocess 0.7.0
pure_eval 0.2.3
pycodestyle 2.12.1
pyflakes 3.2.0
Pygments 2.18.0
pylint 3.2.7
pyparsing 3.1.4
PyQt5 5.15.11
PyQt5-Qt5 5.15.15
PyQt5_sip 12.15.0
pyright 1.1.382.post1
python-dateutil 2.9.0.post0
python-lsp-jsonrpc 1.1.2
python-lsp-server 1.12.0
pytz 2024.2
qutip 4.7.3
ruff 0.6.9
scipy 1.10.1
setuptools 68.1.2
six 1.16.0
stack-data 0.6.3
sympy 1.13.3
tomli 2.0.1
tomlkit 0.13.2
tqdm 4.66.5
traitlets 5.14.3
typing_extensions 4.12.2
tzdata 2024.2
ujson 5.10.0
wcwidth 0.2.13
wheel 0.42.0
yapf 0.40.2
zipp 3.20.2
I added (menu-bar-mode 1) to my dotspacemacs/user-config () function, and when I reload the configuration it shows the menu-bar, but it doesn't show it when I restart emacs. What's the issue?
emacs 27.1
In short, I'm making some changes to a layer that's already available, namely, the asm layer. I'm looking for a method to reload the layer once I change something. I'm struggling to make that happen. Loading relevant files isn't working (either through ielm or directly calling the function through M-:
). I hoped restarting emacs (not using a service) would make it work, but that was a bust as well.
I also tried moving asm to private/local
and adding (asm :location local)
to dotspacemacs-additional-packages
.
Would love some guidance on how to make it work. Thanks in advance!
For example, in a TSX file, when in vscode, I can have my cursor within a component and press C-SPC to show a complete list of intellisense completion options.
I can accomplish somewhat similar if I put my cursor in the same place within a component in Typescript-tsx mode, and then press any character, such as a
, however that will only show results that match with a
in some way. I'd like to show all possible results, similar to vscode's C-SPC functionality.
Anyone know of a way to get something like this? I don't need it bound to C-SPC of course.
I've recently made the jump from Vim to Spacemacs and it's mostly great, Magit and org-mode are killer!
One thing that is really interrupting my flow is how to exit vterm-mode / enter normal mode whilst in a vterm shell without using ESC.
I've mapped Ctrl-q to insert-mode which works well (inside user-init):
(define-key global-map (kbd "C-q") nil)
(define-key evil-insert-state-map (kbd "C-q") 'evil-normal-state)
But cannot for the life of my figure out how to do something similar for vterm. I've tried:
(defun my-setup-vterm-keys ()
"Set up key bindings for vterm mode."
(define-key vterm-mode-map (kbd "C-q") 'evil-normal-state))
;; Wait until Evil is loaded, then define the key binding for vterm mode
(eval-after-load 'evil
'(progn
(require 'evil)
(evil-define-key 'insert vterm-mode-map (kbd "C-q") 'evil-normal-state)))
;; Set up the vterm mode hook to apply the key bindings
(add-hook 'term-mode-hook 'my-setup-vterm-keys))
But nothing I add seems to work. It's as if vterm is completely trumping any config. Has anyone got any similar flows? Would love to see your config!
Help a Vim escapee!
confused about how setup my pom.xml to use junit in spacemacs
my java folder:
/main/Pos.java
/test/PosTest.java
they are both under the root folder /betterChess
All I want to do is use chatgpt in spacemacs.
I've followed this workflow:
https://develop.spacemacs.org/layers/+web-services/openai/README.html#configuration
I added:
export OPENAI_API_KEY="xxxxxx"
..to my .zshrc. And, I've added:
openai
..to dotspacemacs-configuration-layers. Lastly, I've added:
;; Set the OpenAI API key
(setq openai-key (getenv "OPENAI_API_KEY"))
;; Set user for OpenAI requests
(setq openai-user "Chad")
...to dotspacemacs/user-config in my .spacemacs.
Trying to use ChatGPT in Spacemacs:
I see "Chad" in the top right corner for my user, but when I send a query I always get this response:
[INFO] Invalid API key, please set it to the correct value: nil
Things I've tried:
I've created a project api key and a user api key and neither has ever worked. What in the f*** am I doing wrong? Please help.
Anyone knows how I can copy my configuration from Windows to MacOS?
hey,
I created my first layer on spacemacs to integrate tailwindcss but I am having issues.
packages.el (defconst tailwindcss-packages '((lsp-tailwindcss :location (recipe :fetcher github :repo "merrickluo/lsp-tailwindcss")) ))
(defun tailwindcss/init-lsp-tailwindcss ()
(use-package lsp-tailwindcss
:init
(setq lsp-tailwindcss-add-on-mode t)
:config
(add-to-list 'auto-mode-alist '("\\.svelte\\'" . svelte-mode))
))
config.el
(use-package! lsp-tailwindcss)
tailwindcss is installed along tailwindcss-language-server.
I can't seem to get completion in svelte files .e.g. <div class="bg-red-500 ...
. I do have it working in neovim but not on emacs.
Any help is appreciated
Hello, folks! So in my journey to trying to code within org-mode using org-babel, I've eventually stumbled upon this very relevant article-slash-guide by dalanicolai.
I've checked the relevant .el
~/.config/emacs/elpa/29.2/develop/org-contrib-0.4.2/org-eldoc.el
and, yeah, the fixes are there, only seemingly further evolved.
Frustratingly, while src code block's header lines' eldoc's documentation is (and has been) working, the emacs-lisp's own eldoc support within the src block isn't working. It's working when editting from within an .el file - or when using org-edit-special (M-m m ')
Could you help with my thought process on what is my next search query should look like?
I am using emacs 28.1 + spacemacs. Aside from that I haven't added anything overly custom to my .spacemacs. As I spend time editing .cpp files, I will get many (10+ instances) of gtags running that were spawned by emacs and each one will consume 8-10% of my CPU. Any ideas on determining why emacs is doing this, or how to prevent it, are appreciated.
More background: I'm running emacs on a Windows system that's using cygwin gtags. I've tried disabling all of the packages that have an obvious tie-in to gtags (counsel/swiper, ggtags, helm-gtags) and that hasn't changed behavior. I also changed: (ggtags-update-on-save nil)
, also with no change. It appears to me that a new instance of gtags gets run anytime I save a .cpp file, but could be wrong (I'm just observing taskmgr at the time I save). My codebase is quite large, it takes a very long time for gtags to re-index.
Hi, I work in org mode using ess-r. I'm not able to lets eglot automatically start while I open the src temp buffer. Emacs recognize the major mode (ess-r-mode) but eglot do not start. I try to open a .R file and eglot start as expected, so the issue is relative the src buffer. Do you have the same issue? How do you menage it?
I'm a noob to (spac)emacs. Recently I need to use debugging feature for python on spacemacs. I found that dap-mode is the way to do it.
I have read the dap-mode config for python. I have installed debugpy. I tried to debug my python file using , d d d
to start debug. I select the Python :: Run file (buffer)
. But I always got this error
Debug session process exited status: exited abnormally with code 1
How do I solve this? Am I missing any step to activate the dap-mode?
I haven't managed to find a way to have Spacemacs use the development version of Org mode, rather than the Org mode from Elpa. I want the main development branch, rather than the bugfix branch that Elpa follows. Is there a simple way to do this? Ideally, I'd only do this until the main development branch is released and appears on Elpa.
I'm on a work computer that's pretty locked down in terms of Internet access, so Melpa is unavailable. I’m trying to get my SpaceMacs configuration up and running to be productive. I have manually copied all of the files from the .emacs.d/elpa onto my computer, but when I start SpaceMacs, it still wants to go reinstall everything. Is there a way to prevent this behavior?
Hi all,
I'm having issues using yasnippet completion in modes that also use lsp for completion. That means, in those modes, snippets will no longer be shown in the completion window nor will they complete if I enter the keyword.
For comparison, I looked at org-mode. Everything is working as expected there: I have some context sensitive completion as well as snippets from yasnippets. I get the following output from company-diag
:
Emacs 29.1 (aarch64-apple-darwin22.5.0) of 2023-08-08 on admins-Virtual-Machine.local
Company 0.10.2
company-backends: ((company-files :with company-yasnippet)
(company-capf :with company-yasnippet))
Used backend: (company-capf :with company-yasnippet)
Value of c-a-p-f: (yasnippet-capf pcomplete-completions-at-point t)
Major mode: org-mode
Prefix: nil
Completions: none
So the active backend company-capf
with company-yasnippet
enabled. Just as I expected.
Now if I compare that to go-mode, I do get completion candidates from the go lsp server but I no longer get snippets. The output from company-dial
confirms that:
Emacs 29.1 (aarch64-apple-darwin22.5.0) of 2023-08-08 on admins-Virtual-Machine.local
Company 0.10.2
company-backends: (company-capf
(company-go :with company-yasnippet)
(company-files :with company-yasnippet)
(company-capf :with company-yasnippet))
Used backend: company-capf
Value of c-a-p-f: (lsp-completion-at-point semantic-analyze-completion-at-point-function semantic-analyze-notc-completion-at-point-function semantic-analyze-nolongprefix-completion-at-point-function tags-completion-at-point-function)
Major mode: go-mode
Prefix: ""
Completions:
....
It looks like it replaced the yasnippet enabled company-capf
.
From what I understand I want the backend to always be (company-capf :with company-yasnippet)
.
Does anyone know what's going on here? How do I get capf and yasnippet working at the same time with lsp?
minibuffer is hiding all other windows
Observed behaviour: 👀 💔you can see, when the minibuffer is open its hiding all the windows except that active one
Expected behaviour: ❤️ 😄mini buffer should open without hiding all the other windows
issue:https://github.com/syl20bnr/spacemacs/issues/16317
Hi all.
I am having a strange issue with my spacemacs installation. As you can see in the picture, I have an issue where my flycheck-mode throws a ton of errors for things that shouldn't be errors at all (eg. np.multiply!). This happens sporadically, sometimes I open this class file and it has 0 errors and warnings, and sometimes it just decides to freak out.
My best guess is that this is a lsp or flycheck issue, but I unfortunately do not have the know how to fix it. Have tried looking around the interwebs for help to no avail.
Anyone with any insight? Much appreciated!
Also happy to add any versioning information I can upon request, I just am not sure what to include here..
I tried installing the packages with the insecure flag but that didn't do anything. I've removed the previous install and updated the Fedora system packages.
```
An error occurred while installing treemacs-magit (error: (error Package ‘compat’ (version 29.1.4.4) is unavailable))
-
An error occurred while installing paradox (error: (error Package ‘spinner’ (version 1.7.3) is unavailable))
```
Any suggestions?
My .spacemacs has dotspacemacs-line-numbers 'visual
Since that didn't work, for good measure, I added the following to dotspacemacs/user-config
(spaceamcs/toggle-visual-line-numbers-on)
(spacemacs/toggle-visual-line-navigation-globally-on)
Nothing. Every time I start, there are no line numbers shown, and text goes all the way off the screen to the right. I have to physically type SPC t n v
and SPC t l
every time I open a new buffer. What am I doing wrong?