Code Monkey home page Code Monkey logo

unite.vim's Introduction

Stories in Ready Unite.vim

Note: Active development on denite.nvim has stopped. The only future changes will be bug fixes.

Please see ddu.vim.

The unite or unite.vim plug-in can search and display information from arbitrary sources like files, buffers, recently used files or registers. You can run several pre-defined actions on a target displayed in the unite window.

The difference between unite and similar plug-ins like fuzzyfinder, ctrl-p or ku is that unite provides an integration interface for several sources and you can create new interfaces using unite.

Usage

Join the chat at https://gitter.im/Shougo/unite.vim

Run unite to display files and buffers as sources to pick from.

:Unite file buffer

Run unite with an initial filter value (foo) to narrow down files.

:Unite -input=foo file

If you start unite it splits the window horizontally and pops up from the top of Vim by default.

:Unite file

The example call above lists all the files in the current directory. You can choose one of them in the unite window by moving the cursor up and down as usual with j and k. If you type Enter on an active candidate it will open it in a new buffer. Enter triggers the default action for a candidate which is "open" for candidates of the kind "file". You can also select an alternative action for a candidate with . See also unite-action to read on about actions.

You can also narrow down the list of candidates by a keyword. If you change into the insert mode inside of a unite window, the cursor drops you behind the ">" in the second line from above. There you can start typing to filter the candidates. You can also use the wild card * as an arbitrary character sequence. For example,

*hisa

matches hisa, ujihisa, or ujihisahisa. Furthermore, two consecutive wild cards match a directory recursively.

**/foo

So the example above matches bar/foo or buzz/bar/foo. Note: The unite action file_rec does a recursive file matching by default without the need to set wildcards.

You can also specify multiple keywords to narrow down the candidates. Multiple keywords need to be separated either by a space " " or a dash "|". The examples below match for candidates that meet both conditions "foo" and "bar".

foo bar
foo|bar

You can also specify negative conditions with an exclamation mark "!". This matches candidates that meet "foo" but do not meet "bar".

foo !bar

Wild cards are added automatically if you add a "/" in the filter and you have specified "files" as the buffer name with the option "-buffer-name". That's handy in case you select files with unite.

:Unite -buffer-name=files file

See also unite_default_key_mappings for other actions.

Install

Install the distributed files into your Vim script directory which is usually ~/.vim/, or $HOME/vimfiles on Windows. You should consider using one of the famous package managers for Vim like vundle or neobundle to install the plugin.

After installation you can run unite with the :Unite command and append the sources to the command you wish to select from as parameters. However, it's a pain in the ass to run the command explicitly every time, so I recommend you to set a key mapping for the command. See :h unite.

Note: MRU sources are splitted. To use mru sources, you must install neomru. https://github.com/Shougo/neomru.vim

Resources

Screen shots

unite action source

Unite action source.

unite output source

Unite output source.

unite mapping source

Unite mapping source.

unite menu source

Unite menu source.

unite menu source with customization

Unite menu source with customization.

let g:unite_source_menu_menus = get(g:,'unite_source_menu_menus',{})
let g:unite_source_menu_menus.git = {
    \ 'description' : '            gestionar repositorios git
        \                            ⌘ [espacio]g',
    \}
let g:unite_source_menu_menus.git.command_candidates = [
    \['▷ 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'],
    \]
nnoremap <silent>[menu]g :Unite -silent -start-insert menu:git<CR>

Video

https://www.youtube.com/watch?v=fwqhBSxhGU0&hd=1

It is a good introduction about the possibilities of Unite by ReneFroger.

Special Thanks

unite.vim's People

Contributors

akiradeveloper avatar blueyed avatar cohama avatar cpfaff avatar crazymaster avatar csexton avatar dear avatar dlee avatar h1mesuke avatar itchyny avatar joelmo avatar joker1007 avatar justinmk avatar lambdalisue avatar lilyball avatar louispan avatar malblue avatar milly avatar nigorojr avatar osyo-manga avatar shougo avatar smackesey avatar t9md avatar thalesmello avatar thinca avatar todesking avatar tyru avatar ujihisa avatar wilywampa avatar zhaocai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unite.vim's Issues

UniteWithInput が入力した絞込みテキストをパスと見なしている

:UniteWithInput を使ってみたところ、入力した絞込みテキストの末尾に勝手に / が付加されてしまい、こちらが意図した絞込みが行えません。

コードを見てみたところ、入力される絞り込みテキストをディレクトリのパスと見なしているようなのですが、ここは単に input() の返値を l:options.input に設定するだけでいいのでは?

A small bug on UniteWithInput

Based on the help below, I should use space to separate multiple keywords search.

You may specify multiple keywords to narrow down, separating by spaces.
>
foo bar

But if I search using the following mapping and input foo bar

nnoremap <silent> [unite]hi  :<C-u>UniteWithInput help<CR>

Unite would search for foo\ bar. Consequently, the search returns nothing.

Lots of errors.

Hello, I was curious to test Unite.vim but I have a very large number of errors. A good example would be this error, which I get whenever I do :Unite file:

Error detected while processing function <SNR>31_call_unite_empty..unite#start..<SNR>99_initialize_current_unite..unite#is_win..unite#util#is_win:
line    1:
E716: Key not present in Dictionary: is_windows, a:000)
E116: Invalid arguments for function call(s:V.is_windows, a:000)
E15: Invalid expression: call(s:V.is_windows, a:000)

Additionaly there is a list of about 20 errors that flashes (too quickly to yank or screensoot) whenever I start Vim before my file is actually displayed. When the file is finally displayed I have this in the command line:

Error detected while processing function unite#util#substitute_path_separator:
line    1:
E716: Key not present in Dictionary: substitute_path_separator, a:000)

which I can only get rid of after pressing <CR> 3 times.

I run Vim 7.2 (GVim, actually) on Ubuntu 10.10:

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Sep 28 2010 07:11:04)
Included patches: 1-330
Compiled by buildd@
Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape
+dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm
+mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile +python +quickfix +reltime
+rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse
+textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact
 +xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -DORBIT2=1 -pthread -D_REENTRANT -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/gail-1.0 -I/usr/include/freetype2 -I/usr/include/atk-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1 -I/usr/include/libpng12     -Wall -g -O2    -D_REENTRANT -D_GNU_SOURCE -DDEBIAN  -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib/perl/5.10/CORE  -I/usr/include/python2.6-pthread -I/usr/include/tcl8.4  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1  -I/usr/lib/ruby/1.8/i686-linux Linking: gcc   -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic  -Wl,-E  -Wl,--as-needed -o vim   -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpng12 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0     -lgnomeui-2 -lbonoboui-2 -lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lORBit-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lpng12 -lgconf-2 -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lXt -lncurses -lselinux  -lacl -lgpm -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl/5.10/CORE -lperl -L/usr/lib/python2.6/config -lpython2.6 -lutil -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib -ltcl8.4 -lieee -lruby1.8 -lrt -lm

Unite doesn't work in GVim but it works pretty well in a Terminal.

vimfiler dependent

32307449 で vital#of('vimfiler') が使われているが、vimfiler が存在しないとエラーになります。

diff --git a/autoload/unite/util.vim b/autoload/unite/util.vim
index e76c2a1..57e29cd 100644
--- a/autoload/unite/util.vim
+++ b/autoload/unite/util.vim
@@ -2,7 +2,8 @@ let s:save_cpo = &cpo
 set cpo&vim

 let s:V = vital#of('unite.vim')
-call s:V.load('Data.List')
+let s:List = vital#of('vimfiler').import('Data.List')
+
 function! unite#util#truncate_smart(...)
   return call(s:V.truncate_smart, a:000)
 endfunction

open in split

with t In case when you selected a candidate, runs tabopen action.

how I can open in a new split window ?

No commands available for vimfiler "find" search results

Actions are not shown with (unite_choose_action) (default
mapping: "a") when issuing the command on results gotten from vimfiler
"find" command (default mapping: gf).

Reproducible:

:enew
gf " Start find mode
" search for something, say *.txt
" Mark some results with <space>
a " Expand action candidates

Result:
No actions are shown.

Expected:
At least some default "edit/open" action.

Not sure whether this is a bug in unite or in vimfiler.

:Unite file でエラー

環境
Ubuntu10.04
gvim7.2
https://github.com/Shougo/unite.vim.git

:Unite file で以下のエラー
function 29_call_unite_empty..29_parse_options の処理中にエラーが検出されました:
行 7:
E117: 未知の関数です: unite#get_options
E15: 無効な式です: unite#get_options()
function 29_call_unite_empty の処理中にエラーが検出されました:
行 2:
E117: 未知の関数です: unite#start

error for the newest commit!

source "file_mru" is not found.
Error detected while processing function unite#mappings#do_action..<SNR>304_get_action_table..unite#get_default_action..
<SNR>95_get_default_action:
line   12:
E716: Key not present in Dictionary: default_action, a:kind_name)
E116: Invalid arguments for function has_key(source.default_action, a:kind_name)
E15: Invalid expression: has_key(source.default_action, a:kind_name)
line   22:
E716: Key not present in Dictionary: default_action, '*')
E116: Invalid arguments for function has_key(source.default_action, '*')
E15: Invalid expression: has_key(source.default_action, '*')
  [2012-01-02 02:58] /Volumes/Users/zhaocai/.vim/bundle/Neatag/plugin/Neatag.vim(file_mru)
No such action : open   

[file_mru][directory_mru]最大候補を変数で指定できるように

file_mru、directory_mruともにmax_candidateの値は30固定となっていますが、私の場合mru_limitをそれよりも大きな値(1000)にしていて、たくさんのファイルを開いたときにmruリストが有効に活用できません。

findのようにmax_candidatesを変数で指定できるようにして頂くことは出来ないでしょうか。

How to preview to the original buffer?

Do you have a easy way to do -auto-preivew in the original buffer instead of a separate preview window? It is for the following mapping.
nnoremap <silent> / :<C-u>Unite -buffer-name=search -start-insert line<CR>

And there is one more thing: I am interested in creating a unite source to manage/bookmark 'TODO/FIXME/XXX'... tasks in source code or other files. I have read the code of some of the sources including line/colorscheme.... In general I understand. I am hoping if you have documents about the call flow of the overall framework to share...

And the files under vital. are they generated?

error loading unite.vim

After I updated vim yesterday I get the following errors when loading unite.vim, and unite will not work.

Messages maintainer: Bram Moolenaar [email protected]
Error detected while processing ~/.vim/bundle/unite.vim/autoload/vital/_217a9e.vim:
line 12:
E127: Cannot redefine function 92_import: It is in use
E127: Cannot redefine function 92_import: It is in use
line 65:
E127: Cannot redefine function 92__import: It is in use
line 109:
E127: Cannot redefine function vital#_217a9e#new: It is in use
Error detected while processing function vital#of..vital#_217a9e#new:
line 2:
E716: Key not present in Dictionary: import
Error detected while processing ~/.vim/bundle/unite.vim/autoload/unite/util.vim:
line 5:
E716: Key not present in Dictionary: load
Error detected while processing function unite#util#set_default:
line 1:
E716: Key not present in Dictionary: set_default, a:000)
E116: Invalid arguments for function call(s:V.set_default, a:000)
E15: Invalid expression: call(s:V.set_default, a:000)
E716: Key not present in Dictionary: set_default, a:000)
E116: Invalid arguments for function call(s:V.set_default, a:000)
E15: Invalid expression: call(s:V.set_default, a:000)
E716: Key not present in Dictionary: set_default, a:000)
E116: Invalid arguments for function call(s:V.set_default, a:000)
E15: Invalid expression: call(s:V.set_default, a:000)
E716: Key not present in Dictionary: set_default, a:000)
E116: Invalid arguments for function call(s:V.set_default, a:000)
E15: Invalid expression: call(s:V.set_default, a:000)
E716: Key not present in Dictionary: set_default, a:000)
E116: Invalid arguments for function call(s:V.set_default, a:000)
E15: Invalid expression: call(s:V.set_default, a:000)
Error detected while processing function unite#sources#file_mru#_append..unite#util#substitute_path_separator:
line 1:
E716: Key not present in Dictionary: substitute_path_separator, a:000)
E116: Invalid arguments for function call(s:V.substitute_path_separator, a:000)
E15: Invalid expression: call(s:V.substitute_path_separator, a:000)
E716: Key not present in Dictionary: substitute_path_separator, a:000)
E116: Invalid arguments for function call(s:V.substitute_path_separator, a:000)
E15: Invalid expression: call(s:V.substitute_path_separator, a:000)

file_rec/async g:unite_source_file_rec_ignore_pattern

Hi,
I can't make Unite not to include .git folder into file_rec results
i used a lot of combinations of patterns to forse it to ignore .git files.
As it seems it should work by default, but it's not.

Now im using this
let g:unite_source_file_rec_ignore_pattern = '.*\/\.git\/.* '

Edited:
problem only takes place when i use file_rec/async

Uniteのウィンドウを閉じたときに期待しているイベントが発生しない場合がある

Uniteのウィンドウを閉じたときに、
イベントが発生する場合と発生しない場合があります。

Powelineというプラグインを使用していて、
Uniteのウィンドウを閉じたときに表示が更新されなかったため気づきました。

最初に気づいたときは、残りのウィンドウがひとつになったときだけかと思ったのですが、
複数のウィンドウが残っている場合でも、Unite実行時に選択していたウィンドウによっては、
イベントが発生しませんでした。

以下のコード内のnoautocmd close!の実行後に暗に選択されたウィンドウの番号が、
execute unite.winnr . 'wincmd w'で指定されたときはイベントが発生しません。

" autoload/unite.vim
function! s:quit_session(is_force)  "{{{
  ...
  ...

  if a:is_force || !context.no_quit
    let bufname = bufname('%')

    if winnr('$') == 1 || context.no_split
      call unite#util#alternate_buffer()
    else
      noautocmd close!
      execute unite.winnr . 'wincmd w'
      call unite#_resize_window()
    endif

    call s:on_buf_unload(bufname)
  else
    ...
    ...
  endif

  ...
  ...
endfunction"}}}

closeで本来発生するイベントがすべて発生してくれるか、
BufEnter,WinEnter,FileType,BufUnloadのいずれかが発生してくれると、
Powelineプラグインの表示の問題は解消されそうです。

Powelineプラグインの更新のタイミングが問題かもしれないのですが、
確認よろしくお願いします。

How does async_gather_candidates work?

Can you tell me how async_gather_candidates works? Precisely, I want to know:

  1. when is it called? ( my guess is after gather_candidates ?)
  2. how often is it called? when to stop? who is responsible for setting the is_async flag?

Thanks.

Can we execute the default action and keep focus?

Is there an option to execute the default option and keep the focus on the unite buffer?

In a related note, is there an option to change the size of the preview window?

Thanks, and sorry if this is not the right place to ask this questions.

Thanks for your work.

mini help with `?`

In gmail (or google reader) when press ? this show a mini help.
why don't added this feature?

unite#do_candidates_action does not act directly, sometimes...

Test Code:

let candidates = unite#get_candidates([['grep', '/Users/zhaocai/Downloads/Workspace/blkparse.txt', '', 'blktrace']])
call unite#do_candidates_action('replace', candidates)

Problem:

instead of activate the qfreplace window, it drops into the vim command prompt and request user input.

Possible Cause;

unite#do_candidates_action request extra input even if the inputs have been specified. It seems that unite#do_candidates_action calls the s:source.hooks.on_init hook again without the arguments user have specified.

候補のハイライトがずれる。

commit eba13d2 以降、選択された
候補のハイライトがズレて、一つ下の候補の先頭カラムまでハイライトされます。

vim のバージョン

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug  9 2011 09:59:58)
適用済パッチ: 1-269

問題が発生するコミットの前後

問題のあるコミット
↓ eba13 以降発生。

commit eba13d241c4a45ce66ce4a9fa3bba49fdf46a293
Author: Shougo Matsushita <[email protected]>
Date:   Fri Aug 5 12:57:36 2011 +0900

    - Improved cursor line.

commit 890a52ed16c950d9fb752d49cf6155c78e0eee19
Author: Shougo Matsushita <[email protected]>
Date:   Fri Aug 5 12:12:00 2011 +0900

    - Deleted debug message.

↑ 890a では発生しない。
このコミットでは

画面キャプチャ

ずれるというのは下記のような状態。

[http://img703.imageshack.us/img703/5088/capture003y.png]

Vim がクラッシュする問題。

commit eba13d2
以降、unite バッファを出してハイライトがずれた状態で、gnome window のリサイズを行うとVimがハング or クラッシュします。

gvim を起動した Window に表示されるメッセージは 「 Vim: 致命的シグナル SEGV を検知しました 」
だったり 「 Vim: 致命的シグナル ABRT を検知しました 」だったりします。

これは再現性はかなり高く、4,5 回のリサイズで発生します。
コミットを 890a52 時点に戻すと、数十回リサイズしてもクラッシュしません。

元々 vim 7.2 で発生して、7.3 にソースからインストールしても状況は変わらずクラッシュするので調査していました。
Gnome のバグかも知れませんが、ハイライトがずれない 890a52e では発生しません。

ハイライトは

s:adjustments(winwidth(0)-1, l:unite.max_source_name, 5)

s:adjustments(winwidth(0), l:unite.max_source_name, 5)

のように戻すとずれなくなり、クラッシュもしなくなります。

custom filter を設定した source を呼び出すとエラー

Lingr の方で報告したはずなんですが、落ちた後ログみたら書き込まれてなかった(行数制限?)ので
こちらで再度報告します。

custom_filter を登録した file_mru を呼び出したところ、以下のエラーが出ました。

Error detected while processing function 54_call_unite_empty..unite#start..23_recache_cand
idates:
line   43:
E716: Key not present in Dictionary: name) ? s:custom.source[l:source.name] : {}
E116: Invalid arguments for function has_key(s:custom.source, l:source.name) ? s:custom.source[l:sou
rce.name] : {}
E15: Invalid expression: has_key(s:custom.source, l:source.name) ? s:custom.source[l:source.name] : 
{}
line   51:
E121: Undefined variable: l:custom_source
E116: Invalid arguments for function has_key(l:custom_source, 'filters') ? l:custom_source.filters :
 l:source.filters
E15: Invalid expression: has_key(l:custom_source, 'filters') ? l:custom_source.filters : l:source.fi
lters
Error detected while processing function 54_call_unite_empty..unite#start..unite#redraw_status.
.unite#loaded_source_names_with_args:
line    1:
E716: Key not present in Dictionary: name), ":")
E116: Invalid arguments for function insert(copy(v:val.args), v:val.name), ":")
E116: Invalid arguments for function join(insert(copy(v:val.args), v:val.name), ":")
Error detected while processing function 54_call_unite_empty..unite#start..unite#redraw_status:

line    4:
E724: variable nested too deep for displaying

Lingr に貼り付けた gist は再現用のコードとして提示したつもりでした。

file_mru converter — Gist
https://gist.github.com/867775

bookmarkアクションからファイルをブックマークに追加し、そのファイルをブックマークから開くとエラーが出力される

bookmarkアクションからファイルをブックマークに追加し、そのファイルをブックマークから開くとエラーが出力されます。

■検証した環境

  • OS: Windows7 64bit
  • Vimバージョン: GVim KaoriYa版 64bit 適用済パッチ: 1-502
  • 使用プラグイン: neobundle, unite, vimfiler, vimproc

■エラーメッセージ

 function unite#mappings#do_action..33..unite#mappings#do_action..37..78_jump, 行 45
 Vim(call):E35: 正規表現がまだ実行されていません
 Error occured in executing action!
 Action name is open

■再現手順
ホームディレクトリにtmp.txtを作成。
:Unite file コマンドでファイル一覧を取得し、上記で作成した tmp.txt ファイルに対し bookmark アクションを実行。
:Unite bookmark コマンドでブックマーク一覧を取得し、tmp.txt に対し open アクションを実行。
コマンドラインにエラーが出力される。

:UniteBookmarkAdd コマンドにてブックマークしたファイルでは、エラーは出力されません。

ご確認いただければ幸いです。

file_mru is always empty!

Just spend a day to play with unite. Great plugin for vim! The only problem I have so far is that the file_mru is always empty! I have tried to use Unite file to open files and write. Oddly, directory_mru got two entries. But it seems it is not growing either.

Can you give me any hint to debug?

Drag a folder into gvim that auto opens unite?

plugin NerdTree can do this,
seems that it using this augroup to get this:

    if g:NERDTreeHijackNetrw
        augroup NERDTreeHijackNetrw
            autocmd VimEnter * silent! autocmd! FileExplorer
            au BufEnter,VimEnter * call s:checkForBrowse(expand("<amatch>"))
        augroup END
    endif

a bug related to session update_time_save

Bug related to session update_time_save

Error detected while processing function unite#mappings#do_action..unite#all_quit_session..<SNR>143_quit_session..<SNR>143_on_buf_unload:
line   22:
E716: Key not present in Dictionary: update_time_save
E15: Invalid expression: unite.update_time_save 

By the way

I just wrote a unite.vim plugin for scriptname: https://github.com/zhaocai/unite-scriptnames. Can you tell me what does action__text do? Thanks.

p でレジスタの内容がペーストされてしまう

previewアクションを試していて気付いたのですが、
絞り込みテキストの入力行にカーソルがあり、かつノーマルモードの状態で p を押すと、
無名レジスタの内容が候補一覧上にペーストされます。

参考画像:
20110514142142

previewアクションでいろんな候補を見て回るときに起こりがちな気がするので、この場合 p を押しても何も
起こらないようにするか、最初の候補が preview されるようにしてはどうでしょう。

set autochdirの環境においてUnite fileでファイルを正常に開くことができない

set autochdirで自動的にカレント作業ディレクトリを変更する設定にしていると、おかしなパスのファイルが開かれてしまいます。

例えばUniteバッファのカレント作業ディレクトリが~の時に、~/test/foo/foo.txtを編集中に:Unite fileでブラウズして~/test/bar/bar.txtを開こうとすると、~/test/foo/test/bar/bar.txtなどといった、元々開いていたファイルのパスが混ざったおかしなパスが開かれます。

autochdirはバッファの切替時にもカレント作業ディレクトリの変更が行うからのようです。

source name conformity?

I have a very simple unite source named scriptnames. I only changed one line -- the source name from scriptnames to vim/scriptnames. Now :Unite vim/scriptnames does not work. And it sometimes work after a while. Can you give some hints? Thanks.

let s:unite_source = {
      \ 'name': 'vim/scriptnames',
      \ "description": 'candidates from vim scriptnames',
      \ }

fun! s:unite_source.gather_candidates(args, context)
    redir => output
    silent execute 'scriptnames'
    redir END

    let scripts = split(output, "\n")
    let candidates = []
    for _ in scripts
        let [nr, fname ] = matchlist(_,'\v(\d+):\s*(.*)$')[1:2]
        call add(candidates, {
                \ "word": _,
                \ "source": "vim/scriptnames",
                \ "kind": "file",
                \ "action__path": unite#util#substitute_path_separator(
                \   fnamemodify(fname, ":p")),
                \ "action__directory": unite#util#substitute_path_separator(
                \   fnamemodify(fname, ":p:h")),
                \ } )
    endfor
    return candidates
endf

fun! unite#sources#scriptnames#define()
    return s:unite_source
endf

bufwinnr() における * [ ] のエスケープ

名前に unite を含むファイルを編集中に Unite を実行すると、unite のバッファが新規に作られず、編集中のバッファに候補一覧が表示されるという現象にみまわれました。ファイル名を変えて実行すると問題が解消したことから、バッファ名の比較部分に何か問題があるとあたりを付けて調べたところ

autoload/unite.vim の s:switch_unite_buffer() にて bufwinnr() が unite のバッファ名に使われている * [ ] などをエスケープしていないことを見つけました。

このせいで、unite-hoge.txt のような名前が *unite* にマッチして、unite のバッファとみなされていたようです。(ヘルプを見たら bufwinnr(), bufnr() などは文字列を与えられるとそれを file-pattern として解釈するとのことでした)

手元ではとりあえず該当個所に escape() を入れて問題を解消できましたが、エスケープすべき場所や、影響範囲がわからないので、取り急ぎ報告だけ。

保存したセッションの読み込みでエラー

環境
Ubuntu10.04
gvim7.2
https://github.com/Shougo/unite.vim.git

保存したセッションを読み込んだ際に以下のエラー

