vim-vint linting pass
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
let plug_path=expand(vim_files . '/autoload/plug.vim')
|
||||
let have_plug=filereadable(plug_path)
|
||||
if(!have_plug && executable('curl'))
|
||||
echo "Installing Plug"
|
||||
set encoding=utf-8
|
||||
scriptencoding utf-8
|
||||
|
||||
execute '!curl -fLo "' . plug_path . '" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
execute 'source ' . plug_path
|
||||
let have_plug = 1
|
||||
let g:plug_path=expand(g:vim_files . '/autoload/plug.vim')
|
||||
let g:have_plug=filereadable(g:plug_path)
|
||||
if(!g:have_plug && executable('curl'))
|
||||
echo 'Installing Plug'
|
||||
|
||||
execute '!curl -fLo "' . g:plug_path . '" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
execute 'source ' . g:plug_path
|
||||
let g:have_plug = 1
|
||||
endif
|
||||
|
||||
if(have_plug)
|
||||
call plug#begin(vim_files . '/plugged')
|
||||
if(g:have_plug)
|
||||
call plug#begin(g:vim_files . '/plugged')
|
||||
|
||||
Plug 'tpope/vim-sensible' " Sensible defaults for vim
|
||||
|
||||
@@ -47,8 +50,9 @@ if(have_plug)
|
||||
|
||||
" Quality of life
|
||||
Plug 'edkolev/tmuxline.vim'
|
||||
Plug 'jez/vim-superman' " Man page viewer
|
||||
|
||||
if version >= 800
|
||||
if v:version >= 800
|
||||
Plug 'w0rp/ale' " Asynchronous Linting
|
||||
Plug 'sbdchd/neoformat' " Automatic code formatting
|
||||
|
||||
@@ -64,7 +68,7 @@ if(have_plug)
|
||||
|
||||
call plug#end()
|
||||
|
||||
if empty(glob(vim_files . '/plugged'))
|
||||
if empty(glob(g:vim_files . '/plugged'))
|
||||
PlugInstall
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
set encoding=utf-8
|
||||
scriptencoding utf-8
|
||||
|
||||
set shortmess=I " turn off splash screen
|
||||
set hidden " enable multiple dirty buffers
|
||||
set modelines=0
|
||||
set nocompatible
|
||||
set number " show line numbers
|
||||
set visualbell
|
||||
set wildmode=full
|
||||
@@ -78,7 +80,7 @@ call EnsureExists(&directory)
|
||||
let g:ctrlp_user_command = 'ag %s -l --nocolor -f -g ""'
|
||||
let g:ctrlp_use_caching = 0
|
||||
else
|
||||
if executable("rg")
|
||||
if executable('rg')
|
||||
set grepprg=rg\ --color=never
|
||||
|
||||
let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
|
||||
@@ -89,19 +91,19 @@ call EnsureExists(&directory)
|
||||
endif
|
||||
endif
|
||||
|
||||
if has("gui_running")
|
||||
set go-=mTr " disable toolbar, menubar and scrollbar
|
||||
if has("win32")
|
||||
if has('gui_running')
|
||||
set guioptions-=mTr " disable toolbar, menubar and scrollbar
|
||||
if has('win32')
|
||||
set guifont=Source_Code_Pro:h12:cANSI
|
||||
endif
|
||||
if has("osx")
|
||||
if has('osx')
|
||||
set guifont=Source_Code_Pro:h13
|
||||
endif
|
||||
else
|
||||
if(has("mouse"))
|
||||
if(has('mouse'))
|
||||
set mouse=a
|
||||
endif
|
||||
if $TERM_PROGRAM == 'iTerm.app'
|
||||
if $TERM_PROGRAM ==? 'iTerm.app'
|
||||
" different cursors for insert vs normal mode
|
||||
if exists('$TMUX')
|
||||
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
|
||||
@@ -113,7 +115,7 @@ call EnsureExists(&directory)
|
||||
endif
|
||||
|
||||
" Windows-specific setting allowing for 256-colors etc
|
||||
if($ConEmuANSI == 'ON')
|
||||
if($ConEmuANSI ==? 'ON')
|
||||
set term=xterm
|
||||
set t_Co=256
|
||||
let &t_AB='\e[48;5;%dm' " background color
|
||||
|
||||
@@ -14,7 +14,7 @@ nnoremap <silent> <Esc><Esc> <Esc>:nohlsearch<CR><Esc>
|
||||
noremap <leader>l :set list!<cr>
|
||||
|
||||
" noremap <silent> <leader>R :! echo reload \| nc -w 1 localhost 32000<cr><cr>
|
||||
noremap <silent><leader>R :! tmux send-keys -t right "up" C-m<cr><cr>
|
||||
noremap <silent><leader>R :! tmux send-keys -t top-right "up" C-m<cr><cr>
|
||||
|
||||
"press space in normal mode to center screen
|
||||
noremap <space> zz
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if has("autocmd")
|
||||
if has('autocmd')
|
||||
filetype plugin indent on
|
||||
|
||||
augroup InvisibleCharsHighlight
|
||||
@@ -17,9 +17,9 @@
|
||||
au!
|
||||
autocmd BufWritePre * :call <SID>StripTrailingWhitespace()
|
||||
function! <SID>StripTrailingWhitespace()
|
||||
let pos = getpos('.')
|
||||
let l:pos = getpos('.')
|
||||
%s/\s\+$//e
|
||||
call setpos('.', pos)
|
||||
call setpos('.', l:pos)
|
||||
endfun
|
||||
augroup END
|
||||
|
||||
|
||||
14
vimrc
14
vimrc
@@ -1,16 +1,16 @@
|
||||
scriptencoding utf-8
|
||||
set encoding=utf-8
|
||||
scriptencoding utf-8
|
||||
|
||||
let g:vim_files=fnamemodify(resolve(expand("$MYVIMRC")), ":p:h")
|
||||
let g:vim_files=fnamemodify(resolve(expand('$MYVIMRC')), ':p:h')
|
||||
|
||||
function! SourceConfig(name)
|
||||
" exec "echo 'Loading " . a:name . "'"
|
||||
exec "source " . expand(g:vim_files . '/config/' . a:name)
|
||||
exec 'source ' . expand(g:vim_files . '/config/' . a:name)
|
||||
endfunction
|
||||
|
||||
call SourceConfig("01-plugins.vim")
|
||||
call SourceConfig("02-general.vim")
|
||||
call SourceConfig("03-mappings.vim")
|
||||
call SourceConfig("04-autocmds.vim")
|
||||
call SourceConfig('01-plugins.vim')
|
||||
call SourceConfig('02-general.vim')
|
||||
call SourceConfig('03-mappings.vim')
|
||||
call SourceConfig('04-autocmds.vim')
|
||||
|
||||
unlet g:vim_files
|
||||
|
||||
Reference in New Issue
Block a user