Happy birthday VIM!

Vim turned 29 this day. Yay! I am a heavy vim user, it is my editor of choice in every operating system, however, I always installing some GUI editors as well (atom or sublime) for quick copy-paste tasks.

But this post is about vim.

I pretty much love it. I love the way how seamlessly it integrates into my daily workflow. I avoid using vim plugins and fancy configuration parameters, I try to keep it clean and easy. (Yes, I’ll share my .vimrc at the end of this post)

My normal workflow utilizes mostly the UNIX shell, I am rarely keep multiple files open – except I plan to copy-paste between two files. When I have to edit a file, I enter the work directory, open the file with vim, do my edits then save, and go for the next file. Sometimes I use ‘gf’ and ctrl+O to navigate between files, I often use sed like replacements inside files, and when I have to edit multiple files I am mostly use macro recording. And that’s it, I guess. The main part of my config is about how to colorize the output, what to do with the whitespaces, things like those. I keep vim plugin free because I can easily copy my .vimrc to any server I have to work on.

I never really understood anybody who use IDE when there’s an UNIX shell, but that’s only me, if you are somebody who loves that software: you have my blessings. Good for you.

Anyway, keep it going Bram, you are awesome.

Here is my .vimrc in case you are curious.

"
" Do not forget to create ~/.vim directory
"
set nocompatible " behave VIM not VI
set number " Line numbering
autocmd BufWritePre *.pp :%s/\s\+$//e " White spaces
autocmd BufNewFile,BufRead *.pp set filetype=ruby " ruby syntax highlight for puppet
autocmd BufNewFile,BufRead *.cf set filetype=yaml " yaml syntax highlight for cloudformation
autocmd BufNewFile,BufRead *.toml set filetype=dosini " ini syntax highlith for rust's toml files
syntax on " use syntax highlight
filetype indent plugin on " Indent files
set hidden " make able to switch between buffers without saving them
set showcmd " show current command
set showmatch " show matching brackets
set hlsearch " highlight searched words
set backspace=indent,eol,start " make able to use backspace in edit mode
set autoindent " turn on identing
set nostartofline " after G not ruin the last line
set ruler " Which column I am in?
set laststatus=2 " always display status line
set confirm " ask confirmation instead of failing when file is not saved
set cmdheight=2 " make enough space for display messages
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab " tab behaviour (spaces instead of tabs)
set wildmenu " use command line completion on opening filenames
set foldenable " use folds
set clipboard=unnamed " for OSX: if I copy lines to buffer, put them to the clipboard as well
set cul " highligh cursor's line
colorscheme peachpuff " colorscheme
set background=dark " I prefer dark terminal backgrounds
hi CursorLine cterm=NONE ctermbg=darkblue ctermfg=white guibg=darkred guifg=white " cursor line color
hi CursorColumn cterm=NONE ctermbg=darkblue ctermfg=white guibg=darkblue guifg=white " if cursors column is highlighted use these colors
set listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣ " use these symbols for whitespaces (works in my iterm)
nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>. " turn on cursor line
autocmd BufWinLeave *.* mkview " When exiting a file remember the opened line
autocmd BufWinEnter *.* loadview " When opening a file, move cursor to the previously opened position
augroup BgHighlight " When multiple buffers are open, show the cursor line only in the active window
autocmd!
autocmd WinEnter * set cul
autocmd WinLeave * set nocul
augroup END
view raw vimrc.vim hosted with ❤ by GitHub