I am having an issue with Tmux where Control+E brings me to the end of a line outside of Tmux but not inside of Tmux. I have looked around for a solution but none seem to work. Any help would be greatly appreciated. My .tmux.conf can be seen here: https://gist.github.com/Julian25/6585115
if you are using zsh, try adding bindkey -e to your .zshrc file.
Related
I'm trying to auto-expand aliases as I type in zsh using the globalias plugin from oh-my-zsh. It was working when I first installed the plugin, but now it has broken. I think it broke after I rearranged the lines in my ~/.zshrc but I'm not sure.
I've tried to simplify the problem by removing everything except the following lines form my ~/.zshrc (I got this from a reddit thread but it also looks v similar to the function in the globalias plugin):
function expand-alias() {
zle _expand_alias
zle self-insert
}
zle -N expand-alias
bindkey -M main ' ' expand-alias
When I source this file and type a space in my prompt, I see
No such widget `_expand_alias'
I've tried googling and it seems like _expand_alias should be a built-in ZLE function, but when I look for it with zle -la | grep _expand_alias it's not there.
I'm not sure what to try next? I can't find a way to reset zsh or the built-in ZLE commands.
I solved it by adding the line autoload -Uz compinit && compinit near the start of my ~/.zshrc.
Hope this helps someone!
I am using the zsh shell on my mac.
However my when I type Ctrl-A and Ctrl-E I am getting the characters on the screen instead of moving to beginning or the end of the line.
ps -ef ^A^E^A^E
How can I fix this? Thanks
Nvm found a solution, it was a problem with my keybindings.
I was using preztro and set the editor binding to vim whereas it was set to emacs in zsh
Is there any way to achieve tab completion in tmux's status line. Let me give a use-case:
bind-key v command-prompt "split-window -h 'exec vim %%'"
This is from my tmux.conf. It will be a great idea if only I could get paths to complete in the tmux statusline. I've looked around but did not find anything. Anyone has any ideas?
Thanks.
I'm new to Vim. I was experimenting with vim-powerline and tmux (and pathogen and vundle).
Somwehere in that process I tried to remove powerline and tmux started receiving this error.
My .tmux.conf file is empty. How can I find where tmux is trying to run this command?
I had this problem, too, but not in the first tmux window. It only happened for me in subsequent windows. I found a solution, but not exactly the cause of the problem.
The short version is the set the value of the POWERLINE_COMMAND variable in your .bashrc on the line before you source the bash binding. For me, that means:
export POWERLINE_COMMAND="$HOME/powerline/scripts/powerline"
. $HOME/powerline/powerline/bindings/bash/powerline.sh
I don't get exactly why this happens in subsequent tmux windows but I added some echo lines to the bash binding to find out what's happening. When the binding is sourced in subsequent windows, POWERLINE_COMMAND is already set to powerline, so it skips the code that checks for the right place to set it. I couldn't figure out where, how, or why it's already set, though.
Here's the code that does the check from the beginning of the bash binding:
if test -z "${POWERLINE_COMMAND}" ; then
if which powerline-client &>/dev/null ; then
export POWERLINE_COMMAND=powerline-client
elif which powerline &>/dev/null ; then
export POWERLINE_COMMAND=powerline
else
# `$0` is set to `-bash` when using SSH so that won't work
export POWERLINE_COMMAND="$(dirname "$BASH_SOURCE")/../../../scripts/powerline"
fi
fi
Since it works in the first window, I just set POWERLINE_COMMAND to point to the command that it points at in the first window. Setting it before sourcing the bash binding skips the whole check.
I suggest you to check your shell's configuration files. If you use e.g. use bash, check $HOME/.{bashrc,profile} or $HOME/.zshrc for zsh. There is probably a line like
. {repository_root}/powerline/bindings/bash/powerline.sh
according to the powerline installation instructions.
In zsh, how can I set up the line editor such that backward-kill-word stops on a directory separator? Currently in my bash setup, if I type
cd ~/devel/sandbox
and then hit C-w point will be right after devel/. In my zsh setup, point would be after cd . I'd like to set up zsh so it behaves similarly to bash.
For recent versions of zsh, you can simply add:
autoload -U select-word-style
select-word-style bash
to your zshrc as described in the zsh manual (also man zshcontrib).
Another option is to set WORDCHARS (non-alphanumeric chars treated as part of a word) to something that doesn't include /.
You can also tweak this if you'd prefer ^w to break on dot, underscore, etc. In ~/.zshrc I have:
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
Here's what worked for me. unspecified word-style was required otherwise zsh didn't seem to respect the WORDCHARS.enter code here
WORDCHARS=' *?_-.[]~=&;!#$%^(){}<>/'
autoload -Uz select-word-style
select-word-style normal
zstyle ':zle:*' word-style unspecified
Here's more info on why this works.
A quick google reveals:
Backward Kill
Or, perhaps a better fix:
Bash Style Backward Kill