27/11 Update
Signed-off-by: TiagoRG <tiago.rgarcia@ua.pt>
This commit is contained in:
parent
ca69140ac3
commit
5cf3eaa987
|
@ -1 +0,0 @@
|
|||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git);
|
|
@ -5,8 +5,8 @@ require('lualine').setup {
|
|||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {
|
||||
statusline = {"NvimTree"},
|
||||
winbar = {"NvimTree"},
|
||||
statusline = {"NvimTree", "toggleterm"},
|
||||
winbar = {"NvimTree", "toggleterm"},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
|
@ -18,21 +18,20 @@ require('lualine').setup {
|
|||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_a = { 'fileformat', 'mode' },
|
||||
lualine_b = { 'branch', 'diff', 'diagnostics' },
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'encoding', 'filesize', 'filetype' },
|
||||
-- lualine_x = { 'hostname', 'fileformat', 'encoding', 'filesize', 'filetype' },
|
||||
lualine_x = { 'filesize', 'filetype' },
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'selectioncount', 'location' }
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_a = { 'fileformat' },
|
||||
lualine_b = { 'diff', 'diagnostics' },
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'location' },
|
||||
lualine_x = { 'filesize', 'filetype'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
lualine_z = { 'progress', 'location' }
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
require("toggleterm").setup {
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 15
|
||||
return 20
|
||||
elseif term.direction == "vertical" then
|
||||
return vim.o.columns * 0.4
|
||||
end
|
||||
end,
|
||||
|
||||
hide_numbers = true,
|
||||
persist_size = true,
|
||||
persist_size = false,
|
||||
persist_mode = true,
|
||||
close_on_exit = true,
|
||||
auto_scroll = true,
|
||||
|
@ -16,13 +16,21 @@ require("toggleterm").setup {
|
|||
|
||||
float_opts = {
|
||||
border = 'curved',
|
||||
width = 200,
|
||||
height = 20,
|
||||
width = 225,
|
||||
height = 50,
|
||||
winblend = 3,
|
||||
zindex = 50,
|
||||
},
|
||||
|
||||
direction = 'horizontal'
|
||||
--direction = 'float'
|
||||
}
|
||||
|
||||
-- ToggleTerm non terminal mode keybinds
|
||||
vim.keymap.set("n", "<leader>t", "<cmd>ToggleTerm<CR>")
|
||||
vim.keymap.set("n", "<leader>vl", "<cmd>ToggleTermCurrentLine<CR>")
|
||||
vim.keymap.set("n", "<leader>vv", "<cmd>ToggleTermVisualLines<CR>")
|
||||
vim.keymap.set("n", "<leader>vs", "<cmd>ToggleTermVisualSelection<CR>")
|
||||
|
||||
-- ToggleTerm terminal mode keybinds
|
||||
vim.keymap.set("t", "<esc>", "<C-\\><C-n>")
|
||||
|
|
|
@ -1,24 +1,34 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
-- ensure_installed = { "bash", "lua", "vim", "vimdoc", "query", "regex",
|
||||
-- "c", "cpp", "c_sharp", "rust", "python",
|
||||
-- "html", "css", "php", "javascript", "typescript", "sql"
|
||||
-- },
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
-- ensure_installed = { "bash", "lua", "vim", "vimdoc", "query", "regex",
|
||||
-- "c", "cpp", "c_sharp", "rust", "python",
|
||||
-- "html", "css", "php", "javascript", "typescript", "sql"
|
||||
-- },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
|
||||
rainbow = {
|
||||
enable = true,
|
||||
-- list of languages you want to disable the plugin for
|
||||
disable = { 'jsx', 'cpp' },
|
||||
-- Which query to use for finding delimiters
|
||||
query = 'rainbow-parens',
|
||||
-- Highlight the entire buffer all at once
|
||||
strategy = require('ts-rainbow').strategy.global,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
require("tiagorg.set")
|
||||
require("tiagorg.remap")
|
||||
require('Comment').setup()
|
||||
|
|
|
@ -26,6 +26,11 @@ return require('packer').startup(function(use)
|
|||
require("monokai-pro").setup()
|
||||
end
|
||||
}
|
||||
use 'navarasu/onedark.nvim'
|
||||
use {
|
||||
'daltonmenezes/aura-theme',
|
||||
rtp = 'packages/neovim'
|
||||
}
|
||||
|
||||
use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' })
|
||||
use('theprimeagen/harpoon')
|
||||
|
@ -33,8 +38,14 @@ return require('packer').startup(function(use)
|
|||
use('wakatime/vim-wakatime')
|
||||
use('andweeb/presence.nvim')
|
||||
use('m4xshen/autoclose.nvim')
|
||||
use("andrewferrier/wrapping.nvim")
|
||||
use({
|
||||
"andrewferrier/wrapping.nvim",
|
||||
config = function()
|
||||
require("wrapping").setup()
|
||||
end
|
||||
})
|
||||
use "lukas-reineke/indent-blankline.nvim"
|
||||
use "HiPhish/nvim-ts-rainbow2"
|
||||
use {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
requires = {
|
||||
|
@ -79,7 +90,6 @@ return require('packer').startup(function(use)
|
|||
use 'folke/flash.nvim'
|
||||
use({
|
||||
'numToStr/Comment.nvim',
|
||||
require('Comment').setup()
|
||||
})
|
||||
use({
|
||||
"kylechui/nvim-surround",
|
||||
|
|
|
@ -18,7 +18,6 @@ vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]])
|
|||
vim.keymap.set("i", "<C-c>", "<Esc>")
|
||||
|
||||
vim.keymap.set("n", "Q", "<nop>")
|
||||
vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
|
||||
vim.keymap.set("n", "<leader>f", vim.lsp.buf.format)
|
||||
|
||||
vim.keymap.set("n", "<leader>af", "ggVG")
|
||||
|
@ -30,8 +29,10 @@ vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
|
|||
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
|
||||
|
||||
vim.keymap.set("n", "<leader>r", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
|
||||
vim.keymap.set("n", "<leader>X", "<cmd>!chmod -x %<CR>", { silent = true })
|
||||
vim.keymap.set("n", "<leader>m", "<cmd>!make<CR>", { silent = true })
|
||||
|
||||
vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.config/nvim/lua/tiagorg/packer.lua<CR>");
|
||||
|
||||
|
@ -41,3 +42,4 @@ end)
|
|||
|
||||
vim.keymap.set("n", "<C-q>", "<cmd>qa<CR>")
|
||||
vim.keymap.set("n", "<A-t>", "<cmd>tabnew<CR><cmd>NvimTreeFocus<CR>")
|
||||
vim.keymap.set("n", "<S-Tab>", "<C-w>w")
|
||||
|
|
|
@ -49,8 +49,8 @@ local function save_profiles(threshold)
|
|||
end
|
||||
|
||||
time([[Luarocks path setup]], true)
|
||||
local package_path_str = "/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1699392533/share/lua/5.1/?.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1699392533/share/lua/5.1/?/init.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1699392533/lib/luarocks/rocks-5.1/?.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1699392533/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1699392533/lib/lua/5.1/?.so"
|
||||
local package_path_str = "/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1700008891/share/lua/5.1/?.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1700008891/share/lua/5.1/?/init.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1700008891/lib/luarocks/rocks-5.1/?.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1700008891/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1700008891/lib/lua/5.1/?.so"
|
||||
if not string.find(package.path, package_path_str, 1, true) then
|
||||
package.path = package.path .. ';' .. package_path_str
|
||||
end
|
||||
|
@ -84,6 +84,11 @@ _G.packer_plugins = {
|
|||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
||||
url = "https://github.com/L3MON4D3/LuaSnip"
|
||||
},
|
||||
["aura-theme"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/aura-theme/packages/neovim",
|
||||
url = "https://github.com/daltonmenezes/aura-theme"
|
||||
},
|
||||
["autoclose.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/autoclose.nvim",
|
||||
|
@ -196,11 +201,21 @@ _G.packer_plugins = {
|
|||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
["nvim-ts-rainbow2"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-ts-rainbow2",
|
||||
url = "https://github.com/HiPhish/nvim-ts-rainbow2"
|
||||
},
|
||||
["nvim-web-devicons"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||
url = "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
["onedark.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/onedark.nvim",
|
||||
url = "https://github.com/navarasu/onedark.nvim"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||
|
@ -248,6 +263,7 @@ _G.packer_plugins = {
|
|||
url = "https://github.com/wakatime/vim-wakatime"
|
||||
},
|
||||
["wrapping.nvim"] = {
|
||||
config = { "\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rwrapping\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/wrapping.nvim",
|
||||
url = "https://github.com/andrewferrier/wrapping.nvim"
|
||||
|
@ -255,18 +271,26 @@ _G.packer_plugins = {
|
|||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
-- Runtimepath customization
|
||||
time([[Runtimepath customization]], true)
|
||||
vim.o.runtimepath = vim.o.runtimepath .. ",/home/tiagorg/.local/share/nvim/site/pack/packer/start/aura-theme/packages/neovim"
|
||||
time([[Runtimepath customization]], false)
|
||||
-- Config for: wrapping.nvim
|
||||
time([[Config for wrapping.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rwrapping\frequire\0", "config", "wrapping.nvim")
|
||||
time([[Config for wrapping.nvim]], false)
|
||||
-- Config for: tabset.nvim
|
||||
time([[Config for tabset.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n4\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\vtabset\frequire\0", "config", "tabset.nvim")
|
||||
time([[Config for tabset.nvim]], false)
|
||||
-- Config for: monokai-pro.nvim
|
||||
time([[Config for monokai-pro.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\16monokai-pro\frequire\0", "config", "monokai-pro.nvim")
|
||||
time([[Config for monokai-pro.nvim]], false)
|
||||
-- Config for: nvim-surround
|
||||
time([[Config for nvim-surround]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18nvim-surround\frequire\0", "config", "nvim-surround")
|
||||
time([[Config for nvim-surround]], false)
|
||||
-- Config for: monokai-pro.nvim
|
||||
time([[Config for monokai-pro.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\16monokai-pro\frequire\0", "config", "monokai-pro.nvim")
|
||||
time([[Config for monokai-pro.nvim]], false)
|
||||
|
||||
_G._packer.inside_compile = false
|
||||
if _G._packer.needs_bufread == true then
|
||||
|
|
|
@ -1,289 +1,2 @@
|
|||
# Global snippets
|
||||
|
||||
|
||||
# (c) holds no legal value ;)
|
||||
snippet c)
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${1:`g:snips_author`}. All Rights Reserved.
|
||||
snippet date
|
||||
`strftime("%Y-%m-%d")`
|
||||
snippet ddate
|
||||
`strftime("%B %d, %Y")`
|
||||
snippet diso
|
||||
`strftime("%Y-%m-%dT%H:%M:%S")`
|
||||
snippet time
|
||||
`strftime("%H:%M")`
|
||||
snippet datetime
|
||||
`strftime("%Y-%m-%d %H:%M")`
|
||||
snippet lorem
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
snippet GPL2
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
${0}
|
||||
snippet LGPL2
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
${0}
|
||||
snippet GPL3
|
||||
${1:one line to give the program's name and a brief description.}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
${0}
|
||||
snippet LGPL3
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
${0}
|
||||
snippet AGPL3
|
||||
${1:one line to give the program's name and a brief description.}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
${0}
|
||||
snippet GMGPL linking exception
|
||||
As a special exception, if other files instantiate generics from
|
||||
this unit, or you link this unit with other files to produce an
|
||||
executable, this unit does not by itself cause the resulting
|
||||
executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why the
|
||||
executable file might be covered by the GNU Public License.
|
||||
|
||||
${0}
|
||||
snippet BSD2
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation
|
||||
are those of the authors and should not be interpreted as representing
|
||||
official policies, either expressed or implied, of $2.
|
||||
${0}
|
||||
snippet BSD3
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the ${3:organization} nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
${0}
|
||||
snippet BSD4
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this software
|
||||
must display the following acknowledgement:
|
||||
This product includes software developed by the ${3:organization}.
|
||||
4. Neither the name of the $3 nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
${0}
|
||||
snippet MIT
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
${0}
|
||||
snippet APACHE
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright `strftime("%Y")` ${2:`g:snips_author`}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
${0}
|
||||
snippet BEERWARE
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright `strftime("%Y")` ${2:`g:snips_author`}
|
||||
|
||||
Licensed under the "THE BEER-WARE LICENSE" (Revision 42):
|
||||
$2 wrote this file. As long as you retain this notice you
|
||||
can do whatever you want with this stuff. If we meet some day, and you think
|
||||
this stuff is worth it, you can buy me a beer or coffee in return
|
||||
${0}
|
||||
snippet WTFPL
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright `strftime("%Y")` ${0:`g:snips_author`}
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
|
||||
${0}
|
||||
snippet MPL2
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
${0}
|
||||
snippet AGPL
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
snippet ISC
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")`, ${2:`g:snips_author`}
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
${0}
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
snippet init
|
||||
cmake_minimum_required(VERSION ${1:2.8.2})
|
||||
project(${2:ProjectName})
|
||||
|
||||
find_package(${3:library})
|
||||
|
||||
include_directories(${$3_INCLUDE_DIRS})
|
||||
|
||||
add_subdirectory(${0:src})
|
||||
|
||||
add_executable($2)
|
||||
|
||||
target_link_libraries($2 ${$3_LIBRARIES})
|
||||
|
||||
snippet proj
|
||||
project(${0:Name})
|
||||
|
||||
snippet min
|
||||
cmake_minimum_required(VERSION ${0:2.8.2})
|
||||
|
||||
snippet include
|
||||
include_directories(${${0:include_dir}})
|
||||
|
||||
snippet find
|
||||
find_package(${1:library} ${0:REQUIRED})
|
||||
|
||||
snippet glob
|
||||
file(glob ${1:srcs} *.${0:cpp})
|
||||
|
||||
snippet subdir
|
||||
add_subdirectory(${0:src})
|
||||
|
||||
snippet lib
|
||||
add_library(${1:lib} ${${0:srcs}})
|
||||
|
||||
snippet link
|
||||
target_link_libraries(${1:bin} ${0:somelib})
|
||||
|
||||
snippet bin
|
||||
add_executable(${1:bin})
|
||||
|
||||
snippet set
|
||||
set(${1:var} ${0:val})
|
||||
|
||||
snippet dep
|
||||
add_dependencies(${1:target}
|
||||
${0:dep}
|
||||
)
|
||||
|
||||
snippet Ext_url
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(${1:googletest}
|
||||
URL ${2:http://googletest.googlecode.com/files/gtest-1.7.0.zip}
|
||||
URL_HASH SHA1=${3:f85f6d2481e2c6c4a18539e391aa4ea8ab0394af}
|
||||
SOURCE_DIR "${4:${CMAKE_BINARY_DIR}/gtest-src}"
|
||||
BINARY_DIR "${0:${CMAKE_BINARY_DIR}/gtest-build}"
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
)
|
||||
|
||||
snippet Ext_git
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(${1:googletest}
|
||||
GIT_REPOSITORY ${2:https://github.com/google/googletest.git}
|
||||
GIT_TAG ${3:master}
|
||||
SOURCE_DIR "${4:${CMAKE_BINARY_DIR}/googletest-src}"
|
||||
BINARY_DIR "${0:${CMAKE_BINARY_DIR}/googletest-build}"
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
)
|
||||
|
||||
snippet props
|
||||
set_target_properties(${1:target}
|
||||
${2:properties} ${3:compile_flags}
|
||||
${0:"-O3 -Wall -pedantic"}
|
||||
)
|
||||
|
||||
snippet test
|
||||
add_test(${1:ATestName} ${0:testCommand --options})
|
|
@ -1,116 +0,0 @@
|
|||
## Global Snippets
|
||||
# Define a new Angular Controller;
|
||||
# You can change the controller name and parameters
|
||||
snippet ngc
|
||||
${1:controllerName} = (${2:scope}, ${3:injectables}) ->
|
||||
${4}
|
||||
# angular.foreach loop
|
||||
snippet ngfor
|
||||
angular.forEach ${1:iterateOver}, (value, key) ->
|
||||
${2}
|
||||
## Module Based Snippets
|
||||
# A new angular module without a config function
|
||||
snippet ngm
|
||||
angular.module '${1:moduleName}', [${2:moduleDependencies}]
|
||||
${3}
|
||||
# A new angular module without a config function and a variable assignment
|
||||
snippet ngma
|
||||
${1:moduleName} = angular.module '$1', [${2:moduleDeps}]
|
||||
${3}
|
||||
# A new angular module with a config function
|
||||
snippet ngmc
|
||||
${1:moduleName} = angular.module('$1', [${2:moduleDeps}], (${3:configDeps}) ->
|
||||
${4}
|
||||
)
|
||||
# A factory in a module
|
||||
snippet ngmfa
|
||||
factory '${1:factoryName}', (${2:dependencies}) ->
|
||||
${3}
|
||||
# Define an Angular Module Service to be attached to a previously defined module
|
||||
# You can change the service name and service injectables
|
||||
snippet ngms
|
||||
service '${1:serviceName}', (${2:injectables}) ->
|
||||
${3}
|
||||
# Define an Angular Module Filter to be attached to a previously defined module
|
||||
# You can change the filter name
|
||||
snippet ngmfi
|
||||
filter '${1:filterName}', (${2:injectables}) ->
|
||||
(input, ${3:args}) ->
|
||||
${4}
|
||||
## Route Based Snippets
|
||||
# Defines a when condition of an AngularJS route
|
||||
snippet ngrw
|
||||
$routeProvider.when '${1:url}',
|
||||
templateUrl: '${2:templateUrl}'
|
||||
controller: '${3:controller}'
|
||||
${4}
|
||||
# Defines a when condition of an AngularJS route with the resolve block
|
||||
snippet ngrwr
|
||||
$routeProvider.when '${1:url}',
|
||||
templateUrl: '${2:templateUrl}'
|
||||
controller: '${3:controller}'
|
||||
resolve:
|
||||
${4}
|
||||
${5}
|
||||
# Defines an otherwise condition of an AngularJS route
|
||||
snippet ngro
|
||||
$routeProvider.otherwise redirectTo: '${1:url}'
|
||||
${2}
|
||||
## Scope Related Snippets
|
||||
# Define a new $scope'd function (usually inside an AngularJS Controller)
|
||||
# You can change the function name and arguments
|
||||
snippet $f
|
||||
$scope.${1:functionName} = (${2:args}) ->
|
||||
${3}
|
||||
# Defines a new $scope'd variable inside an AngularJS controller
|
||||
snippet $v
|
||||
$scope.${1:variable} = ${2:value}
|
||||
${3}
|
||||
# Defines a new $scope'd variable inside an AngularJS controller and assigns a value from a constructor arguments
|
||||
snippet $va
|
||||
$scope.${1:variable} = ${2:variable}
|
||||
${3}
|
||||
# Define a $watch for an expression
|
||||
# You can change the expression to be watched
|
||||
snippet $w
|
||||
$scope.$watch '${1:watchExpr}', (newValue, oldValue) ->
|
||||
${2}
|
||||
# Define a $on for a $broadcast/$emit on the $scope inside an Angular Controller
|
||||
# You can change the event name to listen on
|
||||
snippet $on
|
||||
$scope.$on '${1:eventName}', (event, ${2:args}) ->
|
||||
${3}
|
||||
# Define a $broadcast for a $scope inside an Angular Controller / Angular Controller Function
|
||||
# You can change the event name and optional event arguments
|
||||
snippet $b
|
||||
$scope.$broadcast '${1:eventName}', ${2:eventArgs}
|
||||
${3}
|
||||
# Define an $emit for a $scope inside an Angular Controller / Angular Controller Function
|
||||
# You can change the event name and optional event arguments
|
||||
snippet $e
|
||||
$scope.$emit '${1:eventName}', ${2:eventArgs}
|
||||
${3}
|
||||
## Directive related snippets
|
||||
# A compile function
|
||||
snippet ngdcf
|
||||
compile = (tElement, tAttrs, transclude) ->
|
||||
(scope, element, attrs) ->
|
||||
${1}
|
||||
# A linking function in a directive
|
||||
snippet ngdlf
|
||||
(scope, element, attrs${1:ctrl}) ->
|
||||
${2}
|
||||
# A directive with a compile function
|
||||
snippet ngdc
|
||||
directive '${1:directiveName}', factory = (${2:injectables}) ->
|
||||
directiveDefinitionObject =
|
||||
${3:directiveAttrs}
|
||||
compile: compile = (tElement, tAttrs, transclude) ->
|
||||
(scope, element, attrs) ->
|
||||
directiveDefinitionObject
|
||||
# A directive with a linking function only
|
||||
snippet ngdl
|
||||
.directive('${1:directiveName}', (${2:directiveDeps}) ->
|
||||
(scope, element, attrs${3:ctrl}) ->
|
||||
${4}
|
||||
)
|
|
@ -1,101 +0,0 @@
|
|||
# Closure loop
|
||||
snippet forindo
|
||||
for ${1:name} in ${2:array}
|
||||
do ($1) ->
|
||||
$0
|
||||
# Array comprehension
|
||||
snippet fora
|
||||
for ${1:name} in ${2:array}
|
||||
$0
|
||||
# Object comprehension
|
||||
snippet foro
|
||||
for ${1:key}, ${2:value} of ${3:object}
|
||||
$0
|
||||
# Range comprehension (inclusive)
|
||||
snippet forr
|
||||
for ${1:name} in [${2:start}..${3:finish}]
|
||||
$0
|
||||
snippet forrb
|
||||
for ${1:name} in [${2:start}..${3:finish}] by ${4:step}
|
||||
$0
|
||||
# Range comprehension (exclusive)
|
||||
snippet forrex
|
||||
for ${1:name} in [${2:start}...${3:finish}]
|
||||
$0
|
||||
snippet forrexb
|
||||
for ${1:name} in [${2:start}...${3:finish}] by ${4:step}
|
||||
$0
|
||||
# Function
|
||||
snippet fun
|
||||
(${1:args}) ->
|
||||
$0
|
||||
# Function (bound)
|
||||
snippet bfun
|
||||
(${1:args}) =>
|
||||
$0
|
||||
# Class
|
||||
snippet cla class ..
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
${0}
|
||||
snippet cla class .. constructor: ..
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
constructor: (${2:args}) ->
|
||||
${3}
|
||||
|
||||
${0}
|
||||
snippet cla class .. extends ..
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
|
||||
${0}
|
||||
snippet cla class .. extends .. constructor: ..
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
|
||||
constructor: (${3:args}) ->
|
||||
${4}
|
||||
|
||||
${0}
|
||||
# If
|
||||
snippet if
|
||||
if $1
|
||||
${0:${VISUAL}}
|
||||
# If __ Else
|
||||
snippet ife
|
||||
if $1
|
||||
${2:${VISUAL}}
|
||||
else
|
||||
${0}
|
||||
# Else if
|
||||
snippet eif
|
||||
else if $1
|
||||
${0:${VISUAL}}
|
||||
# Ternary If
|
||||
snippet ifte Ternary
|
||||
if $1 then $2 else $0
|
||||
# Unless
|
||||
snippet unl Unless
|
||||
$1 unless $0
|
||||
# Switch
|
||||
snippet swi
|
||||
switch ${1:object}
|
||||
when ${2:value}
|
||||
$0
|
||||
|
||||
# Log
|
||||
snippet log
|
||||
console.log ${0}
|
||||
# Try __ Catch
|
||||
snippet try
|
||||
try
|
||||
${1:${VISUAL}}
|
||||
catch ${2:error}
|
||||
${0}
|
||||
# Require
|
||||
snippet req
|
||||
${2:$1} = require '${1:sys}'
|
||||
# Export
|
||||
snippet exp
|
||||
${0:root} = exports ? this
|
||||
|
||||
snippet jsonp
|
||||
JSON.parse ${0:jstr}
|
||||
# JSON.stringify
|
||||
snippet jsons
|
||||
JSON.stringify ${0:object}
|
|
@ -1,524 +0,0 @@
|
|||
snippet add
|
||||
${1:obj}.add('${2:selector expression}')
|
||||
snippet addClass
|
||||
${1:obj}.addClass('${2:class name}')
|
||||
snippet after
|
||||
${1:obj}.after('${2:Some text <b>and bold!</b>}')
|
||||
snippet ajax
|
||||
$.ajax
|
||||
url: "${1:mydomain.com/url}"
|
||||
type: "${2:POST}"
|
||||
dataType: "${3:xml/html/script/json}"
|
||||
data: ${4:data}
|
||||
complete: (jqXHR, textStatus) ->
|
||||
${5:// callback}
|
||||
success: (data, textStatus, jqXHR) ->
|
||||
${6:// success callback}
|
||||
error: (jqXHR, textStatus, errorThrown) ->
|
||||
${0:// error callback}
|
||||
snippet ajaxcomplete
|
||||
${1:obj}.ajaxComplete (${1:e}, xhr, settings) ->
|
||||
${0:// callback}
|
||||
snippet ajaxerror
|
||||
${1:obj}.ajaxError (${1:e}, xhr, settings, thrownError) ->
|
||||
${2:// error callback}
|
||||
${0}
|
||||
snippet ajaxget
|
||||
$.get '${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
(data, textStatus, jqXHR) ->
|
||||
${0:// success callback}
|
||||
snippet ajaxpost
|
||||
$.post '${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
(data, textStatus, jqXHR) ->
|
||||
${0:// success callback}
|
||||
snippet ajaxprefilter
|
||||
$.ajaxPrefilter (${1:options}, ${2:originalOptions}, jqXHR) ->
|
||||
${0: // Modify options, control originalOptions, store jqXHR, etc}
|
||||
snippet ajaxsend
|
||||
${1:obj}.ajaxSend (${1:request, settings}) ->
|
||||
${2:// error callback}
|
||||
${0}
|
||||
snippet ajaxsetup
|
||||
$.ajaxSetup({
|
||||
url: "${1:mydomain.com/url}",
|
||||
type: "${2:POST}",
|
||||
dataType: "${3:xml/html/script/json}",
|
||||
data: $.param( $("${4:Element or Expression}") ),
|
||||
complete: (jqXHR, textStatus) ->
|
||||
${5:// callback}
|
||||
,
|
||||
success: (data, textStatus, jqXHR) ->
|
||||
${6:// success callback}
|
||||
,
|
||||
error: (jqXHR, textStatus, errorThrown) ->
|
||||
${0:// error callback}
|
||||
})
|
||||
snippet ajaxstart
|
||||
$.ajaxStart ->
|
||||
${1:// handler for when an AJAX call is started and no other AJAX calls are in progress}
|
||||
${0}
|
||||
snippet ajaxstop
|
||||
$.ajaxStop ->
|
||||
${1:// handler for when all AJAX calls have been completed}
|
||||
${0}
|
||||
snippet ajaxsuccess
|
||||
$.ajaxSuccess (${1:e}, xhr, settings) ->
|
||||
${2:// handler for when any AJAX call is successfully completed}
|
||||
${0}
|
||||
snippet andself
|
||||
${1:obj}.andSelf()
|
||||
snippet animate
|
||||
${1:obj}.animate({${2:param1: value1, param2: value2}}, ${3:speed})
|
||||
snippet append
|
||||
${1:obj}.append('${2:Some text <b>and bold!</b>}')
|
||||
snippet appendTo
|
||||
${1:obj}.appendTo('${2:selector expression}')
|
||||
snippet attr
|
||||
${1:obj}.attr('${2:attribute}', '${3:value}')
|
||||
snippet attrm
|
||||
${1:obj}.attr({'${2:attr1}': '${3:value1}', '${4:attr2}': '${5:value2}'})
|
||||
snippet before
|
||||
${1:obj}.before('${2:Some text <b>and bold!</b>}')
|
||||
snippet bind
|
||||
${1:obj}.bind('${2:event name}', (${3:e}) ->
|
||||
${0:// event handler}
|
||||
snippet blur
|
||||
${1:obj}.blur (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet C
|
||||
$.Callbacks()
|
||||
snippet Cadd
|
||||
${1:callbacks}.add(${2:callbacks})
|
||||
snippet Cdis
|
||||
${1:callbacks}.disable()
|
||||
snippet Cempty
|
||||
${1:callbacks}.empty()
|
||||
snippet Cfire
|
||||
${1:callbacks}.fire(${2:args})
|
||||
snippet Cfired
|
||||
${1:callbacks}.fired()
|
||||
snippet Cfirew
|
||||
${1:callbacks}.fireWith(${2:this}, ${3:args})
|
||||
snippet Chas
|
||||
${1:callbacks}.has(${2:callback})
|
||||
snippet Clock
|
||||
${1:callbacks}.lock()
|
||||
snippet Clocked
|
||||
${1:callbacks}.locked()
|
||||
snippet Crem
|
||||
${1:callbacks}.remove(${2:callbacks})
|
||||
snippet change
|
||||
${1:obj}.change (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet children
|
||||
${1:obj}.children('${2:selector expression}')
|
||||
snippet clearq
|
||||
${1:obj}.clearQueue(${2:'queue name'})
|
||||
snippet click
|
||||
${1:obj}.click (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet clone
|
||||
${1:obj}.clone()
|
||||
snippet contains
|
||||
$.contains(${1:container}, ${0:contents})
|
||||
snippet css
|
||||
${1:obj}.css('${2:attribute}', '${3:value}')
|
||||
snippet csshooks
|
||||
$.cssHooks['${1:CSS prop}'] = {
|
||||
get: (elem, computed, extra) ->
|
||||
${2: // handle getting the CSS property}
|
||||
set: (elem, value) ->
|
||||
${0: // handle setting the CSS value}
|
||||
}
|
||||
snippet cssm
|
||||
${1:obj}.css({${2:attribute1}: '${3:value1}', ${4:attribute2}: '${5:value2}'})
|
||||
snippet D
|
||||
$.Deferred()
|
||||
snippet Dalways
|
||||
${1:deferred}.always(${2:callbacks})
|
||||
snippet Ddone
|
||||
${1:deferred}.done(${2:callbacks})
|
||||
snippet Dfail
|
||||
${1:deferred}.fail(${2:callbacks})
|
||||
snippet Disrej
|
||||
${1:deferred}.isRejected()
|
||||
snippet Disres
|
||||
${1:deferred}.isResolved()
|
||||
snippet Dnotify
|
||||
${1:deferred}.notify(${2:args})
|
||||
snippet Dnotifyw
|
||||
${1:deferred}.notifyWith(${2:this}, ${3:args})
|
||||
snippet Dpipe
|
||||
${1:deferred}.then(${2:doneFilter}, ${3:failFilter}, ${4:progressFilter})
|
||||
snippet Dprog
|
||||
${1:deferred}.progress(${2:callbacks})
|
||||
snippet Dprom
|
||||
${1:deferred}.promise(${2:target})
|
||||
snippet Drej
|
||||
${1:deferred}.reject(${2:args})
|
||||
snippet Drejw
|
||||
${1:deferred}.rejectWith(${2:this}, ${3:args})
|
||||
snippet Dres
|
||||
${1:deferred}.resolve(${2:args})
|
||||
snippet Dresw
|
||||
${1:deferred}.resolveWith(${2:this}, ${3:args})
|
||||
snippet Dstate
|
||||
${1:deferred}.state()
|
||||
snippet Dthen
|
||||
${1:deferred}.then(${2:doneCallbacks}, ${3:failCallbacks}, ${4:progressCallbacks})
|
||||
snippet Dwhen
|
||||
$.when(${1:deferreds})
|
||||
snippet data
|
||||
${1:obj}.data(${2:obj})
|
||||
snippet dataa
|
||||
$.data('${1:selector expression}', '${2:key}'${3:, 'value'})
|
||||
snippet dblclick
|
||||
${1:obj}.dblclick (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet delay
|
||||
${1:obj}.delay('${2:slow/400/fast}'${3:, 'queue name'})
|
||||
snippet dele
|
||||
${1:obj}.delegate '${2:selector expression}', '${3:event name}', (${4:e}) ->
|
||||
${0:// event handler}
|
||||
snippet deq
|
||||
${1:obj}.dequeue(${2:'queue name'})
|
||||
snippet deqq
|
||||
$.dequeue('${1:selector expression}'${2:, 'queue name'})
|
||||
snippet detach
|
||||
${1:obj}.detach('${2:selector expression}')
|
||||
snippet die
|
||||
${1:obj}.die(${2:event}, ${3:handler})
|
||||
snippet each
|
||||
${1:obj}.each (index) ->
|
||||
${0:this.innerHTML = this + " is the element, " + index + " is the position"}
|
||||
snippet el
|
||||
$('<${1}/>'${2:, {}})
|
||||
snippet eltrim
|
||||
$.trim('${1:string}')
|
||||
snippet empty
|
||||
${1:obj}.empty()
|
||||
snippet end
|
||||
${1:obj}.end()
|
||||
snippet eq
|
||||
${1:obj}.eq(${2:element index})
|
||||
snippet error
|
||||
${1:obj}.error (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet eventsmap
|
||||
{
|
||||
:f${0}
|
||||
}
|
||||
snippet extend
|
||||
$.extend(${1:true, }${2:target}, ${3:obj})
|
||||
snippet fadein
|
||||
${1:obj}.fadeIn('${2:slow/400/fast}')
|
||||
snippet fadeinc
|
||||
${1:obj}.fadeIn 'slow/400/fast', ->
|
||||
${0:// callback}
|
||||
snippet fadeout
|
||||
${1:obj}.fadeOut('${2:slow/400/fast}')
|
||||
snippet fadeoutc
|
||||
${1:obj}.fadeOut 'slow/400/fast', ->
|
||||
${0:// callback}
|
||||
snippet fadeto
|
||||
${1:obj}.fadeTo('${2:slow/400/fast}', ${3:0.5})
|
||||
snippet fadetoc
|
||||
${1:obj}.fadeTo 'slow/400/fast', ${2:0.5}, ->
|
||||
${0:// callback}
|
||||
snippet filter
|
||||
${1:obj}.filter('${2:selector expression}')
|
||||
snippet filtert
|
||||
${1:obj}.filter (${2:index}) ->
|
||||
${3}
|
||||
snippet find
|
||||
${1:obj}.find('${2:selector expression}')
|
||||
snippet focus
|
||||
${1:obj}.focus (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet focusin
|
||||
${1:obj}.focusIn (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet focusout
|
||||
${1:obj}.focusOut (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet get
|
||||
${1:obj}.get(${2:element index})
|
||||
snippet getjson
|
||||
$.getJSON '${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
(data, textStatus, jqXHR) ->
|
||||
${0:// success callback}
|
||||
snippet getscript
|
||||
$.getScript '${1:mydomain.com/url}', (script, textStatus, jqXHR) ->
|
||||
${0:// callback}
|
||||
snippet grep
|
||||
$.grep(${1:array}, (item, index) >
|
||||
${2}
|
||||
${0:, true})
|
||||
snippet hasc
|
||||
${1:obj}.hasClass('${2:className}')
|
||||
snippet hasd
|
||||
$.hasData('${0:selector expression}')
|
||||
snippet height
|
||||
${1:obj}.height(${2:integer})
|
||||
snippet hide
|
||||
${1:obj}.hide('${2:slow/400/fast}')
|
||||
snippet hidec
|
||||
${1:obj}.hide '${2:slow/400/fast}', ->
|
||||
${0:// callback}
|
||||
snippet hover
|
||||
${1:obj}.hover (${2:e}) ->
|
||||
${3:// event handler}
|
||||
, ($2) ->
|
||||
${4:// event handler}
|
||||
snippet html
|
||||
${1:obj}.html('${2:Some text <b>and bold!</b>}')
|
||||
snippet inarr
|
||||
$.inArray(${1:value}, ${0:array})
|
||||
snippet insa
|
||||
${1:obj}.insertAfter('${2:selector expression}')
|
||||
snippet insb
|
||||
${1:obj}.insertBefore('${2:selector expression}')
|
||||
snippet is
|
||||
${1:obj}.is('${2:selector expression}')
|
||||
snippet isarr
|
||||
$.isArray(${1:obj})
|
||||
snippet isempty
|
||||
$.isEmptyObject(${1:obj})
|
||||
snippet isfunc
|
||||
$.isFunction(${1:obj})
|
||||
snippet isnum
|
||||
$.isNumeric(${1:value})
|
||||
snippet isobj
|
||||
$.isPlainObject(${1:obj})
|
||||
snippet iswin
|
||||
$.isWindow(${1:obj})
|
||||
snippet isxml
|
||||
$.isXMLDoc(${1:node})
|
||||
snippet jj
|
||||
$('${1:selector}')
|
||||
snippet kdown
|
||||
${1:obj}.keydown (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet kpress
|
||||
${1:obj}.keypress (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet kup
|
||||
${1:obj}.keyup (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet last
|
||||
${1:obj}.last('${1:selector expression}')
|
||||
snippet live
|
||||
${1:obj}.live '${2:events}', (${3:e}) ->
|
||||
${0:// event handler}
|
||||
snippet load
|
||||
${1:obj}.load (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet loadf
|
||||
${1:obj}.load('${2:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
(responseText, textStatus, xhr) ->
|
||||
${0:// success callback}
|
||||
})
|
||||
snippet makearray
|
||||
$.makeArray(${0:obj})
|
||||
snippet map
|
||||
${1:obj}.map (${2:index}, ${3:element}) ->
|
||||
${0:// callback}
|
||||
snippet mapp
|
||||
$.map ${1:arrayOrObject}, (${2:value}, ${3:indexOrKey}) ->
|
||||
${0:// callback}
|
||||
snippet merge
|
||||
$.merge(${1:target}, ${0:original})
|
||||
snippet mdown
|
||||
${1:obj}.mousedown (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet menter
|
||||
${1:obj}.mouseenter (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet mleave
|
||||
${1:obj}.mouseleave (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet mmove
|
||||
${1:obj}.mousemove (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet mout
|
||||
${1:obj}.mouseout (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet mover
|
||||
${1:obj}.mouseover (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet mup
|
||||
${1:obj}.mouseup (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet next
|
||||
${1:obj}.next('${2:selector expression}')
|
||||
snippet nexta
|
||||
${1:obj}.nextAll('${2:selector expression}')
|
||||
snippet nextu
|
||||
${1:obj}.nextUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet not
|
||||
${1:obj}.not('${2:selector expression}')
|
||||
snippet off
|
||||
${1:obj}.off('${2:events}', '${3:selector expression}'${4:, handler})
|
||||
snippet offset
|
||||
${1:obj}.offset()
|
||||
snippet offsetp
|
||||
${1:obj}.offsetParent()
|
||||
snippet on
|
||||
${1:obj}.on '${2:events}', '${3:selector expression}', (${4:e}) ->
|
||||
${0:// event handler}
|
||||
snippet one
|
||||
${1:obj}.one '${2:event name}', (${3:e}) ->
|
||||
${0:// event handler}
|
||||
snippet outerh
|
||||
${1:obj}.outerHeight()
|
||||
snippet outerw
|
||||
${1:obj}.outerWidth()
|
||||
snippet param
|
||||
$.param(${1:obj})
|
||||
snippet parent
|
||||
${1:obj}.parent('${2:selector expression}')
|
||||
snippet parents
|
||||
${1:obj}.parents('${2:selector expression}')
|
||||
snippet parentsu
|
||||
${1:obj}.parentsUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet parsejson
|
||||
$.parseJSON(${1:data})
|
||||
snippet parsexml
|
||||
$.parseXML(${1:data})
|
||||
snippet pos
|
||||
${1:obj}.position()
|
||||
snippet prepend
|
||||
${1:obj}.prepend('${2:Some text <b>and bold!</b>}')
|
||||
snippet prependto
|
||||
${1:obj}.prependTo('${2:selector expression}')
|
||||
snippet prev
|
||||
${1:obj}.prev('${2:selector expression}')
|
||||
snippet preva
|
||||
${1:obj}.prevAll('${2:selector expression}')
|
||||
snippet prevu
|
||||
${1:obj}.prevUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet promise
|
||||
${1:obj}.promise(${2:'fx'}, ${3:target})
|
||||
snippet prop
|
||||
${1:obj}.prop('${2:property name}')
|
||||
snippet proxy
|
||||
$.proxy(${1:function}, ${2:this})
|
||||
snippet pushstack
|
||||
${1:obj}.pushStack(${2:elements})
|
||||
snippet queue
|
||||
${1:obj}.queue(${2:name}${3:, newQueue})
|
||||
snippet queuee
|
||||
$.queue(${1:element}${2:, name}${3:, newQueue})
|
||||
snippet ready
|
||||
$(() ->
|
||||
${0}
|
||||
)
|
||||
snippet rem
|
||||
${1:obj}.remove()
|
||||
snippet rema
|
||||
${1:obj}.removeAttr('${2:attribute name}')
|
||||
snippet remc
|
||||
${1:obj}.removeClass('${2:class name}')
|
||||
snippet remd
|
||||
${1:obj}.removeData('${2:key name}')
|
||||
snippet remdd
|
||||
$.removeData(${1:element}${2:, 'key name}')
|
||||
snippet remp
|
||||
${1:obj}.removeProp('${2:property name}')
|
||||
snippet repa
|
||||
${1:obj}.replaceAll(${2:target})
|
||||
snippet repw
|
||||
${1:obj}.replaceWith(${2:content})
|
||||
snippet reset
|
||||
${1:obj}.reset (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet resize
|
||||
${1:obj}.resize (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet scroll
|
||||
${1:obj}.scroll (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet scrolll
|
||||
${1:obj}.scrollLeft(${2:value})
|
||||
snippet scrollt
|
||||
${1:obj}.scrollTop(${2:value})
|
||||
snippet sdown
|
||||
${1:obj}.slideDown('${2:slow/400/fast}')
|
||||
snippet sdownc
|
||||
${1:obj}.slideDown('${2:slow/400/fast}', ->
|
||||
${0:// callback}
|
||||
snippet select
|
||||
${1:obj}.select (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet serialize
|
||||
${1:obj}.serialize()
|
||||
snippet serializea
|
||||
${1:obj}.serializeArray()
|
||||
snippet show
|
||||
${1:obj}.show('${2:slow/400/fast}')
|
||||
snippet showc
|
||||
${1:obj}.show '${2:slow/400/fast}', ->
|
||||
${0:// callback}
|
||||
snippet sib
|
||||
${1:obj}.siblings('${2:selector expression}')
|
||||
snippet size
|
||||
${1:obj}.size()
|
||||
snippet slice
|
||||
${1:obj}.slice(${2:start}${3:, end})
|
||||
snippet stoggle
|
||||
${1:obj}.slideToggle('${2:slow/400/fast}')
|
||||
snippet stop
|
||||
${1:obj}.stop('${2:queue}', ${3:false}, ${4:false})
|
||||
snippet submit
|
||||
${1:obj}.submit (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet sup
|
||||
${1:obj}.slideUp('${2:slow/400/fast}')
|
||||
snippet supc
|
||||
${1:obj}.slideUp '${2:slow/400/fast}', ->
|
||||
${0:// callback}
|
||||
snippet text
|
||||
${1:obj}.text(${2:'some text'})
|
||||
snippet this
|
||||
$(this)
|
||||
snippet toarr
|
||||
${0:obj}.toArray()
|
||||
snippet tog
|
||||
${1:obj}.toggle (${2:e}) ->
|
||||
${3:// event handler}
|
||||
, ($2) ->
|
||||
${4:// event handler}
|
||||
${0}
|
||||
snippet togclass
|
||||
${1:obj}.toggleClass('${2:class name}')
|
||||
snippet togsh
|
||||
${1:obj}.toggle('${2:slow/400/fast}')
|
||||
snippet trig
|
||||
${1:obj}.trigger('${2:event name}')
|
||||
snippet trigh
|
||||
${1:obj}.triggerHandler('${2:event name}')
|
||||
snippet $trim
|
||||
$.trim(${1:str})
|
||||
snippet $type
|
||||
$.type(${1:obj})
|
||||
snippet unbind
|
||||
${1:obj}.unbind('${2:event name}')
|
||||
snippet undele
|
||||
${1:obj}.undelegate(${2:selector expression}, ${3:event}, ${4:handler})
|
||||
snippet uniq
|
||||
$.unique(${1:array})
|
||||
snippet unload
|
||||
${1:obj}.unload (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet unwrap
|
||||
${1:obj}.unwrap()
|
||||
snippet val
|
||||
${1:obj}.val('${2:text}')
|
||||
snippet width
|
||||
${1:obj}.width(${2:integer})
|
||||
snippet wrap
|
||||
${1:obj}.wrap('${2:<div class="extra-wrapper"></div>}')
|
|
@ -1,11 +0,0 @@
|
|||
snippet def
|
||||
define ["${1:#dependencies1}"], (${2:#dependencies2}) ->
|
||||
${0:TARGET}
|
||||
|
||||
snippet defn
|
||||
define "${1:#name}", ["${2:#dependencies1}"], (${3:#dependencies2}) ->
|
||||
${0:TARGET}
|
||||
|
||||
snippet reqjs
|
||||
require ["${1:#dependencies1}"], (${2:#dependencies2}) ->
|
||||
${0:TARGET}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,93 +0,0 @@
|
|||
# Snippets for dart in flutter project, to use add the following to your .vimrc
|
||||
# `autocmd BufRead,BufNewFile,BufEnter *.dart UltiSnipsAddFiletypes dart-flutter`
|
||||
# Flutter stateless widget
|
||||
snippet stless
|
||||
class $1 extends StatelessWidget {
|
||||
const $1({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
$2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
# Flutter stateful widget
|
||||
snippet stful
|
||||
class $1 extends StatefulWidget {
|
||||
const $1({super.key});
|
||||
|
||||
@override
|
||||
State<$1> createState() => _$1State();
|
||||
}
|
||||
|
||||
class _$1State extends State<$1> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
$2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
# Flutter widget with AnimationController
|
||||
snippet stanim
|
||||
class $1 extends StatefulWidget {
|
||||
const $1({super.key});
|
||||
|
||||
@override
|
||||
State<$1> createState() => _$1State();
|
||||
}
|
||||
|
||||
class _$1State extends State<$1>
|
||||
with SingleTickerProviderStateMixin {
|
||||
AnimationController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_controller.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
$2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
# Flutter scaffold application
|
||||
snippet fsa
|
||||
void main() {
|
||||
runApp(
|
||||
MaterialApp(
|
||||
title: 'Flutter Demo',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
),
|
||||
debugShowCheckedModeBanner: false,
|
||||
home: const HomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
const HomePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Home Page'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
snippet af
|
||||
(${1}) {${2}}${0}
|
||||
snippet pr
|
||||
print(${1});
|
||||
snippet deb
|
||||
debugger();
|
||||
${0}
|
||||
snippet lib
|
||||
library ${1};
|
||||
${0}
|
||||
snippet im
|
||||
import 'package:${1}/${2}.dart';
|
||||
${0}
|
||||
snippet rgx
|
||||
new RegExp(r'${1}')
|
||||
snippet var
|
||||
var ${1} = ${2};
|
||||
snippet main
|
||||
main() {
|
||||
${0}
|
||||
}
|
||||
snippet st
|
||||
static ${0}
|
||||
snippet fi
|
||||
final ${0}
|
||||
snippet re
|
||||
return ${0}
|
||||
snippet br
|
||||
break;
|
||||
snippet th
|
||||
throw ${0}
|
||||
snippet cl
|
||||
class ${1:`vim_snippets#Filename("", "untitled")`} ${0}
|
||||
snippet in
|
||||
interface ${1:`vim_snippets#Filename("", "untitled")`} ${0}
|
||||
snippet imp
|
||||
implements ${0}
|
||||
snippet ext
|
||||
extends ${0}
|
||||
snippet if
|
||||
if (${1:true}) {
|
||||
${0}
|
||||
}
|
||||
snippet ife
|
||||
if (${1:true}) {
|
||||
${2}
|
||||
} else {
|
||||
${0}
|
||||
}
|
||||
snippet el
|
||||
else
|
||||
snippet sw
|
||||
switch (${1}) {
|
||||
${0}
|
||||
}
|
||||
snippet cs
|
||||
case ${1}:
|
||||
${0}
|
||||
snippet de
|
||||
default:
|
||||
${0}
|
||||
snippet for
|
||||
for (var ${2:i} = 0, len = ${1:things}.length; $2 < len; ${3:++}$2) {
|
||||
${0:$1[$2]}
|
||||
}
|
||||
snippet fore
|
||||
for (final ${2:item} in ${1:itemList}) {
|
||||
${0}
|
||||
}
|
||||
snippet wh
|
||||
while ($1) {
|
||||
${0}
|
||||
}
|
||||
snippet dowh
|
||||
do {
|
||||
${0}
|
||||
} while ($0);
|
||||
snippet as
|
||||
assert($0);
|
||||
snippet try
|
||||
try {
|
||||
${0:${VISUAL}}
|
||||
} catch (${1:Exception e}) {
|
||||
}
|
||||
snippet tryf
|
||||
try {
|
||||
${0:${VISUAL}}
|
||||
} catch (${1:Exception e}) {
|
||||
} finally {
|
||||
}
|
|
@ -1,112 +0,0 @@
|
|||
# Model Fields
|
||||
|
||||
# Note: Optional arguments are using defaults that match what Django will use
|
||||
# as a default, e.g. with max_length fields. Doing this as a form of self
|
||||
# documentation and to make it easy to know whether you should override the
|
||||
# default or not.
|
||||
|
||||
# Note: Optional arguments that are booleans will use the opposite since you
|
||||
# can either not specify them, or override them, e.g. auto_now_add=False.
|
||||
|
||||
snippet auto
|
||||
${1:FIELDNAME} = models.AutoField(${0})
|
||||
snippet bigint
|
||||
${1:FIELDNAME} = models.BigIntegerField(${0})
|
||||
snippet binary
|
||||
${1:FIELDNAME} = models.BinaryField(${0})
|
||||
snippet bool
|
||||
${1:FIELDNAME} = models.BooleanField(${0:default=True})
|
||||
snippet char
|
||||
${1:FIELDNAME} = models.CharField(max_length=${2}${0:, blank=True})
|
||||
snippet comma
|
||||
${1:FIELDNAME} = models.CommaSeparatedIntegerField(max_length=${2}${0:, blank=True})
|
||||
snippet date
|
||||
${1:FIELDNAME} = models.DateField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})
|
||||
snippet datetime
|
||||
${1:FIELDNAME} = models.DateTimeField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})
|
||||
snippet decimal
|
||||
${1:FIELDNAME} = models.DecimalField(max_digits=${2}, decimal_places=${0})
|
||||
snippet email
|
||||
${1:FIELDNAME} = models.EmailField(max_length=${2:75}${0:, blank=True})
|
||||
snippet file
|
||||
${1:FIELDNAME} = models.FileField(upload_to=${2:path/for/upload}${0:, max_length=100})
|
||||
snippet filepath
|
||||
${1:FIELDNAME} = models.FilePathField(path=${2:"/abs/path/to/dir"}${3:, max_length=100}${4:, match="*.ext"}${5:, recursive=True}${0:, blank=True, })
|
||||
snippet float
|
||||
${1:FIELDNAME} = models.FloatField(${0})
|
||||
snippet image
|
||||
${1:FIELDNAME} = models.ImageField(upload_to=${2:path/for/upload}${3:, height_field=height, width_field=width}${0:, max_length=100})
|
||||
snippet int
|
||||
${1:FIELDNAME} = models.IntegerField(${0})
|
||||
snippet ip
|
||||
${1:FIELDNAME} = models.IPAddressField(${0})
|
||||
snippet nullbool
|
||||
${1:FIELDNAME} = models.NullBooleanField(${0})
|
||||
snippet posint
|
||||
${1:FIELDNAME} = models.PositiveIntegerField(${0})
|
||||
snippet possmallint
|
||||
${1:FIELDNAME} = models.PositiveSmallIntegerField(${0})
|
||||
snippet slug
|
||||
${1:FIELDNAME} = models.SlugField(max_length=${2:50}${0:, blank=True})
|
||||
snippet smallint
|
||||
${1:FIELDNAME} = models.SmallIntegerField(${0})
|
||||
snippet text
|
||||
${1:FIELDNAME} = models.TextField(${0:blank=True})
|
||||
snippet time
|
||||
${1:FIELDNAME} = models.TimeField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})
|
||||
snippet url
|
||||
${1:FIELDNAME} = models.URLField(${2:verify_exists=False}${3:, max_length=200}${0:, blank=True})
|
||||
snippet xml
|
||||
${1:FIELDNAME} = models.XMLField(schema_path=${2:None}${0:, blank=True})
|
||||
# Relational Fields
|
||||
snippet fk
|
||||
${1:FIELDNAME} = models.ForeignKey(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${0:, to_field=''})
|
||||
snippet m2m
|
||||
${1:FIELDNAME} = models.ManyToManyField(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, symmetrical=False}${6:, through=''}${0:, db_table=''})
|
||||
snippet o2o
|
||||
${1:FIELDNAME} = models.OneToOneField(${2:OtherModel}${3:, parent_link=True}${4:, related_name=''}${5:, limit_choices_to=}${0:, to_field=''})
|
||||
|
||||
# Code Skeletons
|
||||
|
||||
snippet form
|
||||
class ${1:FormName}(forms.Form):
|
||||
"""${2:docstring}"""
|
||||
${0}
|
||||
|
||||
snippet model
|
||||
class ${1:ModelName}(models.Model):
|
||||
"""${2:docstring}"""
|
||||
${3}
|
||||
|
||||
class Meta:
|
||||
${4}
|
||||
|
||||
def __unicode__(self):
|
||||
${5}
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
${6}
|
||||
|
||||
@models.permalink
|
||||
def get_absolute_url(self):
|
||||
return ('${7:view_or_url_name}' ${0})
|
||||
|
||||
snippet modeladmin
|
||||
class ${1:ModelName}Admin(admin.ModelAdmin):
|
||||
${0}
|
||||
|
||||
admin.site.register($1, $1Admin)
|
||||
|
||||
snippet tabularinline
|
||||
class ${0:ModelName}Inline(admin.TabularInline):
|
||||
model = $1
|
||||
|
||||
snippet stackedinline
|
||||
class ${0:ModelName}Inline(admin.StackedInline):
|
||||
model = $1
|
||||
|
||||
snippet r2r
|
||||
return render_to_response('${1:template.html}', {
|
||||
${2}
|
||||
}${0:, context_instance=RequestContext(request)}
|
||||
)
|
|
@ -1,280 +0,0 @@
|
|||
snippet v "shorthand variable declaration"
|
||||
${1} := ${2}
|
||||
|
||||
snippet vr "variable initialization"
|
||||
var ${1:t} ${0:string}
|
||||
|
||||
snippet var "variable declaration"
|
||||
var ${1} ${2} = ${3}
|
||||
|
||||
snippet vars "variables declaration"
|
||||
var (
|
||||
${1} ${2} = ${3}
|
||||
)
|
||||
|
||||
snippet ap "append"
|
||||
append(${1:slice}, ${0:value})
|
||||
|
||||
snippet bl "bool"
|
||||
bool
|
||||
|
||||
snippet bt "byte"
|
||||
byte
|
||||
|
||||
snippet br "break"
|
||||
break
|
||||
|
||||
snippet ch "channel"
|
||||
chan ${0:int}
|
||||
|
||||
snippet cs "case"
|
||||
case ${1:value}:
|
||||
${0:${VISUAL}}
|
||||
|
||||
snippet co "constants with iota"
|
||||
const (
|
||||
${1:NAME1} = iota
|
||||
${0:NAME2}
|
||||
)
|
||||
|
||||
snippet cn "continue"
|
||||
continue
|
||||
|
||||
snippet df "defer"
|
||||
defer ${0:func}()
|
||||
|
||||
snippet dfr "defer recover"
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
}()
|
||||
|
||||
snippet im "import"
|
||||
import (
|
||||
"${1:package}"
|
||||
)
|
||||
|
||||
snippet in "interface"
|
||||
interface{}
|
||||
|
||||
snippet inf "full interface "
|
||||
interface ${1:name} {
|
||||
${2:/* methods */}
|
||||
}
|
||||
|
||||
snippet if "if condition"
|
||||
if $1 {
|
||||
${2:${VISUAL}}
|
||||
}
|
||||
|
||||
|
||||
snippet ife "if else condition"
|
||||
if $1 {
|
||||
${2:${VISUAL}}
|
||||
} else {
|
||||
${0}
|
||||
}
|
||||
|
||||
snippet el "else"
|
||||
else {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
|
||||
snippet ir "if error not nil, return err"
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
${0}
|
||||
|
||||
snippet f "false"
|
||||
false
|
||||
|
||||
snippet ft "fallthrough"
|
||||
fallthrough
|
||||
|
||||
snippet fl "float"
|
||||
float32
|
||||
|
||||
snippet f3 "float32"
|
||||
float32
|
||||
|
||||
snippet f6 "float64"
|
||||
float64
|
||||
|
||||
snippet for "for loop"
|
||||
for ${1}{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
|
||||
snippet fori "for int loop"
|
||||
for ${2:i} := 0; $2 < ${1:count}; $2${3:++} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
|
||||
snippet forr "for range loop"
|
||||
for ${1:e} := range ${2:collection} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
|
||||
snippet fun "function"
|
||||
func ${1:funcName}(${2}) ${3:error} {
|
||||
${4}
|
||||
}
|
||||
${0}
|
||||
|
||||
snippet fum "method"
|
||||
func (${1:receiver} ${2:type}) ${3:funcName}(${4}) ${5:error} {
|
||||
${6}
|
||||
}
|
||||
${0}
|
||||
|
||||
snippet fumh "http handler function on receiver"
|
||||
func (${1:receiver} ${2:type}) ${3:funcName}(${4:w} http.ResponseWriter, ${5:r} *http.Request) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
|
||||
snippet lf "log printf"
|
||||
log.Printf("%${1:s}", ${2:var})
|
||||
|
||||
snippet lp "log println"
|
||||
log.Println("${1}")
|
||||
|
||||
snippet mk "make"
|
||||
make(${1:[]string}, ${0:0})
|
||||
|
||||
snippet mp "map"
|
||||
map[${1:string}]${0:int}
|
||||
|
||||
snippet main "func main()"
|
||||
func main() {
|
||||
${1}
|
||||
}
|
||||
${0}
|
||||
|
||||
snippet nw "new"
|
||||
new(${0:type})
|
||||
|
||||
snippet pa "package"
|
||||
package ${1:main}
|
||||
|
||||
snippet pn "panic"
|
||||
panic("${0:msg}")
|
||||
|
||||
snippet pf "fmt.Printf()"
|
||||
fmt.Printf("%${1:s}\n", ${2:var})
|
||||
|
||||
snippet pl "fmt.Println()"
|
||||
fmt.Println("${1:s}")
|
||||
|
||||
snippet rn "range"
|
||||
range ${0}
|
||||
|
||||
snippet rt "return"
|
||||
return ${0}
|
||||
|
||||
snippet rs "result"
|
||||
result
|
||||
|
||||
snippet sl "select"
|
||||
select {
|
||||
case ${1:v1} := <-${2:chan1}
|
||||
${3}
|
||||
default:
|
||||
${0}
|
||||
}
|
||||
|
||||
snippet sr "string"
|
||||
string
|
||||
|
||||
snippet st "struct"
|
||||
struct ${1:name} {
|
||||
${2:/* data */}
|
||||
}
|
||||
${0}
|
||||
|
||||
snippet sw "switch"
|
||||
switch ${1:var} {
|
||||
case ${2:value1}:
|
||||
${3}
|
||||
case ${4:value2}:
|
||||
${5}
|
||||
default:
|
||||
${0}
|
||||
}
|
||||
|
||||
snippet ps "fmt.Sprintf"
|
||||
fmt.Sprintf("%${1:s}", ${2:var})
|
||||
|
||||
snippet t "true"
|
||||
true
|
||||
|
||||
snippet g "goroutine named function"
|
||||
go ${1:funcName}(${0})
|
||||
|
||||
snippet ga "goroutine anonymous function"
|
||||
go func(${1} ${2:type}) {
|
||||
${3:/* code */}
|
||||
}(${0})
|
||||
|
||||
snippet test "test function"
|
||||
func Test${1:name}(t *testing.T) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
|
||||
snippet testt "table test function"
|
||||
func Test${1:name}(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
}{
|
||||
{
|
||||
name: "${2:test name}",
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
${0:${VISUAL}}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
snippet bench "benchmark function"
|
||||
func Benchmark${1:name}(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
${2}
|
||||
}
|
||||
}
|
||||
${0}
|
||||
|
||||
snippet cl "composite literals"
|
||||
type ${1:name} struct {
|
||||
${2:attrName} ${3:attrType}
|
||||
}
|
||||
|
||||
snippet om "if key in a map"
|
||||
if ${1:value}, ok := ${2:map}[${3:key}]; ok == true {
|
||||
${4:/* code */}
|
||||
}
|
||||
|
||||
|
||||
snippet gg "Grouped globals with anonymous struct"
|
||||
var ${1:var} = struct{
|
||||
${2:name} ${3:type}
|
||||
}{
|
||||
$2: ${4:value},
|
||||
}
|
||||
|
||||
|
||||
snippet ja "Marshalable json alias"
|
||||
type ${1:parentType}Alias $1
|
||||
|
||||
func (p *$1) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(&struct{ *$1Alias }{(*$1Alias)(p)})
|
||||
}
|
||||
|
||||
|
||||
snippet errwr "Error handling with fmt.Errorf"
|
||||
if ${1}err != nil {
|
||||
return fmt.Errorf("${2} %w", err)
|
||||
}
|
|
@ -1,142 +0,0 @@
|
|||
# Generic tags
|
||||
|
||||
extends html
|
||||
|
||||
snippet %
|
||||
{% ${1} %}
|
||||
snippet %%
|
||||
{% ${1:tag_name} %}
|
||||
${0}
|
||||
{% end$1 %}
|
||||
snippet {
|
||||
{{ ${1} }}
|
||||
# Template Tags
|
||||
|
||||
snippet autoescape
|
||||
{% autoescape ${1:off} %}
|
||||
${0}
|
||||
{% endautoescape %}
|
||||
snippet block
|
||||
{% block ${1} %}
|
||||
${0}
|
||||
{% endblock %}
|
||||
snippet #
|
||||
{# ${0:comment} #}
|
||||
snippet comment
|
||||
{% comment %}
|
||||
${0}
|
||||
{% endcomment %}
|
||||
snippet cycle
|
||||
{% cycle ${1:val1} ${2:val2} ${3:as ${4}} %}
|
||||
snippet debug
|
||||
{% debug %}
|
||||
snippet extends
|
||||
{% extends "${0:base.html}" %}
|
||||
snippet filter
|
||||
{% filter ${1} %}
|
||||
${0}
|
||||
{% endfilter %}
|
||||
snippet firstof
|
||||
{% firstof ${1} %}
|
||||
snippet for
|
||||
{% for ${1} in ${2} %}
|
||||
${0}
|
||||
{% endfor %}
|
||||
snippet empty
|
||||
{% empty %}
|
||||
${0}
|
||||
snippet if
|
||||
{% if ${1} %}
|
||||
${0}
|
||||
{% endif %}
|
||||
snippet el
|
||||
{% else %}
|
||||
${1}
|
||||
snippet eif
|
||||
{% elif ${1} %}
|
||||
${0}
|
||||
snippet ifchanged
|
||||
{% ifchanged %}${1}{% endifchanged %}
|
||||
snippet ifequal
|
||||
{% ifequal ${1} ${2} %}
|
||||
${0}
|
||||
{% endifequal %}
|
||||
snippet ifnotequal
|
||||
{% ifnotequal ${1} ${2} %}
|
||||
${0}
|
||||
{% endifnotequal %}
|
||||
snippet include
|
||||
{% include "${0}" %}
|
||||
snippet load
|
||||
{% load ${0} %}
|
||||
snippet now
|
||||
{% now "${0:jS F Y H:i}" %}
|
||||
snippet regroup
|
||||
{% regroup ${1} by ${2} as ${0} %}
|
||||
snippet spaceless
|
||||
{% spaceless %}${0}{% endspaceless %}
|
||||
snippet ssi
|
||||
{% ssi ${0} %}
|
||||
snippet trans
|
||||
{% trans "${0:string}" %}
|
||||
snippet url
|
||||
{% url ${1} as ${0} %}
|
||||
snippet widthratio
|
||||
{% widthratio ${1:this_value} ${2:max_value} ${0:100} %}
|
||||
snippet with
|
||||
{% with ${1} as ${2} %}
|
||||
${0}
|
||||
{% endwith %}
|
||||
|
||||
# Template Filters
|
||||
|
||||
# Note: Since SnipMate can't determine which template filter you are
|
||||
# expanding without the "|" character, these do not add the "|"
|
||||
# character. These save a few keystrokes still.
|
||||
|
||||
# Note: Template tags that take no arguments are not implemented.
|
||||
|
||||
snippet add
|
||||
add:"${0}"
|
||||
snippet center
|
||||
center:"${0}"
|
||||
snippet cut
|
||||
cut:"${0}"
|
||||
snippet date
|
||||
date:"${0}"
|
||||
snippet default
|
||||
default:"${0}"
|
||||
snippet defaultifnone
|
||||
default_if_none:"${0}"
|
||||
snippet dictsort
|
||||
dictsort:"${0}"
|
||||
snippet dictsortrev
|
||||
dictsortreversed:"${0}"
|
||||
snippet divisibleby
|
||||
divisibleby:"${0}"
|
||||
snippet floatformat
|
||||
floatformat:"${0}"
|
||||
snippet getdigit
|
||||
get_digit:"${0}"
|
||||
snippet join
|
||||
join:"${0}"
|
||||
snippet lengthis
|
||||
length_is:"${0}"
|
||||
snippet pluralize
|
||||
pluralize:"${0}"
|
||||
snippet removetags
|
||||
removetags:"${0}"
|
||||
snippet slice
|
||||
slice:"${0}"
|
||||
snippet stringformat
|
||||
stringformat:"${0}"
|
||||
snippet time
|
||||
time:"${0}"
|
||||
snippet truncatewords
|
||||
truncatewords:${0}
|
||||
snippet truncatewordshtml
|
||||
truncatewords_html:${0}
|
||||
snippet urlizetrunc
|
||||
urlizetrunc:${0}
|
||||
snippet wordwrap
|
||||
wordwrap:${0}
|
|
@ -1,55 +0,0 @@
|
|||
# Generic tags
|
||||
|
||||
snippet {
|
||||
{{ ${0} }}
|
||||
|
||||
# Template tags
|
||||
|
||||
snippet extends
|
||||
{% extends "${0:base.html}" %}
|
||||
snippet autoescape
|
||||
{% autoescape ${0:xhtml_escape | None} %}
|
||||
snippet apply
|
||||
{% apply ${1:function} %}
|
||||
${0}
|
||||
{% end %}
|
||||
snippet block
|
||||
{% block ${1} %}
|
||||
${0}
|
||||
{% end %}
|
||||
snippet for
|
||||
{% for ${1:item} in ${2} %}
|
||||
${0}
|
||||
{% end %}
|
||||
snippet from
|
||||
{% from ${1:x} import ${0:y} %}
|
||||
snippet if
|
||||
{% if $1 %}
|
||||
${0}
|
||||
{% end %}
|
||||
snippet eif
|
||||
{% elif $0 %}
|
||||
snippet el
|
||||
{% else %}
|
||||
snippet import
|
||||
{% import ${0:module} %}
|
||||
snippet include
|
||||
{% include "${0:filename}" %}
|
||||
snippet module
|
||||
{% module ${0:expression} %}
|
||||
snippet raw
|
||||
{% raw ${0:expression} %}
|
||||
snippet set
|
||||
{% set ${1:x} = ${0:y} %}
|
||||
snippet try
|
||||
{% try %}
|
||||
${1:${VISUAL}}
|
||||
{% except %}
|
||||
${2}
|
||||
{% finallly %}
|
||||
${0}
|
||||
{% end %}
|
||||
snippet wh
|
||||
{% while $1 %}
|
||||
${0}
|
||||
{% end %}
|
|
@ -1,52 +0,0 @@
|
|||
# Snippet for bemjson. https://en.bem.info/platform/bemjson/
|
||||
|
||||
# Blocks
|
||||
snippet b
|
||||
{
|
||||
block : '${1:name}',
|
||||
content : [
|
||||
'${2:content}'
|
||||
]
|
||||
}
|
||||
|
||||
# btc - BEM block with text content
|
||||
snippet btc
|
||||
{
|
||||
block : '${1:name}',
|
||||
content: '${2:content}'
|
||||
}
|
||||
|
||||
# bwm - BEM block with modifier.
|
||||
snippet bwm
|
||||
{
|
||||
block : '${1:name}',
|
||||
mods: { ${2:modName}: '${3:modVal}' },
|
||||
content : [
|
||||
'${4:content}'
|
||||
]
|
||||
}
|
||||
|
||||
# Elems
|
||||
|
||||
# e - BEM elem
|
||||
snippet e
|
||||
{
|
||||
elem : '${1:name}',
|
||||
content : [
|
||||
'${2:content}'
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
# mo - Mods
|
||||
snippet mo
|
||||
mods : { ${1:modName} : '${2:modVal}' },
|
||||
|
||||
# mi - BEM mix mod
|
||||
snippet mi
|
||||
mix : [ { ${1:block} : '${2:block}' } ],
|
||||
|
||||
# a - BEM attrs mod
|
||||
snippet a
|
||||
attrs : { ${1:attr} : '${2:val}' },
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
snippet .attr
|
||||
.attr("${1}", ${2})
|
||||
snippet .style
|
||||
.style("${1}", ${2})
|
||||
snippet axis
|
||||
d3.svg.axis()
|
||||
.orient(${1})
|
||||
.scale(${2})
|
||||
snippet fd
|
||||
function(d) { ${1} }
|
||||
snippet fdi
|
||||
function(d, i) { ${1} }
|
||||
snippet marginconvention
|
||||
var ${1:margin} = { top: ${2:10}, right: ${3:10}, bottom: ${4:10}, left: ${5:10} };
|
||||
var ${6:width} = ${7:970} - $1.left - $1.right;
|
||||
var ${8:height} = ${9:500} - $1.top - $1.bottom;
|
||||
|
||||
var ${10:svg} = d3.select("${11}").append("svg")
|
||||
.attr("width", $6 + $1.left + $1.right)
|
||||
.attr("height", $8 + $1.top + $1.bottom)
|
||||
.append("g")
|
||||
.attr("transform", "translate(" + $1.left + "," + $1.top + ")")
|
||||
snippet nest
|
||||
d3.nest()
|
||||
.key(${1})
|
||||
.entries(${2})
|
||||
snippet scale
|
||||
d3.scale.linear()
|
||||
.domain(${1})
|
||||
.range(${2})
|
|
@ -1,175 +0,0 @@
|
|||
snippet des "Describe (js)"
|
||||
describe('${1:description}', function() {
|
||||
$0
|
||||
});
|
||||
|
||||
snippet it "it (js)"
|
||||
it('${1:description}', function() {
|
||||
$0
|
||||
});
|
||||
|
||||
snippet bef "before each (js)"
|
||||
beforeEach(function() {
|
||||
$0
|
||||
});
|
||||
|
||||
snippet aft "after each (js)"
|
||||
afterEach(function() {
|
||||
$0
|
||||
});
|
||||
|
||||
snippet befa "before all (js)"
|
||||
beforeAll(function() {
|
||||
$0
|
||||
});
|
||||
|
||||
snippet afta "after all (js)"
|
||||
afterAll(function() {
|
||||
$0
|
||||
});
|
||||
|
||||
snippet any "any (js)"
|
||||
jasmine.any($1)
|
||||
|
||||
snippet anyt "anything (js)"
|
||||
jasmine.anything()
|
||||
|
||||
snippet objc "object containing (js)"
|
||||
jasmine.objectContaining({
|
||||
${VISUAL}$0
|
||||
});
|
||||
|
||||
snippet arrc "array containing (js)"
|
||||
jasmine.arrayContaining([${1:value1}]);
|
||||
|
||||
snippet strm "string matching (js)"
|
||||
jasmine.stringMatching("${1:matcher}")
|
||||
|
||||
snippet ru "runs (js)"
|
||||
runs(function() {
|
||||
$0
|
||||
});
|
||||
|
||||
snippet wa "waits (js)"
|
||||
waits($1);
|
||||
|
||||
snippet ex "expect (js)"
|
||||
expect(${1:target})$0;
|
||||
|
||||
snippet ee "expect to equal (js)"
|
||||
expect(${1:target}).toEqual(${2:value});
|
||||
|
||||
snippet el "expect to be less than (js)"
|
||||
expect(${1:target}).toBeLessThan(${2:value});
|
||||
|
||||
snippet eg "expect to be greater than (js)"
|
||||
expect(${1:target}).toBeGreaterThan(${2:value});
|
||||
|
||||
snippet eb "expect to be (js)"
|
||||
expect(${1:target}).toBe(${2:value});
|
||||
|
||||
snippet em "expect to match (js)"
|
||||
expect(${1:target}).toMatch(${2:pattern});
|
||||
|
||||
snippet eha "expect to have attribute (js)"
|
||||
expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'});
|
||||
|
||||
snippet et "expect to be truthy (js)"
|
||||
expect(${1:target}).toBeTruthy();
|
||||
|
||||
snippet ef "expect to be falsy (js)"
|
||||
expect(${1:target}).toBeFalsy();
|
||||
|
||||
snippet etbd "expect to be defined (js)"
|
||||
expect(${1:target}).toBeDefined();
|
||||
|
||||
snippet eud "expect to be defined (js)"
|
||||
expect(${1:target}).toBeUndefined();
|
||||
|
||||
snippet en "expect to be null (js)"
|
||||
expect(${1:target}).toBeNull();
|
||||
|
||||
snippet ec "expect to contain (js)"
|
||||
expect(${1:target}).toContain(${2:value});
|
||||
|
||||
snippet ev "expect to be visible (js)"
|
||||
expect(${1:target}).toBeVisible();
|
||||
|
||||
snippet eh "expect to be hidden (js)"
|
||||
expect(${1:target}).toBeHidden();
|
||||
|
||||
snippet eth "expect to throw (js)"
|
||||
expect(${1:target}).toThrow(${2:value});
|
||||
|
||||
snippet ethe "expect to throw error (js)"
|
||||
expect(${1:target}).toThrowError(${2:value});
|
||||
|
||||
snippet notx "expect not (js)"
|
||||
expect(${1:target}).not$0;
|
||||
|
||||
snippet note "expect not to equal (js)"
|
||||
expect(${1:target}).not.toEqual(${2:value});
|
||||
|
||||
snippet notl "expect to not be less than (js)"
|
||||
expect(${1:target}).not.toBeLessThan(${2:value});
|
||||
|
||||
snippet notg "expect to not be greater than (js)"
|
||||
expect(${1:target}).not.toBeGreaterThan(${2:value});
|
||||
|
||||
snippet notm "expect not to match (js)"
|
||||
expect(${1:target}).not.toMatch(${2:pattern});
|
||||
|
||||
snippet notha "expect to not have attribute (js)"
|
||||
expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'});
|
||||
|
||||
snippet nott "expect not to be truthy (js)"
|
||||
expect(${1:target}).not.toBeTruthy();
|
||||
|
||||
snippet notf "expect not to be falsy (js)"
|
||||
expect(${1:target}).not.toBeFalsy();
|
||||
|
||||
snippet notd "expect not to be defined (js)"
|
||||
expect(${1:target}).not.toBeDefined();
|
||||
|
||||
snippet notn "expect not to be null (js)"
|
||||
expect(${1:target}).not.toBeNull();
|
||||
|
||||
snippet notc "expect not to contain (js)"
|
||||
expect(${1:target}).not.toContain(${2:value});
|
||||
|
||||
snippet notv "expect not to be visible (js)"
|
||||
expect(${1:target}).not.toBeVisible();
|
||||
|
||||
snippet noth "expect not to be hidden (js)"
|
||||
expect(${1:target}).not.toBeHidden();
|
||||
|
||||
snippet notth "expect not to throw (js)"
|
||||
expect(${1:target}).not.toThrow(${2:value});
|
||||
|
||||
snippet notthe "expect not to throw error (js)"
|
||||
expect(${1:target}).not.toThrowError(${2:value});
|
||||
|
||||
snippet s "spy on (js)"
|
||||
spyOn(${1:object}, '${2:method}')$0;
|
||||
|
||||
snippet sr "spy on and return (js)"
|
||||
spyOn(${1:object}, '${2:method}').and.returnValue(${3:arguments});
|
||||
|
||||
snippet st "spy on and throw (js)"
|
||||
spyOn(${1:object}, '${2:method}').and.throwError(${3:exception});
|
||||
|
||||
snippet sct "spy on and call through (js)"
|
||||
spyOn(${1:object}, '${2:method}').and.callThrough();
|
||||
|
||||
snippet scf "spy on and call fake (js)"
|
||||
spyOn(${1:object}, '${2:method}').and.callFake(${3:function});
|
||||
|
||||
snippet ethbc "expect to have been called (js)"
|
||||
expect(${1:target}).toHaveBeenCalled();
|
||||
|
||||
snippet nthbc "expect not to have been called (js)"
|
||||
expect(${1:target}).not.toHaveBeenCalled();
|
||||
|
||||
snippet ethbcw "expect to have been called with (js)"
|
||||
expect(${1:target}).toHaveBeenCalledWith(${2:arguments});
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
snippet des "describe('thing', function() { ... })" b
|
||||
describe('${1:}', function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet it "it('should do', function() { ... })" b
|
||||
it('${1:}', function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet xit "xit('should do', function() { ... })" b
|
||||
xit('${1:}', function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet bef "before(function() { ... })" b
|
||||
before(function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet befe "beforeEach(function() { ... })" b
|
||||
beforeEach(function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet aft "after(function() { ... })" b
|
||||
after(function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet afte "afterEach(function() { ... })" b
|
||||
afterEach(function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet exp "expect(...)" b
|
||||
expect(${1:})${0};
|
||||
snippet expe "expect(...).to.equal(...)" b
|
||||
expect(${1:}).to.equal(${0});
|
||||
snippet expd "expect(...).to.deep.equal(...)" b
|
||||
expect(${1:}).to.deep.equal(${0});
|
|
@ -1,205 +0,0 @@
|
|||
snippet sapmlabel
|
||||
var $1 = new sap.m.Label({
|
||||
design : $2,
|
||||
text : $3,
|
||||
visible : $4,
|
||||
textAlign : $5,
|
||||
textDirection : $6,
|
||||
width : $7,
|
||||
required : $7
|
||||
});
|
||||
|
||||
snippet sapmtext
|
||||
var $1 = new sap.m.Text({
|
||||
text :$2,
|
||||
textDirection :$3,
|
||||
visible :$4,
|
||||
wrapping : $5,
|
||||
textAlign : $6,
|
||||
width :$7,
|
||||
maxLines :$8
|
||||
});
|
||||
|
||||
snippet sapmbutton
|
||||
var $1 = new sap.m.Button({
|
||||
text : $2,
|
||||
type : $3,
|
||||
width : $4,
|
||||
enabled :$5,
|
||||
visible :$6,
|
||||
icon : $7,
|
||||
iconFirst : $8,
|
||||
activeIcon :$9,
|
||||
iconDensityAware : $10,
|
||||
});
|
||||
snippet sapmflexbox
|
||||
var $1 = new sap.m.FlexBox({
|
||||
visible : $2,
|
||||
height : $3,
|
||||
width : $4,
|
||||
displayInline :$5,
|
||||
direction :$6,
|
||||
fitContainer : $7,
|
||||
renderType : $8,
|
||||
justifyContent :$9,
|
||||
alignItems : $10,
|
||||
items:[]
|
||||
});
|
||||
snippet sapmhbox
|
||||
var $1 = new sap.m.HBox({
|
||||
visible : $2,
|
||||
height : $3,
|
||||
width : $4,
|
||||
displayInline :$5,
|
||||
direction :$6,
|
||||
fitContainer : $7,
|
||||
renderType : $8,
|
||||
justifyContent :$9,
|
||||
alignItems : $10,
|
||||
items:[]
|
||||
});
|
||||
|
||||
snippet sapmvbox
|
||||
var $1 = new sap.m.VBox({
|
||||
visible : $2,
|
||||
height : $3,
|
||||
width : $4,
|
||||
displayInline :$5,
|
||||
direction :$6,
|
||||
fitContainer : $7,
|
||||
renderType : $8,
|
||||
justifyContent :$9,
|
||||
alignItems : $10,
|
||||
items:[]
|
||||
});
|
||||
|
||||
snippet sapcomponent
|
||||
sap.ui.controller("$1", {
|
||||
onInit: function(){
|
||||
},
|
||||
onAfterRendering: function() {
|
||||
},
|
||||
onAfterRendering: function() {
|
||||
},
|
||||
onExit: function() {
|
||||
},
|
||||
});
|
||||
|
||||
snippet sapminput
|
||||
var $1 = new sap.m.Input({
|
||||
value :$2,
|
||||
width : $3,
|
||||
enabled :$4,
|
||||
visible :$5,
|
||||
valueState :$6,
|
||||
name : $7,
|
||||
placeholder : $8,
|
||||
editable : $9,
|
||||
type : $10,
|
||||
maxLength :$11,
|
||||
valueStateText :$12,
|
||||
showValueStateMessage :$13,
|
||||
dateFormat :$14,
|
||||
showValueHelp :$15,
|
||||
showSuggestion :$16,
|
||||
valueHelpOnly :$17,
|
||||
filterSuggests :$18,
|
||||
maxSuggestionWidth :$19,
|
||||
startSuggestion : $20,
|
||||
showTableSuggestionValueHelp : $21,
|
||||
description : $22,
|
||||
fieldWidth : $23,
|
||||
valueLiveUpdate :$24,
|
||||
suggestionItems :[$25],
|
||||
suggestionColumns : [$26],
|
||||
suggestionRows : [$27],
|
||||
liveChange : $28,
|
||||
valueHelpRequest :$29,
|
||||
suggest : $30,
|
||||
suggestionItemSelected : $31
|
||||
});
|
||||
snippet _sthis
|
||||
var _self = this;
|
||||
|
||||
snippet sapmresponsivepopup
|
||||
var $1 = new sap.m.ResponsivePopover({
|
||||
placement :$2 ,//sap.m.PlacementType (default: sap.m.PlacementType.Right)
|
||||
showHeader :$3 ,//boolean (default: true)
|
||||
title : $4,//string
|
||||
icon :$5 ,//sap.ui.core.URI
|
||||
modal :$6 ,// boolean
|
||||
offsetX :$7, //int
|
||||
offsetY :$8, //int
|
||||
contentWidth : $9,//sap.ui.core.CSSSize
|
||||
contentHeight :$10, //sap.ui.core.CSSSize
|
||||
horizontalScrolling :$11, //boolean
|
||||
verticalScrolling :$12, //boolean
|
||||
showCloseButton :$13, //boolean (default: true)
|
||||
//Aggregations
|
||||
content :$14, //sap.ui.core.Control[]
|
||||
customHeader :$15, //sap.m.IBar
|
||||
subHeader : $16, //sap.m.IBar
|
||||
beginButton :$17, //sap.m.Button
|
||||
endButton : $18, //sap.m.Button
|
||||
//Associations
|
||||
initialFocus : $19, //string | sap.ui.core.Control
|
||||
//Events
|
||||
beforeOpen :$20, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
|
||||
afterOpen : $21, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
|
||||
beforeClose : $22, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
|
||||
afterClose : $23 //fnList
|
||||
});
|
||||
|
||||
snippet sapicon
|
||||
var $1 = new sap.ui.core.Icon({
|
||||
src :$2 , //sap.ui.core.URI
|
||||
size :$3 , //sap.ui.core.CSSSize
|
||||
color :$4 , //sap.ui.core.CSSColor
|
||||
hoverColor : $5 , // sap.ui.core.CSSColor
|
||||
activeColor :$6 , //sap.ui.core.CSSColor
|
||||
width :$7 , //sap.ui.core.CSSSize
|
||||
height : $8 ,//sap.ui.core.CSSSize
|
||||
backgroundColor :$8 , //sap.ui.core.CSSColor
|
||||
hoverBackgroundColor :$9 , //sap.ui.core.CSSColor
|
||||
activeBackgroundColor :$10 , //sap.ui.core.CSSColor
|
||||
visible :$11 , //boolean (default: true)
|
||||
decorative : $12 ,//boolean (default: true)
|
||||
});
|
||||
snippet extendVerticalL
|
||||
sap.ui.layout.VerticalLayout.extend("$1", {
|
||||
metadata: {
|
||||
properties: {
|
||||
$2
|
||||
},
|
||||
aggregations: {
|
||||
$3
|
||||
},
|
||||
events: {
|
||||
$4
|
||||
}
|
||||
},
|
||||
init: function(){
|
||||
$5
|
||||
},
|
||||
|
||||
renderer: "$6"
|
||||
});
|
||||
snippet extendHorizontalL
|
||||
sap.ui.layout.HorizontalLayout.extend("$1", {
|
||||
metadata: {
|
||||
properties: {
|
||||
$2
|
||||
},
|
||||
aggregations: {
|
||||
$3
|
||||
},
|
||||
events: {
|
||||
$4
|
||||
}
|
||||
},
|
||||
init: function(){
|
||||
$5
|
||||
},
|
||||
|
||||
renderer: "$6"
|
||||
});
|
|
@ -1,589 +0,0 @@
|
|||
snippet add
|
||||
${1:obj}.add('${2:selector expression}')
|
||||
snippet addClass
|
||||
${1:obj}.addClass('${2:class name}')
|
||||
snippet after
|
||||
${1:obj}.after('${2:Some text <b>and bold!</b>}')
|
||||
snippet ajax
|
||||
$.ajax({
|
||||
url: '${1:mydomain.com/url}',
|
||||
type: '${2:POST}',
|
||||
dataType: '${3:xml/html/script/json}',
|
||||
data: $.param( $('${4:Element or Expression}') ),
|
||||
complete: function (jqXHR, textStatus) {
|
||||
${5:// callback}
|
||||
},
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
${6:// success callback}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
${0:// error callback}
|
||||
}
|
||||
});
|
||||
snippet ajaxcomplete
|
||||
${1:obj}.ajaxComplete(function (${1:e}, xhr, settings) {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet ajaxerror
|
||||
${1:obj}.ajaxError(function (${1:e}, xhr, settings, thrownError) {
|
||||
${2:// error callback}
|
||||
});
|
||||
${0}
|
||||
snippet ajaxget
|
||||
$.get('${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
function (data, textStatus, jqXHR) {
|
||||
${0:// success callback}
|
||||
}
|
||||
);
|
||||
snippet ajaxpost
|
||||
$.post('${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
function (data, textStatus, jqXHR) {
|
||||
${0:// success callback}
|
||||
}
|
||||
);
|
||||
snippet ajaxprefilter
|
||||
$.ajaxPrefilter(function (${1:options}, ${2:originalOptions}, jqXHR) {
|
||||
${0: // Modify options, control originalOptions, store jqXHR, etc}
|
||||
});
|
||||
snippet ajaxsend
|
||||
${1:obj}.ajaxSend(function (${1:request, settings}) {
|
||||
${2:// error callback}
|
||||
});
|
||||
${0}
|
||||
snippet ajaxsetup
|
||||
$.ajaxSetup({
|
||||
url: "${1:mydomain.com/url}",
|
||||
type: "${2:POST}",
|
||||
dataType: "${3:xml/html/script/json}",
|
||||
data: $.param( $("${4:Element or Expression}") ),
|
||||
complete: function (jqXHR, textStatus) {
|
||||
${5:// callback}
|
||||
},
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
${6:// success callback}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
${0:// error callback}
|
||||
}
|
||||
});
|
||||
snippet ajaxstart
|
||||
$.ajaxStart(function () {
|
||||
${1:// handler for when an AJAX call is started and no other AJAX calls are in progress};
|
||||
});
|
||||
${0}
|
||||
snippet ajaxstop
|
||||
$.ajaxStop(function () {
|
||||
${1:// handler for when all AJAX calls have been completed};
|
||||
});
|
||||
${0}
|
||||
snippet ajaxsuccess
|
||||
$.ajaxSuccess(function (${1:e}, xhr, settings) {
|
||||
${2:// handler for when any AJAX call is successfully completed};
|
||||
});
|
||||
${0}
|
||||
snippet andself
|
||||
${1:obj}.andSelf()
|
||||
snippet animate
|
||||
${1:obj}.animate({${2:param1: value1, param2: value2}}, ${3:speed})
|
||||
snippet append
|
||||
${1:obj}.append('${2:Some text <b>and bold!</b>}')
|
||||
snippet appendTo
|
||||
${1:obj}.appendTo('${2:selector expression}')
|
||||
snippet attr
|
||||
${1:obj}.attr('${2:attribute}', '${3:value}')
|
||||
snippet attrm
|
||||
${1:obj}.attr({'${2:attr1}': '${3:value1}', '${4:attr2}': '${5:value2}'})
|
||||
snippet before
|
||||
${1:obj}.before('${2:Some text <b>and bold!</b>}')
|
||||
snippet bind
|
||||
${1:obj}.bind('${2:event name}', function (${3:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet blur
|
||||
${1:obj}.blur(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet C
|
||||
$.Callbacks()
|
||||
snippet Cadd
|
||||
${1:callbacks}.add(${2:callbacks})
|
||||
snippet Cdis
|
||||
${1:callbacks}.disable()
|
||||
snippet Cempty
|
||||
${1:callbacks}.empty()
|
||||
snippet Cfire
|
||||
${1:callbacks}.fire(${2:args})
|
||||
snippet Cfired
|
||||
${1:callbacks}.fired()
|
||||
snippet Cfirew
|
||||
${1:callbacks}.fireWith(${2:this}, ${3:args})
|
||||
snippet Chas
|
||||
${1:callbacks}.has(${2:callback})
|
||||
snippet Clock
|
||||
${1:callbacks}.lock()
|
||||
snippet Clocked
|
||||
${1:callbacks}.locked()
|
||||
snippet Crem
|
||||
${1:callbacks}.remove(${2:callbacks})
|
||||
snippet change
|
||||
${1:obj}.change(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet children
|
||||
${1:obj}.children('${2:selector expression}')
|
||||
snippet clearq
|
||||
${1:obj}.clearQueue(${2:'queue name'})
|
||||
snippet click
|
||||
${1:obj}.click(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet clone
|
||||
${1:obj}.clone()
|
||||
snippet contains
|
||||
$.contains(${1:container}, ${0:contents});
|
||||
snippet css
|
||||
${1:obj}.css('${2:attribute}', '${3:value}')
|
||||
snippet csshooks
|
||||
$.cssHooks['${1:CSS prop}'] = {
|
||||
get: function (elem, computed, extra) {
|
||||
${2: // handle getting the CSS property}
|
||||
},
|
||||
set: function (elem, value) {
|
||||
${0: // handle setting the CSS value}
|
||||
}
|
||||
};
|
||||
snippet cssm
|
||||
${1:obj}.css({${2:attribute1}: '${3:value1}', ${4:attribute2}: '${5:value2}'})
|
||||
snippet D
|
||||
$.Deferred()
|
||||
snippet Dalways
|
||||
${1:deferred}.always(${2:callbacks})
|
||||
snippet Ddone
|
||||
${1:deferred}.done(${2:callbacks})
|
||||
snippet Dfail
|
||||
${1:deferred}.fail(${2:callbacks})
|
||||
snippet Disrej
|
||||
${1:deferred}.isRejected()
|
||||
snippet Disres
|
||||
${1:deferred}.isResolved()
|
||||
snippet Dnotify
|
||||
${1:deferred}.notify(${2:args})
|
||||
snippet Dnotifyw
|
||||
${1:deferred}.notifyWith(${2:this}, ${3:args})
|
||||
snippet Dpipe
|
||||
${1:deferred}.then(${2:doneFilter}, ${3:failFilter}, ${4:progressFilter})
|
||||
snippet Dprog
|
||||
${1:deferred}.progress(${2:callbacks})
|
||||
snippet Dprom
|
||||
${1:deferred}.promise(${2:target})
|
||||
snippet Drej
|
||||
${1:deferred}.reject(${2:args})
|
||||
snippet Drejw
|
||||
${1:deferred}.rejectWith(${2:this}, ${3:args})
|
||||
snippet Dres
|
||||
${1:deferred}.resolve(${2:args})
|
||||
snippet Dresw
|
||||
${1:deferred}.resolveWith(${2:this}, ${3:args})
|
||||
snippet Dstate
|
||||
${1:deferred}.state()
|
||||
snippet Dthen
|
||||
${1:deferred}.then(${2:doneCallbacks}, ${3:failCallbacks}, ${4:progressCallbacks})
|
||||
snippet Dwhen
|
||||
$.when(${1:deferreds})
|
||||
snippet data
|
||||
${1:obj}.data(${2:obj})
|
||||
snippet dataa
|
||||
$.data('${1:selector expression}', '${2:key}'${3:, 'value'})
|
||||
snippet dblclick
|
||||
${1:obj}.dblclick(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet delay
|
||||
${1:obj}.delay('${2:slow/400/fast}'${3:, 'queue name'})
|
||||
snippet dele
|
||||
${1:obj}.delegate('${2:selector expression}', '${3:event name}', function (${4:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet deq
|
||||
${1:obj}.dequeue(${2:'queue name'})
|
||||
snippet deqq
|
||||
$.dequeue('${1:selector expression}'${2:, 'queue name'})
|
||||
snippet detach
|
||||
${1:obj}.detach('${2:selector expression}')
|
||||
snippet die
|
||||
${1:obj}.die(${2:event}, ${3:handler})
|
||||
snippet each
|
||||
${1:obj}.each(function (index) {
|
||||
${0:this.innerHTML = this + " is the element, " + index + " is the position";}
|
||||
});
|
||||
snippet el
|
||||
$('<${1}/>'${2:, {}})
|
||||
snippet eltrim
|
||||
$.trim('${1:string}')
|
||||
snippet empty
|
||||
${1:obj}.empty()
|
||||
snippet end
|
||||
${1:obj}.end()
|
||||
snippet eq
|
||||
${1:obj}.eq(${2:element index})
|
||||
snippet error
|
||||
${1:obj}.error(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet eventsmap
|
||||
{
|
||||
:f${0}
|
||||
}
|
||||
snippet extend
|
||||
$.extend(${1:true, }${2:target}, ${3:obj})
|
||||
snippet fadein
|
||||
${1:obj}.fadeIn('${2:slow/400/fast}')
|
||||
snippet fadeinc
|
||||
${1:obj}.fadeIn('slow/400/fast', function () {
|
||||
${0:// callback};
|
||||
});
|
||||
snippet fadeout
|
||||
${1:obj}.fadeOut('${2:slow/400/fast}')
|
||||
snippet fadeoutc
|
||||
${1:obj}.fadeOut('slow/400/fast', function () {
|
||||
${0:// callback};
|
||||
});
|
||||
snippet fadeto
|
||||
${1:obj}.fadeTo('${2:slow/400/fast}', ${3:0.5})
|
||||
snippet fadetoc
|
||||
${1:obj}.fadeTo('slow/400/fast', ${2:0.5}, function () {
|
||||
${0:// callback};
|
||||
});
|
||||
snippet filter
|
||||
${1:obj}.filter('${2:selector expression}')
|
||||
snippet filtert
|
||||
${1:obj}.filter(function (${2:index}) {
|
||||
${3}
|
||||
})
|
||||
snippet find
|
||||
${1:obj}.find('${2:selector expression}')
|
||||
snippet focus
|
||||
${1:obj}.focus(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet focusin
|
||||
${1:obj}.focusIn(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet focusout
|
||||
${1:obj}.focusOut(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet get
|
||||
${1:obj}.get(${2:element index})
|
||||
snippet getjson
|
||||
$.getJSON('${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
function (data, textStatus, jqXHR) {
|
||||
${0:// success callback}
|
||||
}
|
||||
);
|
||||
snippet getscript
|
||||
$.getScript('${1:mydomain.com/url}', function (script, textStatus, jqXHR) {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet grep
|
||||
$.grep(${1:array}, function (item, index) {
|
||||
${2}
|
||||
}${0:, true});
|
||||
snippet hasc
|
||||
${1:obj}.hasClass('${2:className}')
|
||||
snippet hasd
|
||||
$.hasData('${0:selector expression}');
|
||||
snippet height
|
||||
${1:obj}.height(${2:integer})
|
||||
snippet hide
|
||||
${1:obj}.hide('${2:slow/400/fast}')
|
||||
snippet hidec
|
||||
${1:obj}.hide('${2:slow/400/fast}', function () {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet hover
|
||||
${1:obj}.hover(function (${2:e}) {
|
||||
${3:// event handler}
|
||||
}, function ($2) {
|
||||
${4:// event handler}
|
||||
});
|
||||
snippet html
|
||||
${1:obj}.html('${2:Some text <b>and bold!</b>}')
|
||||
snippet inarr
|
||||
$.inArray(${1:value}, ${0:array});
|
||||
snippet insa
|
||||
${1:obj}.insertAfter('${2:selector expression}')
|
||||
snippet insb
|
||||
${1:obj}.insertBefore('${2:selector expression}')
|
||||
snippet is
|
||||
${1:obj}.is('${2:selector expression}')
|
||||
snippet isarr
|
||||
$.isArray(${1:obj})
|
||||
snippet isempty
|
||||
$.isEmptyObject(${1:obj})
|
||||
snippet isfunc
|
||||
$.isFunction(${1:obj})
|
||||
snippet isnum
|
||||
$.isNumeric(${1:value})
|
||||
snippet isobj
|
||||
$.isPlainObject(${1:obj})
|
||||
snippet iswin
|
||||
$.isWindow(${1:obj})
|
||||
snippet isxml
|
||||
$.isXMLDoc(${1:node})
|
||||
snippet jj
|
||||
$('${1:selector}')
|
||||
snippet kdown
|
||||
${1:obj}.keydown(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet kpress
|
||||
${1:obj}.keypress(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet kup
|
||||
${1:obj}.keyup(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet last
|
||||
${1:obj}.last('${1:selector expression}')
|
||||
snippet live
|
||||
${1:obj}.live('${2:events}', function (${3:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet load
|
||||
${1:obj}.load(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet loadf
|
||||
${1:obj}.load('${2:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
function (responseText, textStatus, xhr) {
|
||||
${0:// success callback}
|
||||
}
|
||||
});
|
||||
snippet makearray
|
||||
$.makeArray(${0:obj});
|
||||
snippet map
|
||||
${1:obj}.map(function (${2:index}, ${3:element}) {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet mapp
|
||||
$.map(${1:arrayOrObject}, function (${2:value}, ${3:indexOrKey}) {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet merge
|
||||
$.merge(${1:target}, ${0:original});
|
||||
snippet mdown
|
||||
${1:obj}.mousedown(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet menter
|
||||
${1:obj}.mouseenter(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet mleave
|
||||
${1:obj}.mouseleave(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet mmove
|
||||
${1:obj}.mousemove(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet mout
|
||||
${1:obj}.mouseout(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet mover
|
||||
${1:obj}.mouseover(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet mup
|
||||
${1:obj}.mouseup(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet next
|
||||
${1:obj}.next('${2:selector expression}')
|
||||
snippet nexta
|
||||
${1:obj}.nextAll('${2:selector expression}')
|
||||
snippet nextu
|
||||
${1:obj}.nextUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet not
|
||||
${1:obj}.not('${2:selector expression}')
|
||||
snippet off
|
||||
${1:obj}.off('${2:events}', '${3:selector expression}'${4:, handler})
|
||||
snippet offset
|
||||
${1:obj}.offset()
|
||||
snippet offsetp
|
||||
${1:obj}.offsetParent()
|
||||
snippet on
|
||||
${1:obj}.on('${2:events}', '${3:selector expression}', function (${4:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet one
|
||||
${1:obj}.one('${2:event name}', function (${3:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet outerh
|
||||
${1:obj}.outerHeight()
|
||||
snippet outerw
|
||||
${1:obj}.outerWidth()
|
||||
snippet param
|
||||
$.param(${1:obj})
|
||||
snippet parent
|
||||
${1:obj}.parent('${2:selector expression}')
|
||||
snippet parents
|
||||
${1:obj}.parents('${2:selector expression}')
|
||||
snippet parentsu
|
||||
${1:obj}.parentsUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet parsejson
|
||||
$.parseJSON(${1:data})
|
||||
snippet parsexml
|
||||
$.parseXML(${1:data})
|
||||
snippet pos
|
||||
${1:obj}.position()
|
||||
snippet prepend
|
||||
${1:obj}.prepend('${2:Some text <b>and bold!</b>}')
|
||||
snippet prependto
|
||||
${1:obj}.prependTo('${2:selector expression}')
|
||||
snippet prev
|
||||
${1:obj}.prev('${2:selector expression}')
|
||||
snippet preva
|
||||
${1:obj}.prevAll('${2:selector expression}')
|
||||
snippet prevu
|
||||
${1:obj}.prevUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet promise
|
||||
${1:obj}.promise(${2:'fx'}, ${3:target})
|
||||
snippet prop
|
||||
${1:obj}.prop('${2:property name}')
|
||||
snippet proxy
|
||||
$.proxy(${1:function}, ${2:this})
|
||||
snippet pushstack
|
||||
${1:obj}.pushStack(${2:elements})
|
||||
snippet queue
|
||||
${1:obj}.queue(${2:name}${3:, newQueue})
|
||||
snippet queuee
|
||||
$.queue(${1:element}${2:, name}${3:, newQueue})
|
||||
snippet ready
|
||||
$(function () {
|
||||
${0}
|
||||
});
|
||||
snippet rem
|
||||
${1:obj}.remove()
|
||||
snippet rema
|
||||
${1:obj}.removeAttr('${2:attribute name}')
|
||||
snippet remc
|
||||
${1:obj}.removeClass('${2:class name}')
|
||||
snippet remd
|
||||
${1:obj}.removeData('${2:key name}')
|
||||
snippet remdd
|
||||
$.removeData(${1:element}${2:, 'key name}')
|
||||
snippet remp
|
||||
${1:obj}.removeProp('${2:property name}')
|
||||
snippet repa
|
||||
${1:obj}.replaceAll(${2:target})
|
||||
snippet repw
|
||||
${1:obj}.replaceWith(${2:content})
|
||||
snippet reset
|
||||
${1:obj}.reset(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet resize
|
||||
${1:obj}.resize(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet scroll
|
||||
${1:obj}.scroll(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet scrolll
|
||||
${1:obj}.scrollLeft(${2:value})
|
||||
snippet scrollt
|
||||
${1:obj}.scrollTop(${2:value})
|
||||
snippet sdown
|
||||
${1:obj}.slideDown('${2:slow/400/fast}')
|
||||
snippet sdownc
|
||||
${1:obj}.slideDown('${2:slow/400/fast}', function () {
|
||||
${0:// callback};
|
||||
});
|
||||
snippet select
|
||||
${1:obj}.select(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet serialize
|
||||
${1:obj}.serialize()
|
||||
snippet serializea
|
||||
${1:obj}.serializeArray()
|
||||
snippet show
|
||||
${1:obj}.show('${2:slow/400/fast}')
|
||||
snippet showc
|
||||
${1:obj}.show('${2:slow/400/fast}', function () {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet sib
|
||||
${1:obj}.siblings('${2:selector expression}')
|
||||
snippet size
|
||||
${1:obj}.size()
|
||||
snippet slice
|
||||
${1:obj}.slice(${2:start}${3:, end})
|
||||
snippet stoggle
|
||||
${1:obj}.slideToggle('${2:slow/400/fast}')
|
||||
snippet stop
|
||||
${1:obj}.stop('${2:queue}', ${3:false}, ${4:false})
|
||||
snippet submit
|
||||
${1:obj}.submit(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet sup
|
||||
${1:obj}.slideUp('${2:slow/400/fast}')
|
||||
snippet supc
|
||||
${1:obj}.slideUp('${2:slow/400/fast}', function () {
|
||||
${0:// callback};
|
||||
});
|
||||
snippet text
|
||||
${1:obj}.text(${2:'some text'})
|
||||
snippet this
|
||||
$(this)
|
||||
snippet toarr
|
||||
${0:obj}.toArray()
|
||||
snippet tog
|
||||
${1:obj}.toggle(function (${2:e}) {
|
||||
${3:// event handler}
|
||||
}, function ($2) {
|
||||
${4:// event handler}
|
||||
});
|
||||
${0}
|
||||
snippet togclass
|
||||
${1:obj}.toggleClass('${2:class name}')
|
||||
snippet togsh
|
||||
${1:obj}.toggle('${2:slow/400/fast}')
|
||||
snippet trig
|
||||
${1:obj}.trigger('${2:event name}')
|
||||
snippet trigh
|
||||
${1:obj}.triggerHandler('${2:event name}')
|
||||
snippet $trim
|
||||
$.trim(${1:str})
|
||||
snippet $type
|
||||
$.type(${1:obj})
|
||||
snippet unbind
|
||||
${1:obj}.unbind('${2:event name}')
|
||||
snippet undele
|
||||
${1:obj}.undelegate(${2:selector expression}, ${3:event}, ${4:handler})
|
||||
snippet uniq
|
||||
$.unique(${1:array})
|
||||
snippet unload
|
||||
${1:obj}.unload(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet unwrap
|
||||
${1:obj}.unwrap()
|
||||
snippet val
|
||||
${1:obj}.val('${2:text}')
|
||||
snippet width
|
||||
${1:obj}.width(${2:integer})
|
||||
snippet wrap
|
||||
${1:obj}.wrap('${2:<div class="extra-wrapper"></div>}')
|
|
@ -1,190 +0,0 @@
|
|||
# Import
|
||||
snippet ir import React
|
||||
import React from 'react';
|
||||
|
||||
snippet irc import React and Component
|
||||
import React, { Component } from 'react';
|
||||
|
||||
snippet irh import React hooks
|
||||
import { use$1 } from 'react';
|
||||
|
||||
snippet ird import ReactDOM
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
snippet irp import PropTypes
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
# Lifecycle Methods
|
||||
snippet cdm componentDidMount
|
||||
componentDidMount() {
|
||||
${1}
|
||||
};
|
||||
|
||||
snippet cdup componentDidUpdate
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
${1}
|
||||
};
|
||||
|
||||
snippet cwm componentWillMount
|
||||
componentWillMount() {
|
||||
${1}
|
||||
};
|
||||
|
||||
snippet cwr componentWillReceiveProps
|
||||
componentWillReceiveProps(nextProps) {
|
||||
${1}
|
||||
};
|
||||
|
||||
snippet cwun componentWillUnmount
|
||||
componentWillUnmount() {
|
||||
${1}
|
||||
};
|
||||
|
||||
snippet cwu componentWillUpdate
|
||||
componentWillUpdate(nextProps, nextState) {
|
||||
${1}
|
||||
};
|
||||
|
||||
snippet scu shouldComponentUpdate
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
${1}
|
||||
}
|
||||
|
||||
# Props
|
||||
snippet spt static propTypes
|
||||
static propTypes = {
|
||||
${1}: PropTypes.${2}
|
||||
};
|
||||
|
||||
snippet pt propTypes
|
||||
${1}.propTypes = {
|
||||
${2}: PropTypes.${2}
|
||||
};
|
||||
|
||||
snippet sdp static defaultProps
|
||||
static defaultProps = {
|
||||
${1}: ${2}
|
||||
};
|
||||
|
||||
snippet dp defaultProps
|
||||
${1}.defaultProps = {
|
||||
${2}: ${3}
|
||||
};
|
||||
|
||||
snippet pp props
|
||||
props.${1};
|
||||
|
||||
snippet tp this props
|
||||
this.props.${1};
|
||||
|
||||
# State
|
||||
snippet st
|
||||
state = {
|
||||
${1}: ${2},
|
||||
};
|
||||
|
||||
snippet sst
|
||||
this.setState({
|
||||
${1}: ${2}
|
||||
});
|
||||
|
||||
snippet tst
|
||||
this.state.${1};
|
||||
|
||||
# Component
|
||||
snippet raf
|
||||
const ${1:ComponentName} = (${2:props}) => {
|
||||
${3:state}
|
||||
|
||||
return (
|
||||
<>
|
||||
${4}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
snippet rcla
|
||||
class ${1:ClassName} extends Component {
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
${2}
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
snippet ercla
|
||||
export default class ${1:ClassName} extends Component {
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
${2}
|
||||
</>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
snippet ctor
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
${1:state}
|
||||
}
|
||||
|
||||
snippet ren
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
${2}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
snippet fup
|
||||
forceUpdate(${1:callback});
|
||||
|
||||
# Hooks
|
||||
snippet uses useState
|
||||
const [${1:state}, set${2}] = useState(${3:initialState});
|
||||
|
||||
snippet usee useEffect
|
||||
useEffect(() => {
|
||||
${1}
|
||||
});
|
||||
|
||||
snippet userd useReducer
|
||||
const [${1:state}, ${2:dispatch}] = useReducer(${3:reducer});
|
||||
|
||||
snippet userf useRef
|
||||
const ${1:refContainer} = useRef(${2:initialValue});
|
||||
|
||||
snippet usect useContext
|
||||
const ${1:value} = useContext(${2:MyContext});
|
||||
|
||||
snippet usecb useCallback
|
||||
const ${1:memoizedCallback} = useCallback(
|
||||
() => {
|
||||
${2}(${3})
|
||||
},
|
||||
[$3]
|
||||
);
|
||||
|
||||
snippet usem useMemo
|
||||
const ${1:memoizedCallback} = useMemo(() => ${2}(${3}), [$3]);
|
||||
|
||||
snippet usei useImperativeHandle
|
||||
useImperativeHandle(${1:ref}, ${2:createHandle});
|
||||
|
||||
snippet used useDebugValue
|
||||
useDebugValue(${1:value});
|
||||
|
||||
# ReactDOM methods
|
||||
snippet rdr ReactDOM.render
|
||||
ReactDOM.render(${1}, ${2});
|
||||
|
||||
snippet rdh ReactDOM.hydrate
|
||||
ReactDOM.hydrate(${1:element}, ${2:container}[, ${3:callback}]);
|
||||
|
||||
snippet rdcp ReactDOM.createPortal
|
||||
ReactDOM.createPortal(${1:child}, ${2:container});
|
|
@ -1,37 +0,0 @@
|
|||
snippet ist
|
||||
import { createStore } from 'redux';
|
||||
snippet con
|
||||
connect(${1:mapStateToProps}, ${2:mapDispatchToProps})(<${3:VISUAL}/>);
|
||||
snippet act
|
||||
const ${1:actionName} = (${2:arg}) => {
|
||||
return {
|
||||
type: ${3:VISUAL},
|
||||
$2
|
||||
};
|
||||
};
|
||||
snippet rdc
|
||||
const ${1:reducerName} = (state={}, action) => {
|
||||
switch(action.type) {
|
||||
case ${1:action}:
|
||||
return {
|
||||
...state,
|
||||
$2
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
};
|
||||
};
|
||||
snippet mstp
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
${1:propName}: state.$1,
|
||||
};
|
||||
};
|
||||
snippet mdtp
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
${1:propName}: () => {
|
||||
dispatch(${2:actionName}());
|
||||
},
|
||||
};
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
snippet def
|
||||
define(["${1:#dependencies1}"], function (${2:#dependencies2}) {
|
||||
return ${0:TARGET};
|
||||
});
|
||||
|
||||
snippet defn
|
||||
define("${1:#name}", ["${2:#dependencies1}"], function (${3:#dependencies2}) {
|
||||
return ${0:TARGET};
|
||||
});
|
||||
|
||||
snippet reqjs
|
||||
require(["${1:#dependencies1}"], function (${2:#dependencies2}) {
|
||||
return ${0:TARGET};
|
||||
});
|
|
@ -1,51 +0,0 @@
|
|||
snippet #!
|
||||
#!/usr/bin/env node
|
||||
# module exports
|
||||
snippet ex
|
||||
module.exports = ${1};
|
||||
# require
|
||||
snippet re
|
||||
const ${1} = require('${2:module_name}');
|
||||
# EventEmitter
|
||||
snippet on
|
||||
on('${1:event_name}', function(${2:stream}) {
|
||||
${3}
|
||||
});
|
||||
snippet emit
|
||||
emit('${1:event_name}', ${2:args});
|
||||
snippet once
|
||||
once('${1:event_name}', function(${2:stream}) {
|
||||
${3}
|
||||
});
|
||||
# http. User js function snippet as handler
|
||||
snippet http
|
||||
http.createServer(${1:handler}).listen(${2:port_number});
|
||||
# net
|
||||
snippet net
|
||||
net.createServer(function(${1:socket}){
|
||||
${1}.on('data', function('data'){
|
||||
${2}
|
||||
]});
|
||||
${1}.on('end', function(){
|
||||
${3}
|
||||
});
|
||||
}).listen(${4:8124});
|
||||
# Stream snippets
|
||||
snippet pipe
|
||||
pipe(${1:stream})${2}
|
||||
# Express snippets
|
||||
snippet eget
|
||||
${1:app}.get('${2:route}', ${3:handler});
|
||||
snippet epost
|
||||
${1:app}.post('${2:route}', ${3:handler});
|
||||
snippet eput
|
||||
${1:app}.put('${2:route}', ${3:handler});
|
||||
snippet edel
|
||||
${1:app}.delete('${2:route}', ${3:handler});
|
||||
# process snippets
|
||||
snippet stdin
|
||||
process.stdin
|
||||
snippet stdout
|
||||
process.stdout
|
||||
snippet stderr
|
||||
process.stderr
|
|
@ -1,363 +0,0 @@
|
|||
# Functions
|
||||
# prototype
|
||||
snippet proto
|
||||
${1:class_name}.prototype.${2:method_name} = function(${3}) {
|
||||
${0:${VISUAL}}
|
||||
};
|
||||
# Function
|
||||
snippet fun "function"
|
||||
function ${1:function_name}(${2}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# Asynchronous Function
|
||||
snippet asf "async function"
|
||||
async function ${1:function_name}(${2}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# Anonymous Function
|
||||
snippet anf "" w
|
||||
function(${1}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# Anonymous Function assigned to variable
|
||||
snippet vaf
|
||||
var ${1:function_name} = function(${2}) {
|
||||
${0:${VISUAL}}
|
||||
};
|
||||
# Function assigned to variable
|
||||
snippet vf
|
||||
var ${1:function_name} = function $1(${2}) {
|
||||
${0:${VISUAL}}
|
||||
};
|
||||
# Immediate function
|
||||
snippet (f
|
||||
(function(${1}) {
|
||||
${0:${VISUAL}}
|
||||
}(${2}));
|
||||
# Minify safe iife
|
||||
snippet ;fe
|
||||
;(function(${1}) {
|
||||
${0:${VISUAL}}
|
||||
}(${2}))
|
||||
# self-defining function
|
||||
snippet sdf
|
||||
var ${1:function_name} = function (${2:argument}) {
|
||||
${3}
|
||||
|
||||
$1 = function ($2) {
|
||||
${0:${VISUAL}}
|
||||
};
|
||||
};
|
||||
# Flow control
|
||||
# if
|
||||
snippet if "if (condition) { ... }"
|
||||
if (${1:true}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# if ... else
|
||||
snippet ife "if (condition) { ... } else { ... }"
|
||||
if (${1:true}) {
|
||||
${0:${VISUAL}}
|
||||
} else {
|
||||
${2}
|
||||
}
|
||||
# tertiary conditional
|
||||
snippet ter Ternary: `condition ? true : false`
|
||||
$1 ? $2: $0
|
||||
# switch
|
||||
snippet switch
|
||||
switch (${1:expression}) {
|
||||
case '${3:case}':
|
||||
${4}
|
||||
break;
|
||||
${0}
|
||||
default:
|
||||
${2}
|
||||
}
|
||||
snippet case "case 'xyz': ... break"
|
||||
case '${1:case}':
|
||||
${0:${VISUAL}}
|
||||
break;
|
||||
snippet try "try { ... } catch(e) { ... }"
|
||||
try {
|
||||
${0:${VISUAL}}
|
||||
} catch (${1:e}) {
|
||||
${2:/* handle error */}
|
||||
}
|
||||
snippet tryf "try { ... } catch(e) { ... } finally { ... }"
|
||||
try {
|
||||
${0:${VISUAL}}
|
||||
} catch (${1:e}) {
|
||||
${2:/* handle error */}
|
||||
} finally {
|
||||
${3:/* be executed regardless of the try / catch result*/}
|
||||
}
|
||||
# throw Error
|
||||
snippet terr
|
||||
throw new Error('${1:error message}')
|
||||
# return
|
||||
snippet ret
|
||||
return ${0:result};
|
||||
snippet for "for (...) {...}"
|
||||
for (let ${1:i} = 0, ${2:len} = ${3:Things.length}; $1 < $2; $1++) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet forr "reversed for (...) {...}"
|
||||
for (let ${2:i} = ${1:Things.length} - 1; $2 >= 0; $2--) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet wh "(condition) { ... }"
|
||||
while (${1:true}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet wht "(true) { ... }"
|
||||
while (true) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet do "do { ... } while (condition)"
|
||||
do {
|
||||
${0:${VISUAL}}
|
||||
} while ($1);
|
||||
# For in loop
|
||||
snippet fori
|
||||
for (let ${1:prop} in ${2:object}) {
|
||||
${0:$2[$1]}
|
||||
}
|
||||
# Objects
|
||||
# Object Method
|
||||
snippet :f
|
||||
${1:method_name}: function (${2:attribute}) {
|
||||
${0:${VISUAL}}
|
||||
},
|
||||
# hasOwnProperty
|
||||
snippet has
|
||||
hasOwnProperty(${0})
|
||||
# singleton
|
||||
snippet sing
|
||||
function ${1:Singleton} (${2:argument}) {
|
||||
// the cached instance
|
||||
var instance;
|
||||
|
||||
// rewrite the constructor
|
||||
$1 = function $1($2) {
|
||||
return instance;
|
||||
};
|
||||
|
||||
// carry over the prototype properties
|
||||
$1.prototype = this;
|
||||
|
||||
// the instance
|
||||
instance = new $1();
|
||||
|
||||
// reset the constructor pointer
|
||||
instance.constructor = $1;
|
||||
|
||||
${0}
|
||||
|
||||
return instance;
|
||||
}
|
||||
# Crockford's object function
|
||||
snippet obj
|
||||
function object(o) {
|
||||
function F() {}
|
||||
F.prototype = o;
|
||||
return new F();
|
||||
}
|
||||
# Define multiple properties
|
||||
snippet props
|
||||
var ${1:my_object} = Object.defineProperties(
|
||||
${2:new Object()},
|
||||
{
|
||||
${3:property} : {
|
||||
get : function $1_$3_getter() {
|
||||
// getter code
|
||||
},
|
||||
set : function $1_$3_setter(value) {
|
||||
// setter code
|
||||
},
|
||||
value : ${4:value},
|
||||
writeable : ${5:boolean},
|
||||
enumerable : ${6:boolean},
|
||||
configurable : ${0:boolean}
|
||||
}
|
||||
}
|
||||
);
|
||||
# Define single property
|
||||
snippet prop
|
||||
Object.defineProperty(
|
||||
${1:object},
|
||||
'${2:property}',
|
||||
{
|
||||
get : function $1_$2_getter() {
|
||||
// getter code
|
||||
},
|
||||
set : function $1_$2_setter(value) {
|
||||
// setter code
|
||||
},
|
||||
value : ${3:value},
|
||||
writeable : ${4:boolean},
|
||||
enumerable : ${5:boolean},
|
||||
configurable : ${0:boolean}
|
||||
}
|
||||
);
|
||||
# Documentation
|
||||
# docstring
|
||||
snippet /**
|
||||
/**
|
||||
* ${0:description}
|
||||
*
|
||||
*/
|
||||
snippet @par
|
||||
@param {${1:type}} ${2:name} ${0:description}
|
||||
snippet @ret
|
||||
@return {${1:type}} ${0:description}
|
||||
# JSON.parse
|
||||
snippet jsonp
|
||||
JSON.parse(${0:jstr});
|
||||
# JSON.stringify
|
||||
snippet jsons
|
||||
JSON.stringify(${0:object});
|
||||
# DOM selectors
|
||||
# Get elements
|
||||
snippet get
|
||||
getElementsBy${1:TagName}('${0}')
|
||||
# Get element
|
||||
snippet gett
|
||||
getElementBy${1:Id}('${0}')
|
||||
# Elements by class
|
||||
snippet by.
|
||||
${1:document}.getElementsByClassName('${0:class}')
|
||||
# Element by ID
|
||||
snippet by#
|
||||
${1:document}.getElementById('${0:element ID}')
|
||||
# Query selector
|
||||
snippet qs
|
||||
${1:document}.querySelector('${0:CSS selector}')
|
||||
# Query selector all
|
||||
snippet qsa
|
||||
${1:document}.querySelectorAll('${0:CSS selector}')
|
||||
# Debugging
|
||||
snippet de
|
||||
debugger;
|
||||
snippet cl "console.log"
|
||||
console.log(${0});
|
||||
snippet cd "console.debug"
|
||||
console.debug(${0});
|
||||
snippet ce "console.error"
|
||||
console.error(${0});
|
||||
snippet cw "console.warn"
|
||||
console.warn(${0});
|
||||
snippet ci "console.info"
|
||||
console.info(${0});
|
||||
snippet ct "console.trace"
|
||||
console.trace(${0:label});
|
||||
snippet ctime "console.time ... console.timeEnd"
|
||||
console.time("${1:label}");
|
||||
${0:${VISUAL}}
|
||||
console.timeEnd("$1");
|
||||
snippet ctimestamp "console.timeStamp"
|
||||
console.timeStamp("${1:label}");
|
||||
snippet ca "console.assert"
|
||||
console.assert(${1:expression}, ${0:obj});
|
||||
snippet cclear "console.clear"
|
||||
console.clear();
|
||||
snippet cdir "console.dir"
|
||||
console.dir(${0:obj});
|
||||
snippet cdirx "console.dirxml"
|
||||
console.dirxml(${1:object});
|
||||
snippet cgroup "console.group"
|
||||
console.group("${1:label}");
|
||||
${0:${VISUAL}}
|
||||
console.groupEnd();
|
||||
snippet cgroupc "console.groupCollapsed"
|
||||
console.groupCollapsed("${1:label}");
|
||||
${0:${VISUAL}}
|
||||
console.groupEnd();
|
||||
snippet cprof "console.profile"
|
||||
console.profile("${1:label}");
|
||||
${0:${VISUAL}}
|
||||
console.profileEnd();
|
||||
snippet ctable "console.table"
|
||||
console.table(${1:"${2:value}"});
|
||||
snippet clstr "console.log stringified"
|
||||
console.log(JSON.stringify(${0}, null, 2));
|
||||
# Misc
|
||||
snippet us
|
||||
'use strict';
|
||||
# setTimeout function
|
||||
snippet timeout
|
||||
setTimeout(function () {${0}}${2}, ${1:10});
|
||||
snippet const
|
||||
const ${1} = ${0};
|
||||
snippet constn
|
||||
const ${1} = new ${0};
|
||||
snippet let
|
||||
let ${1} = ${0};
|
||||
snippet im "import xyz from 'xyz'"
|
||||
import ${1} from '${2:$1}';
|
||||
snippet imas "import * as xyz from 'xyz'"
|
||||
import * as ${1} from '${2:$1}';
|
||||
snippet imm "import { member } from 'xyz'"
|
||||
import { ${1} } from '${2}';
|
||||
snippet cla
|
||||
class ${1} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet clax
|
||||
class ${1} extends ${2} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet clac
|
||||
class ${1} {
|
||||
constructor(${2}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
}
|
||||
snippet foro "for (const prop of object}) { ... }"
|
||||
for (const ${1:prop} of ${2:object}) {
|
||||
${0:$1}
|
||||
}
|
||||
snippet forl "for (let prop of object}) { ... }"
|
||||
for (let ${1:prop} of ${2:object}) {
|
||||
${0:$1}
|
||||
}
|
||||
snippet fun*
|
||||
function* ${1:function_name}(${2}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet c=>
|
||||
const ${1:function_name} = (${2}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet ca=>
|
||||
const ${1:function_name} = async (${2}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet caf
|
||||
const ${1:function_name} = (${2}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet casf
|
||||
const ${1:function_name} = async (${2}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet =>
|
||||
(${1}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet af "() =>"
|
||||
(${1}) => ${0:${VISUAL}}
|
||||
snippet afb "() => {}"
|
||||
(${1}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet sym
|
||||
const ${1} = Symbol('${0}');
|
||||
snippet ed
|
||||
export default ${0}
|
||||
snippet ${
|
||||
\${${1}}${0}
|
||||
snippet as "async"
|
||||
async ${0}
|
||||
snippet aw "await"
|
||||
await ${0:${VISUAL}}
|
|
@ -1,64 +0,0 @@
|
|||
snippet if if
|
||||
if ${1}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet ife if ... else
|
||||
if ${1}
|
||||
${2}
|
||||
else
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet el else
|
||||
else
|
||||
${0}
|
||||
|
||||
snippet eif elsif
|
||||
elseif ${1}
|
||||
${0}
|
||||
|
||||
snippet wh while
|
||||
while ${1}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet for for
|
||||
for ${1:i} = ${2:1:n}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet parfor parfor
|
||||
parfor ${1:i} = ${2:1:n}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet fun function
|
||||
function [${3:out}] = ${1:`vim_snippets#Filename("$1", "fun_name")`}(${2})
|
||||
${0}
|
||||
|
||||
snippet try try ... catch
|
||||
try
|
||||
${1}
|
||||
catch ${2:err}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet switch switch
|
||||
switch ${1:n}
|
||||
case ${2:0}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet @ anonymous function
|
||||
@(${1:x}) ${0:x*x}
|
||||
|
||||
snippet cl class
|
||||
classdef ${1:`vim_snippets#Filename("$1", "class_name")`}
|
||||
properties
|
||||
${2}
|
||||
end
|
||||
methods
|
||||
${0}
|
||||
end
|
||||
end
|
|
@ -1,135 +0,0 @@
|
|||
# Org Mode Snippets Imported from (https://github.com/doomemacs/snippets/)
|
||||
# Imported by ybenel (github.com/m1ndo)
|
||||
|
||||
# Begin
|
||||
snippet begin
|
||||
#+begin_${1:type} ${2:options}
|
||||
$0
|
||||
#+end_$1
|
||||
# Begin Center
|
||||
snippet <C
|
||||
#+begin_center
|
||||
$0
|
||||
#+end_center
|
||||
# Begin Comment
|
||||
snippet <c
|
||||
#+begin_comment
|
||||
$0
|
||||
#+end_comment
|
||||
# Begin Example
|
||||
snippet <e
|
||||
#+begin_example
|
||||
$0
|
||||
#+end_example
|
||||
# Begin Export Ascii
|
||||
snippet <a
|
||||
#+begin_export ascii
|
||||
$0
|
||||
#+end_export
|
||||
# Begin export html
|
||||
snippet <h
|
||||
#+begin_export html
|
||||
$0
|
||||
#+end_export
|
||||
# Begin export Latex
|
||||
snippet <l
|
||||
#+begin_export latex
|
||||
$0
|
||||
#+end_export
|
||||
# Begin export python
|
||||
snippet <p
|
||||
#+begin_export python
|
||||
$0
|
||||
#+end_export
|
||||
# Begin export shell
|
||||
snippet <s
|
||||
#+begin_export shell
|
||||
$0
|
||||
#+end_export
|
||||
# dot
|
||||
snippet dot
|
||||
#+begin_src dot :file ${1:file}.${2:svg} :results file graphics
|
||||
$0
|
||||
#+end_src
|
||||
# elisp
|
||||
snippet elisp
|
||||
#+begin_src emacs-lisp :tangle yes
|
||||
$0
|
||||
#+end_src
|
||||
# Entry
|
||||
snippet entry
|
||||
#+begin_html
|
||||
---
|
||||
layout: ${1:default}
|
||||
title: ${2:title}
|
||||
---
|
||||
#+end_html
|
||||
$0
|
||||
# Begin example
|
||||
snippet ex
|
||||
#+begin_example
|
||||
$0
|
||||
#+end_example
|
||||
# Begin export
|
||||
snippet export
|
||||
#+begin_export ${1:type}
|
||||
$0
|
||||
#+end_export
|
||||
# Figure
|
||||
snippet fig
|
||||
#+caption: ${1:caption}
|
||||
#+attr_latex: ${2:scale=0.75}
|
||||
#+name: fig-${3:label}
|
||||
# Org Header
|
||||
snippet head
|
||||
#+title: ${1:untitled document}
|
||||
#+author: ${2:user-full-name}
|
||||
#+email: ${3:user-mail-address}
|
||||
# Image
|
||||
snippet img
|
||||
#+attr_html: :alt $2 :align ${3:left} :class img
|
||||
[[${1:src}]${4:[${5:title}]}]
|
||||
$0
|
||||
# Inline
|
||||
snippet inl
|
||||
src_${1:language}${2:[${3::exports code}]}{${4:code}}
|
||||
# Inline source
|
||||
snippet srci
|
||||
src_${1:language}[${2:header}]{${0:body}}
|
||||
# Jupyter
|
||||
snippet jupyter
|
||||
#+begin_src jupyter-${1:$$(yas-choose-value '("python" "julia" "R"))}${2: :session $3}${4: :async yes}
|
||||
$0
|
||||
#+end_src
|
||||
# Matrix (latex)
|
||||
snippet matrix
|
||||
\left \(
|
||||
\begin{array}{${1:ccc}}
|
||||
${2:v1 & v2} \\
|
||||
$0
|
||||
\end{array}
|
||||
\right \)
|
||||
# Name
|
||||
snippet name
|
||||
#+name: $0
|
||||
# Quote
|
||||
snippet quote
|
||||
#+begin_quote
|
||||
$0
|
||||
#+end_quote
|
||||
# Source
|
||||
snippet src
|
||||
#+begin_src $1
|
||||
$0
|
||||
#+end_src
|
||||
# Todo
|
||||
snippet todo
|
||||
TODO ${1:task description}
|
||||
# Verse
|
||||
snippet verse
|
||||
#+begin_verse
|
||||
$0
|
||||
#+end_verse
|
||||
# Atrribute Width
|
||||
snippet #+attr_html:width
|
||||
#+attr_html: :width ${1:500px}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,44 +0,0 @@
|
|||
extends css
|
||||
|
||||
snippet $
|
||||
$${1:variable}: ${0:value};
|
||||
snippet imp
|
||||
@import '${0}';
|
||||
snippet mix
|
||||
@mixin ${1:name}(${2}) {
|
||||
${0}
|
||||
}
|
||||
snippet inc
|
||||
@include ${1:mixin}(${2});
|
||||
snippet ext
|
||||
@extend ${0};
|
||||
snippet fun
|
||||
@function ${1:name}(${2:args}) {
|
||||
${0}
|
||||
}
|
||||
snippet if
|
||||
@if $1 {
|
||||
${0}
|
||||
}
|
||||
snippet ife
|
||||
@if $1 {
|
||||
${2}
|
||||
} @else {
|
||||
${0}
|
||||
}
|
||||
snippet eif
|
||||
@else if $1 {
|
||||
${0}
|
||||
}
|
||||
snippet for
|
||||
@for ${1:$i} from ${2:1} through ${3:3} {
|
||||
${0}
|
||||
}
|
||||
snippet each
|
||||
@each ${1:$item} in ${2:items} {
|
||||
${0}
|
||||
}
|
||||
snippet while
|
||||
@while ${1:$i} ${2:>} ${3:0} {
|
||||
${0}
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
extends javascript
|
||||
|
||||
snippet tconst "ts const"
|
||||
const ${1}: ${2:any} = ${3};
|
||||
${0}
|
||||
snippet tlet "ts let"
|
||||
let ${1}: ${2:any} = ${3};
|
||||
${0}
|
||||
snippet tvar "ts var"
|
||||
var ${1}: ${2:any} = ${3};
|
||||
${0}
|
||||
snippet + "ts create field"
|
||||
${1}: ${0:any}
|
||||
snippet #+ "ts create private field using #"
|
||||
#${1}: ${0:any}
|
||||
snippet tpfi "ts create public field"
|
||||
public ${1}: ${0:any}
|
||||
snippet tprfi "ts create private field"
|
||||
private ${1}: ${0:any}
|
||||
snippet tprofi "ts create protected field"
|
||||
protected ${1}: ${0:any}
|
||||
snippet int "interface"
|
||||
interface ${1} {
|
||||
${2}: ${3:any};
|
||||
${0}
|
||||
}
|
||||
snippet intx "interface extends"
|
||||
interface ${1} extends ${2} {
|
||||
${3}: ${4:any};
|
||||
${0}
|
||||
}
|
||||
snippet tfun "ts function"
|
||||
function ${1}(${2}): ${3:any} {
|
||||
${0}
|
||||
}
|
||||
snippet tpmet "ts public method"
|
||||
public ${1}(${2}): ${3:any} {
|
||||
${0}
|
||||
}
|
||||
snippet tpsmet "ts public static method"
|
||||
public static ${1}(${2}): ${3:any} {
|
||||
${0}
|
||||
}
|
||||
snippet tprmet "ts private method"
|
||||
private ${1}(${2}): ${3:any} {
|
||||
${0}
|
||||
}
|
||||
snippet tpromet "ts protected method"
|
||||
protected ${1}(${2}): ${3:any} {
|
||||
${0}
|
||||
}
|
||||
snippet tcla "ts class"
|
||||
class ${1} {
|
||||
${2}
|
||||
constructor(public ${3}: ${4: any}) {
|
||||
${5}
|
||||
}
|
||||
${0}
|
||||
}
|
||||
snippet tclax "ts class extends"
|
||||
class ${1} extends ${2} {
|
||||
${3}
|
||||
constructor(public ${4}: ${5: any}) {
|
||||
${6}
|
||||
}
|
||||
${0}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
extends typescript
|
|
@ -1,137 +0,0 @@
|
|||
#
|
||||
## Libraries
|
||||
|
||||
snippet lib
|
||||
library ${1}
|
||||
use $1.${2}
|
||||
|
||||
# Standard Libraries
|
||||
snippet libs
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.ALL;
|
||||
use IEEE.numeric_std.ALL;
|
||||
|
||||
# Xilinx Library
|
||||
snippet libx
|
||||
library UNISIM;
|
||||
use UNISIM.VCOMPONENTS.ALL;
|
||||
|
||||
## Entity Declaration
|
||||
snippet ent
|
||||
entity ${1:`vim_snippets#Filename()`} is
|
||||
generic (
|
||||
${2}
|
||||
);
|
||||
port (
|
||||
${3}
|
||||
);
|
||||
end entity $1;
|
||||
|
||||
## Architecture
|
||||
snippet arc
|
||||
architecture ${1:behav} of ${2:`vim_snippets#Filename()`} is
|
||||
|
||||
${3}
|
||||
|
||||
begin
|
||||
|
||||
|
||||
end $1;
|
||||
|
||||
## Declarations
|
||||
# std_logic
|
||||
snippet st
|
||||
signal ${1} : std_logic;
|
||||
# std_logic_vector
|
||||
snippet sv
|
||||
signal ${1} : std_logic_vector (${2} downto 0);
|
||||
# std_logic in
|
||||
snippet ist
|
||||
${1} : in std_logic;
|
||||
# std_logic_vector in
|
||||
snippet isv
|
||||
${1} : in std_logic_vector (${2} downto 0);
|
||||
# std_logic out
|
||||
snippet ost
|
||||
${1} : out std_logic;
|
||||
# std_logic_vector out
|
||||
snippet osv
|
||||
${1} : out std_logic_vector (${2} downto 0);
|
||||
# unsigned
|
||||
snippet un
|
||||
signal ${1} : unsigned (${2} downto 0);
|
||||
## Process Statements
|
||||
# process
|
||||
snippet pr
|
||||
process (${1})
|
||||
begin
|
||||
${2}
|
||||
end process;
|
||||
# process with clock
|
||||
snippet prc
|
||||
process (${1:clk})
|
||||
begin
|
||||
if rising_edge ($1) then
|
||||
${2}
|
||||
end if;
|
||||
end process;
|
||||
# process with clock and reset
|
||||
snippet prcr
|
||||
process (${1:clk}, ${2:nrst})
|
||||
begin
|
||||
if ($2 = '${3:0}') then
|
||||
${4}
|
||||
elsif rising_edge($1) then
|
||||
${5}
|
||||
end if;
|
||||
end process;
|
||||
# process all
|
||||
snippet pra
|
||||
process (${1:all})
|
||||
begin
|
||||
${2}
|
||||
end process;
|
||||
## Control Statements
|
||||
# if
|
||||
snippet if
|
||||
if ${1} then
|
||||
${2}
|
||||
end if;
|
||||
# if
|
||||
snippet ife
|
||||
if ${1} then
|
||||
${2}
|
||||
else
|
||||
${3}
|
||||
end if;
|
||||
# else
|
||||
snippet el
|
||||
else
|
||||
${1}
|
||||
# if
|
||||
snippet eif
|
||||
elsif ${1} then
|
||||
${2}
|
||||
# case
|
||||
snippet ca
|
||||
case ${1} is
|
||||
${2}
|
||||
end case;
|
||||
# when
|
||||
snippet wh
|
||||
when ${1} =>
|
||||
${2}
|
||||
# for
|
||||
snippet for
|
||||
for ${1:i} in ${2} ${3:to} ${4} loop
|
||||
${5}
|
||||
end loop;
|
||||
# while
|
||||
snippet wh
|
||||
while ${1} loop
|
||||
${2}
|
||||
end loop;
|
||||
## Misc
|
||||
# others
|
||||
snippet oth
|
||||
(others => '${1:0}');
|
|
@ -1,85 +0,0 @@
|
|||
snippet header standard Vim script file header
|
||||
" File: ${1:`expand('%:t')`}
|
||||
" Author: ${2:`g:snips_author`}
|
||||
" Description: ${3}
|
||||
${0:" Last Modified: `strftime("%B %d, %Y")`}
|
||||
snippet guard script reload guard
|
||||
if exists('${1:did_`vim_snippets#Filename()`}') || &cp${2: || version < 700}
|
||||
finish
|
||||
endif
|
||||
let $1 = 1${0}
|
||||
snippet f function
|
||||
fun! ${1:`expand('%') =~ 'autoload' ? substitute(matchstr(expand('%:p'),'autoload/\zs.*\ze.vim'),'[/\\]','#','g').'#' : ''`}${2:function_name}(${3})
|
||||
${0}
|
||||
endf
|
||||
snippet t try ... catch statement
|
||||
try
|
||||
${1:${VISUAL}}
|
||||
catch ${2}
|
||||
${0}
|
||||
endtry
|
||||
snippet for for ... in loop
|
||||
for ${1} in ${2}
|
||||
${0:${VISUAL}}
|
||||
endfor
|
||||
snippet forkv for [key, value] in loop
|
||||
for [${1},${2}] in items(${3})
|
||||
${0}
|
||||
unlet $1 $2
|
||||
endfor
|
||||
snippet wh while loop
|
||||
while ${1}
|
||||
${0:${VISUAL}}
|
||||
endw
|
||||
snippet if if statement
|
||||
if ${1}
|
||||
${0:${VISUAL}}
|
||||
endif
|
||||
snippet ife if ... else statement
|
||||
if ${1}
|
||||
${2:${VISUAL}}
|
||||
else
|
||||
${0}
|
||||
endif
|
||||
snippet au augroup ... autocmd block
|
||||
augroup ${1:AU_NAME}
|
||||
autocmd!
|
||||
autocmd ${2:BufRead,BufNewFile} ${3:*.ext,*.ext3|<buffer[=N]>} ${0}
|
||||
augroup END
|
||||
snippet auv augroupvisual ... autocmd block with visual placeholder
|
||||
augroup ${1:AU_NAME}
|
||||
autocmd!
|
||||
${0:${VISUAL}}
|
||||
augroup END
|
||||
snippet bun Vundle.vim Plugin definition
|
||||
Plugin '${0}'
|
||||
snippet plug vim-plug Plugin definition
|
||||
Plug '${0}'
|
||||
snippet plugdo vim-plug Plugin definition with { 'do': '' }
|
||||
Plug '${1}', { 'do': '${0}' }
|
||||
snippet plugon vim-plug Plugin definition with { 'on': '' }
|
||||
Plug '${1}', { 'on': '${0}' }
|
||||
snippet plugfor vim-plug Plugin definition with { 'for': '' }
|
||||
Plug '${1}', { 'for': '${0}' }
|
||||
snippet plugbr vim-plug Plugin definition with { 'branch': '' }
|
||||
Plug '${1}', { 'branch': '${0}' }
|
||||
snippet plugtag vim-plug Plugin definition with { 'tag': '' }
|
||||
Plug '${1}', { 'tag': '${0}' }
|
||||
snippet let
|
||||
let ${1:variable} = ${0: value}
|
||||
snippet se
|
||||
set ${1:setting};
|
||||
snippet set
|
||||
set ${1:setting} = ${0:value}
|
||||
snippet nn
|
||||
nnoremap ${1} ${2}<CR>
|
||||
snippet no
|
||||
noremap ${1} ${2}
|
||||
snippet vm
|
||||
vmap ${1} ${2}
|
||||
snippet im
|
||||
imap ${1} ${2}
|
||||
snippet exe
|
||||
execute ${1}
|
||||
snippet filename
|
||||
`Filename()`
|
|
@ -10,9 +10,5 @@ dotnet build "$1"
|
|||
clear
|
||||
if [ $# -eq 1 ]; then
|
||||
dotnet run --project "$1"
|
||||
exit 0
|
||||
else
|
||||
dotnet run --project "$1" "$(for i in $(seq 2 $#) ; do
|
||||
printf "%s" "${!i} "
|
||||
done)"
|
||||
fi
|
||||
dotnet run --project "$@"
|
||||
|
|
26
.zsh/.zshrc
26
.zsh/.zshrc
|
@ -1,6 +1,15 @@
|
|||
# ~/.zshrc file for zsh interactive shells.
|
||||
# see /usr/share/doc/zsh/examples/zshrc for examples
|
||||
|
||||
# ALL EDITORS CRINGE!
|
||||
# NEOVIM FOR THE WIN!
|
||||
export EDITOR=nvim
|
||||
alias vim='nvim'
|
||||
alias v='vim .'
|
||||
alias vi='/usr/bin/vim'
|
||||
|
||||
export PF_INFO="ascii title os shell editor pkgs uptime memory"
|
||||
|
||||
/bin/clear
|
||||
echo ""
|
||||
echo -e -n "\x1b[\x35 q"
|
||||
|
@ -107,9 +116,9 @@ configure_prompt() {
|
|||
[ "$EUID" -eq 0 ] && prompt_symbol=💀
|
||||
case "$PROMPT_ALTERNATIVE" in
|
||||
twoline)
|
||||
PROMPT=$'%F{%(#.blue.green)}┌──${debian_chroot:+($debian_chroot)─}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))─}(%B%F{%(#.red.blue)}%n'$prompt_symbol$'%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]\n└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '
|
||||
PROMPT=$'%F{%(#.blue.green)}┌──${debian_chroot:+($debian_chroot)─}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))─}(%B%F{%(#.red.blue)}%n'$prompt_symbol$'%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]\n└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '
|
||||
#PROMPT=$'%F{%(#.blue.green)}┌──${debian_chroot:+($debian_chroot)─}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))─}(%B%F{%(#.red.blue)}%n'$prompt_symbol$'%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]-(%B%F{%(#.red.red)}$(git branch 2>/dev/null | grep "*" | colrm 1 2)%b%F{%(#.blue.green)})\n└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '
|
||||
# Right-side prompt with exit codes and background processes
|
||||
#RPROMPT=$'%(?.. %? %F{red}%B⨯%b%F{reset})%(1j. %j %F{yellow}%B⚙%b%F{reset}.)'
|
||||
;;
|
||||
oneline)
|
||||
PROMPT=$'${debian_chroot:+($debian_chroot)}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))}%B%F{%(#.red.blue)}%n@%m%b%F{reset}:%B%F{%(#.blue.green)}%~%b%F{reset}%(#.#.$) '
|
||||
|
@ -268,29 +277,20 @@ if [ -f /etc/zsh_command_not_found ]; then
|
|||
fi
|
||||
|
||||
|
||||
# ALL EDITORS CRINGE!
|
||||
# NEOVIM FOR THE WIN!
|
||||
export EDITOR=nvim
|
||||
alias vim='nvim'
|
||||
alias v='vim .'
|
||||
|
||||
#alias vim='gnome-terminal --maximize --title "Neovim" -- nvim'
|
||||
|
||||
|
||||
# Custom made alias
|
||||
|
||||
alias zshrc='vim /home/tiagorg/.zsh/.zshrc'
|
||||
|
||||
# improved system commands
|
||||
alias update='yay -Syu --noconfirm && flatpak update -y'
|
||||
alias autoremove='yay -Qqd | yay -Runs - && flatpak uninstall --unused -y'
|
||||
alias autoremove='yay -Qqd | yay -Runs --noconfirm - && flatpak remove --delete-data --unused -y'
|
||||
alias clear='echo "y" > ~/.zsh/.zsh_clear && source ~/.zsh/.zshrc'
|
||||
alias c='clear'
|
||||
alias ref='echo -e -n "\x1b[\x35 q"'
|
||||
alias repos='cd /home/tiagorg/repos/'
|
||||
alias sus='su'
|
||||
alias s='sudo'
|
||||
alias grepf='grep -srniIE'
|
||||
alias grepf='grep -sirnIE'
|
||||
|
||||
# uaveiro-leci repository
|
||||
alias ua='cd /home/tiagorg/repos/uaveiro-leci'
|
||||
|
|
Loading…
Reference in New Issue