Skip to content

Instantly share code, notes, and snippets.

@hvmonteiro
Last active April 13, 2016 00:37
Show Gist options
  • Save hvmonteiro/11fea54401063fc0e2033fd0a3be8c58 to your computer and use it in GitHub Desktop.
Save hvmonteiro/11fea54401063fc0e2033fd0a3be8c58 to your computer and use it in GitHub Desktop.
Hvm's customized VIM configuration (file: ~/.vimrc)
"
" Author: Hugo Monteiro
" Description: Customized VIM settings with syntax checker using shellcheck and jshint (if installed)
" URL : https://gist.github.com/hvmonteiro/11fea54401063fc0e2033fd0a3be8c58
" Last Changed: 12-04-2016
" Notes: File to be used as ~/.vimrc
"
color desert
set nowrap
" Increase copY buffer maximum register size to 1000kb (20 = remember changes
" for the previously opened 20 files)
set viminfo='20,<1000
"##############################################################################
"" Easier split navigation
"##############################################################################
"
"" Use ctrl+<cursors> or ctrl-[hjkl] to select the active split window/panel!
"nmap <silent> <c-k> :wincmd k<CR>
"nmap <silent> <c-j> :wincmd j<CR>
"nmap <silent> <c-h> :wincmd h<CR>
"nmap <silent> <c-l> :wincmd l<CR>
nnoremap <silent> <C-Right> <c-w>l
nnoremap <silent> <C-Left> <c-w>h
nnoremap <silent> <C-Up> <c-w>k
nnoremap <silent> <C-Down> <c-w>j
set history=500
set statusline=%<%f%m%r%y%=%b\ 0x%B\ \ %l,%c%V\ %P
set laststatus=2 " always a status line
set encoding=utf-8
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax enable
set hlsearch
" colorscheme mycolors " Custom colors if the file/highlight file exists
endif
" Editor basics {{{
" Behave like Vim instead of Vi
set nocompatible
" Show the current cursor position
set ruler
" Enable syntax highlighting
syn on
" }}}
" Mouse {{{
" Send more characters for redraws
set ttyfast
" Enable mouse use in all modes
"set mouse=a
" Set this to the name of your terminal that supports mouse codes.
" Must be one of: xterm, xterm2, netterm, dec, jsbterm, pterm
set ttymouse=xterm2
" }}}
" size of a hard tabstop
set tabstop=4
"
" size of an "indent"
set shiftwidth=4
"
" a combination of spaces and tabs are used to simulate tab stops at a width
" other than the (hard)tabstop
set softtabstop=4
"
" make "tab" insert indents instead of tabs at the beginning of a line
set smarttab
"
" always uses spaces instead of tab characters
set expandtab
"
"
"For Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" For JAvaScript using JSHint
let g:syntastic_javascript_checkers = ['jshint']
" Vundle
set nocompatible " be iMproved, required
filetype off " required
"set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
"
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"
"
Plugin 'syntastic'
Plugin 'shellcheck'
call vundle#end() " required
filetype plugin indent on " required
"
@hvmonteiro
Copy link
Author

It uses:

  • vundle
  • syntastic
  • shellcheck (syntax checker for bash scripts)
  • jshint (syntax checker for javascript)
  • soft-\tabs aka \spaces
  • 4 tabs idents
  • smart idents
  • status lines
  • uses mouse (if running under an 'xterm' compatible terminal/tty)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment