-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
122 lines (104 loc) · 3.26 KB
/
vimrc
File metadata and controls
122 lines (104 loc) · 3.26 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
" https://www.youtube.com/watch?v=YhqsjUUHj6g
"
" Source the file (enable syntax hilight, etc.) as soon as file is saved
autocmd! bufwritepost .vimrc source %
" Better copy and paste
" Press F2 before pasting large blocks
set pastetoggle=<F2>
set clipboard=unnamed
" rebind leader key
let mapleader = ","
" Remove highlight of last search
noremap <C-n> :nohl<CR>
vnoremap <C-n> :nohl<CR>
inoremap <C-n> :nohl<CR>
" Quick save
noremap <C-Z> :update<CR>
vnoremap <C-Z> <C-C>:update<CR>
inoremap <C-Z> <C-O>:update<CR>
" Quick quit
" Pathogen
" mkdir -p ~/.vim/autoload ~/.vim/bundle
" curl -so ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim
execute pathogen#infect()
filetype off
filetype plugin indent on
syntax on
" show line numbers and length
set number
set tabstop=4 " show existing tab with 4 spaces
set softtabstop=4 "
set shiftwidth=4 " when indenting, use 4 spaces
set shiftround " ??
set expandtab " tab = 4 spaces
set tw=79 " width of doc
set nowrap " don't auto wrap on load
set fo-=t " don't auto warp while typing
set colorcolumn=90 " visual queue for max len
highlight ColorColumn ctermbg=Grey
" Make search case insensitive
set hlsearch
set incsearch
set ignorecase
set smartcase
" swapfiles should be under $HOME (not in eg. dropbox)
set nobackup " get rid of stupid backup files
set nowritebackup
set noswapfile
set directory=$HOME/.vim/swapfiles//
" Color scheme
" mkdir -p ~/.vim/colors && cd ~/.vim/colors
" wget -O wimbat256mod.vim http://www.vim.org/scripts/download_script.php?src=13400
" git clone git://github.com/altercation/vim-colors-solarized.git
set t_Co=256
" colorscheme wombat256mod
let g:solarized_termcolors=256 " Without this, 256 screen term does no work
set background=dark
colorscheme solarized
" Useful settings
set history=700
set undolevels=700
" ============================================================================
" PYTHON IDE
" ============================================================================
" vim-powerline
" cd ~/.vim/bundle
" git clone git://github.com/Lokaltog/vim-powerline.git
" vim-airline
let g:airline#extensions#tabline#enabled = 1
"let g:airline_powerline_fonts = 1
set laststatus=2
" ctrlp
" cd ~/.vim/bundle
" git clone https://github.com/kien/ctrlp.vim.git
let g:ctrlp_max_height = 30
set wildignore+=*.pyc
" jedi-vim
" cd ~/.vim/bundle
" git clone git://github.com/davidhalter/jedi-vim.git
let g:jedi#usages_command = "<leader>z"
let g:jedi#popup_on_dot = 0
let g:jedi#popup_select_first = 0
map <Leader>b Oimport ipdb; ipdb.set_trace() # BREAKPOINT<C-c>
" Better navigating through omnicomplete option list
" " See
" http://stackoverflow.com/questions/2170023/how-to-map-keys-for-popup-menu-in-vim
set completeopt=longest,menuone
function! OmniPopup(action)
if pumvisible()
if a:action == 'j'
return "\<C-N>"
elseif a:action == 'k'
return "\<C-P>"
endif
endif
return a:action
endfunction
inoremap <silent><C-j> <C-R>=OmniPopup('j')<CR>
inoremap <silent><C-k> <C-R>=OmniPopup('k')<CR>
"
" " Python folding
" " mkdir -p ~/.vim/ftplugin
" " wget -O ~/.vim/ftplugin/python_editing.vim
" http://www.vim.org/scripts/download_script.php?src_id=5492
" "" set nofoldenable