Skip to content
osklundsPublic

About

Dotfiles I use

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

dotfiles

dotfiles I use

Emacs todos

Housekeeping

  • Switch to lexical binding
  • Use #' instead of ' for fucntion

More important

  • emacs in dired/vterm is very slow to open minibuffer when the directory is on a slow location.
  • Remove hydra dependency from vidff. It breaks native compilation of some of my files, including ol-magit and merge-survival-knife

Less important

  • For tiny-lsp-client remap to proper root for rust library files
  • For tiny-lsp-client, and e.g. rust, support snippets like for erlang-language-platform.
  • Change to emacs built-in search and search-and-replace
  • Lower memory usage. Garbage collection is slow for me. Even if my config doesn’t generate more garbage than more lightweight configs, because so much memory is used, it takes time to find the garbage. My guess at least. BIG
    • One suggestion was to decrease shell term size.
  • More than one help window, and don’t make them disappear so quickly
  • Undo each step in search-and-replace, i.e. migrate to emacs’ query-replace
  • rg options, e.g. ignore gitignore, only certain file types, fold on file, etc
  • Make relative line numebrs correct in vdiff
  • More colorful dired, like ll
  • vim mark, but name them, cycle through with ivy
  • when new buffer, ALWAYS switch to it for consistent behavior
  • consider change ctrl to meta
  • make vdiff auto sync at start work
  • make vdiff sync as scroll always be able to scroll
  • add vim mark to bookmarks
  • highlights in sync grep
  • center buffer on compile-goto-error
  • org-mode
    • SPC m s, should preserve order
    • spell in completion
    • dd inside list with line breaks delete from the line below
    • Implement centering yourself, like David Wilson did
  • corfu
    • sepator like space for wildcard matching
  • In find-file, nothing is shown for slow dirs, like webdav or some tramps. At least for tramp, would be good to indicate “loading”.
  • eldoc flickers when typing
  • delete in switch-to-buffer is sometimes buggy, e.g. when deleting 1 out of 2 matches
  • In find-file when input is ~ can’t delete ~
  • Slow to open icomplete for .tar.gz files
  • Scroll when async output changes, things get messed up
  • Sometimes annoying save prompt when checking out files etc. Maybe related to auto save timer
  • transient or similar for ripgrep
  • evil bug with e.g. d2k and visual lines
  • search and highlight several search hits at the same time
  • Make emacs start up faster.
  • Inside docker container, simplify host paths and paths to repos etc. Also, dH to host home

Not important at all

  • lsp diagnostics
  • alt-ret for continuing list also outside org-mode
  • cache modeline segments, like doom modeline

Wanted, but hard to do

  • center inline images in sliced org mode (maybe possible, but requires lots of work)
  • Box around the cursorline, like VSCode
  • org-mode
    • Slightly bigger bullets
    • Line numbers
  • Sliced images in org without inserting dummy lins, and vdiff overlays that can be partially hidden at top
    • Maybe can insert a “newline” overlay between each char in image link in org as hack/workaround?

Hard-to-reproduce bugs

  • Sometimes sync grep doesn’t manage to go to result
  • Corfu is laggy when typing the the LSP server is slow
  • Sometimes emacs freezes, feels corfu and/or auto save timer related
  • In org-mode the corfu popup is sometimes incorrectly located
  • Sometimes in org-mode, scroll-up stops working. When scrolling suddenly jumps back a long distance.
    • Is related to variable-pitch-mode. Toggling it fixes the issue. Reverting the buffer doesn’t fix the issue. Copying the file, and the issue doesn’t appear in the copy. Try mixed-pitch-mode just to try somehting.

Upgrade preparation

To make upgrades of emacs as easy as possible, I want to rely on as few packages as possible, and those I rely on should preferably have a large community and be maintained, so that no backwards compatibility issues appear

To make upgrades of packages as easy as possible, I want to customize the config of packages as little as possible, especially advising on internal functions.

Also, I want to customize emacs built-in packages in hacky ways as little as possible.

Packages

Big and critical

