The standard snippets repository for neosnippet.
You can fork or send pull request.
The standard snippets repository for neosnippet
License: Other
The standard snippets repository for neosnippet.
You can fork or send pull request.
I'm not sure if i've missed it in the documentation but it seems to me that there's no way for delayed expression evaluation.
see the following example:
\section{${1:Section Name}}
\label{${2:sec:`tolower(substitute('$1', '\W', '-', 'g'))`}}
${0}
so if i just stepped through that snippet i'd expect it to evaluate to
\section{Section Name}
\label{sec:section-name}
Maybe you could check if there are special characters inside the backticks and evaluate only after they've been expanded?
I'm getting this error:
Error detected while processing function neosnippet#init#_initialize[4]..<SNR>76_initialize_cache[2]..neosnippet#commands#_make_cache[16]..neosnippet#helpers#get_snippets_directory:
line 2:
E712: Argument of get() must be a List or Dictionary
Error detected while processing function neosnippet#init#_initialize[4]..<SNR>76_initialize_cache[2]..neosnippet#commands#_make_cache[16]..neosnippet#helpers#get_snippets_directory:
line 2:
E712: Argument of get() must be a List or Dictionary
Error detected while processing function neosnippet#init#_initialize[4]..<SNR>76_initialize_cache[2]..neosnippet#commands#_make_cache:
line 16:
E714: List required
How can I solve this issue?
Thanks for your help.
I can not install neosnippet-snippets by any of ways below,
while other plugins(vimshell,neocomplete,etc) work well.
1: just put those in my _vimrc:
NeoBundleFetch 'Shougo/neobundle.vim'
NeoBundle 'Shougo/vimproc', {
\ 'build' : {
\ 'windows' : 'make -f make_mingw32.mak',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'unix' : 'make -f make_unix.mak',
\ },
\ }
NeoBundle 'Shougo/vimshell.vim'
NeoBundle 'Shougo/neocomplete'
NeoBundle 'Shougo/neosnippet'
NeoBundle 'https://github.com/Shougo/neosnippet-snippets'
NeoBundle 'kien/ctrlp.vim'
2: another in _vimrc:
...
NeoBundle 'Shougo/neosnippet-snippets'
...
3: I copy this in command mode:
NeoBundleInstall 'https://github.com/Shougo/neosnippet-snippets'
and it returns below:
[neobundle/install] Target bundles not found.
[neobundle/install] You may have used the wrong bundle name, or all of the bundles are already installed.
However, I can download it as zip. so, maybe something wrong with git, ?
need a .gitignore file?
Since Shougo is putting a lot of effort into deoplete for neovim, it seems like it would make sense to add support for deoplete as well.
I am using 'Shougo/neosnippet-snippets' with 'honza/vim-snippets'.
The 'if' snippet is not shown in java files, when i enter if I see the info or interface snippets but not if.
This is my .vimrc:
if has('vim_starting')
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
" My Bundles here:
" Refer to |:NeoBundle-examples|.
" Note: You don't set neobundle setting in .gvimrc!
NeoBundle 'Shougo/vimproc.vim', {
\ 'build' : {
\ 'linux' : 'make',
\ 'cygwin' : 'make -f make_cygwin.mak', }, }
NeoBundle 'Shougo/neocomplete.vim'
NeoBundle 'Shougo/unite.vim'
NeoBundle 'Shougo/neosnippet'
NeoBundle 'Shougo/neosnippet-snippets'
NeoBundle 'honza/vim-snippets'
NeoBundle 'tpope/vim-surround'
NeoBundle 'scrooloose/syntastic'
NeoBundle 'scrooloose/nerdcommenter'
NeoBundle 'syngan/vim-vimlint', {
\ 'depends' : 'ynkdir/vim-vimlparser' }
NeoBundle 'bling/vim-airline'
NeoBundle 'airblade/vim-gitgutter'
NeoBundle 'chrisbra/csv.vim'
NeoBundle 'derekwyatt/vim-scala'
NeoBundle 'altercation/vim-colors-solarized'
NeoBundle 'xolox/vim-easytags', {
\ 'depends' : [ 'xolox/vim-misc', 'xolox/vim-shell' ] }
NeoBundle 'majutsushi/tagbar'
NeoBundle 'godlygeek/tabular'
call neobundle#end()
" Required:
filetype plugin indent on
" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
set nu
syntax enable
set expandtab
set shiftwidth=2
set softtabstop=2
" treat *.gradle files as groovy file for syntax highlights
au BufNewFile,BufRead *.gradle setf groovy
" remove trailing whitespaces when writing a buffer
au BufWritePre * :%s/\s\+$//e
if has('win32unix')
set backspace=indent,eol,start
endif
let g:neocomplete#enable_at_startup = 1
" Plugin key-mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" SuperTab like snippets behavior.
imap <expr><TAB>
\ pumvisible() ? "\<C-n>" :
\ neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
" For conceal markers.
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
let g:neosnippet#enable_snipmate_compatibility = 1
let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets'
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
" Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
" For no inserting <CR> key.
"return pumvisible() ? "\<C-y>" : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif
let g:EclimCompletionMethod = 'omnifunc'
let g:neocomplete#sources#omni#input_patterns.java =
\ '\%(\h\w*\|)\)\.\w*'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_java_javac_config_file_enabled = 1
let g:syntastic_java_javac_options = '-Xlint'
let g:syntastic_java_javac_delete_output = 1
let g:syntastic_java_checkstyle_classpath = '~/checkstyle-6.10.1-all.jar'
let g:syntastic_java_checkstyle_conf_file = '~/google_checks.xml'
let g:syntastic_scala_scalastyle_jar = '~/scalastyle_2.11-0.7.0-batch.jar'
let g:syntastic_scala_scalastyle_config_file = '~/scalastyle_config.xml'
set laststatus=2
set encoding=utf-8
set noshowmode
set guifont=Inconsolata\ for\ Powerline:h11
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
set background=dark
colorscheme solarized
let g:solarized_termcolors=16
let g:solarized_termtrans=1
set t_Co=16
if has('win32unix')
set term=xterm-256color
endif
let g:easytags_async = 1
nmap <F8> :TagbarToggle<CR>
When you use the path snippet the path of the current file including the file name is inserted. additionally a trailing '/' is also added. It seems like this '/' shouldn't be there.
Why are all the snippets in a sub-folder neosnippets
?
If I add this repository in snippets/vendor/shougo
as a submodule, I'll end up with snippets/vendor/shougo/neosnippets
...
I've been using Ultisnips as long as I can remember. I didn't use Honza's snippet repository. I watched some videos linked at the repository of Ultisnips and could easily make snippets that I needed. And that way, I knew all of the available ones.
I just today installed neosnippet, because due to python requirement in Ultisnips I've uninstalled it for some time. But the snippet structure is not the same, which is no big deal, if only there were some little documentation. I'm pretty sure there is, only I can't find it.
So, could you point me to a documentation or maybe add some if there isn't one?
snippet link
abbr [linkname](url)
[${1:link}](`getreg('+')=='' ? '<\`0\`>' : getreg('+')`)${0}
copy www.test.com
I find only can be expand to
[g](_www.test.com) _ is cursor
PHPを普段書いている人への質問がてら提案です。
https://github.com/Shougo/neosnippet-snippets/blob/master/neosnippets/php.snip
<?php
をphpファイルの中に散らばらせて書くスタイルです) はもうモダンな書き方だとほとんど使わないらしいので、そのためのsnippetを一斉削除してもよいかな?array()
は2年前に[]
に置き換えられている。もし反対意見がなければこっちで実際にsnippet書き換えてみます。
このissueはしばらく開いたままにしてみんなが見れたらいいなあと思います。
// なお、php.snipは旧レポジトリ (neosnippet) を含めて半年くらい更新されていないファイルです。
the js try
snippet on L72 is acting a little funny. It starts at the catch argument...then the catch block and then the try block. I would fix it but am not sure how to seeing that you have 0, 1, 2 in the correct places.
Given the prevalence of PSR-2, does it make sense to update the PHP snippets to use that code style? I'd be happy to raise a PR to do so
While I'm trying to write Clojure code, I type (defn-doc) and press tab but it inserts another ( like ((defn-
Can remove insertations ( at Clojure snippets?
I looked around online but could not find any relevant docs.
Could you explain options
and abbr
and possibly add a section to the README.
For example why does options
sometimes have body
or head
etc..?
Cheers.
snippet opt
abbr option value
options head
<option value="${1:value}">%uc($1)</option>
I want to get
<option value="test">TEST</option>
On running the above snippet I got
<option value="test">%uc(test)</option>
is my syntax correct?
for example
i have this two snip
snippet str
options word
String ${0}
snippet for
for (${1}){
${2:#:test}
}
I can not expand str in the paris of for
for_ //_ is cursor
then type tab will get
for (_){ //_ is cursor
}
the type into str
and type tab
for (str_){ // _ is curosr
}
here you can not expand str
if i change the first snippet to
snippet str
String ${1}
it will be expand success
I'm using neosnippet + neocomplete, when I type "fu" and press tab, i get the function snippet. I select it and I have the choice to change "public " as the first argument of the snippet.
protectedfunction #:FunctionName(<'3'>)
When opening an ada file, the following messages are shown:
[neosnippet] bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:36 is overriding `task` from bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:29
[neosnippet] Please rename the snippet name or use `delete task`.
[neosnippet] bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:59 is overriding `pro` from bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:52
[neosnippet] Please rename the snippet name or use `delete pro`.
[neosnippet] bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:125 is overriding `for` from bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:120
[neosnippet] Please rename the snippet name or use `delete for`.
[neosnippet] bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:180 is overriding `for` from bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:125
[neosnippet] Please rename the snippet name or use `delete for`.
[neosnippet] bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:203 is overriding `pro` from bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:59
[neosnippet] Please rename the snippet name or use `delete pro`.
[neosnippet] bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:232 is overriding `fun` from bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:226
[neosnippet] Please rename the snippet name or use `delete fun`.
[neosnippet] bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:244 is overriding `re` from bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:237
[neosnippet] Please rename the snippet name or use `delete re`.
[neosnippet] bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:283 is overriding `e` from bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:146
[neosnippet] Please rename the snippet name or use `delete e`.
[neosnippet] bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:301 is overriding `ge` from bundle/repos/github.com/Shougo/neosnippet-snippets/neosnippets/ada.snip:68
[neosnippet] Please rename the snippet name or use `delete ge`.
It does look like the specified snippets are created multiple times:
neosnippet-snippets/neosnippets/ada.snip
Lines 29 to 43 in 4aaa171
I didn't open a PR to fix this because I have no knowledge of ada so I can't make a decision about which snippets should be kept and which ones should be deleted.
[neosnippet] /Users/Scott/.vim/plugged/neosnippet-snippets/neosnippets/blade.snip:15 is ove
rriding sec
from /Users/Scott/.vim/plugged/neosnippet-snippets/neosnippets/blade.snip:5
Press ENTER or type command to continue
[neosnippet] Please rename the snippet name or use delete sec
.
Press ENTER or type command to continue
https://github.com/Shougo/neosnippet-snippets/blob/master/neosnippets/blade.snip#L5-L15
Hi Shougo,
This may not an proper place to ask this question, but how to create my own snippets file without modifying your files?
Thanks
Jiang9
Upon going to insert mode I get this
I'm using packer.nvim (on neo-vim nightly) and this is my plugins.lua:
return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'sheerun/vim-polyglot'
use 'dense-analysis/ale'
use 'relastle/bluewery.vim'
use 'andymass/vim-matchup'
use 'tpope/vim-dispatch'
use 'tpope/vim-surround'
use 'andweeb/presence.nvim'
use 'sakhnik/nvim-gdb'
use 'glepnir/indent-guides.nvim'
use {'ms-jpq/chadtree', run = 'python3 -m chadtree deps'}
use 'glepnir/prodoc.nvim'
use 'pwntester/octo.nvim'
use 'scrooloose/nerdcommenter'
use 'mattn/emmet-vim'
use {'neoclide/coc.nvim', branch = 'release'}
use 'eslint/eslint'
use {'Shougo/deoplete.nvim', run = ':UpdateRemotePlugins'}
use 'Shougo/neosnippet.vim'
use 'roxma/nvim-yarp'
use 'roxma/vim-hug-neovim-rpc'
use 'Shougo/neosnippet-snippets'
use {'autozimu/LanguageClient-neovim', branch = 'next', run = 'powershell -executionpolicy bypass -File install.ps1'}
use 'junegunn/fzf'
end)
e.g. on
something:
|abc()
i want to expand a snippet to:
something:
indentedSnippet
${0}|
indentedSnippet
abc()
options indent
matches line something:
, I want it to match indent of line abc()
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.