nixprime / cpsm Goto Github PK
View Code? Open in Web Editor NEWA CtrlP matcher, specialized for paths.
License: Apache License 2.0
A CtrlP matcher, specialized for paths.
License: Apache License 2.0
I'm running neovim aliased to vim
. I'm on Arch Linux where Python 3 is in /usr/bin/python
and Python 2 is in /usr/bin/python2
. When I compile cpsm it correctly detects Python 3 support (it echos that to me during build time).
Everything actually works fine and results shows unless I open a vim while my shell is in a venv that I created and activated like this:
pyvenv venv; source venv/bin/activate
The problem is that vim with ctrlp doesn't show any results inside of the venv. If I compile cpsm with PY3=OFF
then everything works fine even in the venv.
The plugin manager at https://github.com/junegunn/vim-plug supports configuring install scripts like Plug 'nixprime/cpsm', { 'do': './install.sh' }
which trigger rebuild on update. However it fails for cpsm
because VIM
is defined inside vim
to usr/local/share/vim
, which is a directory. Hence the line VIM="${VIM:-vim}"
in install.sh
does not produce a path to the vim executable.
Running the script manually works fine though. On a mac with Homebrew vim.
Thanks for the impressive ctrlp speedup!
In OS X, it will be build cpsm_py.dylib
instead cpsm_py.so
when remove SUFFIX
flag.
6e00d1d
but, python can not import .dylib
file... :(
> ls
cpsm.py cpsm.vim cpsm_py.dylib*
> python
Python 2.7.10 (default, Oct 31 2015, 01:36:43)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.78)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cpsm_py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cpsm_py
>>> import cpsm_py.dylib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cpsm_py.dylib
> mv cpsm_py.dylib cpsm_py.so
> python
Python 2.7.10 (default, Oct 31 2015, 01:36:43)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.78)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cpsm_py
>>> # import success
As with python_library, seems necessary osx dedicated flag.
Although there are many problems of OS X, Would you support?
Here's an interesting case I came across where cpsm's scoring algorithm doesn't really do the right thing, but I think it should be easy enough to fix:
I have g:cpsm_query_inverting_delimiter = ' '
. There is a file foo/bar/graph/order.rb
. When I search cpsm with order gra
that file is not the first match; the first match is tmp/VZOCh7GJ4RUldAJOTIMRwSm0k8DmFMRexROl...
because if you'll note all of the necessary characters do appear in the correct order in that random string. The simple fix is to remove the tmp
directory from the ctrl-p search path but I think it also reveals that cpsm should be prioritizing matches somewhat based on contiguity of the match. The desired file matched the given query in two large chunks, whereas the tmp file matched 8 individual characters.
The scorer already contains parts
which is the number of path components... generalizing this to the number of contiguous match groups regardless of path componentization seems like a simple fix.
Hello!
The default ctrlp matcher allows you to filter the currently opened buffers by the number it assigns. It would be very nice if yours also allowed me to do that.
I like your matcher the best out all I have tried. Thank you for making it =)
vim version: 25065ec375a8a55462f6c07c76dc1a72a770ac19
valgrind log: here
The default matcher gives me the most recently used file as first suggestion, then the second most recentely used etc... (given, I didn't type anything yet).
That makes it possible to cycle through most recently used files with ctrl-j/ctrl-k.
I've gotten pretty used to that behaviour as it allows me to quickly change between the few most recently used files.
Any chance to see cpsm support this as well? (Alternatively: Is there a way to tell CtrlP to use a different matcher for the MRU list?)
Is it possible to setup appveyor builds so that we can automatically download the windows binaries similar to how neovim has setup.
Would anyone mind sharing cpsm windows x64 binary in the mean time?
I try ./install.sh
with pyenv. (python 3.5.2)
It seems build is success.
But I can't use it.
Could you help me?
Build
PY3 not specified; inferring Python version from vim
Python 3 selected
-- The C compiler identification is AppleClang 7.3.0.7030031
-- The CXX compiler identification is AppleClang 7.3.0.7030031
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Boost version: 1.61.0
-- Found the following Boost libraries:
-- program_options
-- Found PythonInterp: /Users/okamos/.pyenv/shims/python3 (found suitable version "3.5.2", minimum required is "3")
-- Found PythonInterp: /Users/okamos/.pyenv/shims/python3 (found version "3.5.2")
-- Found PythonLibs: /Users/okamos/.pyenv/versions/3.5.2/lib/python3.5/config-3.5m/libpython3.5m.a
-- Found PythonLibsCustom: TRUE
-- Optional package ICU was not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/okamos/.cache/dein/repos/github.com/nixprime/cpsm/build
Error
Python 3.5.2 (default, Sep 22 2016, 12:35:42)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cpsm_py
Fatal Python error: PyThreadState_Get: no current thread
zsh: abort python3
So the original ctrlp will give me a neat partial highlight during matching. I wonder whether I can somehow get that back? It's useful to see exactly where I'm matching and also it looks neat.
At least here on arch linux the usage of PythonLibsCustom
over PythonLibs
makes all the python3 builds to fail when loaded from within vim eg. by doing :py3 import cpsm_py
with this stack trace
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: ~/.vim/bundle/cpsm/autoload/cpsm_py.so: undefined symbol: forkpty
Moreover the linking phase happens instantly when using PythonLibs
instead of taking the usual ~2 mins.
I tried the instructions in https://github.com/nixprime/cpsm#options to setup the builtin CtrlPMRUFiles
in neovim:
let g:ctrlp_map = ''
nnoremap <silent> <C-o> :let g:cpsm_match_empty_query = 0<CR>:CtrlPMRUFiles<CR>
nnoremap <silent> <c-p> :let g:cpsm_match_empty_query = 1<CR>:CtrlP<CR>
When I start neovim and issue <C-o>
I see the error ERROR: Failed to evaluate expression
. However, when I start neovim and issue <C-p>
followed by <C-o>
I don't get any error (but the list presented doesn't show any MRU entries that I can detect).
I'm not sure even how to debug this - any suggestions?
Installing a vim plugin should be an easy thing to do. Major external dependencies such as boost should be justified.
A grep for #include <boost/
shows following usage of boost libraries:
#include <boost/program_options.hpp>
#include <boost/utility/string_ref.hpp>
#include <boost/algorithm/cxx14/mismatch.hpp>
#include <boost/range/adaptor/reversed.hpp>
Are all of these really necessary?
E.g. IMHO parsing command line arguments are not a good enough reason for boost. They can be dealt in a different way, in particular, if only a few ones have to be parsed. Also consider this: the installation size of boost on my machine is about 440MB
.
The vim plugin YouCompleteMe
has a frightening set of third-party dependencies including a few boost libraries. However, they have added the required boost libraries to the source tree:
https://github.com/Valloric/ycmd/tree/master/cpp/BoostParts
To use this plugin boost does not have to be installed separately.
I am quite sure any software development guide recommends KISS. Relying on boost typically is not.
What do you think? I know this project is most likely only a spare time project, however, if you like you could make it easier for others to use it as well (you have already published it on github).
Hey discovered this plugin recently, very cool.
Just started getting this error after running :PluginUpdate
this morning when activating CtrlP. Running OS X.
Commenting out
let g:ctrlp_match_func = {'match': 'cpsm#CtrlPMatch'}
fixes the issue.
Similar to the default ctrlp matcher, is it possible to exclude the currently opened file in the active window from the file list?
I had the follow line prefix setting in my ctrlp:
let g:ctrlp_line_prefix = ' '
It caused cspm highlighting not working any more.
My vim is macvim 8.0.324
I installed cpsm
in vim using vim-plug
and ran ./install.sh
after installing with no errors. However, whenever I run CtrlP
, I get the output as ERROR: cpsm built with version of Python not supported by Vim
.
The output of vim --version
is:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 7 2017 13:50:55)
Included patches: 1-1176
Compiled by Arch Linux
Huge version with GTK3 GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt +tcl/dyn
+balloon_eval +folding +mouse_xterm +termguicolors
+browse -footer +multi_byte +terminal
++builtin_terms +fork() +multi_lang +terminfo
+byte_offset +gettext -mzscheme +termresponse
+channel -hangul_input +netbeans_intg +textobjects
+cindent +iconv +num64 +timers
+clientserver +insert_expand +packages +title
+clipboard +job +path_extra +toolbar
+cmdline_compl +jumplist +perl/dyn +user_commands
+cmdline_hist +keymap +persistent_undo +vertsplit
+cmdline_info +lambda +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python/dyn +viminfo
+cscope +lispindent +python3/dyn +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con_gui +lua/dyn +rightleft +windows
+diff +menu +ruby/dyn +writebackup
+digraphs +mksession +scrollbind +X11
+dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent +xim
+emacs_tags +mouseshape +startuptime -xpm
+eval +mouse_dec +statusline +xsmp_interact
+ex_extra +mouse_gpm -sun_workshop +xterm_clipboard
+extra_search -mouse_jsbterm +syntax -xterm_save
+farsi +mouse_netterm +tag_binary
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "/.vim/vimrc"/.vim/gvimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "/etc/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "
defaults file: "$VIMRUNTIME/defaults.vim"
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-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -lncurses -lelf -lnsl -lacl -lattr -lgpm -ldl -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.26/core_perl/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lieee -lm
OS details: Arch Linux x86_64
Python Version: 3.6.3
Just on a side note, there is no error reported when running CtrlP
after starting vim with vim -V9vimlog
It's a bit complicated to package cpsm
without a release tag. Please add a tag with v0.1
or something that indicated a version number.
Hi,
I'd like to offer my help for co-maintainership. I noticed that sometimes a few critical fixes which are available in pull requests stay unmerged for a few months. I'd like to just get the ability to triage those problems.
cpsm
does a good job of guessing the right file based on very little information, but the user probably has some additional information which could help it along; for instance:
I'm not exactly sure what the best way of exploiting this information is. One way would be to read a variable containing a list of exact substrings which, if found, would increase the score of a match. Thoughts?
% uname -mprsv
Darwin 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64 i386
% python3 --version
Python 3.5.2
% which python3
/usr/local/bin/python3
% python3 -c "import sys; print(sys.prefix)"
/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5
Installing cpsm, I got followin error.
% PY3=ON ./install.sh
PY3=ON
-- The C compiler identification is AppleClang 7.3.0.7030031
-- The CXX compiler identification is AppleClang 7.3.0.7030031
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Boost version: 1.61.0
-- Found the following Boost libraries:
-- program_options
-- Optional package ICU was not found
-- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.5.2", minimum required is "3")
CMake Error at /usr/local/Cellar/cmake/3.6.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
(Required is at least version "3")
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.6.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.6.1/share/cmake/Modules/FindPythonLibs.cmake:265 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:37 (find_package)
-- Configuring incomplete, errors occurred!
See also "/Users/pocari/.cache/dein/repos/github.com/pocari/cpsm/build/CMakeFiles/CMakeOutput.log".
I have worked around by the following code.
Are there any plans to fix this problem ?
When trying to run the installation script, I get an error:
ld: -stack_size option can only be used when linking a main executable
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [cpsm_py.so] Error 1
make[1]: *** [CMakeFiles/cpsm_py.dir/all] Error 2
make: *** [all] Error 2
Full installation output:
~/.vim/plugged/cpsm/install.sh
PY3 not specified; inferring Python version from /usr/local/bin/vim
Python 3 selected
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
CMake Warning at /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:801 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:907 (_Boost_COMPONENT_DEPENDENCIES)
/usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:1542 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:21 (find_package)
-- Boost version: 1.66.0
-- Found the following Boost libraries:
-- program_options
-- Found PythonInterp: /Users/joe/.pyenv/shims/python3 (found suitable version "3.6.1", minimum required is "3")
-- Found PythonInterp: /Users/joe/.pyenv/shims/python3 (found version "3.6.1")
-- Found PythonConfig: -I/Users/joe/.pyenv/versions/3.6.1/include/python3.6m -I/Users/joe/.pyenv/versions/3.6.1/include/python3.6m; -L/Users/joe/.pyenv/versions/3.6.1/lib/python3.6/config-3.6m-darwin -lpython3.6m -ldl -framework CoreFoundation -Wl,-stack_size,1000000 -framework CoreFoundation
-- Optional package ICU was not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/joe/.vim/plugged/cpsm/build
Scanning dependencies of target cpsm_core
[ 11%] Building CXX object CMakeFiles/cpsm_core.dir/src/str_util.cc.o
[ 22%] Linking CXX static library libcpsm_core.a
[ 22%] Built target cpsm_core
Scanning dependencies of target cpsm_cli
[ 33%] Building CXX object CMakeFiles/cpsm_cli.dir/src/cpsm_cli_main.cc.o
[ 44%] Linking CXX executable cpsm_cli
[ 44%] Built target cpsm_cli
Scanning dependencies of target cpsm_py
[ 55%] Building CXX object CMakeFiles/cpsm_py.dir/src/ctrlp_util.cc.o
[ 66%] Building CXX object CMakeFiles/cpsm_py.dir/src/python_extension.cc.o
[ 77%] Linking CXX shared library cpsm_py.so
ld: -stack_size option can only be used when linking a main executable
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [cpsm_py.so] Error 1
make[1]: *** [CMakeFiles/cpsm_py.dir/all] Error 2
make: *** [all] Error 2
[I] 2>
Version outputs:
clang --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
[I] > python --version
Python 3.6.4
[I] > vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Feb 5 2018 13:16:19)
macOS version
Included patches: 1-1450
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_sgr -tag_any_white
+arabic +file_in_path -mouse_sysmouse -tcl
+autocmd +find_in_path +mouse_urxvt +termguicolors
-autoservername +float +mouse_xterm +terminal
-balloon_eval +folding +multi_byte +terminfo
+balloon_eval_term -footer +multi_lang +termresponse
-browse +fork() -mzscheme +textobjects
++builtin_terms -gettext +netbeans_intg +timers
+byte_offset -hangul_input +num64 +title
+channel +iconv +packages -toolbar
+cindent +insert_expand +path_extra +user_commands
-clientserver +job +perl +vertsplit
+clipboard +jumplist +persistent_undo +virtualedit
+cmdline_compl +keymap +postscript +visual
+cmdline_hist +lambda +printer +visualextra
+cmdline_info +langmap +profile +viminfo
+comments +libcall -python +vreplace
+conceal +linebreak +python3 +wildignore
+cryptv +lispindent +quickfix +wildmenu
+cscope +listcmds +reltime +windows
+cursorbind +localmap +rightleft +writebackup
+cursorshape +lua +ruby -X11
+dialog_con +menu +scrollbind -xfontset
+diff +mksession +signs -xim
+digraphs +modify_fname +smartindent -xpm
-dnd +mouse +startuptime -xsmp
-ebcdic -mouseshape +statusline -xterm_clipboard
+emacs_tags +mouse_dec -sun_workshop -xterm_save
+eval -mouse_gpm +syntax
+ex_extra -mouse_jsbterm +tag_binary
+extra_search +mouse_netterm +tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o vim -lncurses -liconv -framework AppKit -L/usr/local/lib -llua -mmacosx-version-min=10.13 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.26.1/lib/perl5/5.26.1/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -framework CoreFoundation -lruby.2.5.0 -lobjc
OSX 10.13.3 (17D47)
It seems exact match with a prefix might score lower that a set of characters scattered over the full path.
Test input (test.txt
), adding extra before and after placeholder lines:
noise/to/start.txt
Home/level/other/With/ore/al.d
kind/of/very/long/path/This/is/PrefixedHelloWorld.txt
some/path/to/fillup.txt
Matching:
cat test.txt | ./cpsm_cli --limit 2 --query HelloWorld
Output:
Home/level/other/With/ore/al.d
- score: 139646541430753; prefix_level = 0, whole_basename_match = 0, basename_longest_submatch = 0, basename_match_count = 0, basename_word_gaps = 0, crfile_basename_shared_words = 0, crfile_path_distance = 6, unmatched_suffix_len = 4, item_len = 30
- match positions: 0, 3, 5, 9, 11, 17, 22, 23, 27, 29
kind/of/very/long/path/This/is/PrefixedHelloWorld.txt
- score: 139646532747210; prefix_level = 0, whole_basename_match = 0, basename_longest_submatch = 0, basename_match_count = 0, basename_word_gaps = 0, crfile_basename_shared_words = 0, crfile_path_distance = 8, unmatched_suffix_len = 22, item_len = 53
- match positions: 39, 40, 41, 42, 43, 44, 45, 46, 47, 48
The exact "HelloWorld" match is weighted lower (mostly due crfile_path_distance
score)
BTW... Thanks for the great work!
Starting from activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
, I typed pool
.
I wanted to find activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
, but the top results were:
> activerecord/test/cases/pooled_connections_test.rb
> activerecord/lib/active_record/connection_adapters/postgresql/oid/legacy_point.rb
> activerecord/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb
> activestorage/test/controllers/previews_controller_test.rb
> activestorage/app/controllers/active_storage/previews_controller.rb
> actionview/test/fixtures/actionpack/test/potential_conflicts.erb
> actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb
> activesupport/lib/active_support/core_ext/range/overlaps.rb
> actionpack/test/fixtures/public/foo/other-index.html
> actionpack/test/fixtures/ๅ
ฌๅ
ฑ/foo/other-index.html
> railties/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt
> activesupport/lib/active_support/logger.rb
The first match does contain a contiguous pool
at the start of the filename, so it's not unreasonable that it came first. And the second has a split prefix match for po*/o*/l*
. But the rest are pretty spread-out arbitrary single-letter substring matches.
Given the path similarity, I expected my target to be at the top of the list, followed by activerecord/lib/active_record/connection_adapters/statement_pool.rb
(shorter, but no abstract
).
cp
and spoo
are sufficient to get those two files, respectively, to the top while using their first character.
I know different people/projects use underscores (and similar characters) in different ways, and sometimes treating it as a full word separator equal to /
could give equally surprising results in the opposite direction. Perhaps the list of separators could be configurable?
โค๏ธ ๐ ๐ ๐ ๐
Thanks so much for cpsm! Its match quality has completely changed my mind about the usefulness of fuzzy finders -- and it's only because of that "always knows what I mean" awesomeness that I'm opening this issue to report where it's tripped me up.
Firstly, I love this plugin, the speed and quality benefits are obvious, many thanks. I blogged about CtrlP and this plugin recently.
Anyway, doing some performance testing I noticed a difference in speed between Neovim (0.2.0) and Vim (8.0) when dealing with very large trees such as the Linux source. I don't think it is an issue with cpsm, it feels like it may be with Neovim itself. But before I report an issue with the Neovim crew it would be good to gather some info (if possible).
Setup, Vim 8.0 and Neovim 0.2.0 along with CtrlP and cpsm plugins. Note, I also use ripgrep for the ctrlp user command:
let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
Then checkout the Linux kernel, which will be in the order of 58,000 files. Launch Vim/Neovim, then CtrlP then hold j
key for a while, then backspace, rinse and repeat. In Vim the key hold is super responsive whilst in Neovim it will really lag after a while. I see this on both a slower Macbook and fast Linux desktop.
With smaller trees, such as Ruby on Rails source with 3,500, no such obvious lagginess is seen. Big source trees like Linux are needed.
I tested with a minimal Neovim setup and I still see the lag. Any ideas why Neovim has worse performance with CtrlP + cpsm with huge trees? Does anyone else see this?
Also, I am definitely using cpsm on both Vim and Neovim since the ranked results are the same in both (which differ from CtrlP default).
Lastly since this is an informational request please don't hesitate to close this request. Thanks.
I just recently upgraded to Python 3.8.3 with homebrew and now cpsm doesn't seem to compile. I've tried re-installing things and everything else I can think of, but here I am.
Here is the log:
Python 3 selected by PY3=ON
-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Boost: /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found version "1.72.0") found components: program_options
-- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.8.3", minimum required is "3")
-- Found PythonInterp: /usr/local/bin/python3 (found version "3.8.3")
-- Found PythonConfig: -I/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/include/python3.8; -L/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/config-3.8-darwin -ldl -framework CoreFoundation
-- Optional package ICU was not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/trobrock/.cache/dein/repos/github.com/nixprime/cpsm/build
Scanning dependencies of target cpsm_core
[ 11%] Building CXX object CMakeFiles/cpsm_core.dir/src/str_util.cc.o
[ 22%] Linking CXX static library libcpsm_core.a
[ 22%] Built target cpsm_core
Scanning dependencies of target cpsm_cli
[ 33%] Building CXX object CMakeFiles/cpsm_cli.dir/src/cpsm_cli_main.cc.o
[ 44%] Linking CXX executable cpsm_cli
[ 44%] Built target cpsm_cli
Scanning dependencies of target cpsm_py
[ 55%] Building CXX object CMakeFiles/cpsm_py.dir/src/ctrlp_util.cc.o
[ 66%] Building CXX object CMakeFiles/cpsm_py.dir/src/python_extension.cc.o
[ 77%] Linking CXX shared library cpsm_py.so
Undefined symbols for architecture x86_64:
"_PyErr_SetString", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
"_PyExc_RuntimeError", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
"_PyIter_Next", referenced from:
(anonymous namespace)::PyIterCtrlPMatchSource<cpsm::FullLineMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> > >&) in python_extension.cc.o
(anonymous namespace)::PyIterCtrlPMatchSource<cpsm::FilenameOnlyMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FilenameOnlyMatch>, true>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FilenameOnlyMatch>, true> > >&) in python_extension.cc.o
(anonymous namespace)::PyIterCtrlPMatchSource<cpsm::FirstNonTabMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FirstNonTabMatch>, true>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FirstNonTabMatch>, true> > >&) in python_extension.cc.o
(anonymous namespace)::PyIterCtrlPMatchSource<cpsm::UntilLastTabMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::UntilLastTabMatch>, true>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::UntilLastTabMatch>, true> > >&) in python_extension.cc.o
"_PyList_Append", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
cpsm_ctrlp_match(_object*, _object*, _object*)::$_0::operator()(boost::basic_string_ref<char, std::__1::char_traits<char> >, boost::basic_string_ref<char, std::__1::char_traits<char> >, _object*, cpsm::MatchInfo*) const in python_extension.cc.o
"_PyList_GetItem", referenced from:
(anonymous namespace)::PyListCtrlPMatchSource<cpsm::FullLineMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, false>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, false> > >&) in python_extension.cc.o
(anonymous namespace)::PyListCtrlPMatchSource<cpsm::FilenameOnlyMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FilenameOnlyMatch>, false>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FilenameOnlyMatch>, false> > >&) in python_extension.cc.o
(anonymous namespace)::PyListCtrlPMatchSource<cpsm::FirstNonTabMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FirstNonTabMatch>, false>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FirstNonTabMatch>, false> > >&) in python_extension.cc.o
(anonymous namespace)::PyListCtrlPMatchSource<cpsm::UntilLastTabMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::UntilLastTabMatch>, false>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::UntilLastTabMatch>, false> > >&) in python_extension.cc.o
"_PyList_New", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
"_PyList_Size", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
"_PyModule_Create2", referenced from:
_PyInit_cpsm_py in python_extension.cc.o
"_PyTuple_New", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
"_PyTuple_SetItem", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
"_PyUnicode_AsUTF8AndSize", referenced from:
(anonymous namespace)::PyListCtrlPMatchSource<cpsm::FullLineMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, false>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, false> > >&) in python_extension.cc.o
(anonymous namespace)::PyIterCtrlPMatchSource<cpsm::FullLineMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> > >&) in python_extension.cc.o
(anonymous namespace)::PyListCtrlPMatchSource<cpsm::FilenameOnlyMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FilenameOnlyMatch>, false>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FilenameOnlyMatch>, false> > >&) in python_extension.cc.o
(anonymous namespace)::PyIterCtrlPMatchSource<cpsm::FilenameOnlyMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FilenameOnlyMatch>, true>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FilenameOnlyMatch>, true> > >&) in python_extension.cc.o
(anonymous namespace)::PyListCtrlPMatchSource<cpsm::FirstNonTabMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FirstNonTabMatch>, false>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FirstNonTabMatch>, false> > >&) in python_extension.cc.o
(anonymous namespace)::PyIterCtrlPMatchSource<cpsm::FirstNonTabMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FirstNonTabMatch>, true>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FirstNonTabMatch>, true> > >&) in python_extension.cc.o
(anonymous namespace)::PyListCtrlPMatchSource<cpsm::UntilLastTabMatch>::fill(std::__1::vector<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::UntilLastTabMatch>, false>, std::__1::allocator<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::UntilLastTabMatch>, false> > >&) in python_extension.cc.o
...
"_PyUnicode_FromStringAndSize", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
"__PyArg_ParseTupleAndKeywords_SizeT", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
"__PyObject_NextNotImplemented", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
"__Py_Dealloc", referenced from:
cpsm_ctrlp_match(_object*, _object*, _object*) in python_extension.cc.o
__ZN4cpsm14for_each_matchIN12_GLOBAL__N_19PyObjItemINS_9CtrlPItemINS_13StringRefItemENS_13FullLineMatchEEELb1EEENS1_22PyIterCtrlPMatchSourceIS5_EEZNS1_22for_each_pyctrlp_matchIZL16cpsm_ctrlp_matchP7_objectSC_SC_E3$_0EEvN5boost16basic_string_refIcNSt3__111char_traitsIcEEEERKNS_7OptionsENS_14CtrlPMatchModeESC_OT_EUlRKS7_PNS_9MatchInfoEE_EEvSJ_SM_OT0_OT1_ in python_extension.cc.o
__ZN4cpsm14for_each_matchIN12_GLOBAL__N_19PyObjItemINS_9CtrlPItemINS_13StringRefItemENS_17FilenameOnlyMatchEEELb1EEENS1_22PyIterCtrlPMatchSourceIS5_EEZNS1_22for_each_pyctrlp_matchIZL16cpsm_ctrlp_matchP7_objectSC_SC_E3$_0EEvN5boost16basic_string_refIcNSt3__111char_traitsIcEEEERKNS_7OptionsENS_14CtrlPMatchModeESC_OT_EUlRKS7_PNS_9MatchInfoEE_EEvSJ_SM_OT0_OT1_ in python_extension.cc.o
__ZN4cpsm14for_each_matchIN12_GLOBAL__N_19PyObjItemINS_9CtrlPItemINS_13StringRefItemENS_16FirstNonTabMatchEEELb1EEENS1_22PyIterCtrlPMatchSourceIS5_EEZNS1_22for_each_pyctrlp_matchIZL16cpsm_ctrlp_matchP7_objectSC_SC_E3$_0EEvN5boost16basic_string_refIcNSt3__111char_traitsIcEEEERKNS_7OptionsENS_14CtrlPMatchModeESC_OT_EUlRKS7_PNS_9MatchInfoEE_EEvSJ_SM_OT0_OT1_ in python_extension.cc.o
__ZN4cpsm14for_each_matchIN12_GLOBAL__N_19PyObjItemINS_9CtrlPItemINS_13StringRefItemENS_17UntilLastTabMatchEEELb1EEENS1_22PyIterCtrlPMatchSourceIS5_EEZNS1_22for_each_pyctrlp_matchIZL16cpsm_ctrlp_matchP7_objectSC_SC_E3$_0EEvN5boost16basic_string_refIcNSt3__111char_traitsIcEEEERKNS_7OptionsENS_14CtrlPMatchModeESC_OT_EUlRKS7_PNS_9MatchInfoEE_EEvSJ_SM_OT0_OT1_ in python_extension.cc.o
std::__1::vector<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> >, std::__1::allocator<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> > > >::reserve(unsigned long) in python_extension.cc.o
std::__1::back_insert_iterator<std::__1::vector<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> >, std::__1::allocator<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> > > > > std::__1::move<std::__1::__wrap_iter<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> >*>, std::__1::back_insert_iterator<std::__1::vector<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> >, std::__1::allocator<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> > > > > >(std::__1::__wrap_iter<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> >*>, std::__1::__wrap_iter<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> >*>, std::__1::back_insert_iterator<std::__1::vector<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> >, std::__1::allocator<cpsm::detail::Matched<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch>, true> > > > >) in python_extension.cc.o
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [cpsm_py.so] Error 1
make[1]: *** [CMakeFiles/cpsm_py.dir/all] Error 2
make: *** [all] Error 2
Using cpsm with the current git master of vim-ctrlp produces this error on pressing ctrlp:
ERROR: function takes at most 11 arguments (12 given)
master~/.vim/plugged/cpsm$ ./install.sh
PY3 not specified; inferring Python version from /usr/local/bin/vim
Python 3 selected
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Boost version: 1.67.0
-- Found the following Boost libraries:
-- program_options
-- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.7", minimum required is "3")
-- Found PythonInterp: /usr/local/bin/python3 (found version "3.7")
-- Found PythonConfig: -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m; -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -ldl -framework CoreFoundation
-- Optional package ICU was not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/xxx/.vim/plugged/cpsm/build
Scanning dependencies of target cpsm_core
[ 11%] Building CXX object CMakeFiles/cpsm_core.dir/src/str_util.cc.o
[ 22%] Linking CXX static library libcpsm_core.a
[ 22%] Built target cpsm_core
Scanning dependencies of target cpsm_cli
[ 33%] Building CXX object CMakeFiles/cpsm_cli.dir/src/cpsm_cli_main.cc.o
[ 44%] Linking CXX executable cpsm_cli
[ 44%] Built target cpsm_cli
Scanning dependencies of target cpsm_py
[ 55%] Building CXX object CMakeFiles/cpsm_py.dir/src/ctrlp_util.cc.o
[ 66%] Building CXX object CMakeFiles/cpsm_py.dir/src/python_extension.cc.o
/Users/xxx/.vim/plugged/cpsm/src/python_extension.cc:48:11: error: assigning to 'char *' from incompatible type 'const char *'
*data = PyUnicode_AsUTF8AndSize(obj, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/cpsm_py.dir/src/python_extension.cc.o] Error 1
make[1]: *** [CMakeFiles/cpsm_py.dir/all] Error 2
I have developed denite.nvim.
It is implemented as neovim remote plugin using Python3.
https://github.com/Shougo/denite.nvim
I want to add cpsm_matcher to optimize the speed.
But current cpsm only supports ctrlp and filter the list of string type.
I need the word of dictionary type support for denite.
-- Found PythonInterp: C:/msys64/mingw64/bin/python2.7.exe (found version "2.7.14")
CMake Error at C:/msys64/mingw64/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find PythonConfig (missing: PYTHON_COMPILE_FLAGS
PYTHON_LINK_FLAGS)
Call Stack (most recent call first):
C:/msys64/mingw64/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/FindPythonConfig.cmake:27 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:31 (find_package)
python3-config is not executable file on Windows. Just shell-script for msys2/mingw64. So I created batch file like below.
python3.6-config.cmd
@echo off
c:\msys64\usr\bin\bash.exe c:\msys64\mingw64\bin\python3.6m-config %*
And modified some files.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f19c831..bc02187 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,7 +46,7 @@ set_target_properties(cpsm_core PROPERTIES COMPILE_FLAGS "-fPIC")
add_library(cpsm_py SHARED src/ctrlp_util.cc src/python_extension.cc)
target_link_libraries(cpsm_py cpsm_core)
set_target_properties(cpsm_py PROPERTIES COMPILE_FLAGS ${PYTHON_COMPILE_FLAGS})
-set_target_properties(cpsm_py PROPERTIES LINK_FLAGS ${PYTHON_LINK_FLAGS})
+set_target_properties(cpsm_py PROPERTIES LINK_FLAGS "-Wl,--whole-archive ${PYTHON_LINK_FLAGS} -Wl,--no-whole-archive -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic")
set_target_properties(cpsm_py PROPERTIES PREFIX "")
if(APPLE)
set_target_properties(cpsm_py PROPERTIES SUFFIX ".so")
@@ -55,7 +55,7 @@ install(TARGETS cpsm_py DESTINATION ${PROJECT_SOURCE_DIR}/autoload)
install(TARGETS cpsm_py DESTINATION ${PROJECT_SOURCE_DIR}/bin)
add_executable(cpsm_cli src/cpsm_cli_main.cc)
-target_link_libraries(cpsm_cli cpsm_core ${Boost_PROGRAM_OPTIONS_LIBRARIES})
+target_link_libraries(cpsm_cli ${Boost_PROGRAM_OPTIONS_LIBRARIES} cpsm_core)
install(TARGETS cpsm_cli DESTINATION ${PROJECT_SOURCE_DIR}/bin)
enable_testing()
diff --git a/cmake/FindPythonConfig.cmake b/cmake/FindPythonConfig.cmake
index 6a69b75..176b9b8 100644
--- a/cmake/FindPythonConfig.cmake
+++ b/cmake/FindPythonConfig.cmake
@@ -16,7 +16,11 @@ include(FindPackageHandleStandardArgs)
find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
- set(_Python_config "${PYTHON_EXECUTABLE}-config")
+ if(WIN32)
+ set(_Python_config "${PYTHON_EXECUTABLE}-config.cmd")
+ else(WIN32)
+ set(_Python_config "${PYTHON_EXECUTABLE}-config")
+ endif(WIN32)
execute_process(COMMAND ${_Python_config} "--includes" OUTPUT_VARIABLE PYTHON_COMPILE_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${_Python_config} "--ldflags" OUTPUT_VARIABLE PYTHON_LINK_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
string(CONCAT _Python_config_message ${PYTHON_COMPILE_FLAGS} "; " ${PYTHON_LINK_FLAGS})
-Wl,--whole-archive ${PYTHON_LINK_FLAGS}
is required to avoid to fix order of -l
specified. This is ugly workaround. Please help me to fix this issue.
Building on cygwin works fine (with the cygwin setup.exe boost), but the output file has the wrong name. The generated python module file is called cpsm_py.so
, but should be called cpsm_py.dll
.
As a result, the matcher fails silently (just returns "0" as the only match). Renaming the file fixes the problem.
First off: cpsm does a fantastic job matching, so thank you! However, there is one thing I miss from CtrlP's default matcher.
When you launch the default CtrlP matcher in mixed mode (e.g. by putting let g:ctrlp_cmd = 'CtrlPMixed'
in .vimrc
) then CtrlP automatically searches open buffers and most-recently-used files as well as the general list-of-all-files that it collects. Importantly, the default matcher prioritizes these subsets aggressively, which means that while cpsm does a much better job matching in the general case, I find the default matcher slightly more efficient for frequently-used files.
As a particular case in point: I have a large ruby project with a file app/models/order.rb
which I access extremely frequently. So-much-so in fact that when I use the default matcher I don't even have to enter a query string at all; it is the first choice of the default 10. However, when I use cpsm I have to enter a few characters to access it. The default matcher is similarly more efficient in terms of number-of-characters for other files on my MRU list.
It would be great if CPSM could similarly prioritize MRUs when running in mixed mode.
Since 1cbd73c, cpsm causes a memory leak in vim, most evident in large repos like linux
where there are many results. Normally I see vim use 50-100 MB, but after a couple dozen ctrlp searches, this balloons to >500 MB, and continues to increase with each search. In even larger repos, it's trivial to hit >10 GB very quickly. Vim and python versions don't seem to make a difference, but for completeness, this is under vim 8.1.1300 and python 3.7.3.
Initially I suspected this was due to switching from py3
to py3eval
, but I'm pretty sure that's irrelevant (tested both with and without vim/vim@8e9a24a, and with reverting back to py3
).
I've narrowed the issue down to the introduction of **_vim_eval("s:input")
, specifically the "a:items"
part. In fact, the following (applied to current master
) almost entirely fixes the issue:
diff --git autoload/cpsm.py autoload/cpsm.py
index d864e8b..b65bd23 100644
--- autoload/cpsm.py
+++ autoload/cpsm.py
@@ -58,7 +58,7 @@ def ctrlp_match_with(**kwargs):
return ["ERROR:" + ex_str], []
def _ctrlp_match_evalinput():
- return ctrlp_match_with(**_vim_eval("s:input"))
+ return ctrlp_match_with(items=_vim_eval("a:items"), **_vim_eval("s:input"))
def ctrlp_match():
"""
diff --git autoload/cpsm.vim autoload/cpsm.vim
index 191935c..0cf4aa5 100644
--- autoload/cpsm.vim
+++ autoload/cpsm.vim
@@ -85,7 +85,6 @@ function cpsm#CtrlPMatch(items, str, limit, mmode, ispath, crfile, regex)
let s:regex_line_prefix = g:ctrlp_line_prefix
endif
let s:input = {
- \ 'items': a:items,
\ 'query': a:str,
\ 'limit': a:limit,
\ 'mmode': a:mmode,
"Almost entirely" because memory still seems to leak (due to the rest of s:input
?), but at a much slower rate. A more proper fix is completely reverting **_vim_eval("s:input")
to the explicit list of kwargs, each _vim_eval
'd separately, i.e. exactly what ctrlp_match()
still does. That's what I've been doing to work around this issue: nkouevda/cpsm@e037128.
Either way I don't understand what the underlying issue is, which I suspect is in vim itself(?).
Since commit 45676e7 I'm receiving an error while compiling cpsm with Python3 support:
(I'm using macOS with Macports, and not Homebrew)
$ PY3=ON ./install.sh
Python 3 selected by PY3=ON
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- program_options
-- Found PythonInterp: /opt/local/bin/python3 (found suitable version "3.6.4", minimum required is "3")
-- Found PythonInterp: /opt/local/bin/python3 (found version "3.6.4")
-- Found PythonConfig: -I/opt/local/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/opt/local/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m; -L/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -lintl -ldl -framework CoreFoundation
-- Found ICU header files in /opt/local/include
-- Found ICU libraries: /opt/local/lib/libicuuc.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/rafi/.cache/vim/dein/repos/github.com/nixprime/cpsm/build
Scanning dependencies of target cpsm_core
[ 11%] Building CXX object CMakeFiles/cpsm_core.dir/src/str_util.cc.o
[ 22%] Linking CXX static library libcpsm_core.a
[ 22%] Built target cpsm_core
Scanning dependencies of target cpsm_cli
[ 33%] Building CXX object CMakeFiles/cpsm_cli.dir/src/cpsm_cli_main.cc.o
[ 44%] Linking CXX executable cpsm_cli
[ 44%] Built target cpsm_cli
Scanning dependencies of target cpsm_py
[ 55%] Building CXX object CMakeFiles/cpsm_py.dir/src/ctrlp_util.cc.o
[ 66%] Building CXX object CMakeFiles/cpsm_py.dir/src/python_extension.cc.o
[ 77%] Linking CXX shared library cpsm_py.so
ld: library not found for -lintl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [cpsm_py.so] Error 1
make[1]: *** [CMakeFiles/cpsm_py.dir/all] Error 2
make: *** [all] Error 2
Sometimes, in large repos, it may be helpful to limit pattern to match only beginnings of words. For example, ctpy
will match ctrl.py
but won't match control.py
. How hard is to add such feature to cpsm
? Which code is responsible for letter-by-letter matching process?
I've installed boost
and cmake
through homebrew and ./install.sh
seems to go through without a hitch.
$ ./install.sh
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- program_options
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
cpsm_py
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /Users/mrak/.local/share/vim/bundle/cpsm/build
[ 42%] Built target cpsm_core
[ 57%] Built target cpsm_cli
[ 85%] Built target cpsm_py
[100%] Built target matcher_test
Install the project...
-- Install configuration: "Release"
-- Installing: /Users/mrak/.local/share/vim/bundle/cpsm/autoload/cpsm_py.so
-- Installing: /Users/mrak/.local/share/vim/bundle/cpsm/test/cpsm_py.so
-- Up-to-date: /Users/mrak/.local/share/vim/bundle/cpsm/test/cpsm_cli.bin
-- Up-to-date: /Users/mrak/.local/share/vim/bundle/cpsm/test/matcher_test.bin
When I load up vim and try to use CtrlP, vim crashes with the following:
Vim: Caught deadly signal ABRT
Vim: Finished.
I'm running Ubuntu 16.04beta, so the libs I used to compile are fairly experimental. No matter what I search for with ctrlp, and cpsm set as the matcher, the result is always 0.
The only ctrlp setting I have enabled is the setting the match_func, and if I remove it, ctrlp works as normal.
If it's relevant, here's the output of install.sh
$ sudo ./install.sh
-- The C compiler identification is GNU 5.3.1
-- The CXX compiler identification is GNU 5.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- program_options
-- Found ICU header files in /usr/include/x86_64-linux-gnu
-- Found ICU libraries: /usr/lib/x86_64-linux-gnu/libicuuc.so
-- Found PythonInterp: /usr/bin/python2.7 (found version "2.7.11")
-- Found Python executable: /usr/bin/python2.7
-- Found Python version: 2.7.11+
-- Found Python library: /usr/lib/x86_64-linux-gnu/libpython2.7.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
WARNING: Target "cpsm_cli" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it. CMake does not define behavior for this case.
WARNING: Target "matcher_test" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it. CMake does not define behavior for this case.
-- Generating done
-- Build files have been written to: /home/username/.vim/bundle/cpsm/build
Scanning dependencies of target cpsm_core
[ 20%] Building CXX object CMakeFiles/cpsm_core.dir/src/str_util.cc.o
[ 40%] Linking CXX static library libcpsm_core.a
[ 40%] Built target cpsm_core
Scanning dependencies of target cpsm_py
[ 60%] Building CXX object CMakeFiles/cpsm_py.dir/src/ctrlp_util.cc.o
[ 80%] Building CXX object CMakeFiles/cpsm_py.dir/src/python_extension_main.cc.o
[100%] Linking CXX shared library cpsm_py.so
[100%] Built target cpsm_py
Install the project...
-- Install configuration: "Release"
-- Installing: /home/username/.vim/bundle/cpsm/autoload/cpsm_py.so
-- Installing: /home/username/.vim/bundle/cpsm/test/cpsm_py.so
cpsm crashes after executing following command (also crashes when doing the same search from Vim via ctrl-p integration):
echo "a/" | ./cpsm_cli.bin --query "a"
It looks like the trailing / in input filepath is causing the crash. Dump from glibc:
*** glibc detected *** /home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin: double free or corruption (!prev): 0x00007fbb7c000a50 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3469a75e66]
/lib64/libc.so.6[0x3469a789b3]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin(_ZN9__gnu_cxx13new_allocatorINS_17__normal_iteratorIPKcSt6vectorIcSaIcEEEEE10deallocateEPS7_m+0x20)[0x46e5b2]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin(_ZNSt12_Vector_baseIN9__gnu_cxx17__normal_iteratorIPKcSt6vectorIcSaIcEEEESaIS7_EE13_M_deallocateEPS7_m+0x32)[0x46a6ec]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin(ZNSt6vectorIN9__gnu_cxx17__normal_iteratorIPKcS_IcSaIcEEEESaIS6_EE19_M_emplace_back_auxIJRKS6_EEEvDpOT+0x120)[0x46ef18]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin(ZNSt6vectorIN9__gnu_cxx17__normal_iteratorIPKcS_IcSaIcEEEESaIS6_EE9push_backERKS6+0x69)[0x46b3ed]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin(_ZN4cpsm7MatcherINS_18PlatformPathTraitsENS_18SimpleStringTraitsEE32check_basename_match_word_prefixEv+0x30e)[0x4640ca]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin(_ZN4cpsm7MatcherINS_18PlatformPathTraitsENS_18SimpleStringTraitsEE5matchEN5boost16basic_string_refIcSt11char_traitsIcEEE+0x12f)[0x45da75]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin[0x44eb50]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin[0x451d9b]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin[0x456802]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin[0x4563a9]
/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin[0x4561f6]
/home/akocis/toolchains/lib64/libstdc++.so.6(+0xb4600)[0x7fbb82dae600]
/lib64/libpthread.so.0[0x3469e079d1]
/lib64/libc.so.6(clone+0x6d)[0x3469ae88fd]
======= Memory map: ========
00400000-0049b000 r-xp 00000000 fd:00 37362944 /home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin
0069a000-0069b000 rw-p 0009a000 fd:00 37362944 /home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin
00db2000-00dd3000 rw-p 00000000 00:00 0 [heap]
3469200000-3469220000 r-xp 00000000 fd:00 53477382 /lib64/ld-2.12.so
346941f000-3469420000 r--p 0001f000 fd:00 53477382 /lib64/ld-2.12.so
3469420000-3469421000 rw-p 00020000 fd:00 53477382 /lib64/ld-2.12.so
3469421000-3469422000 rw-p 00000000 00:00 0
3469600000-3469683000 r-xp 00000000 fd:00 53477443 /lib64/libm-2.12.so
3469683000-3469882000 ---p 00083000 fd:00 53477443 /lib64/libm-2.12.so
3469882000-3469883000 r--p 00082000 fd:00 53477443 /lib64/libm-2.12.so
3469883000-3469884000 rw-p 00083000 fd:00 53477443 /lib64/libm-2.12.so
3469a00000-3469b8a000 r-xp 00000000 fd:00 53477383 /lib64/libc-2.12.so
3469b8a000-3469d8a000 ---p 0018a000 fd:00 53477383 /lib64/libc-2.12.so
3469d8a000-3469d8e000 r--p 0018a000 fd:00 53477383 /lib64/libc-2.12.so
3469d8e000-3469d8f000 rw-p 0018e000 fd:00 53477383 /lib64/libc-2.12.so
3469d8f000-3469d94000 rw-p 00000000 00:00 0
3469e00000-3469e17000 r-xp 00000000 fd:00 53477390 /lib64/libpthread-2.12.so
3469e17000-346a017000 ---p 00017000 fd:00 53477390 /lib64/libpthread-2.12.so
346a017000-346a018000 r--p 00017000 fd:00 53477390 /lib64/libpthread-2.12.so
346a018000-346a019000 rw-p 00018000 fd:00 53477390 /lib64/libpthread-2.12.so
346a019000-346a01d000 rw-p 00000000 00:00 0
346a600000-346a607000 r-xp 00000000 fd:00 53477394 /lib64/librt-2.12.so
346a607000-346a806000 ---p 00007000 fd:00 53477394 /lib64/librt-2.12.so
346a806000-346a807000 r--p 00006000 fd:00 53477394 /lib64/librt-2.12.so
346a807000-346a808000 rw-p 00007000 fd:00 53477394 /lib64/librt-2.12.so
7fbb7c000000-7fbb7c021000 rw-p 00000000 00:00 0
7fbb7c021000-7fbb80000000 ---p 00000000 00:00 0
7fbb820dd000-7fbb820de000 ---p 00000000 00:00 0
7fbb820de000-7fbb82ae3000 rw-p 00000000 00:00 0
7fbb82ae3000-7fbb82af8000 r-xp 00000000 fd:00 18877079 /home/akocis/toolchains/lib64/libgcc_s.so.1
7fbb82af8000-7fbb82cf8000 ---p 00015000 fd:00 18877079 /home/akocis/toolchains/lib64/libgcc_s.so.1
7fbb82cf8000-7fbb82cf9000 rw-p 00015000 fd:00 18877079 /home/akocis/toolchains/lib64/libgcc_s.so.1
7fbb82cf9000-7fbb82cfa000 rw-p 00000000 00:00 0
7fbb82cfa000-7fbb82de5000 r-xp 00000000 fd:00 18877821 /home/akocis/toolchains/lib64/libstdc++.so.6.0.18
7fbb82de5000-7fbb82fe4000 ---p 000eb000 fd:00 18877821 /home/akocis/toolchains/lib64/libstdc++.so.6.0.18
7fbb82fe4000-7fbb82fec000 r--p 000ea000 fd:00 18877821 /home/akocis/toolchains/lib64/libstdc++.so.6.0.18
7fbb82fec000-7fbb82fee000 rw-p 000f2000 fd:00 18877821 /home/akocis/toolchains/lib64/libstdc++.so.6.0.18
7fbb82fee000-7fbb83003000 rw-p 00000000 00:00 0
7fbb83003000-7fbb83071000 r-xp 00000000 fd:00 18881170 /home/akocis/toolchains/boost/lib/libboost_program_options.so.1.61.0
7fbb83071000-7fbb83270000 ---p 0006e000 fd:00 18881170 /home/akocis/toolchains/boost/lib/libboost_program_options.so.1.61.0
7fbb83270000-7fbb83275000 rw-p 0006d000 fd:00 18881170 /home/akocis/toolchains/boost/lib/libboost_program_options.so.1.61.0
7fbb83275000-7fbb83276000 rw-p 00000000 00:00 0
7fbb83296000-7fbb83298000 rw-p 00000000 00:00 0
7fff0a774000-7fff0a791000 rw-p 00000000 00:00 0 [stack]
7fff0a7f2000-7fff0a7f3000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
Core was generated by `/home/akocis/.vim/bundle/cpsm/build/cpsm_cli.bin --query a'.
Program terminated with signal SIGABRT, Aborted.
#0 0x0000003469a32625 in raise () from /lib64/libc.so.6
Current thread is 1 (Thread 0x7fbb82add700 (LWP 31474)) thread apply all where
Thread 2 (Thread 0x7fbb82adf720 (LWP 31473)):
#0 0x0000003469e0822d in pthread_join () from /lib64/libpthread.so.0
#1 0x00007fbb82dae3c7 in __gthread_join (__value_ptr=0x0, __threadid=) at /home/akocis/install/gcc-4.8.2-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu/bits/gthr-default.h:668
#2 std::thread::join (this=0xdd0760) at /home/akocis/install/gcc-4.8.2-build/../gcc-4.8.2/libstdc++-v3/src/c++11/thread.cc:107
#3 0x0000000000457cc2 in cpsm::Thread::join (this=0xdd0750) at /home/akocis/.vim/bundle/cpsm/src/par_util.h:58
#4 0x000000000044ef1e in cpsm::detail::for_each_match<cpsm::PlatformPathTraits, cpsm::SimpleStringTraits, cpsm::StringRefItem, cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::normal_iterator<const std::basic_string_, std::vectorstd::basic_string > >, main(int, char)::__lambda4>(boost::string_ref, const cpsm::Options &, const cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::_normal_iterator<std::basic_string<char, std::char_traits, std::allocator > const, std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > > > > &, const __lambda4 &) (query=..., opts=..., src=...,
dst=...) at /home/akocis/.vim/bundle/cpsm/src/api.h:284
#5 0x000000000044de46 in cpsm::for_each_match<cpsm::StringRefItem, cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::normal_iterator<const std::basic_string_, std::vectorstd::basic_string > >, main(int, char)::__lambda4>(boost::string_ref, const cpsm::Options &, const cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::_normal_iterator<std::basic_string<char, std::char_traits, std::allocator > const, std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > > > > &, const __lambda4 &) (query=..., opts=..., src=..., dst=...) at /home/akocis/.vim/bundle/cpsm/src/api.h:159
#6 0x000000000044db63 in main (argc=3, argv=0x7fff0a787638) at /home/akocis/.vim/bundle/cpsm/src/cpsm_cli_main.cc:74
Thread 1 (Thread 0x7fbb82add700 (LWP 31474)):
#0 0x0000003469a32625 in raise () from /lib64/libc.so.6
#1 0x0000003469a33e05 in abort () from /lib64/libc.so.6
#2 0x0000003469a70537 in __libc_message () from /lib64/libc.so.6
#3 0x0000003469a75e66 in malloc_printerr () from /lib64/libc.so.6
#4 0x0000003469a789b3 in _int_free () from /lib64/libc.so.6
#5 0x000000000046e5b2 in __gnu_cxx::new_allocator<__gnu_cxx::__normal_iterator<char const*, std::vector<char, std::allocator > > >::deallocate (this=0x7fbb82adcc28, __p=0x7fbb7c000a50) at /home/akocis/toolchains/include/c++/4.8.2/ext/new_allocator.h:110
#6 0x000000000046a6ec in std::_Vector_base<__gnu_cxx::__normal_iterator<char const*, std::vector<char, std::allocator > >, std::allocator<__gnu_cxx::__normal_iterator<char const*, std::vector<char, std::allocator > > > >::_M_deallocate (this=0x7fbb82adcc28, __p=0x7fbb7c000a50, __n=1)
at /home/akocis/toolchains/include/c++/4.8.2/bits/stl_vector.h:174
#7 0x000000000046ef18 in std::vector<__gnu_cxx::__normal_iterator<char const*, std::vector<char, std::allocator > >, std::allocator<__gnu_cxx::__normal_iterator<char const*, std::vector<char, std::allocator > > > >::_M_emplace_back_aux<__gnu_cxx::__normal_iterator<char const*, std::vector<char, std::allocator > > const&> (this=0x7fbb82adcc28)
at /home/akocis/toolchains/include/c++/4.8.2/bits/vector.tcc:430
#8 0x000000000046b3ed in std::vector<__gnu_cxx::__normal_iterator<char const*, std::vector<char, std::allocator > >, std::allocator<__gnu_cxx::__normal_iterator<char const*, std::vector<char, std::allocator > > > >::push_back (this=0x7fbb82adcc28, __x=97 'a') at /home/akocis/toolchains/include/c++/4.8.2/bits/stl_vector.h:911
#9 0x00000000004640ca in cpsm::Matcher<cpsm::PlatformPathTraits, cpsm::SimpleStringTraits>::check_basename_match_word_prefix (this=0x7fbb82adcbe0) at /home/akocis/.vim/bundle/cpsm/src/matcher.h:459
#10 0x000000000045da75 in cpsm::Matcher<cpsm::PlatformPathTraits, cpsm::SimpleStringTraits>::match (this=0x7fbb82adcbe0, item=...) at /home/akocis/.vim/bundle/cpsm/src/matcher.h:146
#11 0x000000000044eb50 in cpsm::detail::__lambda3::operator() (__closure=0xdd0a50) at /home/akocis/.vim/bundle/cpsm/src/api.h:261
#12 0x0000000000451d9b in cpsm::Thread::run<cpsm::detail::for_each_match(boost::string_ref, const cpsm::Options&, const Source&, const Sink&) [with PathTraits = cpsm::PlatformPathTraits; StringTraits = cpsm::SimpleStringTraits; Item = cpsm::StringRefItem; Source = cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::__normal_iterator<const std::basic_string, std::vectorstd::basic_string > >; Sink = main(int, char)::__lambda4; boost::string_ref = boost::basic_string_ref<char, std::char_traits >]::__lambda3>(cpsm::Thread , const cpsm::detail::__lambda3 &) (thread=0xdd0750, f=...) at /home/akocis/.vim/bundle/cpsm/src/par_util.h:68
#13 0x0000000000456802 in std::_Bind_simple<void ((cpsm::Thread, cpsm::detail::for_each_match(boost::string_ref, const cpsm::Options&, const Source&, const Sink&) [with PathTraits = cpsm::PlatformPathTraits; StringTraits = cpsm::SimpleStringTraits; Item = cpsm::StringRefItem; Source = cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::normal_iterator<const std::basic_string_, std::vectorstd::basic_string > >; Sink = main(int, char)::__lambda4; boost::string_ref = boost::basic_string_ref<char, std::char_traits >]::_lambda3))(cpsm::Thread, const cpsm::detail::for_each_match(boost::string_ref, const cpsm::Options&, const Source&, const Sink&) [with PathTraits = cpsm::PlatformPathTraits; StringTraits = cpsm::SimpleStringTraits; Item = cpsm::StringRefItem; Source = cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::__normal_iterator<const std::basic_string, std::vectorstd::basic_string > >; Sink = main(int, char)::__lambda4; boost::string_ref = boost::basic_string_ref<char, std::char_traits >]::__lambda3&)>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (this=0xdd0a50) at /home/akocis/toolchains/include/c++/4.8.2/functional:1732
#14 0x00000000004563a9 in std::_Bind_simple<void ((cpsm::Thread*, cpsm::detail::for_each_match(boost::string_ref, const cpsm::Options&, const Source&, const Sink&) [with PathTraits = cpsm::PlatformPathTraits; StringTraits = cpsm::SimpleStringTraits; Item = cpsm::StringRefItem; Source = cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::normal_iterator<const std::basic_string_, std::vectorstd::basic_string > >; Sink = main(int, char)::__lambda4; boost::string_ref = boost::basic_string_ref<char, std::char_traits >]::_lambda3))(cpsm::Thread, const cpsm::detail::for_each_match(boost::string_ref, const cpsm::Options&, const Source&, const Sink&) [with PathTraits = cpsm::PlatformPathTraits; StringTraits = cpsm::SimpleStringTraits; Item = cpsm::StringRefItem; Source = cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::__normal_iterator<const std::basic_string, std::vectorstd::basic_string > >; Sink = main(int, char*)::__lambda4; boost::string_ref = boost::basic_string_ref<char, std::char_traits >]::__lambda3&)>::operator()(void) (
this=0xdd0a50) at /home/akocis/toolchains/include/c++/4.8.2/functional:1720
#15 0x00000000004561f6 in std::thread::Impl<std::Bind_simple<void ((cpsm::Thread, cpsm::detail::for_each_match(boost::string_ref, const cpsm::Options&, const Source&, const Sink&) [with PathTraits = cpsm::PlatformPathTraits; StringTraits = cpsm::SimpleStringTraits; Item = cpsm::StringRefItem; Source = cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::__normal_iterator<const std::basic_string, std::vectorstd::basic_string > >; Sink = main(int, char_)::__lambda4; boost::string_ref = boost::basic_string_ref<char, std::char_traits >]::_lambda3))(cpsm::Thread, const cpsm::detail::for_each_match(boost::string_ref, const cpsm::Options&, const Source&, const Sink&) [with PathTraits = cpsm::PlatformPathTraits; StringTraits = cpsm::SimpleStringTraits; Item = cpsm::StringRefItem; Source = cpsm::RangeSource<cpsm::StringRefItem, __gnu_cxx::__normal_iterator<const std::basic_string, std::vectorstd::basic_string > >; Sink = main(int, char*)::__lambda4; boost::string_ref = boost::basic_string_ref<char, std::char_traits >]::__lambda3&)> >::_M_run(void) (this=0xdd0a38) at /home/akocis/toolchains/include/c++/4.8.2/thread:115
#16 0x00007fbb82dae600 in std::(anonymous namespace)::execute_native_thread_routine (__p=) at /home/akocis/install/gcc-4.8.2-build/../gcc-4.8.2/libstdc++-v3/src/c++11/thread.cc:84
#17 0x0000003469e079d1 in start_thread () from /lib64/libpthread.so.0
#18 0x0000003469ae88fd in clone () from /lib64/libc.so.6
When filtering buffers with CtrlP and cpsm the matched characters aren't highlighted.
I tried disabling cpsm for buffers but then matching isn't as good as with cpsm.
Played a bit with the experimental branch on linux so far and it looks great (and definitely seens to resolve #18). However, it isn't building on my OSX machine.
In file included from /Users/eapache/.vim/bundle-local/cpsm/src/python_extension_main.cc:29:
/Users/eapache/.vim/bundle-local/cpsm/src/api.h:225:31: error: constexpr variable 'comparator' must be initialized by a constant expression
constexpr auto comparator = [](MatchedItem const& x, MatchedItem const& y) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/eapache/.vim/bundle-local/cpsm/src/api.h:156:15: note: in instantiation of function template specialization 'cpsm::detail::for_each_match<cpsm::PlatformPathTraits, cpsm::Utf8StringTraits, (anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch> >, (anonymous namespace)::PyListCtrlPMatchSource<cpsm::FullLineMatch>,
(lambda at /Users/eapache/.vim/bundle-local/cpsm/src/python_extension_main.cc:239:9)>' requested here
detail::for_each_match<PlatformPathTraits, Utf8StringTraits, Item>(
^
/Users/eapache/.vim/bundle-local/cpsm/src/python_extension_main.cc:239:9: note: in instantiation of function template specialization 'cpsm::for_each_match<(anonymous namespace)::PyObjItem<cpsm::CtrlPItem<cpsm::StringRefItem, cpsm::FullLineMatch> >, (anonymous namespace)::PyListCtrlPMatchSource<cpsm::FullLineMatch>,
(lambda at /Users/eapache/.vim/bundle-local/cpsm/src/python_extension_main.cc:239:9)>' requested here
DO_MATCH_WITH_MMODE(cpsm::FullLineMatch);
^
/Users/eapache/.vim/bundle-local/cpsm/src/python_extension_main.cc:230:9: note: expanded from macro 'DO_MATCH_WITH_MMODE'
cpsm::for_each_match<CpsmItem<MMODE>>( \
^
This is El Capitan with apple's clang 7.0.2.7000181. Master branch still builds fine.
I build the plugin on cygwin and it is just extremely slow (10-50 times slower that the default matcher). Any idea what might cause that?
Vim as shipped by default with Ubuntu 16.04 is built with python3 instead of python 2, meaning CPSM (and a few other plugins) don't work out of the box. Since CPSM has almost no actual logic in the python bindings I imagine it'll be pretty easy to convert to build with python 3, probably just needs some cmake tweaks.
When trying to compile using the install.sh
script, it fails with following output:
https://gist.github.com/zegervdv/66ac5b35cc71dd8f0e68
I have installed boost via homebrew, am I still missing some dependency?
Mac OS X 10.10.3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.