Add toggle for vim for large files (performance issues with rnu/cul)

This commit is contained in:
Andrew Tomaka 2013-07-19 18:51:21 -04:00
parent 518fcb33d1
commit aecf5d1ad2

26
.vimrc
View file

@ -1,5 +1,5 @@
" Plugins " Plugins
set rtp+=~/.vim/bundle/vundle/ set runtimepath+=~/.vim/bundle/vundle/
call vundle#rc() call vundle#rc()
Bundle 'gmarik/vundle' Bundle 'gmarik/vundle'
@ -16,16 +16,16 @@ Bundle 'vim-scripts/ruby-matchit'
" Options " Options
set nocompatible " Disable vi compatibility set nocompatible " Disable vi compatibility
set ffs=unix,dos " File format prefer unix endings set fileformats=unix,dos " File format prefer unix endings
set eol " Add newlien at end of file set endofline " Add newlien at end of file
set shellslash " Forward slashes set shellslash " Forward slashes
set nobk " No backup files set nobackup " No backup files
set formatoptions=crq set formatoptions=crq
set textwidth=80 set textwidth=80
set laststatus=2 " Always show status line set laststatus=2 " Always show status line
set showmode " Show current mode set showmode " Show current mode
set history=100 " History length set history=100 " History length
set cul " Highlight current line set cursorline " Highlight current line
set nowrap " Disable wrapping by default set nowrap " Disable wrapping by default
set backspace=2 " Backspace over indent, eol, start of insert set backspace=2 " Backspace over indent, eol, start of insert
set hlsearch " Search highlights set hlsearch " Search highlights
@ -34,12 +34,11 @@ set incsearch " Search as yuo type
set ignorecase " Ignore case with search set ignorecase " Ignore case with search
set smartcase " Search will not ignore uppercase set smartcase " Search will not ignore uppercase
set showcmd " Show command as you type set showcmd " Show command as you type
set hls " Highlight search (hlsearch?)
set ruler " Show cursor position set ruler " Show cursor position
set autoindent set autoindent
set number " Show line numbers
set colorcolumn=80 " Ruler at line 80 set colorcolumn=80 " Ruler at line 80
set nomodeline set nomodeline
set relativenumber " Relative line numbers
" Tabs are 2 spaces " Tabs are 2 spaces
set tabstop=2 set tabstop=2
set softtabstop=2 set softtabstop=2
@ -66,7 +65,7 @@ imap <C-s> <esc>:w<CR>
let mapleader = "," let mapleader = ","
map <Leader>bi :BundleInstall<cr> map <Leader>bi :BundleInstall<cr>
map <Leader>nc :Nyancat<cr> map <Leader>lf :call LargeFileToggle()<cr>
map <Leader>s :e ~/Source/<cr> map <Leader>s :e ~/Source/<cr>
map <Leader>se :e ~/.vimrc<cr> map <Leader>se :e ~/.vimrc<cr>
map <Leader>sz :so ~/.vimrc<cr> map <Leader>sz :so ~/.vimrc<cr>
@ -83,3 +82,14 @@ hi SignColumn ctermbg=black
hi ColorColumn ctermbg=234 hi ColorColumn ctermbg=234
hi IndentGuidesOdd ctermbg=black hi IndentGuidesOdd ctermbg=black
hi IndentGuidesEven ctermbg=234 hi IndentGuidesEven ctermbg=234
" Functions
" Toggle relative line numbers and cursorline; useful for long line files
function! LargeFileToggle()
if &relativenumber
set number
else
set relativenumber
endif
set cursorline!
endfunction