Skip to content

Instantly share code, notes, and snippets.

@nejni-marji
Created April 9, 2015 20:26
Show Gist options
  • Save nejni-marji/31356f3cc39c695e9c2a to your computer and use it in GitHub Desktop.
Save nejni-marji/31356f3cc39c695e9c2a to your computer and use it in GitHub Desktop.
Vim
" {{{ autocommands
" This must be first because all other autocommands are loaded after it.
autocmd!
" spell check when not code
au syntax * if &syntax == " " | set spell | else | set nospell
" exiting insert mode when idle
autocmd CursorHoldI * stopinsert
autocmd InsertEnter * let updaterestore=&updatetime | set updatetime=10000
autocmd InsertLeave * let &updatetime=updaterestore
" line and column highlight in active window
au WinLeave * set nocursorline nocursorcolumn
au WinEnter * set cursorline cursorcolumn
" }}}
" {{{ airline
execute pathogen#infect()
let g:airline#extensions#tabline#enabled=1
set laststatus=2 " Makes airline bar show up with last window
set ttimeoutlen=50 " Fixes lag on return to NORMAL
" }}}
" {{{ mappings
let mapleader = "\t"
noremap <leader>v :source ~/.vimrc<CR>
noremap / :set incsearch hlsearch<CR>/
noremap <leader>h :set hlsearch! hlsearch?<CR>
noremap <leader>s :set spell! spell?
noremap <leader>l :set list! list?<CR>
noremap <leader>w :set list nowrap<CR>
noremap <leader>W :set nolist wrap<CR>
" }}}
" {{{ misc
" moving around, searching and patterns
set ignorecase
set smartcase
" multiple windows
set hidden
set splitbelow
set splitright
" tabs and indenting
set autoindent
" folding
set foldlevelstart=10
set foldmethod=marker
" command line editing
set wildmenu
" }}}
" {{{ visuals
set number
set scrolloff=10 sidescrolloff=5
set listchars=tab:>-,trail:~,extends:>,precedes:<
set linebreak
set cursorcolumn cursorline | highlight cursorcolumn ctermbg=darkgrey | highlight cursorline cterm=none ctermbg=darkgrey
highlight spellbad ctermbg=none cterm=bold,underline
syntax enable
let loaded_matchparen=1 " Disabling that stupid parentheses highlighting
" }}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment