Commit Graph

28 Commits

Author SHA1 Message Date
56d8e1e0f8 bindings: fix emacs bindings and add more 2019-09-07 00:32:34 +02:00
2485123164 term/{eshell,vterm}: remove already in * buffer check
Allows users to spawn additional eshell/vterm buffers, if they like.
2019-08-22 14:44:14 -04:00
0c7e6261e8 term/vterm: don't reset vterm popup 2019-08-11 02:05:09 -04:00
6647ebc736 term/shell: fix void-variable buffer error on +shell/toggle 2019-08-05 11:29:22 -04:00
19ecf8e46a Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +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
703b58f325 term/*: conform to new conventions 2019-07-23 00:07:14 +02:00
1b79aa1b4d term/eshell: remove redundant keys (with evil-collection)
And expand comments + use windmove-* instead of evil-window-* so as to
not exclude non-evil users from these keybinds.
2019-07-22 02:37:46 +02:00
149b2617b0 💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
51d3b1b424 💥 revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.

In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.

  doom*shut-up -> doom-shut-up-a
  doom*recenter -> doom-recenter-a
  +evil*static-reindent -> +evil--static-reindent-a

The rationale behind this change is:

1. Elisp's own formatting/indenting tools would occasionally struggle
   with | and * (particularly pp and cl-prettyprint). They have no
   problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
   github markdown) struggle with it, sometimes refusing to highlight
   code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
   intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
   on haphazardly way back when Doom was simply "my private config".

Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.

Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
  macro. The old pair weren't as useful. The new def-advice! saves on a
  lot of space.
- Removed "stage" assertions to make sure you were using the right
  macros in the right place. Turned out to not be necessary, we'll
  employ better checks later.
2019-07-22 02:27:45 +02:00
4ebd3fad7f Add :term shell module 2019-07-13 13:00:24 +02:00
648e81f765 term/vterm: remove evil config
It's been implemented in evil-collection-vterm.
2019-07-06 23:22:28 +02:00
0eeb6b5092 term/vterm: add nixos recipes to README 2019-07-05 20:11:25 +02:00
63883d575b term/vterm: prefer built-in vterm to elpa
If it's present. Particularly useful for nix-os users who install
Emacs+vterm with this statement:

  systemPackages = with pkgs; [
    ((emacsPackagesNgGen emacs).emacsWithPackages (epkgs: [
      epkgs.emacs-libvterm
    ]))
  ];

Or with home-manager:

  programs.emacs = {
    enable = true;
    extraPackages = epkgs: [ epkgs.emacs-libvterm ];
  };
2019-07-05 20:04:42 +02:00
9a02bd8ac8 Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
e313fef7b0 term/eshell: fix reference to old function 2019-06-18 21:52:50 +02:00
9c842bfad8 Open term popups in current dir, instead of project-root
CDing into the project root can be accomplished with external tools, e.g.

  cd $(git rev-parse --show-toplevel)
  cd $(hg root)
  cd $(npm root)

Any of which could be aliased. Also, +vterm/toggle and term/toggle
define the PROOT environment variable, so `cd $PROOT` will work too.

On the other hand, CDing to the current file/folder requires that the
shell be made aware of the file/directory of some Emacs state, which is
a little trickier to deal with, so I made that the default behavior for
+term/toggle, +vterm/toggle and +eshell/toggle.
2019-06-17 19:25:17 +02:00
2835314022 term/term: don't erase term buffer on toggle #1492 2019-06-17 16:06:11 +02:00
43615c4d64 Integrate term toggle commands w/ persp-mode #1492
By namespacing the dedicated term buffers you get perspective-local
popup terminals.
2019-06-16 19:16:23 +02:00
3e4f0a982b Fix #1492: +term/toggle not closing popup
And prevent term process from prompting on death.
2019-06-14 13:16:18 +02:00
7ce4a25e1e Rewrite +term/toggle #1492
multi-term performs a lot of hackery on Emacs' windows API, which causes
problems, particularly for persp-mode. To side-step it all we must
reinvent some of the wheel.
2019-06-14 12:33:09 +02:00
be907350e4 Fix +eshell/toggle with arguments
Fixes:

- Wrong-type-argument error when failing to display eshell buffer with
  pop-to-buffer, because it was killed (when prefix arg is non-nil).
- Passes non-existent variable `buf` to +eshell-run-command.
2019-06-13 17:52:52 +02:00
b2da28edfe Revert to initial evil state on term popup toggle
i.e. switch to insert state and move cursor to prompt.
2019-06-12 20:17:47 +02:00
a56ce38903 term/eshell: refactor & update keybinds
- Replace +eshell|init-evil with an advice for
  evil-collection-eshell-next-prompt-on-insert
- Update C-n/C-j and C-p/C-k keybinds to use
  eshell-{next,previous}-matching-input-from-input, which behave much
  like zsh's history-substring-search-{up,down}
- Move window navigation keybinds C-{h,j,k,l} to C-c {h,j,k,l} (more
  tmux-esque).
2019-06-11 07:57:26 +02:00
4fec3eb698 Revise term/vterm/eshell commands & keybinds
The semantics of SPC o t and SPC o T (or SPC o e and SPC o E in eshell's
case) have been reversed.

The lowercase keybind toggles the popup (and the prefix arg forciby
recreates the popup), and the uppercase keybind switches to that
terminal in the current buffer (whose prefix arg will open the terminal
in default-directory, rather than the project root).

- +{term,vterm,eshell}/open have been replaced with +X/here commands and
  are bound to SPC o T (and SPC o E in eshell's case).
- +{term,vterm,eshell}/popup* have been replaced with +x/toggle commands
  and are bound to SPC o t (and SPC o e in eshell's case).

The "toggle" behavior will do as the name implies, except will select
the popup if it is visible but unfocused.
2019-06-11 07:53:50 +02:00
aa64cf9426 Replace kill-this-buffer with kill-current-buffer
As per the documentation for kill-this-buffer, it should only be invoked
from the menu and behaves unpredictably when invoked programmatically.
2019-05-30 18:54:58 -07:00
a583d69ae1 Fix #1442: void-function eshell-input-filter-initial-space
eshell-input-filter-initial-space was introduced in Emacs 26. I've
inlined its definition, at least until we drop 25.x support.
2019-05-29 23:44:23 -04:00
8c65a63b1c Move eshell, term & vterm modules to :term 2019-05-19 02:17:59 -04:00