-
Notifications
You must be signed in to change notification settings - Fork 0
/
defaults.vim
executable file
·171 lines (113 loc) · 4.58 KB
/
defaults.vim
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
scriptencoding utf-8
syntax on " enable syntax-highlighting
if has("gui_running")
set guioptions=gc " Disable all GUI elements and enable console based dialogs for simple queries
set guifont=Droid_Sans_Mono_For_Powerline_Plus_Nerd_File_Types:h13
else
set t_Co=256
" Allows cursor change in tmux mode
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
set t_ut=
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
endif
if has('mouse')
set mouse=a " Enable mouse support
set mousemodel=popup " Use the mouse for copy/paste with popup in gui vim
set mousehide " Hide cursor while typing
if exists("$TMUX")
" tmux knows the extended mouse mode
if has('nvim')
else
set ttymouse=xterm2
endif
endif
endif
if has('multi_byte')
set listchars=tab:│\ ,trail:·,eol:¶,extends:→,precedes:←,nbsp:×
" Vertical split chars
set fillchars=stl:\ ,stlnc:\ ,vert:│
if has("linebreak")
let &sbr = nr2char(8618).' ' " Show ↪ at the beginning of wrapped lines
endif
endif
if has("autocmd")
" Enable file type detection.
filetype plugin indent on
" Auto complete options for Python (we use jedi by default)
au FileType python set omnifunc=jedi#completions
" Auto complete options for JavaScript
au FileType javascript set omnifunc=javascriptcomplete#CompleteJS
" Python: jedi-vim disable auto preview docs
au FileType python setlocal completeopt-=preview
" Python indentation
" About nosmartindent please look this link
" http://stackoverflow.com/questions/2063175/vim-insert-mode-comments-go-to-start-of-line
au FileType python setlocal expandtab shiftwidth=4 tabstop=8 nosmartindent nofoldenable
" Django autocomplete options
au FileType html set filetype=htmldjango
au FileType htmldjango set omnifunc=htmldjangocomplete#CompleteDjango
" Folding by marker for vim files
au FileType vim setlocal foldmethod=marker foldlevel=0
" JavaScript indentation
au FileType javascript setlocal expandtab shiftwidth=2 tabstop=8
endif
set background=dark " Backgroud
" Disable timeout for Esc key
set ttimeout
set ttimeoutlen=0
set notimeout
" Autocomplete options:
" longest: do not select the first candidate
" set completeopt=menuone,longest
set completeopt=menuone,longest,preview
set confirm " Get a dialog when :q, :w, or :wq fails
let mapleader = "," " Map leader
let maplocalleader = "_" " Local leader
set hlsearch " Highlight search terms (very useful!)
set display+=lastline " Display lastline instead of @
set incsearch " Show search matches while typing
set lazyredraw " Don't redraw while executing macros (good performance config)
set laststatus=2 " Enable statusline
set magic " For regular expressions turn magic on
set ignorecase " Searches are Non Case-sensitive
set smartcase " Do smart case matching when searching
"set showmatch " Show matching brackets when text indicator is over them
set showcmd " Show incomplete cmds down the bottom
set title " Show title
set acd " Vim will change the current working directory whenever you open a file
set expandtab " Use space instead of tab
set autoread " Reload files changed outside automatically
set tabstop=4 " 1 tab == 4 spaces
set shiftwidth=4
set backspace=2
set smarttab " Be smart when using tabs
set autoindent " Enable auto indent
set smartindent " Smart indent
set wrap " Enable word wrap
set noerrorbells visualbell t_vb= " No annoying sound on errors
set termencoding=utf-8 " Terminal encoding
set fileencodings=utf8,cp1251 " Supported file encodings
set number " Enable line numbers
set ruler " Always display cursor position
set hidden " A buffer becomes hidden when it is abandoned
set noswapfile " Disable swap files
set undofile " Persistent undo
set noautochdir " Change the current working directory whenever you open a file
set wildmenu " Turn on the Wild menu
set wildmode=list:longest,list:full " Wildmenu configuration
set wildignore+=*.o,*.pyc,*.jpg,*.png,*.gif,*.db,*.obj,.git " Ignore compiled files
set conceallevel=2 " Conceal level
set ttyfast " Optimize for fast terminal connections
set foldmethod=indent " Folding method by default
set foldlevel=3 " Folding level
set path=.,,**
set noshowmode " Suppress mode change messages
" Store swap, backup and undo files in fixed location
set dir=/var/tmp//,/tmp//,.
set backupdir=/var/tmp//,/tmp//,.
set undodir=/var/tmp//,/tmp//,.