" New Start: A modern Arch workflow built with an emphasis on functionality. " Copyright (C) 2017-2018 Donovan Glover if &shell =~# 'fish$' set shell=sh endif source ~/.vim/plugins.vim source ~/.vim/config.vim source ~/.vim/colors.vim source ~/.vim/keybindings.vim " =================================== Plugin-Specific =================================== let g:ale_lint_on_text_changed = 'never' " Do not lint while typing let g:ale_lint_on_insert_leave = 1 " Only lint after leaving insert mode let g:ackprg = 'rg --vimgrep' " Use rg instead of ag / ack / grep let g:plug_window = 'rightbelow topleft new' " Show vim-plug above instead of to the left let g:vimfiler_as_default_explorer = 1 " Replace netrw with vimfiler as the default FileEx let g:indentLine_enabled = 0 " Disable indent lines by default let g:indentLine_color_term = 8 " Set the color for the indent line "let g:vimfiler_no_default_key_mappings = 1 " Note that indent lines breaks with pencil mode, although you really " shouldn't be using both at the same time anyway. " NOTE: To view all the items you can change the color of, use: " :so $VIMRUNTIME/syntax/hitest.vim " Set the color for the vertical split line (6 is as good as 8 here) hi vertsplit ctermfg=8 ctermbg=none " Remove the background color from the status line hi StatusLine ctermbg=none hi StatusLineNC ctermbg=none " Remove the background color from tabs hi TabLine ctermbg=none hi TabLineFill ctermbg=none hi TabLineSel ctermbg=none " Finally, an easier way to read search results hi Search ctermbg=240 ctermfg=255 " We have to set the color for while we search as well " To keep things simple, we'll just invert the colors here " As an added bonus, this looks rather nice as well hi IncSearch ctermbg=255 ctermfg=240 " Disable all vimtex keybindings so we can define our own let g:vimtex_mappings_enabled = 0 let g:vimtex_imaps_enabled = 0 let g:vimtex_view_method = 'zathura' let g:vimtex_index_show_help = 0 let g:vimtex_index_split_width = 50 let g:vimtex_index_split_pos = 'vert rightbelow' let g:vimtex_compiler_latexmk = {'build_dir': '.tex'} map a (vimtex-toc-toggle) map f (vimtex-view) map g (vimtex-compile) map c (vimtex-errors) map w :VimtexCountWords " Delete the surrounding environment map d (vimtex-env-delete) map c (vimtex-env-change) " Toggle stars nnoremap s (vimtex-env-toggle-star) nnoremap e (vimtex-cmd-toggle-star) inoremap ]] (vimtex-delim-close) " Use incsearch and tab / shift+tab to go through the results cno getcmdtype() =~ '[?/]' ? '' : feedkeys('', 'int')[1] cno getcmdtype() =~ '[?/]' ? '' : feedkeys('', 'int')[1] " Easily repeat a command on multiple lines through visual mode vnoremap . :normal . " Easily show lines that go past the character count highlight OverLength ctermbg=red ctermfg=white guibg=#592929 " Automatically close the file viewer when it's the only thing left autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif " Use w!! to force write a file as sudo " cmap w!! w !sudo tee > /dev/null % " Make the tabline not have an X in it function MyTabLine() let s = '' for i in range(tabpagenr('$')) " select the highlighting if i + 1 == tabpagenr() let s .= '%#TabLineSel#' else let s .= '%#TabLine#' endif " set the tab page number (for mouse clicks) let s .= '%' . (i + 1) . 'T' " the label is made by MyTabLabel() let s .= ' %{MyTabLabel(' . (i + 1) . ')} ' endfor " after the last tab fill with TabLineFill and reset tab page nr let s .= '%#TabLineFill#%T' return s endfunction function MyTabLabel(n) let buflist = tabpagebuflist(a:n) let winnr = tabpagewinnr(a:n) return bufname(buflist[winnr - 1]) endfunction set tabline=%!MyTabLine() " Custom highlighting " Highlight key words that we like to use match Function /@requires/ " Use syntax highlighting for .ecr files autocmd BufNewFile,BufRead *.ecr set syntax=html " Use syntax highlighting for .slang files autocmd BufNewFile,BufRead *.slim setlocal filetype=slim autocmd BufNewFile,BufRead *.slang setlocal filetype=slim " autocmd BufReadPost *.slang set syntax=slim " Use htmldjango for html files " autocmd BufNewFile,BufRead *.html setlocal filetype=htmldjango " autocmd BufNewFile,BufRead *.html setlocal filetype=html autocmd BufNewFile,BufRead *.html setlocal filetype=jinja " Disable vim-markdown folding let g:vim_markdown_folding_disabled = 1 let g:vim_markdown_math = 1 let g:vim_markdown_frontmatter = 1 autocmd BufNewFile,BufRead *.md set conceallevel=2 " au BufNewFile,BufRead,BufWrite *.md syntax match Comment /\%^---\_.\{-}---$/ " Change cursor back to blink after exiting neovim au VimLeave * set guicursor=a:block-blinkon1 " Only hide the dots we don't need let g:vimfiler_ignore_pattern = ['^\.git$', '^\.shards$', '^\.sass-cache$'] " Only use standard for JavaScript let g:ale_linters = {'javascript': ['standard']} " Ignore syntax concealing for markdown files let g:vim_markdown_conceal = 0 let g:tex_conceal = "" let g:vim_markdown_math = 1