Troubleshooting
Vim has a problem with
getting the correct path in OSX.
This leads to it using system Ruby
if you run :!rake test
.
To fix,
run the command:
sudo chmod ugo-x /usr/libexec/path_helper
Blog posts, links, etc.
- Vim Awesome - Search for vim plugins
- Vim and Ctags
- Vim Splits - Move Faster and More Naturally
- Vim as your IDE
- Clipboard sharing in OSX
- Mapping keys
- Vim, Tmux and system clipboard
- Extending Rails.vim with custom commands
- An Extremely Quick and Simple Introduction to the Vi Text Editor
- Vim for Rubyists
- Vim Revisited, a post by Mislav Marohnić
- Vim After 11 Years
- Best of Vim Tips
- Supercharge Your Vim Into an IDE With Ctags
- Vim for Elixir
- Configuring Vim Right
Screencasts
Other vim implementations
Books
Videos:
- Ben Orenstein - Write code faster: expert-level vim (Railsberry 2012)
- tpope’s vim config and plugins
- Impressive Ruby Productivity with Vim and Tmux by Chris Hunt
- Vim for Rails Developers
Vimscript
function HelloWorld()
echo "Hello, world!"
endfunction
call HelloWorld()
function ReturnSomethign()
return "Something"
endfunction
echo ReturnSomethign()
function Foo()
endfunction
" Returns 0 by default
function TooBigEh(foo)
if a:foo > 10
return 1
end
endfunction
" Returns 1 if cond matches, falls back to 0 otherwise
" a:foo is for variable scoping - tells vimscript that it's the argument foo
" Truthiness
" 'hey' is coerced in to 0, so falsey
" '8 hello' is coerced to 8 because it starts with a number, so truthy
" Local vars
function Foo()
let bar = 'baz'
return bar
endfunction
" Match url in the following line:
" foo bar http://hello.baz hai
" Matches string starting with http, until it runs into spaces
matchstr(getline('.', "http[^ ]*"))