dotfiles

My dotfiles, nothing really interesting to see ...
git clone https://git.onna.be/dotfiles.git
Log | Files | Refs | README

commit f24d7f69967d06ba43d4ef6197899d5e2423f485
parent 9e1f4b2b89632c8808af4df0b5686c4a2dabc693
Author: Paco Esteban <paco@onna.be>
Date:   Fri, 29 Jun 2018 20:16:51 +0200

tabline the way I like it, and without plugins

Diffstat:
nvim/.config/nvim/init.vim | 87+++++++++++++++++++++++++++++++++++++++++++------------------------------------
1 file changed, 47 insertions(+), 40 deletions(-)

diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim @@ -10,8 +10,6 @@ set cursorline set cursorcolumn set ignorecase set smartcase " don't use ignorecase when we search for a cased pattern -set noshowcmd " we have airline, more info than needed -set noshowmode " showmode disabled because of lightline plugin set hidden " avoiding annoying messages (no write since last change) set splitright " split windows on the right ! set list " mark non-printable chars as per above instructions @@ -20,6 +18,8 @@ set wildmode=longest,list:longest " command completion works as set foldmethod=syntax set updatetime=1000 +set path+=** + " appearance color lucius LuciusBlackLowContrast @@ -63,6 +63,14 @@ vnoremap < <gv " search with true regexp, not vim's ... nnoremap / /\v vnoremap / /\v +" next prev tab +let i = 1 +while i < 10 + execute 'nnoremap <leader>'.i.' '.i.'gt' + let i += 1 +endwhile +nmap <leader>[ :tabprevious<CR> +nmap <leader>] :tabnext<CR> " go fast to home end of line inoremap <C-e> <C-o>$ inoremap <C-a> <C-o>0 @@ -84,39 +92,6 @@ tnoremap <Esc> <C-\><C-n> tnoremap <C-v><Esc> <Esc> " plugins config -" FZF -nnoremap <C-p> :Files<CR> -nnoremap <C-b> :Buffers<CR> -" ALE -let g:ale_linters = { -\ 'perl': ['perl'], -\} -let g:ale_sign_column_always = 1 -let g:airline#extensions#ale#enabled = 1 -nmap <silent> [W <Plug>(ale_first) -nmap <silent> [w <Plug>(ale_previous) -nmap <silent> ]w <Plug>(ale_next) -nmap <silent> ]W <Plug>(ale_last) -" airline -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#tabline#tab_nr_type = 2 -let g:airline#extensions#tabline#buffer_idx_mode = 1 -let g:airline#extensions#tabline#formatter = 'unique_tail_improved' -let g:airline#extensions#tabline#show_close_button = 0 -let g:airline#extensions#branch#enabled = 1 -let g:airline#extensions#virtualenv#enabled = 1 -let g:airline_powerline_fonts = 1 -nmap <leader>1 <Plug>AirlineSelectTab1 -nmap <leader>2 <Plug>AirlineSelectTab2 -nmap <leader>3 <Plug>AirlineSelectTab3 -nmap <leader>4 <Plug>AirlineSelectTab4 -nmap <leader>5 <Plug>AirlineSelectTab5 -nmap <leader>6 <Plug>AirlineSelectTab6 -nmap <leader>7 <Plug>AirlineSelectTab7 -nmap <leader>8 <Plug>AirlineSelectTab8 -nmap <leader>9 <Plug>AirlineSelectTab9 -nmap <leader>[ <Plug>AirlineSelectPrevTab -nmap <leader>] <Plug>AirlineSelectNextTab " Nerdcommenter let g:NERDSpaceDelims = 1 let g:NERDDefaultAlign = 'left' @@ -134,9 +109,6 @@ let g:go_highlight_extra_types = 1 let g:go_fmt_command = "goimports" let g:go_template_autocreate = 0 let g:go_info_mode = 'guru' -" gitgutter -nmap ]h <Plug>GitGutterNextHunk -nmap [h <Plug>GitGutterPrevHunk " vim -grepper let g:grepper = {} let g:grepper.tools = ['rg', 'git', 'grep'] @@ -146,7 +118,42 @@ xmap gs <plug>(GrepperOperator) " UltiSnips " Disabling snipmate let g:UltiSnipsEnableSnipMate = 0 -" vim-virtualenv -let g:virtualenv_directory = "~/src/virtualenvs" " vim-slackcat let g:slackcat_default_channel = "festeban" + +" tabline with numbers +" shamelessly taken form +" https://github.com/mkitt/tabline.vim/blob/master/plugin/tabline.vim +" and modified slightly +function! Tabline() + let s = '' + for i in range(tabpagenr('$')) + let tab = i + 1 + let winnr = tabpagewinnr(tab) + let buflist = tabpagebuflist(tab) + let bufnr = buflist[winnr - 1] + let bufname = bufname(bufnr) + let bufmodified = getbufvar(bufnr, "&mod") + + let s .= '%' . tab . 'T' + let s .= (tab == tabpagenr() ? '%#TabLineSel#' : '%#TabLine#') + let s .= ' ' . tab + let n = tabpagewinnr(tab,'$') " get the number of windows in the current tab + if n > 1 + let s .= '(' . n .')' " if there's more than one, add a colon and display the count + endif + let s .= ':' + let s .= (bufname != '' ? '['. pathshorten(fnamemodify(bufname, ':~:.')) . '] ' : '[No Name] ') + + if bufmodified + let s .= '[+] ' + endif + endfor + + let s .= '%#TabLineFill#' + if (exists("g:tablineclosebutton")) + let s .= '%=%999XX' + endif + return s +endfunction +set tabline=%!Tabline()