diff --git a/.vimrc b/.vimrc index 09de3c6..def50fe 100644 --- a/.vimrc +++ b/.vimrc @@ -83,6 +83,7 @@ set undolevels=1000 " highlight search results set hlsearch +" show tabs and spaces set list set listchars=tab:>··,trail:· @@ -169,11 +170,13 @@ augroup json_macros " { autocmd FileType json :nnoremap fm :%!python -m json.tool augroup END " } +" Haskell augroup haskell_stuff " { autocmd! autocmd BufNewFile,BufRead *.hsc set ft=haskell augroup END " } +" C augroup c_stuff " { autocmd! autocmd BufNewFile,BufRead *.h set ft=c @@ -203,9 +206,23 @@ endfunction noremap g :call GrepAskForDir(expand("")) +function SetIdentWidth() + call inputsave() + let l:width = input('Set ident: ') + call inputrestore() + if l:width=='' + set tabstop=8 shiftwidth=8 noexpandtab + else + let l:numw = str2nr(l:width, 10) + execute 'set softtabstop=' . l:numw . ' shiftwidth=' . l:numw . ' expandtab' + endif +endfunction + +noremap i :call SetIdentWidth() + " Automatically user relative lines when not in insert mode -au InsertLeave * :set relativenumber -au InsertEnter * :set norelativenumber +" au InsertLeave * :set relativenumber +" au InsertEnter * :set norelativenumber " Syntastic settings @@ -234,3 +251,7 @@ noremap h :nohlsearch if executable('ag') let g:ackprg = 'ag --vimgrep' endif + +digraphs \- 8866 +digraphs -\ 8867 +