Terminal font broken after exiting vim - vim

My terminal's (alacrity with zsh/powerlevel10k) font breaks after I leave vim.
Anyone that could tell me how I could fix this?
Interestingly, the font seems to fix itself if I enter and then exit vim again.

Try to update vim to latest version
$ git clone https://github.com/vim/vim.git
$ cd vim/src
$ make
$ sudo make install

Related

Tmux does not work in ZSH shell in arch linux

Initially, I had tmux working in bash shell. Then, I installed the zsh shell and changed the default shell to zsh with the following line:
#set shell
set-option -g default-shell /usr/bin/zsh
Then, I noticed that tmux would not work. For instance, after getting into tmux, pressing ctrl+b+" displayed a yellow bar at the bottom with "index" on it.
Since then, I have made several modifications to tmux.conf and now I do not know the settings for the default tmux.conf. I tried removing and reinstalling tmux but the tmux.conf file still remains the same.
Any suggestions would be very much appreciated.
Thanks.
Try to re-install tmux using this command: dpkg --purge tmux This will erase all tmux configuration file. And then install it againapt-get install tmux

How to make terminal recognize command "gvim" or "mvim"?

I am not sure I understand correctly from the readme file how to install vim onto my mac. After installation, I still cannot seem to open files while typing gvim HelloWorld.c into terminal. How can I permanently fix the gvim command for terminal to recognize all the time?
Mac OS X already ships with a slightly underpowered but perfectly working vim build so you only have to issue that command in your terminal:
$ vim filename
MacVim is a more featureful version that comes with a GUI and a CLI executable. Is that what you installed?
The archive you downloaded contains MacVim.app and a shell script called mvim.
If you don't plan to use Vim in or from your terminal, you don't need that mvim script at all.
If you do, the simplest solution is to put that script somewhere in your $PATH. To do so, check the value of $PATH with the following command:
$ echo $PATH
and copy the script into one of the listed directories:
$ cp /path/to/mvim /some/directory/mvim
After that's done, you can call the MacVim GUI from your terminal with:
$ mvim filename
or the MacVim CLI with:
$ mvim -v filename

bash: __vte_prompt_command: command not found

