Emacs tips and tricks

Forum rules
Share your brain ;)
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
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: 5877
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: 5877
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: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
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: 5877
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: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
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: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
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
Ivana Fukalot
Posts: 1093
Joined: Mon Jan 27, 2014 2:03 am
Location: 印尼国

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: 5877
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: 5877
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.

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

Re: Emacs tips and tricks

Unread post by GekkoP » Fri Sep 08, 2017 9:59 am

^ Eventually, can't be bothered to continue the experiment, sorry.

Meanwhile, an epub reader for Emacs appeared: https://github.com/wasamasa/nov.el

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

Re: Emacs tips and tricks

Unread post by GekkoP » Sun Sep 17, 2017 10:50 am


User avatar
franksinistra
Ivana Fukalot
Posts: 1093
Joined: Mon Jan 27, 2014 2:03 am
Location: 印尼国

Re: Emacs tips and tricks

Unread post by franksinistra » Mon Sep 25, 2017 4:02 pm

^ I use parinfer https://github.com/DogLooksGood/parinfer-mode for that, because I'm a lazy person. :)
rice no more.

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

Re: Emacs tips and tricks

Unread post by GekkoP » Mon Sep 25, 2017 4:25 pm

^ Interesting, although Smartparens works with non-Lisps too.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Wed Sep 27, 2017 9:05 am

Any ideas how I can use Evernote to sync my org files? I actually only use two devices to access my *.org files, so Evernote fits the bill: it supports sync between 2 devices in the Free plan, and the upload limit per month is 60MB (we all know that *.org files are just kilobytes in size).

Of course the most logical way would be logging in to Evernote on their web interface, moving the *.org files into a folder, then log onto the second device, sync, and pull the *.org files to the second device. Meh. Not beautiful.

Gekko to the rescue?

(Why not dropbox? Yeah, works perfectly well in countries without THE GREAT FUCKING FIREWALL)
..gnutella..

User avatar
franksinistra
Ivana Fukalot
Posts: 1093
Joined: Mon Jan 27, 2014 2:03 am
Location: 印尼国

Re: Emacs tips and tricks

Unread post by franksinistra » Wed Sep 27, 2017 11:53 am

^ How about nextcloud / syncthing? does that work in the great firewall of churros?

I use orgzly and nextcloud on droid phones to sync it with my other devices.
rice no more.

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

Re: Emacs tips and tricks

Unread post by GekkoP » Wed Sep 27, 2017 12:03 pm

^ orgzly and nextcloud seem like the most reasonable solutions.

I found these, but never tried them honestly:

- https://github.com/avendael/emacs-geeknote
- https://github.com/pymander/evernote-mode

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Thu Sep 28, 2017 6:06 am

^ thanks, that's what I found before, too.

^^ sometimes it does, sometimes it doesn't. I guess I have to find a CLI client for yun.baidu.com or so :D

Actually, what I love about Evernote is the web clipper and the capturing via camera. If it would just have an org-mode... :D
..gnutella..

User avatar
franksinistra
Ivana Fukalot
Posts: 1093
Joined: Mon Jan 27, 2014 2:03 am
Location: 印尼国

Re: Emacs tips and tricks

Unread post by franksinistra » Mon Oct 09, 2017 6:25 pm

Olivetti mode for distraction-free writing: https://github.com/rnkn/olivetti
I've had it hooked for org-mode and when i do typing games. :) For example:
Attachments
olivetti.png
rice no more.

Post Reply