Current Configuration (Github)
Currently, I use VS Code
for c#/backend development. This works well for the most part, but has a few issues that I would like to fix by pivoting to a new editor:
- Slow intellisense/autocomplete with VS Code + omnisharp. The hope is that emacs will provide a faster experience.
- Slowdown from the above slows the rest of my machine down, which is painful.
- Poor window/pane management. There is no easy keyboard shortcuts for creating/killing panes or windows
- Poor code navigation. VS Code does a bad job of tracking previous positions and has no native feature for storing bookmarks to jump between.
The goal is to learn emacs for developing c#. It can later be expanded to other languages, but the immediate focus is getting a specific workflow setup that can be used as my daily editor.
The goals of this are:
- Use emacs as primary editor for creating code modifications and reviewing code
- Make heavy use of keyboard shortcuts afforded by emacs to improve productivity with (1)
- Have a baseline configuration that can be modified to customize my experience as I continue to improve my emacs skills
Out of scope for initial learning, but might be focused on later:
- Using emacs for git management.
magit
looks very powerful - Using emacs org-mode for note taking.
- Debugging inside of emacs. Not currently supported for c#
- Running projects from inside emacs. Or running the command line via a shell inside emacs
Here is where each incremental progress will be outlined
Overall progress
Install emacsBasic file opening and navigationGet Vanilla Emacs config startedBasicxah-fly-keys
file controls- Basic buffer controls
- Project loading/navigation
- Basic
omnisharp
code navigation omnisharp
code refactoring/autocompletion- Emacs file and directory controls
- Emacs file and directory searching and modification
- (Final Step) Reach out to other emacs users for input on my configuration/setup
--
The initial hurdle was deciding on which flavor of emacs to use as a starting point. I initially decided on doom-emacs
as it bills itself as focusing on sane defaults and the ability to serve as a good foundation. It makes adding some features easier than vanilla emacs, which should hopefully speed up initial competency/usage of emacs. I may change to a different emacs flavor once I have the basics down and a better idea of how my setup will ultimately look.
After trying doom-emacs
for a short while, I went back to the drawing board and decided to use vanilla emacs. doom-emacs
was doing too many "black magic" things making it hard to debug when something went wrong. Initially, the idea of separate config files for organization sounded ideal, but using an org-mode config is proving to be easier as it is all in one place and I can easily document why I'm making the config changes I am.
I originally ran through basic navigation of files and buffers (using evil). I'm expanding the shortcuts section here and learning the basics. Fortunately, there are many somewhat "isolated" sections/features of evil/vi, which makes it easy to learn a small bit at a time. At this point, I am using emacs/evil to try some text editing, with somewhat frequent stops to look up how a certain feature works.
One concern I have is not using the best tools for the job as there are many ways to perform actions. My hope is that the final step of reviewing my techniques with others will allow me to improve any bad spots.
After getting up to speed on evil/vi, I ran into a few issues with it not quite being dvorak-friendly. I discovered an alternative more ergonomic-friendly library xah-fly-keys that natively supports dvorak and re-organizes the keys to put the more frequently used commands in more finger-friendly locations. As I do not have any previous vi "baggage" at this point, I'm pivoting to learn these controls as well.
With this change, came the difficulty in getting it working with doom-emacs
, as it is built around evil
. When trying to get them to play nice together, I realized I didn't understand anything that doom-emacs
was adding over vanilla emacs, and didn't like that. I have thus decided to go with vanilla emacs and build my config from there. This will be more work, but will allow me to add pieces as I learn them and ensure that I understand everything I'm changing.
To that end, I started an org file config.org
to contain all of my configuration changes (linked at top). It will be the only way I modify emacs to ensure I can have the same experience on other machines.
This section will keep track of the most used basic shortcuts to start using and reference back to for using emacs.
u
- insert modef8
- command mode- In Command Mode
h
,n
,c
,t
- left, right, up, downg
,r
- forward/back wordm
,v
- forward/back parena
- execute command;
- commentq
,j
,k
- cut, copy, pasteb
- isearchleft
,right
- search forward/back
d
,s
- beginning/end of line, paragraphspace
ctl h
- list leader key commandsy
- markspace d
/space b
- beginning/end of bufferf
- undoctl g
f
- redo- Selections
6
- select text block7
- select line8
- select current word9
- select between brackets/quotes
- File Actions
space c n
- new filespace t b
- close
- Buffers
3
- unsplit all buffers4
- split downspace 4
- split rightw
- change buffers