From cbeeda8c6486b2fcdfbfbdabe53a7e0cc8f6a15f Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Sun, 28 May 2017 21:04:57 -0500 Subject: [PATCH] use lightline instead of airline --- .bashrc | 1 + .vimrc | 46 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/.bashrc b/.bashrc index f12bbac..04d5657 100644 --- a/.bashrc +++ b/.bashrc @@ -51,3 +51,4 @@ if [ -f "$HOME/.localrc" ]; then fi alias randompass="python -c \"import string, random; print ''.join(random.sample(string.letters+string.digits, 8))\"" +alias dotfiles="$HOME/.dotfiles/install.sh" diff --git a/.vimrc b/.vimrc index 3e05e53..2731ad8 100644 --- a/.vimrc +++ b/.vimrc @@ -26,8 +26,7 @@ call vundle#begin() Plugin 'airblade/vim-rooter' Plugin 'airblade/vim-gitgutter' Plugin 'ctrlpvim/ctrlp.vim' - Plugin 'vim-airline/vim-airline' - Plugin 'vim-airline/vim-airline-themes' + Plugin 'itchyny/lightline.vim' Plugin 'heavenshell/vim-jsdoc' " Past plugins @@ -81,10 +80,17 @@ set wildignore+=*.pyc,*.pyo " ignore compiled Python files set mousehide " hides the mouse when typing +set autochdir " set current working directory on file enter + +set noshowmode " not necessary with the status line plugin + set listchars=tab:>-,trail:.,extends:# set matchpairs+=<:> " match angle brackets +set encoding=utf8 +set fillchars=vert:│ + " CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo, " so that you can undo CTRL-U after inserting a line break. inoremap u @@ -138,7 +144,7 @@ if has("autocmd") " causes VIM to enter the directory of the file being edited to simplify " finding related files. - autocmd BufEnter * silent! lcd %:p:h + " autocmd BufEnter * silent! lcd %:p:h autocmd FileType go :iabbrev iff if {} autocmd FileType javascript :iabbrev iff if @@ -195,9 +201,9 @@ noremap $ g$ let g:ctrlp_map = '' let g:ctrlp_cmd = 'CtrlP' let g:ctrlp_user_command = [ - \'.git', - \'cd %s && git ls-files -co --exclude-standard' - \] + \ '.git', + \ 'cd %s && git ls-files -co --exclude-standard' + \ ] " open up directories with a single click instead of needing to double-click let g:NERDTreeMouseMode = 2 @@ -220,6 +226,9 @@ let g:rooter_targets = '/' " (and thus losing) your changes. cnoremap w!! w !sudo tee % >/dev/null +" prevents editing a file named "~", which I literally never want. +cabbrev ~ $HOME + " leader ev to edit your vim rc nnoremap ev :vsplit $MYVIMRC @@ -243,3 +252,28 @@ onoremap il( :normal! F)vi( " command mode abbreviation :vhelp to open help text in a vertical split " instead of a horizontal split. cabbrev vhelp vertical help + +" don't show the readonly marker in help files, it's pointless. +function! LightlineReadonly() + return &readonly && &filetype !=# 'help' ? 'RO' : '' +endfunction + +" status line configuration +let g:lightline = { +\ 'colorscheme': 'jellybeans', +\ 'active': { +\ 'left': [ +\ ['mode', 'paste'], +\ ['gitbranch'], +\ ['llreadonly', 'filename', 'modified'] +\ ], +\ 'right': [ +\ ['lineinfo'], +\ ['filetype'] +\ ] +\ }, +\ 'component_function': { +\ 'gitbranch': 'fugitive#head', +\ 'llreadonly': 'LightlineReadonly' +\ } +\ }