When executing the main function which requires command line arguments, user can
set `go-run-args` to pass command line arguments to compiled binary.
The example below demonstrates how to pass command line arguments by setting
`go-run-args` as file local variable:
package main
import (
"fmt"
"os"
"strconv"
)
func main() {
//Atoi converts a string to an int
fmt.Println("Arguments:", os.Args)
a, _ := strconv.Atoi(os.Args[1])
b, _ := strconv.Atoi(os.Args[2])
result := sum(a, b)
fmt.Printf("The sum of %d and %d is %d\n", a, b, result)
}
func sum(a, b int) int {
return a + b
}
// Local Variables:
// go-run-args: "10 5"
// End:
Since factor 0.98, `fuel-edit-word` has been removed, since
`fuel-edit-word-at-point` has the same behavior when point is not on a symbol.
Also adjust the jump-handler definition.
factor: choose correct name for the `fuel` package
The package is called `fuel`, not `factor-mode`.
This does not make a difference for the layer itself, since it is using the
`site` pseudo-location, and thus never deals with the package files.
Now, any `post-init-fuel` functions defined somewhere else should work
correctly.
factor-layer: add missing refactor command binding, fix initial modes
When switching the Go layer to use the LSP backend with `golangci-lint`, I
noticed that none of my linter errors were being rendered with my source code.
Digging in further, I eventually learned it was due to `lsp-prefer-flymake`
being set to `nil` and not `:none`.
This change updates the Go layer, when using LSP and golangci-lint, to set
`lsp-prefer-flymake` to `:none`. If this is not set, the golangci-lint errors
will not be reported.
This is an alternative to #12043.
Fixes#11680
Signed-off-by: Tim Heckman <t@heckman.io>
importmangic does not have a diminish character.
Add diminish characters to make the modeline nice(r).
Signed-off-by: Loys Ollivier <loys.ollivier@gmail.com>
Fixes helm not being loaded before calls to:
read-file-name and completing-read.
These are some commands that call either of those two functions:
spacemacs/rename-current-buffer-file (SPC f R)
In a Treemacs window:
treemacs-add-project-to-workspace (C-c C-p a)
In a Magit buffer:
magit-checkout (b b)
Thanks Miciah for a more elegant solution.
This commit also reverts:
Fix helm loading for layouts transient state #11705
because it's not needed anymore.
And the previously commented out transient hook minibuffer-setup-hook (it
doesn't seem to ever have been used) is removed because:
- It loads helm after a command is called that uses helm (instead of before)
- (spacemacs|hide-lighter helm-mode) has previously been moved to the
helm/init-helm :config section.
Updated documentation for Clojure layer to currently recommended versions of
build tools and `cider-nrepl`, ensuring that connecting to a manually run
Clojure REPL works correctly with the current version of CIDER.
Leiningen version 2.9.0
Boot version 2.8.2
`cider-nrepl` 0.21.1
Helm has removed the helm-wikipedia-suggest command, so delete Spacemacs's
key binding for the command.
4ef8299d78
* CHANGELOG.develop: Add entry.
* doc/DOCUMENTATION.org: Delete documentation for the key binding for
helm-wikipedia-suggest.
* layers/+completion/helm/packages.el (helm/init-helm): Delete the key
binding for helm-wikipedia-suggest.
Moved:
- ("ai" "irc") to both the `erc` and `rcirc` layers. They don't have to be
renamed until the layers are loaded.
- ("ay" "ipython notebook") to the `ipython-notebook` layer.
- ("p$" "projects/shell")
("'" "open shell")
("as" "shells")
to the `shell` layer.
- The commands with keybindings from spacemacs-bootstrap/packages.el to
spacemacs-defaults/keybindings.el.
Removed:
- ("gd" "diff") it seems to be an old group name, there's no `SPC g d` group at
the moment.
- ("Re" "elisp") and ("Rp" "pcre") because they have moved to:
("xr" "regular expressions")
("xre" "elisp")
("xrp" "pcre")
- ("xm" "move") seems to be an old move text group, the current keybindings are
`SPC x J` and `SPC x K` which opens the Move Text Transient State.
- ("b" "persp-buffers") because `SPC b` is also renamed as ("b" "buffers") which
is more general and not persp-mode specific.
Magit now uses Transient instead of magit-popup, and we must adapt. Also had to
replace the recently removed magit-diff-buffer-file-popup with
magit-diff-buffer-file (similar but doesn't offer a popup before displaying the
diff).
Note some upstream packages haven't adapted to this change, but when they do we
might need similar fixes:
- magithub
- magit-gitflow
- magit-svn
As described here: https://github.com/nim-lang/nim-mode/issues/159,
company-capf makes nim-mode unusable. I am replacing it with
company-nimsuggest as it is much more responsive. The reason I elected not to
leave company-capf in as a backup is that it would somehow still make it to the
car of company-backends, regardless of position at assignment, thus becoming the
default completion backend. Given that no functionality is lost this way, and
that nimsuggest is now part of the core nim installation
(https://github.com/nim-lang/nimsuggest), I do not think anything has been
sacrificed.
Update the documentation for forge per upstream changes to key bindings in
evil-magit[1].
[1] 49978d07d3
* layers/+source-control/github/README.org: Update key bindings for forge.
Rename the spacemacs/c-c++-tags-find-references-at-point and
rtags-find-references-at-point to fix the c-c++-modes key binding:
"g," 'spacemacs/c-c++-tags-find-references-at-point
when c-c++-backend is set to 'rtags.
This changeset reverts some of the changes introduced by
the commit 445f6af93f.
Note that Forge binds the ' key to the Forge dispatch popup, but evil-magit
binds the ' key to the submodule dispatch popup (see
https://github.com/emacs-evil/evil-magit/issues/54), and evil-magit's key
binding takes precedence with the vim editing style. Because Forge's key
binding does not always work, it is omitted from the README.
Note also that Magit binds the % key to its worktree dispatch popup, but
Spacemacs binds the % key to the magit-gitflow popup, and Spacemacs's key
binding takes precedence. Because there is no available key binding for
the worktree dispatch popup, Forge's key binding under that dispatch popup
is omitted from the README.
* CHANGELOG.develop:
* layers/+source-control/github/README.org: Update.
* layers/+source-control/github/packages.el (github-packages): Add forge.
(github/init-forge): Load forge after magit. Configure forge to use
spacemacs-cache-directory.
(github/init-magithub): Disabling injecting issues and pull-requests
sections if forge is installed.
c-c++-lsp-initialization-options:
-> ccls-initialization-options
-> cquery-extra-init-params (cacheFormat set to "msgpack" by default)
c-c++-lsp-args:
-> ccls-args
-> cquery-extra-args
c-c++-lsp-cache-dir:
-> ccls: Appended to initialization-options
-> cquery-cache-dir
<<Amendment 1 21/12/18>>
Removing 'clangd' from list of lsp clients to squash per-file prompt for
language client.
Updated lsp/packages.el to reflect upstream lsp-mode function name changes.
Python layer -- added if guards to prevent anaconda package loading / keyboard
shortcut config when lsp backend selected.
Replaced opt-in use of `spacemacs/lsp-bind-keys-for-mode` function with
keybindings for the lsp minor mode, which should be enabled for all derived
layers.
<<Amendment 1 26/11/2018>>
Added call to (spacemacs//setup-lsp-jump-handler) to lsp-after-open-hook
<<Amendment 2 04/12/2018>>
Migrated to new lsp-mode package API.
Updated c-c++ layer accordingly.
<<Amendment 3 05/12/2018>>
Incorporated PR feedback / corrections from gessen
<<Amendment 4 05/12/2018>>
Incorporated further feedback / corrections from gessen
- I had some issues related to finding the corresponding shortcuts for each of
the commands and I am looking for suggestions for improvements.
- updated the lsp-java readme since the server installation is now automatic. If
you already have jdt server installation, please run lsp-java-update-server
which will download the related dap-mode related stuff.
- Make sure that you have latest melpa versions of lsp-java, lsp-ui and dap-mode
since several issues related to the java integration were fixed lately.
- dap-mode is pretty young package and it is not extensively tested
- dap-hydra which will be used as a transient state for the breakpoints and
debugging, in general, is not synched with the shortcuts in the layer. I will sync
them once there is agreement on the shortcuts configuration. Also, I have not
updated lsp-java README.org with the corresponding shortcuts for the same
reason.
- The debug integration with the python lsp layer will be implemented in
separate PR.
- There will be few more functions that are going to be added to the dap-mode at
some point and they would require shortcuts too:
* suspend/kill thread I guess - "m d t s" "m d t k"?
* watches - "m d l w"
* exception breakpoints - I have to figure out how it will look like on emacs
side.
* goto point "m d H"?
Fix the following errors:
rcirc-late-fix.el:49:12:Warning: ‘rcirc-print-hooks’ is an obsolete
variable (as of 24.3); use ‘rcirc-print-functions’ instead.
rcirc-late-fix.el:51:1:Warning: defface for ‘rcirc-late-fix-face’ fails
to specify containing group
In rcirc-late-fix-hook:
rcirc-late-fix.el:79:82:Warning: (lambda (x) ...) quoted with ' rather
than with #'
In rcirc-late-fix-matching-buffer:
rcirc-late-fix.el:85:34:Warning: function ‘find-if’ from cl package
called at runtime
problem:
some layer packages lists have the open and closing parentheses on the same line
as the first and last listed package, but most seem to have them on a separate
lines.
solution:
put the open and close parentheses on separate lines, except for lists with only
a single package, they are written on the same line as the variable name and
parentheses.
fix the lists indentation
Because the setup functions run after local vars are set, setting jump handlers
needs to happen directly. Otherwise setting them only applies to the next
typescript file that is opened, which may or may not even have the same backend.
Also prevents lsp jump handlers from being installed unless the backend is lsp.
- Add clojure-mode refactorings and which-key prefixes in default layer
configuration.
- Improve discoverability of the refactoring features which are not enabled
by default. When clj-refactor is installed, "SPC mr?" runs
cljr-describe-refactoring
- Refactor out repeated dolist clauses into `forall-clojure-modes` macro
which executes body forms for all clojure derived modes, and adds missing
functionality of parinfer, fancify-symbols and evil-cleverparens to
cider-repl-mode and cider-clojure-interaction-mode.
problems:
the delete file prompt doesn't show which file it's about to delete,
and when the deletion request is canceled, then the question remains in the
minibuffer (the text disappears when an action updates the minibuffer, like
moving the cursor, but it might be confusing to still be seeing the question
after it's been answered)
solution:
show the file name in the delete file prompt, and show a canceled message
This commit reverts ab34cc2d9d. Setting
company-minimum-prefix-length to 0 causes issues indicated in issue #8222. While
the user is free to set company-minimum-prefix-length to 0 if they please, doing
so affects editing any files that also use web-mode such as jsx files.
Additionally, new users to Spacemacs may be confused by this behavior since no
other layer sets company-minimum-prefix-length to 0.
By analogy with the "zz", "zb", "zt" vim / evil bindings, this adds an
additional key binding "z" for `recenter-top-bottom` to the following
transient states which navigate around the buffer in large jumps:
- auto-symbol-highlight
- error
- buffer
- vcs
- org-babel
This allows for repositioning of the buffer for visibility without having to
exit the transient state.
Minor updates are also made to documentation of other transient states.
c-c++-enable-rtags-support has been removed in favor of c-c++-backend. Don't mention it in README
Delete .ccls from c-c++-adopt-subprojects
as in ccls, .ccls-root is recommended for this purpose
Delete the extra parameter :levels 3 from $ccls/inheritance
Finding the immediate bases is usually more desired
The parameters of refs-* in ccls are not in :context