-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
182 lines (153 loc) · 4 KB
/
vimrc
File metadata and controls
182 lines (153 loc) · 4 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
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
172
173
174
175
176
177
178
179
180
181
182
execute pathogen#infect()
execute pathogen#helptags()
filetype on
filetype plugin on
syntax on
let python_highlight_all=1
set term=xterm-256color
set encoding=utf-8
scriptencoding utf-8
set clipboard=unnamed
set backupcopy=yes
set colorcolumn=100
set number
set relativenumber
set noshowmode
set nocompatible
set laststatus=2
set path+=**
set tags=tags;
set wildmenu
let mapleader=" "
set backspace=indent,eol,start
"leader maps
map <leader>s :source ~/.vimrc<CR>
map <leader>ff :NERDTreeFind<CR>
map <leader>co :set cursorcolumn! <bar> highlight CursorColumn guibg=yellow<CR>
" use escape to remove highlight from search
nnoremap <silent> <Esc> :nohlsearch<Bar>:echo<CR>
nnoremap <esc>^[ <esc>^[
set updatetime=250
set hidden
set history=100
filetype indent on
set nowrap
set tabstop=2
set shiftwidth=2
set expandtab
set smartindent
set autoindent
" remove whitespaces on save
autocmd BufWritePre * :%s/\s\+$//e
" search highlight found words
set hlsearch
" show matching parens
set showmatch
" theme
colorscheme nova
" togglecursor setup
let g:togglecursor_insert = 'blinking_underline'
" auto-tags
let g:autotagTagsFile='tags'
" delimitMate settings
let g:delimitMate_expand_cr = 1
let g:delimitMate_expand_space = 1
let g:delimitMate_jump_expansion = 1
let g:delimitMate_balance_matchpairs = 1
" emmet settings
let g:user_emmet_install_global = 0
autocmd FileType html,css EmmetInstall
" You complete me setup
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_semantic_triggers = {
\ 'elm': ['.'],
\}
" ale setup
let g:ale_linters = {
\ 'javascript': ['eslint'],
\ 'elixir': ['credo'],
\ 'python': ['flake8'],
\ 'elm': ['elm-make']
\}
let g:ale_sign_error = '❌'
let g:ale_sign_warning = '⚠️'
" nerd-tree setup
map <C-\> :NERDTreeToggle<CR>
let NERDTreeIgnore=['\.DS_Store', '\~$', '\.swp', '\.pyc', '__pycache__']
" nerd-commenter setup
let g:NERDSpaceDelims = 1
" command-t
let g:CommandTFileScanner = 'git'
" vim-wiki settings
let wiki = {}
let wiki.nested_syntaxes = {'javascript': 'js', 'python': 'python'}
let g:wiki_list = [wiki]
" dravisual settings
vmap <expr> <LEFT> DVB_Drag('left')
vmap <expr> <RIGHT> DVB_Drag('right')
vmap <expr> <DOWN> DVB_Drag('down')
vmap <expr> <UP> DVB_Drag('up')
vmap <expr> D DVB_Duplicate()
"Remove any introduced trailing whitespace after moving
let g:DVB_TrimWS = 1
" lightline setup
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'fugitive', 'filename' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'LightLineFugitive',
\ 'readonly': 'LightLineReadonly',
\ 'modified': 'LightLineModified',
\ 'filename': 'LightLineFilename'
\ },
\ 'separator': { 'left': '⮀', 'right': '⮂' },
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
\ }
"python with virtualenv support
py << EOF
import os
import sys
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
EOF
" elm
let g:elm_format_autosave=1
function! LightLineModified()
if &filetype == "help"
return ""
elseif &modified
return "+"
elseif &modifiable
return ""
else
return ""
endif
endfunction
function! LightLineReadonly()
if &filetype == "help"
return ""
elseif &readonly
return "⭤"
else
return ""
endif
endfunction
function! LightLineFugitive()
if exists("*fugitive#head")
let branch = fugitive#head()
return branch !=# '' ? '⭠ '.branch : ''
endif
return ''
endfunction
function! LightLineFilename()
let nr = bufnr('')
return nr . ':' . ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
\ ('' != expand('%:t') ? expand('%:t') : '[No Name]') .
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
endfunction