Skip to content

Commit

Permalink
change qf height
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenyangze committed Apr 13, 2023
1 parent 50d5b2b commit 05eb0cf
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
1 change: 1 addition & 0 deletions layers/common/theme-colors.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Plug 'arcticicestudio/nord-vim'
Plug 'liuchengxu/space-vim-theme'
Plug 'rakr/vim-two-firewatch'
Plug 'sainnhe/gruvbox-material'
Plug 'glepnir/oceanic-material'
if has('mac')
Plug 'ryanoasis/vim-devicons'
if !has('nvim')
Expand Down
21 changes: 21 additions & 0 deletions layers/common/tool-functions.vim
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,27 @@ function! AutoFormatFile()
echomsg "Formated"
endfunction

function! ChangeColorchemes()
" 获取当前主题
let current_theme = g:colors_name

" 获取所有主题
let all_themes = getcompletion('', 'color')

" 获取下一个主题
let next_theme = all_themes[0]
for theme in all_themes
if theme == current_theme
let next_theme = all_themes[(index(all_themes, theme) + 1) % len(all_themes)]
break
endif
endfor

" 切换到下一个主题
execute 'colorscheme' next_theme
echo "colorscheme:" . next_theme
endfunction

"}}}

"{{{============================= language ================================
Expand Down
1 change: 1 addition & 0 deletions layers/common/tool-notity.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Plug 'rcarriga/nvim-notify'
8 changes: 5 additions & 3 deletions layers/user/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ set cmdheight=1
autocmd bufenter * if (winnr("$") == 1 && &buftype == 'quickfix') | q | endif


let g:qf_min_height = 7
let g:qf_max_height = 12
if version > 800
au FileType qf call AdjustWindowHeight(2, 7)
au FileType qf call AdjustWindowHeight()
endif
function! AdjustWindowHeight(minheight, maxheight)
function! AdjustWindowHeight()
"let l = 1
"let n_lines = 0
"let w_width = winwidth(0)
Expand All @@ -50,7 +52,7 @@ function! AdjustWindowHeight(minheight, maxheight)
"let n_lines += float2nr(ceil(line_width))
"let l += 1
"endw
exe max([min([line('$'), a:maxheight]), a:minheight]) . "wincmd _"
exe max([min([line('$'), g:qf_max_height]), g:qf_min_height]) . "wincmd _"
endfunction

let g:context_enabled = 0
3 changes: 2 additions & 1 deletion layers/user/theme.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ if !exists('$TMUX')

let g:gruvbox_material_background = 'soft'
let g:gruvbox_material_better_performance = 1
colorscheme gruvbox-material
"colorscheme gruvbox-material
colorscheme oceanic_material
"colorscheme onehalfdark
hi SignColumn ctermbg=NONE guibg=NONE
hi StatusLineNC guifg=#444444 guibg=#3a3a3a
Expand Down

0 comments on commit 05eb0cf

Please sign in to comment.