From 6938ddae5d8eecb8a4a4b97a0fca572e60472889 Mon Sep 17 00:00:00 2001 From: "julio.biason" Date: Tue, 17 Nov 2015 08:40:23 -0200 Subject: [PATCH] some new plugins, changed leader, nerdtree shortcuts --- configs/vimrc | 84 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 10 deletions(-) diff --git a/configs/vimrc b/configs/vimrc index 6de169f..945bb9c 100644 --- a/configs/vimrc +++ b/configs/vimrc @@ -57,11 +57,11 @@ set background=dark " to follow most of the colorschemes I use set vb t_vb= " convert bells to visual bells and do nothing as visual bell set t_Co=256 " 256 color terminals set modeline " Enable modelines -set undofile " saves undo changes in a separate file, so we can undo anytime +" set undofile " saves undo changes in a separate file, so we can undo anytime set lcs=tab:¦\ " uses a special char at the start of a tab character, uses spaces after that set nolist " ... but don't display them by default -let mapleader="," " use comma to start user-defined (in plugins) functions +let mapleader=" " " use space to start user-defined (in plugins) functions syntax sync minlines=1500 " increases the number of lines to find the proper syntax @@ -128,6 +128,8 @@ Plugin 'gorodinskiy/vim-coloresque' " Project tree Plugin 'scrooloose/nerdtree' +Plugin 'jistr/vim-nerdtree-tabs' + " CTags regeneration " Plugin 'craigemery/vim-autotag' @@ -141,9 +143,17 @@ Plugin 'Shougo/vimshell.vim' " Undo Plugin 'sjl/gundo.vim' +" Smartabs +Plugin 'ingo-library' +Plugin 'IndentTab' +let g:IndentTab_scopes = 'indent' + " Mega-autocomplete " Plugin 'Valloric/YouCompleteMe' +" Clang Formatter +Plugin 'rhysd/vim-clang-format' + call vundle#end() " done with plugins color mustang " looks awesome on gvim, looks alright in vim if you have 256 color support @@ -201,6 +211,7 @@ au FileType c setlocal colorcolumn=100 tw=100 noet list au FileType c autocmd BufWritePre :call TrimWhiteSpace() au FileType cpp setlocal colorcolumn=100 tw=100 noet list au FileType cpp autocmd BufWritePre :call TrimWhiteSpace() +"au FileTYpe c,cpp,objc autocmd BufwritePre :ClangFormat " Default ReStructured document style " reStructured files follow python closely, but use 3 tab stops instead of 4 @@ -355,7 +366,7 @@ let g:UltiSnipsJumpForwardTrigger = "" let g:UltiSnipsJumpBackwardTrigger = "" " ---------------------------------------------------------------------- -" Nerdtree +" Nerdtree and Nerdtree tabs " ---------------------------------------------------------------------- let NERDTreeChDirMode=2 let NERDTreeIgnore=['\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__'] @@ -363,9 +374,10 @@ let NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$'] let NERDTreeShowBookmarks=1 let g:nerdtree_tabs_focus_on_files=1 let g:NERDTreeMapOpenInTabSilent = '' -let g:NERDTreeWinSize = 20 -noremap :NERDTreeToggle -nnoremap :NERDTreeFind +let g:NERDTreeWinSize = 40 +"noremap :NERDTreeToggle +"nnoremap :NERDTreeFind +map \ NERDTreeTabsToggle " ---------------------------------------------------------------------- " Syntastic @@ -383,10 +395,62 @@ let g:syntastic_c_cflags = '-Wall -Werror -W -Wno-unused-parameter -Werror=unuse let g:syntastic_cpp_compiler_options = '-std=c++11' " ---------------------------------------------------------------------- -" Crazy macros -" ---------------------------------------------------------------------- -" au BufNewFile,BufRead *.c sp %<.h -" au BufNewFile,BufRead *.h sp %<.c +" Clang formatter +" ---------------------------------------------------------------------- +let g:clang_format#style_options = { + \ "Language": "Cpp", + \ "AccessModifierOffset": -1, + \ "ConstructorInitializerIndentWidth": 4, + \ "AlignEscapedNewlinesLeft": "true", + \ "AlignTrailingComments": "true", + \ "AllowAllParametersOfDeclarationOnNextLine": "true", + \ "AllowShortBlocksOnASingleLine": "false", + \ "AllowShortIfStatementsOnASingleLine": "false", + \ "AllowShortLoopsOnASingleLine": "false", + \ "AllowShortFunctionsOnASingleLine": "None", + \ "AlwaysBreakTemplateDeclarations": "true", + \ "AlwaysBreakBeforeMultilineStrings": "true", + \ "BreakBeforeBinaryOperators": "true", + \ "BreakBeforeTernaryOperators": "true", + \ "BreakConstructorInitializersBeforeComma": "false", + \ "BinPackParameters": "true", + \ "ColumnLimit": 100, + \ "ConstructorInitializerAllOnOneLineOrOnePerLine": "true", + \ "DerivePointerAlignment": "true", + \ "ExperimentalAutoDetectBinPacking": "false", + \ "IndentCaseLabels": "true", + \ "IndentWrappedFunctionNames": "true", + \ "IndentFunctionDeclarationAfterType": "true", + \ "MaxEmptyLinesToKeep": 1, + \ "KeepEmptyLinesAtTheStartOfBlocks": "true", + \ "NamespaceIndentation": "None", + \ "ObjCSpaceAfterProperty": "false", + \ "ObjCSpaceBeforeProtocolList": "false", + \ "PenaltyBreakBeforeFirstCallParameter": 1, + \ "PenaltyBreakComment": 300, + \ "PenaltyBreakString": 1000, + \ "PenaltyBreakFirstLessLess": 120, + \ "PenaltyExcessCharacter": 1000000, + \ "PenaltyReturnTypeOnItsOwnLine": 200, + \ "PointerAlignment": "Left", + \ "SpacesBeforeTrailingComments": 2, + \ "Cpp11BracedListStyle": "false", + \ "Standard": "Auto", + \ "IndentWidth": 4, + \ "TabWidth": 8, + \ "UseTab": "Never", + \ "BreakBeforeBraces": "Stroustrup", + \ "SpacesInParentheses": "false", + \ "SpacesInAngles": "false", + \ "SpaceInEmptyParentheses": "false", + \ "SpacesInCStyleCastParentheses": "false", + \ "SpacesInContainerLiterals": "true", + \ "SpaceBeforeAssignmentOperators": "true", + \ "ContinuationIndentWidth": 4, + \ "CommentPragmas": "^ IWYU pragma:", + \ "SpaceBeforeParens": "ControlStatements", + \ "DisableFormat": "false" } + " ---------------------------------------------------------------------- " Lastly, load configurations available only to this computer