Commit 1d5b5aa3 authored by Robert Spencer's avatar Robert Spencer
Browse files

Start reorganizing and cleaning up whitespace

parent 8834d281
" Setup colors
set t_Co=256
" Tab to 4 chars
set tabstop=4
set shiftwidth=4
" Turn syntax highlighting on
syntax on
" Filetypes based on extension
filetype on
" Show edit window details in bar at bottom
set title
" Always show status line
set ls=2
filetype on " filetypes based on extension
syntax on " turn syntax highlighting on
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set cindent " C code indentation
set cinkeys=0{,0},0),:,!^F,o,O,e
set cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,ls,b0,gs,hs,N0,ps,t0,is,+2s,c1,C1,/0,(2s,us,Us,w0,W2s,k2s,m1,M-1,j0,J0,)20,*70,#1
set cursorline " highlight current line
set display=uhex " all unknown characters should be in hex
set fileformats=unix " only support Unix line endings
set hlsearch " highlight search results
set ignorecase " ignore search case
set laststatus=2 " always show status line
set mouse= " disable mouse in vim, so we can actually copy paste between applications
set nobackup " don't use backup files
set noerrorbells " no annoying sound on errors
set nostartofline " try keep on same column when moving in a file
set novisualbell
set nowritebackup " don't use backup files
set ruler " always show the cursor position
set shiftwidth=4 " when shifting, indent using four spaces
set showcmd " show incomplete commands
set showmatch " show matching brackets when text indicator is over them
set signcolumn=yes " always have the sign column
"set spell " enable spell checking
set statusline=%<\ %n:%f\ %m%r%y%=%-35.(line:\ %l\ of\ %L,\ col:\ %c%V\ (%P)%)
" Show incomplete commands
set showcmd
" Show ruler
set ruler
set t_Co=256 " setup colors
set t_vb= " no annoying sound on errors
set tabstop=4 " number of visual spaces per TAB
set title " set the window's title, reflecting the file currently being edited
set ttimeoutlen=500 " wait up to 500ms for key sequences to complete
" Set autocomplete menu colors
highlight Pmenu ctermfg=254 ctermbg=233
......@@ -35,30 +45,28 @@ highlight ColorColumn ctermbg=238
" Highlight line we're on
highlight CursorLine cterm=none ctermbg=235
set cursorline
" Highlight messed up tab/spaces
highlight ExtraWhitespaces ctermbg=202
" Switch whitespace handling based on file type
function! WhitespaceHighlight()
if &filetype == 'python'
call matchadd('ExtraWhitespaces','^\t')
set colorcolumn=132
elseif &filetype == 'yaml'
call matchadd('ExtraWhitespaces',' \t')
call matchadd('ExtraWhitespaces','\t ')
set colorcolumn=132
elseif &filetype != ''
call matchadd('ExtraWhitespaces',' \t')
call matchadd('ExtraWhitespaces','\t ')
call matchadd('ExtraWhitespaces','^ ')
set colorcolumn=132
endif
call matchadd('ExtraWhitespaces','\s\+$')
if &filetype == 'python'
call matchadd('ExtraWhitespaces','^\t')
set colorcolumn=132
elseif &filetype == 'yaml'
call matchadd('ExtraWhitespaces',' \t')
call matchadd('ExtraWhitespaces','\t ')
set colorcolumn=132
elseif &filetype != ''
call matchadd('ExtraWhitespaces',' \t')
call matchadd('ExtraWhitespaces','\t ')
call matchadd('ExtraWhitespaces','^ ')
set colorcolumn=132
endif
call matchadd('ExtraWhitespaces','\s\+$')
endfunction
" Autocmd
au BufNewFile,BufRead * call WhitespaceHighlight()
au BufNewFile,BufRead *.sls set filetype=python | set expandtab softtabstop=4 | call WhitespaceHighlight()
......@@ -66,60 +74,6 @@ au BufNewFile,BufRead *.md set filetype=markdown | call WhitespaceHighlight()
au BufNewFile,BufRead *.html.ep set filetype=php | call WhitespaceHighlight()
au BufNewFile,BufRead *.py set filetype=python | set expandtab softtabstop=4 | call WhitespaceHighlight()
" Don't use backup files
set nobackup
set nowb
" Auto-indentation
set backspace=indent,eol,start
set cindent
set cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,ls,b0,gs,hs,N0,ps,t0,is,+2s,c1,C1,/0,(2s,us,Us,w0,W2s,k2s,m1,M-1,j0,J0,)20,*70,#1
set cinkeys=0{,0},0),:,!^F,o,O,e
" Closing braces
"inoremap { {}<Left>
"inoremap {<CR> {<CR>}<Esc>O
"inoremap {{ {
"inoremap {} {}
" Closing brackets
"inoremap ( ()<Left>
"inoremap <expr> ) strpart(getline('.'), col('.')-1, 1) == ")" ? "\<Right>" : ")"
" Try keep on same column when moving in a file
set nostartofline
" Highlight search on
set hlsearch
" Ignore search case
set ignorecase
" Show matching brackets when text indicator is over them
set showmatch
"NK: We now use secure modelines plugin, so this should be disabled by default
" Pull vim settings from end of file
"set modeline
" Use 3 lines at bottom of file
"set modelines=3
" Only support unix filetypes
set fileformats=unix
" All unknown chars should be in hex
set dy=uhex
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" Enable spell check, one must turn syn off to see spelling mistakes
"set spell
"
" vim-plug start
"
......@@ -145,18 +99,14 @@ Plug 'vim-syntastic/syntastic'
" https://github.com/ciaranm/securemodelines
Plug 'ciaranm/securemodelines'
" vim-plug end
call plug#end()
"
" Enable neocomplete
"
let g:neocomplete#enable_at_startup = 1
"
" neosnippet configuration
......@@ -168,36 +118,28 @@ let g:neosnippet#enable_snipmate_compatibility = 1
let g:neosnippet#snippets_directory='~/.vim/snippets'
let g:neosnippet#disable_runtime_snippets = { '_' : 1 }
"
" Configure neosnippets
"
" Plugin key-mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" Plugin key-mappings
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" SuperTab like snippets behavior.
" SuperTab like snippets behavior
imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: pumvisible() ? "\<C-n>" : "\<TAB>"
\ "\<Plug>(neosnippet_expand_or_jump)"
\: pumvisible() ? "\<C-n>" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: "\<TAB>"
\ "\<Plug>(neosnippet_expand_or_jump)"
\: "\<TAB>"
" For conceal markers.
" For conceal markers
if has('conceal')
set conceallevel=2 concealcursor=niv
set conceallevel=2 concealcursor=niv
endif
"
" Configure vim-gitgutter
"
set signcolumn=yes
"
" Configure vim-airline
"
......@@ -205,14 +147,10 @@ set signcolumn=yes
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
"
" Configure syntastic
"
let g:syntastic_python_checkers = ['python', 'pylama']
" Disable mouse in vim, so we can actually copy paste between applications
set mouse=
" vim: set filetype=vim expandtab shiftwidth=2 tabstop=2 :
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment