1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 10:20:05 +08:00

Format unite config

This commit is contained in:
wsdjeg 2017-03-30 23:08:30 +08:00
parent e8992de68a
commit 692871bdc0
2 changed files with 170 additions and 85 deletions

View File

@ -27,7 +27,7 @@
""
" Version of SpaceVim , this value can not be changed.
scriptencoding utf-8
let g:spacevim_version = '0.2.0'
let g:spacevim_version = '0.3.0-dev'
lockvar g:spacevim_version
""
" Change the default indentation of SpaceVim. Default is 2.

View File

@ -23,20 +23,29 @@ call unite#custom#profile('default', 'context', {
call unite#custom#profile('source/neobundle/update', 'context', {
\ 'start_insert' : 0,
\ })
let g:unite_source_codesearch_ignore_case = get(g:, 'unite_source_codesearch_ignore_case', 1)
let g:unite_source_buffer_time_format = get(g:, 'unite_source_buffer_time_format', '(%m-%d-%Y %H:%M:%S) ')
let g:unite_source_file_mru_time_format = get(g:, 'unite_source_file_mru_time_format', '(%m-%d-%Y %H:%M:%S) ')
let g:unite_source_directory_mru_time_format = get(g:, 'unite_source_directory_mru_time_format', '(%m-%d-%Y %H:%M:%S) ')
let g:unite_source_directory_mru_limit = get(g:, 'unite_source_directory_mru_limit', 80)
let g:unite_source_file_rec_max_depth = get(g:, 'unite_source_file_rec_max_depth', 6)
let g:unite_source_codesearch_ignore_case = get(g:,
\ 'unite_source_codesearch_ignore_case', 1)
let g:unite_source_buffer_time_format = get(g:,
\ 'unite_source_buffer_time_format', '(%m-%d-%Y %H:%M:%S) ')
let g:unite_source_file_mru_time_format = get(g:,
\ 'unite_source_file_mru_time_format', '(%m-%d-%Y %H:%M:%S) ')
let g:unite_source_directory_mru_time_format = get(g:,
\ 'unite_source_directory_mru_time_format', '(%m-%d-%Y %H:%M:%S) ')
let g:unite_source_directory_mru_limit = get(g:,
\ 'unite_source_directory_mru_limit', 80)
let g:unite_source_file_rec_max_depth = get(g:,
\ 'unite_source_file_rec_max_depth', 6)
let g:unite_enable_ignore_case = get(g:, 'unite_enable_ignore_case', 1)
let g:unite_enable_smart_case = get(g:, 'unite_enable_smart_case', 1)
let g:unite_data_directory = get(g:, 'unite_data_directory','~/.cache/unite')
"let g:unite_enable_start_insert=1
let g:unite_source_history_yank_enable = get(g:, 'unite_source_history_yank_enable', 1)
let g:unite_source_history_yank_enable = get(g:,
\ 'unite_source_history_yank_enable', 1)
let g:unite_split_rule = get(g:, 'unite_split_rule', 'botright')
let g:unite_winheight = get(g:, 'unite_winheight', 25)
let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', '-iRHn'
let g:unite_source_grep_default_opts = get(g:,
\ 'unite_source_grep_default_opts',
\ '-iRHn'
\ . " --exclude='tags'"
\ . " --exclude='cscope*'"
\ . " --exclude='*.svn*'"
@ -90,100 +99,164 @@ let g:unite_source_menu_menus.git.command_candidates = [
"===============================================================================
" HTTP Status Code Definitions
"===============================================================================
let g:unite_source_menu_menus.StatusCodeDefinitions = {'description': 'HTTP status code definitions <leader>sc'}
let g:unite_source_menu_menus.StatusCodeDefinitions = {'description':
\ 'HTTP status code definitions <leader>sc'}
let g:unite_source_menu_menus.StatusCodeDefinitions.command_candidates = [
\['➤ 100 Continue ', 'echo "Continue"'],
\['➤ 101 Switching Protocols ', 'echo "Switching Protocols"'],
\['➤ 200 OK ', 'echo "OK"'],
\['➤ 201 Created ', 'echo "Created"'],
\['➤ 202 Accepted ', 'echo "Accepted"'],
\['➤ 203 Non-Authoritative Information ', 'echo "Non-Authoritative Information"'],
\['➤ 204 No Content ', 'echo "No Content"'],
\['➤ 205 Reset Content ', 'echo "Reset Content"'],
\['➤ 206 Partial Content ', 'echo "Partial Content"'],
\['➤ 300 Multiple Choices ', 'echo "Multiple Choices"'],
\['➤ 301 Moved Permanently ', 'echo "Moved Permanently"'],
\['➤ 302 Found ', 'echo "Found"'],
\['➤ 303 See Other ', 'echo "See Other"'],
\['➤ 304 Not Modified ', 'echo "Not Modified"'],
\['➤ 305 Use Proxy ', 'echo "Use Proxy"'],
\['➤ 307 Temporary Redirect ', 'echo "Temporary Redirect"'],
\['➤ 400 Bad Request ', 'echo "Bad Request"'],
\['➤ 401 Unauthorized ', 'echo "Unauthorized"'],
\['➤ 402 Payment Required ', 'echo "Payment Required"'],
\['➤ 403 Forbidden ', 'echo "Forbidden"'],
\['➤ 404 Not Found ', 'echo "Not Found"'],
\['➤ 405 Method Not Allowed ', 'echo "Method Not Allowed"'],
\['➤ 406 Not Acceptable ', 'echo "Not Acceptable"'],
\['➤ 407 Proxy Authentication Required ', 'echo "Proxy Authoritative Required"'],
\['➤ 408 Request Timeout ', 'echo "Request Timeout"'],
\['➤ 409 Conflict ', 'echo "Conflict"'],
\['➤ 410 Gone ', 'echo "Gone"'],
\['➤ 411 Length Required ', 'echo "Length Required"'],
\['➤ 412 Precondition Failed ', 'echo "Precondition Failed"'],
\['➤ 413 Request Entity Too Large ', 'echo "Request Entity Too Large"'],
\['➤ 414 Request-URI Too Long ', 'echo "Request-URI Too Long"'],
\['➤ 415 Unsupported Media Type ', 'echo "Unsupported Media Type"'],
\['➤ 416 Requested Range Not Satisfiable ', 'echo "Requested Range Not Satisfiable"'],
\['➤ 417 Expectation Failed ', 'echo "Expectation Failed"'],
\['➤ 422 Unprocessable Entity ', 'echo "Unprocessable Entity"'],
\['➤ 500 Internal Server Error ', 'echo "Internal Server Error"'],
\['➤ 501 Not Implemented ', 'echo "Not Implemented"'],
\['➤ 502 Bad Gateway ', 'echo "Bad Gateway"'],
\['➤ 503 Service Unavailable ', 'echo "Service Unavailable"'],
\['➤ 504 Gateway Timeout ', 'echo "Gateway Timeout"'],
\['➤ 505 HTTP Version Not Supported ', 'echo "HTTP Version Not Supported"'],
\['➤ 100 Continue ',
\ 'echo "Continue"'],
\['➤ 101 Switching Protocols ',
\ 'echo "Switching Protocols"'],
\['➤ 200 OK ',
\ 'echo "OK"'],
\['➤ 201 Created ',
\ 'echo "Created"'],
\['➤ 202 Accepted ',
\ 'echo "Accepted"'],
\['➤ 203 Non-Authoritative Information ',
\ 'echo "Non-Authoritative Information"'],
\['➤ 204 No Content ',
\ 'echo "No Content"'],
\['➤ 205 Reset Content ',
\ 'echo "Reset Content"'],
\['➤ 206 Partial Content ',
\ 'echo "Partial Content"'],
\['➤ 300 Multiple Choices ',
\ 'echo "Multiple Choices"'],
\['➤ 301 Moved Permanently ',
\ 'echo "Moved Permanently"'],
\['➤ 302 Found ',
\ 'echo "Found"'],
\['➤ 303 See Other ',
\ 'echo "See Other"'],
\['➤ 304 Not Modified ',
\ 'echo "Not Modified"'],
\['➤ 305 Use Proxy ',
\ 'echo "Use Proxy"'],
\['➤ 307 Temporary Redirect ',
\ 'echo "Temporary Redirect"'],
\['➤ 400 Bad Request ',
\ 'echo "Bad Request"'],
\['➤ 401 Unauthorized ',
\ 'echo "Unauthorized"'],
\['➤ 402 Payment Required ',
\ 'echo "Payment Required"'],
\['➤ 403 Forbidden ',
\ 'echo "Forbidden"'],
\['➤ 404 Not Found ',
\ 'echo "Not Found"'],
\['➤ 405 Method Not Allowed ',
\ 'echo "Method Not Allowed"'],
\['➤ 406 Not Acceptable ',
\ 'echo "Not Acceptable"'],
\['➤ 407 Proxy Authentication Required ',
\ 'echo "Proxy Authoritative Required"'],
\['➤ 408 Request Timeout ',
\ 'echo "Request Timeout"'],
\['➤ 409 Conflict ',
\ 'echo "Conflict"'],
\['➤ 410 Gone ',
\ 'echo "Gone"'],
\['➤ 411 Length Required ',
\ 'echo "Length Required"'],
\['➤ 412 Precondition Failed ',
\ 'echo "Precondition Failed"'],
\['➤ 413 Request Entity Too Large ',
\ 'echo "Request Entity Too Large"'],
\['➤ 414 Request-URI Too Long ',
\ 'echo "Request-URI Too Long"'],
\['➤ 415 Unsupported Media Type ',
\ 'echo "Unsupported Media Type"'],
\['➤ 416 Requested Range Not Satisfiable ',
\ 'echo "Requested Range Not Satisfiable"'],
\['➤ 417 Expectation Failed ',
\ 'echo "Expectation Failed"'],
\['➤ 422 Unprocessable Entity ',
\ 'echo "Unprocessable Entity"'],
\['➤ 500 Internal Server Error ',
\ 'echo "Internal Server Error"'],
\['➤ 501 Not Implemented ',
\ 'echo "Not Implemented"'],
\['➤ 502 Bad Gateway ',
\ 'echo "Bad Gateway"'],
\['➤ 503 Service Unavailable ',
\ 'echo "Service Unavailable"'],
\['➤ 504 Gateway Timeout ',
\ 'echo "Gateway Timeout"'],
\['➤ 505 HTTP Version Not Supported ',
\ 'echo "HTTP Version Not Supported"'],
\]
nnoremap <silent><leader>sc :Unite -silent -winheight=17 -start-insert menu:StatusCodeDefinitions<CR>
let g:unite_source_grep_max_candidates = get(g:, 'unite_source_grep_max_candidates', 200)
nnoremap <silent><leader>sc :Unite -silent -winheight=17
\ -start-insert menu:StatusCodeDefinitions<CR>
let g:unite_source_grep_max_candidates = get(g:,
\ 'unite_source_grep_max_candidates', 200)
if executable('hw')
" Use hw (highway)
" https://github.com/tkengo/highway
let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'hw')
let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', '--no-group --no-color')
let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '')
let g:unite_source_grep_default_opts = get(g:,
\ 'unite_source_grep_default_opts', '--no-group --no-color')
let g:unite_source_grep_recursive_opt = get(g:,
\ 'unite_source_grep_recursive_opt', '')
elseif executable('ag')
" Use ag (the silver searcher)
" https://github.com/ggreer/the_silver_searcher
let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'ag')
let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts',
let g:unite_source_grep_default_opts = get(g:,
\ 'unite_source_grep_default_opts',
\ '-i --line-numbers --nocolor --nogroup --hidden --ignore ' .
\ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr''')
let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '')
\ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr''')
let g:unite_source_grep_recursive_opt = get(g:,
\ 'unite_source_grep_recursive_opt', '')
elseif executable('pt')
" Use pt (the platinum searcher)
" https://github.com/monochromegane/the_platinum_searcher
let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'pt')
let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', '--nogroup --nocolor')
let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '')
let g:unite_source_grep_default_opts = get(g:,
\ 'unite_source_grep_default_opts', '--nogroup --nocolor')
let g:unite_source_grep_recursive_opt = get(g:,
\ 'unite_source_grep_recursive_opt', '')
elseif executable('ack-grep')
" Use ack
" http://beyondgrep.com/
let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'ack-grep')
let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts',
let g:unite_source_grep_command = get(g:,
\ 'unite_source_grep_command', 'ack-grep')
let g:unite_source_grep_default_opts = get(g:,
\ 'unite_source_grep_default_opts',
\ '-i --no-heading --no-color -k -H')
let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '')
let g:unite_source_grep_recursive_opt = get(g:,
\ 'unite_source_grep_recursive_opt', '')
elseif executable('ack')
let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'ack')
let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', '-i --no-heading --no-color -k -H')
let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '')
let g:unite_source_grep_default_opts = get(g:,
\ 'unite_source_grep_default_opts', '-i --no-heading --no-color -k -H')
let g:unite_source_grep_recursive_opt = get(g:,
\ 'unite_source_grep_recursive_opt', '')
elseif executable('jvgrep')
" Use jvgrep
" https://github.com/mattn/jvgrep
let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'jvgrep')
let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', '-i --exclude ''\.(git|svn|hg|bzr)''')
let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '-R')
let g:unite_source_grep_command = get(g:,
\ 'unite_source_grep_command', 'jvgrep')
let g:unite_source_grep_default_opts = get(g:,
\ 'unite_source_grep_default_opts',
\ '-i --exclude ''\.(git|svn|hg|bzr)''')
let g:unite_source_grep_recursive_opt = get(g:,
\ 'unite_source_grep_recursive_opt', '-R')
elseif executable('beagrep')
" Use beagrep
" https://github.com/baohaojun/beagrep
let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'beagrep')
let g:unite_source_grep_command = get(g:,
\ 'unite_source_grep_command', 'beagrep')
endif
let g:unite_source_rec_async_command = get(g:, 'unite_source_rec_async_command',
let g:unite_source_rec_async_command = get(g:,
\ 'unite_source_rec_async_command',
\ ['ag', '--follow', '--nocolor', '--nogroup',
\ '--hidden', '-g', ''])
nnoremap <silent><leader>ufa :<C-u>Unite -no-split -buffer-name=Mixed -start-insert file file_mru file_rec buffer<cr>
nnoremap <silent><leader>ufr :<C-u>Unite -buffer-name=files file_rec/async:!<cr>
nnoremap <silent><leader>ufg :<C-u>Unite -buffer-name=git-repo file_rec/git<cr>
nnoremap <silent><leader>ufa :<C-u>Unite -no-split
\ -buffer-name=Mixed -start-insert file file_mru file_rec buffer<cr>
nnoremap <silent><leader>ufr :<C-u>Unite
\ -buffer-name=files file_rec/async:!<cr>
nnoremap <silent><leader>ufg :<C-u>Unite
\ -buffer-name=git-repo file_rec/git<cr>
call unite#custom#profile('file_rec/async,file_rec/git', 'context', {
\ 'start_insert' : 1,
\ 'quit' : 1,
@ -191,11 +264,16 @@ call unite#custom#profile('file_rec/async,file_rec/git', 'context', {
\ 'keep_focus' : 1,
\ 'winheight' : 20,
\ })
call unite#custom#source('file_rec/async', 'ignore_globs',['*.png','.git/','*.ttf'])
nnoremap <silent><leader>uf :<C-u>Unite -no-split -buffer-name=files -start-insert file<cr>
nnoremap <silent><leader>ufm :<C-u>Unite -no-split -buffer-name=mru -start-insert file_mru<cr>
nnoremap <silent><leader>ubf :<C-u>Unite -buffer-name=buffer buffer<cr>
nnoremap <silent><leader>utb :<C-u>Unite -buffer-name=buffer_tab buffer_tab<cr>
call unite#custom#source('file_rec/async', 'ignore_globs',
\ ['*.png','.git/','*.ttf'])
nnoremap <silent><leader>uf :<C-u>Unite
\ -no-split -buffer-name=files -start-insert file<cr>
nnoremap <silent><leader>ufm :<C-u>Unite
\ -no-split -buffer-name=mru -start-insert file_mru<cr>
nnoremap <silent><leader>ubf :<C-u>Unite
\ -buffer-name=buffer buffer<cr>
nnoremap <silent><leader>utb :<C-u>Unite
\ -buffer-name=buffer_tab buffer_tab<cr>
call unite#custom#profile('buffer,buffer_tab', 'context', {
\ 'start_insert' : 0,
\ 'quit' : 1,
@ -208,14 +286,18 @@ nnoremap <silent><leader>f :<c-u>Unite tag/include:<C-R><C-w><CR>
nnoremap <silent><leader>ff :<c-u>Unite tag/include -start-insert<CR>
"" grep dictionay
""" For searching the word in the cursor in the current directory
nnoremap <silent><leader>v :Unite -auto-preview -no-split grep:.::<C-R><C-w><CR>
nnoremap <silent><leader>v :Unite
\ -auto-preview -no-split grep:.::<C-R><C-w><CR>
""" For searching the word handin
nnoremap <silent><leader>vs :Unite -auto-preview -no-split grep:.<CR>
""" For searching the word in the cursor in the current buffer
noremap <silent><leader>vf :Unite -auto-preview -no-split grep:%::<C-r><C-w><CR>
noremap <silent><leader>vf :Unite
\ -auto-preview -no-split grep:%::<C-r><C-w><CR>
""" For searching the word in the cursor in all opened buffer
noremap <silent><leader>va :Unite -auto-preview -no-split grep:$buffers::<C-r><C-w><CR>
nnoremap <silent><Leader>bl :<C-u>Unite -start-insert -buffer-name=buffer buffer<cr>
noremap <silent><leader>va :Unite
\ -auto-preview -no-split grep:$buffers::<C-r><C-w><CR>
nnoremap <silent><Leader>bl :<C-u>Unite
\ -start-insert -buffer-name=buffer buffer<cr>
nnoremap <silent><Leader>ta :<C-u>Unite -start-insert -buffer-name=tag tag<cr>
" search plugin
" :Unite neobundle/search
@ -223,8 +305,11 @@ nnoremap <silent><Leader>ta :<C-u>Unite -start-insert -buffer-name=tag tag<cr>
nnoremap <silent><leader>ugg :Unite -silent -start-insert menu:git<CR>
nnoremap <silent><leader>ugf :UniteWithCursorWord file_rec/async<CR>
nnoremap <silent><leader>ugt :UniteWithCursorWord tag<CR>
nnoremap <silent><Leader>ls :Unite -silent -ignorecase -winheight=17 -start-insert menu:MyStarredrepos<CR>
nnoremap <silent><Leader>lm :Unite -silent -ignorecase -winheight=17 -start-insert menu:MpvPlayer<CR>
nnoremap <silent><Leader>ls :Unite
\ -silent -ignorecase -winheight=17
\ -start-insert menu:MyStarredrepos<CR>
nnoremap <silent><Leader>lm :Unite
\ -silent -ignorecase -winheight=17 -start-insert menu:MpvPlayer<CR>
call zvim#util#loadMusics()
augroup unite_buffer_feature
autocmd FileType unite call s:unite_my_settings()
@ -279,4 +364,4 @@ function! s:unite_my_settings()
imap <silent><buffer><expr> <C-s> unite#do_action('split')
endfunction
" vim:set et sw=2:
" vim:set et sw=2 cc=80: