Przeglądaj źródła

~/.vimrc: Supposedly better pasting and darkroom/focusmode

Lucas Stadler 14 lat temu
rodzic
commit
cc8ac44050
1 zmienionych plików z 23 dodań i 0 usunięć
  1. 23 0
      .vimrc

+ 23 - 0
.vimrc

14
set tabstop=3
14
set tabstop=3
15
set shiftwidth=3
15
set shiftwidth=3
16
set smarttab
16
set smarttab
17
set paste " keep indendation on paste
17
18
18
set number " With numbertoggle they're quite cool (I think)
19
set number " With numbertoggle they're quite cool (I think)
19
20
47
48
48
autocmd CursorMoved * :call g:setTextWidthInComments()
49
autocmd CursorMoved * :call g:setTextWidthInComments()
49
50
51
" via <http://paulrouget.com/e/vimdarkroom>
52
function! ToggleFocusMode()
53
  if (&foldcolumn != 12)
54
    set laststatus=0
55
    set numberwidth=10
56
    set foldcolumn=12
57
    set noruler
58
    set showtabline=0
59
    hi FoldColumn ctermbg=none
60
    hi LineNr ctermfg=0 ctermbg=none
61
    hi NonText ctermfg=0
62
  else
63
    set laststatus=2
64
    set numberwidth=4
65
    set foldcolumn=0
66
    set ruler
67
    set showtabline=1
68
    colorscheme solarized
69
  endif
70
endfunc
71
nnoremap F :call ToggleFocusMode()<cr>
72
50
au BufNewFile,BufRead *.{hs,lhs} set comments=:--,sr:{-,ex:-}
73
au BufNewFile,BufRead *.{hs,lhs} set comments=:--,sr:{-,ex:-}
51
au BufNewFile,BufRead *.rb set comments=:#,s:=begin,e:=end
74
au BufNewFile,BufRead *.rb set comments=:#,s:=begin,e:=end
52
au BufNewFile,BufRead *.{opa,trx} set filetype=opa shiftwidth=2 tabstop=2 expandtab
75
au BufNewFile,BufRead *.{opa,trx} set filetype=opa shiftwidth=2 tabstop=2 expandtab