-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.local
140 lines (120 loc) · 4.48 KB
/
.vimrc.local
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
set nocursorline " don't highlight current line
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.idea/*,*/.DS_Store,*/vendor,*/tmp/cache
set background=dark
set guifont=Inconsolata\ for\ Powerline:h20
set tags=./tags;/
" Define where emacs is installed. needed for vim orgmode export.
let g:org_export_init_script="~/.emacs/"
let g:org_export_emacs="/usr/local/bin/emacs"
" keyboard shortcuts
inoremap jj <ESC>
inoremap {<space> {<space><space>}<ESC>hi
:map <leader>r :! rubocop -a %<cr>
:nmap f <Plug>(easymotion-sn)
:nmap F <Plug>(easymotion-s)
:command WQ wq
:command Wq wq
:command W w
:command Q q
" Insert todays date by typing 'xdate.' in insert mode.
iabbrev xdate <c-r>=strftime("%d-%m-%y %H:%M:%S")<cr>
" highligh tnd("%")let @+ = expand("%")let @+ = expand("%")"")"")"")search
"set hlsearch
"nmap <leader>hl :let @/ = ""<CR>
" gui settings
if (&t_Co == 256 || has('gui_running'))
if ($TERM_PROGRAM == 'iTerm.app')
colorscheme solarized
endif
endif
let g:two_firewatch_italics=1
colo two-firewatch
" Which browser should vim universal text linking use.
let g:utl_cfg_hdl_scm_http_system = "silent !open -a Safari '%u'"
" How to open images with vim universal text linking.
let g:syntastic_aggregate_errors = 1
let g:syntastic_ruby_checkers = ['mri', 'rubocop']
let g:syntastic_mode_map = {
\ 'mode': 'active',
\ "active_filetypes": ["ruby"] }
" Disambiguate ,a & ,t from the Align plugin, making them fast again.
"
" This section is here to prevent AlignMaps from adding a bunch of mappings" that interfere with the very-common ,a and ,t mappings. This will get run
" at every startup to remove the AlignMaps for the *next* vim startup.
"
" If you do want the AlignMaps mappings, remove this section, remove
" ~/.vim/bundle/Align, and re-run rake in maximum-awesome.
function! s:RemoveConflictingAlignMaps()
if exists("g:loaded_AlignMapsPlugin")
AlignMapsClean
endif
endfunction
command! -nargs=0 RemoveConflictingAlignMaps call s:RemoveConflictingAlignMaps()
silent! autocmd VimEnter * RemoveConflictingAlignMaps
" Vim Airline
"
let g:airline#extensions#branch#enabled = 0 "Disable branch anme in vim airline status bar.
let g:airline_skip_empty_sections = 1
"
" LIGHT LINE
let g:lightline = {
\ 'colorscheme': 'seoul256',
\ 'mode_map': { 'c': 'NORMAL' },
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'relativepath'] ],
\ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'filetype' ] ]
\ },
\ 'component_visible_condition': {
\ 'readonly': '(&filetype!="help"&& &readonly)',
\ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))'
\ },
\ 'component_function': {
\ 'modified': 'LightLineModified',
\ 'fugitive': 'LightLineFugitive',
\ 'filename': 'LightLineFilename',
\ 'fileformat': 'LightLineFileformat',
\ 'filetype': 'LightLineFiletype',
\ 'fileencoding': 'LightLineFileencoding',
\ 'mode': 'LightLineMode',
\ },
\ 'separator': { 'left': '', 'right': '' },
\ 'subseparator': { 'left': '', 'right': '' }
\ }
function! LightLineModified()
return &ft =~ 'help\|vimfiler' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
function! LightLineFilename()
return (&ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
endfunction
function! LightLineFugitive()
if &ft !~? 'vimfiler' && exists("*fugitive#head")
let branch = fugitive#head()
return branch !=# '' ? branch : ''
endif
return ''
endfunction
function! LightLineFileformat()
return winwidth(0) > 70 ? &fileformat : ''
endfunction
function! LightLineFiletype()
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
endfunction
function! LightLineFileencoding()
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
endfunction
function! LightLineMode()
return winwidth(0) > 60 ? lightline#mode() : ''
endfunction
command! -nargs=0 -bar Qargs execute 'args ' . QuickfixFilenames()
function! QuickfixFilenames()
" Building a hash ensures we get each buffer only once
let buffer_numbers = {}
for quickfix_item in getqflist()
let buffer_numbers[quickfix_item['bufnr']] = bufname(quickfix_item['bufnr'])
endfor
return join(values(buffer_numbers))
endfunction