Commit Graph

51 Commits

Author SHA1 Message Date
9cb4c8b637 fix(:lang): ensure lsp! is always appended to hooks 2022-07-25 18:12:03 +02:00
a70e634ebd refactor(:lang): move tree-sitter init
Moved add-hook calls (for tree-sitter initialization) into their
respective modes' config blocks, or nearby, to be consistent with how
other, similar tools (like lsp!) are initialized, and does so at
runtime, rather than at expansion/compile time, which eval-when! caused.
2022-07-25 17:34:44 +02:00
5ccbc468ad lang/web: fix fill-prefix on continued comments
Before:

  /*
   * pretend this is a line longer than 80 characters
   */

  Call fill-paragraph:

  /*
   * pretend this is a line longer
     than 80 characters
   */

After

  /*
   * pretend this is a line longer than 80 characters
   */

  Call fill-paragraph:

  /*
   * pretend this is a line longer
   * than 80 characters
   */
2020-11-09 17:19:14 -05:00
5c06edd90a lang/web: fix comments not joining/filling correctly
Before, joining these two lines

  // hello
  // world

Results in

  // hello // world

And filling the following

  // Pretend this line is longer than 80 characters

Becomes

  // Pretend this lineis longer than
  80 characters
2020-11-09 17:19:14 -05:00
b96b6ed64e Fix /* and /** expansion in various languages
Also adds +web-continue-block-comments option to control:

/*
 *
 */

vs

/*

*/

Has a known issue where the indentation for the closing delimiter is off
by one when +web-continue-block-comments is disabled. Will have to look
into that later.
2020-11-09 17:19:14 -05:00
64c4d00275 Autostart LSP also in scss-mode 2020-04-17 11:31:07 +02:00
b78fc4eb76 Minor refactor & reformatting across the board 2020-04-08 15:30:10 -04:00
195dfda045 Minor refactors & comment revision 2020-01-02 21:16:02 -05:00
99cd52e70f 💥 Drop Emacs 25.x support
Emacs 26.1 is Doom's new minimum supported version

Closes #2026
2019-11-08 16:02:06 -05:00
3c6f48f9ec Move evil & corrective keybinds to respective modules
Keybinds that correct behavior or provide or extend vim functionality
were moved to their respective modules, or to the :editor evil module.

Keybinds in the global space, that are particularly opinionated but
potentially harmful or imposing as a default, or likely for users to
change (like leader keys), are kept in config/default.
2019-10-26 23:44:28 -04:00
323e0adf45 Minor refactors & reformatting across the board 2019-10-17 01:47:58 -04:00
2d365619cd General refactor & cleanup, across the board 2019-09-13 22:00:34 -04:00
a3e262c7ac 💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00
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
dee6e4c214 lang/web: use only company-capf for s?css-mode 2019-05-01 21:02:29 -04:00
6d314c2795 Revise and update docstrings and comments 2019-05-01 21:02:28 -04:00
6cf6825a4d lang/web: fix typo
Pushing to the wrong variable!
2019-04-08 23:07:29 -04:00
742687a51e Add delq! and pushnew! macros
And move projectile configs to their respective modules (and out of
package configs).
2019-04-08 23:01:30 -04:00
eb3c569e1d Replace +lsp|init with lsp! autodef 2019-03-02 01:34:19 -05:00
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
954b0f9c5d Minor tweaks to map! calls for correctness
+ :map arguments shouldn't be quoted
+ :localleader keys default to all states in the absence of state
  modifiers. This is preferred, rather than restricting their use to
  normal state.
+ :map* is deprecated (there is no difference between it and :map)
2018-12-22 17:01:00 -05:00
001f90df2f lang/web: update set-docsets! & general refactor 2018-09-09 09:58:21 -04:00
48c77b1126 Move helm-css-scss package to lang/web/+css 2018-09-09 09:58:18 -04:00
0cf9d1f2f2 Minor refactor & revision across the board 2018-08-31 02:53:50 +02:00
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
90d09e6f93 Highlight-numbers on every prog-mode 2018-07-29 12:19:56 +10:00
c78c6495f1 Apply /* and /** pairs to more modes
Including js, ts, rjsx, rust, all C modes, php, and all css modes (scss,
less, and stylus).

Requested by @ar1a
2018-06-24 16:31:13 +02:00
b99ab59578 Replace :docset with set-docset! autodef 2018-06-15 16:20:20 +02:00
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
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
803511c771 lang/web: disable company-css in Emacs 26+
css-mode's built-in completion is superior in Emacs 26+. The
company-capf backend will take advantage of it.
2018-05-17 12:22:27 +02:00
8cab2f19fd Remove redundant config & auto-mode-alist entries
Much of this config is done in package autoloads, and now that
auto-mode-alist is cached in doom-package-alist (after reading autoload
files), we can save some space by removing redundant config.
2018-05-14 20:48:14 +02:00
168cb74794 Replace add-hook! with setq-hook! where possible 2018-05-07 22:37:19 +02:00
8bd68064ef lang/web: register docsets for css, scss & sass 2018-03-14 18:50:10 -04:00
0fb72805ab lang/web: new comment-indent-function for css/scss-mode
Adds +css/comment-indent-new-line, since the built-in default performs
poorly in CSS buffers. This is experimental.
2018-02-14 20:58:38 -05:00
da84850ced lang/web: remove company-yasnippet from css modes 2018-02-10 15:13:08 -05:00
f9de4fd7b7 lang/web/+css: wrap sp config in after! block 2017-12-08 23:14:13 -05:00
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
ed76cfda99 General lang refactor; new refactor, help, build & test menus 2017-10-03 02:58:09 +02:00
d0fcb23314 Replace feature/eval build system with def-menu! 2017-10-03 02:58:09 +02:00
392c58ea47 General refactor & cleanup 2017-06-19 00:32:45 +02:00
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
5ae94b765c PRAISE BE TO THE BYTE COMPILER FOR THY SHARP QUOTES 2017-04-17 02:17:10 -04:00
648c4c1d3b Update lang modules' :build settings 2017-04-07 01:46:33 -04:00
5f8cbd751a Remove references to doom/append-semicolon; use evil append mode instead 2017-04-03 13:17:35 -04:00
db7cf68775 General tweaks 2017-03-19 22:50:57 -04:00
3e63d2d23b Reduce def-package magic; explicitly use :when property 2017-03-19 22:47:50 -04:00
4f5826df37 lang/web/+css: refactor; css imenu support; add counsel-imenu & rainbow-mode 2017-03-04 20:49:23 -05:00
e77545f1f8 Move rainbow-delimiters-mode activation to respective lang modules 2017-03-03 23:59:53 -05:00
33c88d4f82 Revert macros to ...! name convention (elisp doesn't like @...) 2017-02-23 00:06:12 -05:00