Similar Neovim mappings--one works, one does not work - neovim

Context
Creating remappings to exit TERMINAL mode and enter NORMAL mode within neovim (ie. <C-\><C-N>).
I'm getting no-op behavior (ie. terminal stays in TERMINAL mode and simply ouputs , -- mapleader) when creating a new mapping as follows (in init.lua):
keymap.set("t", "<leader><Esc>", "<C-\\><C-N>")
Shell is zsh and I've set bindkey -v in .zshrc. Terminal application is iterm2.
When I set the following mapping:
keymap.set("t", "<leader>nn", "<C-\\><C-N>")
The expected behavior happens (ie. terminal exits TERMINAL mode and enter NORMAL mode).
Not sure how/where the first mapping is getting interrupted to not exit TERMINAL mode.
Question
Why is the first mentioned mapping not working, which the second mentioned mapping is working?
Effort
Looked on other posts and they all indicate there should be no problem with the first mapping.

Related

Weird CMD - VSCode behavior

yesterday I had SumatraPDF and VisualStudioCode with latex-workshop working with forward and reverse-search. Today the reverse-search didn't work any more. With a simple bat file I tried to show the commandline arguments.
echo %*
pause
They seemed correct and when I copied the command and paste it into a new cmd it works. To do further testing I tried to direct command and run it.
"C:\....\Code.exe" -g "%1:%2"
pause
Visual Studio Code responds: bad option -g
In SumatraPDF I set cmd as command.
Now the behavior is that I have two cmd windows. With the cmd directly opened the VSC open's the file. With the cmd launched indirect I got the error message.
I have tried resetting the environment variables, changing the current working directory, and checking the code page currently in use.
How can it be that cmd behaves differently with seemingly the same environment? And what can I do to make a cmd started from an application work like a cmd started by windows?
Update: It appears there were a couple of recent security changes in the way VSCODE.exe is allowed to interact with the command line (especially affecting LaTeX-workshop users) so for recent changes twice this year see the discussion at https://forum.sumatrapdfreader.org/t/inverse-search-not-performed-for-vs-code-exe/4486/27
Within SumatraPDF the reverse syntex command for %1 is replaced by %f for file and (l)L for line
It is triggered by a double click near the line of interest and if the synctex index file was compiled correctly by PdfLaTeX (or similar) it will include the tex %f(ilename) and the nearest %l(ine) reference to the point where double clicked.
Thus your tex syctex enhanced "reverse search" call out of SumatraPDF should historically be
"C:\...path to...\Code.exe" -g "%f:%l"
that's Lower L not 1
Avoid using any depreciated -inverse-search parameter from a LaTeX editor just add it once into SumatraPDF-settings.txt and then it's not disturbed by repeated assignments when running your -forward-search.
It will NOT work if the file.synctex or file.synctex.gz is corrupt by a bad PDF compilation.
HOWEVER It seem Microsoft have added the requirement to add a CLI.js handler and requires another switch setting after that ! (see link to discussion in Update above)
For a small test file download https://github.com/GitHubRulesOK/MyNotes/raw/master/AppNotes/SumatraPDF/LATeX%20and%20Reverse-Search.zip unpack and open sync.pdf in SumatraPDF to test that double click on page opens sync.tex in the editor
If the message is cannot start ... then the command line is not configured correctly. A rough test for a bad synctex is to see what happens if the call is changed by adding cmd /k echo to the start, since that will confirm the reverse command. Here I wrote "wrong" as the path to code.exe, once corrected I can remove cmd /k echo.
For some other systems where the reverse might change
see https://github.com/sumatrapdfreader/sumatrapdf/issues/1197#
However there should be no interference in a valid VsCode call.

How to exit gitbash after running Mongod?

I am following some tutorials on how to work with Mongodb but they don't explain how to close the CLI. I usually just use "exit" but after running mongod it now does nothing, and if I try to leave by just closing the window I get a message saying "processes running in session".
I get the same problem with the other gitbash window after running npm run dev (I think the "dev" part is just specific to what I do now?).
Normally you can press 'ctrl' + 'c' on your keyboard and it should stop the process running on your command line tool.
Have a look here thing might be more MongoDB specific help
https://stackoverflow.com/a/11776728/4389143
The command to save a file in Vim and quit the editor is :wq . To save the file and exit the editor simultaneously, press Esc to switch to normal mode, type :wq and hit Enter .
Check this.

