-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
187 lines (154 loc) · 5.75 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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below. If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
" vim git plugin
" its a colorscheme
" folds for python
Plugin 'tmhedberg/SimpylFold'
"fuzzy file search activated by -
Plugin 'kien/ctrlp.vim'
" syntax checking
Plugin 'flazz/vim-colorschemes' " nice colors!
Plugin 'tpope/vim-fugitive.git' " for git integration
Plugin 'christoomey/vim-tmux-navigator' "split screen movements in sync tmux
Plugin 'ervandew/supertab' " tab completion
Plugin 'onur/vim-motivate'
Plugin 'nvie/vim-flake8' "PEP8 checker on F7
Plugin 'shime/vim-livedown.git'
Plugin 'chip/vim-fat-finger' " spell corrector
Plugin 'vimwiki/vimwiki' "wiki
call vundle#end()
filetype plugin indent on
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
" filetype plugin indent on
"endif
let mapleader = " "
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set smartcase " Do smart case matching
set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
"tabspaces
set tabstop=4
set shiftwidth=4
set expandtab
set smarttab
autocmd FileType yaml setlocal softtabstop=2 ts=2 sts=2 sw=2 expandtab
autocmd FileType groovy setlocal softtabstop=2 ts=2 sts=2 sw=2 expandtab
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set hlsearch " highlight search terms
set number
set relativenumber
nmap <f3> :set number! number?<cr>
"toggle line numbers by F3
set history=1000 " remember more commands and search history
set undolevels=1000 " use many muchos levels of undo
set nobackup " do not keep backup files, it's 70's style cluttering
set noswapfile " do not write annoying intermediate swap files,
nnoremap <leader>q :q<CR>
nnoremap <leader>w :w<CR>
"ctrl + j/k/l/h for switching windows instead of ctrl-w + h/j/k/l
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif
nnoremap ; :
:command W w
:command WQ wq
:command Wq wq
:command Q q
:command Qa qa
:command QA qa
set wildmenu
set wildmode=full
" hide matches on <leader>space
nnoremap <leader><space> :nohlsearch<cr>
inoremap jk <ESC>
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode
set background=dark
colorscheme Chasing_Logic
" colorscheme zenburn
map - :CtrlP<cr>
map ` :!pyre --source-directory . check <enter>
iabbrev adn and
iabbrev pdb import ipdb<CR>ipdb.set_trace(
set gdefault " always assume /g ie matchies all matches in a line
"let g:ctrlp_custom_ignore = '\v\.(svg|txt|json|pyc|styl)$'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v(\.git|venv)$',
\ 'file': '\v\.(svg|txt|json|pyc|styl)$',
\ }
"set textwidth=120
set colorcolumn=+1
let &colorcolumn=join(range(81,999),",")
highlight ColorColumn ctermbg=240 guibg=#2c2d27
let &colorcolumn="80,".join(range(100,999),",")
" For simplyfold plugin
" show docstrings as preview
let g:SimpleFold_docstring_preview = 1
"syntax checking
set statusline+=%#warningmsg#
set statusline+=%*
"give us 256 colors
set term=screen-256color
"auto spell check for md files
autocmd BufRead,BufNewFile *.md setlocal spell
autocmd BufRead,BufNewFile *.tex setlocal spell
" Commenting blocks of code.
autocmd FileType sh,ruby,python let b:comment_leader = '# '
autocmd FileType tex let b:comment_leader = '% '
autocmd FileType vim let b:comment_leader = '" '
noremap <silent> ,c :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR>
noremap <silent> ,u :<C-B>silent <C-E>s/^\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR>
nnoremap <space>gs :Gstatus<CR>
set list listchars=trail:.,extends:>
let g:vimwiki_list = [
\{'path': '~/Google Drive/wiki'},
\]