Vim Vundle broken, can't open file - shell

My vim setup apparently has broken out of nothing. It now spills errors for every single plugin I have configured. This started happening after I have changed some appearance settings, some syntastic features (both of which I don't think are the cause) and changed my shell to fish (this MAYBE is the cause).
Using the directive set shell=/usr/bin/fish or set shell=fish does not change anything, it still fails, for which I tried after reading this question.
The errors happen for both :BundleInstall and :BundleUpdate. My full vimrc file is available here if there is need to read it, it's not long.

Yes, setting your shell to fish is likely to be the root of your problem. The fish shell doesn't support the standard UNIX syntax for file redirections, which breaks Vim's system(). Just set Vim's shell to sh:
set shell=/bin/sh
You can't use the interactive features of fish from Vim anyway.

A while back I wrote up some docs for this on the Vundle wiki that you may find useful. In short, you can either:
Run: env SHELL=(which sh) vim +BundleInstall! +BundleClean +qall
Add set shell=sh to your .vimrc
As an aside, my Tackle project has an Up plugin that includes a handy way to update your vim plugins via Vundle.

Related

Trouble installing haskell: how to adjust PATH variable to add to a shell config file?

I installed Haskell on my MacOS system using ghcup installer. It worked because if I type ghci I am dropped into this interactive shell. However I got this message in the terminal after doing the install:
In order to run ghc and cabal, you need to adjust your PATH variable.
You may want to source '/Users/user1/.ghcup/env' in your shell
configuration to do so (e.g. ~/.bashrc).
Detected bash shell on your system...
If you want ghcup to automatically add the required PATH variable to "/Users/user1/.bashrc"
answer with YES, otherwise with NO and press ENTER.
YES
grep: /Users/user1/.bashrc: No such file or directory
My shell is bash 3.2 But as you can see, when I typed YES it says there is no such file. How do I find my shell configuration file, or resolve this? I'd like to complete the setup correctly here.
And I have to be honest about my level of knowledge here, I don't truly understand what this is asking exactly. Is the PATH variable 'env'?
On macOS, .bashrc does not exist by default. ghcup will create this file, so the command you ran will have worked correctly. However, one of ghcup's subcommands expected to find the file before it was created, and therefore reported that error message. You can safely ignore this.

Catch-22 UNIX Shell Zsh

I was fooling around with .zshrc files, and now I am locked out of my terminal with "No such shell function 'accept-line'".
It would be easy to just go and undo the change in the .zshrc file, but my terminal autoloads into zsh, so there is no way to edit the dotfile.
I have looked all around for a way to edit hidden files in El Capitan, but to no avail.
From your mention of 'El Capitan' I infer that you might be on OS X and using Terminal.app? If so, please add a tag for that, or state that clearly.
If so, you could duplicate a Terminal profile in the preferences and under Settings->Shell / Startup set e.g. /bin/bash as the command and untick "run inside shell". That should give you a bash which will ignore .zshrc.
Otherwise, look for similar settings in your terminal emulator. Most should have such a setting somewhere.

Why does git diff on Windows warn that the "terminal is not fully functional"?

I'm using msysgit 1.7.7.1 on Windows. I get an error when using git diff. What is causing this? Is there no diff tool included in msysgit? What should I do?
WARNING: terminal is not fully functional
If you are having issues in cmd.exe, for instance, see the warning here:
Then simply set your environment variables and include TERM=msys. After that, each time you open a cmd.exe, your variable will be set correctly.
NOW YOU MUST RESTART YOUR SHELL (CMD.EXE). Just run a new one. And from there, you should have no more issues. Again:
For Git Bash, this can be fixed by adding the following line to ~/.bashrc:
export TERM=cygwin
-or-
export TERM=msys
The first seems to be the original by git for windows, the second a popular known form to "heal" as well.
The problem can be caused if some other program (like for example Strawberry Perl) sets the TERM system environment variables.
http://code.google.com/p/msysgit/issues/detail?id=184
Above answers was not fully worked for me, so I did:
Add
export TERM=msys
to "[githome]/etc/profile" at the top but it made changes only for git bash. Then I added
#set TERM=msys
to "[githome]/cmd/git.cmd" after #setlocal (I installed only git run from command line). May be this decision not truly good but it works for me and there are not any terminal warnings. (I use git version 1.7.10.msysgit.1).
The answer can be found here, in which the author of the solution claims that:
the environment variable TERM was set to dumb
that was instead of
TERM=cygwin
You can change that to
TERM=msys
to solve the problem at hand.
I work in powershell and I have the git executable directly in my path.
None of the suggested answers worked, but I found a solution that works for me.
I added a line in my powershell profile:
$env:TERM="msys"
Which fixed the problem for me.
A quick & dirty solution in my case turned out to be to use the --no-pager option.
By default, some git commands (like log) will use a pager like less if they expect the output to be long. Pagers require things like scrolling text up and down with the arrow keys, which sometimes doesn't work if the assumptions about what kind of terminal you're on are wrong (this is what the "not fully functional" means).
If you know ahead of time that your output will be short, or you just want it to dump output to the terminal and leave the scrolling up to your terminal program, you can override this and not use a pager at all, e.g.:
git --no-pager log
In case someone gets this launching bash from Git Extensions, check the setting for Path to linux tools.... Mine was set to C:\cygwin. Changing it to C:\Program Files (x86)\Git\bin\ fixed it for me. I didn't have to set the TERM variable to launch bash this way.

How to set path for vim config files?

I know they say to store your vim config files under source control.
Is there a way to tell vim where the config files are? like .vimrc etc.?
i.e. I will store them in a different folder where my other git repos are.
BTW, what are good coloring plugins for ruby?
You can use the VIM environment variable to change the location of your ~/.vim/ directory, if you want to keep all your git repos in one place. See the :help $VIM section for more details, but here's the bit that looks most useful:
The environment variable "$VIM" is used to locate various user files for Vim,
such as the user startup script ".vimrc". This depends on the system, see
|startup|.
If you add export VIM=/home/blankman/git/vim/ to your ~/.bashrc, you ought to be set.
Excerpt from the vim man page:
-u {vimrc} Use the commands in the file {vimrc} for initializations.
All the other initializations are skipped.
To have it work whenever you run vim, try putting in your shell's startup script (.bashrc etc):
alias vim='vim -u /path/to/vimrc'
Link: http://www.h3rald.com/articles/herald-vim-color-scheme/
Has a few schemes with ruby highlighting examples. Vim has decent native ruby support it seems, so you may just want a new colour scheme.
A light-coloured Ruby highlighting scheme here.

How to set my GVim to be feel like IDE?

Currently, I'm using GEdit as my text editor for editing Ruby and Javascript source codes. I would like to give GVim a try to be my editor choice. I have tried to follow https://github.com/akitaonrails/vimfiles and few others instructions, but I don't get any luck, when I source ~/.vimrc, then I always get:
bash: /home/samnang/.vimrc: line 5: syntax error near unexpected token ('
bash: /home/samnang/.vimrc: line 5:call pathogen#runtime_append_all_bundles()'
Could you point me somewhere to get the instruction or configuration?
Environment: Ubuntu 10.10
Edit: If I don't source it, when I type vim or gvim, then I got:
Vim: Caught deadly signal SEGV
Vim: Finished.
Segmentation fault
You need to run source ~/.vimrc as an Ex mode command. That is, inside Vim itself, hit : and enter the command:
:source ~/.vimrc
Right now, you're running Bash's source command, which is entirely not what you want to do.
~/.vimrc is the configuration file for vim, and will automatically be read by vim when it launches in order to know how you want it set up. You can add your non-graphical vim commands, such as key mappings, abbreviations to ~/.vimrc/. In ~/.gvimrc you can add commands to set your colorscheme, the default number of columns and rows displayed at startup, etc.
If you aren't familiar with vim itself type vimtutor at the command-line and go through the tutorial.
To start gvim, type gvim at the command-line. To edit a file you can either open gvim, then use :e file/to/load in comman-mode, or do gvim file/to/load at the command-line. gvim supports multiple windows and tabs as does vim, so study those things to make the most use of them.
You can also try integrating Vim with eclipse if you want to bring IDE functionality to Vim (like projects, error highlighting, code completion, etc).
If you're interested check out the eclim project. It supports most of the modern languages, including Ruby, and I highly recommend it.
Try adding a .vim or vimfiles in your $HOME directory. If it still fails, add a file to the .vim directory. I did a
cd
mkdir .vim
cd .vim
touch .netrwhist
chmod g+w .netrwhist
I discovered this while learning about building your own syntax files at vim wikia creating your own syntax files

Resources