Skip to content

Instantly share code, notes, and snippets.

/-

Created September 28, 2015 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/044d9cf6a35200ffa845 to your computer and use it in GitHub Desktop.
Save anonymous/044d9cf6a35200ffa845 to your computer and use it in GitHub Desktop.
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
augroup resCur
autocmd!
autocmd BufReadPost * call setpos(".", getpos("'\""))
augroup END
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