I'd like to know how to close nano under a term using /bin/bash, all under the context of in emacs -nw. A plain ^X doesn't work.
I tried entering the character mode using C-c C-k, but that didn't seem to help. Is there another "just send this along" command for a key binding?
Short answer: Esc Esc X will be interpreted by nano in the same manner as C-x.
Background: A [sometimes-]handy nano tip: press Esc twice followed by the desired key to send the equivalent Ctrl- command.
Related
I'm trying to remap Ctrl-C to Esc, or <C-c> to <Plug>(PearTreeFinishExpansion) in neovim but I can't seem to be able to do it. If I do either of these following commands in nvim they work:
:map <C-c> <Esc>
or
:map <C-c> <Plug>(PearTreeFinishExpansion)
But if I try to put them in my init.lua file in either vim.cmd[[imap <C-c> <Esc>]] or through the vim.api.nvim_set_keymap, they don't work.
Where do I need to define this remap to make it work? Cheers <3
I'm running on Linux. I have the issue both in bash and pwsh shells.
How do I clear the current command prompt in the VS Code terminal?
For example, say you have copied and pasted a very long string into the terminal.
How do you clear what you just pasted?
The only way I know of for getting back to a an empty command prompt involves hitting backspace until you have deleted every character.
Is there any short cut for getting back to an empty prompt?
Thanks!
How do you clear what you just pasted?
There is no command to clear what you have already pasted. You can do Ctrl + C or Ctrl+D to get the next promt.
Now if you want a short-cut to clear command which we use in terminal, its Cmd + k for Mac OS
CTRL + shift + p, then write clear. You can use the clear command in bash terminal too.
Use Console.Clear() in code.
or use 'cls' cmd on console
In the Spacemacs Documentation, creating the .spacemacs dotfile is accomplished with the following command:
<SPC> : dotspacemacs/install RET
I parse this as being the following string (note the preceding space):
: dotspacemacs/install
followed by me hitting the enter key.
When I open up emacs and type the first space, nothing appears to happen and my computer makes a sound I typically hear with invalid input. I have also tried the following:
: dotspacemacs/install (no preceding space). This gives me Unknown command: dotspacemacs/install
M-x (on my keyboard alt x) followed by both of the previously mentioned commands. These both result in [no match]
Where am I going wrong?
did you see the spacemacs buffer after you started emacs?
make sure you install the spacemacs correctly or you can copy that file manually :
cp ~/.emacs.d/core/templates/.spacemacs.template ~/.spacemacs
close emacs and reopen to see if works
SPC f e d
does create / open it after a fresh install.
Occasionally when using emacs in term mode I will mistakenly run emacs file instead of just opening the file. This will create a nested emacs client inside the current client. My problem is how to close the inner client only?
Answer
You should be able to C-z out of it, then kill it with
kill %1
Explanation
C-z will suspend the current process, assigning it a job number and returning you to the shell.
The jobs command will show you the current jobs and their numbers. kill allows you to kill a process by its job number using the %n syntax.
Just use the command M-x kill-emacs inside the inner emacs. Backgrounding and killing it works fine but it is a little bit more hackish.
You should use the top Emacs. Starts emacs with:
emacs --daemon
Starts all frame with:
emacsclient -c
From your term:
emacsclient -n
Or you should use eshell instead.
How do I consistently control window focus after running emacsclient?
Currently, focus depends on if I already have an emacs server running. When emacsclient invokes an alternative editor, focus is shifted to the new emacs window. When emacsclient connects to an existing emacs server, focus is not shifted (ie. it stays on my putty client).
I would like to consistently focus on the emacs window, since I usually go to emacs after opening a file.
Any help would be greatly appreciated!
Notes
Version Info
emacs: 21.4.1
emacsclient: 21.4
client os: Windows XP Service Pack 3
x server: Exceed 11.0.0.0
Relevant section of my .bash_profile
# a wrapper is needed to sandwich multiple command line arguments in bash
# 2>/dev/null hides
# "emacsclient: can't find socket; have you started the server?"
emacs_wrapper () {
if [ 0 -eq $# ]
then
emacsclient -n -a emacs ~/notes.txt 2>/dev/null &
else
emacsclient -n -a emacs $* &
fi
}
alias x="emacs_wrapper"
Also, at the end of my .emacs I have
(server-start)
My current workaround is a simple autohotkey script, which focuses on my first Exceed window
^+x::
If WinExist("ahk_class EXCEEDW:MWCLIENT0")
WinActivate
return
As a side note, it seems my redirection to /dev/null confused the syntax-highlighter :(
How about:
emacsclient -e "(select-frame-set-input-focus (selected-frame))"
works for me on emacs 23.1
To unfocus (lower-frame) might be useful.
Would the "--create-frame" option to emacsclient work for you? You'd get a new frame for each file you opened this way, but at least it would be focused (I think).
For some unknown reason, the issue fixed itself. Opening files now consistently changes focus to the emacs frame with the corresponding file. I'm honestly unsure what changed the behavior, but I'm happy.
Thanks to everyone for their comments and suggestions!