Using vim as text editor for IPython (Mac OSX) - macos

I'm trying to get vim-ipython working, and have been using this reference guide (https://github.com/ivanov/vim-ipython).
First, I created the following directory:
/Users/***/.vim/ftconfig/python/ipy.vim
However, when I type %edit in IPython, I still get
No default editor available.
Specify a GUI text editor in the `IPythonWidget.editor` configurable to enable the %edit magic
Then, I tried typing the following in IPython:
source ipy.vim
I got an error:
File "<ipython-input-7-505e44392e8d>", line 1
source ipy.vim
^
SyntaxError: invalid syntax
Finally, I edited ipython_qtconsole.config.py to include the following line:
c.IPythonWidget.editor = "/Users/***/.vim/ftplugin/python/ipy.vim"
Still no dice. I can get emacs to work by editing c.IpythonWidge.editor, but I'm not sure how to change it to use vim as the editor.
Any suggestions? Thanks!

Related

Netbeans - installing SASS

I have had a few attempts at installing SASS on netbeans. I have followed the following tutorial:
http://kgagliardo.com/blog/netbeans-sass-windows-7
I get the below error when creating and trying to save the SASS file and no CSS file is created.
""C:\Ruby193\bin\sass.bat" "--cache-location"
"C:\Users\Leanne\AppData\Local\NetBeans\Cache\7.4\sass-compiler"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\store.scss"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\css\store.css"
'"ruby.exe"' is not recognized as an internal or external command,
operable program or batch file. Done."
I've been stuck on this all morning, please help...
UPDATE
I've tried to follow the instructions provided below and it still does not work, although I did get a slightly different error message:
"C:\Ruby193\bin\sass.bat" "--cache-location"
"C:\Users\Leanne\AppData\Local\NetBeans\Cache\7.4\sass-compiler"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\store.scss"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\css\store.css"
Syntax error: File to import not found or unreadable:
foundation/components/accordion.
Load path: C:/Users/Leanne/Documents/work/freelance/sites/fws_templates
(DEPRECATED)
on line 10 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\foundation\foundation.scss
from line 11 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\store.scss
Use --trace for backtrace. Done.
However Now I simply get the original error message again. No idea what to do. See image below showing that I have done everything according to the instructions (I think).
http://i.stack.imgur.com/Eekyt.png
Your path environment variable points to the wrong folder
Your Path to ruby is C:\Ruby193\bin
Go back and edit your path environment variable to point to C:\Ruby193\bin . At the moment you have C:\Ruby\192\bin
EDIT
And Now remove the backslash between Ruby and 193.
Your Path is set to : C:\Ruby\193\bin :-) !
your .bat is in Folder : C:\Ruby193\bin
TIP
Go to Options
Miscellaneous --> CSS Preprocessors
check : Generate extra information (debug)
You don't have path to ruby.exe which is c:\Ruby\192\bin in you PATH variable.
In Windows 7:
Right click on My computer and select Properties -> Go to
Advanced Tab -> Click on the Environmental Variables button
In the Environmental Variables window highlight PATH variable in
System variables section and click Edit
Append ;c:\Ruby\192\bin to the end (the semicolon is intentional)
Restart command prompt
You don't have path to ruby.exe
As simple, reinstall ruby, use ruby installer for windows.
When you go through the installation wizard, you’ll come to this options screen:
From what I can tell, the only option that you need to check on that one is the middle option, which helps your command-line instructions recognize where to find (as it says) “Ruby executables”. Otherwise, you’ll get the error message “ruby is not recognized as an internal or external command” when you try to install Sass in the command prompt.
Go to Options
Miscellaneous --> CSS Preprocessors
check : Generate extra information (debug)
For more information go to Setting Up Sass on Windows
They are all right in the above message. The problem is that Netbeans is not designed to pick up these changes instantaneously. Once you make the changes above, you have to RESTART Netbeans, so that the changes will be applied. This worked for me. Let me know if it works for you.
Thanks

Loading .rb files in Mac OS IRB

