Emacs General

What are some non-default keys you use in emacs?

I recently set up C-x K as bury-buffer, so I have a way to burry buffers instead of killing them with C-x k (or typing M-x bury-buffer RET).

Two other keys I find handy when scrolling prose text:

(global-set-key (kbd "M-N") '(lambda () (interactive) (scroll-up 1)))
(global-set-key (kbd "M-P") '(lambda () (interactive) (scroll-down 1)))


They scroll the buffer up/down by one line, without messing with C-v/M-v an friends.

Also emacs general.

Attached: Emacs-logo.svg.png (1274x1024, 159K)

Other urls found in this thread:

emacswiki.org/emacs/Irfc
gnu.org/software/emacs/manual/pdf/eintr.pdf&ved=2ahUKEwjJs6Df5ojbAhXIWBQKHVkzATEQFjAAegQIARAB&usg=AOvVaw38fQa7a6caCuZ0AHoP3kAF
google.co.uk/url?sa=t&source=web&rct=j&url=https://www.gnu.org/software/emacs/manual/pdf/eintr.pdf&ved=2ahUKEwjJs6Df5ojbAhXIWBQKHVkzATEQFjAAegQIARAB&usg=AOvVaw38fQa7a6caCuZ0AHoP3kAF
ergoemacs.org/emacs/emacs.html
github.com/rgerganov/footswitch
github.com/ch11ng/exwm
informatimago.com/linux/emacs-on-user-mode-linux.html
howardism.org/Technical/Emacs/new-window-manager.html
twitter.com/SFWRedditVideos

no custom keybindings, but I am sitting comfy with
erc, gnus, org-mode, ledger-mode.

I also have it to where C-c d can define word at point, which is good with looking up uknown words through browsing.

the scroll-up and down by 1 would be handy, I might look more into that.

Attached: emacs.jpg (1362x725, 369K)

Being able to view content without ads is nice...
I kind of like having nothing but text when viewing some content. Especially when its news related, you dont need all the other bloat when reading words.
Been getting in the habit of using eww for news viewing. Its working out pretty well.

Attached: noads.jpg (1362x725, 283K)

so much readability.

Attached: newcontent.jpg (1362x725, 518K)

pic related makes me want to barf.

Attached: oldcontent.jpg (1362x725, 172K)

I use C-u and C-d just like vim to scroll half a page up or down
and a few other things.
(global-set-key (kbd "C-d") 'my-scroll-half-page-down)
(global-set-key (kbd "C-u") 'my-scroll-half-page-up)
(global-set-key (kbd "M-u") 'undo)
(global-set-key (kbd "M-U") 'redo)
(global-set-key (kbd "M-o") 'query-replace)
(global-set-key (kbd "M-g") 'goto-line)
(global-set-key (kbd "M-,") 'pop-to-mark-command)

now that's a nice idea for a general

All mine:

(global-set-key (kbd "RET") #'newline-and-indent)
(global-set-key (kbd "C-x C-b") #'ibuffer)
(global-set-key (kbd "C-x k") #'kill-this-buffer)
(global-set-key (kbd "C-s-f") #'toggle-frame-fullscreen)
(global-set-key (kbd "C-+") #'text-scale-increase)
(global-set-key (kbd "C--") #'text-scale-decrease)
(global-set-key (kbd "") #'rectangle-mark-mode)
(global-set-key (kbd "C-s") #'isearch-forward-regexp)
(global-set-key (kbd "C-r") #'isearch-backward-regexp)
(global-set-key (kbd "C-M-s") #'isearch-forward)
(global-set-key (kbd "C-M-r") #'isearch-backward)

pic unrelated

Do you by chance use evil mode? This seems like an evil-mode thing.

You might also like M-. which goes to the definition of the current symbol (and M-, to go back).

Does your C-c d do anything different than C-h f RET (when your point is on top of a symbol)?

Do you seriously use eww for daily web browsing? It seems acceptable for many simpler sites, but so much crap nowadays require js and dom manipulation to actually work :c

Not sure if this has any functional difference, but I think the proper way to use ibuffer everywhere is to (defalias 'list-buffers 'ibuffer)

Attached: 2018-05-09-092038_2046x1129.png (2046x1129, 280K)

What is the best way to use emacs as a java ide? I like compiling and running from shell but I would like autocomplete and other small quality of life features. I've noticed jdee and some other package beginning with 'm' (megham?) that offer a full suite of java tools, but is there a more modular way to install java ide tools?

Attached: raphael_school_of_athens.jpg (2120x1192, 433K)

thx :3

I don't have a great deal experience using anything besides eclim with emacs, but it works well. It basically lets you compile, get some autocomplete, and show errors in emacs from a background (headless) eclipse process. I only used it because a project used the eclipse build system and I didn't want to reconfigure it.

Attached: 2017-10-28-172234_2046x1129.png (2046x1129, 232K)

>Do you by chance use evil mode?
I came from vim originally and used evil-mode for a while. But at some point I decided to try emacs without evil-mode to see what it's like, and I've been sticking to that except for C-u and C-d because emacs doesn't have anything like half page scroll I think and it's much more convenient than pgup or pgdn.

Sounds reasonable, I hope you don't miss C-d and C-u :p

Attached: 2017-04-08-233007_487x187.png (487x187, 16K)

eclim might be worth investigating. i've enjoyed eclipse whenever i've used it in the past so i wouldn't be opposed to having another ide installed.

Op here. I forgot to mention I found this cool RFC reader for emacs emacswiki.org/emacs/Irfc (note, there are others on the wiki, might be better, or worse)

Lets you browse RFCs in a way reminiscent of info pages.

Attached: 2018-05-15-173935_720x740.png (720x740, 82K)

>Do you seriously use eww for daily web browsing? It seems acceptable for many simpler sites, but so much crap nowadays require js and dom manipulation to actually work :c

Only for news.

Hey guys, I'm trying to learn elisp (emacs in general too, but specifically elisp programming). I've read through the manual and various guides but I've come to the conclusion that to learn a language I have to practice it (writing code) as much as learning theory. I'm looking for an online course (or at least a guide with exercices) to learn elisp, can someone recommend me one?
Thanks in advance!

Any spacemacs users here?

Check out ELM for a basic elisp REPL that comes built in to emacs.
idk if you saw it in the documentation but this book is pretty good, gnu.org/software/emacs/manual/pdf/eintr.pdf&ved=2ahUKEwjJs6Df5ojbAhXIWBQKHVkzATEQFjAAegQIARAB&usg=AOvVaw38fQa7a6caCuZ0AHoP3kAF

sorry for broken link -
google.co.uk/url?sa=t&source=web&rct=j&url=https://www.gnu.org/software/emacs/manual/pdf/eintr.pdf&ved=2ahUKEwjJs6Df5ojbAhXIWBQKHVkzATEQFjAAegQIARAB&usg=AOvVaw38fQa7a6caCuZ0AHoP3kAF

>non-default emacs
Why the fuck would you ruin perfection?

Emacs is far from perfection, it's all about tailoring it your specific usecases
means M-x ielm RET , by the way.

Also get comfortable with all the C-h commands, specifically C-h f, C-h F, C-h v, and so on.

Emacs lisp is a really shitty language, so you shouldn't feel bad that it seems difficult, because it is. I'd look for guides or tutorials on emacs lisp because there are a lot of weird and useless ways to do things.

Be sure to check out the CL library in the infopages, it's a handy library that helps make elisp somewhat usable.

Attached: editor-learing-curves.jpg (600x400, 26K)

What news reader mode do you use - sorry I didn't recognize it from your screenshot. I've heard good things about elfeed, but uncertain if that is elfeed :)

Attached: common-lisp-buncha-parens.png (252x479, 72K)

>default emacs
>perfection?
emacs would be a pain to use if it weren't an extensible and programmable editor.
The extensibility is what makes it great.

Does anyone have a guide to start being productive in Emacs? I am starting to learn how to use it but I fail to see how this is any better than individual apps. For example, on a Mac you have: Reminders, Calendar, Notes

How is that worse than using Emacs and having to memorize keystrokes and combinations? Not criticizing as i am keen to learn out of interest but just trying to wrap my head around the use case.

The bottom line, is you should use features of your applications you like, and avoid the rest.

You might find this interesting, but it still isn't very goal-oriented ergoemacs.org/emacs/emacs.html

The hardest thing about using emacs is learning about functionality that will save you time, and ignoring the rest, so if you are interested, i'd start with small things, like simply editing tasks, or taking notes, or writing todo lists in emacs. Then build upon that if you like the results.

I've checked this one but not followed completely through and made the exercises. If I follow it while taking notes will I be able to do the exercises and will I learn a good base of elisp?

That application works for single lines of code only, is it really that useful?

Btw guys. I kind of have a dilemma. I come from vim. I've read about emacs and I know why it's superior in a lot of ways, that's why I'm getting into it. But I've also read that the pure text editing part of it is way worse (vim modes make it extremely efficient + that muscular problem a lot of people get in the pinky from using emacs). That's why I've used evil-mode and now use spacemacs. But I feel like it's not really good for learning emacs, like trying to learn chemistry from a russian book translated to my language in google translate (excuse this horrible example, I hope you get why I mean). It's also a pain in the ass to try to use other packages with evil-mode, all the keybindings are different, etc.
Should I use the default emacs (no evil, no spacemacs)?

> Reminders, Calendar, Notes
While you can do those things in emacs, it's more straight forward if you start using it to do text editing.
emacs is especially useful if you need to use other tools along with the text editing, like in programming (you can have specific modes for each language, repl, integrated git, project management, debugger,...), latex (with auctex), irc.
If you've been using emacs for a while and you like it so much that you never want to leave it and you want to do everything in it, you can start looking at stuff like org, emacs file managers, mail, emms music player, web browser using xembed, or even emacs as a window manager.

the ideal way (imo) would be generally with lsp-mode/eglot and a language server, but I don't know if one exists for java (there should be one considering its popularity) or if the one that exist are good

I don't think there is anything wrong with use spacemacs as an end goal. It's simply emacs with a different set of default packages, and different defaults. And it's easier to learn, but still pretty powerful.

I agree the trick appears to get random stuff working in spacemacs, but i don't think it gets much easier using vanilla... but then again I've never used spacemacs - it only got popular after I started using emacs heavily.

Maybe you could try using vanilla for a week, spacemacs for a week, and evil-mode for a week just to get a deeper understanding of which you personally prefer. I think there is also doom emacs or whatever, which has different defaults too.

The benefit of ielm is it provides you with an interactive REPL to try elisp code and getting the results back away. In general a REPL is the superior way to learn a library or language because it lets you work in a tight feedback loop where you type some code in, and see the results right away (with supplement of reference documentation, of course).

Attached: 2018-05-15-182505_1364x745.png (1364x745, 106K)

just use gnus with rss feeds.

Attached: gnus.jpg (1362x725, 91K)

I (not the one you replied to) do feel like customizing spacemacs is much more difficult than vanilla emacs, so I would suggest for the other guy to go with vanilla emacs and evil-mode and customize it to your liking.

there are packages like evil-collection that will help evil integration with other modes.

I'm samefag: Thanks for the clarification, maybe I should use spacemacs than say it's okay lol. I just haven't had a need to since I learned vanilla a long time ago.

But do you guys recommend using the default emacs keybindings? Do you use them?
I've thought about replacing the Alt key with the Ctrl key for example, to avoid the pinky thing

Default keys are more-or-less sufficient with some augmentation. I assign Caps lock as another left control key, so I don't have to reach very far.

It comes down to personal preference.

I use evil and evil-leader to create mode specific bindings and replace regular emacs bindings.

when a mode doesn't work well with evil then I'll just use that mode's default bindings.

anyway, I'm off to sleep and I really hope this stays alive when I wake up, this thread has great potential.

Thanks for the replies man, good night

I think I'll stick with spacemacs then. Default emacs bindings seem too inefficient (compared with vim) and with evil I would have to remap keys with every new mode I try.

got this foot pedal, I'm going to bind it to control

Attached: IMG_20180515_181722.jpg (3480x4640, 1.85M)

both very helpful answers. I'll look into it a bit more.

I've been contemplating a foot pedal for a very long time. My main concern is latency - e.g. the pedal should register with X11 with the same latency as my keyboard registers with x11. I think if it's more than a hundred MS difference it'll be really awkward.

I rebind C-a so that pressing it once will bring be to the beginning of indentation, while pressing it again brings me to the actual beginning of the line. It's helpful, because 90% of the time that's what I want to do anyway:
(defun back-to-indent-or-line ()
(interactive)
(cond (visual-line-mode (beginning-of-visual-line))
((at-indent-end) (beginning-of-visual-line))
(t (back-to-indentation))))

(bind-key "C-a" 'back-to-indent-or-line)

Just realized at-indent-end isn't built in. Here's a probably incredibily inefficient way to do it:
(defun at-indent-end ()
(save-excursion
(let ((prev-position (point)))
(back-to-indentation)
(= prev-position (point)))))

The registration is pretty instant, the travel is pretty long but you don't need to go all the way down to activate it. So you can just press slightly to get it to work. Software wise, I belive it's pretty much instant, I use github.com/rgerganov/footswitch for firmware.

>never want to leave
Pretty much how it ends up. My home office laptop is just emacs sitting on a kernel. Don't need any distraction. I'm working on a short book about my experience called something like "zen and the art of emacs." Might be out early next year if I can get a sabatical next semester, currently doing a post-doc and research fellowship at Cal.

I'd read your book sempai

Attached: K&R.gif (400x486, 161K)

>emacs is my os meme
Is this a troll or legitimately possible? I'm a macfag but I like emacs. Always wanted to try a minimal system gag on my super old macbook but even lubuntu ran like shit. Can you post some kind of how to?

On my thinkpad I'm using emacs as my window-manager with exwm and it's been pretty gud

Attached: clit-mice.jpg (600x390, 20K)

You can unironically use Emacs as the entire application suite for a computer. Aside from the obvious text editor function, Org mode is incredibly useful and can do spreadsheets (or SES if you prefer), you can run a web browser through it, you can spawn new shells in it, it can be used for file management, play music, video, manage windows, etc etc etc
I would never recommend doing it but if you want to live the meme, its possible

erc is an unironically excellent irc client

I want to live the meme. I have a summer internship that's boring as fuck and basically leaves me unsupervised for 9 hours at a time.

its made my irc use increase by 100%
opening a connection and leaving a buffer open to a channel and going off and doing other emacs stuff and periodically checking your erc buffers. Its pretty blissful.

what kind of how to are you expecting?
You open up emacs --- then use it for everything.

i made a helm command that lists all my erc buffers with unread messages, so i just hit my helm-erc hotkey and go to the most recent one

Like i said, i'm a macfag so i don't know anything about linux except the one time i put a liveCD of lubuntu on my oldest macbook. So i mean what is the process of like just installing emacs alone? Like you put emacs on a flash drive and install it as an OS probably isnt it. I guess you need like the linux kernel and then do stuff in the terminal commands, right?

You should focus on learning Emacs first

i mean its not like I don't have my legit 2015 macbook around too, this is totally an eccentric hobby sort of thing ya know

If you really want to dive in: github.com/ch11ng/exwm

But as the other user said, you should definitely focus on learning emacs first

informatimago.com/linux/emacs-on-user-mode-linux.html
howardism.org/Technical/Emacs/new-window-manager.html
These are some people that use Emacs as their primary environment. You will learn a lot if you jump right in. On the other hand, things will be a lot smoother and natural if you are totally comfortable with the Emacs environment first

my dudes you're friggin awsome, going to take my shitty old macbook to work tonight and get down and dirty

Have fun, user. Picking up Emacs a year ago is the best decision I've made. It makes computing fun again.

Someone definitely need to make an emacs "distro," liveUSB.

It's called GuixSD, user

Mind = Blown

Here is what I did:
(Optional) Download a package called use-package. It greatly helps with keeping your config organized.

Download Evil and Evil-Leader packages. This will give you almost full functionallity. If something is missing then check the package manager and sort for packages which start with evil or evil-. This will pretty much give you all evil related packages that give you vim functionality.

Afterwards, pick a package you want to download and read the docs to see which keybindings it uses. Pick a binding then press C-h k which will bring up the help menu for a key. Press the key combo and it will give you the description of the function as well as the function name which you can then take and rebind using either the evil package rebind functions or the evil leader ones. From this point you can just read the docs for a package and rebind as you go along. Just keep in mind that some of the emacs bindings might not work in vim mode so you can temporarily switch to emacs mode by pressing C-z and then you can execute the whole C-h k to get definition and rebind. More work than simply using vim and its packages but its worth it imho.

Additionally, I think there is some large package called evil bindings or something which brings in vim style bindings for close to 50 of the most popular emacs packages.

I just use emacs to run M+X shell for a comfy iex interface in my Elixir projects. I use VSCode for my actual text editing

Is this a crime

just curious, what do you like about vscode?

i've been on emacs for about 3 years now but am open to try new editors if they are superior

it's not a crime it's just nonsense

I second this. I'm interested why people get drawn into things like VSCode

Attached: cianiggers.png (578x148, 21K)

Had anyone looked into EXWM? How is it as a daily driver?

I'm pretty sure that's the way to go. There used to be something called semantic-mode that theoretically could be used for Java, but I was never able to get it working reliably. Eclim is the only solution I've been able to get working, and job constraints mean that I still have to spend half my time in Eclipse anyway, so wrangling Eclim is barely worth the effort for me.

Funny thing, a LOT of the gnu coreutils have emacs-compatible shortcuts already built into them. Bash defaults to using emacs-style line and character controls, screen has some similar shit. If you're familiar in a terminal environment that probably isn't pure BSD or something, you may have some emacs familiarity already. I literally never noticed it til recently but definitely there.

I don't really like the idea of it

Emacs seems so nice, but I only know of like
>C-x C-f, C-x C-s, C-x C-w
>C-x k, C-x b, C-x o, C-x 1/2/3
>M-x eshell
learning it while learning C++,
As far I understood it uses styles for each language and you can edit them so for example if I wanted to make TAB do an indentation of set spaces would I set that in the C++ style? Is it possible to use multiple styles at the same time as long as they don't conflict?

>requires dbus to send email
Why are you using this piece of shit bloated monstrosity?

Protip: it doesn't.

After using Spacemacs for a couple of months I've decided to roll my own Emacs config, as the slow load times and the idiosyncrasies of tweaking a custom Emacs distribution made my life harder.

I've copied the stuff I liked about Spacemacs (evil, which-key, space as leader). I'm writing the config in org-mode and use use-package for everything. General.el for all keybindings, super nice integration with use-package as well.
Currently at 1500 lines of code after two weeks of tweaking and still no end in sight, lol.

Do you think it's worth it though? Investing all this time configuring while you could use spacemacs out of the box.

For most people, probably not. They just want an editor that werks without spending hundreds of hours editing config files. In that case, Spacemacs*, VSCode and other editors are a good choice.
But to me, the biggest strength of Emacs is the fact that you can change just about everything and truly make it your own. The hours invested probably will not pay off in increased productivity but I have fun ricing stuff, so why not

*Spacemacs is a good intro to Emacs imo because it shows you what's possible with sane defaults. After using it for a while, you'll know which features you actually need and can create a trimmed-down version that suits you personally

>Protip: it doesn't
Try it yourself.

mmmh, I'm making a bit of research and VSCode has a vim mode and an org mode. Do any of you guys use it? Is it a good alternative to emacs (spacemacs)?

Vim mode is kinda shitty (can't do macros) and org mode just basically does syntax highlighting.

no folding?

They can't implement folding in vscode

bump

What are some essential packages for turning emacs into a C++ IDE?

I use diminish in use-package to try and keep my mode-line clean - I'm sure this used to work, but I was using some meme powerline shit and now that I've disabled it diminish doesn't seem to be working and I'm seeing all the modes in my mode line (pic related). Any ideas?

Attached: Screen Shot 2018-05-16 at 16.27.30.png (2104x2184, 957K)

nice font/colour scheme, what is it?

I would suggest customizing your powerline theme

IBM Plex Mono/sanityinc-tomorrow-night
I disabled powerline altogether, that's just the basic modeline.

The problem with something like this is
> Send an email from emacs
> Main thread gets blocked while email is being sent, freezing everything

emacs does stuff asynchronously

nice nice

It can, but that doesn't necessarily mean it does. Sending mail with notmuch blocks the thread. So does anything that uses url-retrieve-synchronously, which is a substantial portion of packages because url-retrieve is a bitch to use properly.

not everything runs asynchronously.
e.g. if you try to update your packages while your internet connection is down, it will freeze emacs too.

What emacs do you guys use lucid, nox or gtk version?

I just use spacemacs.
Very good, I enjoy it a lot.

gtk. not because I'm a fan of gtk but I like the gui featurues even though there are very few.

company with irony

I think diminish only works for minor modes.
It seems delight is the recommended package to use nowadays for modeline hiding, has use-packe integration too.

Only reason to use evil is for vi keybindings