Skip to content

Instantly share code, notes, and snippets.

@cronnelo
Last active January 15, 2016 10:03
Show Gist options
  • Save cronnelo/743fd861bcd652e50165 to your computer and use it in GitHub Desktop.
Save cronnelo/743fd861bcd652e50165 to your computer and use it in GitHub Desktop.
cronnelo .vimrc setup
execute pathogen#infect()
filetype plugin indent on
""""""""""""""""""""""""""
" => Mappings
""""""""""""""""""""""""""
let mapleader=","
" make jk do esc
inoremap jk <Esc>
" make esc do nothing
inoremap <Esc> <Nop>
nnoremap <leader><space> :nohlsearch<CR>
" Shortcut to rapidly toggle `set list`
nmap <leader>l :set list!<CR>
set listchars=tab:▸\ ,eol:¬,nbsp:.
""""""""""""""""""""""""""
" => basic
""""""""""""""""""""""""""
set textwidth=79
" Always show current position
set ruler
" Display line numbers on the left
set number
" Ignore case when searching
set ignorecase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" Show tabs and spaces
set list
""""""""""""""""""""""""""
" => Colors and Fonts
""""""""""""""""""""""""""
" Enable syntax highlighting
syntax enable
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
set showmatch "highlight matching [{()}]
" solozarized options
let g:solarized_termcolors=256
set background=dark
colorscheme solarized
"""""""""""""""""""""""""""""
" => Files, backups and undo
"""""""""""""""""""""""""""""
" Turn backup off, since most stuff is in SVN, git etc., anyway...
set nobackup
set nowb
set noswapfile
"""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""
" make "tab" insert indents instead of tabs at the beginning of a line
set smarttab
" On pressing tab, insert 4 spaces
set expandtab
" when indenting with '> | <', use 4 spaces width
set shiftwidth=4
" show existing tab with 4 spaces width
set tabstop=4
" sets the number of clumns for a TAB
set softtabstop=4
set autoindent
set smartindent
set wrap "Wrap lines
set noswapfile
""""""""""""""""""""""""""""""
" => Visual mode related
""""""""""""""""""""""""""""""
" Visual mode pressing * or # searches for the current selection
" Super useful! From an idea by Michael Naumann
vnoremap <silent> * :call VisualSelection('f')<CR>
vnoremap <silent> # :call VisualSelection('b')<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Moving around, tabs, windows and buffers
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Smart way to move between windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
set wildmenu
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" let g:syntastic_javascript_checkers = ['eslint']
" 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
let g:NERDTreeShowHidden = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment