From 0cac80e8e5496959788a002d7a9270cd087c3441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Fri, 6 Jan 2017 15:48:51 +0000 Subject: [PATCH] Replace .vimrc --- .vimrc | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 95 insertions(+), 6 deletions(-) diff --git a/.vimrc b/.vimrc index 0fee02e..6c847e9 100644 --- a/.vimrc +++ b/.vimrc @@ -1,3 +1,5 @@ +let VIMHOME = split(&rtp, ",")[0] + " Vundle package managment set nocompatible filetype off @@ -6,7 +8,8 @@ call vundle#begin() Plugin 'altercation/vim-colors-solarized' Plugin 'cohama/lexima.vim' Plugin 'gmarik/Vundle.vim' -Plugin 'bling/vim-airline' +Plugin 'vim-airline/vim-airline' +Plugin 'vim-airline/vim-airline-themes' Plugin 'easymotion/vim-easymotion' Plugin 'hdima/python-syntax' Plugin 'scrooloose/syntastic' @@ -22,6 +25,7 @@ Plugin 'Valloric/YouCompleteMe' Plugin 'rhysd/vim-clang-format' Plugin 'tmux-plugins/vim-tmux' Plugin 'tmux-plugins/vim-tmux-focus-events' +Plugin 'christoomey/vim-tmux-navigator' Plugin 'Valloric/ListToggle' Plugin 'jeetsukumaran/vim-buffergator' call vundle#end() @@ -37,6 +41,8 @@ let mapleader="," :command Q q :command WQ wq :command Wq wq +nnoremap j gj +nnoremap k gk "python with virtualenv support py << EOF @@ -48,6 +54,10 @@ if 'VIRTUAL_ENV' in os.environ: execfile(activate_this, dict(__file__=activate_this)) EOF +" don't store .swp files in the file's own directory +" neither for .ext~ files +set directory=/home/billie/.vim/tmp/ +set backupdir=/home/billie/.vim/tmp/ " Autoindent for filetype filetype plugin indent on @@ -71,16 +81,76 @@ let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclu set hidden let g:clang_format#style_options = { - \ "AccessModifierOffset" : -4, - \ "AllowShortIfStatementsOnASingleLine" : "true", - \ "AlwaysBreakTemplateDeclarations" : "true", - \ "Standard" : "C++11"} -let g:clang_format#code_style = 'llvm' + \ "AccessModifierOffset" : -4, + \ "AlignAfterOpenBracket" : "true", + \ "AlignEscapedNewlinesLeft" : "false", + \ "AlignOperands" : "false", + \ "AlignTrailingComments" : "true", + \ "AllowAllParametersOfDeclarationOnNextLine" : "true", + \ "AllowShortBlocksOnASingleLine" : "false", + \ "AllowShortCaseLabelsOnASingleLine" : "false", + \ "AllowShortFunctionsOnASingleLine" : "All", + \ "AllowShortIfStatementsOnASingleLine" : "true", + \ "AllowShortLoopsOnASingleLine" : "true", + \ "AlwaysBreakAfterDefinitionReturnType" : "false", + \ "AlwaysBreakBeforeMultilineStrings" : "false", + \ "AlwaysBreakTemplateDeclarations" : "true", + \ "BinPackArguments" : "true", + \ "BinPackParameters" : "true", + \ "BreakBeforeBinaryOperators" : "None", + \ "BreakBeforeBraces" : "Attach", + \ "BreakBeforeTernaryOperators" : "true", + \ "BreakConstructorInitializersBeforeComma" : "false", + \ "ColumnLimit" : 0, + \ "ConstructorInitializerAllOnOneLineOrOnePerLine" : "true", + \ "ConstructorInitializerIndentWidth" : 4, + \ "ContinuationIndentWidth" : 4, + \ "Cpp11BracedListStyle" : "true", + \ "DerivePointerAlignment" : "true", + \ "DisableFormat" : "false", + \ "ExperimentalAutoDetectBinPacking" : "false", + \ "IndentCaseLabels" : "true", + \ "IndentWidth" : 4, + \ "IndentWrappedFunctionNames" : "false", + \ "KeepEmptyLinesAtTheStartOfBlocks" : "false", + \ "Language" : "Cpp", + \ "MaxEmptyLinesToKeep" : 1, + \ "NamespaceIndentation" : "None", + \ "ObjCBlockIndentWidth" : 4, + \ "ObjCSpaceAfterProperty" : "false", + \ "ObjCSpaceBeforeProtocolList" : "false", + \ "PenaltyBreakBeforeFirstCallParameter" : 1, + \ "PenaltyBreakComment" : 300, + \ "PenaltyBreakFirstLessLess" : 120, + \ "PenaltyBreakString" : 1000, + \ "PenaltyExcessCharacter" : 1000000, + \ "PenaltyReturnTypeOnItsOwnLine" : 200, + \ "PointerAlignment" : "Left", + \ "SpaceAfterCStyleCast" : "false", + \ "SpaceBeforeAssignmentOperators" : "true", + \ "SpaceBeforeParens" : "ControlStatements", + \ "SpaceInEmptyParentheses" : "false", + \ "SpacesBeforeTrailingComments" : 4, + \ "SpacesInAngles" : "false", + \ "SpacesInCStyleCastParentheses" : "false", + \ "SpacesInContainerLiterals" : "true", + \ "SpacesInParentheses" : "false", + \ "SpacesInSquareBrackets" : "false", + \ "Standard" : "Auto", + \ "TabWidth" : 4, + \ "UseTab" : "Never"} + +let g:clang_format#code_style = 'Google' " Line numbering set number set numberwidth=4 :set mouse=a +" Allow xterm-key usage inside tmux +execute "set =\e[1;*A" +execute "set =\e[1;*B" +execute "set =\e[1;*C" +execute "set =\e[1;*D" " Persistent undo set undodir=~/.vim/undodir/ @@ -106,15 +176,24 @@ endif " Quickfix nnoremap f :YcmCompleter FixIt +nnoremap g :YcmCompleter GoTo + " Terminal colors set t_Co=256 +let g:airline_theme="solarized" set tabstop=4 set shiftwidth=4 set softtabstop=4 set expandtab +" Commenting +nnoremap c :TComment +nnoremap C :TCommentBlock +vnoremap c :TCommentInline +vnoremap C :TCommentBlock + " Tab completion set wildmode=longest,list set wildmenu @@ -130,3 +209,13 @@ let python_highlight_all=1 set background=dark let g:solarized_termcolors=256 colorscheme solarized + +let g:tmux_navigator_no_mappings = 1 + +nnoremap {Left-mapping} :TmuxNavigateLeft +nnoremap {Down-Mapping} :TmuxNavigateDown +nnoremap {Up-Mapping} :TmuxNavigateUp +nnoremap {Right-Mapping} :TmuxNavigateRight +nnoremap {Previous-Mapping} :TmuxNavigatePrevious +let g:tmux_navigator_save_on_switch = 2 +