What causes the fish shell to change input while typing?

I understand, that when I start typing that fish can give me either auto-suggestions or tab completion.
But: I also noticed that sometimes I get updates to my command line while typing. Example: I have a command a lengthy command line to enable some tooling of mine, lets say it looks like:
python3 whatever.py -bla -blub --property fubber:blub
I start typing "py2" and fish suggests
python3 whatever.py -bla -blub --property fubber:blub
OK. So I use alt-left arrow to accept up to
python3 whatever.py -bla -blub
and now I start typing --property ( not accepting, typing that word ). Thing is: as soon as typed the last char (y) from property fish will somehow insert content into command line. Worse: it also happens frequently, that the whole isn't showing correctly any more in my iterm session - I actually have no way of seeing the exact current command before hitting enter.
I know that the above isn't exactly an MCVE - but I can't disclose my actual command here, and I was unable to create that MCVE. In that sense, my question boils down to: which events make the fish shell insert content into the "current" command?
For completness:
I am running fish, version 2.7 on Mac Os 10.13.3, installed via brew
default bindings
I am sure that just pressed "y", no modifier key added to that
But I am also unable to repro at this point in time. So, although I am very sure that I didn't dream this up, I consider this to be a strange hick-up for the moment that hopefully stopped bugging me for now.

Send tmux command to tmuxinator

Specifically, I need to create a profile that by default will have a small pain displaying the clock, which can be triggered with C-b t. However, I couldn't find the way to do that.
In this GitHub issue comment, a Collaborator of the project said it could be defined like a regular command, but on my ZSH setup, it just didn't work, saying "zsh: Command not found: C-b".
Does anyone happen to know how I can achieve this?
Thanks!!!
windows:
- work:
panes:
- tmux clock-mode
- ipython
Below is what happens when typing tmux clock-mode inside tmux session:
current tmux client connect to tmux server
attach to current(or the most recently) session
since the -t argument is omitted, the currently active pane in the current window is used for the clock-mode command.
Checkout the session in $man tmux for more detail.
COMMANDS
This section contains a list of the commands supported by tmux. Most commands accept the optional -t argument with one of target-client, target-session
target-window, or target-pane. These specify the client, session, window or pane which a command should affect. target-client is the name of the pty(7)
file to which the client is connected, for example either of /dev/ttyp1 or ttyp1 for the client attached to /dev/ttyp1. If no client is specified, the
current client is chosen, if possible, or an error is reported. Clients may be listed with the list-clients command.

emacs CUA-mode OK in X but not working console

I have been struggling to get emacs CUA-mode working in the console where it works fine in X (in an xterm using emacs -nw).
The main features I want are shift-movement selection and ^C,^V,^X but any more would be helpful. So far I am using a local keyboard and monitor but ultimate goal is to get all this working over ssh using something like putty.
So far I have been working on getting my terminal to output the same control sequences that emacs expects to see for shift-movement (specifically S-<down> or <S-down>) and this works in the console when shift-select-mode is set in .emacs. So far so good, so I can shift select text from any emacs invocation type: X-windows, terminal ($TERM=linux or $TERM=xterm). This site has been very useful.
Shift-<down> displays as follows using cat -v and emacs happily maps <S-down> to this control sequence.
cat -v (then type shift-down)
^[O2B
Here's the problem, switch on cua-mode and the shift-selection stops working but ^C,^V and ^X starts working !? So I can either have shift-selection or ^C,^V,^X but not both at the same time.
-------
Setup:
emacs 23
Raspberry Pi
Raspian (similar to Debian)
You might like to try a more recent version of Emacs, since cua-mode has been slowly changed to use the same code as shift-select-mode. In Emacs-24.4, cua-mode actually uses shift-select-mode directly.