-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
109 lines (85 loc) · 2.12 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
" Plugin settings
" vundle needs this off; turn on further down below
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Linter
Plugin 'dense-analysis/ale'
" Autocomplete
Plugin 'ycm-core/YouCompleteMe'
" Fuzzy file finder
Plugin 'ctrlpvim/ctrlp.vim'
" Color scheme
Plugin 'altercation/vim-colors-solarized'
call vundle#end()
let g:ale_set_highlights = 0
let g:ale_virtualtext_cursor = 0
let g:ale_fix_on_save = 1
" Needed for MUcomplete
set completeopt+=menuone
" Colors
syntax enable
set background=dark
try
" Wrap in try/catch to avoid annoying errors when we PluginInstall
colorscheme solarized
catch /.*/
endtry
" General settings
set encoding=utf8
set completeopt-=preview
set number
set relativenumber
set wildmenu
set hidden
set hlsearch
set incsearch
set belloff=all
set backspace=eol,start,indent
set shortmess+=c
" Tab stuff. Override in filetype-specific
" configs if necessary.
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set shiftround
filetype plugin indent on
" Bindings
let mapleader = ","
let maplocalleader = ","
nnoremap <leader>, ,
" Buffer navigation
nnoremap <silent> <leader>b :bprevious<CR>
nnoremap <silent> <leader>b :bnext<CR>
" Arrow keys
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
" Jump to definition
nnoremap <silent> <C-J> :ALEGoToDefinition<CR>
" Open a window
nnoremap <leader>v <C-w><C-v>
" Close a buffer without closing window
nnoremap <silent> <leader>x :bp\|bd #<CR>
" Close a window without closing buffer
nnoremap <leader>z <C-w>c
" Move between windows
nnoremap <leader>w <C-W><C-W>
" Turn off highlighting
nnoremap <silent> <leader>h :nohlsearch<CR>
" Operator pending mapping for stuff inside parentheses
onoremap p i(
" Misc. settings
" Keep undo logs around when we close buffers.
" We can always add a crontab to clean up ~/.vim_undo_files
" if we're worried about disk space.
if has('persistent_undo') && exists("*mkdir")
let undo_file_dir=expand('~/.vim_undo_files')
call mkdir(undo_file_dir, "p", 0o700)
let &undodir=undo_file_dir
set undofile
unlet undo_file_dir
endif