1,932 questions
Advice
0
votes
0
replies
11
views
Visual Studio snippet with variable number of arguments
I recently learned about making snippets in Visual Studio and can make simple replacement ones and understand what's going on.
However I saw this Make a vscode snippet that can use a variable number ...
0
votes
0
answers
31
views
Custom LaTeX snippets intermittently trigger multi-cursor mode in VS Code 1.104.2
The video that shows the problem
I am experiencing an intermittent issue where triggering custom user snippets in VS Code causes the editor to unexpectedly enter multi-cursor mode.
Environment
VS ...
0
votes
1
answer
55
views
Is there a quick way to edit snippets for the current language?
When I want to add a snippet for the current language, I open the command palette, type "snippet", go "Configure Snippets", then I have to select the language even though the file ...
0
votes
1
answer
65
views
Automatically enable sold individually product settings
In WooCommerce, I'm selling only simple downloadable/ virtual products which can only be sold once per client.
I found a snippet on stackoverflow (Automatically enable virtual and downloadable product ...
2
votes
1
answer
83
views
How can I limit my code snippet to only show up in the intellisense ddl when typing the shortcut
I've recently created my first code snippet and the problem I'm having is that whenever I go to surround my code with something, instead of automatically selecting the usual "Visual C#" ...
1
vote
1
answer
391
views
How to create custom snippets using luasnip
I want to make my custom snippets in latex files. I am using luasnip and this is my config:
{
"hrsh7th/nvim-cmp",
config = function()
require("luasnip.loaders.from_vscode")....
0
votes
2
answers
101
views
Custom HTML snippet in Visual Studio only prints default values
I have an HTML snippet which adds a Label and Input element. But when I invoke the snippet, it doesn't let me alter the literal's, it just adds the tags with default values.
I made a different snippet ...
4
votes
1
answer
532
views
How to open the code snippets window in Xcode26?
In the Xcode26 beta (currently beta 2) the "+" Button to open the code snippets window in the window title bar is gone.
There is still a "Create Code Snippet" menu point in the ...
0
votes
0
answers
42
views
Python tempfile SpooledTemporaryFile write to a gzip without writing to disk where possible?
I am trying to create a snippet of Python code that first writes a possibly large text file (think csv) to a SpooledTemporaryFile in memory. Then that spooled file is compressed with gzip. While some ...
1
vote
1
answer
72
views
Code snippets appears as a second choice in C#
Code snippets are easier to enter repeating code patterns, such as loops or conditional statements. In VS Code, the code snippets appear as the second choice, so I can't use Tab to generate code ...
0
votes
0
answers
76
views
configure autocomplete snippits in nvim for .hbs file
How do I configure autocomplete snippets for .hbs (Handlebars) files in Neovim using the NvChad framework?
I'm using Neovim with the NvChad configuration framework, and I want to enable autocomplete/...
0
votes
1
answer
48
views
How do you do multiple regex replacments in an UltiSnips snippet in vim?
I am trying to create a snippet for a LaTeX section that automatically fills in the label. I'd like the label to replace special characters and convert uppercase characters to lowercase characters. I ...
1
vote
1
answer
102
views
Using a bash terminal to list gitlab "snippets"
I'm trying to list "snippets" but everything I've found so far only refers to listing repos.
In gitlab there's a submenu, "snippets", where we occasionally need to pull new code ...
0
votes
0
answers
89
views
Need Help Adding a MailerLite Popup Form to My Next.js App
I'm trying to add a MailerLite subscription form (a popup triggered by a button) to my Next.js app, but I just can't get it to work.
This is my first time integrating a universal code snippet in a ...
4
votes
2
answers
282
views
How can I use predefined code snippets outside of code chunks in Quarto within RStudio/Posit?
I'm working on a Quarto document in RStudio/Posit where I frequently need to insert recurring formatting code. I've set up some custom code snippets in RStudio that work perfectly inside code chunks. ...
0
votes
1
answer
51
views
How to key bind a snippet in Sublime Text?
I had some trouble figuring out how to add a Key Binding to my new Snippet in Sublime.
This answer may save some people some time...
0
votes
1
answer
82
views
VS Code snippet - how to get the relative_filepath without the file extension
How can I get the relative_filepath without the extension and backslash change ?
I found two transforms:
"${RELATIVE_FILEPATH/[\\]/\//g/}"
"${RELATIVE_FILEPATH/(.js)//}"
If the ...
1
vote
0
answers
89
views
WPForms Refresh Page
Upon integrating the snippet into the File Upload WPForm for images and videos, it successfully initiates a page refresh to reset all form values and present a confirmation message upon submission. ...
0
votes
1
answer
81
views
Can you add a comma to a VS Code Snippet placeholder option?
I want to create a VS Code snippet that uses the choices feature:
"Fool's Dart Types": {
"scope": "dart",
"prefix": "foolsTypes",
...
1
vote
1
answer
45
views
How to open dropdown from separate button in stackoverflow code snippet
Running code snippet using "Run code snippet" button and clicking "Open menu" button does nothing. It should open menu.
Menu is defined in other place in DOM and display is set to ...
2
votes
2
answers
76
views
How would I add an "extended" tabstop in snippets?
I'm trying to make a snippet with multiple choices and I need only one of the choices to have a subset of choices after selecting it.
For Example:
"Basic Furniture": {
"prefix":...
0
votes
0
answers
31
views
is it possible to get support for more advanced snippets than default in Visual Studio?
I'm creating some snippets for both VS and VS Code, and I would love all the features from the VS Code ones in VS. And the ability to define file extension types instead of just language. Is it ...
0
votes
1
answer
62
views
Woocommerce wholesale user role setting minimum order quantity to 10 products PHP
I’ve been searching for PHP solutions related to WooCommerce, but nothing I've found has worked for my specific requirements. Here’s the background on my situation:
I need wholesale users to meet a ...
0
votes
1
answer
90
views
Stop Visual Studio Xaml Editor showing snippets when I press the Tab button
After a recent update of either Visual Studio 2022 or R#, now when I'm in the xaml editor and I press the tab key, the snippets dialog pops up.
This is new behaviour, and is incredibly annoying. Can I ...
0
votes
1
answer
43
views
Replace VS Code Snippet Variable
I want to replace ${TM_FILENAME_BASE} with ${TM_DIRECTORY} if ${TM_FILENAME_BASE} is init
I tried this snippet. It works for all files not named init, otherwise the output is -- Name: $TM_DIRECTORY
{
...
1
vote
0
answers
1k
views
nvim snippets how to create custom peace of codes
I try to write some custom snippets. For that I install and configure Luasnip in my nvim.cmp. Also installed rafamadriz/friendly-snippets
So far it is ok; means autocompletion shows snippets from ...
1
vote
1
answer
216
views
Snippets stopped working after updating Visual Studio
I have just updated Visual Studio 2022 from version 17.10.6 to the latest version (17.11.2) and noticed that my C++-snippets stopped working.
To make sure, I tested it on my laptop with the same ...
0
votes
1
answer
53
views
ACF get_field not returning value inside function with foreach loop
I have a function that loops all Woocommerce subcategories for the current category. Inside the subcategory loop there is an advanced-custom-field that is supposed to display an icon. But I do ...
1
vote
1
answer
79
views
Is there a way to generate all public members object initializer in vs code?
I'm looking for behaviour similiar to JB Rider. When contructing object through initializer there's an option to generate all public property assignments. Is there a way to add this feature to vs code?...
0
votes
1
answer
90
views
How can I make hashing algorithm for code snippets?
I would like to make an algorithm, which can detect code snippets when iterating through source codes, based on some hashing algorithms.
So for example, here is that short code snippet from a fragment ...
1
vote
0
answers
15
views
Embedding promotion text into article at diffrent points
We have promotional text (text A) that we want to embed into in article (text B) at specific different points, e.g. at 25% or 50% etc. The problem is, after adding it, text A is not displaying in text ...
0
votes
0
answers
49
views
Macros, Code Snippets, or even Keyboard Shortcuts not working in Visual Studio 2008 for C++
I am working in Visual Studio 2008 and cannot update due to constraint of my software compatibility issue. I search everywhere on the Internet, read many posts here as well, but no solution found to ...
2
votes
0
answers
191
views
What are the effects of "Show new snippet experience (experimental)" setting in Visual Studio 2022?
Recently, I have encountered a new option in Visual Studio 2022 "Show new snippet experience (experimental)" setting in Visual Studio 2022?".
It is located in the VS Options: "Text ...
0
votes
0
answers
22
views
I am having issues to get the piece of code in my snippet whith the html labels
This is my snippet and what I hope to get when I write "html-em" in my html file:
{
"HTML EM template": {
"prefix": "html-em",
"body": [
...
0
votes
1
answer
84
views
"Code Snippets" snippet does not work for `big_image_size_threshold` setting
I have WordPress 6.5.2, "Code Snippets" plugin 3.6.4 installed and following snippet code:
add_filter( 'big_image_size_threshold', '__return_false' );
but it does not work, WordPress still ...
-2
votes
1
answer
155
views
Code Snippet for Add to Cart Redirect only works for the Add to Cart Button in SINGLE PRODUCT PAGE
The code snippet for redirecting the add to cart to the checkout page only works when I press the add to cart on the SINGLE PRODUCT PAGE. It does not work when I click the add to cart button on the ...
0
votes
1
answer
125
views
jMeter - How to escape quotes?
I need help to escape quotes in jMeter!
I've to put into a var some words with quotes, for example "dummy", so I've tried with:
vars.put("example", '"dummy"')
vars.put(&...
1
vote
1
answer
207
views
How do I remove and replace line breaks from my clipboard while using snippets in Visual Studio Code?
I am planning to replace every line break in my clipboard with a space, followed a vertical bar and then another space.
For instance, if my clipboard has the following text:
My
Clipboard
Content
the ...
2
votes
3
answers
226
views
Auto delete old posts using Snippets for special category
Dears,
I want to delete the old post automatically without using a plugin and the Snippets will be the choice, I want to delete any post older than one day from a special category an using this ...
2
votes
1
answer
763
views
Snippet of current time in nvim
I'm trying to create a snippet for vimwiki. The snippet must change __ to current time.
local line_begin = require("luasnip.extras.expand_conditions").line_begin
return {
s(
{...
0
votes
1
answer
137
views
How can I apply a Postfix Completion to an expression separated by spaces in PyCharm
I'm new in PyCharm IDE and I'm now personalizing my code snippets (Live Templates | Postix Completion) but don't know the syntax and limits of which.
I've seen there is a Postfix Completion whose ...
0
votes
1
answer
153
views
PHP Code Snippet Not Working in CartFlows (WooCommerce Plugin)
I followed THIS tutorial to change the coupon field and button text, using the following script in a Code Snippet:
/**
* Change the CartFlows Coupon Field text and Button text.
*
* @param array $...
0
votes
1
answer
26
views
Sublime text snippet : how to define choices as value?
is there a solution to create a snippet in sublime text where the value can have several methods (choices) . For example , in Python a list can have multiple methods (append , clear , copy) .
It's ...
1
vote
1
answer
374
views
Unexpected token error while using javascript snippet with WPCode in wordpress
I am trying to add custom javascript into my website for a widget on wordpress using the wpcode plugin but I keep getting an unexpected token error. There is a already created that isn't accessible ...
1
vote
0
answers
539
views
How can i add a css code snippet to vs code
is there any possibility to add a css code snippet that contains multiple elements or tags with their styles in vs code.
i already have an idea about the basic way that adds just the properties and ...
2
votes
1
answer
4k
views
Neovim nvim-cmp and LuaSnip: Tab Key Not Navigating Completion Menu or Expanding Snippets
I'm working on setting up my Neovim configuration for development, specifically focusing on integrating nvim-cmp for autocompletion and LuaSnip for snippet support. However, I'm encountering an issue ...
0
votes
1
answer
295
views
How to create custom snippets in Visual Studio 2022 for Blazor files (*.razor)
Is there a way that I can create my own custom snippets for Blazor files in Visual Studio 2022? I'm able to create custom snippets for C# using <Code Language="CSharp"> in the .snippet ...
0
votes
1
answer
141
views
Is it possible to use html snippets inside of Razor (cshtml) pages in ASP.NET MVC
I tried so many ways but I didn't achieve to do it . I can't use html snippets inside of cshtml razor page and it sucks.I don't wanna use VS Code to write ASP.NET MVC because I'm used to use Visual ...
0
votes
1
answer
436
views
Color Swatch Display Issues on Shopify Store: Image Integration
I have a color metafield on my shopify store, where inserting a specific color should reflect on both the website and phone devices simultaneously. Each color swatch is associated with an image tile ...
1
vote
0
answers
113
views
How can I hide or override built-in code snippets?
I edit the built in code snippet propdp for personal preferences. My problem is that Visual Studio updates reset the edited propdp to its default.
I could add a custom snippet with the same shortcut ...