Vim status line not working - macos

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.

Related

Problem with integrated terminal in PhpStorm

I'm learning Laravel, and also I started learning it with(for me) new editor - PhpStorm. I want to edit my terminal(not colors, fonts, etc.). I integrated the gitbash instead of factory terminal that comes with PhpStorm.
The problem is that I'm having some'? ' with a number, usually '32m' before the statements in my terminal. To explain it better, here's a screenshot:
And for example, everyone that I've seen on google, using PhpStorm have 'normal' editor without those symbols and numbers before each line in the terminal.
My terminal atm :
Tried searching JetBrains FAQ, googling and ofc here on StackOverflow, but no luck for me.
What would I like my terminal to look like https://i.stack.imgur.com/oh3Vv.jpg
What it's missing is the ANSI support for color codes. As a result you see those strange characters as these aren't parsed and therefore displayed as output.
Maybe you could try with a little utility like ansicon. For further details take a look at this article (outdated but might work anyway)

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?

How to run Octave from a Notepad++ file line by line or by sections?

I am looking for a way to have my Notepad++ window open for editing my code and run it line by line or by sections (more than 1 line) while I am editing. It would be like having a real IDE; the output could be shown in the same window (Notepad++) or directly in the Octave window.
I have tried what many many sites say. That is, writing this:
C:\Software\Octave-3.6.4\bin\Octave\Octave-3.6.5.exe "$(FULL_CURRENT_PATH)"
in the Run window in Notepad++, saving and giving it a shortcut. However, it is still not working. When I tried to run it, the black window starts showing-up but then it disappears and nothing else happens. In my Notepad++ window I have only one line (for now) where I have tried just "b=4" or "3*4". I have done this with and without semicolon at the end. Nothing happens.
I have Windows 8.0, Notepad 6.5.5 and Octave-3.6.4. I already change the octaverc file in Octave to make it work with Notepad++. I have work already only in the command line in Octave and is working fine. The Octave I installed was exactly "octave-3.6.4-vs2010-setup", it says it was compiled for Visual Studio 10. Is that the reason why this is not working?
Any help will be appreciated...
regarding Octave not processing the command: use supposed command line outside the N++ and see if it works. If not, find a way to make it working, then transfer it back to N++ (and use the token "$(FULL_CURRENT_PATH)" instead of concrete filename)
regarding running the code in smaller portions: if you app can accept the code directly in the command line (SQL command line tools I use can do this), then you can use token "$(CURRENT_WORD)" what stands for content of current selection (all tokens are in wiki)

How do I use tab completion in Rstudio

I've been using Rstudio for a few weeks now, and the tab completion has worked inconsistently for me. For example:
my_variable = 10
my_va
Those are the only two lines in my R-script. When I press tab to use completion, a small message appears next to the text bar saying "(No matches)", when I believe it should find the matching variable called "my_variable" in the line above.
Does anyone know how to use tab completion in Rstudio?
RStudio looks at the workspace and the packages loaded to try to do the tab-completion. If you haven't run the first line then RStudio won't recognize that you want to complete to "my_variable".
If you run your first line then RStudio will be able to tell that you have a variable called my_variable and will offer to complete it to that.
You can read a little bit more in the RStudio documentation.

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