Replace .vimrc

This commit is contained in:
Thomas Avé 2017-01-06 15:48:51 +00:00
parent 54074ee674
commit 0cac80e8e5
1 changed files with 95 additions and 6 deletions

101
.vimrc
View File

@ -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 <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
" Persistent undo
set undodir=~/.vim/undodir/
@ -106,15 +176,24 @@ endif
" Quickfix
nnoremap <silent> <leader>f :YcmCompleter FixIt<CR>
nnoremap <silent> <leader>g :YcmCompleter GoTo<CR>
" Terminal colors
set t_Co=256
let g:airline_theme="solarized"
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
" Commenting
nnoremap <silent> <leader>c :TComment<CR>
nnoremap <silent> <leader>C :TCommentBlock<CR>
vnoremap <silent> <leader>c :TCommentInline<CR>
vnoremap <silent> <leader>C :TCommentBlock<CR>
" 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 <silent> {Left-mapping} :TmuxNavigateLeft<cr>
nnoremap <silent> {Down-Mapping} :TmuxNavigateDown<cr>
nnoremap <silent> {Up-Mapping} :TmuxNavigateUp<cr>
nnoremap <silent> {Right-Mapping} :TmuxNavigateRight<cr>
nnoremap <silent> {Previous-Mapping} :TmuxNavigatePrevious<cr>
let g:tmux_navigator_save_on_switch = 2