From 370134eae81072777b2a82acd364783736c38c0a Mon Sep 17 00:00:00 2001 From: Alexander Karle Date: Wed, 27 Dec 2017 14:27:14 -0500 Subject: [PATCH] Split vmrc into multiple files + swap to vim-plug --- keys.vim | 17 +++++++++++++++++ plugins.vim | 39 +++++++++++++++++++++++++++++++++++++++ pluginsettings.vim | 16 ++++++++++++++++ theme.vim | 32 ++++++++++++++++++++++++++++++++ vimrc | 123 +++++++++------------------------------------------------------------------------------------------------------------------ 5 files changed, 113 insertions(+), 114 deletions(-) create mode 100644 keys.vim create mode 100644 plugins.vim create mode 100644 pluginsettings.vim create mode 100644 theme.vim diff --git a/keys.vim b/keys.vim new file mode 100644 index 0000000..918cb03 --- /dev/null +++ b/keys.vim @@ -0,0 +1,17 @@ +"================================ +" KEY MAPPINGS +"================================ +"Map 'jk' to ESC (its wonderful) +inoremap jk + +"Map ctrl-i/j/k/h to switch between splits +nnoremap j +nnoremap k +nnoremap h +nnoremap l + +"Map ctrl-p to fuzzy finder +nnoremap :GFiles + +" HTML autoclose tag +iabbrev diff --git a/plugins.vim b/plugins.vim new file mode 100644 index 0000000..c79032b --- /dev/null +++ b/plugins.vim @@ -0,0 +1,39 @@ +" Plugs will be downloaded under the specified directory. +call plug#begin('~/.vim/bundle') + +" Colorscheme +Plug 'rakr/vim-one' + +" Plug nerdtree for tree package explorer +Plug 'scrooloose/nerdtree' + +" Airline = status bar for vime +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' + +" Fugitive = git for vim +Plug 'tpope/vim-fugitive' + +" NERD Commenter = for comments +Plug 'scrooloose/nerdcommenter' + +" Git Gutter +Plug 'airblade/vim-gitgutter' + +" Syntastic for syntax checks +Plug 'vim-syntastic/syntastic' + +" todo task plugin +Plug 'irrationalistic/vim-tasks' + +" Simple latex tools +Plug 'lervag/vimtex' + +" fzf -- fuzzy finder +Plug 'junegunn/fzf.vim' + +" surround for parens and such +Plug 'tpope/vim-surround' + +" List ends here. Plugins become visible to Vim after this call. +call plug#end() diff --git a/pluginsettings.vim b/pluginsettings.vim new file mode 100644 index 0000000..fda62c6 --- /dev/null +++ b/pluginsettings.vim @@ -0,0 +1,16 @@ +" Syntastic Default Settings +"set statusline+=%#warningmsg# +"set statusline+=%{SyntasticStatuslineFlag()} +"set statusline+=%* + +"let g:syntastic_always_populate_loc_list = 1 +"let g:syntastic_auto_loc_list = 1 +"let g:syntastic_check_on_open = 0 +"let g:syntastic_check_on_wq = 0 + +"let g:syntastic_python_checkers = ['flake8'] +"let g:syntastic_python_flake8_post_args='--ignore=E116' + +" vimtex stuff +" Set pdf viewer to sim +let g:vimtex_view_method='skim' diff --git a/theme.vim b/theme.vim new file mode 100644 index 0000000..9e0817a --- /dev/null +++ b/theme.vim @@ -0,0 +1,32 @@ +"================================ +" THEME +"================================ +"for airline status bar -- need to include font +if filereadable(expand("~/.vim/bundle/vim-airline/plugin/airline.vim")) + let g:airline_powerline_fonts = 1 +endif + +if filereadable(expand("~/.vim/bundle/vim-airline-themes/plugin/airline-themes.vim")) + let g:airline_theme = 'onedark' +endif + +"Syntax highlighting on +syntax on + +" COLORSCHEME +" use iterm profiles to determin background +if $ITERM_PROFILE=='light_background' + set background=light +else + set background=dark +endif + +" load colorscheme if plugins installed +if filereadable(expand("~/.vim/bundle/vim-one/colors/one.vim")) + colorscheme one +endif + +" if can use truecolor, do +if (has("termguicolors")) + set termguicolors +endif diff --git a/vimrc b/vimrc index 446d0bb..9610f0f 100644 --- a/vimrc +++ b/vimrc @@ -18,130 +18,25 @@ set smarttab "search highlighting set hlsearch -"=============================== -" PLUGINS -"=============================== -"Don't try to work with vi -set nocompatible - -"Use vundle for plugins! -filetype off - -" set the runtime path to include Vundle and initialize -set rtp+=~/.vim/bundle/Vundle.vim -call vundle#begin() - -" let Vundle manage Vundle, required -Plugin 'VundleVim/Vundle.vim' - -" Colorscheme -Plugin 'rakr/vim-one' - -" Plugin nerdtree for tree package explorer -Plugin 'scrooloose/nerdtree.git' - -" Airline = status bar for vime -Plugin 'vim-airline/vim-airline' -Plugin 'vim-airline/vim-airline-themes' - -" Fugitive = git for vim -Plugin 'tpope/vim-fugitive' - -" NERD Commenter = for comments -Plugin 'scrooloose/nerdcommenter' - -" Better syntax highlighting for python -"Plugin 'hdima/python-syntax' - -" Git Gutter -Plugin 'airblade/vim-gitgutter' - -" Syntastic for syntax checks -Plugin 'vim-syntastic/syntastic' - -" todo task plugin -Plugin 'irrationalistic/vim-tasks' - -" Simple latex tools -Plugin 'lervag/vimtex' - -" fzf -- fuzzy finder set rtp+=/usr/local/opt/fzf -Plugin 'junegunn/fzf.vim' +filetype plugin indent on -" All of your Plugins must be added before the following line -call vundle#end() " required -filetype plugin indent on " required -"================================ -" THEME + OTHER -"================================ -"for airline status bar -- need to include font -let g:airline_powerline_fonts = 1 +" OTHER +" Link clipboard to mac +set clipboard=unnamed "For security (modeline vulnerability) set modelines=0 -"Syntax highlighting on -syntax on - " Encoding set encoding=utf-8 -" COLORSCHEME -" use iterm profiles to determin background -if $ITERM_PROFILE=='light_background' - set background=light -else - set background=dark -endif - -" load colorscheme if plugins installed -if filereadable(expand("~/.vim/bundle/vim-one/colors/one.vim")) - colorscheme one -endif - -" if can use truecolor, do -if (has("termguicolors")) - set termguicolors -endif - -let g:airline_theme = 'onedark' - " Show whitespace with 'set: list' (disable: set: nolist) set listchars=space:·,tab:>–,trail:~,eol:¬ -" Syntastic Default Settings -set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} -set statusline+=%* - -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_auto_loc_list = 1 -let g:syntastic_check_on_open = 0 -let g:syntastic_check_on_wq = 0 - -let g:syntastic_python_checkers = ['flake8'] -let g:syntastic_python_flake8_post_args='--ignore=E116' - -" vimtex stuff -" Set pdf viewer to sim -let g:vimtex_view_method='skim' - -"================================ -" NEW MAPPINGS -"================================ -"Map 'jk' to ESC (its wonderful) -inoremap jk - -"Map ctrl-i/j/k/h to switch between splits -nnoremap j -nnoremap k -nnoremap h -nnoremap l - -"Map ctrl-p to fuzzy finder -nnoremap :GFiles - -" Link clipboard to mac -set clipboard=unnamed +" Source helper files +source ~/.vim/plugins.vim +source ~/.vim/pluginsettings.vim +source ~/.vim/theme.vim +source ~/.vim/keys.vim -- libgit2 0.28.4