How to disable rainbow-delimiters for Spacemacs? - spacemacs

I've added dotspacemacs-excluded-packages '(rainbow-delimiters) at my .spacemacs file. (This is the only instance of the rainbow-delimiters at the whole file.) I've restarted Spacemacs and nothing happened. I still have the delimiters in a different color, which depends on my cursor position.

You can disable rainbow-delimiters-mode with
SPC t C d

Related

How to efficiently yank to system clipboard in WSL2 neovim?

I've installed win32yank through chocolatey and changed clipboard setting in init.vim:
set clipboard=unnamedplus
Everything works however I notice that copy and paste operations now have very slight but noticeable delay. Is there any alternative way to copy to system clipboard? (I'm using neovim in WSL2 Ubuntu)
Just remove clipboard option. It's harmful and useless.
What it essentially does, it prepends "quote-plus" to all yank/delete/put commands automatically. Instead of this, manually type "+ when you want to access system clipboard and don't when you don't.
I've expanded on Matt's feedback and put this in my vimrc:
let mapleader=" "
noremap <Leader>y "+y
noremap <Leader>p "+p
noremap <Leader>d "+d
Select a block of text, press and then either y/p/d for yanking, pasting and deleting lines into the system buffer. It automagically seems to work with win32yank.exe (which is in my PATH in WSL2).

Spacemacs: Search for file in multiple projects

I know I can use "SPC p f" to search for a file in the current project, which means git repository for me. Now, in my current project we have multiple git repos, and I'd like to search for files in all of them. Luckily, they all reside in the same directory (e.g. ~/projects/x/).
Is there a command in Spacemacs that lets me search for files in all the git repos under ~/projects/x?
I believe you can do it with SPC s f. When you activate it:
Prompts you to select a directory to search
Allow you to enter a search string, showing results in the HELM window
In general, SPC s shows all keybindings for general search, where f is for files.
I dug through the available helm commands again and found helm-projects-find-files, which does exactly what I want.
I put this in ~/.spacemacs into the function dotspacemacs/user-config:
(setq-default helm-locate-project-list (list "~/projects"))
(spacemacs/set-leader-keys "fm" 'helm-projects-find-files))
For searching in those files, you can use spacemacs/helm-project-smart-do-search-in-dir:
Put this somewhere in ~/.spacemacs:
(defun mine/search-in-projects ()
"Search in all my projects (i.e. what is checked out in ~/projects)"
(interactive)
(spacemacs/helm-project-smart-do-search-in-dir "~/projects"))
And this in ~/.spacemacs into the function dotspacemacs/user-config:
(spacemacs/set-leader-keys "sm" 'mine/search-in-projects)
(I used SPC-sm as key combination because the project name starts with an "m").
Oh, I just realized I can just put a marker that projectile respects (like a .projectile file) into my ~/projects/x directory. Now I can switch to the ~/projects/x project, and still am able to also narrow it to specific sub-projects by selecting e.g. ~/projects/x/p1/.
So all I needed to do was:
touch ~/projects/.projectile
Update: I realized that when doing this, I can't narrow down to a sub-project. So it's not really the best answer.
You can put this in your .spacemacs to bind SPC p f to search all projects.
(spacemacs/set-leader-keys "pf" 'helm-projectile-find-file-in-known-projects)

Spacemacs powerline separator change not working

I am trying to customize the powerline separator style for Spacemacs. I added the following code to my .spacemacs file, as section 11.1.5.5 of the docs say to do.
(setq powerline-default-separator 'bar)
However, nothing is changing in my UI. I tried reloading via SPC f e R and restarting Spacemacs. Am I doing something wrong?
If you're using the stable release (master branch), then you also need to add a call to (spaceline-compile) at the end of dotspacemacs/user-config.
This is fixed in the develop branch (Spacemacs calls (spaceline-compile) at the end of the loading process), so the fix should be included in the next major version (current version is 0.105.20).

Keyboard shortcut for going onelevel up in midnight commander [mc]

Is there a keyboard shortcut for going one level up in the directory tree in midnight commander (mc), which will save me from going all the up to the ..?
As shown below - say I'm in a directory that contains tonnes of stuff, and its painful to scroll all the way up. Its clickable, but nothing beats keyboard shortcuts!
If you go to Options->Panel-Options and tick the "Lynx-like motion" option you can use left-arrow to go to the parent directory and right-arrow to enter a directory.
Does Home, Enter count as a keyboard shortcut?
Short answer: No.
Longer answer: Ctrl + PageUp goes to the last diretory - not the parent, but this may be what you want in most cases.
(https://www.midnight-commander.org/ticket/2420)
Without changing the default setup Alt + Y and Alt + U go to previous and next directory in history, which may be enough on most cases (Alt + H to see the full history). If not, you always have Home, Enter.
Alt + Arrows are used to move between windows on byobu/tmux.
To add a custom shortcut (like Backspace) to your user config:
echo 'CdParentSmart = backspace' >> ~/.config/mc/mc.keymap # Globally in /etc/mc/mc.keymap
Here more related handy shortcuts.
In /etc/mc/mc.default.keymap find and uncomment CdParentSmart in [Panel] section. If it's not there, add it. And set a key you want. Behavoir similar to Total/Double Commander would be CdParentSmart = backspace. So it will backspace command line, if it's not empty. Or will level up from any place, if command line is empty.
The file should be edited when MC is not running, as it is resetting it to currently loaded settings on exit.

How do I navigate the MiniBufExplorer without going into the MiniBufExplorer window?

How do I navigate the MiniBufExplorer without going into the MiniBufExplorer window?
In lines 170-174 of minibufexpl.vim:
" To enable the optional mapping of <C-TAB> and <C-S-TAB> to a
" function that will bring up the next or previous buffer in the
" current window, you can put the following into your .vimrc:
"
" let g:miniBufExplMapCTabSwitchBufs = 1
I added that to my .vimrc, restarted a blank Vim, then did the following commands to bring up multiple buffers (and consequently, the MiniBufExplorer):
:e somefile
:e someotherfile
Now, with my cursor inside the file window (not the MiniBufExplorer window), I try CtrlTab and CtrlShiftTab to no effect. Something I missed?
I think this is most likely a conflict with snipMate, which I believe you have since you mention the tab mapping works in select mode. I tried to do it manually map <C-Tab> :bn<cr>,
and it did not work either. I now use map <C-P> :bp<cr> and map <C-N> :bn<cr> to navigate through buffers, and I suppose other mappings would work just as well as long as there is no conflict.
Minibuf explorer shortcuts (may require additional configuration):
[C-TAB] and [C-S-TAB] - move to next and prev buffers
Vim regular buffer shortcuts:
:bn and :bp - move to next and prev buffers
:b# - move to buffer of number #
:h :buffers - for additional help
Did you leave the " at the beginning of the let line? If so, it's commented out, and will not work. Otherwise, you may have a mapping conflict between plugins. The :map command will list current mappings.
It's easier to deal with mappings if you install headlights though.