emacs

My initial thoughts

With emacs, I don’t have to switch modes. This can be liberating from Vim’s modes model where I have to switch to a different mode based on what I want to do.

How to do in emacs?

  1. Figure out how to do these things in emacs.
  2. Update your config with these nice tips.

Questions

  1. How to read ePub books in emacs?
  2. Change CapsLock into Ctrl key for use in Emacs?
  3. How to compare project with project in main branch in GitHub?

Find the answers for the following:

  1. Completion.
    1. Either complete words from dictionary or context aware completion.
    2. Completing words based on words used in the current buffer or project.
    3. Language aware completion.
    4. See emacs - auto completion
  2. Spelling correction. How to identify common spelling mistakes and correct them on the fly. Examples: taht to that This is a very common problem and if there is a way emacs can solve this, it would be very very helpful.
  3. Count the number of occurrences of a word or pattern in the current file.
  4. File comparison with emacs
  5. Indentation
  6. How to move an entire paragraph (or block of code) up? (like alt up arrow or down arrow in visual studio code) Use Vim commands for this.
  7. How to move an entire line up? (like alt up arrow or down arrow in visual studio code) Use Vim commands for this.
  8. How to search in an entire directory for a word and replace it?
  9. How to display all the occurances of a word in a buffer (like the way it is done in Notepad++)
  10. How to remapping capslock key to Ctrl
  11. How to get a Tree view of directories as opposed to using dired for navigating project directories?

Open questions

Can we change Ctrl x to leader key in normal mode whilt using evil mode?

– Move this into a separate file – after finding out the answers to the questions

Answered

  1. How to move around splits in an emacs window? Ctrl w.

  2. How to move cursor to the next period (full stop sign)? Just use evil mode.

  3. How to create slides in Emacs and do a demonstration or make a presentation from it? org-slide package

  4. How to select a word and make it all capital case or all small case or camel case or some other case? Answer: Cap U, tilda, String inflection

  5. How to send notifications to phone or email from an Org agenda that was set-up in an Org document? Answer: You need to download an app called Orgzly and download the file into the file system in the phone and feed the document to the app. If there are further changes to the document, you need to download it again and upload it to the app again.

  6. How to reload files from the file system on the fly? I use terminal to lint the files and I want to see the changes reflected in emacs right away. Answer: I updated the config to do this.

  7. How to rewrite the configuration file in org mode? done

  8. How to read internet articles in plain text mode in emacs?

    This is a workflow that I find useful.

    Just use emacs eww and the command R to enable readable mode in eww. This works pretty well for reading articles on a computer.

    An alternative is to copy the contents of the article and paste them into a txt file in the computer.

    However, what if you want to read it in Kindle Paperwhite? Copy the link to the article. Open it in a browser. Follow the step mentioned above to create a file on the computer and copy the contents of the article into that file manually. After this is done, you can read it in the computer or you can send it to Kindle Paperwhite (you can convert it to epub using Calibre if you want). Kindle Paperwhite supports txt documents just fine.

TODO

https://protesilaos.com/codelog/2020-03-25-emacs-ripgrep-rg/

What am I trying to achieve by using Emacs :

  1. Set up REPL loops for programming. Haskell, Javascript, etc.
  2. Working in a project and look for files by name and also look at file directory structure. Achieved this using Projectile mode. This is also possible in Vim with fzf. So, this feature is not a deal breaker.
  3. Navigate in and out of method declarations. I haven’t figured out how to do this either in Vim or in Emacs.
  4. Search for and/or replace a word everywhere in the project. This is also possible to do in Vim.

All of these can be solved by using Visual Studio Code.

And achieve speed of typing the same way we do in Vim. Is evil mode an answer to these?

Can we achieve these using Emacs? The answer is yes. But is it going to be easier? Or, should I just continue using Vim key bindings with evil mode?

Vim key bindings are the best. Even in emacs, without Vim keybindings, it would be kind of hard to achieve that level of comfort with typing.

  1. make a change on multiple lines. e.g. change a word on 5 lines
  2. jump till a full stop (period). forwards and backwards.
  3. jump to the beginning of the paragraph.
  4. jump to a character in a line from the current cursor position.
  5. search for the occurance of a word in the entire project.
  6. insert something at the beginning/ending of the line for multiple lines.
  7. project directory exploration.
  8. do certain search/replace only in visually selected text.
  9. list all lines in a file where a given word occurs.
  10. developer workflow in Emacs.

List of helpful extensions: Avy

I have been using emacs for a few months now. Here is the list of things that I am enjoying using emacs:

  1. Org mode - definitely. Even if I don’t use anything else in emacs, I would install it just for org mode. A lot of my personal to do lists are now written using org mode.
  2. magit - It is good. But I don’t know if it is better than Vim fugitive or git terminal based commands. I am not sure if I would call it a deal breaker.

Tags

  1. emacs - auto completion
  2. emacs - buffers, tabs, splits, windows and frames
  3. emacs - comparing files
  4. emacs - configurations for reference
  5. emacs - deleting
  6. emacs - dired
  7. emacs - evaluating expressions
  8. emacs - file navigation
  9. emacs - functions
  10. emacs - help system
  11. emacs - installation and configuration
  12. emacs - lists
  13. emacs - macros
  14. emacs - mark and region
  15. emacs - modes
  16. emacs - movement within a file
  17. emacs - org agenda notes
  18. emacs - org mode notes
  19. emacs - exporting org documents to Word
  20. emacs - org-timer
  21. emacs - renaming files
  22. emacs - search and replace
  23. emacs - line numbers
  24. emacs - spelling
  25. emacs - tables
  26. emacs - terminal
  27. emacs - text manipulation
  28. emacs - the point
  29. emacs - eww
  30. emacs - working with lines
  31. emacs - system type
  32. emacs - environment variables
  33. emacs - Launching
  34. emacs - Change fonts
  35. emacs - Comments
  36. emacs - Inserting timestamps in files

TODO

https://www.emacswiki.org/emacs/EmacsNiftyTricks