Hacker News new | comments | show | ask | jobs | submit login
Textmate To Vim: 100 Textmate keyboard shortcuts translated to VIM (jackkinsella.ie)
47 points by jackkinsella on Sept 5, 2011 | hide | past | web | favorite | 15 comments



I found NERTree really akward and was one of the reasons why I originally had trouble switching to VIM from textmate.

Its best to use something like PeepOpen, command-t, fuzzyfinder to open files. If you want tree structure I just use terminal and aliased:

  alias l='ls -AlGFh'
Or use the vim directory navigation.

VIM also looks much nicer with just a single file open. The left panel for NERDTree looks hacky.


I use NERDTree and quite like it, but I never keep it open. I have :NERDTreeToggle mapped to <Leader>f, so if I need to open a file I can quickly press `,f`, find the file and then press `,f` to close NERDTree. One thing I find annoying about this is that in MacVim, NERDTree creates a scrollbar in the left hand side of the window that I can never seem to get rid of.

Once the files are open, I tend to use buffers, splits and tabs to navigate between them. NERDTree is just used to load a file into a Vim buffer. Also note that the NERDTree explorer replaces the default vim file explorer.

I heard good things about Command-T though, maybe I'll try that and see if it works better with my workflow than NERDTree.


You can remove the left hand scrollbar by setting this command:

    " This removes the left hand scrollbar from the current guioptions.
    :set guioptions-=L
Check out :help guioptions for more. I've set up my vim so I don't have any scrollbars.


Is there somewhere to suggest comments? The information is quite useful but I think there may be some more idiomatic shortcuts in certain cases. For example, isn't :w FILENAME the equivalent of "Save As"? And perhaps it would be good to show commands that are OS-agnostic like :tabnew for a new tab?

Regardless, I think this is a useful resource and I'd love to have a cheat sheet with it. Thanks!


If you suggest improvements here I will make the modifications. I just changed :saveas filename to :w filename

OS-agnostic methods are outside the scope of the guide, which is only intended for those coming from Textmate, implying that they are on a Mac. If I were to accommodate everyone it would get too messy to fulfill its primary purpose. The single responsibility principle applies equally to tutorials.


:w FILENAME will save a file without changing the filename of the current buffer, while :sav FILENAME will update the filename (so that future :w will go to the new file, rather than the old one). I think :sav is the right one for that shortcut.


Interesting! Thanks for the clarification and I definitely agree that :sav FILENAME is a more accurate Save File As... than :w FILENAME.


If you are going textmate to Vim you should really just go straight to Vico. It's essentially the perfect editor ( for me ): Textmate look/feel/bundles but vim keybinds down to the most esoteric corners.

http://www.vicoapp.com/


a couple of mistakes and comments:

* "File>new" can be done by ':enew'

* top of the file is 'gg' and not just 'g'

* bottom of the file is 'G' and not 'GG' ;)

* in addition to ':20<CR>' you can use just '20G' to go to line 20

* to sort all of the file use ':%!sort<CR>', no need to use '0,$'


Thanks for the feedback; I've just made the improvements. The gg G mixup was a nasty little typo.


Sorry, off topic. But the red design of the tables is awful.


I'm happy to modify it if you can suggest improvements. I don't have the greatest eye for design.


I am not a design expert either. But red tables on dark background feel uncomfortable for eyes when you are in a dark room. I'd suggest to make them darker (which will also add some contrast to the white text) and to use a more neutral color.


You're right; the red was too loud.

I changed the background to a light purple and switched to plain black text. Do you find it easier to read?


Yes. I think this is better.

PS Unfortunately, now the contrast between table cells is almost lost. Don't know if it was intended.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: