Vim commands do not respond anymore - macos

Since yesterday, after I updated my macbook (system update, iterm update, oh_my_zsh and homebrew update), my Vim editor (the system one) does not quit anymore after typing :q or :x.
Most of the commands like saving don't work either, I sometimes can access the :help but I also can't quit it. I tried to install macvim in replacement but when I open it inside the command line with mvim -v I got the same issue.
The only way I found to quit it is to put it in the background with Ctrl+Z and force kill it, otherwise it won't close. I tried to find the solution online but most of the topics are about how to close it when it's working (for beginners) or are only about macvim.

Related

My emacs client automagically terminates when switching applications [OSX iTerm2]

I try to be brave and switch from vi to emacs.
Now, I set up Emacs 26 on macOS via homebrew and start Emacs as daemon in the background.
I can use files using emacsclient -t. However, whenever I bring the Terminal into the background emacsclient exits within a few seconds.
See example Video here: https://cloud.familie-ganter.de/s/QwbK8cFBHnPjQ4d
I did a plain install. My init file does not contain anything except what you see in the video. The funny thing is whenever I start emacs directly in the Terminal, nothing at all happens when bringing it to the background.
What seems to be the problem?
I am lost …
I expect it to be something dumb and simple -- so please be nice, this is my first stackoverflow post.

Vim copy to system clipboard using register not working (Mac computer)

I have been spending some time looking for the solution. I have reinstalled Vim on my mac for several times using MacPorts. The vim --version command show that +clipboard and +xterm_clipboard, so I should be good to go. However, when I type "+yy or "*yy inside vim, the :reg command show that the register changed to the current line, but when I do paste outside vim, the content still did not change. Everything in vim I can tolerate to trade off its super flexibility, however, this copy/paste which is frequently used but extremely difficult in vim really driving me crazy...
I've found that if I add set clipboard=unnamed to my .vimrc, then pasting outside of vim will paste the contents of the * register. For + you might try set clipboard=unnamedplus.
Problem solved. I am always using system vim, which is /opt/local/bin/vim. I think there was some glitch going on there. So I installed MacVim, and link vim to MacVim by adding the following code to my bash profile (~/.bash_profile)
alias vim='/Applications/MacVim.app/Contents/MacOS/Vim'
Registers work perfectly with MacVim. Even though vim --version reveals that it is +clipboard but -xterm_clipboard.
For me, it was a matter of updating the vim that ships with OS X (7.3) via homebrew to 7.4.

Accidently quit updating ZSH in the middle and can't type any commands

I was upgrading everything in homebrew and zsh was upgrading and I was cycling through my open applications and accidentally closed iterm during the update. Now I can't open iterm and when I open the terminal I get the following error message:
login: /usr/local/bin/zsh: No such file or directory
I am not sure how I can switch back to bash until I correctly update zsh. I also can't type a single command in either iterm or termianl which makes sense (there's no zsh file). How can I finish upgrading zsh correctly or switch back to bash?
I have done a good amount of research and can't find someone having a similar issue.
Any guidance to how to solve this issue would be much appreciated, I currently can't do any of the development work I need to do.
Found this on Apple's suport site. Basically, you want to launch Terminal and go into Preferences. Change Shells open with from Default login shell to a valid shell (I recommend /bin/bash or even /bin/sh just to get you working again).
Once you can access your shell session, you can restore zsh.
Here's the full article... http://support.apple.com/kb/ta27005

Can't paste into MacVim

I copy text from outside of Vim. ⌘V in other apps pastes text without problem. In MacVim, it doesn't work.
In Insert Mode, nothing appears. In Normal Mode, I get E353: Nothing in register +. This happens when set clipboard=unnamed is on or off.
Oddly enough, this was working before. What's wrong?
If you are using tmux and sometimes you initially launch MacVim via the mvim command-line program, then you might be encountering the problem that prompted me to write the reattach-to-user-namespace command.
My guess is that clipboard access worked on prior occasions because you happened to have launched MacVim via a “normal” GUI method (e.g. the dock, Finder, Spotlight, etc.). The clipboard later became inaccessible after you had quit the prior instance of MacVim and relaunched it through (e.g.) mvim from inside a tmux session.
The core problem is that programs launched in certain contexts (i.e. inside a tmux session) end up with an environment that denies them access to certain services (e.g. the OS X pasteboard).
The initial launch is the important one here. New windows started by mvim-in-tmux (even without the above-linked wrapper program) should have access to the clipboard as long as MacVim was previously started “via the GUI” (maybe there are still some MacVim windows open, or maybe you have MacVim configured to keep running even when there are no windows open). Correspondingly, to regain access to the clipboard you will need to close all your existing MacVim windows, quit the application, then restart it in a way that has access to the clipboard (e.g. via the GUI, or “inside” the wrapper).
Once you have the above-linked wrapper program installed (it is also available through MacPorts and Homebrew), you can use a command like reattach-to-user-namespace mvim to ensure that if it ends up starting a new MacVim instance, then that new instance will have access to the clipboard. You might use an alias, shell function, or a script to make sure you always “wrap” mvim.
Several other commands also benefit from “wrapping” (pbpaste, pbcopy, nohup, launchctl (depending on which subcommand you are using)), so you may want to “wrap” your whole shell instead of the individual commands. The bit of the process environment that the “wrapper” modifies is inherited by child processes, so “wrapping” your shell will affect most commands you run from it. If you are using tmux, you could configure your default-command to automatically “wrap” your default tmux shells:
set-option -g default-command "reattach-to-user-namespace -l zsh"

vim replaces lines when I move to a new line

I'm using Terminal.app on Mac 10.6.6 and want to upgrade vim. Should I install it in /usr/local?
I'm asking because my native vim install is messed up for some reason. Sometimes, when I open it and move up and down, the whole line changes to another line on the screen, like dancing chairs. But if I type :q it quits fine because nothing actually gets changed (cause I'm just moving the cursor around), but I can't see what I'm doing because when I move to a new line, that line gets replaced with another line about 6 lines below, but it's random.
$TERM = xterm-color
I installed Mercurial & ack via CPAN (for which I installed File:Next) yesterday, so maybe that did it. I have MacVim, but I want vim to work too cause I use it for Git, etc.
Try running vim -u "NONE" to load your Vim without your .vimrc, this might be the culprit in this case. If everything works like it should you can try re-enabling things one by one so you can see what caused it.
If you want to update your Vim I can recommend homebrew which has a so called formula with a regularly updated Vim.
Put the mvim script that came with MacVim in your $PATH and use it on the terminal with the -v option or a symbolic link named vim.
Also, use TERM=dtterm for Terminal.app. Programs will behave better.

Resources