Want To Rewrite Your Configs In Org-Mode? It's Easy!

Поділитися
Вставка
  • Опубліковано 4 лис 2024

КОМЕНТАРІ • 67

  • @robertdavis9948
    @robertdavis9948 4 роки тому +27

    Org mode is smart enough to wrap code block delimiters around selected text. Mark the block you want, then press "C-c ," and that will give you a nice menu. hit "s" to wrap the selected text in a source code block. I believe that "

  • @nicolasmorazotti8684
    @nicolasmorazotti8684 4 роки тому +33

    I've used emacs for about 8 years, org-mode for 4 years and didn't know about the :toc:

  • @TheFakeVIP
    @TheFakeVIP 4 роки тому +10

    Long time markdown user, but this is totally a reason to learn org-mode. You could definitely do this with a Pandoc filter for Markdown as well, and I might just try that, but whatever markup language, it's so cool you can do this, and it'll be so helpful to clean up my configs.

  • @AndersJackson
    @AndersJackson 4 роки тому +8

    Thanks, you have shown peopel the light in Emacs.
    This is a great way of document your config files, and that without lots and lots of comments in the code.
    You could also generate HTML, PFD, LaTeX, LibreOffice and plain text files from the Org-mpde too, so it get even easier to read for someone that want to have a look at your code.
    Would also recommend that the links get properly converted into named linkes, just put [] around the link. There are also a shortcut to make a text with a link into a proper link.
    But, thanks for showing the magic of Emacs. And as usual, I learn some stuff from looking at your videos about Emacs. And I started to use it back about 1985.

  • @robertdavis9948
    @robertdavis9948 4 роки тому +29

    In vanilla emacs, :toc: doesn't work like it does in Doom. You'll need to install the toc-org package to get the same functionality.

  • @markmake2252
    @markmake2252 2 роки тому

    Your videos inspired me a lot. I finally ditched macOS and Windows and I am using Arch Linux as my daily driver. This and all the other videos showing the wonders of Emacs and Org mode are also an added value to this switch. I found Emacs really intimidating at first, even by reading its tutorial and manual, let alone the Org-Mode-Bible-like manual... but your videos helped me to learn more and use this piece of software. I still have a lot to learn but I am already starting to use Emacs in my workflow. I wish you could also guide us into using Emacs as a mail client, or music player or anything else that it can do ! You are doing a great job indeed. There should be more people like you in this planet!

  • @bibleculture
    @bibleculture 3 роки тому +2

    I needed this! Thanks. I'm starting to rewrite my spacemacs config files this way. Read a few reddit posts and blogs, but videos are much better for this type of content.

  • @tomaso0
    @tomaso0 4 роки тому +24

    0:07 The org language is a form of markup language, but not related to markdown in any way apart from that

    • @semilin
      @semilin 4 роки тому +6

      I think he meant to say markup

    • @driden1987
      @driden1987 4 роки тому +1

      Was about to make this comment myself, thanks @tomaslib

  • @auroradraco9974
    @auroradraco9974 4 роки тому +4

    This is honestly great, org mode really is a killer feature.

  • @kristiannordin7765
    @kristiannordin7765 2 роки тому +1

    Thank you for this video. Been searching the web to make this work but didnt find a solution that made sense to me.
    After watching your video everything is working perfectly.
    Thank you!

  • @HenriqueNewsted
    @HenriqueNewsted 4 роки тому +2

    This made me want to try emacs, and i've been a Vim user since i started on Linux (circa 2017). Thanks DT, if it weren't for you i would never know this.
    You are surely the best Linux youtuber out there!

    • @Archwyrm
      @Archwyrm 4 роки тому

      The neat thing about Doom Emacs or vanilla Emacs with evil-mode is you can be a Vim user *and* an Emacs user. :)
      I've been using Vim since 2003 and am recently exploring all that Emacs has to offer like org-mode and customizing in Elisp!

  • @kubo407
    @kubo407 4 роки тому +6

    This is incredibly useful! I'm definitely going to start making more use of org-mode.

    • @AndersJackson
      @AndersJackson 4 роки тому

      It is great. Both for config files and also for programming. Tangeling was something Donald Knuth used that he called WEB programming, way back in time. But he didn't used Emacs for that. Org-mode wasn't invented yet. :-)
      I use it to generate my Emacs config and init.el. So yoou can tangel many different files and in many languages if you want to.
      There are even some people that write their PHd thesis in Emacs and tangle it into LaTeX, generating all data files etc. But of course you don't need to to do that if you don't want to.
      But in plain Emacs, C-c C-e l p generates PDF document from Org-mode file, and C-c C-e h h generates HTML document from the Org-mode file.

  • @JeffChien13
    @JeffChien13 2 роки тому

    you have successfully made me switch from vim to emacs. also I found that tangle can work for any text content not just programming languages, all it needs is to call revert-buffer.

  • @aleksandrpetrosyan1140
    @aleksandrpetrosyan1140 4 роки тому +10

    You can tangle anything you like. So you can do i3, and SpectrWM confirms in Org.

    • @DistroTube
      @DistroTube  4 роки тому +1

      Nice!

    • @aleksandrpetrosyan1140
      @aleksandrpetrosyan1140 4 роки тому +5

      @@DistroTube specifically, you set the file name to the file name, o
      I.e.
      =:tangle .config/i3/config=
      As seen in orgmode.org/manual/Extracting-Source-Code.html

    • @aleksandrpetrosyan1140
      @aleksandrpetrosyan1140 4 роки тому +2

      @@DistroTube I would also recommend github.com/mtekman/org-tanglesync.el

    • @DeshierArchitecte
      @DeshierArchitecte 3 роки тому

      What do you specify as the language in the code block then? Just plain text?

    • @aleksandrpetrosyan1140
      @aleksandrpetrosyan1140 3 роки тому

      @@DeshierArchitecte See my other replies.

  • @alan_core
    @alan_core 4 роки тому +2

    Thanks for the hard work Derek, stay safe

  • @FrederickCai
    @FrederickCai 4 роки тому +2

    One thing kinda annoying me is, if you move to 5:28, you will see even you've wrapped the code in source code block, it won't highlight them until you move to `#+BEGIN_SRC`.

  • @kaiocesar8578
    @kaiocesar8578 4 роки тому +11

    I don't see why it will only work with programming languages scripts

    • @DistroTube
      @DistroTube  4 роки тому +12

      Actually, I was corrected on this by another commenter. Tangle will work on anything so it doesn't have to be a programming language, since we are not really evaluating the code with this. We are just writing what's in the SRC blocks to the file we specify.

  • @dantebarbieri
    @dantebarbieri 4 роки тому +7

    I love this idea and want to rewrite my dotfiles in org mode, but for some files like bspwmrc which is a shell file that requires executable permissions, tangle removes the permissions. Is there a way to make the tangle output with the executable permission set?

    • @dantebarbieri
      @dantebarbieri 4 роки тому +9

      Surprise surprise, the answer was in the documentation. orgmode.org/org.html#Working-with-Source-Code
      In short:
      There is a shebang property that sets the file executable and adds a shebang, there is a way to set it executable without the shebang property using `:tangle-mode (identity #o755)`.
      The Shebang property: `:shebang "#!/bin/bash"`
      To set multiple properties you need to either do it on one line: `#+PROPERTY: header-args :tangle bspwm :shebang "#!/bin/bash"`
      Or you must specify that you are appending to the property:
      ```
      #+PROPERTY: header-args :tangle bspwm
      #+PROPERTY: header-args+ :shebang "#!/bin/bash"
      ```
      Make sure that you reload whenever you change the property or tangle will not output correctly. I kept getting 0 blocks output until I reloaded with C-c C-c. Hope this helps somebody!

    • @DistroTube
      @DistroTube  4 роки тому +5

      Glad you got it working. And thanks for posting the solution here. Others will definitely need it! :D

  • @cornelisdejong1523
    @cornelisdejong1523 4 роки тому +1

    You might consider using the expand-region package {melpa} which facilitates selection. Besides legacy emacs includes mark-whole-buffer, which I've bound to C-a {naturally!}.

  • @TDOLLA
    @TDOLLA 8 місяців тому

    damnit… I JUST got to a point where I got a solid understanding of neovim and can customize it to my liking and understand the config and modular file structure. Now I want to go start on emacs

  • @digitalife8719
    @digitalife8719 11 місяців тому

    Short version of the tutorial.
    1.Make your file like this:
    #+PROPERTY: header-args :tangle output_file.py
    * entry_1
    #+BEGIN_SRC python
    print('hello')
    #+END_SRC
    * entry_2
    #+BEGIN_SRC python
    print('world')
    #+END_SRC
    2. Put the cursor in the #+PROERTY line. Refresh local setups with C-c C-c,
    3. Then, M-x org-babel-tange ENTER, to execute command org-babel-tangle to output code in all code blocks into file output_file.py, in the same directory of current org file.

  • @Phydoux2112
    @Phydoux2112 4 роки тому +3

    Wow! This is some cool stuff! Time for me to get serious about Emacs!

  • @patrykgronkiewicz924
    @patrykgronkiewicz924 4 роки тому +9

    4:50 you could do ggyG instead of ggVGy

  • @mohammedalbatati5529
    @mohammedalbatati5529 2 роки тому

    Thanks alot DT
    I started changing all my README files to org mode
    It looks much better

  • @otavioschwanck6668
    @otavioschwanck6668 4 роки тому

    Tip:
    You can go to dired mode with SPC . and selecting a folder instead a file. You can use SPC . to create files too.

  • @hayopapayo1717
    @hayopapayo1717 4 роки тому +2

    nice, could not watch live stream, was searching for the recordings and couldnt find it ^^

  • @jeremyottley4141
    @jeremyottley4141 4 роки тому +1

    Hey DT? What aspects made you choose Doom Emacs over Prelude or Spacemacs?

  • @rohscx
    @rohscx 2 роки тому

    Good stuff DT

  • @uuu12343
    @uuu12343 2 роки тому

    Question
    I assume this will require emacs to be installed as a dependency for all installs?
    Because doesn't this mean that the config files are in emacs-lisp language as opposed to the correct dotfile Syntax?

  • @AnzanHoshinRoshi
    @AnzanHoshinRoshi 4 роки тому +1

    Thank you, Derek.

  • @brunogama9346
    @brunogama9346 4 роки тому

    Where did you buy that awesome mug?

  • @techforfreedom6023
    @techforfreedom6023 4 роки тому +2

    Hey DT put video about Elisp tutorials. Emacs users want that. good luck.

  • @jr_Linux
    @jr_Linux Рік тому

    man DT makes this all seem easy, but god theres alot to learn, kinda makes me want to try this, but im not sure if im ready for that, "yes i have Doom installed, trying to mess with it and learn some some stuff,

  • @bobkoss280
    @bobkoss280 2 роки тому

    Excellent!

  • @BalajiA
    @BalajiA 4 роки тому

    Excellent. Thanks for this illustration. I'm looking to rewrite and generate my .spacemacs this way.
    f e d opens up the dotfile .spacemacs. How can I make it open the spacemacs.org instead?

    • @bandithedoge
      @bandithedoge 4 роки тому

      hopefully you've found an answer in the 3 months since this comment was posted. in case you haven't, this spacemacs documentation page on binding keys might help: www.spacemacs.org/doc/DOCUMENTATION.html#binding-keys

  • @yiannifunataoldotcom
    @yiannifunataoldotcom 3 роки тому

    Thank you! I really liked that

  • @iqwrjwqioprwjriopqrjpqowir
    @iqwrjwqioprwjriopqrjpqowir 4 роки тому

    I support your videos about emacs, but you have to say the differences between emacs and doom emacs. Statements like "Press Y to yank this" or "

  • @DarkNoys
    @DarkNoys 4 роки тому +1

    it's awesome !!

  • @ste_ph_en9018
    @ste_ph_en9018 4 роки тому

    you missed an opportunity to show off magit the second best package in emacs!

  • @leviticus8930
    @leviticus8930 4 роки тому +1

    I blame Comcast and Pulseaudio

  • @zweitlander874
    @zweitlander874 4 роки тому +1

    :)

  • @mortezabehboodian5758
    @mortezabehboodian5758 4 роки тому +1

    i came for i3 :|

    • @kaiocesar8578
      @kaiocesar8578 4 роки тому +1

      You don't need to evaluate the sources just do C-c C-c in the first line then C-c C-v t to tangle

    • @DistroTube
      @DistroTube  4 роки тому +2

      Yea, I stand corrected on this working with i3 and spectrwm. This will work for any file regardless of whether it's in a programming language since we aren't actually going to evaluate any of this code.

  • @MichaelMantion
    @MichaelMantion 3 роки тому +1

    2 minutes before he gets to it.... Sorry this is 2015, most people don't have time for this. That is why 96.3% of people watched your video and didn't bother to like or unlike it.
    You have a great voice, your nice to listen to, we all want to have a complete understanding. BUT start with the meat then explain it. Your video should be, This is Org mode in doom emacs, Her is a dot file. This is how you do it. THEN go and explain that you use doom and why "i use doom because It gives me Vi/VIM key controls and has a lot of customization I like. Then explain what org mode is and why and give more examples of how it works.

  • @semilin
    @semilin 4 роки тому +2

    Last

  • @usrname1105
    @usrname1105 4 роки тому +2

    FiRsT

    • @usrname1105
      @usrname1105 4 роки тому +2

      Damn bro that’s crazy, but I don’t remember anyone asking.