-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
146 lines (116 loc) · 2.76 KB
/
vimrc
File metadata and controls
146 lines (116 loc) · 2.76 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
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()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" plugins
Plugin 'tpope/vim-fugitive'
Plugin 'scrooloose/nerdtree'
Plugin 'altercation/vim-colors-solarized'
Plugin 'viis/vim-bclose'
Plugin 'airblade/vim-gitgutter'
Plugin 'tpope/vim-surround'
Plugin 'fholgado/minibufexpl.vim'
Plugin 'scrooloose/nerdcommenter'
Plugin 'editorconfig/editorconfig-vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'mileszs/ack.vim'
Plugin 'w0rp/ale'
Plugin 'majutsushi/tagbar'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
syntax on
" color theme
set t_Co=256
set background=light
colorscheme morning
" use UTF-8
set encoding=utf-8
" use , as the leader
let mapleader = ","
" tabs
set shiftwidth=4
set softtabstop=4
set expandtab
set autoindent
" visual help
set number
set ruler
set listchars=tab:>-,trail:-
set list
set colorcolumn=120
" search
set hlsearch
set incsearch
set ignorecase
set smartcase
" line breaks
set nowrap
set formatoptions=l
set wildmenu
set showcmd
map Y y$
" set cursorcolumn
nnoremap ; :
nnoremap : ;
" remap j and k to scroll by visual lines
nnoremap j gj
nnoremap k gk
nnoremap gj j
nnoremap gk k
" Ctrl-f to escape insert mode
inoremap jk <ESC>
"This unsets the 'last search pattern' register by hitting return
nnoremap <CR> :noh<CR>
" map up/down to C-p/C-n in command line mode
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
" increase command history
set history=200
" NerdTree
nnoremap <silent> <Leader>n :NERDTreeToggle<CR>
" bclose
nnoremap <silent> <Leader>x :Bclose<CR>
"
" buffers
set hidden
nnoremap <silent> <Leader>b :b#<CR>
nnoremap <silent> <Leader>j :bn<CR>
nnoremap <silent> <Leader>k :bp<CR>
" search for selected text with //
vnoremap // y/<C-R>"<CR>"
" enable mouse
set mouse=v
" split windows
noremap <Tab> <C-W>w
noremap <Bar> <C-W>v<C-W><Right>
noremap - <C-W>s<C-W><Down>
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
" minibufexpl
let g:miniBufExplorerAutoStart = 0
nnoremap <silent> <Leader>u :MBEToggle<cr>
" ctrlp
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
" ack
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
cnoreabbrev Ack Ack!
nnoremap <Leader>a :Ack!<Space>
" ALE
let g:ale_linters = {'python': ['flake8']}
let g:ale_fixers = {'python': ['black']}
nnoremap <silent> <Leader>f :ALEFix<CR>
" ctags
set autochdir
set tags=tags;
nnoremap <silent> <Leader>s :ts<CR>
" tagbar
nnoremap <silent> <Leader>t :TagbarToggle<CR>