I'm using mac, and I'm in search for a new free editor to use. I'm familiar with vi from college days a bit rusty with the Vi commands.
Can someone tell me, what is a good free vi editor to use on a mac, and a good link to top vi commands?
type brew install macvim into a terminal (or install macvim some other way)
This will install macvim on your computer, which you can now use by typing vim in a terminal.
type vimtutor in a terminal to start a guide on how to use vim,
or whilst inside vim, type :e /usr/share/vim/vim74/tutor/tutor to open to open the guide.
I suggest you using NeoVim as I'm daily using it. Because of:
Simplify maintenance and encourage contributions
Split the work between multiple developers
Enable advanced UIs without modifications to the core
Maximize extensibility
I think NeoVim is the most active project which bases on Vim and it is free for sure: https://github.com/neovim/neovim
For the tutorial, the easiest way is type vimtutor on the terminal, all the commands you need are there.
Related
I hope this question is suitable for this forum, I'm still learning what's deemed fit and what isn't. Anyway here is my question, a lot of places seem to state I need to install homebrew on my mac to install rails, do I really need to and what benefits does it offer to do so and for the development environment?
This question is pretty bad but I remember when I started programming that I had a similar question, so here we go:
How do you install stuff on your computer? Obviously you use the Mac App Store if you want something from Apple, and if you want to install Chrome just go the Google Chrome website etc.
But when you want some kind of programmer tool, let's say a compiler. How do you install this? Either you go to their website, download a tarball with the source code, compile it from scratch and bind the necessary environment variables. Or you are unlucky and the compiler has a bunch of dependencies so you have to download them first.
Then some geniuses thought that "Oh damn, that's a pain", so instead they created so called package managers, so now when I want Rails on my computer, I just installed it through the "gem" ruby package/dependency manager.
So you can install rails through the command "gem" (just google "ruby gem") and you'll see what it is, but I advise you to if you want to have a nice development environment where it's easy to install and uninstall stuff, use brew or macports.
I am new to vim, and I just followed this setup tutorial, but something went wrong. I am a ruby developer and I am not getting a a ruby highlighting syntax. I have installed janus, before with pathogen I had syntax highlighting but not know.
Also I am using the solarized theme the guy suggested but there is no difference now (in color) between folders and files in my terminal when listing a directory.
Could somebody tell me if I can install pathogen with janus? WIll this break my vim?
Thanks!
Don't install anything (and don't install Janus).
Run $ vimtutor in your terminal. As many times as needed (and don't install Janus).
Once you feel ready to use Vim for day-to-day coding, install MacVim which is built with a better feature set than the default Vim. It comes with a CLI executable so you can use it in your terminal and in tmux (and don't install Janus).
Install the vim-ruby package for better, more up-to-date Ruby support (and don't install Janus).
Don't install Janus. This thing is a pile of crap that will make your life overly complicated, hook you on plugins that may or may not be the best for you needs and prevent you from actually learning Vim properly in exchange of an artificially flattened learning curve.
Decide for a plugin/runtimepath management solution (VAM, vundle or plain Pathogen) and choose your plugins yourself according to your needs (and don't install Janus).
If you have problems with Solarized, take a look at their issue tracker and their wiki. It is fragile and you need some work to set it up correctly (and… you know the rest).
What is the preferred method of exporting a homebrew environment so I can synchronize my workspace between computers? Seems like there should be something similar to composer.lock or pip freeze. Is there a better way than brew list > brews.txt?
There is a better way: brew leaves.
This command prints a simple list of installed formulae which are not dependencies of any other formulae. Essentially this lists everything that was manually installed or is a leftover dependency from a removed formula.
$ brew leaves
apple-gcc42
bash-completion
brew-cask
git
[...]
There's no built-in means of using brew leaves output to install, but just having a clean list of manually-installed formulae is a step in the right direction.
Thanks to this Gabe Berke-Williams for writing about this: http://robots.thoughtbot.com/brew-leaves
Homebrew Bundle seems like a pretty great solution.
There is not a better way, and there are no current plans to make one.
Source: https://github.com/mxcl/homebrew/issues/17771
Use git! Maintaining repos for environment setup scripts is a pretty slick approach.
I highly recommend using a script to set up a development environment in the first place. thoughtbot has a really lightweight approach that provisions a development environment, including a bunch of brew formulas. https://github.com/thoughtbot/laptop. GitHub just open sourced boxen for this (and much more), but it has a somewhat steeper learning curve.
As you can see from the thoughtbot/latop readme, the entire install is a one-liner. If you want different packages, fork the repo and add whatever you use. This only covers the initial install, but it is a fantastic start.
For ongoing synchronization of development environments, including updating your preferred homebrew setup, you might want to try a 'dotfiles' approach. Zach Holman has a great approach detailed here: https://github.com/holman/dotfiles
If you want to tweak or update anything, just make the appropriate changes to the script (holman's dot script does the ongoing update stuff). Commit, push, pull down from any other environments.
I have made the move from TextMate to VIM. I can not use macvim, policy at work does not allow me to install it. I have tried installing command-t to give me "go to file" functionality. However as I am using VIM with the osx terminal, when I press command-t it opens a new tab.
I have now decided to try FuzzyFinder but can not figure out how to search across a directory recursively for a file with it, could anyone show me how to go to a file like command-t but using FuzzyFinder. :-/
Command-T describes its intended use inside MacVim. If you want to use it inside terminal Vim, use the default binding <Leader>t (by default, <Leader> is the backslash key). You can remap this in your Vim config if you'd rather use a modifier key binding.
Fuzzy finder is not under active development. You're way better off with the awesome Command-t. The problem is terminal Vim does support it because terminal Vim needs to be built with Ruby support. It's fairly straightforward to build Vim from source to enable this.
http://brilliantcorners.org/2011/02/building-vim-on-osx-snow-leopard/
Guide for Snow Leopard but works for Lion too. You'll need to have XCode installed, not just the GCC compiler.
You could map it to ctrl or shift easily, which won't conflict with your OS like command, via:
nmap <C-t> :CommandT<CR>
# or
nmap T :CommandT<CR>
In normal fuzzyfinder to search through a directory you can use file globs, like **, e.g., at the fuzzyfinder prompt:
>File>**/yourpattern
Will search all directories under the current directory for your pattern. Just be wary not to try to do that on large filesystems, or you're going to be waiting a while and/or running out of memory. It will index the tree in memory after the first search though, and will be faster afterwards.
I find that browsing source code of open source libraries being used in projects is invaluable. Unfortunately, I find this difficult when developing with ruby on rails. I am accustomed to working inside IDE's that allow me to jump to the definitions of symbols, regardless of whether they are part of an external library.
I use Aptana Studio 3 on Mac OS X to develop, but would be willing to change IDEs for this feature.
I have explored https://github.com/fnando/gem-open as an option, but have yet to find a good editor to integrate this with. Can anyone recommend one? Anyone else have a good method for browsing the sources of gems?
Aptana Studio 3 has a command line launcher: studio3.
Add the following to your ~/.bash_profile:
export PATH="/Applications/Aptana Studio 3:$PATH"
export GEM_EDITOR="studio3"
Reload your existing shell environment: . ~/.bash_profile and then you can use gem-open with your preferred editor: gem open rails