the time bar of powerlevel9k go to the second line - themes

I'm trying to set up wsl in my computer
and I install the powerlevel9k theme for it.
But the system time bar seems doesn't work correctly.
the time bar went to the second line, which is my command line.
when I type something, what I type will cover the original text(i.e. time status)
I wonder if there has anything I do is wrong
or it's just a bug?
Btw, in my .zshrc I didn't edit anything except ZSH_THEME.
And I apologize for this horrible color in my picture :(

Powerlevel9k has been discontinued and superseded by Powerlevel10k. Try installing Powerlevel10k and see if it fixes the issue.

Related

Clear terminal without clearing first line of multi-line prompt

I'm trying to setup the terminal on my new Mac to match the behavior of my old Mac, however I have run into an issue with my multiline prompt that has me stumped. I remember having this issue when I setup my old Mac several years ago, however I don't remember how I solved it.
My prompt (without color) looks like this:
╭─username ~ 130 ↵
╰─
When I press ⌘commandK in iTerm2 on my old Mac it clears the terminal window so that both lines of the prompt are shown at the top.
When I press ⌘commandK in iTerm2 on my new Mac it clears the terminal window so that only the second line of the prompt is shown at the top.
I have tried checking everything I could think of, I have checked:
Every dot file/directory in my home directory (copied them to the new Mac).
iTerm2 settings.
System settings (primarily keyboard shortcuts).
Various websites with instructions about setting up multi-line prompts.
Interestingly I have discovered that if I type clear iTerm2 will clear the screen and leave the top line showing on both Macs. However it first clears the entire screen, including the prompt, before bringing the prompt back (looks bad imo). However since it works differently ⌘commandK does I don't think that's what my old Mac is doing.
It's possible that I installed some program/script that somehow does this, but if so I'm not finding it locally or referenced online.
Does anyone know how I can get ⌘commandK working to clear the screen while keeping the top line of my prompt? I still have the old Mac so I can check/compare anything on it to the new Mac if there are any guesses about what settings I changed.
Edit:
I was able to find something that worked, however if anyone has any other suggestions I'll be happy to try them and accept any that I can make work that are less hacky than this (e.g. don't require another 3rd party app).
Edit: This doesn't work while a command is running, nor does it clear the scrollable history. So it's better than nothing but still doesn't behave like I want it to.
After coming back to my question SO associated a new question with an answer I was able to make work, although it feels extra hacky and wasn't what I had working before.
I found this answer which suggests using ⌃controlL to clear the screen. That does exactly what I want it to do (leaves the top prompt visible and doesn't flash) but with the wrong keybinding. Fortunately I was able to use an app I already have installed (BTT) to make ⌘commandK map to ⌃controlL only in iTerm2.

Vim status line not working

I'm on OS X and I've installed Vim using Homebrew via
brew install vim
I noticed that whenever I use Vim, there is no status line appearing at the bottom. I thought I could fix it by always displaying the status line by adding the following to vimrc:
:set laststatus=2
This shows me the status line but it's just an empty line above the ruler. It looks like this:
Am I missing something?
EDIT
I want to use Vim for Haskell. I've installed haskell-vim-proto. I'm using the included included vimrc which should result in showing things like syntax errors in the status line. When I edit Haskell files (with the vimrc), there is no status bar in my Vim. Adding set laststatus=2 to the vimrc results in a blank status line showing.
When I'm following tutorials that install Vim through HomeBrew (as I did), opening any time of file with Vim shows the status line at the bottom containing things like this:
I'm literally following this tutorial. When he opens .bash_profile with Vim, it looks like this:
When I do the exact same thing, it looks like this:
The guy who made that tutorial made a very big and very common mistake: he is using a heavily customized Vim instead of vanilla Vim. This rather obviously gives new users wrong expectations.
Basically, everything you see in that first screenshot:
colorful pseudo-tabline
colorful statusline
colorscheme
relative line numbers
is either provided by one or more plugins that the author failed to mention or by a built-in option that he also failed to mention.
If you absolutely need an "always-on" statusline, follow #dNitro's suggestion.
If you absolutely want the exact same setup as the author (which is not a very good idea in and of itself), I'd suggest you contact him directly. People should take full responsibility of the crap they put online.
Status line by default is just like that gray line and will always remains there as long as you set laststatus=2.
What you are missing is formatting this line to show the items you want it to show you. you can do it manually yourself. just add the following to .vimrc and see what happens:
set statusline=%F%m%r%h%w%=\ [%Y]\ [%{&ff}]\ [%04l,%04v]\ [%p%%]\ [%L]
to decipher see: :help statusline and add your desired items.
Or use a plugin: vim-airline and lightline.vim are two popular one.

vim in Macbook Pro command line doesn't work appropriately

I just switched from a Windows laptop to a Macbook Pro. I have installed vim and macvim using homebrew. Everything works fine with macvim, but in the command line, the vim exhibits weird behaviors.
First, the cursor in the Insert mode (which I suppose should be simply a line) is the same as the Normal mode (which is a rectangle), making it impossible to tell the current mode from the cursor shape. I don't know whether this is normal with vim in the command line because I didn't pay attention before. But this is certainly different from the behavior of macvim and it helps to distinguish the shapes of the cursor in different modes.
Second, the backspace does not work appropriately. It often cannot delete letters in the Insert mode.
I am totally new to OS X, so I would greatly appreciate it if someone can give some hints on how to solve these issues.
Thanks!
Indeed, nothing in your question relates in any way to Mac OS X.
I also like my cursor to change shape when in insert mode, and I use these lines to make it happen in iTerm2:
let &t_SI = "\e[5 q"
let &t_EI = "\e[2 q"
This is a hack, and YMMV depending on which terminal emulator you're using. I suggest googling to find the best solution for your case.
The weird backspace behavior you're experiencing is caused by one of the notorious Vim defaults. Simply set
set backspace=eol,start,indent
to make it work as expected.
I suggest starting with or at least skim through Tim Pope's vim-sensible and save yourself some headaches.
When run in a terminal emulator, Vim has no control over the shape of the cursor. Some hacks exist but they only "work" by chance so I would suggest you get used to it and read :help 'showmode'.
Your backspace issue with a simple option. See :help 'backspace'.

Vi for OS X won't show -- insert -- on status

I have tried many things such as add "set showmode" in .vimrc file and start vi with the command "vim" instead of just "vi". Nothing seems to work. I have another Mac and in that one the --Insert-- status does show up.
Any help is appreciated.
Thanks!
vim will not show the mode if (later) in the settings you have
set compatible
That cancels and/or overrides most of the vim extensions. See these for discussion:
In a .vimrc, is set nocompatible completely useless?
Setting vim filetype with modeline not working as expected
I was finally able to fix the problem.
It seems that the status was always there but the text color was the same as the background (black). As soon as I changed the theme color, I was able to see the status --Insert--.
if your trying status lines and term colours you might find this useful.
https://github.com/FallenAngelTodd/vim-status
lots used for setting different modes in the status line?

Vim under mac does not behave as expected

I recently got a mac. I was previously working on a laptop with ubuntu and I was using vim.
I now will discuss about vim in console (iTerm2 or the default terminal) and macvim.
The problem is that some binding don't work under mac. For example I had CTRL left/right for navigating between splits, CTRL up/down to move lines or blocks of code up and down, etc. They don't work anymore.
I had a bunch of plugins (nerdtree, powerline, etc.) that now look weird. Powerline doesn't display special characters in macvim and in terminal they are question marks.
In console, nerdtree looks weird and it doesn't display the special triangle character. If I hit return to open a file selected from nerdtree, it doesn't do anything. In macvim, it works ok.
Is there any guide on how to use vim on mac? Or what is the recommended way?
Nerdtree : let g:NERDTreeDirArrows=0
Powerline : Take a look at the part of strange characters in the document https://github.com/Lokaltog/vim-powerline
Navigating within splits with Ctrl + arrows work on mine. Can you post your vimrc, or try running vim without any configuration.
Ctrl+arrows to move lines and block doesn't work on mine.
Did you check which key was sent by your terminal to vim ?
Did you tried to set it manually ?
I had similar problems with emacs, including one keybinding I'm still not able to reproduce :(
I have the exact same config on my Mac and a Windows box at work, my Ubuntu box at home and a couple of VPSes. It works exactly the same on every platform in GVim/MacVim or in plain Vim.
Unfortunately I don't use either NERDTree nor Powerline but Vdt's answer seems to have all the info needed.
Some of the behaviors you describe are custom mappings. You should show us your ~/.vimrc (the old one on linux and the new one on the Mac, if there are differences) so that we can help you make it more portable.
Also, "looks weird" means nothing: please add a screenshot or two.

Resources