Skip to main content

Posts

Showing posts with the label VIM

Installing Vim 7.2 in QNX 6.5 using pkgsrc

Installing Vim 7.2 in QNX 6.5 using pkgsrc QNX 6.5 self-hosted Neutrino host ships with vi but Vim 7.2 is a big imporovement over the default application. Below are the steps to install Vim 7.2 using pkgsrc. Download the bootstrap package http://archive.netbsd.org/pub/pkgsrc-archive/packages/QNX/i386/6.5.0_head_20110826/bootstrap.tar.gz Download Vim package and dependencies from the link below http://archive.netbsd.org/pub/pkgsrc-archive/packages/QNX/i386/6.5.0_head_20110826/All vim-share-7.2.446.tgz libiconv-1.14.tgz gettext-lib-0.18.1.1.tgz vim-7.2.446nb1.tgz Copy the files into /tmp using ftp, Momentics IDE, sftp, etc #: ls /tmp bootstrap.tar.gz vim-share-7.2.446.tgz libiconv-1.14.tgz gettext-lib-0.18.1.1.tgz vim-7.2.446nb1.tgz Install bootstrap package into the root folder #: tar -xvzf bootstrap.tar.gz -C / Add pkgsrc utilities into the path #: echo 'export PA

VI Editor common operations

My commonly used vi shortcut keys: Command Action Notes Basic operations :q Quit VI This will exit VI editor :q! Force quit This will exit VI editor even if buffers are dirty :w Save current buffer Save currently active buffer :e <ENTER> Reload current buffer from file :e /path/to/file Load /path/to/file to a buffer General :set nowrap Don't wrap text :set number Show line number :set nu Show line number (short hand) :set nonumber Hide line number :set nu! Hide line number (short hand) Text Operations v Start Visual Mode(for copying) y Yank/copy selected text yy Copy line 2y Copy 2 lines from the cursor p Paste _after_ the current line P Paste _before_ the current line x Delete char under the cursor dw Delete the word under the cursor This will also delete the space after it 3dw Delete 3 words This will also delete the space after it dd Delete line Deletes the entire line Navigation 0 Jump to beginning of line $ Jump to end of line w (count)M