Coder Social home page Coder Social logo

neosnippet-snippets's Introduction

Neosnippet-snippets

The standard snippets repository for neosnippet.

You can fork or send pull request.

neosnippet-snippets's People

Contributors

aiya000 avatar e-kwsm avatar ellisonleao avatar faceleg avatar fluecke avatar gambledor avatar igrep avatar itchyny avatar mroutput avatar mshr-h avatar photon3108 avatar pocke avatar rgrinberg avatar rhysd avatar robinro avatar ryunix avatar saulaxel avatar sh78 avatar shougo avatar shuber2 avatar syngan avatar tasusu avatar tyru avatar ujihisa avatar vayn avatar vbauerster avatar wkentaro avatar yienge avatar yymm avatar zirst avatar

Stargazers

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

Watchers

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

neosnippet-snippets's Issues

Delayed expression evaluation

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?

Error with: let g:neosnippet#disable_runtime_snippets = 1.

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.

can not install neosnippet-snippets

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?

Support for deoplete?

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.

'if' snippet not shown in snippet popup for java files.

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>

Useless 'neosnippets' sub-folder?

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 ...

Sample tutorials to learn to make snippets for oneself

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?

how to make this snip work?

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 snippets

PHPを普段書いている人への質問がてら提案です。

https://github.com/Shougo/neosnippet-snippets/blob/master/neosnippets/php.snip

  • 埋込み型PHP (<?phpをphpファイルの中に散らばらせて書くスタイルです) はもうモダンな書き方だとほとんど使わないらしいので、そのためのsnippetを一斉削除してもよいかな?
  • 古い記法のサポートの廃止。例えばarray()は2年前に[]に置き換えられている。
    snippet array
    $${1:#:arrayName} = array('${2}' => ${3} ${0});
  • (snipmate由来と思われる)短いスニペット名をもっとdescriptiveな名前への変更

もし反対意見がなければこっちで実際にsnippet書き換えてみます。
このissueはしばらく開いたままにしてみんなが見れたらいいなあと思います。

// なお、php.snipは旧レポジトリ (neosnippet) を含めて半年くらい更新されていないファイルです。

js try snippet

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.

Do not insert (

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?

How to avoid temporary files?

Hi, I just found there are some temporary (cache) files generated automatically. Like this:

screenshot

How to make these files to be generated at specific location? Not everywhere else.

Different snippet options

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.

using %uc

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?

nested snippet's ${0} will not be jumpped to ,is it a bug? if not we should not use ${0} in all key words snippets .

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

php "function" snippet doesn't work properly

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.

  • If I skip it everything works.
  • If I type "protected" I can jump to the next argument (function name) but the code is
protectedfunction #:FunctionName(<'3'>)
  • If I type "protected " (with a space) I cannot jump anymore to the next arguments.
  • If I delete "public" I cannot jump anymore to the next arguments.

ada.snip: Conflicting snippets

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:

snippet task
abbr task
options head
task ${1} is
entry ${0}
end $1;
snippet task
abbr task body
options head
task body ${1} is
${2}
begin
${0}
end $1;

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.

JS if else

looks like the else is indented one too many AND there is no target for the else condition
1455563760

How to create my own snippets?

Hi Shougo,

This may not an proper place to ask this question, but how to create my own snippets file without modifying your files?

  • what file names need to be?
  • what folders to place these files?

Thanks
Jiang9

Neosnippet does not detect neosnippet-snippets

Upon going to insert mode I get this
image

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)

Indent to SAME line, not line above

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()

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.