From b518b5bf5773a94e9f55cad8d1a0235c7d6dcb5d Mon Sep 17 00:00:00 2001 From: Brandon Cornejo Date: Mon, 6 Nov 2017 10:00:53 -0600 Subject: [PATCH] Updated vimrc --- old.vimrc | 131 +++++++++++++++++++++++++++++++++ vimrc | 214 ++++++++++++++++++++++++++---------------------------- 2 files changed, 234 insertions(+), 111 deletions(-) create mode 100644 old.vimrc diff --git a/old.vimrc b/old.vimrc new file mode 100644 index 0000000..3130a82 --- /dev/null +++ b/old.vimrc @@ -0,0 +1,131 @@ +set shell=/bin/bash +set nocompatible +set laststatus=2 +set encoding=utf-8 + +filetype off + +" autocmd +if has("autocmd") + " enable file type detection + "filetype on + filetype indent on + filetype plugin on + set ofu=syntaxcomplete#Complete + autocmd FileType python map 8 :call Flake8() +endif + +" basic options +syntax on +set number +set relativenumber +set nowrap +set autoindent + +set backspace=indent,eol,start +set complete-=i +set showmatch +set smarttab +set incsearch + +set ruler +set showcmd +set wildmenu +set foldmethod=indent +set foldcolumn=1 + +if !&scrolloff + set scrolloff=1 +endif +if !&sidescrolloff + set sidescrolloff=5 +endif +set display+=lastline + +" spaces not tabs, etc +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set expandtab + +" show invisible characters +nmap l :set list! +set listchars=tab:▸\ ,eol:¬ + +" multi-file +set hidden + +" shortcut to silently run commands +command -nargs=1 Run execute ':silent !'. execute ':redraw!' + +map +map +map +map +imap +imap +imap +imap + +" lets setup vundle +set rtp+=~/.vim/bundle/Vundle.vim +call vundle#begin() +call vundle#rc() + +" vundle bundles +Plugin 'gmarik/Vundle.vim' + +" bundles on github +Plugin 'fholgado/minibufexpl.vim.git' +Plugin 'Lokaltog/vim-powerline.git' +Plugin 'Lokaltog/vim-distinguished.git' +Plugin 'scrooloose/nerdtree.git' +Plugin 'ervandew/supertab.git' +Plugin 'myusuf3/numbers.vim.git' +Plugin 'majutsushi/tagbar.git' +Plugin 'nvie/vim-flake8.git' +Plugin 'kien/rainbow_parentheses.vim.git' +Plugin 'hynek/vim-python-pep8-indent' +Plugin 'tmhedberg/SimpylFold' +Plugin 'ejholmes/vim-forcedotcom' + +call vundle#end() +filetype plugin indent on + +" toggle showing nerd-tree +:nmap e :NERDTreeToggle +" toggle showing tagbar +nmap r :TagbarToggle + +" end tags with a key +imap ,/ + +" xml validation +:nmap ; :%w !xmllint --valid --noout - + +" toggle line wrap +:nmap w :setlocal wrap!:setlocal wrap? + +" dem fancy colors +set t_Co=256 +"colorscheme ir_black " for macvim +colorscheme distinguished + +" force django templates to use html syntax +au BufNewFile,BufRead *.djhtml set filetype=html +au BufNewFile,BufRead *.raml set filetype=yaml + +" sudo save +cmap w!! w !sudo tee % >/dev/null + +" Let's try some mouse stuff +set mouse=a + +" Mark the 80th column. PEP8 yo +set colorcolumn=80 + +" rainbow parens +au VimEnter * RainbowParenthesesToggle +au Syntax * RainbowParenthesesLoadRound +au Syntax * RainbowParenthesesLoadSquare +au Syntax * RainbowParenthesesLoadBraces diff --git a/vimrc b/vimrc index 37678a9..f1faeb2 100644 --- a/vimrc +++ b/vimrc @@ -1,63 +1,99 @@ -set shell=/bin/bash -set nocompatible -set laststatus=2 -set encoding=utf-8 +" system stuff +filetype off " for now, enabled after Vundle +set nocompatible " disable vi compatibility +set shell=/bin/bash " set our shell, always bash +set laststatus=2 " always show a status-bar +set encoding=utf-8 " always be unicode-ing +set hidden " hide abandoned buffers, don't close +set mouse=a " enable mouse support everywhere + + +" aesthetics +syntax enable " enable syntax processing +set scrolloff=4 " always show 5 lines above/below cursor +set sidescrolloff=5 " always show 5 chars over +set display=lastline " show as much as possible, no @s +set colorcolumn=80 " show bar at column # as a guide (pep8) + + +" tabs +set expandtab " make any tabs into spaces +set tabstop=4 " turn them into 4 spaces +set softtabstop=4 " even in insert mode +set shiftwidth=4 " also 4 spaces for <> indenting + + +" interface +set nowrap " never wrap long lines +set number " show line numbers +set relativenumber " show numbers relative to current line +set cursorline " highlight currently selected line +set wildmenu " command autocomplete bar +"set lazyredraw " redraw only when needed +set showmatch " highlight matching brackets/parens +set incsearch " real-time searching while typing +set hlsearch " highlight search matches +set autoindent " auto-match surrounding indentation for newlines +set backspace=indent,start " let backspace delete autoindent, not eol + + +" folding +set foldenable " turn on vim folding +set foldnestmax=8 " stay out of fold-hell, only 10-deep +set foldmethod=indent " unless told otherwise, fold on indents + + +" set Vundle runtime path and initialize +set rtp+=~/.vim/bundle/Vundle.vim +call vundle#begin() + +" Plugins for Vundle to handle +Plugin 'VundleVim/Vundle.vim' " handle Vundle itself +Plugin 'fholgado/minibufexpl.vim' " mini-buffer explorer (tabs at top) +Plugin 'itchyny/lightline.vim' " status bar replacement +Plugin 'Lokaltog/vim-distinguished.git' " ancient color-scheme, should replace +Plugin 'scrooloose/nerdtree.git' +Plugin 'ervandew/supertab.git' +Plugin 'nvie/vim-flake8.git' +Plugin 'kien/rainbow_parentheses.vim.git' +Plugin 'hynek/vim-python-pep8-indent' +Plugin 'tmhedberg/SimpylFold' +Plugin 'w0rp/ale' +" Plugin 'vim-syntastic/syntastic' + +" end vundle setup +call vundle#end() +colorscheme distinguished " such colours -filetype off -" autocmd +" autocmd check if has("autocmd") - " enable file type detection - "filetype on - filetype indent on - filetype plugin on - set ofu=syntaxcomplete#Complete + filetype plugin indent on " enable filetype detection + " \8 to run Flake8 on python files autocmd FileType python map 8 :call Flake8() + " set filetypes in odd extensions for decent highlighting + autocmd BufNewFile,BufRead *.djhtml set filetype=html + autocmd BufNewFile,BufRead *.raml set filetype=yaml + autocmd BufNewFile,BufRead *.rst set filetype=rust + autocmd BufNewFile,BufRead *.cls set filetype=apex + " for rainbow parentheses plugin + autocmd VimEnter * RainbowParenthesesToggle + autocmd Syntax * RainbowParenthesesLoadRound + autocmd Syntax * RainbowParenthesesLoadSquare + autocmd Syntax * RainbowParenthesesLoadBraces endif -" basic options -syntax on -set number -set relativenumber -set nowrap -set autoindent - -set backspace=indent,eol,start -set complete-=i -set showmatch -set smarttab -set incsearch - -set ruler -set showcmd -set wildmenu -set foldmethod=indent -set foldcolumn=1 - -if !&scrolloff - set scrolloff=1 -endif -if !&sidescrolloff - set sidescrolloff=5 -endif -set display+=lastline - -" spaces not tabs, etc -set tabstop=4 -set softtabstop=4 -set shiftwidth=4 -set expandtab - +" [COMMANDS] +" close html/xml tags with a hotkey +imap ,/ +" turn off search-highlighting +nnoremap :nohlsearch +" highlight last inserted text +nnoremap gV `[v`] " show invisible characters nmap l :set list! set listchars=tab:▸\ ,eol:¬ - -" multi-file -set hidden - -" shortcut to silently run commands -command -nargs=1 Run execute ':silent !'. execute ':redraw!' - +" don't be a noob - disable arrow keys everywhere map map map @@ -67,63 +103,19 @@ imap imap imap -" lets setup vundle -set rtp+=~/.vim/bundle/Vundle.vim -call vundle#begin() -call vundle#rc() - -" vundle bundles -Plugin 'gmarik/Vundle.vim' - -" bundles on github -Plugin 'fholgado/minibufexpl.vim.git' -Plugin 'Lokaltog/vim-powerline.git' -Plugin 'Lokaltog/vim-distinguished.git' -Plugin 'scrooloose/nerdtree.git' -Plugin 'ervandew/supertab.git' -Plugin 'myusuf3/numbers.vim.git' -Plugin 'majutsushi/tagbar.git' -Plugin 'nvie/vim-flake8.git' -Plugin 'kien/rainbow_parentheses.vim.git' -Plugin 'hynek/vim-python-pep8-indent' - -call vundle#end() -filetype plugin indent on - -" toggle showing nerd-tree -:nmap e :NERDTreeToggle -" toggle showing tagbar -nmap r :TagbarToggle - -" end tags with a key -imap ,/ - -" xml validation -:nmap ; :%w !xmllint --valid --noout - - -" toggle line wrap -:nmap w :setlocal wrap!:setlocal wrap? - -" dem fancy colors -set t_Co=256 -"colorscheme ir_black " for macvim -colorscheme distinguished - -" force django templates to use html syntax -au BufNewFile,BufRead *.djhtml set filetype=html -au BufNewFile,BufRead *.raml set filetype=yaml - -" sudo save -cmap w!! w !sudo tee % >/dev/null - -" Let's try some mouse stuff -set mouse=a - -" Mark the 80th column. PEP8 yo -set colorcolumn=80 - -" rainbow parens -au VimEnter * RainbowParenthesesToggle -au Syntax * RainbowParenthesesLoadRound -au Syntax * RainbowParenthesesLoadSquare -au Syntax * RainbowParenthesesLoadBraces +" [PLUGIN COMMANDS] +" show nerd-tree bar +nmap e :NERDTreeToggle +" validate xml +nmap ; :%w !xmllint --valid --noout - + + +" [Syntastic 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 = 1 +let g:syntastic_check_on_wq = 0 +let g:syntastic_loc_list_height = 3