Commit graph

66 commits

Author SHA1 Message Date
Jeetaditya Chatterjee
06ed5ade3f
refactor!(tree-sitter): add +tree-sitter flag
BREAKING CHANGE: break the global nature of the tree sitter
module by adding a +tree-sitter flag to every applicable module

In the background this hooks turn-on-tree-sitter-mode
to the major-mode-hook of the language.
This may also solve the eager loading of tree sitter
2022-05-22 21:26:00 +01:00
Henrik Lissner
d58d084774
tweak(:lang,:tools): start eglot/lsp-mode later
To ensure lsp/eglot settings have precedence over local servers (e.g.
cider and lookup handlers).

Ref: clojure-emacs/cider#3170
2022-03-30 17:32:47 +02:00
Henrik Lissner
8bf902d5f4
General refactors & reformatting across the board 2020-06-04 20:13:28 -04:00
Henrik Lissner
169f9a6121
General, minor refactor & reformatting 2020-03-27 01:25:30 -04:00
Henrik Lissner
7ebc887905
Merge tb prefix into t prefix 2020-02-09 17:00:28 -05:00
Remco Verhoef
7fe392d946
add benchmark bindings (,tbs and ,tba)
go supports running benchmarks much similar to running tests,
the new key bindings will run single or all benchmark
2020-02-09 10:58:49 +01:00
Henrik Lissner
12094788d7
Fix references to :tools fly{spell,check} 2020-01-14 03:04:26 -05:00
Gerry Agbobada
e91dacea2d
Remove envvar setter in golangci-lint checker
This allows users to be responsible for their use of the feature. I definitely misread the documentation about the checker.
2019-12-01 20:45:13 +01:00
Henrik Lissner
a88a3e12b2
Merge pull request #1983 from gagbo/feature/golang/flycheck_ci-lint
lang/go: add flycheck-golangci-lint
2019-11-21 17:21:52 -05:00
Bastien Rivière
1fcf210bd4 replace go-add-tags with go-tag
go-add-tags isn't maintained and has a few issues.
This library will fix those issues by using a binary intended for this.
2019-11-06 14:22:24 +01:00
Gerry Agbobada
70e7b8a388 Add flycheck-golangci-lint
This plugin runs
[golangci-lint](https://github.com/golangci/golangci-lint) in the
background and gathers the results in a checker.
2019-10-30 09:36:05 +01:00
Henrik Lissner
63ee940a7e
lang/go: move go-gen-test keybinds onto t prefix 2019-10-22 12:35:12 -04:00
nobv
5de62574bc Add support for go-gen-test 2019-10-23 01:06:46 +09:00
Henrik Lissner
2d365619cd
General refactor & cleanup, across the board 2019-09-13 22:00:34 -04:00
babariviere
3d1e232f50 add go-add-tags for go-mode 2019-09-06 11:00:24 +02:00
Henrik Lissner
76cacb5bfe
💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
Illia Danko
78e290b6f6 lang/go: integrate lsp to local-vars hook 2019-07-02 23:23:28 +03:00
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