Skip to content

Instantly share code, notes, and snippets.

@pfactum pfactum/.vimrc
Created Mar 25, 2015

Embed
What would you like to do?
.vimrc
set nocompatible
colorscheme ron
set background=dark
set noerrorbells
set novisualbell
set t_vb=
set tm=500
filetype plugin indent on
syntax on
set encoding=utf-8
set autoindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set wrap
set viminfo='20,<1000,s10,h
set history=1000
set number
highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
set showcmd
set wildmenu
set lazyredraw
set showmatch
set mouse=a
set pastetoggle=<F11>
set ignorecase
set smartcase
set incsearch
set hlsearch
nnoremap <leader><space> :nohlsearch<CR>
nnoremap <F10> :set invnumber<CR>
noremap <F12> :set list!<CR>
inoremap <F12> <Esc>:set list!<CR>a
function! SmartHome()
let first_nonblank = match(getline('.'), '\S') + 1
if first_nonblank == 0
return col('.') + 1 >= col('$') ? '0' : '^'
endif
if col('.') == first_nonblank
return '0'
endif
return &wrap && wincol() > 1 ? 'g^' : '^'
endfunction
noremap <expr> <silent> <Home> SmartHome()
imap <silent> <Home> <C-O><Home>
set laststatus=2
set statusline=
set statusline+=%-3.3n\ " buffer number
set statusline+=%f\ " file name
set statusline+=%h%m%r%w " flags
set statusline+=[%{strlen(&ft)?&ft:'none'}, " filetype
set statusline+=%{strlen(&fenc)?&fenc:&enc}, " encoding
set statusline+=%{&fileformat}] " file format
set statusline+=%= " right align
set statusline+=%{synIDattr(synID(line('.'),col('.'),1),'name')}\ " highlight
set statusline+=%b,0x%-8B\ " current char
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
set backup
set backupdir=~/.vim/tmp
set directory=~/.vim/tmp
set writebackup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.