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
"
setnocompatible" behave VIM not VI
setnumber" Line numbering
autocmdBufWritePre*.pp :%s/\s\+$//e" White spaces
autocmdBufNewFile,BufRead*.ppsetfiletype=ruby" ruby syntax highlight for puppet
autocmdBufNewFile,BufRead*.cfsetfiletype=yaml" yaml syntax highlight for cloudformation
autocmdBufNewFile,BufRead*.toml setfiletype=dosini" ini syntax highlith for rust's toml files
syntaxon" use syntax highlight
filetypeindentpluginon" Indent files
sethidden" make able to switch between buffers without saving them
setshowcmd" show current command
setshowmatch" show matching brackets
sethlsearch" highlight searched words
setbackspace=indent,eol,start" make able to use backspace in edit mode
setautoindent" turn on identing
setnostartofline" after G not ruin the last line
setruler" Which column I am in?
setlaststatus=2" always display status line
setconfirm" ask confirmation instead of failing when file is not saved
setcmdheight=2" make enough space for display messages
settabstop=4softtabstop=0expandtabshiftwidth=4smarttab" tab behaviour (spaces instead of tabs)
setwildmenu" use command line completion on opening filenames
setfoldenable" use folds
setclipboard=unnamed" for OSX: if I copy lines to buffer, put them to the clipboard as well
setcul" highligh cursor's line
colorscheme peachpuff" colorscheme
setbackground=dark" I prefer dark terminal backgrounds
hiCursorLine cterm=NONE ctermbg=darkblue ctermfg=white guibg=darkred guifg=white" cursor line color
hiCursorColumn cterm=NONE ctermbg=darkblue ctermfg=white guibg=darkblue guifg=white" if cursors column is highlighted use these colors
setlistchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣" use these symbols for whitespaces (works in my iterm)
nnoremap<Leader>c :setcursorline!cursorcolumn!<CR>." turn on cursor line
autocmdBufWinLeave*.*mkview" When exiting a file remember the opened line
autocmdBufWinEnter*.*loadview" When opening a file, move cursor to the previously opened position
augroupBgHighlight" When multiple buffers are open, show the cursor line only in the active window