From 1906a56b4e64e9374403827e2c3150db23dc7fe9 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Wed, 18 Dec 2019 16:29:46 -0800 Subject: [PATCH] Update neovim configuration and allow clang-format --- dotfiles/bash/bash_profile | 1 + dotfiles/config/nvim/init.vim | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/dotfiles/bash/bash_profile b/dotfiles/bash/bash_profile index 40677a1..f36d93b 100644 --- a/dotfiles/bash/bash_profile +++ b/dotfiles/bash/bash_profile @@ -10,6 +10,7 @@ export CXX=$(which clang++) export OPENSSL_ROOT_DIR=$(which openssl) alias python='python3' +alias vim='nvim' if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi diff --git a/dotfiles/config/nvim/init.vim b/dotfiles/config/nvim/init.vim index cd77cb4..f925433 100644 --- a/dotfiles/config/nvim/init.vim +++ b/dotfiles/config/nvim/init.vim @@ -63,6 +63,8 @@ Plug 'isRuslan/vim-es6' " Flake8 Integration Plug 'nvie/vim-flake8' +" Clang Formatting +Plug 'rhysd/vim-clang-format' " SBT integration for vim Plug 'ktvoelker/sbt-vim' @@ -97,25 +99,10 @@ Plug 'christoomey/vim-tmux-navigator' Plug 'godlygeek/tabular' Plug 'plasticboy/vim-markdown' -" Snippet Support/Configuration -" Currently disabled because it irrepairably causes neovim to detonate more -" than I care to deal with as of 5/26/2017 -"Plug 'SirVer/ultisnips' -"Plug 'honza/vim-snippets' " Database engine support Plug 'https://github.com/vim-scripts/dbext.vim' -"let g:UltiSnipsExpandTrigger="" -"let g:UltiSnipsJumpForwardTrigger="" -"let g:UltiSnipsJumpBackwardTrigger="" -"let g:UltiSnipsSnippetsDir=["~/.config/nvim/plugged/vim-snippets/UltiSnips", "~/.config/nvim/snippets"] - -"" Allow UltiSnips to split the window vertically -"let g:UltiSnipssEditSplit="vertical" - -""""""""""""""""""""""""""""""" - " end plugin list call plug#end() @@ -152,7 +139,17 @@ endfunc " Autocmds -" Stripping trailing whitespace on save + +" Auto Clang Formatting + +autocmd FileType c ClangFormatAutoEnable +autocmd FileType cpp ClangFormatAutoEnable +autocmd FileType cxx ClangFormatAutoEnable +autocmd FileType h ClangFormatAutoEnable +autocmd FileType hpp ClangFormatAutoEnable +autocmd FileType hxx ClangFormatAutoEnable + +""" Stripping trailing whitespace on save autocmd BufWritePre * :%s/\s\+$//e " Fix rust @@ -165,6 +162,9 @@ autocmd BufNewFile,BufRead *.py setlocal colorcolumn=80 " Set Python syntax checking to Python3 let python_highlight_all=1 +" Make tabs display as 4 spaces for Python files (makes them easier to read) +autocmd BufNewFile,BufRead *.py setlocal noexpandtab tabstop=4 shiftwidth=4 + " Indent YAML files correctly au FileType yaml setlocal tabstop=2 expandtab shiftwidth=2 softtabstop=2