bash: __vte_prompt_command: command not found
Whenever I open a terminal, I am greeted with this line. Also, this is printed each time I enter a command in the terminal.
I am a linux-noob, and would be happy to read up, if someone can point me to some resource, or hint at a possible solution. I tried google-ing, but was unable to turn up with any useful results.
I did not do anything specific just before this started popping up.
Thanks in advance :)
Additional Info:
The terminal I used is the default gnome-terminal
Fedora 20
It sounds like a program named VTE has set your bash environment variable PROMPT_COMMAND to invoke a function called __vte_prompt_command.
The PROMPT_COMMAND environment variable defines a command that is executed before every new prompt is displayed to the screen. It can be very annoying when this command produces unexpected output.
You can temporarily get rid of the annoying messages by entering this command in the terminal:
__vte_prompt_command() { true; }
This creates a dummy function that does nothing - you can confirm by looking at the output of this command:
type __vte_prompt_command
After applying the hack to my system I see this:
__vte_prompt_command is a function
__vte_prompt_command ()
{
true
}
However, this is an indication that VTE may not be installed properly and/or may be broken. You might want to try to reinstall VTE, if possible. I would not recommend putting this permanently into your ~/.bashrc file.
I am running Ubuntu 18.04 with the default gnome-terminal and ran into the same problem but wanted a definitive solution.
After trying the solutions suggested previously, I still had the message:
__vte_prompt_command: command not found
comming up after starting a new terminal and after each command terminated.
I searched for a file in for instance .bashrc, .profile that would be doing a source /etc/profile.d/vte-2.91.sh with no luck.
Than I remembered that a long time ago I added the following line in my ~/.bashrc:
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
in order to append command line histories to all opened terminals. I figured out that commenting it solved the problem.
#export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
than
$ source ~/.bashrc
Thought I would share this for anyone having the same problem.
You can disable the corresponding code by editing your ~/.bashrc by using sudo gedit ~/.bashrc, searching for the string "vte" with STRG+F and outcommenting the line with a #.
On my system, the line looked like this, I guess an old installation of Ubuntu Budgie put it there:
if [ $TILIX_ID ] || [ $VTE_VERSION ] ; then source /etc/profile.d/vte.sh; fi # Ubuntu Budgie END
And if it looks like this, the line in your terminal will not appear anymore:
#if [ $TILIX_ID ] || [ $VTE_VERSION ] ; then source /etc/profile.d/vte.sh; fi # Ubuntu Budgie END
For CentOS7 (64 bit):
Try installing using yum command.
sudo yum update -y
sudo yum install -y terminator
sudo yum install -y epel-release
sudo yum install -y terminator #again
Resart the command prompt terminal, This worked for me (:
Reference: http://bytefreaks.net/gnulinux/install-terminator-in-centos-7-64bit
set +v
I think you may somehow made: set -v (Prints shell input lines as they are read.)
so set i

Uninstalled MacVim, now can't use regular Vim?

I got a new machine at work. The previous developer had macvim installed. When typing 'vim' in the terminal, the macvim program would open. I uninstalled macvim because I don't use it. Now when I type 'vim' in the terminal, it says, "Sorry, cannot find MacVim.app." I want to just run vim in the terminal. Is this an alias or something? How can I quickly fix!
you can enter this into the terminal:
which vim
alias
to see info about defined aliases and what happens when you try to run vim
The previous user installed the mvim script that comes with MacVim somewhere in the $PATH or elsewhere and probably symlinked it or created an alias.
To get rid of that behaviour, try the following:
look into your ~/.bashrc or whatever if there's an alias that point at mvim
look everywhere in your $PATH for a mvim script, maybe
$ which mvim
will do
make sure /usr/bin/vim is a real Vim executable and not a symlink with this command
$ file /usr/bin/vim
If it's symlinked then you have trouble, If it's only an alias simply remove it. If you don't want to mess around too much, you can add an alias to /usr/bin/vim in your ~/.profile or whatever.
Whatever you do, I'd recommend you to re-install MacVim as it is a lot better than the default Vim in almost every way.
Is there still a file here: /usr/bin/vim ?
If that got deleted, then you'll need to reinstall vim.
I suggest using Link as your package manager

How can I get vim to point to macvim? Where can I find macvim?

I would like vim to point to macvim :)
Probably through an alias.
vim is here: whereis vim
/usr/bin/vim
macvim I can't find, e.g.
whereis macvim returns nothing
The MacVim distro comes with a script called mvim that takes exactly the same arguments as vim. Put mvim somewhere in your path. Then, just set the alias: alias vim='mvim'
If you want to completely override the system vim, an easy way is to use Homebrew. Just install MacVim with $brew install macvim --override-system-vim. The --override-system-vim flag will create mvim symlinks to vi, vim, etc. You may find it a cleaner way to achieve the same goal. Plus, I prefer to use Homebrew as a package manager.
EDIT: Since you say you don't know where MacVim is, you may just want to download the latest tarball for your system and start from scratch. There are three files: the MacVim application, the mvim script, and a README.
Put MacVim in your Applications folder. Put mvim somewhere in your path.
Going forward, you should look for mvim using which rather than whereis. E.g. $which mvim #=> /usr/local/bin/mvim
which returns the pathnames of the files which would be executed in the current environment. whereis checks the standard binary directories, and may miss files included in your personal path.
Alternately, use Homebrew, as I suggest above and it will manage the location of both files.
My answer is kind of the opposite of michaelmichael's and I've made it quite a few times:
MacVim comes with a CLI executable that you can use in place of Mac OS X's default Vim if you add a single alias to your ~/.bashrc/~/.profile. No need to compile anything, no need to put MacVim in a special place, no need to overwrite default programs with symlinks
This way, you can stay in CLI-land and enjoy the power of a powerful/recent/fast Vim.
EDIT
MacVim is a native Mac OS X GUI version of Vim. It doesn't come preinstalled with your OS so you have to download it from the Internet or install it through homebrew (see michaelmichael's answer). Once it's installed, MacVim is where you have put it, plain and simple.
Because it's a full fledged GUI app, MacVim can't really be used as a drop-in replacement for the default Vim in the terminal.
`$ MacVim file.txt` will not work. `$ open -a macvim file.txt` will not work either.
You basically have two options: use the mvim CLI wrapper to open MacVim from the terminal or use an alias to MacVim's bundled CLI executable.
The mvim wrapper
I think michaelmichael's answer could be a expanded a bit but the most important is said.
EDIT: well scratch that.
The bundled CLI executable
Just add this line (customized to reflect your system) to your ~/.bashrc or ~/.profile or whatever file is run by your shell at startup:
alias vim='/path/to/MacVim.app/Contents/MacOS/Vim'
Open a new terminal window, $ vim file.txt should launch vim in your terminal window, just like the default /usr/bin/vim but with a lot more bells and whistles.
After installing mvim, you can find where it is located with typing into terminal:
which mvim
On my system this gave me:
/usr/local/bin/mvim
Then you create an alias in .bash_profile by typing the following in your terminal, and hit enter:
echo alias vim='/usr/local/bin/mvim' >> .bash_profile
Restart your terminal and try typing:
vim .
This should launch mvim and not vim

Resources