Commit graph

49 commits

Author SHA1 Message Date
Illia Danko
d13c93ffef lang/go: prioritize lsp over guru 2019-07-02 02:23:24 +03:00
Henrik Lissner
2dc52bc9be
💥 Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.

Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
  commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)

The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.

+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
  running `doom env enable` (`doom env clear` will reverse this and
  delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
  file. You won't need it if you're confident Emacs will always be
  started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
  doom/reload-env`. Note: this won't work if the Emacs session you're
  running it in doesn't have a correct SHELL set. i.e. don't use this to
  create your first env file!

The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.

This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 01:56:09 -04:00
Henrik Lissner
eb3c569e1d
Replace +lsp|init with lsp! autodef 2019-03-02 01:34:19 -05:00
Henrik Lissner
cb923eadcc
Add basic LSP support
Still needs to be documented, but includes support for the following
languages:

+ C/C++/ObjC
+ Go
+ Java
+ Javascript
+ OCaml
+ PHP
+ Python
+ Ruby
+ Scala
+ Swift
+ HTML/CSS

Relevant to #460, #716, #1186
2019-02-21 19:13:35 -05:00
Andy McLeod
1c20e33e03 Add descriptions for go-mode map
Makes the map for go-mode easier to discover.
2018-12-26 16:57:53 +00:00
Henrik Lissner
3f195614d9
Normalize :leader/:localleader keybinds
Evil states no longer apply to them. Also removes x-alt-keysym.
2018-12-23 23:54:27 -05:00
Kazutoshi Noguchi
e9bdf89c73 Fix 'SPC m b r' in go-mode. 2018-11-23 23:13:32 +09:00
Henrik Lissner
6a44cf0124 editor/reformat: refactor & fixes
+ Change +format-type to +format-region-p (now a boolean)
+ Add PRESERVE-INDENT-P boolean argument to +format-buffer
+ Add +format-preserve-indentation variable (only controls indent
  preservation during +format/buffer, not +format/region, where it's
  always enabled).
+ Fix error arising from +format|buffer hook when no formatter is
  defined for the current mode #893
+ Change +format|buffer to alias for +format/buffer.
2018-09-18 15:19:50 -04:00
Henrik Lissner
08d9c02218
lang/go: fix formatter
`use-region-p` is not a reliable mechanism for detecting region-type
formatting, so +format-type was added to the editor/format module.
2018-09-10 08:25:48 -04:00
Henrik Lissner
bc092acaee
lang/go: use gofmt for partials
goimports (if available) doesn't play well with partial code
reformatting.
2018-09-09 09:58:23 -04:00
Henrik Lissner
6767bb926e
lang/go: rebind conflicting keybinds for go-play-*
Fixes a startup error regarding binding to a non-prefix key.
2018-09-09 09:58:22 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
84abac6b69
Remove def-menu!; use :localleader keys instead
def-menu was clumsy. We could use a better UI for refactoring commands,
but they should be available via localleader keybinds in any case.
2018-09-09 09:58:18 -04:00
Henrik Lissner
fd8f8c5108
feature/lookup: rewrite dash docset integration
+ Uses alist variable to store config, rather than hooks
+ Added check for installed docsets in +lookup/documentation
+ Set docsets for various language modules (c-mode, c++-mode, css-mode,
  scss-mode, sass-mode, web-mode, go-mode, racket-mode, emacs-lisp-mode,
  js2-mode, rjsx-mode, typescript-mode, rust-mode, and php-mode)
+ Made *eww* popups for dash docsets larger
+ Renamed set-docset! => set-docsets! (set-docset! is aliased to
  set-docsets!)
+ New +lookup/install-docset alias
2018-08-31 02:49:48 +02:00
Henrik Lissner
f51f2948af
New :editor format module
Centralized code formatting with built-in support for a variety of
languages. Provides the set-formatter! function for defining your own.

Still experimental and needs more testing!
2018-08-22 02:20:11 +02:00
Henrik Lissner
e05d7cfee0
Change flycheck initialization strategy
Initialize it globally and turn it off where needed, instead of enabling
it on demand. Also fixes void-function: flycheck-mode errors when
:feature syntax-checker is disabled. This is experimental.

Indirectly fixes #710
2018-06-22 01:49:20 +02:00
Henrik Lissner
c0251aacee
Replace :lookup with set-lookup-handlers! autodef
And update all internal references.
2018-06-15 17:27:48 +02:00
Henrik Lissner
588359cc5f
Replace :eval/:repl with autodef functions
+ :eval => set-eval-handler!
+ :repl => set-repl-handler!
+ Updates all internal references.
2018-06-15 16:20:20 +02:00
Henrik Lissner
98d2f1de3f
Add set-env! autodef; make :env obsolete 2018-06-15 03:42:01 +02:00
Henrik Lissner
d8b1e469bc
Introduce autodefs to replace some settings
+ :popup -> set-popup-rule!
+ :popups -> set-popup-rules!
+ :company-backend -> set-company-backend!
+ :evil-state -> set-evil-initial-state!

I am slowly phasing out the setting system (def-setting! and set!),
starting with these.

What are autodefs? These are functions that are always defined, whether
or not their respective modules are enabled. However, when their modules
are disabled, they are replaced with macros that no-op and don't
waste time evaluating their arguments.

The old set! function will still work, for a while.
2018-06-15 03:42:01 +02:00
Henrik Lissner
67eb749d1e
lang/go: group flycheck config & use add-hook 2018-05-26 10:33:55 +02:00
Sean Dawson
e51e483c86 Small fixes for go-mode:
- Fixed typo for gocode command in `doctor.el`
- Only enable flycheck mode if the syntax-checker feature is enabled
2018-05-25 21:17:13 -04:00
Henrik Lissner
09cb4f6716
Major refactor & optimization of how modules load their packages
Now that we are loading package autoloads files (as part of the
generated doom-package-autoload-file when running make autoloads), many
:commands properties are redundant. In fact, many def-package! blocks
are redundant.

In some cases, we can do without a config.el file entirely, and can move
into the autoloads file or rely entirely on package autoloads.

Also, many settings have been moved in their module's autoloads files,
which makes them available ASAP; their use no longer depends on module
load order.

This gained me a modest ~10% boost in startup speed.
2018-05-25 00:46:16 +02:00
Henrik Lissner
74c8b1d113
Rewrite doctor; move warn! blocks out in doctor.el files 2018-03-12 13:32:01 -04:00
Henrik Lissner
738f39d21a
Change how shell env is injected #449
Changes the behavior of the :env setting to fetch the shell variables
immediately on call.
2018-03-02 19:55:05 -05:00
Henrik Lissner
a9cbfc7f4e
New :env setting for pulling shell envvars into MacOS sessions
:env lets you specify what environment variables exec-path-from-shell
should pull in from your shell environment at startup. As such, these
need to be defined at startup. :env is useless post-init.

May address #433
2018-03-01 01:03:03 -05:00
Henrik Lissner
bac73ec938
Replace warn => warn! 2018-02-14 07:46:38 -05:00
Henrik Lissner
d634a7e69d
lang/go: put keybinds in evil maps to fix hijacked SPC in go-mode 2018-02-14 05:53:53 -05:00
Henrik Lissner
38903d07e8
lang/go: relax warnings
+ Don't default to goimports unless it's available.
+ No warning if goimports is missing.
2018-02-14 05:52:08 -05:00
Henrik Lissner
eaeb495b18
lang/go: show annotations in code-completion popups 2018-02-02 20:47:32 -05:00
Henrik Lissner
ec7f20589a
lang/go: don't popup gofmt errors (use flycheck instead) 2018-02-02 03:00:57 -05:00
Henrik Lissner
42cee2e046
Update :jump => :lookup 2018-01-05 23:57:48 -05:00
Henrik Lissner
9d81bc5a8b
Major refactor: use-package-always-defer = nil & use :hook
Possibly breaking change: packages are no longer deferred by default.

Addresses #286
2017-12-08 23:14:11 -05:00
Henrik Lissner
ed76cfda99
General lang refactor; new refactor, help, build & test menus 2017-10-03 02:58:09 +02:00
Henrik Lissner
c7254e7bdc
Major optimization refactor, across the board
+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster
  startup; ~5-20% general boost
+ reduce consing, function calls & garbage collection by preferring
  cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and
  various cl-lib filter/map/reduce functions) -- where possible
+ prefer functions with dedicated opcodes, like assq (see byte-defop's
  in bytecomp.el for more)
+ prefer pcase & cond (faster) over cl-case
+ general refactor for code readability
+ ensure naming & style conventions are adhered to
+ appease byte-compiler by marking unused variables with underscore
+ defer minor mode activation to after-init, emacs-startup or
  window-setup hooks; a customization opportunity for users + ensures
  custom functionality won't interfere with startup.
2017-06-09 00:47:45 +02:00
Peter Luladjiev
77dc22f2f4 lang/go: add missing command-go-gocode-command variable 2017-06-02 23:54:07 +03:00
Henrik Lissner
9a4a196b69 Refactor lang/go 2017-05-26 20:22:45 +02:00
Henrik Lissner
009d7c9d49 lang/go: add goimports & godoc + more warnings 2017-05-26 20:22:45 +02:00
Henrik Lissner
10ea06b661 General cleanup + refactor 2017-05-25 20:12:43 +02:00
Henrik Lissner
5ae94b765c PRAISE BE TO THE BYTE COMPILER FOR THY SHARP QUOTES 2017-04-17 02:17:10 -04:00
Henrik Lissner
769cf850c9 General comment + README cleanup 2017-03-20 04:24:10 -04:00
Henrik Lissner
3d30844070 lang/go: add go-guru + refactor config 2017-03-19 22:49:00 -04:00
Henrik Lissner
3e63d2d23b Reduce def-package magic; explicitly use :when property 2017-03-19 22:47:50 -04:00
Henrik Lissner
4ae0513020 lang/go: refactor + add prereqs in doc comment 2017-03-16 17:40:45 -04:00
Henrik Lissner
89e220456f lang/go: fix un-quoted bindings 2017-03-16 17:25:57 -04:00
Henrik Lissner
45122cdea5 Fix keybindings + make them more consistent 2017-02-28 12:11:18 -05:00
Henrik Lissner
33c88d4f82 Revert macros to ...! name convention (elisp doesn't like @...) 2017-02-23 00:06:12 -05:00
Henrik Lissner
e14e25ecb4 Update modules/lang/* 2017-02-20 00:26:08 -05:00
Henrik Lissner
f453b3cee1 Reorganize modules 2017-02-20 00:23:03 -05:00
Renamed from modules/module-go.el (Browse further)