/
.vimrc
121 lines (101 loc) · 4.03 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
call pathogen#infect()
filetype plugin on
filetype plugin indent on
""" ---- Settings ----
set autoindent " always set autoindenting on
set autoread
set copyindent " copy the previous indentation on autoindenting
set expandtab
set hidden
set hlsearch " highlight search terms
set ignorecase " ignore case when searching
set incsearch " show search matches as you type
set number " always show line numbers
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set showmatch " set show matching parenthesis
set smartcase " ignore case if search pattern is all lowercase, case-sensitive otherwise
set nobackup
set nocompatible
set noic
set noswapfile
set nowrap " don't wrap lines
set softtabstop =4
set tabstop =4 " a tab is four spaces
set backspace =indent,eol,start " allow backspacing over everything in insert mode
set shiftwidth =4 " number of spaces to use for autoindenting
set pastetoggle =<F2>
set t_Co =256
set wildignore =*.py[co]
set wildmode =list:longest,list:full
set clipboard =unnamedplus
set gfn =Monaco\ 10
set background =dark
set tags +=~/.tags/django13.tags
set path +=templates
set includeexpr =substitute(v:fname,'\\.','/','g')
set suffixesadd =.py
set statusline =[%n]%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
set laststatus =2
set completeopt =
let NERDTreeIgnore =['\.pyc']
let g:closetag_default_xml =1
let g:sparkupNextMapping ='<c-h>'
let g:pep8_map ='<F6>'
let g:pyflakes_use_quickfix =0
let g:ackprg ="ack-grep -H --nocolor --nogroup --column"
let g:surround_{char2nr("r")} ="_(u\r)"
let g:virtualenv_directory ="/home/tuxcanfly/.virtualenvs2.7/"
let g:Powerline_symbols ="fancy"
let g:UltiSnipsSnippetDirectories =["UltiSnips", "snippets"]
let g:neocomplcache_enable_at_startup =1
colorscheme hemisu
function! s:Gentags()
:! find . -name '*.py' | xargs ctags
endfunction
command! -nargs=0 Gentags call s:Gentags()
autocmd FileType htmldjango set ft =htmldjango.html
autocmd BufRead,BufNewFile *.json set filetype =json
""" ---- Keybindings ----
" toggle NERDTree
map <F4> :NERDTreeToggle<CR>
" toggle fugitive status
map <silent><leader>s :Gstatus<CR>
" toggle fugitive diff
map <silent><leader>d :Gdiff<CR>
" insert newline but dont enter insert mode
map <silent><leader><Enter> o<Esc>k
" tabbing
map <silent>K :tabnext<CR>
map <silent>J :tabprevious<CR>
map <silent><A-x> :tabclose<CR>
" new tab
map <Leader>t :tabnew<CR>
" Project search
map <leader>g :Ack <cword>
map <leader>gp :Ack --py<cword>
map <leader>gh :Ack --html<cword>
map <leader>gj :Ack --js<cword>
map <leader>gc :Ack --css<cword>
" remove trailing whitespace
map <leader>w :FixWhitespace<CR>
nmap <F5> :Gentags<CR>
nmap <leader>fp :Git push<CR>
nmap <leader>fm :Git pull<CR>
" clear search highlight
nnoremap <leader><space> :noh<CR>
" shortcuts
nnoremap ; :
" open gf in new tab
nnoremap gf <C-W>gf
" clear ^M messup
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
" prevent cursor jumping
noremap <S-Up> <Up>
noremap <S-Down> <Down>
" move between splits
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
" allow the . to execute once for each line of a visual selection
vnoremap . :normal .<CR>