-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
124 lines (102 loc) · 3.13 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
command! Vimrc :vs $MYVIMRC
"General
set nocompatible "Disable original VI compatibility
set nu
set hidden "Manage buffers mo betta
set wildmenu "Tab completion support
set shortmess=atI "Shorter warnings
set scrolloff=3 "Window has better context when scrolling beyond
set history=256 "Number of history items remembered
set timeoutlen=250 "Commands time out at 250ms
set clipboard=unnamed "Use the system clipboard
set ignorecase "These 2 enable case sense searching when caps are found
set smartcase
set showcmd "Show info at bottom about current command
set wildmenu "Autocomplete
set showmatch "Matches parenthesis
set showmode "Shows current mode at bottom of screen
set textwidth=0 "Don't wrap text
set wrap
set incsearch
set hlsearch "Highlight search results
set backspace=indent,eol,start " more powerful backspacing
set directory^=$HOME/.vim/swapfiles// " Put all swapfiles in one location
set undodir=~/.vim/undodir " Enable persistent undo on all edited files
set undofile
set visualbell
set noerrorbells
"Time between key presses for keymaps with >1 keys
set timeoutlen=250
" Add a line below the current line (can't add support for adding above)
nmap <CR> o<Esc>k
"Keyboard shortcuts
"Split with Ctrl + <j,k,l,h>
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
"s behaves like d without clobbering the default register
nnoremap s "_d
"Remove a line with -
map - dd
"Easy code block navigation
map [ [{
map ] ]}
" Allow jk combo to exit insert mode
inoremap jk <esc>
inoremap kj <esc>
"Faster viewport scrolling
nnoremap <C-e> 3<C-e>
nnoremap <C-y> 3<C-y>
"Enable folding with spacebar
set foldmethod=indent
set foldlevel=99
nnoremap <space> za
"Plugin management uses Vundle
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
"Code folding
Plugin 'tmhedberg/SimpylFold'
"Theme
"Plugin 'hdima/python-syntax'
Plugin 'sjl/badwolf'
"PEP8 indentation for Python
"Plugin 'vim-scripts/indentpython.vim'
"Syntax checking
"Plugin 'scrooloose/syntastic'
"Python errthang
"Plugin 'klen/python-mode'
"Auto completion
"Bundle 'Valloric/YouCompleteMe'
"Status on bottom of screen
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
call vundle#end()
"Plugin Settings
"let g:pymode_options_max_line_length =
"Turn off rope in python-mode
let g:pymode_rope = 0
"Ignore undefined name errors raised by pyflakes
let g:pymode_lint_ignore = "E0602"
"Visual
syntax enable "Enable plugins to highlight
colorscheme badwolf "Set the colorscheme
"Abbreviations
abbr _sh #!/bin/bash
abbr _py #!/usr/bin/python
abbr _pl #!/usr/bin/perl
"Language specific settings
filetype plugin indent on
" Show existing tabs as 4 spaces width
set tabstop=4
" When indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
"Python
let python_highlight_all=1 "Prettify Python code
set encoding=utf-8 "Set encoding
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | execute "normal g'\"" | endif " restore position in file upon reopen
au BufNewFile,BufReadPost *.log* :set filetype=messages " Log highlighting for .log files