Tag Archives: editor

VIM buffer commands

Commands from vim buffers can take long to get into our brains. Practice will lead to perfection… eventually.

Here are some tips to get them into memory faster:

Editor commands:    
  :e filename - Edit a file an existing file in a new buffer
  :sp filename - Open a file in a new buffer and split window
  :vs or :vsp Open a file in a new buffer and split window vertically 
  ctrl+ws - Split window to work in two places of the same file
  ctrl+wv - Split window vertically (and work in the same file)

Navigation commands:
  :bnext (or :bn) - go to next buffer
  :bprev (of :bp) - go to previous buffer
  :bd - delete a buffer (close a file)
  ctrl+ww - switch between windows
  ctrl+wq - Quit a window
    

With pictures to decorate this post:

vim_example1_call

Open up a new file called ‘example1’

vs_example2

With ‘example1’ open, type in ‘:vs example2’ to vertically split the window and edit a new file ‘example2‘. It will open up a new buffer to the left of ‘example1’

sp_example3

From the ‘example2’ buffer, type in ‘:sp example3’ to horizontally split the screen and edit a new file ‘example3‘. It will open a new buffer above ‘example2’

example3_text

All three buffers displayed. Use CTRL-W+W to cycle through them.

Cheers!

Reference: http://www.worldtimzone.com/res/vi.html

Advertisements

Hide .gitignore files in Atom Tree view

I have been using Atom as my coding editor for almost a year now. As a Python developer, the *.pyc files often bugged me whenever I ran my code.

Adding those files in the .gitgnore file did not prevent them to show up in the tree view and hiding them from the Atom menus was not as much intuitive as I would guess at first, so I had to dig a little further.

To hide all files included in the .gitignore file:

atom_hide_3

Image1: find the ‘tree-view’ package and press Settings to enter the preferences of the package.

atom_hide_1

Image2: Scroll down to see the preference options.

atom_hide_2

Image3: Check the “Hide VCS ignored files” checkbox.

You may now see your tree view free of unwanted files.

I hope it helps.

Cheers!