andreyorst / simplesnippets.vim Goto Github PK
View Code? Open in Web Editor NEWSimple snippet support for your Vim and Neovim
License: GNU General Public License v3.0
Simple snippet support for your Vim and Neovim
License: GNU General Public License v3.0
I'm investigating on getting snippet support for vim-lsp but I see that $0
is not supported. Would it be possible to add support for it? prabirshrestha/vim-lsp#247
cquery seems to return snippets with $0. Full syntax can be found at https://github.com/Microsoft/language-server-protocol/blob/master/snippetSyntax.md
hex(${1:ios_base & __str})$0
Which gets displayed as following.
Hi.
I've more a question than an issue...
If I insert a snippet, it won't be inserted at the current level of indentation. It is alway inserted at column one. Are there special settings required (regarding tabstop, shiftwidth and so on)? It seem to work in gifs within the documentation though.
Thx in advance and greetings.
I am currently using snipmate and would like to move to something simpler like this plugin.
However in my setup snipmate has one advantage - it be default works with supertab plugin which let's use tab for multiple purposes (keyword completion as well as snippet expansion).
Are there any plans to integrate SimpleSnippets with supertab?
Note for myself. It is easier to keep track on things when a corresponding issue is remaining open.
Also backups of snippets (ending with ~) are displayed. IMO backup files should be suppressed in output.
if '$n's appear somewhere in the file they're disturbing for snippets.
I've got that code somewhere in my file:
GetLongMatch() {
_log := new Logger("class." A_ThisFunc)
RegExMatch(this.stExpr, "^([imsxADJUXPSC]+\))?(.*)", $)
if (_log.Logs(Logger.Finest)) {
_log.Finest("this.stExpr", this.stExpr)
_log.Finest("$1", $1)
_log.Finest("$2", $2)
}
return _log.Exit($1 "^--" (this.iFlags & OptParser.OPT_NEG ? "(no-?)?" : "") $2 "$")
}
if I expand a snippet elsewhere it produces unwanted content:
The if
snippet used in the example above looks like this:
if (${1:true}) {
${0:; TODO: Add code}
}
Question: Is it possible to distinct between '$n's within the snippet and the rest of the file to avoid that behaviour? If not, a remark in the documentation would be helpfull. (I hope I haven't overseen this... ๐จ)
If I replace the $
in my code, for example by an X
, everything works fine what is a sufficient workaround for me. But I love your plugin and would like it to be as efficient as possible, so I opened this issue.
Environment:
I want to be able to edit the snippet descriptions text file for the current filetype very easily.
Describe the solution you'd like
That's my local solution so far; feel free to modify and adapt it to the plugin; or take it just as an idea:
" Edit snippet descriptions for current filetype
function! SimpleSnippetsEditDescriptions()
let ft = getbufvar(bufname('%'), '&filetype')
if exists('g:SimpleSnippets_search_path')
let path = g:SimpleSnippets_search_path
else
let path = $HOME.'/.vim/snippets/'
endif
:exec ':split '.path.ft.'/'.ft.'.snippets.descriptions.txt'
endfunction
command! -register SimpleSnippetsEditDescriptions call SimpleSnippetsEditDescriptions()
Describe the bug
The output of SimpleSnippetsList
is distorted on Windows.
Steps to reproduce
Submit :SimpleSnippetList
on the Vim command line
Expected behavior
Display a well formed list of the available snippets.
Actual behavior
Due to the use of Linux version of the echo
command the output on windows is not well formatted. Also backups of snippets (ending with ~
) are displayed. IMO backup files should be suppressed in output.
Screenshot or gif (if possible)
Environment:
btw: Thanks a lot for implementing SimpleSnippetsEditDescriptions
. Work's great ๐
It is not possible to define a snippet with placeholders next to eachother or connected with nonletter characters like _
which vim inludes inside <word>
${1:lorem}_${0:ipsum}
or ${1:lorem}${0:ipsum}
snippetslorem
is selected, and upon jump ipsum
is selected.
Select mode is on, but nothing is selected, and jumping does nothing.
Vim Version: NVIM v0.3.0-1062-gfe5f38d8b
This plugin version: badee69
Operating system: Archlinux
List of plugins: None
Improve the core of snippet engine to use different approach to make available nested placeholders and tabstops, which is impossible or near impossible to do with current implementation of the core.
Snippet body can be parsed and yanked to file, but unparsed snippet is stays in memory. While jumping placeholders can be obtained from memory and positions of placeholder's contents in the text can be used, rather then searching for the text itself. This will make possible to use nested placeholders in any order, if the unparsed snippet in memory is updated simultaneously with parsed snippet in the file. This also will make possible of non-unique bodies of different placeholders, and even empty placeholders, a.k.a. tabstops.
I will update this issue at some point of developing. Subscribe if you're interested.
Goals:
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.