-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
111 lines (87 loc) · 3.04 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
colorscheme molokai-dark
"let g:clang_format#code_style='google'
""map to <Leader>cf in C++ code only visual mode
autocmd FileType c,cpp,objc vnoremap <buffer><Leader>cf :ClangFormat<CR>
" Automatically add closing brackets after pressing enter similarly to VS
inoremap " ""<left>
inoremap ' ''<left>
inoremap ( ()<left>
inoremap [ []<left>
inoremap { {}<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {;<CR> {<CR>};<ESC>O
" Enable syntax highlighting
syntax on
" Show filename
set laststatus=2
" 4 spaces instead of tabs
set expandtab
set smarttab
set shiftwidth=2
set softtabstop=2
" Syntax-related settings
" When opening a new line and no filetype-specific indenting is enabled, keep
" the same indent as the line you're currently on.
set autoindent
" Do smart autoindenting when starting a new line.
set smartindent
" Window/split settings
" When on, splitting a window will put the new window right of the
" current one.
set splitright
" When on, all the windows are automatically made the same size after
" splitting or closing a window.
set equalalways
" Maximum line length
set textwidth=80
set colorcolumn=80
" Enable syntax highlighting
syntax on
set number
" set paste
" Instead of failing a command because of unsaved changes, instead raise a
" dialogue asking if you wish to save changed files.
set confirm
"------------------------------------------------------------
" Search options
" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase
" While typing a search command, show where the pattern, as it was typed
" so far, matches.
set incsearch
" Toggle spell check
nnoremap <F8> :setlocal spell! spelllang=en_us<CR>
" Overwrite vim-tmux-navigator keybindings with Alt-*
let g:tmux_navigator_no_mappings = 0
nnoremap <silent> <M-h> :TmuxNavigateLeft<cr>
nnoremap <silent> <M-j> :TmuxNavigateDown<cr>
nnoremap <silent> <M-k> :TmuxNavigateUp<cr>
nnoremap <silent> <M-l> :TmuxNavigateRight<cr>
nnoremap <silent> <M-\> :TmuxNavigatePrevious<cr>
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'rhysd/vim-clang-format'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line