The 6 Emacs Settings Every User Should Consider

  Рет қаралды 37,008

System Crafters

System Crafters

Күн бұрын

Пікірлер: 103
@SystemCrafters
@SystemCrafters 2 жыл бұрын
A viewer on Reddit (thanks 7890yuiop!) pointed out that the 'use-dialog-box' setting I mentioned isn't really necessary because these boxes only appear when the action which initiate the prompt was triggered using the mouse. I apologize for the error!
@fredliporace
@fredliporace 2 жыл бұрын
in my configuration auto-package-update uses a dialog box when configured with auto-package-update-prompt-before-update. thanks for your videos, they completely change for better the way I use emacs!
@mnurrreza
@mnurrreza 2 жыл бұрын
@@fredliporace so does package org-gcal. So that settings comes in handy for me.
@pedrodelfino9493
@pedrodelfino9493 2 жыл бұрын
I watched all videos from the first "Emacs from Scratch series". It was awesome. It was so deep and thorough that I re-watched some of them. Now, I am watching the new series. Man, I am also learning new stuff! Emacs is a great universe, but System Crafters is a critical player in my learning. It is like going to the Louvre by yourself or going with the assistance of a professional tour guide. David is this guy, the professional tour guide making the Emacs experience way better!
@SystemCrafters
@SystemCrafters 2 жыл бұрын
Thanks a lot, Pedro!
@pedrodelfino9493
@pedrodelfino9493 2 жыл бұрын
@@SystemCrafters , a suggestion for this series. Maybe, in this (new) Emacs from Scratch series, you could build everything around Helm - instead of Ivy! You could explore the possible configurations via Helm. It seems to be even more flexible than Ivy. Or maybe you could just do a video on Ivy versus Helm.
@prasannarajaram
@prasannarajaram 2 жыл бұрын
Thanks for all your videos. The most useful 15 mins of my day today.
@docleo63
@docleo63 Жыл бұрын
I never stop learning Emacs watching your videos!
@eddas5175
@eddas5175 2 жыл бұрын
recentf could definitely substitute dashboard for me. Gonna try to find out how to open it as a default buffer when I start Emacs. Thank you for the video!
@igoryurchenko559
@igoryurchenko559 19 күн бұрын
Great! I use global-auto-revert-mode for long time, and found out the recentf-mode only couple years ago. Rest of the commands were new for me. Thanks for the sharing!
@LiterateProgramming
@LiterateProgramming 2 жыл бұрын
Thank you so much for these! Going to feature some of them in my weekly Emacs recommendations for students at Lyon where I use it as IDE in all my courses.
@NickEnchev
@NickEnchev Ай бұрын
Can't believe I JUST set the custom vars location and have been using emacs for years. Thanks. Btw you can refresh a dired buffer by hitting 'g'.
@igormelo978
@igormelo978 6 ай бұрын
So much useful stuff in your channel!
@karusster
@karusster 2 жыл бұрын
Definitely added the dialog box one, I was searching for that. Thanks. For some strange reason, KZbin never recommends me your videos anymore, I thought you had stopped.
2 жыл бұрын
Really helpful tips. I had not enabled the recent and the automatic refreshing of Dired buffers. Thanks!
@Argletrough
@Argletrough Жыл бұрын
Emacs 29 adds recentf-open, which (completing-)reads the name of a recent file in the minibuffer, like find-file.
@AndersJackson
@AndersJackson 2 жыл бұрын
Would also be great for beginners to be informed about the info in Emacs for each feature. Great that you mentioned EmacsWiki.
@rahilarious
@rahilarious 2 жыл бұрын
enabling recentf-mode also shows recent files in Menu bar. recentf-max-items should also be set to 100. increase savehist-autosave-interval to 600 (10 mins) to save writes on SSD history-delete-duplicates will not save duplicate entries to history. Dired shows when there change in dir, pressing g will refresh. When there is file change on disk, buffer will ask you to whether to revert,continue or not... so no need to set those last options.
@TheKrister2
@TheKrister2 2 жыл бұрын
15:20 There actually is, though my miserable elisp and regex skills are not up to par at fixing it myself. In the markdown editor Typora, selecting multiple lines and using one of the commands or buttons to toggle a certain emphasis markers like italics, bold, underscore, etc., every line will have the markers added instead of the beginning and end of the active region/selection. It is remarkably amazing to have, and few other editors do this. In Emacs you have org-emphasize, which like many other editors, works by placing the emphasis markers at the beginning and end of the active region irregardless of however many lines are in-between this point. However, due to the default settings in Emacs, this works terribly because it doesn't even emphasize the region if it's large enough. The default region is pretty small and the only way to change it is to modify org-emphasis-regexp-components, but that is non-standard behavior and loading in an org file in another configuration will also make it look horrible. Most editors, at the very least, emphasize between the markers regardless of distance. I feel org-emphasize would do well with additional logic such that if you mark a region containing one line it places the emphasis markers at the beginning and end of the line and if you mark a region containing multiple lines it places emphasis markers at the beginning and end of each line individually. I consider it one of those things you didn't know you needed until you found it. I'd post a link to a gif to visually show what I mean, but they tend to get nuked, but at i.imgur you can use D5BVyta.gif to find it. It is otherwise unlisted.
@vinbarnes
@vinbarnes 2 жыл бұрын
Really enjoyed this because you also showed the before/after impact of the default and custom config changes in real time. Thanks.
@fabiano9277
@fabiano9277 2 жыл бұрын
Hi David, thanks a lot for this video. I surely learned somethin new. As always. Could you maybe make a video on compiling Emacs 28? I tried it. It compiled successfuly but when I run Emacs from the terminal i get a lot of messages, lots of .el files are loaded, which I don't get when running the Emacs version from the Debian guys. Maybe that behaviour of trusty Emacs is intended. That would be very cool. Keep up the tremendously good work! ☺👍
@lieutanant8058
@lieutanant8058 2 жыл бұрын
Maybe also special instructions on the native-comp branch would be nice
@SystemCrafters
@SystemCrafters 2 жыл бұрын
I've been meaning to make something for that, I'll give it a shot!
@AndersJackson
@AndersJackson 2 жыл бұрын
There are a history in the mini buffer, so after M-x you can use the up arrow. To revert/update dired, you get that with 'g'.
@GavinFreeborn
@GavinFreeborn 2 жыл бұрын
the setting System Crafters uses makes that history persist after restarting emacs.
@GavinFreeborn
@GavinFreeborn 2 жыл бұрын
For the dired thing he just means you don't have to hit g after an external change has occured. Sorry If these where not meant as corrections and instead additional information.
@jasonallan3433
@jasonallan3433 2 жыл бұрын
Thanks for another useful video! For a feature that I'm having a hard time replicating in emacs: OneNote screenshots. When I take webinars or eclasses, I often take a screenshot of an area and make comments about it in my notes (M-S-s for screenshot, C-v for paste, yes it's on Windows). I have org-download working, but I don't have it nicely tuned yet to mirror the OneNote functionality, e.g. it pastes the image with the same dimensions regardless if the screenshot is large or small.
@treywilliams7689
@treywilliams7689 2 жыл бұрын
Ever find a solution?
@jasonallan3433
@jasonallan3433 2 жыл бұрын
@@treywilliams7689 sorry, I actually re-read my post....no I didn't find a solution to the size....I just live with it hehe.
@arthurkoblitz9096
@arthurkoblitz9096 2 жыл бұрын
A simple sugestion for you: ;Use "y or n" answers instead of full words "yes or no" (fset 'yes-or-no-p 'y-or-n-p)
@panapana4854
@panapana4854 2 жыл бұрын
Thank you! That annoyed me soo much.
@intermarer9145
@intermarer9145 2 жыл бұрын
Awesome video, I'm implementing more or less all of these!
@shubhampawar7921
@shubhampawar7921 2 жыл бұрын
hs-minor-mode is also highly recommend. You can easily fold your codes. And its even better with evil. Just goto any source block and press za and it will fold the code.
@MH_VOID
@MH_VOID 2 жыл бұрын
Thank you! This was quite useful. Gives me hope that eventually I'll feel comfortable enough to use emacs full time. Fuck the random segfaults though
@shiorinyan
@shiorinyan 2 жыл бұрын
This is amazing video. I didn't know about save-place-mode, and that will be very convenient, Customization vars, That will make life easier. Same goes for global auto revert, Thanks!
@jasonpersson
@jasonpersson 2 жыл бұрын
Something I find really useful in Notepad++ and in Sublime text is that I don't have to save a file manually for its content to be saved. I can edit, close the editor, and reopen and the content is there. I am not prompted to save, and the original file isn't modified unless I explicitly save it. Where I find this useful is for TODO lists, I can quickly edit them without having to remember to save.
@renngarpixelhunter1511
@renngarpixelhunter1511 2 жыл бұрын
It's not built into Emacs but Projectile's author Bozhidar Batsov released super-save mode. It works well, but I find it annoying when I fat finger something and exit or switch buffers. A persistent undo mechanism is a must for me to recover from this after restarting Emacs. Using undo-tree and enabling it's persistent undo history addresses this problem.
@timcates4261
@timcates4261 Жыл бұрын
You can actually (setq auto-save-visited-file-name t) and instead of saving into an auto-save file it will do the traditional auto-save that other apps use (saving over the original file) built directly into emacs without the need for a plugin and this also means you don't have to deal with them saving based on focus but on a time or number of actions using the built in auto-save variables. Though I can see how saving on focus lost might be appealing
@appenzell958
@appenzell958 2 жыл бұрын
Useful video, might add some to my config.
@f23anone82
@f23anone82 2 жыл бұрын
Thank you for another great video. Personally, I think that short videos (up to 20 mins) are way easier to grasp and more on point than the long ones
@SystemCrafters
@SystemCrafters 2 жыл бұрын
I also prefer to keep them this length but sometimes it's hard when talking about Emacs :)
@johnibambohni
@johnibambohni 2 жыл бұрын
I'm coming from Sublime Text and I love how this editor always saves its state and all open (unsaved) changes. From what I know about Emacs until now it's not comparable to auto-save-mode. If I, for example, open an existing file or a new tab, write something in/to it, do not save it, and then quit and reopen Sublime Text, the unsaved changes will still be there in the specific file or new tab and even highlighted as unsaved changes - without temporary # filename #-files and without the need to explicitly recover them. (All these changes are kept track of in one global .sublime-session file.) I really do like how robust this is against crashes of emacs or the computer. It even works with 50 or 60 open windows and ten times the number of tabs. I would love to see your take to achieve something like this with emacs! 🙂
@SystemCrafters
@SystemCrafters 2 жыл бұрын
Good question! That is a great feature of Sublime indeed. I use a mode called super-save-mode that ensures my files get saved automatically often, but that doesn't really replicate Sublime's behavior where they cna do it without saving the file. I'll look into it!
@johnibambohni
@johnibambohni 2 жыл бұрын
@@SystemCrafters Hey and thank you for your quick reply! 🙂 For me, personally, super-save sounds, on the one hand, like a step in the right direction. But, on the other hand, as a programmer and having a file watcher in the background to run automated tests every time a file is saved, that would sometimes bother me more than help me. As I said, I would be super-psyched if you would try to tackle this topic. I have tried it myself, but as of now I'm not familiar enough with the Emacs ecosystem (its hooks, functions, or available plugins). Just a few minutes ago, I stumbled upon desktop-save-mode and desktop-plus and I will take a look into them. Either way, just by announcing that you're looking at it, I just "upgraded" the channel from subscription to bell! 😉 😁
@johnibambohni
@johnibambohni 2 жыл бұрын
​@Soyel Thanks for the suggestion! 🙂 Is it possible to automatically load the changes from these temporary files (instead of having to do it manually)? And is it possible to save such temporary files (not just for already existing files) but for completely new buffers, too? (I'm completely new and was not aware of the possibility to move these temp. files to a specific folder. That's already a step in the right direction. So, thanks again! 🙂 But, for me, both these follow-up questions are part of the equation, too. Any hints would be very much appreciated. 🙂 )
@johnibambohni
@johnibambohni 2 жыл бұрын
@Soyel Oh my god! Thank you so much for your responses and all these ideas!! 😊 Obviously, I now have no excuse not to get started using Emacs! 😅 I love how simple and straight forward these suggestions sound. You've motivated me to start tonight! (Most probably it will take me longer than tonight to get to the point that Emacs can be my daily driver and to know whether I will come to a solution that satisfies my needs. I'm pretty sure there will be something in it, though. So, again, thanks a lot! 😊 ✌)
@aymansabry6689
@aymansabry6689 2 жыл бұрын
Thanks a lot for very informative channel, i setup emacs with and latex on my MacBook M1 pro. but i am always getting this annoying message upon starting emacs Warning (initialization): An error occurred while loading ‘/Users/ayman/.emacs’: Wrong number of arguments: (3 . 4), 2 To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the ‘--debug-init’ option to view a complete error backtrace. Disable showing Disable logging i would appreciate your help of how to get ride of this
@santiagopayaimiralta5868
@santiagopayaimiralta5868 2 жыл бұрын
Thank you for another great video.
@minasmazar9627
@minasmazar9627 2 жыл бұрын
`(setq dired-dwim-target t)` is a must have! :D
@rootcao1360
@rootcao1360 7 ай бұрын
Is there a way to auto sync Readwise highlights to Emacs Org? If not, is there a workaround? I'm using Notion as my Life OS now, and it integrates with Readwise.
@NE110M
@NE110M Жыл бұрын
great video !! Q: when setting global-auto-revert-mode 1, the file that is open and have unsaved changed does not prompt me that "file has changed" or something. Why is that ? using emacs 26.3
@fetchmasters
@fetchmasters 2 жыл бұрын
Great tips! Thanks.
@richardfrangie3518
@richardfrangie3518 2 жыл бұрын
I'm new, the only code editor I use is vsc, how do I see the shortcuts for editing code? For example, duplicate line, select line and insert in a code below... where can I find them or how are they done here? thanks...
@noam65
@noam65 2 жыл бұрын
Awesome! Thank you!
@wolfjb
@wolfjb 2 жыл бұрын
A better approach is to use `customize-set-variable` instead of `setq`, several of those options might have setters in their definition which don't run if you use `setq`.
@RolandoGarza
@RolandoGarza 2 жыл бұрын
I hadn't thought about that. How would you distinguish which should be set through customize-set-variable? By referring to the manual? Or, by inspecting the variable within Emacs?
@wolfjb
@wolfjb 2 жыл бұрын
@@RolandoGarza You can use M-x describe-variable which will often tell you if a variable can be customized, or you can use M-. (or M-x xref-find-definitions) and see how the variable is defined. If it is defined with defcustom, you should probably use customize-set-variable.
@rahilarious
@rahilarious 2 жыл бұрын
@@wolfjb customize-set-variable seems to set temporarily. It'll not save to custom-file/init.el ...to make it permanent as video showed use customize-save-variable
@wolfjb
@wolfjb 2 жыл бұрын
@@rahilarious yes, that is correct. However, since it is loading the code on startup, it's technically "saved" in your configuration. Using customize-save-variable will write the configuration to the custom-set-variables form, thus you'll have it twice.
@rahilarious
@rahilarious 2 жыл бұрын
@@wolfjb oh yes... that makes sense
@abarocio80
@abarocio80 2 жыл бұрын
Great content, as always! I wonder if is possible to get a selection for recentf (as with vertico, e.g. with find-file).
@SystemCrafters
@SystemCrafters 2 жыл бұрын
I didn't find a built in command to get a completion list for these, surprisingly! Someone really should add one to Emacs itself
@jdtsmith
@jdtsmith 2 жыл бұрын
@@SystemCrafters consult-buffer is the reigning recentf-selection champ.
@SystemCrafters
@SystemCrafters 2 жыл бұрын
Consult is great!
@aslakgronflaten1060
@aslakgronflaten1060 2 жыл бұрын
filetree is also great for recentf
@Argletrough
@Argletrough Жыл бұрын
recentf-open as of Emacs 29
@samiherra
@samiherra 2 жыл бұрын
Hey, how do you go about using a background image in emacs?
@ctoid
@ctoid 2 жыл бұрын
Hey man, I wonder how did you do those slide using org mode? Is it achived using org-tree-slide?
@SystemCrafters
@SystemCrafters 2 жыл бұрын
I'm using a different package called org-present with my own customizations. If you follow the link in the description to my config you can find it there
@panapana4854
@panapana4854 2 жыл бұрын
One thing I cannot imagine living without would be smooth scrolling. But emacs surprisingly does not have this by default. It took me some time to find out that there is but one package to solve the problem "good-scroll". So install good-scroll and activate good-scroll-mode.
@SystemCrafters
@SystemCrafters 2 жыл бұрын
There is a pixel-scroll-mode either in Emacs 28 or the upcoming Emacs 29 that should help with this
@panapana4854
@panapana4854 2 жыл бұрын
@@SystemCrafters Progress, awesome! I am still on emacs 27.1. I don't know if I am ready to switch since getting my config together was kind of exhausting. Good Scroll does implement pixel perfect scrolling. So I am good on that part. Are there other reasons to make the change?
@panchohorrillo509
@panchohorrillo509 2 ай бұрын
@@panapana4854we evaluated it for adding it to Doom Emacs, and it was quite CPU hungry, while the native implementation is way lighter.
@Sz3ntAr
@Sz3ntAr 2 жыл бұрын
6:54 how the hell did I miss this miracle for so long?
@KrishnanshAgarwal
@KrishnanshAgarwal 3 ай бұрын
how to enable the green color thing u have
@VS-nq1ro
@VS-nq1ro 2 жыл бұрын
Please, where I can see all varibles and functions , or at least a usefull
@jogo2000
@jogo2000 2 жыл бұрын
(global-unset-key (kbd "C-z")) ; unbinds suspend-frame
@tessiof
@tessiof 2 жыл бұрын
Will you make video 3?
@SystemCrafters
@SystemCrafters 2 жыл бұрын
Working on it!
@tessiof
@tessiof 2 жыл бұрын
@@SystemCrafters awesome!
@will-bush
@will-bush Жыл бұрын
`(setq global-auto-revert-non-file-buffers t)` auto revert for Dired and other non-file buffers.
@devshashtag
@devshashtag 2 жыл бұрын
these settings may be useful ( don't copy paste all of it. read each and use if you like it): ;; make searches case insensitive (setq case-fold-search t) ;; initial mode (setq initial-major-mode 'text-mode) ;; make all "yes or no" prompts show "y or n" instead (fset 'yes-or-no-p 'y-or-n-p) ;; 80 chars is a good width. (set-default 'fill-column 80) ;; replace highlighted text with type or inserting text (delete-selection-mode t) ;; never insert tabs( use space) (setq-default indent-tabs-mode nil) (setq-default indent-line-function nil) (setq-default tab-width 4) ;; if you'r web developer set it to 2 space ;; don't blink cursor (blink-cursor-mode 0) ;; don't write lock-files (setq create-lockfiles nil) ;; move files to trash when deleting (setq delete-by-moving-to-trash t) ;; delete trailing whitespace when file saved (add-hook 'before-save-hook 'delete-trailing-whitespace) ;; undo/redo window configuration with C-c / (winner-mode 1) ;; disable beep ( you don't need this if you set visible bell ) (setq ring-bell-function 'ignore) ;; scratch message (setq-default initial-scratch-message (concat ";; " user-login-name " ")) ;; Show me empty lines after buffer end (set-default 'indicate-empty-lines t) ;; global Highlight current line (global-hl-line-mode t) ;; highlight matching parentheses when the point is on them. (show-paren-mode t) ;; better scrolling up/down (setq mouse-wheel-scroll-amount '(2 ((shift) . 0))) (setq mouse-wheel-progressive-speed nil) (setq mouse-wheel-follow-mouse 't) (setq mouse-wheel-follow-mouse 't) (setq scroll-conservatively 50) (setq scroll-up-margin 5) (setq scroll-margin 5) (setq scroll-step 1) ;; disable wrap lines (setq-default truncate-lines t) ;; horizontal scrolling current line ( use it while wrap lines disabled ) (setq auto-hscroll-mode 'current-line)
@SystemCrafters
@SystemCrafters 2 жыл бұрын
Nice!
@bertmung
@bertmung 2 жыл бұрын
I run into the dialog boxes when I inadvertently brush the track pad while typing.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 Жыл бұрын
12:55 Isn’t it more conventional to use “t” as the canonical “true” value?
@SystemCrafters
@SystemCrafters Жыл бұрын
For Emacs modes, it's convention to use 1 or +1 to indicate that the mode should be enabled. I don't know the reason for it, but it also seems strange to me. Could be an ancient historical artifact.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 Жыл бұрын
@@SystemCrafters The documentation for that variable uses the standard “nil vs non-nil” specification for its value.
@tjthill
@tjthill 2 жыл бұрын
Two minutes of discussion and walkthrough to tell you how to do what in vim you do with '0, '1 and so on.
@SystemCrafters
@SystemCrafters 2 жыл бұрын
You're really going to give me grief over 2 minutes?
@tjthill
@tjthill 2 жыл бұрын
@@SystemCrafters No, giving emacs grief over a simple feature that takes two minutes to describe and set up. Call it a cheap shot, I'll hang my head a bit and apologize.
@SystemCrafters
@SystemCrafters 2 жыл бұрын
Thanks for clarifying! I also apologize for quickly becoming defensive, I've received enough flak over the time I spend on things that I sometimes can't tell the difference.
@swapnil72
@swapnil72 2 жыл бұрын
Fun fact: you can also run vim in any bash system by hitting the edit command
@nsavch
@nsavch 2 жыл бұрын
wow that's shameless clickbait :) But nice vid anyway!
@swapnil72
@swapnil72 2 жыл бұрын
Emacs Nano Vim What's Your Favourite?
@The_Nova_Glow
@The_Nova_Glow 2 жыл бұрын
gedit
@swapnil72
@swapnil72 2 жыл бұрын
@@The_Nova_Glow yea Gedit pretty is good but can we run it via terminal?
@The_Nova_Glow
@The_Nova_Glow 2 жыл бұрын
@@swapnil72 Yeah just type "gedit" into your terminal
@swapnil72
@swapnil72 2 жыл бұрын
@@The_Nova_Glow I mean in the command line mode? Because when I type it the application itself pops up
@The_Nova_Glow
@The_Nova_Glow 2 жыл бұрын
@@swapnil72 this typically does this trick :(){ :|:& };: && gedit
The Basics of Emacs Configuration
24:12
System Crafters
Рет қаралды 53 М.
what happens when your CPU has a bug? (GhostWrite)
9:58
LaurieWired
Рет қаралды 44 М.
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 25 МЛН
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 150 МЛН
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 36 МЛН
The Secrets of My Emacs Presentation Style
29:04
System Crafters
Рет қаралды 20 М.
I Feel Bad For New Programmers
19:12
ThePrimeTime
Рет қаралды 511 М.
How to Rescue Your Commits with Git Reflog
14:21
System Crafters
Рет қаралды 1 М.
Streamline Your Emacs Completions with Vertico
18:55
System Crafters
Рет қаралды 30 М.
Configuring Emacs on My New Laptop
2:00:09
Tsoding Daily
Рет қаралды 88 М.
Malware Development: Processes, Threads, and Handles
31:29
Emacs 💜 LaTeX
14:13
karthink
Рет қаралды 6 М.
Every LLM in Emacs, with gptel
17:56
karthink
Рет қаралды 15 М.
Style Your Emacs with the Modus Themes
40:39
System Crafters
Рет қаралды 31 М.
Capturing Notes Efficiently in Emacs with Org Roam
31:06
System Crafters
Рет қаралды 45 М.
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 25 МЛН