who needs an IDE? All I need is Vim

I know that IDE’s exist, I’m no hermit. I’ve tried using Eclipse (also Easy) and I was a Kate user also. These editors have nice support for high level languages like Perl and Python… BUT I want my h,j,k,l shortcuts! If these IDEs have Vim key bindings, then maybe I’ll give it a second chance.

Don’t get me wrong, I’m not saying Vim is the “silver bullet” among editors. I’m just saying it’s the best one in my opinion, hehe. Learning it, shortcuts and all, is steep, but once you get the hang of it, I’m pretty sure you’ll understand why I think it’s the best one. Vim is hard to learn, but believe me, you won’t regret learning it.

Anyway, I just want to share my .vimrc (config file of Vim) for my fellow Vim users out there. I got the tips from Vim’s homepage, so they’re the ones who deserve credits.

set nu
set nowrap
set tabstop=4
set shiftwidth=4
set expandtab
set wmw=0
set guioptions=mic
set autoindent
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
set laststatus=2
set guifont=Bitstream\ Vera\ Sans\ Mono\ 12
set backupdir=~/.vimbackup,/tmp
syntax enable
colorscheme desert

" move to the righ/left window and maximize
"" nmap <c-h> <c-w>h<c-w><bar>
"" nmap <c-l> <c-w>l<c-w><bar>

nmap <c-h> :tabprev<CR>
nmap <c-l> :tabnext<CR>

" move the current line up or down
nmap <C-Down> :m+<CR>==
nmap <C-Up> :m-2<CR>==
" imap <C-Down> <C-O>:m+<CR><C-O>==
" imap <C-Up> <C-O>:m-2<CR><C-O>==

" move the current line left or right
" nmap <c-left> <<
" nmap <c-right> >>
" imap <c-left> <c-o><<
" imap <c-right> <c-o>>>

" move the selected block up or down
vmap <C-Down> :m'>+<CR>gv=gv
vmap <C-Up> :m'<-2<CR>gv=gv

" move the selected block left or right
vmap <C-Right> >gv
vmap <C-Left> <gv
vmap <Tab> >gv
vmap <S-Tab> <gv

If you want to use it, just copy and save it in a file named .vimrc inside your home directory if you’re using Linux. I forgot the exact location in Windows, hehe.

And here’s a link for a good cheat sheet and tutorial.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s