added a new foldtext function, and added bindings to move windows around in tmux.

This commit is contained in:
Gabe Venberg 2018-08-10 23:47:36 -05:00
parent 74f32eb2b5
commit 3c4d334a7e
2 changed files with 16 additions and 2 deletions

View file

@ -95,7 +95,8 @@ filetype plugin on
set foldminlines=3
"spacebar opens or closes a fold in normal mode
nmap <Space> za
nnoremap <Space> za
vnoremap <Space> za
"indent folding: really basic fold method. eventually I may make some custom folds, but with the foldtext fixed a bit, this shouldn't annoy me too much.
if foldtype ==# "basicindent"
@ -103,8 +104,17 @@ filetype plugin on
set foldmethod=indent
"make sure that comment are counted in indent folding!
set foldignore=
set fillchars="fold:-"
"set the fold text for this method, in most cases, the line just above our fold is what we want, so we wont put any text into it. just level and linecount. TODO
"set foldtext=Minimal_foldtext()
function! Minimal_foldtext()
let lines_count = v:foldend - v:foldstart
let lines_count_text = '+' . v:folddashes . '| ' . printf("%10S" , lines_count) . ' lines |'
let line_level_text = '| ' . printf("%5S" , 'level ' . v:foldlevel) . ' |'
let fold_text_end = line_level_text . repeat('-',8)
let fold_text_length = strlen(lines_count_text . fold_text_end) + &foldcolumn
return lines_count_text . repeat('-' , winwidth(0) - fold_text_length) . fold_text_end
endfunction
set foldtext=Minimal_foldtext()
endif
"useful keybinds

View file

@ -29,6 +29,10 @@
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
#moving panes between windows.
bind-key b command-prompt -p "bring pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "sent pane to:" "join-pane -t '%%'"
#reload conf with r
bind r source-file ~/tmux.conf