Mostly window width/height stuff

* Default is now equal distribution, as I was using windows for what
tabs are usually for.
* Vim 8.0 indentation features are now used when available
This commit is contained in:
Talia 2017-11-16 14:09:18 +01:00
parent 28709c0cf9
commit bbf97daec6
2 changed files with 15 additions and 12 deletions

1
gvimrc
View file

@ -1,5 +1,6 @@
set guioptions-=T set guioptions-=T
set guioptions-=m set guioptions-=m
set guioptions-=e
let g:colors=['slate', 'desert', 'blue', 'ron', 'elflord', 'murphy', 'torte'] let g:colors=['slate', 'desert', 'blue', 'ron', 'elflord', 'murphy', 'torte']
function! Randomcolor() function! Randomcolor()

24
vimrc
View file

@ -77,7 +77,13 @@ set wrap
au BufEnter,BufRead * set linebreak au BufEnter,BufRead * set linebreak
set breakat=\ .,{ set breakat=\ .,{
set display+=lastline set display+=lastline
if v:version>=800
set breakindent
au WinNew * set breakindentopt=sbr
set showbreak=.\
else
set showbreak=+->\ set showbreak=+->\
end
set listchars=eol,tab:»\ ,trail:.,nbsp:. set listchars=eol,tab:»\ ,trail:.,nbsp:.
set cursorline " Highlight cursor line set cursorline " Highlight cursor line
@ -247,8 +253,8 @@ noremap x "_x
noremap <leader>x x noremap <leader>x x
" --- Numbvers --- " --- Numbvers ---
nnoremap <leader>] <C-x> nnoremap <leader>- <C-x>
nnoremap <leader>[ <C-a> nnoremap <leader>= <C-a>
" --- MOVEMENT --- " --- MOVEMENT ---
nnoremap j gj nnoremap j gj
@ -413,7 +419,8 @@ function! s:GrepOperator(type)
endfunction endfunction
" Window Height stuff " Window Height stuff
command! Equal call Equal() command! EqualH call Equal()
command! -nargs=1 WinHeight call SetWinMinHeight(<f-args>)
function! Equal() function! Equal()
set winminheight=0 set winminheight=0
set winheight=1 set winheight=1
@ -428,18 +435,16 @@ function! SetWinMinHeight(num)
endif endif
execute "set winheight=".9999 execute "set winheight=".9999
endfunc endfunc
call SetWinMinHeight(2) " call SetWinMinHeight(2)
function! AddWinMinHeight(num) function! AddWinMinHeight(num)
let a:new = &winminheight + a:num let a:new = &winminheight + a:num
call SetWinMinHeight(a:new) call SetWinMinHeight(a:new)
set winminheight? set winminheight?
endfunc endfunc
nnoremap <leader>= :call AddWinMinHeight(1)<cr>
nnoremap <leader>- :call AddWinMinHeight(-1)<cr>
nnoremap <leader>0 :Equal<cr>
" Window Width Stuff " Window Width Stuff
command! EqualW silent! call EqualW() command! EqualW silent! call EqualW()
command! -nargs=1 WinWidth call SetWinMinWidth(<f-args>)
function! EqualW() function! EqualW()
set winminwidth=0 set winminwidth=0
set winwidth=1 set winwidth=1
@ -459,9 +464,6 @@ function! AddWinMinWidth(num)
call SetWinMinWidth(a:new) call SetWinMinWidth(a:new)
set winminwidth? set winminwidth?
endfunc endfunc
nnoremap <leader>+ :call AddWinMinWidth(1)<cr>
nnoremap <leader>_ :call AddWinMinWidth(-1)<cr>
nnoremap <leader>) :EqualW<cr>
if has("autocmd") if has("autocmd")
@ -504,7 +506,7 @@ endfunc
au BufNewFile,BufRead *.vim,*vimrc :call <sid>init_vim_file() au BufNewFile,BufRead *.vim,*vimrc :call <sid>init_vim_file()
function! s:init_vim_file() function! s:init_vim_file()
nnoremap <buffer> <F5> :so %<CR> nnoremap <buffer> <F5> :w<CR>:so %<CR>
nnoremap <leader>c A<space>"<space> nnoremap <leader>c A<space>"<space>
nnoremap <leader>if ofunction! <C-o>m'()<enter>endfunction<C-o>`'<C-o>l nnoremap <leader>if ofunction! <C-o>m'()<enter>endfunction<C-o>`'<C-o>l