-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
149 lines (123 loc) · 4.37 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
" Configuration file for vim
set modelines=0 " CVE-2007-2438
set autoindent
syntax on
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=2 " more powerful backspacing
" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup nobackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup nobackup
syntax on
set nu
"set cindent
set background=dark
set ruler
set history=1000
set shiftwidth=4 softtabstop=4 expandtab
colorscheme elflord
set showcmd
set autoindent
set nobackup
set noswapfile
set hlsearch
set incsearch
" Auto-completation special characters.
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap { {}<ESC>i
inoremap < <><ESC>i
inoremap ' ''<ESC>i
inoremap " ""<ESC>i
filetype plugin on
let g:pydiction_location = '~/.vim/tools/pydiction/complete-dict'
filetype off " required
"""""""" VIEW SETTINGS """"""""
autocmd InsertLeave * se nocul " high-lighted current line
set ruler
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}"")}
set laststatus=2
set foldenable
set magic
""""""""""""""""""""""""" VUNDLE SETTINGS BEGIN """"""""""""""""""""""""
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
Plugin 'gmarik/Vundle.vim'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'scrooloose/syntastic'
Plugin 'Valloric/YouCompleteMe'
Plugin 'vim-airline/vim-airline'
Plugin 'nvie/vim-flake8'
Plugin 'L9'
Plugin 'The-NERD-tree'
Plugin 'Syntastic'
Plugin 'FuzzyFinder'
Plugin 'Lokaltog/vim-powerline'
Plugin 'Tagbar'
Plugin 'rdnetto/YCM-Generator'
Plugin 'kien/ctrlp.vim'
" Python auto-completation"
Plugin 'davidhalter/jedi'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
filetype plugin indent on " required
call vundle#end() " required
""""""""""""""""""""""""""" VUNDLE SETTINGS END """""""""""""""""""""""""""
" Enable folding with the spacebar
nnoremap <space> za
au BufNewFile, BufRead *.py
\ set tabstop=4
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=4
\ set expandtab
\ set autoindent
\ set fileformat=unix
au BufNewFile, BufRead *.js, *.html, *.css
\ set tabstop=2
\ set softtabstop=2
\ set shiftwidth=2
au BufRead, BufNewFile *.py *.pyw, *.c, *.h match BadWhitespace /\s\+&/
set encoding=utf-8
let python_highlight_all=1
syntax on
set t_Co=256
set mouse=a
set expandtab
filetype indent on
" taglist setting"
let Tlist_Compact_Format=1
let Tlist_Use_Right_Window=1
let Tlist_Show_One_File=1
let Tlist_Auto_Highlight_tag=1
let Tlist_Auto_Update=1
let Tlist_WinWidth=30
let Tlist_Exit_OnlyWindow=1
let Tlist_Use_SingClick=1
nnoremap <silent> <F8> :TlistToggle<CR>
" NERD_Tree settings"
"""""""""""""""""""""""""""" YCM SETTINGS BEGIN """"""""""""""""""""""""""""
let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let mapleader=","
nnoremap <leader>u :YcmCompleter GoToDeclaration<CR>
nnoremap <leader>i :YcmCompleter GoToDefinition<CR>
nnoremap <leader>o :YcmCompleter GoToInclude<CR>
"""""""""""""""""""""""""""" YCM SETTINGS END """"""""""""""""""""""""""""
"""""""""""""""""""""""""""" NERDTree SETTINGS START """"""""""""""""""""""""""""
" Open a NERDTree automatically when vim starts up if no files were specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" Open NERDTree automatically when vim starts up on opening a directory.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
" Open NERDTree with Ctrl+n
map <C-n> :NERDTreeToggle<CR>
" Close vim if the only window left open is a NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" Change default arrows.
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
"""""""""""""""""""""""""""" NERDTree SETTINGS END """"""""""""""""""""""""""""