I tried to put ignored setting in .vimrc
But when I used the ctrlp to search under rails app folder
It still search the vendor folder, so it took lots of time.
But when the search was done, I couldn't search anything under the vendor
It was so strange! How to fix it.
Here is my .vimrc setting file.
http://d.pr/i/yMtK
http://d.pr/i/Hy4u
" Sane Ignore For ctrlp
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$|vendor\|\.hg$\|\.svn$\|\.yardoc\|public\/images\|public\/system\|data\|log\|tmp$',
\ 'file': '\.exe$\|\.so$\|\.dat$'
\ }
When I appended the code in the end of .vimrc
217 let g:NERDTreeIgnore=['\~$', 'vendor']
218 set wildignore+=*\\vendor\\**
It worked when my first time to use the CTRLP to search under the RAILS app folder,
But still NOT worked in the following times.
I guess maybe there are some settings will disable the ignored setting ?
Here are the structure of my folder
.
├── Gemfile
├── Gemfile.lock
├── README.rdoc
├── Rakefile
├── app
│ ├── assets
│ ├── controllers
│ ├── helpers
│ ├── mailers
│ ├── models
│ ├── uploaders
│ ├── views
│ └── workers
├── auto.sh
├── config
│ ├── application.rb
│ ├── application.yml
│ ├── boot.rb
│ ├── database.yml
│ ├── environment.rb
│ ├── environments
│ ├── initializers
│ ├── locales
│ ├── macbookair_whenever_schedule.rb
│ ├── menu_navigation.rb
│ ├── navigation.rb
│ ├── resque.god
│ ├── resque_schedule.yml
│ ├── routes.rb
│ ├── schedule.rb -> ubuntu_whenever_schedule.rb
│ ├── tinymce.yml
│ └── ubuntu_whenever_schedule.rb
├── config.ru
├── db
│ ├── development.sqlite3
│ ├── migrate
│ ├── migrate_should_be_skip
│ ├── production.sqlite3
│ ├── schema.rb
│ └── seeds.rb
├── doc
│ └── README_FOR_APP
├── lib
│ ├── assets
│ ├── auto_tools
│ ├── tasks
│ └── url_automation_module.rb
├── log
│ ├── apalog
│ ├── development.log
│ ├── passenger.80.log
│ ├── production.log
│ └── prodution.log
├── output_name
├── public
│ ├── 404.html
│ ├── 422.html
│ ├── 500.html
│ ├── exports
│ ├── favicon.ico
│ ├── results.zip
│ ├── robots.txt
│ ├── sandbox
│ └── uploads
├── script
│ ├── delayed_job
│ └── rails
├── test
│ ├── fixtures
│ ├── functional
│ ├── integration
│ ├── performance
│ ├── test_helper.rb
│ └── unit
├── test.sh
├── tmp
│ ├── cache
│ ├── pids
│ ├── restart.txt
│ ├── sessions
│ └── sockets
├── tmplog
└── vendor
└── bundle
If you type :help ctrlp-options and read a bit, you will find:
Note #1: by default, wildignore and g:ctrlp_custom_ignore only
apply when globpath() is used to scan for files, thus these options
do not apply when a command defined with g:ctrlp_user_command is
being used.
Thus, you may need to unlet g:ctrlp_user_command (possibly set to a default command) to actually use wildignore as advised by #TomCammann. For instance, in your ~/.vimrc, add:
if exists("g:ctrlp_user_command")
unlet g:ctrlp_user_command
endif
set wildignore+=*\\vendor\\**
After that, you need to refresh your ctrlp cache: in Vim, press F5 in ctrlp mode, or run :CtrlPClearAllCaches, or remove the cache directory directly in your shell:
rm -r ~/.cache/ctrlp/ # On Linux
part of my .vimrc file . perhaps it will help
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.idea/*,*/.DS_Store,*/vendor
You can use the wildignore vim setting which CtrlP will pick up on.
set wildignore+=*\\vendor\\**
Check if you are using some specific search command, like:
let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux
let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows
This kind of configuration ignores the g:ctrlp_custom_ignore option.
wildignore may be used by other commands, the reason of failure for g:ctrlp_custom_ignore is g:ctrlp_user_command, for example, here is mine:
if executable('rg')
let g:ctrlp_user_command = 'rg %s --files --hidden --color=never --glob ""'
endif
For this case, rg has own ignore way, just put .git to .gitignore, rg will not search any files in .gitignore.
Related
Emmet plugin installed on my vim74.
Here are some tutorial from the mannual .
https://docs.emmet.io/customization/snippets/
Create snippets.json file in extensions folder to add or override snippets.
sudo find / -name 'snippets.jsom'
nothing as output.
No snippets.json in my directories,i want to create it as the mannual say,which directory to put it in?
What does extensions folder mean?
Which directory is extensions folder for my vim and emmet?
tree -L 2 /usr/share/vim
/usr/share/vim
├── addons
│ ├── doc
│ └── plugin
├── registry
│ └── vim-runtime.yaml
├── vim74
│ ├── autoload
│ ├── bugreport.vim
│ ├── bundle
│ ├── colors
│ ├── compiler
│ ├── debian.vim
│ ├── delmenu.vim
│ ├── doc
│ ├── evim.vim
│ ├── filetype.vim
│ ├── ftoff.vim
│ ├── ftplugin
│ ├── ftplugin.vim
│ ├── ftplugof.vim
│ ├── gvimrc_example.vim
│ ├── indent
│ ├── indent.vim
│ ├── indoff.vim
│ ├── keymap
│ ├── lang
│ ├── macros
│ ├── menu.vim
│ ├── mswin.vim
│ ├── optwin.vim
│ ├── plugin
│ ├── print
│ ├── rgb.txt
│ ├── scripts.vim
│ ├── spell
│ ├── synmenu.vim
│ ├── syntax
│ ├── tutor
│ └── vimrc_example.vim
├── vimfiles -> /etc/vim
├── vimrc -> /etc/vim/vimrc
└── vimrc.tiny -> /etc/vim/vimrc.tiny
tree -L 1 /usr/share/vim/vim74/autoload
/usr/share/vim/vim74/autoload
├── adacomplete.vim
├── ada.vim
├── ccomplete.vim
├── clojurecomplete.vim
├── csscomplete.vim
├── decada.vim
├── emmet
├── emmet.vim
├── getscript.vim
├── gnat.vim
├── gzip.vim
├── htmlcomplete.vim
├── javascriptcomplete.vim
├── netrwFileHandlers.vim
├── netrw_gitignore.vim
├── netrwSettings.vim
├── netrw.vim
├── paste.vim
├── phpcomplete.vim
├── python3complete.vim
├── pythoncomplete.vim
├── README.txt
├── rubycomplete.vim
├── spellfile.vim
├── sqlcomplete.vim
├── syntaxcomplete.vim
├── tar.vim
├── tohtml.vim
├── vimball.vim
├── xml
├── xmlcomplete.vim
└── zip.vim
2 directories, 30 files
tree -l 1 /usr/share/vim/vim74/plugin
1 [error opening dir]
/usr/share/vim/vim74/plugin
├── emmet.vim
├── getscriptPlugin.vim
├── gzip.vim
├── matchparen.vim
├── netrwPlugin.vim
├── README.txt
├── rrhelper.vim
├── spellfile.vim
├── tarPlugin.vim
├── tohtml.vim
├── vimballPlugin.vim
└── zipPlugin.vim
The linked page says:
Please refer to README file bundled with your editor’s plugin to find out where Emmet looks for extensions.
When you read this sentence, what is the only reasonable thing to do? Reading your plugin's READMEof course! A README that says:
If you have installed the web-api for emmet-vim you can also add your own snippets using a custom snippets.json file.
Once you have installed the web-api add this line to your .vimrc:
let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/.snippets_custom.json')), "\n"))
You can change the path to your snippets_custom.json according to your preferences.
1.to install pathogen.vim
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
2.to edite snippets.json
copy https://github.com/emmetio/emmet/blob/master/lib/snippets.json and revise something for your customization.
I want to make html:5 expand as below.
<html lang="zh">
<head>
<meta charset="gbk">
<title></title>
</head>
<body>
</body>
</html>
vim ~./vim/snippets.json
"variables": {
"lang": "zh",
"locale": "en-US",
"charset": "gbk",
"indentation": "\t",
"newline": "\n"
},
To list only part codes of it.
3.to edite your .vimrc to call snippets.json
vim .vimrc
let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/.vim/snippets.json')), "\n"))
I'm following Swaroop's Byte of Vim, and have reached the chapter on personal information management, where it says to install the Viki plugin. The instructions are as follows (and I have no real idea of what is going on, but):
Download multvals.vim [2] and store as $vimfiles/plugin/multvals.vim
Download genutils.zip [3] and unzip this file to $vimfiles
Download Viki.zip [4] and unzip this file to $vimfiles (make sure all the folders and files under the 'Viki' folder name are stored directly in the $vimfiles folder)
After this I open a new text file in vim and run the commmand
:set filetype=viki
but I get a whole slew of errors. I've tried clearing out my ~/.vim folder and reinstalling everything, along with tlib this time as specified on the Viki vimscript page, and extracted the version 4.0 viki.vba instead of using the version 4.08 zip file, but I'm still getting errors about non-existent functions:
Error detected while processing home/user/.vim/ftplugin/viki.vim:
line 100
E117: Unknown function: tlib#balloon#Register
I don't really know what's going on, and am quite a new Vim user, so please be patient. Right now my ~/.vim directory tree looks like this:
.vim
├── autoload
│ ├── genutils.vim
│ ├── tlib
│ │ ├── eval.vim
│ │ ├── list.vim
│ │ ├── notify.vim
│ │ ├── persistent.vim
│ │ ├── progressbar.vim
│ │ ├── TestChild.vim
│ │ └── vim.vim
│ ├── tlib.vim
│ ├── viki
│ │ ├── enc_latin1.vim
│ │ └── enc_utf-8.vim
│ ├── viki_anyword.vim
│ ├── viki_latex.vim
│ ├── viki_viki.vim
│ └── viki.vim
├── colors
│ └── molokai.vim
├── compiler
│ └── deplate.vim
├── doc
│ ├── tlib.txt
│ └── viki.txt
├── ftplugin
│ ├── bib
│ │ └── viki.vim
│ └── viki.vim
├── plugin
│ ├── 02tlib.vim
│ ├── genutils.vim
│ ├── multvals.vim
│ └── viki.vim
└── test
└── tlib.vim
Any help is much appreciated.
The info is outdated. You need to install a current versions of tlib and viki from:
https://github.com/tomtom/viki_vim
https://github.com/tomtom/tlib_vim
I am really getting headache from this - I am beginning to use vim for my daily programming tasks, so I decided to make use of great plugins which are available for it. So I started with Pathogen and I believe I succesfully installed it. Then I tried emmet.vim but I am really not able make this work. This is my directory structure
├── autoload
│ └── pathogen.vim
└── bundle
├── autoload
│ ├── emmet
│ │ ├── lang
│ │ │ ├── css.vim
│ │ │ ├── haml.vim
│ │ │ ├── html.vim
│ │ │ ├── sass.vim
│ │ │ ├── scss.vim
│ │ │ └── slim.vim
│ │ ├── lang.vim
│ │ ├── lorem
│ │ │ ├── en.vim
│ │ │ └── ja.vim
│ │ └── util.vim
│ └── emmet.vim
├── doc
│ └── emmet.txt
└── plugin
└── emmet.vim
| .vimrc
And .vimrc content
execute pathogen#infect()
syntax on
filetype plugin indent on
So is this right? And I then tried simple tutorial mentioned on GitHub page but it didn't work. So I did
vim file.html
i //insert mode
html:5 and then pressing Ctrl + y + ,
but nothing happened. I appreciate any advice on this, I got really stucked
You forgot the root directory.
You have bundle/<repo content>, but it should be bundle/emmet-vim/<repo content>.
So usually you just do:
$ cd ~/.vim/bundle
$ git clone git#github.com:mattn/emmet-vim.git
(Which is also described at Pathogen README :-))
Setting up a new machine and trying to get Solarized running in Vim. Getting the following error when I run vim:
E185: Cannot find color scheme solarized
Tried to follow Pathogen install instructions from the Solarized README on the official repo. Checked this similar question & answer, which solved the problem by actually having the proper files in the directory, but as you can see below, my directory is indeed full of goodies (I just cloned it).
Details
iTerm2
.vimrc is loading, and other plugins are working
Tried to manually install Solarized also (by moving solarized.vim into .vim/colors), but got the same error
.vimrc
32 syntax enable
33 " colo wombat
34
35 """ Solarized """
36 let g:solarized_termcolors=256
37 set background=dark
38 colorscheme solarized
.vim directory
├── autoload
│ └── pathogen.vim
├── bundle
│ ├── ctrlp.vim
│ │ ├── autoload
│ │ │ ├── ctrlp
│ │ │ │ ├── bookmarkdir.vim
│ │ │ │ ├── buffertag.vim
│ │ │ │ ├── changes.vim
│ │ │ │ ├── dir.vim
│ │ │ │ ├── line.vim
│ │ │ │ ├── mixed.vim
│ │ │ │ ├── mrufiles.vim
│ │ │ │ ├── quickfix.vim
│ │ │ │ ├── rtscript.vim
│ │ │ │ ├── tag.vim
│ │ │ │ ├── undo.vim
│ │ │ │ └── utils.vim
│ │ │ └── ctrlp.vim
│ │ ├── doc
│ │ │ ├── ctrlp.txt
│ │ │ └── tags
│ │ ├── plugin
│ │ │ └── ctrlp.vim
│ │ └── readme.md
│ ├── supertab
│ │ ├── Makefile
│ │ ├── README.rst
│ │ ├── doc
│ │ │ ├── supertab.txt
│ │ │ └── tags
│ │ └── plugin
│ │ └── supertab.vim
│ ├── vim-colors-solarized
│ │ ├── README.mkd
│ │ ├── autoload
│ │ │ └── togglebg.vim
│ │ ├── bitmaps
│ │ │ └── togglebg.png
│ │ ├── colors
│ │ │ └── solarized.vim
│ │ └── doc
│ │ ├── solarized.txt
│ │ └── tags
│ ├── vim-jade
│ └── vim-surround
│ ├── README.markdown
│ ├── doc
│ │ ├── surround.txt
│ │ └── tags
│ └── plugin
│ └── surround.vim
└── colors
└── wombat.vim
I ran into the same issue with Gnome Terminal (although gvim would work fine), and these were the lines I had to add to my .vimrc:
se t_Co=16
let g:solarized_termcolors=256
set background=dark
colorscheme solarized
Setting se t_co=256 without let g:solarized_termcolors=256, will also show colors, but not the right one as per the colorscheme, since it reverts to fallback mode with 256 colors.
This is similar to Mike's suggestion.
Another solution after none of the above worked for me. This one's a real face-palmer.
Make sure that
""" Solarized """
let g:solarized_termcolors=256
set background=dark
colorscheme solarized
or whatever settings you use comes after your pathogen#infect() code.
make sure syntax on is in your .vimrc
Check what t_Co vim is picked up from your term emulator (a quick :echo &t_Co). If it's 8 you'll want to se t_Co=16. You might also try se t_Co=256 though without let g:solarized_termcolors=16 this will use the 256 fallback mode, which isn't quite the correct color scheme.
my source
Found this bug:
https://github.com/altercation/vim-colors-solarized/issues/104
cp ~/.vim/bundle/vim-colors-solarized/colors/solarized.vim ~/.vim/colors/
Leaving this here for others looking for possible solutions to similar E185 vim colorscheme errors: for me the jellybeans colorscheme was throwing the same error at startup, whether I had it in system wide /usr/share/vim/vimfiles/colors/jellybeans.vim or ~/.vim/colors/jellybeans.vim/jellybeans.vim.
I noticed that when I ran vim as sudo that my colors suddenly worked! That lead me to discover that the jellybeans.vim file needs write permissions on 'others' to work (not sure why, didn't look into the code for it). I did some testing, and at least for jellybeans on vim 7.4, vim will fail to find and load the colorscheme until the file permissions are: rw-rw-rw-
I have a directory-tree with a lot of files in it. I'd like to copy all of those files into one new directory, but with all files located in the base of the folder.
So I have something like this:
images
├── avatar.png
├── bg.jpg
├── checkbox.png
├── cross.png
├── datatables
│ ├── back_disabled.png
│ ├── back_enabled.png
│ ├── forward_disabled.png
│ ├── forward_enabled.png
│ ├── sort_asc.png
│ ├── sort_asc_disabled.png
│ ├── sort_both.png
│ ├── sort_desc.png
│ └── sort_desc_disabled.png
├── exclamation.png
├── forms
│ ├── btn_left.gif
│ ├── btn_right.gif
│ ├── checkbox.gif
│ ├── input
│ │ ├── input_left-focus.gif
│ │ ├── input_left-hover.gif
│ │ ├── input_left.gif
│ │ ├── input_right-focus.gif
│ │ ├── input_right-hover.gif
│ │ ├── input_right.gif
│ │ ├── input_text_left.gif
│ │ └── input_text_right.gif
│ ├── radio.gif
│ ├── select_left.gif
│ ├── select_right.gif
And I'd like something like this:
new_folder
├── avatar.png
├── bg.jpg
├── checkbox.png
├── cross.png
├── back_disabled.png
├── back_enabled.png
├── forward_disabled.png
├── forward_enabled.png
├── sort_asc.png
├── sort_asc_disabled.png
├── sort_both.png
├── sort_desc.png
├── sort_desc_disabled.png
├── exclamation.png
├── btn_left.gif
├── btn_right.gif
├── checkbox.gif
├── input_left-focus.gif
├── input_left-hover.gif
├── input_left.gif
├── input_right-focus.gif
├── input_right-hover.gif
├── input_right.gif
├── input_text_left.gif
├── input_text_right.gif
├── radio.gif
├── select_left.gif
├── select_right.gif
I'm pretty sure there is a bashcommand for that, but I haven't found it yet. Do you have any ideas?
CS
find /source-tree -type f -exec cp {} /target-dir \;
you are looking for ways to flatten the directory
find /images -iname '*.jpg' -exec cp --target-directory /newfolder/ {} \;
find all files iname in case insensitive name mode.
cp copy once to --target-directory named /newfolder/.
{} expand the list from find into the form of /dir/file.jpg /dir/dir2/bla.jpg.
On zsh:
cp /source/**/* /destination
$ cd images && cp ** new_folder/