evil
corfu (+ cape)
magit (+ with-editor, cond-let, llma)
vterm

The above are big and impossible to replace on my own. Fortunetly, they have a big community.

Small and non-critical

evil-nerd-commenter
goto-chg

These are smaller. If they break, not as critical. Can e.g. do a poor-man reimplementation.

Small and critical

vdiff
vdiff-magit

These are critical, but if needed, I can tweak them myself if they break. In fact, I have already done that for vdiff-magit.

Own

tiny-lsp-client (+ merge-commit-analyzer)
merge-survival-knife

tiny-lsp-client and merge-survival-knife are critical, but maintainable.

libvterm offline install

Inside the libvterm-mirror submodule, checkout the commit specified by CMakeLists.txt inside the emacs-libvterm submodule. Inside CMakeLists.txt change the git stuff to point to the local submodule. After that, run as usual.

Docker development environment

I have (or is in the process of) containerized my development environment.

Host setup

I want to keep the required host setup as small as possible. What you need to do on the host:

  • Install rootless Docker (and docker-compose)
  • Clone this repo
  • Make sure the paths in volumes: in docker/docker-compose.yaml are available
  • Symlink .bashrc
  • Run dev_env_start and dev_env_attach respectively.

Notes

The symlinks done in Dockerfile happen to be the ones you need to create to “install” this repo also on a normal host. The directories in docker-compose.yaml happen to be the ones you need to have available also on a normal host for this repo to function properly. What a pleasent side-effect. These two docker files document the dependencies of this repo. Note, when running the containerized variant, only things in docker-compose.yaml needs to be taken care of.

The user inside the container is root, because in rootless docker, it means the user on the host becomes the user you are.

“Merge Survival Knife”

Principles

This tool sets up five different views of the merge conflict according to the figure below.

         LOCAL
        /  |  \
       /   |   \
      /    |    \
     /     |     \
    /      |      \
BASE       |       MERGED
    \      |      /
     \     |     /
      \    |    /
       \   |   /
        \  |  /
         REMOTE

LOCAL is the version in the target branch, “your changes”. REMOTE is the version in the branch you’re merging in, “others’ changes”. BASE is the merge base between LOCAL and REMOTE. MERGED is the merged result.

I use the different diffs the following way:

  • BASE <-> LOCAL for understanding what changes I have made since the merge base.
  • BASE <-> REMOTE for understanding what changes other people have made since the merge base.
  • LOCAL <-> REMOTE if LOCAL and REMOTE have made very similar changes, I use this to understand the difference between them. Useful if you have manually copy-pasted code from the branch to merge from, but also made a few changes on your own.
  • REMOTE <-> MERGED for understanding what changes I will “apply” to the branch I’m merging from, if I were to merge my changes to it. For example, if I create a branch based on the main branch, I do a few changes, and main does a few changes, then this diff shows what I would apply to main if I merge to main.
  • LOCAL <-> MERGED for understanding what changes remote will “apply” to my branch after I merge.

BASE <-> LOCAL shows your intention. So that diff should look very similar to REMOTE <-> MERGED if you have correctly preserved your intentions after the merge.

Similiarly, BASE <-> REMOTE shows others’ intentions, so it should look the same as LOCAL <-> MERGED.

In other words, I use

  • BASE <-> LOCAL
  • BASE <-> REMOTE
  • LOCAL <-> REMOTE

for understanding the conflict, and

  • REMOTE <-> MERGED
  • LOCAL <-> MERGED

for reviewing my resolution of the conflict.

How to use it

The tool is based on vdiff.

My keyCommandDescription
SPC g mmsk-mode-enableStart solving the merge conflict the cursor is in
C-c qmsk-mode-disableSave your resolution of the merge conflict
M-1msk-base-localChange diff view to BASE-LOCAL
M-2msk-base-remoteChange diff view to BASE-REMOTE
M-3msk-local-remoteChange diff view to LOCAL-REMOTE
M-4msk-local-mergedChange diff view to LOCAL-MERGED
M-5msk-remote-mergedChange diff view to REMOTE-MERGED

About

Dotfiles I use

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages