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

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.

Related

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.

Emacs: region isn't highlighted when selected with keyboard

When I select a region by clicking and dragging a mouse across the text, the selection shows up highlighted, as expected. However, when I do the same by hitting M-<space> to set the mark, then moving the point with the arrow keys, the region doesn't show up highlighted. I can yank it, but I can't call things like replace-string on it, suggesting that the region is not active.
This guy seems to have encountered a similar problem in emacs 22 (I'm using 23), and his fix was to call M-x transient-mark-mode to enable that mode. Unfortunately, I already have (custom-set-variables '(transient-mark-mode t)) in my .emacs file. Indeed, when I run M-x transient-mark-mode, I get the message "transient-mark-mode disabled", suggesting that it had been enabled before.
Any suggestions as to what might be going on, or things I could try to shed more light on the situation, would be greatly appreciated.
Bisect your init file (~/.emacs) until you find the culprit code. You just need to make sure transient-mark-mode is turned on only once. You can also just put (setq transient-mark-mode t) at the end of your init file. Unless actions you take interactively cause some other library to be loaded that changes the value of that variable, that should ensure that the mode is on.
The first thing to try, however, is just M-x transient-mark-mode, to be sure that the mode actually works for you. If not, again, bisect your init file to find out what breaks it.

Any way to prevent emacs key bindings to bug in Eclipse?

I'm wondering if I'm the only one struggling (i.e. failing) to keep the emacs key bindings working in Eclipse.
I set them. It works fine. The it stops working fine. Some keys still work, others don't. I find myself in a kind of weird quantum state of uncertain key-binding setup superposition. Some key bindings from the standard set work, some from the emacs set work, some things I can achieve with neither set of bindings.
I'm the only one to experience this? I've seen this on at least 4 computers in the past few months.
I set key bindings back to standard set. Sometimes it works. I use the reset to defaults button. Try to set it back to emacs. Doesn't work. Pressing the apply button between the different steps or not... Drives me crazy.
On some computers, the bindings are just whatever. Can only save using the mouse, C-d and C-k don't work to delete/cut lines, most emacs keys still work but back to C-space for auto-completion, etc.
Anyone knows what can cause this? How to prevent it? Am I pressing some key binding key-bindings by mistake?
I had a similar problem with the Ctl-K, Ctl-D commands: after doing an upgrade (I forget whether it was Eclipse itself or the Android plugin) I saw Eclipse offering a little pop up menu on both these keys, offering to do either the correct Emacs command or some completely unrelated command. So, for example, Ctl-D offered to either delete the next character (correct) or delete the line (incorrect).
After some poking around in the key bindings (Windows>Preferences>General>Keys), I discovered that sure enough, someons in the Eclipse project supplied these wrong bindings in addition to the correct ones. So I deleted the incorrect bindings and left the correct ones.
So I thought I would be out of the woods at this point. But I also discovered that I had to add the correct binding back in a couple of times before it would stick.
Look for Cut to End of Line under the Command column and make sure it has Ctl-K when Editing Text and in the Text Editing Category. The same for Delete Next (which means next character). But make sure Ctl-D does NOT show up for the Delete Line Command.
Test it out in an editor window; if it fails, go edit the bindings again, test again, repeat until it sticks, making sure you click Apply after editing the bindings.

Is there a guide to changing emacs colorscheme?

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).

How to scroll down on pages in doc-view mode in Emacs?

I have recently started using doc-view in Emacs, but I am having quite a few problems with it. The main one is that I can't scroll down on pages. I can see the next or previous page using "n" or "p", but the commands to scroll up and down a page, which are supposedly SPACE and DEL, do not work. Well, to be fair, DEL works, but it goes to the previous page rather than scroll up to the bottom of the previous page. The result is that I can only see the top of the pdf pages, but not the bottom parts.
I tried changing the view to continuous, but that doesn't work either. This is what I tried changing:
I did check the customisations for doc-view, but the variables (or options, or whatever they are called) did not appear to me to be the ones which would solve my problem.
More information: I did manage to make SPACE and DEL work at some point, but I don't remember what I did, and I can't get it to work again. I am using Aquamacs.
Any ideas?
By the way, another problem I have is that doc-view causes Aquamacs to sort of crash, meaning it freezes everything, keeps "thinking", and I have to force quit Aquamacs to get it to work again. While this is not my main question, if anyone can tell me anything about this I would also appreciate.
Thanks!
EDIT: I tried what the answer below suggested, it didn't work, kept trying other things/commands, and then C-n and SPACE started working! I quit Aquamacs, started it again, opened a pdf document, and it is back to not working. Can someone please explain what is happening? How can I make this reliable?
(setq doc-view-continuous t)
This lets you scroll the whole document with mouse wheel(not just the current page).
To commands to scroll down are bind to:
C-n, down
not SPC
UPDATE:
SPC is rebound in docview mode. Can't reproduce you issue using GNU Emacs/Linux, can you invoke:
M-x doc-view-scroll-down-or-previous-page