dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 5419662ff87f920b1b732749175d561b39d03c87
parent 95c1b1c0b0d5e62b255f7e1efa8fae20fc6f524c
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date:   Tue,  3 Sep 2013 13:47:22 +0200

added some features from maximum-awesome

Diffstat:
M.vimrc | 172++++++++++++++++++++++++++++++++++++++-----------------------------------------
1 file changed, 83 insertions(+), 89 deletions(-)

diff --git a/.vimrc b/.vimrc @@ -1,16 +1,89 @@ " Include pathogen plugin manager +filetype on +filetype off execute pathogen#infect() +filetype plugin indent on -" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file. -filetype plugin on +" Disable vi-compatibility +set nocompatible -" Shortcut to reload .vimrc, leader is '\' +" Enable syntax highligting +syntax on + +" Select non-default syntax colorscheme. Found in /usr/share/vim/vim72/colors/ +colorscheme desert +set background=dark " adjust colors for better contrast + +" hilight column 80 +set textwidth=80 +set colorcolumn=+1 +hi ColorColumn guibg=#2e2e2e ctermbg=236 + + +set autoindent +set autoread " reload files when changed on disk +set backspace=2 " fix broken backspace in some setups +set backupcopy=yes " see :help crontab +"set clipboard=unnamed " yank and paste with the system clipboard +set encoding=utf-8 " Necessary to show unicode glyphs +set expandtab " convert tab char to spaces +set ignorecase " case-insensitive search +set incsearch " search as you type +set laststatus=2 " always show the statusline +set list " enable rendering of invisible characters +set listchars=tab:▸\ ,eol:¬ " Use symbols for tab and end-of-line +set number " set linenumbering ON as default +set pastetoggle=<F2> " toggle paste mode +set ruler " Enable bottom ruler +set scrolloff=3 " show context above-below cursorline +set shiftwidth=4 " width for autoindents +set showcmd +set smartcase " case0sensitive search if any caps +set softtabstop=4 " makes the tab key indent by four spaces +set tabstop=8 " a tab is 4 characters wide +set wildmenu " show a navigable menu for tab completion +set wildmode=longest,list,full + +" enable basic mouse behavior +set mouse=a +if exists('$TMUX') " support resizing in tmux + set ttymouse=xterm2 +endif + +" fix cursor in tmux +if exists('$TMUX') + let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\" + let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\" +else + let &t_SI = "\<Esc>]50;CursorShape=1\x7" + let &t_EI = "\<Esc>]50;CursorShape=0\x7" +endif + + +""" Keyboard shortcuts + +" Resize with <C-h>, <C-j>, <C-k> and <C-l> +map <C-h> <C-w>h +map <C-j> <C-w>j +map <C-k> <C-w>k +map <C-l> <C-w>l + +" Shortcut to reload .vimrc nmap <leader>r :source $MYVIMRC<CR> -" IMPORTANT: win32 users will need to have 'shellslash' set so that latex -" can be called correctly. -"set shellslash +" toggle spelling +nmap <leader>s :set spell!<CR> + +" toggle line numbering +nmap <leader>n :set number!<CR> + +" NERD Tree short cut +nmap <leader>d :NERDTreeToggle<CR> + +" Toggle TAB and EOL symbols +nmap <leader>l :set list!<CR> +""" Latex-Suite " IMPORTANT: grep will sometimes skip displaying the file name if you " search in a singe file. This will confuse Latex-Suite. Set your grep " program to always generate a file-name. @@ -21,74 +94,20 @@ set grepprg=grep\ -nH\ $* " The following changes the default filetype back to 'tex': let g:tex_flavor='latex' -" this is mostly a matter of taste. but LaTeX looks good with just a bit -" of indentation. -set sw=2 - " TIP: if you write your \label's as \label{fig:something}, then if you " type in \ref{fig: and press <C-n> you will automatically cycle through " all the figure labels. Very useful! set iskeyword+=: - -" Set linenumbering ON as default -set number - -" Enable bottom ruler -"set ruler - -" Enable syntax highligting -syntax on - -" Select non-default syntax colorscheme. Found in /usr/share/vim/vim72/colors/ -colorscheme desert - -" adjust colors for better contrast -set background=dark - -" allow backspacing over everything in insert mode -set backspace=indent,eol,start - -" note that the following rval is made by hitting ctrl-v and then backspace... -" " this remaps backspace to actualy BACKSPACE - not delete. -" set t_kb=ctrl-vBACKSPACE -fixdel - -set cindent -set smartindent -set autoindent - -" toggle paste mode -set pastetoggle=<F2> - -" NERD Tree short cut -map <F3> :NERDTreeToggle<CR> +""" Latex-Suite end " Spell check in mutt :autocmd FileType mail :nmap <F6> :w<CR>:!aspell -e -c %<CR>:e<CR> -" Map F7 and F9 to switch between tabs, F8 for new tab -map <F7> :tabp<CR> -map <F9> :tabn<CR> -map <F8> :tabe - -" toggle spelling -noremap <silent><F10> :set spell!<CR> - -" toggle line numbering -nnoremap <silent><F11> :set number!<CR> - -" Latex suite configuration -"let g:Tex_DefaultTargetFormat = 'pdf' -"let g:Tex_ViewRule_pdf ="/Applications/Skim.app/Contents/MacOS/Skim" -"let g:Tex_ViewRule_pdf ="open -a Skim" - -"highlight OverLength ctermbg=red ctermfg=white guibg=#592929 -"match OverLength /\%81v.\+/ +" Dictionary word completion using Ctrl-x Ctrl-k +" File from wordlist- (debian) or word- (arch) package +set dictionary+=/usr/share/dict/words " Vim Powerline -set nocompatible " Disable vi-compatibility -set laststatus=2 " Always show the statusline -set encoding=utf-8 " Necessary to show unicode glyphs "let g:Powerline_symbols = 'fancy' let g:Powerline_symbols = 'unicode' @@ -97,31 +116,6 @@ autocmd! BufNewFile,BufRead *.pde setlocal ft=arduino autocmd! BufNewFile,BufRead *.ino setlocal ft=arduino autocmd! BufNewFile,BufRead *.cuh setlocal ft=cuda -" Google Python style guide -set tabstop=8 " a tab is 4 characters wide -set expandtab " convert tab char to spaces -set softtabstop=4 " makes the tab key indent by four spaces -set shiftwidth=4 " width for autoindents -filetype indent on " automatic indent - -" Dictionary word completion using Ctrl-x Ctrl-k -" File from wordlist- (debian) or word- (arch) package -set dictionary+=/usr/share/dict/words - -" hilight column 80 -set textwidth=80 -set colorcolumn=+1 -hi ColorColumn guibg=#2e2e2e ctermbg=236 - -" Enable rendering of invisible characters -set list - -" Shortcut to rapidly toggle `set list`, leader is '\' -nmap <leader>l :set list!<CR> - -" Use the same symbols as TextMate for tabstops and EOLs -set listchars=tab:▸\ ,eol:¬ - "Invisible character colors highlight NonText ctermfg=8 guifg=DarkGray highlight SpecialKey ctermfg=8 guifg=DarkGray