2016-12-26 21:11:19 +08:00
|
|
|
scriptencoding utf-8
|
|
|
|
call unite#custom#source('codesearch', 'max_candidates', 30)
|
|
|
|
call unite#filters#matcher_default#use(['matcher_fuzzy'])
|
|
|
|
call unite#filters#sorter_default#use(['sorter_rank'])
|
|
|
|
call unite#custom#profile('default', 'context', {
|
2017-03-06 23:26:26 +08:00
|
|
|
\ 'safe': 0,
|
|
|
|
\ 'start_insert': 1,
|
|
|
|
\ 'ignorecase' : 1,
|
|
|
|
\ 'short_source_names': 1,
|
|
|
|
\ 'update_time': 200,
|
|
|
|
\ 'direction': 'rightbelow',
|
|
|
|
\ 'winwidth': 40,
|
|
|
|
\ 'winheight': 15,
|
|
|
|
\ 'max_candidates': 100,
|
|
|
|
\ 'no_auto_resize': 1,
|
|
|
|
\ 'vertical_preview': 1,
|
|
|
|
\ 'cursor_line_time': '0.10',
|
|
|
|
\ 'hide_icon': 0,
|
|
|
|
\ 'candidate-icon': ' ',
|
|
|
|
\ 'marked_icon': '✓',
|
|
|
|
\ 'prompt' : '➭ '
|
|
|
|
\ })
|
2016-12-26 21:11:19 +08:00
|
|
|
call unite#custom#profile('source/neobundle/update', 'context', {
|
2017-03-06 23:26:26 +08:00
|
|
|
\ 'start_insert' : 0,
|
|
|
|
\ })
|
2017-03-30 23:08:30 +08:00
|
|
|
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)
|
2017-03-29 21:36:46 +08:00
|
|
|
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)
|
2021-08-18 20:54:54 +08:00
|
|
|
let g:unite_data_directory = get(g:, 'unite_data_directory',g:spacevim_data_dir.'unite')
|
2016-12-26 21:11:19 +08:00
|
|
|
"let g:unite_enable_start_insert=1
|
2017-03-30 23:08:30 +08:00
|
|
|
let g:unite_source_history_yank_enable = get(g:,
|
|
|
|
\ 'unite_source_history_yank_enable', 1)
|
2017-03-29 21:36:46 +08:00
|
|
|
let g:unite_split_rule = get(g:, 'unite_split_rule', 'botright')
|
|
|
|
let g:unite_winheight = get(g:, 'unite_winheight', 25)
|
2017-03-30 23:08:30 +08:00
|
|
|
let g:unite_source_grep_default_opts = get(g:,
|
|
|
|
\ 'unite_source_grep_default_opts',
|
|
|
|
\ '-iRHn'
|
2017-03-06 23:26:26 +08:00
|
|
|
\ . " --exclude='tags'"
|
|
|
|
\ . " --exclude='cscope*'"
|
|
|
|
\ . " --exclude='*.svn*'"
|
|
|
|
\ . " --exclude='*.log*'"
|
|
|
|
\ . " --exclude='*tmp*'"
|
|
|
|
\ . " --exclude-dir='**/tmp'"
|
|
|
|
\ . " --exclude-dir='CVS'"
|
|
|
|
\ . " --exclude-dir='.svn'"
|
|
|
|
\ . " --exclude-dir='.git'"
|
2017-03-29 21:36:46 +08:00
|
|
|
\ . " --exclude-dir='node_modules'")
|
|
|
|
let g:unite_launch_apps = get(g:, 'unite_launch_apps', [
|
2017-03-06 23:26:26 +08:00
|
|
|
\ 'rake',
|
|
|
|
\ 'make',
|
|
|
|
\ 'git pull',
|
2017-03-29 21:36:46 +08:00
|
|
|
\ 'git push'])
|
|
|
|
let g:unite_source_menu_menus = get(g:, 'unite_source_menu_menus', {})
|
2016-12-26 21:11:19 +08:00
|
|
|
let g:unite_source_menu_menus.git = {
|
2017-03-06 23:26:26 +08:00
|
|
|
\ 'description' : ' gestionar repositorios git
|
|
|
|
\ ⌘ [espacio]g',
|
|
|
|
\}
|
2016-12-26 21:11:19 +08:00
|
|
|
let g:unite_source_menu_menus.git.command_candidates = [
|
2017-03-06 23:26:26 +08:00
|
|
|
\['▷ tig ⌘ ,gt',
|
|
|
|
\'normal ,gt'],
|
|
|
|
\['▷ git status (Fugitive) ⌘ ,gs',
|
|
|
|
\'Gstatus'],
|
|
|
|
\['▷ git diff (Fugitive) ⌘ ,gd',
|
|
|
|
\'Gdiff'],
|
|
|
|
\['▷ git commit (Fugitive) ⌘ ,gc',
|
|
|
|
\'Gcommit'],
|
|
|
|
\['▷ git log (Fugitive) ⌘ ,gl',
|
|
|
|
\'exe "silent Glog | Unite quickfix"'],
|
|
|
|
\['▷ git blame (Fugitive) ⌘ ,gb',
|
|
|
|
\'Gblame'],
|
|
|
|
\['▷ git stage (Fugitive) ⌘ ,gw',
|
|
|
|
\'Gwrite'],
|
|
|
|
\['▷ git checkout (Fugitive) ⌘ ,go',
|
|
|
|
\'Gread'],
|
|
|
|
\['▷ git rm (Fugitive) ⌘ ,gr',
|
|
|
|
\'Gremove'],
|
|
|
|
\['▷ git mv (Fugitive) ⌘ ,gm',
|
|
|
|
\'exe "Gmove " input("destino: ")'],
|
|
|
|
\['▷ git push (Fugitive, salida por buffer) ⌘ ,gp',
|
|
|
|
\'Git! push'],
|
|
|
|
\['▷ git pull (Fugitive, salida por buffer) ⌘ ,gP',
|
|
|
|
\'Git! pull'],
|
|
|
|
\['▷ git prompt (Fugitive, salida por buffer) ⌘ ,gi',
|
|
|
|
\'exe "Git! " input("comando git: ")'],
|
|
|
|
\['▷ git cd (Fugitive)',
|
|
|
|
\'Gcd'],
|
|
|
|
\]
|
2016-12-26 21:11:19 +08:00
|
|
|
"===============================================================================
|
|
|
|
" HTTP Status Code Definitions
|
|
|
|
"===============================================================================
|
2017-03-30 23:08:30 +08:00
|
|
|
let g:unite_source_menu_menus.StatusCodeDefinitions = {'description':
|
|
|
|
\ 'HTTP status code definitions <leader>sc'}
|
2016-12-26 21:11:19 +08:00
|
|
|
let g:unite_source_menu_menus.StatusCodeDefinitions.command_candidates = [
|
2017-03-30 23:08:30 +08:00
|
|
|
\['➤ 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"'],
|
2017-03-06 23:26:26 +08:00
|
|
|
\]
|
2017-03-30 23:08:30 +08:00
|
|
|
let g:unite_source_grep_max_candidates = get(g:,
|
|
|
|
\ 'unite_source_grep_max_candidates', 200)
|
2021-09-20 22:07:27 +08:00
|
|
|
" set the unite async command based on spacevim default searcher
|
|
|
|
let [
|
|
|
|
\ s:grep_default_exe,
|
|
|
|
\ s:grep_default_opt,
|
|
|
|
\ s:grep_default_ropt,
|
|
|
|
\ s:grep_default_expr_opt,
|
|
|
|
\ s:grep_default_fix_string_opt,
|
|
|
|
\ s:grep_default_ignore_case,
|
|
|
|
\ s:grep_default_smart_case
|
|
|
|
\ ] = SpaceVim#mapping#search#default_tool()
|
|
|
|
let g:unite_source_grep_command = s:grep_default_exe
|
|
|
|
let g:unite_source_grep_default_opts = join(s:grep_default_opt)
|
|
|
|
let g:unite_source_grep_recursive_opt = join(s:grep_default_ropt)
|
|
|
|
|
|
|
|
let s:async_command = [s:grep_default_exe] +
|
|
|
|
\ s:grep_default_opt +
|
|
|
|
\ s:grep_default_fix_string_opt +
|
|
|
|
\ ['--files', '.']
|
2017-03-30 23:08:30 +08:00
|
|
|
let g:unite_source_rec_async_command = get(g:,
|
|
|
|
\ 'unite_source_rec_async_command',
|
2021-09-20 22:07:27 +08:00
|
|
|
\ s:async_command)
|
2016-12-26 21:11:19 +08:00
|
|
|
call unite#custom#profile('file_rec/async,file_rec/git', 'context', {
|
2017-03-06 23:26:26 +08:00
|
|
|
\ 'start_insert' : 1,
|
|
|
|
\ 'quit' : 1,
|
|
|
|
\ 'split' : 1,
|
|
|
|
\ 'keep_focus' : 1,
|
|
|
|
\ 'winheight' : 20,
|
|
|
|
\ })
|
2017-06-25 13:19:46 +08:00
|
|
|
call unite#custom#source('file_rec/async,file_rec/neovim', 'ignore_globs',
|
|
|
|
\ ['*.png','.git/','*.ttf', '*.eot', '*.woff', '*.svg'])
|
2016-12-26 21:11:19 +08:00
|
|
|
call unite#custom#profile('buffer,buffer_tab', 'context', {
|
2017-03-06 23:26:26 +08:00
|
|
|
\ 'start_insert' : 0,
|
|
|
|
\ 'quit' : 1,
|
|
|
|
\ 'keep_focus' : 1,
|
|
|
|
\ })
|
2017-06-01 20:59:59 +08:00
|
|
|
function! s:view_github_starred_repos() abort
|
|
|
|
if empty(g:unite_source_menu_menus.MyStarredrepos.command_candidates)
|
|
|
|
if UpdateStarredRepos()
|
|
|
|
Unite -silent -ignorecase -winheight=17 -start-insert menu:MyStarredrepos
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
Unite -silent -ignorecase -winheight=17 -start-insert menu:MyStarredrepos
|
|
|
|
endif
|
|
|
|
endfunction
|
2020-07-27 23:21:30 +08:00
|
|
|
" if SpaceVim#layers#isLoaded('tools#mpv')
|
2021-09-20 22:07:27 +08:00
|
|
|
" call SpaceVim#layers#tools#mpv#loadMusics()
|
2020-07-27 23:21:30 +08:00
|
|
|
" endif
|
2016-12-26 21:11:19 +08:00
|
|
|
augroup unite_buffer_feature
|
2017-03-06 23:26:26 +08:00
|
|
|
autocmd FileType unite call s:unite_my_settings()
|
2016-12-26 21:11:19 +08:00
|
|
|
augroup END
|
|
|
|
function! s:unite_my_settings()
|
2017-03-06 23:26:26 +08:00
|
|
|
" Overwrite settings.
|
2017-06-23 00:11:15 +08:00
|
|
|
setlocal nowrap
|
2016-12-26 21:11:19 +08:00
|
|
|
|
2017-03-06 23:26:26 +08:00
|
|
|
" Play nice with supertab
|
|
|
|
let b:SuperTabDisabled=1
|
2018-03-30 21:27:59 +08:00
|
|
|
|
2017-03-06 23:26:26 +08:00
|
|
|
" Enable navigation with control-j and control-k in insert mode
|
2018-03-30 21:27:59 +08:00
|
|
|
imap <buffer> <C-j> <Plug>(unite_select_next_line)
|
|
|
|
nmap <buffer> <C-j> <Plug>(unite_select_next_line)
|
2017-08-06 00:08:03 +08:00
|
|
|
imap <buffer> <TAB> <Plug>(unite_select_next_line)
|
|
|
|
nmap <buffer> <TAB> <Plug>(unite_select_next_line)
|
2018-03-30 21:27:59 +08:00
|
|
|
imap <buffer> <C-k> <Plug>(unite_select_previous_line)
|
|
|
|
nmap <buffer> <C-k> <Plug>(unite_select_previous_line)
|
2017-08-06 00:08:03 +08:00
|
|
|
imap <buffer> <S-Tab> <Plug>(unite_select_previous_line)
|
|
|
|
nmap <buffer> <S-Tab> <Plug>(unite_select_previous_line)
|
2018-03-30 21:27:59 +08:00
|
|
|
imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
|
|
|
|
imap <buffer><expr> j unite#smart_map('j', '')
|
2016-12-26 21:11:19 +08:00
|
|
|
|
2018-03-30 21:27:59 +08:00
|
|
|
" Runs "split" action by <C-s>.
|
|
|
|
imap <silent><buffer><expr> <C-s> unite#do_action('split')
|
|
|
|
nmap <silent><buffer><expr> <C-s> unite#do_action('split')
|
2016-12-26 21:11:19 +08:00
|
|
|
|
2018-09-25 23:27:56 +08:00
|
|
|
" Runs "vsplit" action by <C-v>.
|
|
|
|
imap <silent><buffer><expr> <C-v> unite#do_action('vsplit')
|
|
|
|
nmap <silent><buffer><expr> <C-v> unite#do_action('vsplit')
|
|
|
|
|
|
|
|
" Runs "tabopen" action by <C-t>.
|
|
|
|
imap <silent><buffer><expr> <C-t> unite#do_action('tabopen')
|
|
|
|
nmap <silent><buffer><expr> <C-t> unite#do_action('tabopen')
|
2016-12-26 21:11:19 +08:00
|
|
|
|
2017-03-06 23:26:26 +08:00
|
|
|
imap <buffer> ' <Plug>(unite_quick_match_default_action)
|
|
|
|
nmap <buffer> ' <Plug>(unite_quick_match_default_action)
|
|
|
|
nmap <buffer> <C-z> <Plug>(unite_toggle_transpose_window)
|
|
|
|
imap <buffer> <C-z> <Plug>(unite_toggle_transpose_window)
|
|
|
|
imap <buffer> <C-y> <Plug>(unite_narrowing_path)
|
|
|
|
nmap <buffer> <C-y> <Plug>(unite_narrowing_path)
|
|
|
|
nmap <buffer> <C-e> <Plug>(unite_toggle_auto_preview)
|
|
|
|
imap <buffer> <C-e> <Plug>(unite_toggle_auto_preview)
|
|
|
|
nmap <buffer> <C-r> <Plug>(unite_narrowing_input_history)
|
|
|
|
imap <buffer> <C-r> <Plug>(unite_narrowing_input_history)
|
|
|
|
let unite = unite#get_current_unite()
|
|
|
|
if unite.profile_name ==# 'search'
|
|
|
|
nnoremap <silent><buffer><expr> r unite#do_action('replace')
|
|
|
|
else
|
|
|
|
nnoremap <silent><buffer><expr> r unite#do_action('rename')
|
|
|
|
endif
|
|
|
|
nnoremap <silent><buffer><expr> cd unite#do_action('lcd')
|
2016-12-26 21:11:19 +08:00
|
|
|
endfunction
|
2017-03-06 23:26:26 +08:00
|
|
|
|
2017-03-30 23:08:30 +08:00
|
|
|
" vim:set et sw=2 cc=80:
|