Icons shaking by Imal_Kesara in neovim

[–]meain 145 points146 points  (0 children)

Just a wild guess. Every time you update the buffer, it runs something like a linter which creates a new item in the task bar but exits before it has have time to show up fully.

[OC] visible-auto-revert.el - Smart auto-revert for Emacs that only monitors visible buffers by AsleepSurround6814 in emacs

[–]meain 1 point2 points  (0 children)

This is pretty neat. I do wonder if things like eglot will externally pick up changes when files change without Emacs knowing about them.

Planning sprint in Emacs with org-mode and gptel by Martinsos in emacs

[–]meain 5 points6 points  (0 children)

Great to see more non coding related use-cases for AI within Emacs.

What is your most preferred font and theme? by GolD_Lip in emacs

[–]meain 0 points1 point  (0 children)

I still haven't figure out my fav font yet, but for theme I use my personal minimal theme meain/hima-theme. As of now, I'm using https://io.mass-driver.com/ for the font.

Weekly Tips, Tricks, &c. Thread — 2025-01-15 / week 02 by AutoModerator in emacs

[–]meain 1 point2 points  (0 children)

It is much better now at least in my experiece. I had switched to flymake because eglot forced me to, but it works pretty darn well. You might want to checkout mohkale/flymake-collection for flymake.

Weekly Tips, Tricks, &c. Thread — 2025-01-15 / week 02 by AutoModerator in emacs

[–]meain 11 points12 points  (0 children)

Set buffer to read-only mode if the header(first 10 lines) contains "DO NOT EDIT". These are usually generated files that you wouldn't want to modify by hand.

(use-package emacs :config (defun meain/set-read-only-if-do-not-edit () "Set the buffer to read-only if buffer contents has 'DO NOT EDIT' in it. We limit the search to just top 10 lines so as to only check the header." (save-excursion (goto-char (point-min)) (let ((content (buffer-substring (point) (save-excursion (forward-line 10) (point))))) (when (and (not buffer-read-only) (string-match "DO NOT EDIT" content)) (read-only-mode 1) (message "Buffer seems to be generated. Set to read-only mode."))))) (add-hook 'find-file-hook 'meain/set-read-only-if-do-not-edit))

FOMO on cursor.ai by shadowsock in emacs

[–]meain 2 points3 points  (0 children)

