Browse Source

Kernel styleguide settings, better color support

John Mertz 10 months ago
1 changed files with 26 additions and 6 deletions
  1. +26

+ 26
- 6
vim/vimrc View File

@@ -1,13 +1,20 @@
set nocompatible
execute pathogen#infect()
runtime! plugin/sensible.vim
"set nocompatible

filetype off
filetype plugin indent on

let g:gruvbox_italic=1
let g:gruvbox_bold=1
let g:gruvbox_underline=1
let g:gruvbox_undercurl=1
let g:gruvbox_termcolors=256
autocmd vimenter * colorscheme gruvbox

set ttyfast

set termguicolors
set background=dark
set laststatus=2
set encoding=utf-8
@@ -21,11 +28,10 @@ set number
set noswapfile
set title

" 4 spaces is the correct number of spaces. Fight me...
syn on se title
set ts=4
set softtabstop=4
set shiftwidth=4
set ts=8
set softtabstop=8
set shiftwidth=8
set expandtab
" Show tabs and trailing spaces
set list listchars=tab:»\ ,trail:·
@@ -66,10 +72,24 @@ if has("autocmd")
au BufNewFile,BufRead COMMIT_EDITMSG set spell nonumber nolist wrap linebreak

" Set filetype tab settings
autocmd FileType python,doctest set ai ts=4 sw=4 sts=4 et
autocmd FileType python,doctest set ai ts=8 sw=8 sts=8 et

autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif

" 80 characters line
set colorcolumn=81
"execute "set colorcolumn=" . join(range(81,335), ',')
highlight ColorColumn ctermbg=Black ctermfg=DarkRed

" Highlight trailing spaces
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()