BufLeave Auto commands for "" の処理中にエラーが検出されました:
E117: 未知の関数です: unite#sources#directory_mru#append
BufWinLeave Auto commands for "
" の処理中にエラーが検出されました:
"app.js" 155L, 3544C
TabEnter Auto commands for "
" の処理中にエラーが検出されました:
E117: 未知の関数です: unite#sources#tab#append
BufLeave Auto commands for "
" の処理中にエラーが検出されました:
"test/app.test.js" 41L, 884C
TabEnter Auto commands for "" の処理中にエラーが検出されました:
E117: 未知の関数です: unite#sources#tab#append
BufLeave Auto commands for "
" の処理中にエラーが検出されました:
"models.js" 20L, 325C
TabEnter Auto commands for "
" の処理中にエラーが検出されました:
E117: 未知の関数です: unite#sources#tab#append
BufLeave Auto commands for "
" の処理中にエラーが検出されました:
"views/documents/index.jade" 12L, 426C
TabEnter Auto commands for "" の処理中にエラーが検出されました:
E117: 未知の関数です: unite#sources#tab#append
BufLeave Auto commands for "
" の処理中にエラーが検出されました:
"public/stylesheets/style.less" 5L, 67C
TabEnter Auto commands for "
" の処理中にエラーが検出されました:
E117: 未知の関数です: unite#sources#tab#append
BufLeave Auto commands for "
" の処理中にエラーが検出されました:
"public/javascripts/application.js" 31L, 602C
TabEnter Auto commands for "*" の処理中にエラーが検出されました:

[source: mapping] extend to contain *Where* the key mapping was set

verb map would tell where the mapping was last set as the example before. This info would be useful when you have so many key mappings as any powerful vim user do. Sometimes, you want to know who messed up my existing key mappings. Sometimes, you may forgot where the key mapping was...

x  [u            <Plug>unimpairedUrlEncode
        Last set from ~/.vim/bundle/vim-unimpaired/plugin/unimpaired.vim
n  [u            <Plug>unimpairedUrlEncode
        Last set from ~/.vim/bundle/vim-unimpaired/plugin/unimpaired.vim

This extended where info can also be applied to

  • command:
  • function
  • autocmd
  • menu
  • abbr
  • ... etc.

I wanted to do these extension for unite.vim for a while. But some of the functionalities overlaps with existing unite source. How do you think? If you decide not to do it, I will spare some time to do it.

Cheers,

syntax region uniteCandidateAbbr等のstartがおかしい

syntax region uniteCandidateAbbrsyntax region source.syntax の start の部分がおかしいようです。
'start=/\%'.(unite.abbr_head).'c/ の列の値が想定よりも右に 2 つずれます。

  let source_padding = 5

  let unite.abbr_head = unite.max_source_name+source_padding
  execute 'syntax region uniteCandidateAbbr' 'start=/\%'
        \ .(unite.abbr_head).'c/ end=/$/ keepend contained'

  execute 'highlight default link uniteCandidateAbbr'
        \ g:unite_abbr_highlight

  " Set syntax.
  for source in filter(copy(unite.sources), 'v:val.syntax != ""')
    let name = unite.max_source_name > 0 ?
          \ source.name : ''

    execute 'syntax region' source.syntax 'start=/\%'
          \ .(unite.abbr_head).'c/ end=/$/ keepend contained'

469fa6bcandidate.unite__abbr の先頭にスペース2つ入れていた処理がなくなっているのですが、上記の source_padding が 5 のままになっているので、リージョンの開始位置が 2 つほどずれてしまっているようです。

Sources: example
>
- hogefuga      ←現在
-   hogefuga    ←以前はこんな感じで先頭が余分に空いていた

現在のほうでリージョンの開始が「g」になっているみたいです。

拙作の unite-webcolorname がうまくカラー表示できなくなっていることに気づいて git bisect してみたところ 469fa6b が特定されたのですが、source_padding なども含めどういう表示処理なのか十分に理解できていないので、ご確認お願いします。

-hide-source-names broken?

Hi,

Running Unite with the -hide-source-names option doesn't appear to do anything. I assume it should hide the first line in the buffer that says "Sources: , , ". Am I missing something?

Thanks.

More buffer info

when I Use Unite buffer I get the buffer list, but, how I can see more information about the buffers in this list ?
(number of buffer, etc)

Unnecessary default mapping for <Esc>

Default mapping:

imap <buffer> <ESC>     <Plug>(unite_insert_leave)

Has problem with some terminals, which use <Esc> as leading of special key sequences (example: cursor keys).
User has to fix it.

Suggestion:

  • remove the mapping.

Reason:

  • reduce complexity.
  • won't change default behavior.

file_rec outputs too verbose message

Following two messages are too verbose for me in daily use.

call unite#print_message('[file_rec] directory: ' . directory)
call unite#print_message('[file_rec] Directory traverse was completed.')

Can I hide these messages?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.