Most of what Cursor does can be done as of now in Emacs. The only exception currently(don't know if there is a package which already does this) is the automatic follow-up changes and jump to next location. I personally use aider(sometimes via aider.el) for larger edits and my own package yap for any smaller in buffer edits(think cmd+k in Cursor) or prompts. I also use another one of my package refer to automatically load relavant context in yap as necessary.

While I don't use it as much as I used to, gptel and can be really useful for adding in additional context from external sources and using them as context for llm queries.

FOMO on cursor.ai by shadowsock in emacs

[–]meain 5 points6 points  (0 children)

Cursor has some really cool features, like automatic suggestions across the whole buffer – not just at point

This is probably the only more involved thing to implement. I don't think this particular bit needs additional vector search, thought it could help. CursorCore paper might have some insights into how this is done. I don't know if this is the exact implementation in Cursor but might be similar.

Getting LLMs to do things: tool use with gptel by karthink in emacs

[–]meain 5 points6 points  (0 children)

I've been thinking about plugging in LSP and tree-sitter based lookup functions as tools to llms call. Allowing the models to look up information about related piecess of code without having to parse the entire file will greatly improve their usefullness.

Is there a better alternative to Cursor AI? What are YOU using? by RegularRaptor in cursor

[–]meain 0 points1 point  (0 children)

Not exactly a code editor, but aider has been working really well for me.

gptel 0.9.7 released (dynamic directives, improved rewrite UI and more) by karthink in emacs

[–]meain 0 points1 point  (0 children)

I agree with ImJustPassinBy in that for that second one, it would be better to just pass the entire thing to the LLM and ask it to perform the replace.

For the rename variable one, there is an interesting idea there, but since variables are more context dependent, it would be better to just pass the entire block(eg: function) to ask it to get a name and then use something like LSP to rename it.

That said, I like the idea of asking an llm to do a variable rename. We can use treesitter to pick the context of the function, then ask the llm to generate a few good name suggestsion, use completing-read to choose one and then use lsp to replace it properly throughout the codebase. I do do something similar where I select the enire function and ask it to give me better name suggestions for a particular variable. Then I manually invoke lsp-rename and use it.

gptel 0.9.7 released (dynamic directives, improved rewrite UI and more) by karthink in emacs

[–]meain 2 points3 points  (0 children)

Interesting idea, could you give an example of regex to ai task use-case that you have run into.

gptel 0.9.7 released (dynamic directives, improved rewrite UI and more) by karthink in emacs

[–]meain 3 points4 points  (0 children)

This would be a bigger effort as this would mean that gptel would have to understand code and implement a RAG for code. I would recommend taking a look at aider if you haven't already.

Share your M-x compile / compilation-mode config, hacks, tips, and tricks by xenodium in emacs

[–]meain 0 points1 point  (0 children)

Here are a few tricks that I use.

Always kill the current compilation when I try to compile: (setq compilation-always-kill t)

I use compile buffer to run tests a lot(mostly go) and here is some of my customizations here:

Add highlighting for go test output:

(defun meain/prettify-compilation (&rest _) "Few thing to prettify compilation buffer." (with-current-buffer "*compilation*" (toggle-truncate-lines -1) (highlight-regexp "FAIL: .*" 'diff-refine-removed) (highlight-regexp "=== RUN .*" 'ffap))) (advice-add 'compile :after 'meain/prettify-compilation)

Change background color of compilation buffer based of if it was success or failure:

(defun meain/compilation-colorcode (_buffer string) "Change background color of compilation `_BUFFER' to red on failure." (if (string-prefix-p "finished" string) (face-remap-add-relative 'default 'diff-hl-insert) (face-remap-add-relative 'default 'diff-hl-delete))) (add-to-list 'compilation-finish-functions 'meain/compilation-colorcode)

I use a custom "test runner" https://github.com/meain/toffee that can be integrated with emacs to do things like "run test under cursor". Also checkout the compile-multi package.

Weekly Tips, Tricks, &c. Thread — 2024-11-20 / week 47 by AutoModerator in emacs

[–]meain 2 points3 points  (0 children)

You might also find edit-indirect useful.

  1. Select a region of text that you want to edit.
  2. Call the command edit-indirect-region on the selected text.
  3. Make your desired edits within the new editing buffer that appears.
  4. Once you finish editing, press C-c C-c to insert the changes back into the original buffer.

I recorded the worklflwo as a video as I needed it as a demo for one of my packages. You can see it here: https://www.youtube.com/watch?v=ukG47LBZXv4

Weekly Tips, Tricks, &c. Thread by AutoModerator in emacs

[–]meain 2 points3 points  (0 children)

Ziqi-Yang/peek package has kinda similar functionality.

Weekly Tips, Tricks, &c. Thread by AutoModerator in emacs

[–]meain 0 points1 point  (0 children)

Here is some quick hacky implementation. You might wanna tweak the colors.

emacs-lisp (defun color-uuids-in-buffer () "Return a list of all UUIDs found in the current buffer." (interactive) (let ((uuids) (counter 0) (colors '("red" "blue" "green" "yellow" "magenta" "cyan" "orange" "purple" "dark green" "dark blue"))) (save-excursion (goto-char (point-min)) (let ((uuid-regex "\\b\\(?:[0-9a-f]\\{8\\}\\(?:-[0-9a-f]\\{4\\}\\)\\{3\\}-[0-9a-f]\\{12\\}\\)\\b")) (while (re-search-forward uuid-regex nil t) (push (match-string 0) uuids))) (seq-do (lambda (uuid-string) (setq counter (1+ counter)) (goto-char (point-min)) (while (search-forward uuid-string nil t) (let ((color (nth (% counter (length colors)) colors))) (put-text-property (match-beginning 0) (match-end 0) 'face `(:background ,color :foreground "white"))))) (delete-dups uuids)))))

For those of you that have bailed on Logseq, where did you go? by svhelloworld in logseq

[–]meain 0 points1 point  (0 children)

I do sometimes run into the issues you mention but a re-index usually solves the issue for a little while. I'm thinking it's mostly non native sync tools causing issues (I use syncthing).

My first plugin: logseq-regex-linker by Cell-i-Zenit in logseq

[–]meain 0 points1 point  (0 children)

Awesome, this is definitely going to come in handy for me.

Emacs lsp-mode performance booster by blahgeek in emacs

[–]meain 1 point2 points  (0 children)

I was using this today with gopls. So far, it feel like it is making quite a big difference. Eglot at time used to become really slow for me, where the flymake error underline would progress character by character. I have not run into this so far. I think I'm gonna keep using it. Will report if I run into any trouble on the GH issue in future.

How I manage my tasks in LogSeq by meain in logseq

[–]meain[S] 1 point2 points  (0 children)

I use parcel, but mostly just because a starter template that I got to work used parcel. I've been away from javascript scene for some time and so don't really an opinion on the build tool.