I'm just staring out with Ruby. I followed a tutorial to set up Ruby environment on my Mac OS. Then, I created a file named 'personal_chef.rb' in Sublime Text and saved it to a folder I created. Next went to IRB and tried "load 'personal_chef.rb'" and got the error:
-bash: load: command not found
I think it might have to do with how I switched my PATH when installing a new version of git during Environment setup. (I did that by following their instructions and typing: 'echo 'export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"' >> ~/.bash_profile').
Can someone please help explain what is happening and how I can fix it? Basically I want to be able to create a file in Sublime Text, save it, then load it in IRB.
(I am running Mac OS 10.7.5, using Sublime Text 2.0.2 and using Terminal.app for IRB).
Thanks!
This is how you load the file:
First, make sure you enter the irb command from within the same directory you saved 'personal_chef.rb'.
This means that if you saved it to your desktop, you would type ~/desktop
You'll know you're in irb if your command line beings with irb(main)
Next simply type load 'personal_chef.rb'
If you successfully loaded the file the load method will return true.

Hart1´s Ruby Tutorial - Subl Gemfile - failed with error -43

I am struggeling my way through Hart1's Ruby Tutorial, and I can't get past this point; whenever I execute the subl Gemfile command, I get the following error:
FSPathMakeRef(/Applications/Sublime Text 2.app) failed with error -43.
Can someone help me??
To echo what R_G said - you should definitely include more information about your environment to get better help.
What's happening here could be that you don't have sublime text installed in your applications (if you downloaded on a mac, you have to drag it into the applications folder - Or you don't have the 'subl' command set up in your command line. I never got subl as a command to work from my command line when I was working on a windows computer....
Here are instructions on how to do these things - if you are working from a Mac. http://www.sublimetext.com/docs/2/osx_command_line.html
What it's trying to get you to do is just open the gemfile with sublime text - so since you are just beginning -- just do that. Manually open the sublime text application and then manually find the gem file in your application folders and open it.

E185 error on mac terminal [duplicate]

I have Solarized installed via pathogen and it's been working fine in both terminal and MacVim on my Mac. Today, I tried setting up an Ubuntu box on Linode. I just cloned my dotfiles and symlinked to my .vim and .vimrc folders (this is the same setup as I use on my local machine.
Whenever I try to run vim on the Ubuntu box I get an error
Error detected while processing /root/.vimrc:
line 43:
E185: Cannot find color scheme solarized
Press ENTER or type command to continue
I can tell my .vimrc is being loaded because all other setting like line numbers are working.
The related lines in .vimrc are the following:
" settings needed for solarized colorscheme
syntax enable
set background=dark
let g:solarized_termcolors=256
colorscheme solarized
This is the setup of my .vim/bundle directory (incase you suspect I don't actually have solzrized in there!):
~ ls .vim/bundle
ack coffeescript liquid snipmate vim-colors-solarized vim-jst zencoding
closetag html5.vim nerdtree surround vim-javascript vim-rails
One other thing, running echo &t_Co in vim on the ubunto box gets me 256.
Any ideas?
I was running into this problem just now, too. I had my call pathogen#infect() line in my .vimrc just fine, but was getting the
E185: Cannot find color scheme solarized
error, like you. I moved my call pathogen#infect() up to the top of my .vimrc and all is swell now. Try that if you're still having problems!
I know that it is kind of obvious, but did you check the contents of ~/.vim/bundle/vim-colors-solarized? Just in case you are running in the same issue described in Vim: Pathogen not loading
:colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath'
for the file "colors/{name}.vim. The first one that
is found is loaded.
You should put solarized.vim in ~/.vim/colors/.
This is what I did;
cp ~/.vim/bundle/vim-colors-solarized/colors/solarized.vim ~/.vim/colors/
I just ran into this problem myself on a new CentOS box where 'vi' was mapped to a version of VIM without syntax support (ie. -syntax) and was giving the E185: Cannot find color scheme solarized error, while 'vim' mapped to a version with syntax support and worked fine with solarized.
Aliasing 'vi' to 'vim' resolved the issue.
For reference:
To check if the version of vim that you are running has support for syntax highlighting, run :version from within vim. -syntax means no support, +syntax means it has support.
To create the alias, append alias vi='vim' to your ~/.bashrc or ~/.bash_profile
To re-source, type source ~/.bashrc or source ~/.bash_profile, whichever is appropriate for your setup.
One step you might be missing is to add
call pathogen#infect()
to your .vimrc file.
Src: http://www.vim.org/scripts/script.php?script_id=2332
I was getting this problem and I fixed it by issuing
cd ~/.yadr
git pull
rake update
I fix it ;)
Found this bug:
https://github.com/altercation/vim-colors-solarized/issues/104
cp ~/.vim/bundle/vim-colors-solarized/colors/solarized.vim ~/.vim/colors/
As Ryan Ransford said:
With the new version of vundle (Vundle.vim),
it appears as though "colorscheme solarized" must
come somewhere after "call vundle#end()".
This works for me!
I have the same issue and resolve it after moving color setting after call vundle#end() in ~/.vimrc
...
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
call vundle#end() " required
filetype plugin indent on " required
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endif

How to initialize sparkup plugin in Vim for MacOS?

Im new to Vim and am having trouble installing the sparkup plugin found at https://github.com/rstacruz/sparkup. I've copied the contents of the zip into the ftplugin folder and have tried to expand the div tag by pressing command e but appears.
Im stumped, any assistance would be appreciated
Make sure you have filetype detection enabled. That was the issue I ran into a while back on sparkup, with similar symptoms.
Try adding the following to your ~/.vimrc:
filetype indent plugin on
Most of the time, vim plugins come with specific help files, it does not seem to be the case for that one...
You can check the following things :
This a "file type" plugin : so it will only trigger when you are editing a *.html file. So make sure you're not doing your test on a new buffer but on a previously saved .html file.
Regarding your installation and the path of the sparkup files, make sure than sparkup.py and sparkup.vim are in ~/.vim/ftplugin/html (and not something like ~/vim/vim/ftplugin/html) or it won't work
Type :scriptnames it will list all loaded plugin : so somewhere in that list you should see sparkup.vim, if not it means it is not correctly installed or detected by Vim.
Regarding the shortcut to invoke sparkup, it seems to be <CTRL>e.
You can use vim version of Sparkup tailored for easy installation https://github.com/pyp/vim-sparkup.
With Pathogen
cd ~/.vim/bundle
git clone 'https://github.com/pyp/vim-sparkup.git'
With Vundle. Add this to .vimrc:
Bundle 'pyp/vim-sparkup'

Resources