Created
January 28, 2016 23:17
-
-
Save nhooyr/57cca1aa632d11244eae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Plugins {{{ | |
call plug#begin('/usr/local/etc/dotfiles/nvim/plugged') | |
Plug 'junegunn/vim-easy-align' | |
"TODO FIX LABELS | |
Plug 'fatih/vim-go', { 'for': 'go' } | |
Plug 'tomtom/tcomment_vim' | |
Plug 'haya14busa/incsearch.vim' | |
Plug 'benekastah/neomake' | |
Plug 'majutsushi/tagbar' | |
Plug 'tpope/vim-fugitive' | |
Plug 'SirVer/ultisnips' | |
Plug 'honza/vim-snippets' | |
Plug 'Shougo/deoplete.nvim' | |
Plug 'zchee/deoplete-go' | |
Plug 'Shougo/neco-vim' | |
Plug 'zchee/deoplete-jedi', { 'for': 'python'} | |
Plug 'Rip-Rip/clang_complete' | |
Plug 'itchyny/lightline.vim' | |
Plug 'Raimondi/delimitMate' | |
Plug 'tpope/vim-vinegar' | |
Plug 'mhinz/vim-startify' | |
Plug 'christoomey/vim-tmux-navigator' | |
Plug 'mattn/emmet-vim', { 'for': ['html', 'css'] } | |
Plug 'tpope/vim-surround' | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
Plug 'tpope/vim-repeat' | |
Plug 'romainl/Apprentice' | |
Plug 'unblevable/quick-scope' | |
Plug 'jez/vim-superman' | |
Plug 'vim-scripts/LanguageTool' | |
Plug 'osyo-manga/vim-over' | |
Plug 'xuhdev/vim-latex-live-preview' | |
Plug 'lervag/vimtex', { 'for': 'tex' } | |
Plug 'wellle/targets.vim' | |
Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'html'] } | |
Plug 'othree/html5.vim', { 'for': 'html'} "verifiy if html only needed here | |
Plug 'tpope/vim-tbone' | |
Plug 'mbbill/undotree' | |
Plug 'mhinz/vim-grepper' | |
Plug 'NLKNguyen/c-syntax.vim', { 'for': ['c'] } | |
call plug#end() | |
" }}} | |
" Plugin Settings {{{ | |
" vim-go {{{ | |
let g:go_highlight_functions = 1 | |
let g:go_highlight_methods = 1 | |
let g:go_highlight_structs = 1 | |
let g:go_highlight_operators = 1 | |
let g:go_highlight_build_constraints = 1 | |
let g:go_highlight_interfaces = 1 | |
let g:go_jump_to_error = 1 | |
let g:go_create_test_file = 1 | |
let g:go_fmt_command = "goimports" | |
"let g:go_auto_type_info = 0 | |
"let g:go_fmt_options = '-s' | |
" }}} | |
" neomake {{{ | |
let g:neomake_open_list = 1 | |
let g:neomake_error_sign = { | |
\ 'text': '>', | |
\ 'texthl': 'ErrorMsg', | |
\ } | |
let g:neomake_warning_sign = { | |
\ 'text': '>', | |
\ 'texthl': 'ErrorMsg', | |
\ } | |
" }}} | |
" tagbar {{{ | |
let g:tagbar_autofocus = 1 | |
let g:tagbar_autoclose = 1 | |
nnoremap <silent> <leader>l :TagbarToggle<CR> | |
" }}} | |
" ultisnips {{{ | |
let g:UltiSnipsExpandTrigger="<c-t>" | |
let g:UltiSnipsJumpForwardTrigger="<c-t>" | |
let g:UltiSnipsJumpBackwardTrigger="<c-e>" | |
let g:UltiSnipsEditSplit="vertical" | |
" }}} | |
" deoplete {{{ | |
" Tab autocomplete | |
imap <silent><expr><Tab> pumvisible() ? "\<c-n>" | |
\ : (<SID>is_whitespace() ? "\<Tab>" | |
\ : deoplete#mappings#manual_complete()) | |
inoremap <expr><S-Tab> pumvisible() ? "\<c-p>" : "\<c-h>" | |
function! s:is_whitespace() | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~? '\s' | |
endfunction | |
let g:clang_library_path = '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib' | |
let g:deoplete#enable_at_startup = 1 | |
let g:deoplete#auto_completion_start_length = 1 | |
let g:deoplete#sources#go = 'vim-go' | |
let g:deoplete#enable_refresh_always = 1 | |
let g:clang_omnicppcomplete_compliance = 1 | |
call deoplete#custom#set('go', 'rank', 9999) | |
call deoplete#custom#set('go', 'min_pattern_length', 1) | |
call deoplete#custom#set('jedi', 'rank', 9999) | |
call deoplete#custom#set('omni', 'rank', 9998) | |
call deoplete#custom#set('ultisnips', 'rank', 5000) | |
call deoplete#custom#set('member', 'min_pattern_length', 1) | |
call deoplete#custom#set('clang_complete', 'min_pattern_length', 1) | |
let g:deoplete#ignore_sources = {} | |
let g:deoplete#ignore_sources.go = 'member' | |
" }}} | |
" lightline {{{ | |
let g:lightline = { | |
\ 'colorscheme': 'nhooyr', | |
\ 'enable': { | |
\ 'statusline': 1, | |
\ 'tabline': 0, | |
\ }, | |
\ 'active': { | |
\ 'left': [ [ 'mode', 'paste' ], | |
\ [ 'fugitive', ], [ 'filename' ], ], | |
\ 'right': [ [ 'lineinfo' ], | |
\ [ 'filetype'], ['make']], | |
\ }, | |
\ 'inactive': { | |
\ 'left': [ [ 'filename' ] ], | |
\ 'right': [ [ 'filetype' ] ], | |
\ }, | |
\ 'component': { | |
\ }, | |
\ 'component_function': { | |
\ 'fugitive': 'LightLineFugitive', | |
\ 'readonly': 'LightLineReadonly', | |
\ 'modified': 'LightLineModified', | |
\ 'filename': 'LightLineFilename', | |
\ 'tagbar': 'LightLineTagbar', | |
\ 'make': 'LightLineMake', | |
\ }, | |
\ 'tabline': { | |
\ 'left': [[ 'tabs'] ], | |
\ 'right': [ [ 'close' ] ], | |
\ }, | |
\ 'tab': { | |
\ 'active': [ 'filename', ], | |
\ 'inactive': [ 'filename', ], | |
\ }, | |
\ 'separator': { 'left': '', 'right': '' }, | |
\ 'subseparator': { 'left': '', 'right': '' }, | |
\ } | |
function! LightLineMake() | |
if &filetype ==# "go" | |
return go#jobcontrol#Statusline() | |
else | |
return neomake#statusline#LoclistStatus() | |
endif | |
endfunction | |
function! LightLineModified() | |
if &modified | |
return "+" | |
elseif &modifiable | |
return "-" | |
else | |
return "" | |
endif | |
endfunction | |
function! LightLineReadonly() | |
if &filetype ==# "help" | |
return "" | |
elseif &readonly | |
return "" | |
else | |
return "" | |
endif | |
endfunction | |
function! LightLineFugitive() | |
if exists("*fugitive#head") && &filetype !=# "tagbar" && &filetype !=# "help" | |
let _ = fugitive#head() | |
return strlen(_) ? ' '._ : '' | |
endif | |
return '' | |
endfunction | |
function! LightLineFilename() | |
if &filetype ==# "tagbar" || &filetype ==# "vim-plug" || &filetype ==# "startify" || &filetype ==# "qf" | |
return '' | |
endif | |
if &buftype ==# "nofile" | |
return 'scratch' | |
endif | |
return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') . | |
\ ('' != expand('%:t') ? expand('%:t') : '[No Name]') . | |
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '') | |
endfunction | |
"fix tagbar | |
let g:tagbar_status_func = 'TagbarStatusFunc' | |
function! TagbarStatusFunc(current, sort, fname, ...) abort | |
return lightline#statusline(0) | |
endfunction | |
" }}} | |
" delimitMate {{{ | |
let g:delimitMate_expand_cr = 1 | |
" }}} | |
" startify {{{ | |
let g:startify_custom_header = | |
\ map(split(system('fortune -s | cowsay'), '\n'), '" ". v:val') + ['',''] | |
" }}} | |
" vim-tmux-navigator {{{ | |
inoremap <silent> <c-h> <ESC>:TmuxNavigateLeft<cr> | |
inoremap <silent> <c-j> <ESC>:TmuxNavigateDown<cr> | |
inoremap <silent> <c-k> <ESC>:TmuxNavigateUp<cr> | |
inoremap <silent> <c-l> <ESC>:TmuxNavigateRight<cr> | |
" }}} | |
" fzf {{{ | |
" Mapping selecting mappings | |
nmap <leader><tab> <plug>(fzf-maps-n) | |
xmap <leader><tab> <plug>(fzf-maps-x) | |
omap <leader><tab> <plug>(fzf-maps-o) | |
" Insert mode completion | |
imap <c-x><c-k> <plug>(fzf-complete-word) | |
imap <c-x><c-f> <plug>(fzf-complete-path) | |
imap <c-x><c-j> <plug>(fzf-complete-file-ag) | |
imap <c-x><c-l> <plug>(fzf-complete-line) | |
function! s:fzf_statusline() | |
" Override statusline as you like | |
highlight fzf1 ctermfg=8 ctermbg=5 cterm=bold | |
highlight fzf2 ctermfg=5 ctermbg=8 | |
setlocal statusline=%#fzf1#\ fzf\ %#fzf2# | |
endfunction | |
autocmd! User FzfStatusLine call <SID>fzf_statusline() | |
let g:fzf_layout = { 'down': '20%' } | |
" }}} | |
" quickscope {{{ | |
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T'] | |
let g:qs_first_occurrence_highlight_color = 1 | |
let g:qs_second_occurrence_highlight_color = 2 | |
" }}} | |
" languageTool {{{ | |
let g:languagetool_jar = '/usr/local/Cellar/languagetool/3.0/libexec/languagetool-commandline.jar' | |
" }}} | |
" vim-latex-live-preview {{{ | |
let g:livepreview_previewer = 'open -a Preview' | |
" }}} | |
" vim-grepper {{{ | |
command! -nargs=* -complete=file Vag Grepper -tool ag -query <args> | |
command! -nargs=* Cag Grepper -noprompt -tool ag -grepprg ag --vimgrep <args> % | |
command! Q q | |
command! Chat tabe term://$SHELL\ -ic\ tchat | |
" }}} | |
" netrw {{{ | |
let g:netrw_silent=1 | |
" }}} | |
" incsearch {{{ | |
map / <Plug>(incsearch-forward) | |
map ? <Plug>(incsearch-backward) | |
map g/ <Plug>(incsearch-stay) | |
" }}} | |
" }}} | |
" Basic Settings {{{ | |
syntax on | |
set autochdir | |
set mouse = | |
set visualbell | |
set fillchars=vert:\| | |
set linebreak | |
set scrolljump=10 | |
set shiftwidth=5 | |
set tabstop=5 | |
set formatoptions+=w | |
set t_co=256 | |
set background=dark | |
set wildignorecase | |
set backspace=indent,eol,start | |
set title | |
set re=1 | |
set number | |
set relativenumber | |
set noruler | |
set laststatus=2 | |
set updatetime=0 | |
set noshowmode | |
set showcmd | |
set ignorecase | |
set smartcase | |
set incsearch | |
set autochdir | |
set scrolloff=5 | |
set backup | |
set backupdir=/usr/local/etc/dotfiles//nvim/backup | |
set backupskip=/tmp/*,/private/tmp/* | |
set directory=/usr/local/etc/dotfiles//nvim/swap | |
set undofile | |
set undodir=/usr/local/etc/dotfiles//nvim/undo | |
set writebackup | |
set splitbelow | |
set splitright | |
set showtabline=2 | |
" }}} | |
" Buffer Settings {{{ | |
" c {{{ | |
augroup c | |
autocmd! | |
autocmd FileType c nnoremap <silent> <buffer> <leader>dd :call ClangGotoDeclaration()<CR><Esc> | |
autocmd FileType c nnoremap <silent> <buffer> <leader>dp :call ClangGotoDeclarationPreview()<CR><Esc> | |
autocmd BufRead,BufNewFile *.h set filetype=c | |
augroup END | |
" }}} | |
" html/css {{{ | |
let g:user_emmet_install_global = 0 | |
let g:html_exclude_tags = ['html', 'body'] | |
augroup html | |
autocmd! | |
autocmd FileType html,css EmmetInstall | |
augroup END | |
" }}} | |
" zsh {{{ | |
augroup zsh | |
autocmd! | |
autocmd BufRead,BufNewFile .z* setfiletype zsh | |
autocmd BufRead,BufNewFile z* setfiletype zsh | |
augroup END | |
" }}} | |
" go {{{ | |
augroup go | |
autocmd! | |
autocmd FileType go nmap <silent> <buffer> <leader>m <Plug>(go-build) | |
autocmd FileType go nnoremap <buffer> <leader>i :GoImport | |
autocmd FileType go nnoremap <buffer> <leader>di :GoDrop | |
autocmd FileType go nmap <buffer> <leader>gs <Plug>(go-doc) | |
autocmd FileType go nmap <buffer> <leader>gv <Plug>(go-doc-vertical) | |
autocmd FileType go nnoremap <silent> <buffer> <leader>f :GoFmt<CR> | |
autocmd FileType go nnoremap <buffer> <leader>gr :GoRename | |
autocmd FileType go nmap <buffer> <leader>dd <Plug>(go-def) | |
autocmd FileType go nmap <buffer> <leader>n <Plug>(go-info) | |
autocmd FileType go nmap <buffer> <leader>rs <Plug>(go-run-split) | |
autocmd FileType go nmap <buffer> <leader>rv <Plug>(go-run-vertical) | |
autocmd FileType go nmap <buffer> <leader>rt <Plug>(go-run-tab) | |
autocmd FileType go nmap <buffer> <leader>aa <Plug>(go-alternate) | |
autocmd FileType go nmap <buffer> <leader>as <Plug>(go-alternate-split) | |
autocmd FileType go nmap <buffer> <leader>av <Plug>(go-alternate-vertical) | |
augroup END | |
" }}} | |
" vim {{{ | |
augroup vim | |
autocmd! | |
autocmd FileType vim setlocal foldmethod=marker | |
augroup END | |
" }}} | |
" tex {{{ | |
augroup tex | |
autocmd! | |
autocmd FileType tex highlight MatchParen ctermfg=6 | |
augroup END | |
" }}} | |
" {{{ term | |
tnoremap <c-n> <c-\><c-n> | |
tnoremap <silent> <c-h> <c-\><c-n>:TmuxNavigateLeft<CR> | |
tnoremap <silent> <c-j> <c-\><c-n>:TmuxNavigateDown<CR> | |
tnoremap <silent> <c-k> <c-\><c-n>:TmuxNavigateUp<CR> | |
tnoremap <silent> <c-l> <c-\><c-n>:TmuxNavigateRight<CR> | |
tnoremap <silent> <a-q> <c-\><c-n>:q<cr> | |
tnoremap <silent> <a-t> <c-\><c-n>:tabe term://$SHELL<CR> | |
tnoremap <silent> <a-v> <c-\><c-n>:vsplit term://$SHELL<CR> | |
tnoremap <silent> <a-s> <c-\><c-n>:split term://$SHELL<CR> | |
tnoremap <silent><expr> <leader>h "<c-\><c-n>".(&hls && v:hlsearch ? ":nohls" : ":set hls")."\n" | |
tnoremap <silent> <leader>/ <c-\><c-n>/ | |
tnoremap <silent> <a-m> <c-\><c-n>:tabn<CR> | |
tnoremap <silent> <a-n> <c-\><c-n>:tabp<CR> | |
tnoremap <silent> <leader>p <c-\><c-n>"*]pi | |
tnoremap <silent> <leader>P <c-\><c-n>"*]Pi | |
augroup term | |
autocmd! | |
"autocmd BufWinEnter,WinEnter term://* startinsert | |
autocmd BufWinEnter,WinEnter term://* setlocal nonumber norelativenumber | |
augroup END | |
" }}} | |
" netrw {{{ | |
augroup netrw | |
autocmd! | |
autocmd FileType netrw nnoremap <silent> <leader>r :Rex<CR> | |
augroup END | |
" }}} | |
" python {{{ | |
augroup python | |
autocmd! | |
autocmd FileType python setlocal omnifunc=jedi#completions | |
augroup END | |
"}}} | |
" preview {{{ | |
autocmd InsertLeave * pclose | |
" }}} | |
" }}} | |
" General Mappings and Functions {{{ | |
nnoremap <silent> <leader>yy "*yy | |
nnoremap ,p :b#<bar>bd#<CR> | |
nnoremap ,d :enew<bar>bd#<CR> | |
nnoremap <silent> <leader>y "*y | |
vnoremap <silent> <leader>y "*y | |
nnoremap <silent> <leader>p "*]p | |
nnoremap <silent> <leader>P "*]P | |
nnoremap <silent> p ]p | |
nnoremap <silent> <expr> j v:count ? 'j' : 'gj' | |
nnoremap <silent> <expr> k v:count ? 'k' : 'gk' | |
nnoremap <silent> <c-e> 5<c-e> | |
nnoremap <silent> <c-y> 5<c-y> | |
"nnoremap <silent> <leader>h :if &hls && v:hlsearch \| nohls \| else \| set hls \| :endif <CR> | |
nnoremap <silent><expr> <leader>h (&hls && v:hlsearch ? ":nohls" : ":set hls")."\n" | |
nnoremap <silent> <Esc><Esc> :<c-u>nohlsearch<CR> | |
nnoremap <silent> Q <nop> | |
"highlight last inserted text | |
nnoremap <silent> gV `[v`] | |
nnoremap <silent> m ; | |
inoremap <silent> <c-s> <CR><esc>O | |
nnoremap <silent> <c-s> i<CR><esc>O | |
nnoremap <silent> <leader>ev :vsplit $MYVIMRC<cr> | |
nnoremap <silent> <leader>es :split $MYVIMRC<cr> | |
nnoremap <silent> <leader>sv :source $MYVIMRC<CR> | |
nnoremap <silent> <leader>wt /\s\+$/<CR> | |
nnoremap <silent> <leader>ws :call SudoWrite()<CR> | |
function! SudoWrite() | |
"TODO fix this shit | |
execute ":write !sudo tee " . shellescape(@%, 1) . " >/dev/null" | |
endfunction | |
nnoremap <silent> <leader>0 :vs ~/.homework<CR> | |
nnoremap <silent> <leader>to :vs ~/.todo<CR> | |
nnoremap <silent> <leader>z :Files<CR> | |
nnoremap <silent> <leader>b :Buffers<CR> | |
nnoremap <silent> <leader>s :OverCommandLine<CR> | |
nnoremap H ^ | |
nnoremap L $ | |
nnoremap * *`` | |
nnoremap <A-a> <c-a> | |
nnoremap <A-x> <c-x> | |
"Show syntax highlighting groups for word under cursor ctrl+p | |
nnoremap <silent> <c-P> :call <SID>SynStack()<CR> | |
function! <SID>SynStack() | |
if !exists("*synstack") | |
return | |
endif | |
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') | |
endfunc | |
cnoreabbrev <expr> help ((getcmdtype() is# ':' && getcmdline() is# 'help')?('vert help'):('help')) | |
cnoreabbrev <expr> h ((getcmdtype() is# ':' && getcmdline() is# 'h')?('vert help'):('h')) | |
"Ag operator | |
nnoremap <silent> <leader>ag :set operatorfunc=<SID>AgOperator<cr>g@ | |
vnoremap <silent> <leader>ag :<c-u>call <SID>AgOperator(visualmode())<cr> | |
function! s:AgOperator(type) | |
let tmp = @@ | |
if a:type ==# 'v' | |
normal! `<v`>y | |
elseif a:type ==# 'char' | |
normal! `[v`]y | |
else | |
return | |
endif | |
silent execute "Vag" . shellescape(@@) | |
let @@ = tmp | |
endfunction | |
nnoremap <silent> <c-q> :cp<CR> | |
nnoremap <silent> <c-b> :cn<CR> | |
inoremap <silent> <c-q> <ESC>:cp<CR> | |
inoremap <silent> <c-b> <ESC>:cn<CR> | |
nnoremap <silent> <c-m> :lne<CR> | |
nnoremap <silent> <c-n> :lp<CR> | |
inoremap <silent> <c-m> <ESC>:lne<CR> | |
inoremap <silent> <c-n> <ESC>:lp<CR> | |
imap <CR> <Plug>delimitMateCR | |
nnoremap <silent> <a-m> :tabn<CR> | |
nnoremap <silent> <a-n> :tabp<CR> | |
inoremap <silent> <a-m> <ESC>:tabn<CR> | |
inoremap <silent> <a-n> <ESC>:tabp<CR> | |
nnoremap <silent> <a-t> :tabe term://$SHELL<CR> | |
nnoremap <silent> <a-v> :vsplit term://$SHELL<CR> | |
nnoremap <silent> <a-s> :split term://$SHELL<CR> | |
inoremap <silent> <a-t> <ESC>:tabe term://$SHELL<CR> | |
inoremap <silent> <a-v> <ESC>:vsplit term://$SHELL<CR> | |
inoremap <silent> <a-s> <ESC>:split term://$SHELL<CR> | |
function! GotoJump() | |
jumps | |
let j = input("Please select your jump: ") | |
if j != '' | |
let pattern = '\v\c^\+' | |
if j =~ pattern | |
let j = substitute(j, pattern, '', 'g') | |
execute "normal " . j . "\<c-i>" | |
else | |
execute "normal " . j . "\<c-o>" | |
endif | |
endif | |
endfunction | |
nnoremap <silent> <leader>j :call GotoJump()<CR> | |
nnoremap <silent> <leader>m :Neomake<CR> | |
iabbrev waht what | |
iabbrev tehn then | |
iabbrev @e [email protected] | |
iabbrev ccopy Copyright 2015 Anmol Sethi, all rights reserved. | |
nnoremap <silent> <a-right> :5winc<<cr> | |
nnoremap <silent> <a-up> :5winc+<cr> | |
nnoremap <silent> <a-down> :5winc-<cr> | |
nnoremap <silent> <a-left> :5winc><cr> | |
"Uppercase | |
"inoremap <c-U> <esc>mzgUiw`za | |
"nnoremap <c-u> mzgUiw`z | |
" }}} | |
" Colorscheme {{{ | |
colorscheme apprentice | |
highlight Type ctermfg=103 | |
highlight cssClassName ctermfg=6 | |
highlight cssClassNameDot ctermfg=6 | |
highlight link jsFuncCall Type | |
highlight cssBraces ctermfg=fg | |
highlight htmlLink ctermfg=fg | |
highlight Function ctermfg=182 | |
highlight MatchParen ctermfg=182 ctermbg=232 | |
highlight Constant ctermfg=210 | |
highlight htmlH1 ctermfg=fg | |
highlight StartifyHeader ctermfg=231 | |
highlight Normal ctermbg=black | |
highlight Search ctermfg=0 ctermbg=110 | |
highlight IncSearch ctermfg=0 ctermbg=2 | |
highlight Cursor ctermfg=0 ctermbg=fg | |
highlight Directory ctermfg=7 | |
highlight StatusLine ctermbg=0 ctermfg=7 | |
highlight WildMenu ctermbg=253 ctermfg=0 | |
highlight TODO ctermbg=0 ctermfg=6 cterm=bold | |
highlight VertSplit ctermbg=0 ctermfg=238 | |
highlight DiffChange cterm=none ctermfg=235 ctermbg=103 | |
highlight DiffText cterm=none ctermfg=235 ctermbg=13 | |
highlight LineNr ctermbg=234 | |
highlight SignColumn ctermbg=234 | |
highlight CursorLine ctermbg=234 | |
highlight CursorLineNR ctermbg=234 | |
highlight ErrorMsg ctermbg=234 ctermfg=73 | |
highlight TermCursor cterm=none ctermfg=bg ctermbg=fg | |
highlight TermCursorNC cterm=none ctermfg=bg ctermbg=fg | |
highlight link StartifySlash Directory | |
" }}} | |
" Tabline {{{ | |
function! Tabline() | |
let s = '%#TabLabel# tabs %#TabLabelNum#' | |
let t = tabpagenr() | |
for i in range(1, tabpagenr('$')) | |
let wn = tabpagewinnr(i) | |
let s .= '%' . i . 'T' | |
let s .= '%#TabBGNum#' | |
let s .= ( i == t ? '%#TabNumSel#' : '%#TabNum#') | |
let s .= ' ' | |
let s .= i | |
let s .= ':' | |
let s .= wn | |
let s .= ' ' | |
let s .= ( i == t ? '%#TabNumSelName#' : '%#TabNumName#') | |
let s .= '' | |
let s .= ( i == t ? '%#TabNameSel#' : '%#TabName#') | |
let buflist = tabpagebuflist(i) | |
let bufnr = buflist[wn - 1] | |
let file = bufname(bufnr) | |
if file == '' | |
let file = '[No Name]' | |
elseif file =~# "term\:\/\/.*fzf" | |
let file = 'fzf' | |
elseif file =~# "term\:\/\/.*tchat" | |
let file = 'chat' | |
elseif file =~# "term\:\/\/.*zsh" | |
let file = 'zsh' | |
elseif file =~# "term\:\/\/.*go run" | |
let file = 'go-run' | |
endif | |
let s .= ' ' | |
let s .= file | |
let s .= ' ' | |
let s .= ( i == t ? '%#TabNameSelBG#' : '%#TabNameBG#') | |
let s .= '' | |
endfor | |
let s .= '%T%#TabLineFill#%= %#TabBGClose#%#TabClose# X ' | |
return s | |
endfunction | |
hi TabLabel cterm=bold ctermfg=8 ctermbg=7 | |
hi TabLabelNum ctermfg=7 ctermbg=235 | |
hi TabClose ctermfg=8 ctermbg=12 | |
hi TabBGClose ctermfg=12 ctermbg=235 | |
hi TabBGNum ctermfg=235 ctermbg=8 | |
hi TabNameSel ctermfg=235 ctermbg=12 | |
hi TabNumSel ctermfg=7 ctermbg=8 | |
hi TabNumSelName ctermfg=8 ctermbg=12 | |
hi TabNameSelBG ctermfg=12ctermbg=235 | |
hi TabName ctermfg=250 ctermbg=11 | |
hi TabNum ctermfg=250 ctermbg=8 | |
hi TabNameBG ctermfg=11 ctermbg=235 | |
hi TabNumName ctermfg=8 ctermbg=11 | |
hi TabLineFill ctermfg=7 ctermbg=235 | |
hi Close ctermfg=8 ctermbg=10 | |
set tabline=%!Tabline() | |
" }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment