From fdf8f7a480202e3db5c005a0960054bb720a67fa Mon Sep 17 00:00:00 2001 From: Joel Perras Date: Mon, 16 May 2016 21:28:35 -0400 Subject: [PATCH] Various changes. --- .vimrc | 155 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 90 insertions(+), 65 deletions(-) diff --git a/.vimrc b/.vimrc index fb16939..aa00788 100644 --- a/.vimrc +++ b/.vimrc @@ -15,26 +15,29 @@ Plug 'tpope/vim-surround' Plug 'jiangmiao/auto-pairs' Plug 'editorconfig/editorconfig-vim' Plug 'kshenoy/vim-signature' +Plug 'tweekmonster/braceless.vim' +Plug 'Shougo/deoplete.nvim' + " In-file searching ala 'ack' Plug 'gabesoft/vim-ags' " Fuzzy file finder -Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' } +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } +Plug 'junegunn/fzf.vim' " Syntax highlighting Plug 'saltstack/salt-vim' Plug 'stephpy/vim-yaml' Plug 'fatih/vim-go' Plug 'Glench/Vim-Jinja2-Syntax' +Plug 'tpope/vim-liquid' +Plug 'chriskempson/base16-vim' " REStructuredText Plug 'Rykka/riv.vim' Plug 'Rykka/InstantRst' -" Code folding for Python -Plug 'tmhedberg/SimpylFold' - " Ctags tagbar Plug 'majutsushi/tagbar' @@ -42,64 +45,102 @@ Plug 'majutsushi/tagbar' " formats e.g. markdown. Plug 'reedes/vim-pencil' -" The all-important colorscheme +" Markdown syntax augmentation +Plug 'tpope/vim-markdown' +Plug 'junegunn/goyo.vim' + +" The all-important colorschemes Plug 'altercation/vim-colors-solarized' Plug '29decibel/codeschool-vim-theme' Plug 'morhetz/gruvbox' +Plug 'reedes/vim-colors-pencil' +Plug 'vim-airline/vim-airline-themes' -call plug#end() +set laststatus=2 +call plug#end() " Colorscheme +let base16colorspace=256 set background=dark -colorscheme gruvbox - -" All key mappings -"""""""""""""""""" +colorscheme base16-eighties +"let g:gruvbox_italic=1 +"set background=dark +"colorscheme gruvbox -" Hail to the +" Basic configurations +"""""""""""""""""""""" let mapleader = "," +set number " Line numbers +set ignorecase! " Ignore case in search +set hidden " Hide instead of close bufffers to preserve history -" Ignore case in search -set ignorecase! +" Toggle highlight on ,/ +nnoremap / :set hlsearch! -" Only hide buffers when changing between them; -" this way we can keep their undo histories. -set hidden +" I CAN HAZ NORMAL REGEXES? +nnoremap / /\v +vnoremap / /\v -" NERDTree toggle -noremap t :NERDTreeToggle +" Highlight VCS conflict markers +match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' -" Run manual syntastic check -noremap :TagbarToggle +" Special characters for hilighting non-priting spaces/tabs/etc. +set list listchars=tab:»\ ,trail:· -" Toggle highlight on ,/ -nnoremap / :set hlsearch! +" Where swap and backup files go +set backupdir=~/.config/nvim/backup_files// +set directory=~/.config/nvim/swap_files// +set undodir=~/.config/nvim/undo_files// + +hi Search ctermfg=0 ctermbg=11 guifg=Black guibg=Yellow +hi SpellBad ctermfg=15 ctermbg=9 guifg=White guibg=Red -" Map main trigger for fuzzy file finder +" FZF file finder plugin +"""""""""""""""""""""""" noremap :FZF +let g:fzf_height = '30%' +let g:fzf_command_prefix = 'Fzf' +let g:fzf_tags_options = '-f .ctags"' " Tagbar/ctags +"""""""""""""" nmap :TagbarToggle +" NERDTree +"""""""""" +noremap t :NERDTreeToggle + +let NERDTreeIgnore = ['\.pyc$', '\.egg$', '\.o$', '\~$', '__pycache__$', '\.egg-info$'] + +autocmd FileType jinja,html setlocal shiftwidth=2 expandtab tabstop=2 softtabstop=2 + " Python specific configs """"""""""""""""""""""""" +" We like spaces; avoid tabs. Set colorcolumn. +"autocmd FileType python setlocal shiftwidth=4 expandtab tabstop=4 softtabstop=4 colorcolumn=80 omnifunc=pythoncomplete#Complete +autocmd FileType python setlocal shiftwidth=4 expandtab tabstop=4 softtabstop=4 colorcolumn=80 -" We like spaces; avoid tabs -autocmd FileType python setlocal shiftwidth=4 expandtab tabstop=4 softtabstop=4 +" Braceless.vim configuration +""""""""""""""""""""""""""""" +" Use braceless plugin for python-aware indenting, folding +autocmd FileType python BracelessEnable +indent +fold -" Remind ourselves to keep Python code to < 80 cols -autocmd FileType python setlocal colorcolumn=80 -" Omnifunc for python -autocmd FileType python set omnifunc=pythoncomplete#Complete +" Use braceless configuration for haml, yaml, coffeescript since none of those +" use braces +autocmd FileType haml,yaml,coffee BracelessEnable +indent +fold +highlight +highlight-cc2 -" NERDTree settings -let NERDTreeIgnore = ['\.pyc$', '\.egg$', '\.o$', '\~$', '__pycache__$', '\.egg-info$'] +let g:braceless_cont_call = 1 +let g:braceless_cont_block = 1 + +" Use deoplete. +let g:deoplete#enable_at_startup = 1 " Syntax checker options let g:flake8_ignore="E128,E501" " Syntastic settings +"""""""""""""""""""" set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%* @@ -116,33 +157,20 @@ let g:syntastic_python_checkers = ['flake8'] let g:syntastic_disabled_filetypes=['html', 'jinja'] let g:syntastic_python_flake8_args='--ignore=E501,E128' -hi Search ctermfg=0 ctermbg=11 guifg=Black guibg=Yellow -hi SpellBad ctermfg=15 ctermbg=9 guifg=White guibg=Red -hi Folded term=bold ctermfg=85 ctermbg=234 gui=bold guifg=#9cffd3 guibg=#202020 - -" Map main trigger for fuzzy file finder -let g:fzf_height = '30%' - -" I CAN HAZ NORMAL REGEXES? -nnoremap / /\v -vnoremap / /\v - -" Highlight VCS conflict markers -match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' -" Special characters for hilighting non-priting spaces/tabs/etc. -set list listchars=tab:»\ ,trail:· +" Airline configuration +""""""""""""""""""""""" -" Automatically populate the g:airline_symbols dictionary with the powerline symbols. -let g:airline_powerline_fonts = 1 +" Don't use powerline fonts +let g:airline_powerline_fonts = 0 +let g:airline_symbols = {} -" Line numbers -set number +" Don't show separators +let g:airline_left_sep='' +let g:airline_right_sep='' -" Where swap and backup files go -set backupdir=~/.config/nvim/backup_files// -set directory=~/.config/nvim/swap_files// -set undodir=~/.config/nvim/undo_files// +" Use theme for Airline +let g:airline_theme='papercolor' " Vim-Golang plugin configs let g:go_highlight_functions = 1 @@ -152,11 +180,6 @@ let g:go_highlight_operators = 1 let g:go_highlight_build_constraints = 1 let g:go_fmt_command = "goimports" -" Code folding for pythonm -let g:SimpylFold_docstring_preview = 1 -autocmd BufWinEnter *.py setlocal foldexpr=SimpylFold(v:lnum) foldmethod=expr -autocmd BufWinLeave *.py setlocal foldexpr< foldmethod< - " Tell Vim which characters to show for expanded TABs, " trailing whitespace, and end-of-lines. VERY useful! " (Sourced from http://nerditya.com/code/guide-to-neovim/) @@ -170,6 +193,11 @@ highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen match ExtraWhitespace /\s\+$\|\t/ +" Markdown-ish configurations +""""""""""""""""""""""""""""""" +let g:markdown_fenced_languages = ['javascript', 'js=javascript', 'json=javascript', 'ruby'] +let g:vim_markdown_frontmatter=1 + " Configure vim-pencil let g:pencil#wrapModeDefault = 'soft' " default is 'hard' augroup pencil @@ -178,9 +206,9 @@ augroup pencil \ | setl spell spl=en_us fdl=4 noru nonu nornu \ | setl fdo+=search autocmd Filetype git,gitsendemail,*commit*,*COMMIT* - \ call pencil#init({'wrap': 'hard', 'textwidth': 72}) - \ | setl spell spl=en_us et sw=2 ts=2 noai - autocmd Filetype mail call pencil#init({'wrap': 'hard', 'textwidth': 60}) + \ call pencil#init() + \ | setl spell spl=en_us et sw=2 ts=2 tw=72 noai + autocmd Filetype mail call pencil#init({'wrap': 'hard', 'textwidth': 80}) \ | setl spell spl=en_us et sw=2 ts=2 noai nonu nornu autocmd Filetype html,xml call pencil#init({'wrap': 'soft'}) \ | setl spell spl=en_us et sw=2 ts=2 @@ -190,6 +218,3 @@ let g:airline_section_x = '%{PencilMode()}' " Editorconfig exceptions let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] - -" configuring colours -" let $NVIM_TUI_ENABLE_TRUE_COLOR=1