Emacs tips and tricks

Forum rules
Share your brain ;)
machinebacon
Baconator
Posts: 10185
Joined: Thu Sep 16, 2010 11:03 am
Location: Chinkistan
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Sat Oct 01, 2016 4:55 pm

I was searching for a (non-org/non-schedule/non-deadline) way to simply insert (today's) date as quick as possible: https://www.emacswiki.org/emacs/InsertDate

There is another way which I haven't tried: https://www.emacswiki.org/emacs/InsertingTodaysDate

Another little thing - in TTY some neat things (for example scrolling through the org calendar) don't work. There are ways to circumvent certain limitations: http://orgmode.org/manual/TTY-keys.html
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 4334
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Tue Nov 01, 2016 11:26 am

I know Emacs sucks horribly when it comes to Java development. Still use it for everything else at work, but yes, it's a shame.

However, Java - unless it's Java 8 - also sucks horribly. Lucky me support for Clojure in Emacs is brilliant through the awesome CIDER.

I recently got fascinated by Scala and found out about ENSIME: https://ensime.github.io/

Image

Here my setup: https://github.com/manuel-uberti/.emacs ... ng.el#L345

User avatar
GekkoP
Emacs Sancho Panza
Posts: 4334
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Sun Feb 05, 2017 10:31 am

Handy new package out there: guess-language

https://manuel-uberti.github.io/emacs/2 ... -language/

machinebacon
Baconator
Posts: 10185
Joined: Thu Sep 16, 2010 11:03 am
Location: Chinkistan
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Sat Feb 18, 2017 3:11 pm

Pretty Emacsers, a question for you:
in org-mode, there's the 'org-scheule and 'org-deadline command, that opens the neat little calendar and you can shift-cursor through the dates, right? now this does only work in the GUI version, not in emacs-nox, at least not in TTY, where I use Emacs most of the time. Do you know what commands make the shift-cursor move through the calendar? I knew that there's a hook that is called after setting a date, but that's useless for me. Right now, I have F11/F12 set in the init to change the timestamp (so the timestamp that has already been selected through the calendar buffer), but I would like to replace the shift-cursor keybindings with an alternative (C-n, C-p, or C-f, C-b). Any ideas? Thanks in advance!
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 4334
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Sat Feb 18, 2017 5:25 pm

There is org-calendar-select-mouse, but I'm not sure this is what you're looking for.

machinebacon
Baconator
Posts: 10185
Joined: Thu Sep 16, 2010 11:03 am
Location: Chinkistan
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Sat Feb 18, 2017 6:07 pm

yeah cool, with gpm it does work in TTY. Thanks, it's definitely a good alternative
..gnutella..

machinebacon
Baconator
Posts: 10185
Joined: Thu Sep 16, 2010 11:03 am
Location: Chinkistan
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Thu Mar 30, 2017 5:31 pm

Just a note to self...

To print the output of a command directly to the point (equivalent to :r !command), for example here the output of all UUID devices:

Code: Select all

C-u M-! blkid -o export | grep -w "UUID"
Record a keyboard macro

Code: Select all

C-x (
...do your thing
C-x )
...execute the macro 
C-x e
..gnutella..

User avatar
franksinistra
lost his wife
Posts: 914
Joined: Mon Jan 27, 2014 2:03 am
Location: San Bao Long

Re: Emacs tips and tricks

Unread post by franksinistra » Wed Jun 07, 2017 11:06 am

This is specific to spacemacs (actually spacemacs-base)

Since all-the-icons package popularity is rising, and every theme started using it, I'd like to share a way for you to use it on spacemacs. It's relatively easy, as i mentioned in https://github.com/domtronn/spaceline-a ... /issues/31.

1. First, create a new spacemacs layer (you can call it whatever you want, here i named it my-spaceline)
2. Create file packages.el inside the my-spaceline dir.
3. Put this:

Code: Select all

(defconst my-spaceline-packages
  '(all-the-icons
    spaceline ;; optional -- if you use spacemacs (not spacemacs-base)
    all-the-icons-dired
    spaceline-all-the-icons))

(defun my-spaceline/init-all-the-icons ()
;; optional -- add all-the-icons into neotree
    (use-package all-the-icons
      :config (setq neo-theme 'icons)))

(defun my-spaceline/init-spaceline ()
   (use-package spaceline))

(defun my-spaceline/init-all-the-icons-dired ()
;; optional -- add all-the-icons into dired
  (use-package all-the-icons-dired)
  :config (add-hook 'dired-mode-hook 'all-the-icons-dired-mode))

(defun my-spaceline/init-spaceline-all-the-icons ()
    (use-package spaceline-all-the-icons
      :after spaceline
      :init (spaceline-all-the-icons-theme)
      :config (progn
                (spaceline-all-the-icons--setup-git-ahead)
                (setq spaceline-all-the-icons-separator-type 'slant))))
Result:
Attachments
all-the-icons.png
rice no more.

kadinparker
Distrowatcher
Posts: 1
Joined: Mon May 29, 2017 7:45 am

Re: Emacs tips and tricks

Unread post by kadinparker » Thu Jun 08, 2017 4:18 am

GekkoP wrote:
Tue Nov 01, 2016 11:26 am
I know Emacs sucks horribly when it comes to Java development. Still use it for everything else at work, but yes, it's a shame.

However, Java - unless it's Java 8 - also sucks horribly. Lucky me support for Clojure in Emacs is brilliant through the awesome CIDER.

I recently got fascinated by Scala and found out about ENSIME: https://ensime.github.io/

Image

Here my setup: https://github.com/manuel-uberti/.emacs ... ng.el#L345
Actually I've never had any issues coding java in emacs. Unless you're doing android (in which case you basically have to use android studio), there's a really nice package called jdee. https://github.com/jdee-emacs/jdee. So far it has had everything I've needed for Java. :)

User avatar
GekkoP
Emacs Sancho Panza
Posts: 4334
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Fri Jun 09, 2017 7:49 am

^ Tried that. It's wasn't a smooth experience like CIDER for Clojure or ENSIME for Scala. To be fair though, I probably didn't stick with it as much as the others.

I also tried eclim, but having Eclipse around just to code Java in Emacs didn't feel quite right to me.

User avatar
GekkoP
Emacs Sancho Panza
Posts: 4334
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Mon Aug 07, 2017 7:29 pm

https://github.com/emacscollective/borg

I am giving this a try. Not that there is anything wrong with my current Emacs configuration, but curiosity is an unbearable pain.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest