remove snippets
This commit is contained in:
parent
2a888388ea
commit
3745d69205
12 changed files with 2 additions and 454 deletions
|
@ -1,4 +0,0 @@
|
|||
augroup det_snippet
|
||||
autocmd!
|
||||
autocmd BufRead,BufNewFile *.snippets set filetype=snippets
|
||||
augroup END
|
|
@ -1,6 +1,6 @@
|
|||
local api = vim.api
|
||||
|
||||
local exclude_ft = { "help", "git", "markdown", "snippets", "text", "gitconfig", "alpha", "dashboard" }
|
||||
local exclude_ft = { "help", "git", "markdown", "text", "gitconfig", "alpha", "dashboard" }
|
||||
|
||||
require("ibl").setup {
|
||||
indent = {
|
||||
|
|
|
@ -3,12 +3,6 @@ local cmp = require("cmp")
|
|||
local lspkind = require("lspkind")
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
-- For `ultisnips` user.
|
||||
vim.fn["UltiSnips#Anon"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
["<Tab>"] = function(fallback)
|
||||
if cmp.visible() then
|
||||
|
@ -32,7 +26,6 @@ cmp.setup {
|
|||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" }, -- For nvim-lsp
|
||||
{ name = "ultisnips" }, -- For ultisnips user.
|
||||
{ name = "path" }, -- for path completion
|
||||
{ name = "buffer", keyword_length = 2 }, -- for buffer word completion
|
||||
{ name = "emoji", insert = true }, -- emoji completion
|
||||
|
@ -49,7 +42,6 @@ cmp.setup {
|
|||
mode = "symbol_text",
|
||||
menu = {
|
||||
nvim_lsp = "[LSP]",
|
||||
ultisnips = "[US]",
|
||||
nvim_lua = "[Lua]",
|
||||
path = "[Path]",
|
||||
buffer = "[Buffer]",
|
||||
|
@ -63,7 +55,6 @@ cmp.setup {
|
|||
cmp.setup.filetype("tex", {
|
||||
sources = {
|
||||
{ name = "omni" },
|
||||
{ name = "ultisnips" }, -- For ultisnips user.
|
||||
{ name = "buffer", keyword_length = 2 }, -- for buffer word completion
|
||||
{ name = "path" }, -- for path completion
|
||||
},
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
snippet "(?<!\w)ltx" "LaTeX symbol" r
|
||||
LaTeX
|
||||
endsnippet
|
||||
|
||||
snippet arw "Right-pointed arrow"
|
||||
--> $1
|
||||
endsnippet
|
|
@ -1,182 +0,0 @@
|
|||
|
||||
#include <set>
|
||||
#include <unordered_set>
|
||||
#include <stack>
|
||||
#include <queue>
|
||||
#include <numeric>
|
||||
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
using std::vector;
|
||||
using std::string;
|
||||
using std::map;
|
||||
using std::unordered_map;
|
||||
using std::set;
|
||||
using std::unordered_set;
|
||||
using std::stack;
|
||||
using std::queue;
|
||||
using std::pair;
|
||||
using std::make_pair;
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet icd "#include directive" b
|
||||
#include <$1>
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet plist "print vector" w
|
||||
template <class T>
|
||||
void printList(const T& arr, const string& desc){
|
||||
std::cout << desc << ": [";
|
||||
|
||||
for (auto it = arr.begin(); it != arr.end(); it++){
|
||||
std::cout << *it << ((std::next(it) != arr.end()) ? ", " : "");
|
||||
}
|
||||
std::cout << "]\n";
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet pmat "print list of list" w
|
||||
template <class T>
|
||||
void printMat(const vector<vector<T>>& mat, const string& desc){
|
||||
cout << desc << ": " << endl;
|
||||
|
||||
for (auto it1 = mat.begin(); it1 != mat.end(); it1++){
|
||||
auto cur_vec = *it1;
|
||||
cout << "[";
|
||||
for (auto it2 = cur_vec.begin(); it2 != cur_vec.end(); it2++){
|
||||
cout << *it2 << ((std::next(it2) != cur_vec.end()) ? ", " : "]\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet pqueue "print queue"
|
||||
template <class T>
|
||||
void printQueue(T q){
|
||||
while(!q.empty()){
|
||||
std::cout << q.top() << " ";
|
||||
q.pop();
|
||||
}
|
||||
std::cout << '\n';
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet cout "print a variable" w
|
||||
cout << "$1: " << $2 << endl;
|
||||
endsnippet
|
||||
|
||||
snippet random "Generate a random list" b
|
||||
// Generate a random sequence of length len, in range(low, high) (inclusive).
|
||||
// need to #include<random>
|
||||
vector<int> genRandom(int low, int high, int len){
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
std::uniform_int_distribution<int> distribution(low, high);
|
||||
|
||||
vector<int> arr(len, 0);
|
||||
for (int i = 0; i != len; ++i){
|
||||
arr[i] = distribution(gen);
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet incset "Use set" b
|
||||
#include <set>
|
||||
|
||||
using std::set;
|
||||
endsnippet
|
||||
|
||||
snippet incmap "Use map" b
|
||||
#include <map>
|
||||
|
||||
using std::map;
|
||||
endsnippet
|
||||
|
||||
snippet incqueue "Use queue" b
|
||||
#include <queue>
|
||||
|
||||
using std::queue;
|
||||
endsnippet
|
||||
|
||||
snippet incstr "Use string" b
|
||||
#include <string>
|
||||
|
||||
using std::string;
|
||||
endsnippet
|
||||
|
||||
snippet incvec "Use vector" b
|
||||
#include <vector>
|
||||
|
||||
using std::vector;
|
||||
endsnippet
|
||||
|
||||
snippet incstack "Use stack" b
|
||||
#include <stack>
|
||||
|
||||
using std::stack;
|
||||
endsnippet
|
||||
|
||||
snippet vec "std::vector" w
|
||||
vector<$1> ${2:vec}
|
||||
endsnippet
|
||||
|
||||
snippet map "std::map" w
|
||||
map<$1, $2> ${3:mymap}
|
||||
endsnippet
|
||||
|
||||
snippet umap "std::unordered_map"
|
||||
unordered_map<$1, $2> ${3:mymap}
|
||||
endsnippet
|
||||
|
||||
snippet set "std::set" w
|
||||
set<$1> ${2:myset}
|
||||
endsnippet
|
||||
|
||||
snippet uset "std::unordered_set" w
|
||||
unordered_set<$1> ${2:myset}
|
||||
endsnippet
|
||||
|
||||
snippet queue "std::queue" w
|
||||
queue<$1> ${2:q}
|
||||
endsnippet
|
||||
|
||||
snippet stack "std::stack" w
|
||||
stack<$1> ${2:mystack}
|
||||
endsnippet
|
||||
|
||||
snippet sol "solution" w
|
||||
auto solution = Solution();
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet for "for loop" w
|
||||
for ($1; $2; $3){
|
||||
$4
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet if "if condition" w
|
||||
if ($1){
|
||||
$2
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet ifelse "if else condition"
|
||||
if ($1){
|
||||
$2
|
||||
}else{
|
||||
|
||||
}
|
||||
endsnippet
|
|
@ -1,168 +0,0 @@
|
|||
global !p
|
||||
def gen_header(snip):
|
||||
placeholders_string = snip.buffer[snip.line].strip()
|
||||
level = int(placeholders_string[0])
|
||||
|
||||
# erase current line
|
||||
snip.buffer[snip.line] = ""
|
||||
line_content = "#"*level + " ${1:Section Name}"
|
||||
line_content += '\n$0'
|
||||
|
||||
snip.expand_anon(line_content)
|
||||
endglobal
|
||||
|
||||
snippet "(k1|kbd)" "HTML kbd tag" rw
|
||||
<kbd>${1:KEY}</kbd>$0
|
||||
endsnippet
|
||||
|
||||
snippet k2 "Two key strokes shortcut"
|
||||
<kbd>${1:KEY}</kbd> + <kbd>${2:KEY}</kbd>
|
||||
endsnippet
|
||||
|
||||
snippet k3 "Three key strokes shortcut"
|
||||
<kbd>${1:KEY}</kbd> + <kbd>${2:KEY}</kbd> + <kbd>${3:KEY}</kbd>
|
||||
endsnippet
|
||||
|
||||
snippet meta "Markdown front matter (YAML format)" b
|
||||
---
|
||||
title: "$1"
|
||||
date: `!p from datetime import datetime
|
||||
if not snip.c:
|
||||
snip.rv=datetime.now().astimezone().strftime("%Y-%m-%d %H:%M:%S%z")`
|
||||
tags: [$2]
|
||||
categories: [$3]
|
||||
---
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet more "HTML more tag"
|
||||
<!--more-->
|
||||
endsnippet
|
||||
|
||||
snippet img "Aligned image using HTML tag"
|
||||
<p align="center">
|
||||
<img src="${1:URL}" width="${2:800}">
|
||||
</p>
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet font "HTML font tag"
|
||||
<font color="${1:blue}">${2:TEXT}</font>
|
||||
endsnippet
|
||||
|
||||
snippet link "Markdown links"
|
||||
[$1]($2)$0
|
||||
endsnippet
|
||||
|
||||
post_jump "gen_header(snip)"
|
||||
snippet "h([1-6])" "Markdown header" br
|
||||
`!p snip.rv = match.group(1)`
|
||||
endsnippet
|
||||
|
||||
snippet detail "Clickable details" b
|
||||
<details>
|
||||
<summary><font size="2" color="red">${1:Click to show the code.}</font></summary>
|
||||
|
||||
$2
|
||||
</details>
|
||||
endsnippet
|
||||
|
||||
snippet yh "直角引号" w
|
||||
「$1」
|
||||
endsnippet
|
||||
|
||||
snippet info "info box"
|
||||
<style type="text/css">
|
||||
@import url('//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css');
|
||||
|
||||
.info-msg {
|
||||
color: #059;
|
||||
background-color: #BEF;
|
||||
margin: 5px 0;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
border: 2px solid transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="info-msg">
|
||||
<i class="fa fa-info-circle"> Info</i></br>
|
||||
${1:info text}
|
||||
</div>
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet warn "warning box"
|
||||
<style type="text/css">
|
||||
@import url('//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css');
|
||||
|
||||
.warning-msg {
|
||||
color: #9F6000;
|
||||
background-color: #FEEFB3;
|
||||
margin: 5px 0;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
border: 2px solid transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="warning-msg">
|
||||
<i class="fa fa-warning"> Warning</i></br>
|
||||
${1:warning text}
|
||||
</div>
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet error "error box"
|
||||
<style type="text/css">
|
||||
@import url('//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css');
|
||||
|
||||
.error-msg {
|
||||
color: #D8000C;
|
||||
background-color: #FFBABA;
|
||||
margin: 5px 0;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
border: 2px solid transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="error-msg">
|
||||
<i class="fa fa-times-circle"> Error</i></br>
|
||||
${1:error text}
|
||||
</div>
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet success "success box"
|
||||
<style type="text/css">
|
||||
@import url('//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css');
|
||||
|
||||
.success-msg {
|
||||
color: #270;
|
||||
background-color: #DFF2BF;
|
||||
margin: 5px 0;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
border: 2px solid transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="success-msg">
|
||||
<i class="fa fa-check"></i>
|
||||
${1:success text}
|
||||
</div>
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet td "too long do not read" bw
|
||||
tl;dr: $1
|
||||
endsnippet
|
|
@ -1,30 +0,0 @@
|
|||
snippet head "Python source file header" b
|
||||
"""
|
||||
Description: $1
|
||||
Author: Jie-dong Hao (jdhao@hotmail.com)
|
||||
Created: `!v strftime("%Y-%m-%d %H:%M:%S%z")`
|
||||
"""
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet print "Print value of some variable"
|
||||
print("$1".format($2))
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet impa "import FOO as BAR" b
|
||||
import ${1:FOO} as ${2:BAR}
|
||||
endsnippet
|
||||
|
||||
snippet main "Main function boilerplate" b
|
||||
def main():
|
||||
$0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
endsnippet
|
||||
|
||||
snippet sol "solution" b
|
||||
solution = Solution()
|
||||
endsnippet
|
|
@ -1,6 +0,0 @@
|
|||
# copied from https://github.com/honza/vim-snippets/blob/master/UltiSnips/snippets.snippets
|
||||
snippet snip "Ultisnips snippet definition" b
|
||||
`!p snip.rv = "snippet"` ${1:Tab_trigger} "${2:Description}" ${3:b}
|
||||
${0:${VISUAL}}
|
||||
`!p snip.rv = "endsnippet"`
|
||||
endsnippet
|
|
@ -1,9 +0,0 @@
|
|||
snippet use "usepackage" b
|
||||
\usepackage{${1:package}}
|
||||
endsnippet
|
||||
|
||||
snippet eqa "equation environment" b
|
||||
\begin{equation}\label{$1}
|
||||
$2
|
||||
\end{equation}
|
||||
endsnippet
|
|
@ -1,14 +0,0 @@
|
|||
snippet fun "vim function"
|
||||
function! ${1:MyFunc}(${2}) abort
|
||||
$3
|
||||
endfunction
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet aug "vim augroup" b
|
||||
augroup ${1:GROUP_NAME}
|
||||
autocmd!
|
||||
autocmd ${2:EVENT} ${3:PATTERN} $4
|
||||
augroup END
|
||||
$0
|
||||
endsnippet
|
|
@ -13,21 +13,6 @@ call utils#Cabbrev('ps', 'Lazy sync')
|
|||
" configurations for vim script plugin "
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
"""""""""""""""""""""""""UltiSnips settings"""""""""""""""""""
|
||||
" Trigger configuration. Do not use <tab> if you use YouCompleteMe
|
||||
let g:UltiSnipsExpandTrigger='<c-j>'
|
||||
|
||||
" Do not look for SnipMate snippets
|
||||
let g:UltiSnipsEnableSnipMate = 0
|
||||
|
||||
" Shortcut to jump forward and backward in tabstop positions
|
||||
let g:UltiSnipsJumpForwardTrigger='<c-j>'
|
||||
let g:UltiSnipsJumpBackwardTrigger='<c-k>'
|
||||
|
||||
" Configuration for custom snippets directory, see
|
||||
" https://jdhao.github.io/2019/04/17/neovim_snippet_s1/ for details.
|
||||
let g:UltiSnipsSnippetDirectories=['UltiSnips', 'my_snippets']
|
||||
|
||||
"""""""""""""""""""""""""" vlime settings """"""""""""""""""""""""""""""""
|
||||
command! -nargs=0 StartVlime call jobstart(printf("sbcl --load %s/vlime/lisp/start-vlime.lisp", g:package_home))
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
cmp-buffer
|
||||
cmp-emoji
|
||||
cmp-nvim-lsp
|
||||
cmp-nvim-ultisnips
|
||||
cmp-omni
|
||||
cmp-path
|
||||
committia-vim
|
||||
|
@ -59,7 +58,6 @@
|
|||
targets-vim
|
||||
telescope-nvim
|
||||
telescope-symbols-nvim
|
||||
UltiSnips
|
||||
unicode-vim
|
||||
vim-auto-save
|
||||
vim-commentary
|
||||
|
@ -76,7 +74,6 @@
|
|||
vim-repeat
|
||||
vim-sandwich
|
||||
vim-scriptease
|
||||
vim-snippets
|
||||
vim-swap
|
||||
vim-toml
|
||||
vimtex
|
||||
|
@ -106,7 +103,6 @@
|
|||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-omni",
|
||||
"hrsh7th/cmp-emoji",
|
||||
"quangnguyen30192/cmp-nvim-ultisnips",
|
||||
},
|
||||
config = function()
|
||||
require("config.nvim-cmp")
|
||||
|
@ -216,10 +212,6 @@
|
|||
end,
|
||||
cmd = "Vista",
|
||||
},
|
||||
-- Snippet engine and snippet template
|
||||
{ "SirVer/ultisnips", dependencies = {
|
||||
"honza/vim-snippets",
|
||||
}, event = "InsertEnter" },
|
||||
-- Automatic insertion and deletion of a pair of characters
|
||||
{ "Raimondi/delimitMate", event = "InsertEnter" },
|
||||
-- Comment plugin
|
||||
|
|
Loading…
Reference in a new issue