bloc referral

If you are interested in learning to code with a mentor, try bloc and get $100 off.
Showing posts with label VIM. Show all posts
Showing posts with label VIM. Show all posts

Tuesday, February 3, 2015

I can open web pages in vim

I feel as if each day I use vim I use the trackpad even less. I just discovered about the command to open chrome and open specific webpages. I will be having a lot of fun with this, but thought I should share. 

My leader key is spacebar, so all I need to do is hit "spacebar + ggg" and out pops chrome which will be automatically directed to google.com

" open web pages in vim "
nmap <leader>ggg :! open -a "/Applications/Google Chrome.app" 'http://google.com/'<CR>






*Note: I know you can do the same in Alfred, but this is VIM!

Friday, January 9, 2015

VIM indent all the way to Oz

I am have been using VIM since Thanksgiving and definitely not looking back to Sublime. I really do believe that the myth that VIM is this big mystery/archaic of programming is not real. It's similar to the Wizard of Oz, where everyone thinks Oz is this great and powerful being and when it is all said and done, its turns Oz is a short white dude behind a curtain, but that short white dude is you just installing plugins into your dotfiles.

One thing I did miss with common IDE's like Sublime, is the ability to hit `command + [`for quick line indentation. Well it turn out getting that back was easy, all I had to do was add the following to the bottom of my .vimrc, voila.

Remember, If you can dream it, you can do it in VIM.

nmap <D-[> <<
nmap <D-]> >>
vmap <D-[> <gv
vmap <D-]> >gv
Take the plunge and try vim today but typing "vimtutor" in your unix terminal.


Thursday, December 4, 2014

My VIM config

This is a copy of my current .vimrc. Do you have any suggestions?

2 weeks and nothing but VIM

I decided that the 2 days prior to my Thanksgiving holiday would be a great time to switch to VIM at work and I admit it was stuff not to pull up Sublime text for specific things. One of the most common reasons I have heard for not learning VIM is the need to not loose time for switching workflows; This concern is understandable, but the only way to learn is by doing.

The past two weeks have been packed with learning how to update my .vimrc and making sure I have the most common plugins installed.

Right away I missed some of the most common shortcuts in sublime text, like quick indenting and commenting. Thanks to the Nerdtree and my custom key mappings I can still use them. I also finally figured out what a <leader> which has greatly assisted in mapping special commands to.  

Some of things I look forward to learning is finally figuring out how to do project wide search properly, at moment the rails-vim commands and accessing the buffer tree have been great additions to my workflow. In addition to all that I hope to learn how to run test directly from vim with a mapped key command, but like all things, I have to pace myself in learning; I am desperately trying not to spend my entire day learning cool tricks - I still work to do.

*update - thanks to @tracehelms I was able to solve my project searching issue.


Tuesday, December 2, 2014

Copy current file path in VIM

I found a vim shortcut to grab the file current path and copy it to the system clipboard.  I wrote a blog post in the past about key bindings in sublime, and my favorite key binding which has the same path grabbing functionality.

The .vimrc can the host the same type snippets that sublime, but obviously in a different syntax. I am pretty excited to add this to vim with it being one of the two thing I miss from sublime. The last thing I miss is not really a missing functionality but just my lack of knowledge and that is project wide searching, but I believe with a little practice I can figure it out.

If you have any pointers in working with let me know.

Monday, November 24, 2014

git commit -v

Everyday I use vim I get a little better at it, and actually surprised on how fast I have progressed this past week. My hesitation to jump right in was unfortunately the only thing preventing me from really learning it.

The best that help break my timidness in vim was writing my commit messages us the vim IDE. The common way of commit work is using `git commit -m`, but I recently found out about `git commit -v` from an upcase video; Rather than set your message per commit, you are able view the `git diff` and add a commit message while viewing what you changed.

I highly recommend viewing the diff before you create commits, it will help you catch misspellings and prevent debuggers from getting in a pull request.


Wednesday, November 12, 2014

My Baby Steps into VIM

I have spent a lot of time attempting to complete the challenging Vim-Adventures, but have found solving the integrated puzzles more challenging actually learning VIM. I am actually still stuck on level 9, I found I needed to learn VIM faster and actually completed vimtutor twice.

Vim-Adventures is definitely one of the best ways to learn muscle memory, as you tend to learn how to move around without even thinking about it. The vimtutor tutorial is definitely one of the best tutorials and covers a lot in a short amount a time. I imagine you can complete the entire tutorial in less than an hour on your first run through.

The entirety of my VIM learning was completed while running the test suite at work, which unfortunately takes about 30mins each time (something we are working on in making better). I decided last week that after spending 2 months learning VIM in small spurts, it was time to actually start using it.

I got a very brief walkthrough after my last TDD  practice session. I got to see tmate.io (actually tmux and not vim, but still a cool tool) working in the wild and even install the JANUS VIM package. Last week I attempted to work on a feature using VIM but quickly found out despite my extensive research and practice, the previous tutorials do not have sections on working through the file system.

I moved on to learning through the free Vimcast and Vim Novice Tutorials which has helped in learning the VIM workflow, like splitting windows and entering and exiting the file system.

I am not yet ready to use VIM at work but I have been working through the Javascript Koans. I am finding that koans is a nice and safe way to learn how much I would rather be using VIM at work. My goal is to switch over when I complete the the entirety of the Koans and become a little more proficient.

If you are at any level interested in try out VIM, either type vimtutor in your terminal or checkout Vim-Adventures. Warning, once you get the initial muscle memory down, you might get addicted.


Monday, July 7, 2014

Ember and VIM tutorial

Staying true to my goals I have started the Ember tutorial. I am only half and can't really report on it at the moment, but I do have to say its nice to go through a tutorial on a framework and understand everything that is going on. Ember is a MVC framework, which operates very similar to Rails and with my background in that framework has made it super easy to breeze through this tutorial.

On another note, I typed `vimtutor` in my terminal and got a pretty cool initiation to VIM. I didn't even know it was there but as many recommend, I think you should give it a try. There will be a day when you will have to interact with VIM, just make sure you know that `j` will move the cursor down.