Is there a guide to changing emacs colorscheme? - emacs

In the terminal when I try to use emacs the colors are not good, most of the times I can't properly see the text.
In vim I know I can change the colorscheme with :colo <colorscheme_name>
Is there something similar in emacs?
A tutorial on the proper steps to change the colors would be appreciated.

I'm not sure of tutorial, but off top of my head, what you probably will want to do is: M-x customize then navigate to the section called "Faces" - you'll get a bunch of settings related to the color scheme and other font-related settings.
But Emacs has tons of customizations related to how text is displayed. I'm using this http://www.nongnu.org/color-theme/ but you can find a lot of info here: http://emacswiki.org/emacs/ColorTheme (emacswiki is basically the resource to be consulted first when you have any Emacs-related problem).
Obviously, you can do that in your .emacs file by adding different settings, but I'd suggest to use what's generated by the changed settings first, see how it works and then add on top of that yourself (once you modify settings from the customization buffer, it will save the changes into .emacs file - you can then open it and see what exactly did it do).

M-x load-theme
then use arrows to select a theme.
Adding here for easy reference ( #deong shared this answer via comment under the accepted answer).

Related

How to set position of the lsp-ui-doc in spacemacs

I'm new to spacemacs and am having trouble with LSP as I'm also unfamiliar with the elisp language. I have a few things set up, but I can't for the life of me figure out how to set the position of the lsp-ui-doc to be under/above the cursor. I referenced the lsp-ui module on Github and it says that this can be configured, but I don't see any examples and I also don't know where I'd set it in my .spacemacs file.
Also, if anyone has any clues as to how I could have figured this out by myself, please let me know as well. I'd rather not have to resort to stack overflow to answer these questions if I can help it.
Any help would be greatly appreciated
For reference, the lsp-ui-doc shows up in the top right when the cursor is over some artifact:
Ok, so I was able to find the answer in the issues page on the github repo.
Short answer for this is to put '(lsp-ui-doc-position 'at-point) in the .spacemacs file under the heading (custom-set-variables. It should look something like this:
(custom-set-variables
'(lsp-ui-doc-position 'at-point)
Possible values for lsp-ui-doc-position are: top, bottom, at-point.
Take note of the warning here:
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
The appropriate way to do it is by following the instructions linked in this issue:
https://github.com/emacs-lsp/lsp-ui/issues/508
For anyone unfamiliar with the Customization option page, The buttons didn't work for me when I clicked them (though I'm certain there's a way to set this in emacs to work with clicks) but I had to put the cursor on the buttons I wanted to click and press enter. This brought up a context menu that allowed me to set the varables when I pressed enter on `Value Menu'.
"Clicking" (placing cursor and pressing enter) State allowed me to save it.

TODO Tool window in Emacs?

I'm looking for a functionality like:
the TODO tool window of IntelliJ IDEA (see https://www.jetbrains.com/help/idea/todo-example.html) or
the Tasks list of Eclipse (see https://dzone.com/articles/to-do-lists-with-eclipse-tasks-view).
And I'd like that window to be opened automatically (if not empty) when opening any file or, at least, to have a message in the echo area stating that there are some TODO/FIXME items in the file I'm currently opening.
So far, I did not find any matching package, only things (like fic-ext-mode) that would highlight TODO and FIXME in comments for common programming languages, but no more.
Is there something else, closer to what I'm looking for? I'm certainly not the first one looking for such a feature in our favorite editor ;-)
hl-todo has hl-todo-occur, which opens an occur buffer of all the keywords it's configured to highlight in the current buffer. You should be able to add it to a major mode hook like so:
(add-hook 'prog-mode-hook #'hl-todo-occur)
But this doesn't work. I think it's because hl-todo-mode is activated in prog-mode-hook, and it isn't ready yet. I don't have time to track this down right now.
If you use magit, I just saw a new package magit-todos. I haven't tried it, but it looks pretty nice.
Not aware of an existing module. It would be nice to have one. If you can write, use elisp and M-x Highlight-regexp and M-x occur and then write a hook to open occur window when you open a file. May be a macro will do for this too. You can do more with elisp, such as make occur window renamed as TODO-window and parse the entries to convert into org-mode table to sort entries while preserving the clicking etc.

How to achieve this in Emacs?

I saw the feature shown and described below in Sublime Text and was curious to know how does one achieve it in Emacs?
A brief description of the feature:
Have a condensed view of the entire code/text file currently opened and highlight the region, in the very same condensed view, which is currently being viewed. Clicking on any part of the condensed view would bring that part in focus.
Although I know, almost certainly, that I would rarely use this feature since it would be, in my view, a estate hog, considering the fact that I have even had my scroll-mode disabled, but still I am curious to know how it can be done in Emacs.
And yeah I went through(skimmed) Sublime's feature list to find the name of the feature, so that I could then try to find it for Emacs, but couldn't. Therefore, another question: What's this feature called?
Original source of the image above.
There is MiniMap package. From EmacsWiki:
Put minimap.el in your load path.
(require 'minimap)
Use M-x minimap-create in a buffer you’re currently editing.
Use M-x minimap-kill to kill the minimap.
Use M-x customize-groupRETminimap RET to adapt minimap to your needs.

Where can I get a "Light Table" theme for Emacs 24?

I really like the Light Table color scheme but despite lots of Googling I can't seem to find an Emacs theme. I've made an attempt to recreate it but surely someone else has done this already.
It's a dark theme that looks like:
There's a load more example images on the Kickstarter page.
I made a theme based on the LightTable color scheme, I've just released it as a gist.
https://gist.github.com/3027622
FYI I'm publishing several new themes for Emacs24. There's a couple of other dark themes at https://emacsfodder.github.io/
Update
Here's a view of the font-lock (i.e. language generics, which are used by major modes to provide syntax highlighting.) definition with rainbow-mode.
Note:
In Emacs Lisp mode (CommonLisp & EmacsLisp are the closest things I know to Clojure.)
We can see that even local function usage isn't added to syntax highlighting:
(Having done a small check with clojure-mode, I can see the same thing going on there, defn's show their function name highlighted, but usage is in the default face color.)
For completeness it's probably worth adding this new answer here. There is now a LightTable theme for Emacs. It's called Noctilux:
https://github.com/stafu/noctilux-theme
Lighttable theme for Doom Emacs

Icons in dired mode for Emacs

I would like to use the dired mode of emacs as my file browser. I am very much addicted to see an icon for file/folder rather that to see the extension and color. The icons give me a very quick visual feedback. I have searched the web for display of icons in dired but found none. So I wonder whether it is even possible to do this and if yes how?
To put my question clearly
How can I display icons for files and folders in dired mode of Emacs?
all-the-icons-dired is a more current solution. Another option that looks quite nice is to use treemacs-icons-dired
I just switched to treemacs-icons-dired and recommend it. Simply install the package and add a mode hook like:
(add-hook 'dired-mode-hook 'treemacs-icons-dired-mode)
If you are using Windows, you can try dired-dispicon.el.
Get the relevant files from here.
See http://wiki.gohome.org/teranisi/?EmacsOnWindows for what it looks like. Note that you will probably need a version of emacs that supports images (e.g. for Windows you could try EmacsW32).
Use the dired-icon extension, which works for GTK (on Linux).
Disclaimer: I'm the author of the extension.