├── README.md
├── config
├── default.nix
├── keymappings.nix
├── modules
│ └── plugins
│ │ ├── autopairs.nix
│ │ ├── blink.nix
│ │ ├── bufferline.nix
│ │ ├── cmp.nix
│ │ ├── colorscheme.nix
│ │ ├── comment-box.nix
│ │ ├── comment.nix
│ │ ├── conform.nix
│ │ ├── gitsigns.nix
│ │ ├── icons.nix
│ │ ├── lint.nix
│ │ ├── lsp.nix
│ │ ├── lualine.nix
│ │ ├── lz-n.nix
│ │ ├── markview.nix
│ │ ├── neoscroll.nix
│ │ ├── neotree.nix
│ │ ├── noice.nix
│ │ ├── none-ls.nix
│ │ ├── oil.nix
│ │ ├── schemastore.nix
│ │ ├── telescope.nix
│ │ ├── treesitter.nix
│ │ ├── trouble.nix
│ │ └── trunk.nix
├── options.nix
├── plugins.nix
└── vim-snippets
│ ├── AUTHORS
│ ├── LICENSE
│ ├── UltiSnips
│ ├── README
│ ├── ada.snippets
│ ├── all.snippets
│ ├── bib.snippets
│ ├── bindzone.snippets
│ ├── blade.snippets
│ ├── c.snippets
│ ├── coffee-jasmine.snippets
│ ├── coffee-react.snippets
│ ├── coffee.snippets
│ ├── cpp.snippets
│ ├── crystal.snippets
│ ├── cs.snippets
│ ├── css.snippets
│ ├── cuda.snippets
│ ├── d.snippets
│ ├── django.snippets
│ ├── eelixir.snippets
│ ├── ejs.snippets
│ ├── elm.snippets
│ ├── erlang.snippets
│ ├── eruby.snippets
│ ├── gitcommit.snippets
│ ├── go.snippets
│ ├── haskell.snippets
│ ├── help.snippets
│ ├── html.snippets
│ ├── html_minimal.snippets
│ ├── htmldjango.snippets
│ ├── htmljinja.snippets
│ ├── java.snippets
│ ├── javascript-angular.snippets
│ ├── javascript-ember.snippets
│ ├── javascript-jasmine-arrow.snippets
│ ├── javascript-jsdoc.snippets
│ ├── javascript-node.snippets
│ ├── javascript.snippets
│ ├── javascript_react.snippets
│ ├── jinja2.snippets
│ ├── json.snippets
│ ├── julia.snippets
│ ├── ledger.snippets
│ ├── lhaskell.snippets
│ ├── lua.snippets
│ ├── mako.snippets
│ ├── markdown.snippets
│ ├── matlab.snippets
│ ├── objc.snippets
│ ├── ocaml.snippets
│ ├── octave.snippets
│ ├── pandoc.snippets
│ ├── perl.snippets
│ ├── php-laravel.snippets
│ ├── php-phpspec.snippets
│ ├── php-symfony2.snippets
│ ├── php.snippets
│ ├── plsql.snippets
│ ├── proto.snippets
│ ├── puppet.snippets
│ ├── python.snippets
│ ├── r.snippets
│ ├── rails.snippets
│ ├── rnoweb.snippets
│ ├── robot.snippets
│ ├── rst.snippets
│ ├── ruby.snippets
│ ├── rust.snippets
│ ├── sh.snippets
│ ├── smarty.snippets
│ ├── snippets.snippets
│ ├── soy.snippets
│ ├── supercollider.snippets
│ ├── svelte.snippets
│ ├── tcl.snippets
│ ├── tex.snippets
│ ├── texmath.snippets
│ ├── typescript.snippets
│ ├── typescript_react.snippets
│ ├── vim.snippets
│ ├── vue.snippets
│ ├── xhtml.snippets
│ ├── xml.snippets
│ └── zsh.snippets
│ └── snippets
│ ├── _.snippets
│ ├── actionscript.snippets
│ ├── ada.snippets
│ ├── all.snippets
│ ├── alpaca.snippets
│ ├── apache.snippets
│ ├── arduino.snippets
│ ├── asm.snippets
│ ├── autoit.snippets
│ ├── awk.snippets
│ ├── bash.snippets
│ ├── c.snippets
│ ├── chef.snippets
│ ├── clojure.snippets
│ ├── cmake.snippets
│ ├── codeigniter.snippets
│ ├── coffee
│ ├── angular_coffee.snippets
│ ├── coffee.snippets
│ ├── jquery_coffee.snippets
│ └── requirejs_coffee.snippets
│ ├── cpp.snippets
│ ├── crystal.snippets
│ ├── cs.snippets
│ ├── css.snippets
│ ├── cuda.snippets
│ ├── d.snippets
│ ├── dart-flutter.snippets
│ ├── dart.snippets
│ ├── diff.snippets
│ ├── django.snippets
│ ├── dosini.snippets
│ ├── eelixir.snippets
│ ├── elixir.snippets
│ ├── elm.snippets
│ ├── erlang.snippets
│ ├── eruby.snippets
│ ├── falcon.snippets
│ ├── fortran.snippets
│ ├── freemarker.snippets
│ ├── fsharp.snippets
│ ├── gdscript.snippets
│ ├── gitcommit.snippets
│ ├── gleam.snippets
│ ├── go.snippets
│ ├── haml.snippets
│ ├── handlebars.snippets
│ ├── haskell.snippets
│ ├── heex.snippets
│ ├── helm.snippets
│ ├── html.snippets
│ ├── htmldjango.snippets
│ ├── htmltornado.snippets
│ ├── idris.snippets
│ ├── jade.snippets
│ ├── java.snippets
│ ├── javascript-bemjson.snippets
│ ├── javascript-d3.snippets
│ ├── javascript-jasmine.snippets
│ ├── javascript-mocha.snippets
│ ├── javascript-openui5.snippets
│ ├── javascript
│ ├── javascript-jquery.snippets
│ ├── javascript-react.snippets
│ ├── javascript-redux.snippets
│ ├── javascript-requirejs.snippets
│ ├── javascript.node.snippets
│ └── javascript.snippets
│ ├── jenkins.snippets
│ ├── jinja.snippets
│ ├── jsp.snippets
│ ├── julia.snippets
│ ├── kotlin.snippets
│ ├── laravel.snippets
│ ├── ledger.snippets
│ ├── lfe.snippets
│ ├── liquid.snippets
│ ├── lpc.snippets
│ ├── ls.snippets
│ ├── lua.snippets
│ ├── make.snippets
│ ├── mako.snippets
│ ├── markdown.snippets
│ ├── matlab.snippets
│ ├── mustache.snippets
│ ├── objc.snippets
│ ├── ocaml.snippets
│ ├── octave.snippets
│ ├── openfoam.snippets
│ ├── org.snippets
│ ├── pandoc.snippets
│ ├── perl.snippets
│ ├── perl6.snippets
│ ├── phoenix.snippets
│ ├── php.snippets
│ ├── plsql.snippets
│ ├── po.snippets
│ ├── processing.snippets
│ ├── progress.snippets
│ ├── ps1.snippets
│ ├── puppet.snippets
│ ├── purescript.snippets
│ ├── python.snippets
│ ├── r.snippets
│ ├── racket.snippets
│ ├── rails.snippets
│ ├── reason.snippets
│ ├── rmd.snippets
│ ├── rst.snippets
│ ├── ruby.snippets
│ ├── rust.snippets
│ ├── sass.snippets
│ ├── scala.snippets
│ ├── scheme.snippets
│ ├── scss.snippets
│ ├── sh.snippets
│ ├── simplemvcf.snippets
│ ├── slim.snippets
│ ├── smarty.snippets
│ ├── snippets.snippets
│ ├── sql.snippets
│ ├── stylus.snippets
│ ├── supercollider.snippets
│ ├── svelte.snippets
│ ├── systemverilog.snippets
│ ├── tcl.snippets
│ ├── tex.snippets
│ ├── textile.snippets
│ ├── twig.snippets
│ ├── typescript.snippets
│ ├── typescriptreact.snippets
│ ├── verilog.snippets
│ ├── vhdl.snippets
│ ├── vim.snippets
│ ├── vue.snippets
│ ├── xml.snippets
│ ├── xslt.snippets
│ ├── yii-chtml.snippets
│ ├── yii.snippets
│ └── zsh.snippets
├── flake.lock
└── flake.nix
/README.md:
--------------------------------------------------------------------------------
1 |
Nixvim
2 |
3 | > This repository contains my Neovim configuration, which is declaratively written in Nix.
4 |
5 | **Configuring/editting**
6 |
7 | To start configuring, just add or modify the Nix files in `./config`.
8 |
9 | If you add a new configuration file, remember to add it to the [`config/default.nix`](./config/default.nix) file
10 |
11 | **Testing your new configuration**
12 |
13 | To test your configuration simply run the following command
14 |
15 | ```sh
16 | nix run .
17 | ```
18 |
19 | To test the config without first cloning the repo simply run the following command
20 |
21 | ```sh
22 | nix run github:Ahwxorg/nixvim-config
23 | ```
24 |
25 | **Add to flake:**
26 |
27 | I have the following in flake.nix
28 |
29 | ```nix
30 | {
31 | ....
32 | inputs = {
33 | nixvim.url = "github:ahwxorg/nixvim-config";
34 | }
35 | ....
36 | };
37 | ```
38 |
39 | And then I have a `packages.nix` file that contains:
40 |
41 | ```nix
42 | { inputs, pkgs, ... }:
43 | {
44 | home.packages = with pkgs; [
45 | ...
46 | inputs.nixvim.packages.${pkgs.system}.default
47 | ];
48 | }
49 | ```
50 |
51 | Or you can always [take a look yourself](https://github.com/Ahwxorg/nixos-config)
52 |
53 | ## Credits
54 |
55 | Huge amount of credits to [elythh](https://github.com/elythh/nixvim)! I've ~~taken~~ shamelessly stolen quite a lot of their configuration.
56 |
--------------------------------------------------------------------------------
/config/default.nix:
--------------------------------------------------------------------------------
1 | {
2 | # Import all your configuration modules here
3 | imports = [
4 | # ./plugins.nix
5 | ./options.nix
6 | ./keymappings.nix
7 | ./modules/plugins/autopairs.nix
8 | ./modules/plugins/blink.nix
9 | ./modules/plugins/bufferline.nix
10 | ./modules/plugins/cmp.nix
11 | ./modules/plugins/colorscheme.nix
12 | ./modules/plugins/comment.nix
13 | ./modules/plugins/comment-box.nix
14 | ./modules/plugins/conform.nix
15 | ./modules/plugins/gitsigns.nix
16 | ./modules/plugins/icons.nix
17 | ./modules/plugins/lint.nix
18 | ./modules/plugins/lsp.nix
19 | ./modules/plugins/lualine.nix
20 | ./modules/plugins/lz-n.nix
21 | ./modules/plugins/markview.nix
22 | ./modules/plugins/neoscroll.nix
23 | ./modules/plugins/neotree.nix
24 | ./modules/plugins/noice.nix
25 | ./modules/plugins/none-ls.nix
26 | ./modules/plugins/oil.nix
27 | ./modules/plugins/schemastore.nix
28 | ./modules/plugins/telescope.nix
29 | ./modules/plugins/treesitter.nix
30 | ./modules/plugins/trouble.nix
31 | ./modules/plugins/trunk.nix
32 | ];
33 | }
34 |
--------------------------------------------------------------------------------
/config/keymappings.nix:
--------------------------------------------------------------------------------
1 | {self, ...}: {
2 | keymaps = [
3 | # Neo-tree bindings
4 | {
5 | action = "Neotree toggle";
6 | key = "e";
7 | }
8 |
9 | # Undotree
10 | {
11 | mode = "n";
12 | key = "ut";
13 | action = "UndotreeToggle";
14 | options = {
15 | desc = "Undotree";
16 | };
17 | }
18 |
19 | # Lazygit
20 | {
21 | mode = "n";
22 | key = "gg";
23 | action = "LazyGit";
24 | options = {
25 | desc = "LazyGit (root dir)";
26 | };
27 | }
28 |
29 | # Commentary bindings
30 | {
31 | action = "Commentary";
32 | key = "/";
33 | }
34 |
35 | # Telescope bindings
36 |
37 | {
38 | action = "Telescope live_grep";
39 | key = "fw";
40 | }
41 | {
42 | action = "Telescope find_files";
43 | key = "ff";
44 | }
45 | {
46 | action = "Telescope git_commits";
47 | key = "fg";
48 | }
49 | {
50 | action = "Telescope oldfiles";
51 | key = "fh";
52 | }
53 | {
54 | action = "Telescope colorscheme";
55 | key = "ch";
56 | }
57 | {
58 | action = "Telescope man_pages";
59 | key = "fm";
60 | }
61 |
62 | # Notify bindings
63 |
64 | {
65 | mode = "n";
66 | key = "un";
67 | action = ''
68 | lua require("notify").dismiss({ silent = true, pending = true })
69 | '';
70 | options = {
71 | desc = "Dismiss All Notifications";
72 | };
73 | }
74 |
75 | # Bufferline bindings
76 |
77 | {
78 | mode = "n";
79 | key = "";
80 | action = "BufferLineCycleNext";
81 | options = {
82 | desc = "Cycle to next buffer";
83 | };
84 | }
85 |
86 | {
87 | mode = "n";
88 | key = "";
89 | action = "BufferLineCyclePrev";
90 | options = {
91 | desc = "Cycle to previous buffer";
92 | };
93 | }
94 |
95 | {
96 | mode = "n";
97 | key = "";
98 | action = "BufferLineCycleNext";
99 | options = {
100 | desc = "Cycle to next buffer";
101 | };
102 | }
103 |
104 | {
105 | mode = "n";
106 | key = "";
107 | action = "BufferLineCyclePrev";
108 | options = {
109 | desc = "Cycle to previous buffer";
110 | };
111 | }
112 |
113 | {
114 | mode = "n";
115 | key = "bd";
116 | action = "bdelete";
117 | options = {
118 | desc = "Delete buffer";
119 | };
120 | }
121 | ];
122 | }
123 |
--------------------------------------------------------------------------------
/config/modules/plugins/autopairs.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.nvim-autopairs.enable = true;
3 | }
4 |
--------------------------------------------------------------------------------
/config/modules/plugins/bufferline.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.bufferline.enable = true;
3 | }
4 |
--------------------------------------------------------------------------------
/config/modules/plugins/colorscheme.nix:
--------------------------------------------------------------------------------
1 | {
2 | colorschemes = {
3 | # modus.enable = true;
4 | # rose-pine.enable = true;
5 | oxocarbon.enable = true;
6 | };
7 | }
8 |
--------------------------------------------------------------------------------
/config/modules/plugins/comment-box.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.comment-box = {
3 | enable = true;
4 | };
5 | }
6 |
--------------------------------------------------------------------------------
/config/modules/plugins/comment.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.commentary = {
3 | enable = true;
4 | };
5 | }
6 |
--------------------------------------------------------------------------------
/config/modules/plugins/conform.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }: {
2 | extraPackages = with pkgs; [ shfmt ];
3 | plugins.conform-nvim = {
4 | enable = true;
5 | settings = {
6 | format_on_save = {
7 | lspFallback = true;
8 | timeoutMs = 500;
9 | };
10 | notify_on_error = true;
11 | formatters_by_ft = {
12 | html = [ [ "prettierd" "prettier" ] ];
13 | css = [ [ "prettierd" "prettier" ] ];
14 | javascript = [ [ "prettierd" "prettier" ] ];
15 | javascriptreact = [ [ "prettierd" "prettier" ] ];
16 | typescript = [ [ "prettierd" "prettier" ] ];
17 | typescriptreact = [ [ "prettierd" "prettier" ] ];
18 | python = [ "black" ];
19 | lua = [ "stylua" ];
20 | nix = [ "nixfmt" ];
21 | markdown = [ [ "prettierd" "prettier" ] ];
22 | yaml = [ "yamllint" "yamlfmt" ];
23 | terragrunt = [ "hcl" ];
24 | bash = [ "shfmt" ];
25 | sh = [ "shfmt" ];
26 | };
27 | };
28 | };
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/config/modules/plugins/gitsigns.nix:
--------------------------------------------------------------------------------
1 | { ... }:
2 | {
3 | plugins.gitsigns = {
4 | enable = true;
5 | settings = {
6 | current_line_blame = true;
7 | current_line_blame_formatter = " , • ";
8 | };
9 | };
10 | }
11 |
--------------------------------------------------------------------------------
/config/modules/plugins/icons.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.web-devicons.enable = true;
3 | }
4 |
--------------------------------------------------------------------------------
/config/modules/plugins/lint.nix:
--------------------------------------------------------------------------------
1 | { lib, pkgs, config, ... }: {
2 | plugins = {
3 | lint = {
4 | enable = true;
5 | lintersByFt = {
6 | bash = [ "shellcheck" ];
7 | json = [ "jsonlint" ];
8 | markdown = [ "vale" ];
9 | go = [ "golangcilint" ];
10 | dockerfile = [ "hadolint" ];
11 | lua = [ "luacheck" ];
12 | nix = [ "deadnix" "nix" ] ++ lib.optionals (!config.plugins.lsp.servers.statix.enable) [ "statix" ];
13 | python = [ "pylint" ];
14 | sh = [ "shellcheck" ];
15 | yaml = [ "yamllint" ];
16 | };
17 |
18 | linters = {
19 | deadnix = {
20 | cmd = lib.getExe pkgs.deadnix;
21 | };
22 | golangcilint = {
23 | cmd = lib.getExe pkgs.golangci-lint;
24 | };
25 | jsonlint = {
26 | cmd = lib.getExe pkgs.nodePackages.jsonlint;
27 | };
28 | luacheck = {
29 | cmd = lib.getExe pkgs.luaPackages.luacheck;
30 | };
31 | # markdownlint = {
32 | # cmd = lib.getExe pkgs.markdownlint-cli;
33 | # };
34 | pylint = {
35 | cmd = lib.getExe pkgs.pylint;
36 | };
37 | shellcheck = {
38 | cmd = lib.getExe pkgs.shellcheck;
39 | };
40 | statix = {
41 | cmd = lib.getExe pkgs.statix;
42 | };
43 | yamllint = {
44 | cmd = lib.getExe pkgs.yamllint;
45 | };
46 | };
47 | };
48 | };
49 | }
50 |
--------------------------------------------------------------------------------
/config/modules/plugins/lualine.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.lualine = {
3 | enable = true;
4 | };
5 | }
6 |
--------------------------------------------------------------------------------
/config/modules/plugins/lz-n.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.lz-n.enable = true;
3 | }
4 |
--------------------------------------------------------------------------------
/config/modules/plugins/markview.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.markview = {
3 | enable = true;
4 | };
5 | }
6 |
--------------------------------------------------------------------------------
/config/modules/plugins/neoscroll.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.neoscroll.enable = true;
3 | }
4 |
--------------------------------------------------------------------------------
/config/modules/plugins/neotree.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.neo-tree = {
3 | enable = true;
4 | enableDiagnostics = true;
5 | enableGitStatus = true;
6 | enableModifiedMarkers = true;
7 | enableRefreshOnWrite = true;
8 | closeIfLastWindow = true;
9 | popupBorderStyle = "rounded"; # Type: null or one of “NC”, “double”, “none”, “rounded”, “shadow”, “single”, “solid” or raw lua code
10 | buffers = {
11 | bindToCwd = false;
12 | followCurrentFile = {
13 | enabled = true;
14 | };
15 | };
16 | window = {
17 | width = 40;
18 | height = 15;
19 | autoExpandWidth = false;
20 | mappings = {
21 | "" = "none";
22 | };
23 | };
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/config/modules/plugins/noice.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.noice = {
3 | enable = true;
4 | };
5 | }
6 |
--------------------------------------------------------------------------------
/config/modules/plugins/none-ls.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | {
3 | plugins.none-ls = {
4 | enable = true;
5 | enableLspFormat = true;
6 | settings = {
7 | updateInInsert = false;
8 | };
9 | sources = {
10 | code_actions = {
11 | gitsigns.enable = true;
12 | statix.enable = true;
13 | };
14 | diagnostics = {
15 | statix.enable = true;
16 | yamllint.enable = true;
17 | };
18 | formatting = {
19 | nixfmt = {
20 | enable = true;
21 | package = pkgs.nixfmt-rfc-style;
22 | };
23 | black = {
24 | enable = true;
25 | settings = ''
26 | {
27 | extra_args = { "--fast" },
28 | }
29 | '';
30 | };
31 | prettier = {
32 | enable = true;
33 | disableTsServerFormatter = true;
34 | settings = ''
35 | {
36 | extra_args = { "--no-semi" },
37 | }
38 | '';
39 | };
40 | stylua.enable = true;
41 | yamlfmt = {
42 | enable = true;
43 | };
44 | hclfmt.enable = true;
45 | };
46 | };
47 | };
48 | keymaps = [
49 | {
50 | mode = [
51 | "n"
52 | "v"
53 | ];
54 | key = "cf";
55 | action = "lua vim.lsp.buf.format()";
56 | options = {
57 | silent = true;
58 | desc = "Format";
59 | };
60 | }
61 | ];
62 | }
63 |
--------------------------------------------------------------------------------
/config/modules/plugins/oil.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.oil.enable = true;
3 | }
4 |
--------------------------------------------------------------------------------
/config/modules/plugins/schemastore.nix:
--------------------------------------------------------------------------------
1 | {
2 | plugins.schemastore = {
3 | enable = true;
4 | yaml.enable = true;
5 | json.enable = false;
6 | };
7 | }
8 |
--------------------------------------------------------------------------------
/config/modules/plugins/telescope.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }: {
2 | plugins.telescope = {
3 | enable = true;
4 | extensions = {
5 | fzf-native = {
6 | enable = true;
7 | };
8 | };
9 | settings = {
10 | defaults = {
11 | vimgrep_arguments = [ "${pkgs.ripgrep}/bin/rg" "-L" "--color=never" "--no-heading" "--with-filename" "--line-number" "--column" "--smart-case" "--fixed-strings" ];
12 | selection_caret = " ";
13 | entry_prefix = " ";
14 | layout_strategy = "flex";
15 | layout_config = {
16 | horizontal = {
17 | prompt_position = "top";
18 | };
19 | };
20 | sorting_strategy = "ascending";
21 | file_ignore_patterns = [ "^.git/" "^.mypy_cache/" "^__pycache__/" "^output/" "^data/" "%.ipynb" ];
22 | set_env.COLORTERM = "truecolor";
23 | };
24 |
25 | pickers = {
26 | colorscheme = {
27 | enable_preview = true;
28 | };
29 | };
30 | };
31 | };
32 |
33 | extraPackages = with pkgs; [ ripgrep ];
34 | }
35 |
--------------------------------------------------------------------------------
/config/modules/plugins/treesitter.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }: {
2 | plugins = {
3 | treesitter = {
4 | enable = true;
5 |
6 | settings = {
7 | indent = {
8 | enable = true;
9 | };
10 | highlight = {
11 | enable = true;
12 | };
13 | };
14 |
15 | nixvimInjections = true;
16 | grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars;
17 | };
18 |
19 | treesitter-context = {
20 | enable = false;
21 | };
22 |
23 | treesitter-textobjects = {
24 | enable = true;
25 | select = {
26 | enable = true;
27 | lookahead = true;
28 | };
29 | };
30 | };
31 | extraConfigLua = ''
32 | local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
33 | '';
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/config/modules/plugins/trouble.nix:
--------------------------------------------------------------------------------
1 | { lib, config, ... }: {
2 | plugins.trouble = {
3 | enable = true;
4 | };
5 | keymaps = lib.mkIf config.plugins.trouble.enable [
6 | {
7 | mode = "n";
8 | key = "xx";
9 | action = "Trouble diagnostics toggle";
10 | options = {
11 | desc = "Trouble diagnostics toggle";
12 | };
13 | }
14 | {
15 | mode = "n";
16 | key = "[c";
17 | action = ":lua require('trouble').next {skip_groups = true, jump = true }";
18 | options = {
19 | desc = "Trouble next";
20 | };
21 | }
22 | {
23 | mode = "n";
24 | key = "]c";
25 | action = ":lua require('trouble').prev {skip_groups = true, jump = true }";
26 | options = {
27 | desc = "Trouble prev";
28 | };
29 | }
30 | ];
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/config/modules/plugins/trunk.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | let
3 | pname = "neovim-trunk";
4 | version = "v0.1.3";
5 | in
6 | {
7 | extraPlugins = with pkgs.vimUtils; [
8 | (buildVimPlugin {
9 | inherit pname version;
10 | src = pkgs.fetchFromGitHub {
11 | owner = "trunk-io";
12 | repo = "neovim-trunk";
13 | rev = "refs/tags/${version}";
14 | hash = "sha256-xfGK1wlpq1aELMdcEQMvJTWJUyEryPuxyywEUYugjc8=";
15 | };
16 | })
17 | ];
18 | }
19 |
--------------------------------------------------------------------------------
/config/options.nix:
--------------------------------------------------------------------------------
1 | { self, ... }:
2 | {
3 | globalOpts = {
4 | # Line numbers
5 | number = true;
6 | relativenumber = true;
7 |
8 | # Enable more colors (24-bit)
9 | termguicolors = true;
10 |
11 | # Have a better completion experience
12 | completeopt = [
13 | "menuone"
14 | "noselect"
15 | "noinsert"
16 | ];
17 |
18 | # Always show the signcolumn, otherwise text would be shifted when displaying error icons
19 | signcolumn = "yes";
20 |
21 | # Enable mouse
22 | mouse = "a";
23 |
24 | # Search
25 | ignorecase = true;
26 | smartcase = true;
27 |
28 | # Configure how new splits should be opened
29 | splitright = true;
30 | splitbelow = true;
31 |
32 | list = true;
33 | # NOTE: .__raw here means that this field is raw lua code
34 | listchars.__raw = "{ tab = '» ', trail = '·', nbsp = '␣' }";
35 |
36 | expandtab = true;
37 | # tabstop = 4;
38 | shiftwidth = 2;
39 | # softtabstop = 0;
40 | # smarttab = true;
41 |
42 | # System clipboard support, needs xclip/wl-clipboard
43 | clipboard = {
44 | providers.wl-copy.enable = true; # Use wl-copy for wayland and xsel for Xorg
45 | register = "unnamedplus";
46 | };
47 |
48 | # Set encoding
49 | encoding = "utf-8";
50 | fileencoding = "utf-8";
51 |
52 | # Save undo history
53 | undofile = true;
54 | swapfile = true;
55 | backup = false;
56 | autoread = true;
57 |
58 | # Highlight the current line for cursor
59 | cursorline = true;
60 |
61 | # Show line and column when searching
62 | ruler = true;
63 |
64 | # Global substitution by default
65 | gdefault = true;
66 |
67 | # Start scrolling when the cursor is X lines away from the top/bottom
68 | scrolloff = 5;
69 | };
70 |
71 | diagnostics = {
72 | update_in_insert = true;
73 | severity_sort = true;
74 | float = {
75 | border = "rounded";
76 | };
77 | jump = {
78 | severity.__raw = "vim.diagnostic.severity.WARN";
79 | };
80 | };
81 |
82 | userCommands = {
83 | Q.command = "q";
84 | Q.bang = true;
85 | Wq.command = "q";
86 | Wq.bang = true;
87 | WQ.command = "q";
88 | WQ.bang = true;
89 | W.command = "q";
90 | W.bang = true;
91 | };
92 |
93 | globals.mapleader = " ";
94 |
95 | autoCmd = [
96 | {
97 | event = [ "VimEnter" ];
98 | callback = {
99 | __raw = "function() if vim.fn.argv(0) == '' then require('telescope.builtin').find_files() end end";
100 | };
101 | }
102 | ];
103 | #autoCmd = [
104 | # {
105 | # event = [ "BufEnter" "BufWinEnter" ];
106 | # pattern = [ "*.md" "*.mdx" ];
107 | # command = "MarkdownPreviewToggle";
108 | # }
109 | #];
110 |
111 | highlight = {
112 | Comment.fg = "#ff00ff";
113 | Comment.bg = "#000000";
114 | Comment.underline = true;
115 | Comment.bold = true;
116 | };
117 | }
118 |
--------------------------------------------------------------------------------
/config/vim-snippets/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 see AUTHORS
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7 | of the Software, and to permit persons to whom the Software is furnished to do
8 | so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/README:
--------------------------------------------------------------------------------
1 | This directory contains the snippets for UltiSnips.
2 | https://github.com/sirver/ultisnips
3 |
4 | Standing On The Shoulders of Giants
5 | ===================================
6 |
7 | The snippets have been collected from various other project which I want to
8 | express my gratitude for. My main source for inspiration where the following
9 | two projects:
10 |
11 | TextMate: http://svn.textmate.org/trunk/Bundles/
12 | SnipMate: http://code.google.com/p/snipmate/
13 |
14 | UltiSnips has seen contributions by many individuals. Those contributions have
15 | been merged into this collection seamlessly and without further comments.
16 |
17 | -- vim:ft=rst:nospell:
18 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/bib.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet online "Online resource" b
4 | @online{${1:name},
5 | author={${2:author}},
6 | title={${3:title}},
7 | date={${4:date}},
8 | url={${5:url}}
9 | }
10 | $0
11 | endsnippet
12 |
13 | snippet article "Article reference" b
14 | @article{${1:name},
15 | author={${2:author}},
16 | title={${3:title}},
17 | journaltitle={${4:journal}},
18 | volume={${5:NN}},
19 | number={${6:NN}},
20 | year={${7:YYYY}},
21 | pages={${8:NN}--${9:NN}}
22 | }
23 | $0
24 | endsnippet
25 |
26 | snippet book "Book reference" b
27 | @book{${1:name},
28 | author={${2:author}},
29 | title={${3:title}},
30 | subtitle={${4:subtitle}},
31 | year={${5:YYYY}},
32 | location={${6:somewhere}},
33 | publisher={${7:publisher}},
34 | pages={${8:NN}--${9:NN}}
35 | }
36 | $0
37 | endsnippet
38 |
39 | snippet inb "In Book reference" b
40 | @inbook{${1:name},
41 | author={${2:author}},
42 | title={${3:title}},
43 | subtitle={${4:subtitle}},
44 | booktitle={${5:book}},
45 | editor={${6:editor}},
46 | year={${7:YYYY}},
47 | location={${8:somewhere}},
48 | publisher={${9:publisher}},
49 | pages={${10:NN}--${11:NN}}
50 | }
51 | $0
52 | endsnippet
53 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/bindzone.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | global !p
4 | def newsoa():
5 | import datetime
6 | now = datetime.datetime.now()
7 | # return standard SOA formatted serial for today
8 | return now.strftime("%Y%m%d00")
9 | endglobal
10 |
11 | snippet zone "Bootstrap a new Bind zonefile" b
12 | $TTL 86400
13 | @ IN SOA ${1:example.net}. ${2:hostmaster.$1}.(
14 | `!p snip.rv = newsoa()`; serial
15 | 21600; refresh every 6 hours
16 | 3600; retry after one hour
17 | 604800; expire after a week
18 | 86400 ); minimum TTL of 1 day
19 |
20 | IN NS ns01.$1.
21 | IN MX 10 mail.$1.
22 |
23 | ns01.$1 IN A
24 | mail.$1 IN A
25 | endsnippet
26 |
27 | snippet A "Insert A Record" b
28 | ${1:hostname} IN A ${2:ip}
29 | endsnippet
30 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/blade.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | extends html
4 |
5 | # We want to overwrite everything in parent ft.
6 | priority -49
7 |
8 | snippet break "@break"
9 | @break
10 | endsnippet
11 |
12 | snippet component "@component directive"
13 | @component('$1')
14 | ${2:${VISUAL}}
15 | @endcomponent
16 | endsnippet
17 |
18 | snippet each "@each directive"
19 | @each('$1', $$2, '$3')
20 | endsnippet
21 |
22 | snippet else "@else directive"
23 | @else
24 | endsnippet
25 |
26 | snippet eif "@else if directive"
27 | @else if ($1)
28 | ${2:${VISUAL}}
29 | endsnippet
30 |
31 | snippet for "@for directive"
32 | @for ($1)
33 | ${2:${VISUAL}}
34 | @endfor
35 | endsnippet
36 |
37 | snippet foreach "@foreach directive"
38 | @foreach ($$1 as $$2)
39 | ${3:${VISUAL}}
40 | @endforeach
41 | endsnippet
42 |
43 | snippet extends "@extends directive"
44 | @extends('$1')
45 | endsnippet
46 |
47 | snippet if "@if directive"
48 | @if ($1)
49 | ${2:${VISUAL}}
50 | @endif
51 | endsnippet
52 |
53 | snippet ife "@if @else structure"
54 | @if ($1)
55 | ${2:${VISUAL}}
56 | @else
57 | ${3:${VISUAL}}
58 | @endif
59 | endsnippet
60 |
61 | snippet include "@include directive"
62 | @include('$1')
63 | endsnippet
64 |
65 | snippet includeIf "@includeIf directive"
66 | @includeIf('$1')
67 | endsnippet
68 |
69 | snippet isset "@isset directive"
70 | @isset
71 | ${1:${VISUAL}}
72 | @endisset
73 | endsnippet
74 |
75 | snippet inject "@inject directive"
76 | @inject('$1', '$2')
77 | endsnippet
78 |
79 | snippet lang "@lang directive" i
80 | @lang('$1')
81 | endsnippet
82 |
83 | snippet php "@php directive"
84 | @php
85 | ${1:${VISUAL}}
86 | @endphp
87 | endsnippet
88 |
89 | snippet push "@push directive"
90 | @push('$1')
91 | ${2:${VISUAL}}
92 | @endpush
93 | endsnippet
94 |
95 | snippet section "@section directive"
96 | @section('$1')
97 | endsnippet
98 |
99 | snippet show "@show directive"
100 | @show
101 | endsnippet
102 |
103 | snippet slot "@slot directive"
104 | @slot('$1')
105 | ${2:${VISUAL}}
106 | @endslot
107 | endsnippet
108 |
109 | snippet unless "@unless directive"
110 | @unless
111 | ${1:${VISUAL}}
112 | @endunless
113 | endsnippet
114 |
115 | snippet verbatim "@verbatim directive"
116 | @verbatim
117 | ${0:$VISUAL}
118 | @endverbatim
119 | endsnippet
120 |
121 | snippet wh "@while directive"
122 | @while ($1)
123 | ${2:${VISUAL}}
124 | @endwhile
125 | endsnippet
126 |
127 | snippet yield "@yield directive"
128 | @yield('$1')
129 | endsnippet
130 |
131 | snippet { "{{ }} statement." i
132 | {{ $1 }}
133 | endsnippet
134 |
135 | snippet {! "{!! !!} statement" i
136 | {!! $1 !!}
137 | endsnippet
138 |
139 | # vim:ft=snippets:
140 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/coffee-react.snippets:
--------------------------------------------------------------------------------
1 | #
2 | # CoffeeScript versions -- adapted from coffee-jasmine
3 | # for some ReactJS matchers.
4 | #
5 | priority -50
6 |
7 | extends coffee
8 |
9 | priority -49
10 |
11 | snippet createClass "React define Class" b
12 | ${1:classname}Class = React.createClass
13 | displayName: "$1"
14 | render: ->
15 | $2
16 | $1 = React.createFactory($1)
17 | endsnippet
18 |
19 | snippet PropTypes "React define propTypes" b
20 | propTypes: ->
21 | ${1:myVar}: React.PropTypes.${2:type}${3:.isRequired}
22 | endsnippet
23 |
24 | snippet propType "React propType (key/value)" b
25 | ${1:myVar}: React.PropTypes.${2:type}${3:.isRequired}
26 | $4
27 | endsnippet
28 |
29 | snippet setState "React setState" b
30 | @setState
31 | ${1:myvar}: ${2:myvalue}
32 | $3
33 | endsnippet
34 |
35 | snippet getInitialState "React define getInitialState" b
36 | getInitialState: ->
37 | ${1:myvar}: ${2:myvalue}
38 | $3
39 | endsnippet
40 |
41 | snippet getDefaultProps "React define getDefaultProps" b
42 | getDefaultProps: ->
43 | ${1:myvar}: ${2:myvalue}
44 | $3
45 | endsnippet
46 |
47 | snippet componentWillMount "React define componentWillMount" b
48 | componentWillMount: ->
49 | $1
50 | endsnippet
51 |
52 | snippet componentDidMount "React define componentDidMount" b
53 | componentDidMount: ->
54 | $1
55 | endsnippet
56 |
57 | snippet componentWillReceiveProps "React define componentWillReceiveProps" b
58 | componentWillReceiveProps: (nextProps) ->
59 | $1
60 | endsnippet
61 |
62 | snippet shouldComponentUpdate "React define shouldComponentUpdate" b
63 | shouldComponentUpdate: (nextProps, nextState) ->
64 | $1
65 | endsnippet
66 |
67 | snippet componentWillUpdate "React define componentWillUpdate" b
68 | componentWillUpdate: (nextProps, nextState) ->
69 | $1
70 | endsnippet
71 |
72 | snippet componentDidUpdate "React define componentDidUpdate" b
73 | componentDidUpdate: (prevProps, prevState) ->
74 | $1
75 | endsnippet
76 |
77 | snippet componentWillUnmount "React define componentWillUnmount" b
78 | componentWillUnmount: ->
79 | $1
80 | endsnippet
81 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/coffee.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet fun "Function" b
4 | ${1:name} = `!p snip.rv = "(" if t[2] else ""`${2:args}`!p snip.rv = ") " if t[2] else ""`->
5 | ${0:# body...}
6 | endsnippet
7 |
8 | snippet bfun "Function (bound)" i
9 | `!p snip.rv = "(" if t[1] else ""`${1:args}`!p snip.rv = ") " if t[1] else ""`=>`!p snip.rv = " " if t[2] and not t[2].startswith("\n") else ""`${2:expr}
10 | endsnippet
11 |
12 | snippet if "If" b
13 | if ${1:condition}
14 | ${0:# body...}
15 | endsnippet
16 |
17 | snippet ife "If .. Else" b
18 | if ${1:condition}
19 | ${2:# body...}
20 | else
21 | ${3:# body...}
22 | endsnippet
23 |
24 | snippet elif "Else if" b
25 | else if ${1:condition}
26 | ${0:# body...}
27 | endsnippet
28 |
29 | snippet ifte "Ternary if" b
30 | if ${1:condition} then ${2:value} else ${3:other}
31 | endsnippet
32 |
33 | snippet unl "Unless" b
34 | ${1:action} unless ${2:condition}
35 | endsnippet
36 |
37 | snippet fora "Array Comprehension" b
38 | for ${1:name} in ${2:array}
39 | ${0:# body...}
40 | endsnippet
41 |
42 | snippet foro "Object Comprehension" b
43 | for ${1:key}, ${2:value} of ${3:Object}
44 | ${0:# body...}
45 | endsnippet
46 |
47 | snippet forr "Range Comprehension (inclusive)" b
48 | for ${1:name} in [${2:start}..${3:finish}]`!p snip.rv = " by " if t[4] else ""`${4:step}
49 | ${0:# body...}
50 | endsnippet
51 |
52 | snippet forrex "Range Comprehension (exclusive)" b
53 | for ${1:name} in [${2:start}...${3:finish}]`!p snip.rv = " by " if t[4] else ""`${4:step}
54 | ${0:# body...}
55 | endsnippet
56 |
57 | snippet swi "Switch" b
58 | switch ${1:object}
59 | when ${2:value}
60 | ${3:# body...}
61 | else
62 | $0
63 | endsnippet
64 |
65 | snippet swit "Switch when .. then" b
66 | switch ${1:object}
67 | when ${2:condition}`!p snip.rv = " then " if t[3] else ""`${3:value}
68 | else`!p snip.rv = " " if t[4] and not t[4].startswith("\n") else ""`${4:value}
69 | endsnippet
70 |
71 | snippet cla "Class" b
72 | class ${1:ClassName}`!p snip.rv = " extends " if t[2] else ""`${2:Ancestor}
73 |
74 | ${3:constructor:`!p snip.rv = " (" if t[4] else ""`${4:args}`!p snip.rv = ")" if t[4] else ""` ->
75 | ${5:# body...}}
76 | $0
77 | endsnippet
78 |
79 | snippet try "Try .. Catch" b
80 | try
81 | $1
82 | catch ${2:error}
83 | $3
84 | endsnippet
85 |
86 | snippet req "Require" b
87 | ${1/^'?(\w+)'?$/\L$1\E/} = require(${1:'${2:sys}'})
88 | endsnippet
89 |
90 | snippet # "Interpolated Code" i
91 | #{$1}$0
92 | endsnippet
93 |
94 | snippet log "Log" b
95 | console.log ${1:"${2:msg}"}
96 | endsnippet
97 |
98 | snippet kv "Key:value for object" b
99 | ${1:key}:${2:value}
100 | endsnippet
101 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/crystal.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet "\b(de)?f" "def ..." r
4 | def ${1:method_name}${2:(${3:*args})}
5 | $0
6 | end
7 | endsnippet
8 |
9 | snippet "\b(pde)?f" "private def ..." r
10 | private def ${1:method_name}${2:(${3:*args})}
11 | $0
12 | end
13 | endsnippet
14 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/cuda.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | extends cpp
4 |
5 | # vim:ft=snippets:
6 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/eelixir.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | extends html
4 |
5 | snippet % "<% %>" w
6 | <% $0 %>
7 | endsnippet
8 |
9 | snippet = "<%= %>" w
10 | <%= $0 %>
11 | endsnippet
12 |
13 | snippet end "<% end %>" w
14 | <% end %>
15 | endsnippet
16 |
17 | snippet for
18 | <%= for ${1:item} <- ${2:$1s} ${3:@conn} do %>
19 | $0
20 | <% end %>
21 | endsnippet
22 |
23 | snippet ft "form_tag" w
24 | <%= form_tag(${1:"${2:/users}"}, method: ${3::post}) %>
25 | $0
26 |
27 | endsnippet
28 |
29 | snippet lin "link" w
30 | <%= link ${1:"${2:Submit}"}, to: ${3:"${4:/users}"}, method: ${5::delete} %>
31 | endsnippet
32 |
33 | snippet ff "form_for" w
34 | <%= form_for @changeset, ${1:"${2:/users}"}, fn f -> %>
35 | $0
36 |
37 | <%= submit "Submit" %>
38 | <% end %>
39 | endsnippet
40 |
41 | snippet gt "gettext" w
42 | <%= gettext("${0:${VISUAL}}") %>
43 | endsnippet
44 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/ejs.snippets:
--------------------------------------------------------------------------------
1 | snippet for "ejs for loop" b
2 | <% for (let ${1:i = 0}; ${2:i
3 | ${0:body}
4 | <% } %>
5 | endsnippet
6 | snippet forE "ejs for Each loop" b
7 | <% ${1:array}.forEach((${2:single var}) => { %>
8 | ${0:body}
9 | <% }) %>
10 | endsnippet
11 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/elm.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet impa "Qualified import"
4 | import ${1:Json.Encode} as ${0:`!p snip.rv = t[1].split(".")[-1]`}
5 | endsnippet
6 |
7 | snippet impae "Qualified import with exposing"
8 | import ${1:Json.Encode} as ${2:`!p snip.rv = t[1].split(".")[-1]`} exposing (${0:Value})
9 | endsnippet
10 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/erlang.snippets:
--------------------------------------------------------------------------------
1 | ###########################################################################
2 | # TEXTMATE SNIPPETS #
3 | ###########################################################################
4 |
5 | priority -50
6 |
7 | snippet pat "Case:Receive:Try Clause"
8 | ${1:pattern}${2: when ${3:guard}} ->
9 | ${4:body}
10 | endsnippet
11 |
12 | snippet mod "Module Directive" b
13 | -module(${1:`!p snip.rv = snip.basename or "module"`}).
14 | endsnippet
15 |
16 | snippet || "List Comprehension"
17 | [${1:X} || ${2:X} <- ${3:List}${4:, gen}]
18 | endsnippet
19 |
20 | snippet gen "Generator Expression"
21 | ${1:X} <- ${2:List}${3:, gen}
22 | endsnippet
23 |
24 | # vim:ft=snippets:
25 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/gitcommit.snippets:
--------------------------------------------------------------------------------
1 | global !p
2 | def complete(t, opts):
3 | if t:
4 | opts = [ m[len(t):] for m in opts if m.startswith(t) ]
5 | if len(opts) == 1:
6 | return opts[0]
7 | return '(' + '|'.join(opts) + ')'
8 | endglobal
9 |
10 | snippet status "Status" bA
11 | status $1`!p snip.rv = complete(t[1], ['build', 'ci', 'test', 'refactor', 'perf', 'improvement', 'docs', 'chore', 'feat', 'fix'])`
12 | endsnippet
13 |
14 | snippet fix "fix conventional commit"
15 | fix(${1:scope}): ${2:title}
16 |
17 | ${0:${VISUAL}}
18 | endsnippet
19 |
20 | snippet feat "feat conventional commit"
21 | feat(${1:scope}): ${2:title}
22 |
23 | ${0:${VISUAL}}
24 | endsnippet
25 |
26 | snippet chore "chore conventional commit"
27 | chore(${1:scope}): ${2:title}
28 |
29 | ${0:${VISUAL}}
30 | endsnippet
31 |
32 | snippet docs "docs conventional commit"
33 | docs(${1:scope}): ${2:title}
34 |
35 | ${0:${VISUAL}}
36 | endsnippet
37 |
38 | snippet improvement "improvement conventional commit"
39 | improvement(${1:scope}): ${2:title}
40 |
41 | ${0:${VISUAL}}
42 | endsnippet
43 |
44 | snippet perf "perf conventional commit"
45 | perf(${1:scope}): ${2:title}
46 |
47 | ${0:${VISUAL}}
48 | endsnippet
49 |
50 | snippet refactor "refactor conventional commit"
51 | refactor(${1:scope}): ${2:title}
52 |
53 | ${0:${VISUAL}}
54 | endsnippet
55 |
56 | snippet test "test conventional commit"
57 | test(${1:scope}): ${2:title}
58 |
59 | ${0:${VISUAL}}
60 | endsnippet
61 |
62 | snippet ci "ci conventional commit"
63 | ci(${1:scope}): ${2:title}
64 |
65 | ${0:${VISUAL}}
66 | endsnippet
67 |
68 | snippet build "build conventional commit"
69 | build(${1:scope}): ${2:title}
70 |
71 | ${0:${VISUAL}}
72 | endsnippet
73 |
74 | snippet Co-authored-by "Co-authored-by:"
75 | Co-authored-by: ${1:Author Name} <${2:Email}>
76 | endsnippet
77 |
78 | snippet sign "Signature"
79 | -------------------------------------------------------------------------------
80 | ${1:Company Name}
81 |
82 | ${2:Author Name}
83 |
84 | ${3:Streetname 21}
85 | ${4:City and Area}
86 |
87 | ${5:Tel: +44 (0)987 / 888 8888}
88 | ${6:Fax: +44 (0)987 / 888 8882}
89 | ${7:Mail: Email}
90 | ${8:Web: https://}
91 | -------------------------------------------------------------------------------
92 | $0
93 | endsnippet
94 |
95 | snippet t "Todo"
96 | TODO: ${1:What is it} (`date "+%b %d %Y %a (%H:%M:%S)"`, `echo $USER`)
97 | $0
98 | endsnippet
99 |
100 | snippet cmt "Commit Structure" bA
101 | ${1:Summarize changes in around 50 characters or less}
102 |
103 | ${2:More detailed explanatory text, if necessary. Wrap it to about 72
104 | characters or so. In some contexts, the first line is treated as the
105 | subject of the commit and the rest of the text as the body. The
106 | blank line separating the summary from the body is critical (unless
107 | you omit the body entirely); various tools like `log`, `shortlog`
108 | and `rebase` can get confused if you run the two together.}
109 |
110 | ${3:Explain the problem that this commit is solving. Focus on why you
111 | are making this change as opposed to how (the code explains that).
112 | Are there side effects or other unintuitive consequences of this
113 | change? Here's the place to explain them.}
114 |
115 | ${4:Further paragraphs come after blank lines.
116 |
117 | - Bullet points are okay, too
118 |
119 | - Typically a hyphen or asterisk is used for the bullet, preceded
120 | by a single space, with blank lines in between, but conventions
121 | vary here}
122 |
123 | ${5:Status}
124 |
125 | ${6:If you use an issue tracker, put references to them at the bottom,
126 | like this.}
127 |
128 | ${7:Any todos}
129 |
130 | ${8:Resolves: #123
131 | See also: #456, #789}
132 |
133 | ${9:Signature}
134 | endsnippet
135 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/go.snippets:
--------------------------------------------------------------------------------
1 | # Snippets for Go
2 |
3 | priority -50
4 |
5 | # when to abbriviate and when not?
6 | # b doesn't work here, because it ignores whitespace
7 | # optional local name?
8 | snippet /^import/ "Import declaration" r
9 | import (
10 | "${1:package}"
11 | )
12 | endsnippet
13 |
14 | snippet /^package/ "Package declaration" r
15 | // Package $1 provides ...
16 | package ${1:main}
17 | endsnippet
18 |
19 | # Mostly converted from: https://github.com/AlanQuatermain/go-tmbundle
20 | snippet /^cons/ "Constants declaration" r
21 | const (
22 | ${1:constant}${2/(.+)/ /}${2:type} = ${0:value}
23 | )
24 | endsnippet
25 |
26 | snippet /^con/ "Constant declaration" r
27 | const ${1:name}${2/(.+)/ /}${2:type} = ${0:value}
28 | endsnippet
29 |
30 | snippet iota "Iota constant generator" b
31 | const (
32 | ${1:constant}${2/(.+)/ /}${2:type} = iota
33 | )
34 | endsnippet
35 |
36 | snippet struct "Struct declaration" b
37 | type ${1:Struct} struct {
38 | ${0:${VISUAL}}
39 | }
40 | endsnippet
41 |
42 | snippet interface "Interface declaration" b
43 | type ${1:Interface} interface {
44 | ${0:${VISUAL}}
45 | }
46 | endsnippet
47 |
48 | snippet if "If statement" b
49 | if ${1:condition}${1/(.+)/ /}{
50 | ${0:${VISUAL}}
51 | }
52 | endsnippet
53 |
54 | snippet switch "Switch statement" b
55 | switch ${1:expression}${1/(.+)/ /}{
56 | case$0
57 | }
58 | endsnippet
59 |
60 | # functions
61 | snippet /^main/ "Main function" r
62 | func main() {
63 | ${0:${VISUAL}}
64 | }
65 | endsnippet
66 |
67 | snippet /^meth/ "Method" r
68 | func (${1:receiver} ${2:type}) ${3:name}(${4:params})${5/(.+)/ /}${5:type} {
69 | ${0:${VISUAL}}
70 | }
71 | endsnippet
72 |
73 | snippet func "Function" b
74 | func ${1:name}(${2:params})${3/(.+)/ /}${3:type} {
75 | ${0:${VISUAL}}
76 | }
77 | endsnippet
78 |
79 | snippet funch "HTTP handler" b
80 | func ${1:handler}(${2:w} http.ResponseWriter, ${3:r} *http.Request) {
81 | ${0:${VISUAL}}
82 | }
83 | endsnippet
84 |
85 | # types and variables
86 | snippet map "Map type" b
87 | map[${1:keytype}]${2:valtype}
88 | endsnippet
89 |
90 | snippet : "Variable declaration :=" b
91 | ${1:name} := ${0:value}
92 | endsnippet
93 |
94 | snippet var "Variable declaration" b
95 | var ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value}}
96 | endsnippet
97 |
98 | snippet vars "Variables declaration" b
99 | var (
100 | ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value} }
101 | )
102 | endsnippet
103 |
104 | snippet json "JSON field"
105 | \`json:"${1:displayName}"\`
106 | endsnippet
107 |
108 | # vim:ft=snippets:
109 |
110 | # error handling
111 | snippet err "Basic error handling" b
112 | if err != nil {
113 | log.${1:Fatal}(err)
114 | }
115 | endsnippet
116 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/haskell.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet imp "Simple import"
4 | import ${1:${2:Data}.${0:Text}}
5 | endsnippet
6 |
7 | snippet imp2 "Selective import" b
8 | import ${1:${2:Data}.${3:Text}} (${4})${0}
9 | endsnippet
10 |
11 | snippet impq "Qualified import"
12 | import qualified ${1:${2:Data}.${3:Text}} as ${0:`!p snip.rv = t[1].split(".")[-1]`}
13 | endsnippet
14 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/help.snippets:
--------------------------------------------------------------------------------
1 | # Snippets for VIM Help Files
2 |
3 | priority -50
4 |
5 | global !p
6 | def sec_title(snip, t):
7 | file_start = snip.fn.split('.')[0]
8 | sec_name = t[1].strip("1234567890. ").lower().replace(' ', '-')
9 | return ("*%s-%s*" % (file_start, sec_name)).rjust(78-len(t[1]))
10 | endglobal
11 |
12 | snippet sec "Section marker" b
13 | ==============================================================================
14 | ${1:SECTION}`!p snip.rv = sec_title(snip, t)`
15 |
16 | $0
17 | endsnippet
18 |
19 | snippet ssec "Sub section marker" b
20 | ${1:Subsection}`!p snip.rv = sec_title(snip, t)
21 | snip += "-"*len(t[1])`
22 |
23 | $0
24 | endsnippet
25 |
26 | snippet sssec "Subsub Section marker" b
27 | ${1:SubSubsection}:`!p snip.rv = sec_title(snip, t)`
28 |
29 | $0
30 | endsnippet
31 |
32 | # For vim help, follow the same settings as the official docs.
33 | snippet modeline "Vim help modeline"
34 | `!v 'vim'`:tw=78:ts=8:ft=help:norl:
35 | endsnippet
36 |
37 | # vim:ft=snippets:
38 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/html_minimal.snippets:
--------------------------------------------------------------------------------
1 | # more can be found in snippets/html_minimal.snippets
2 | # these UltiSnips override snippets because nested placeholders are being used
3 |
4 | priority -49
5 |
6 | snippet id
7 | id="$1"$2
8 | endsnippet
9 |
10 | snippet idn
11 | id="$1" name="${2:$1}"
12 | endsnippet
13 |
14 | snippet label_and_input
15 |
16 | $8
17 | endsnippet
18 |
19 | snippet input
20 | $7
21 | endsnippet
22 |
23 | snippet submit
24 | $7
25 | endsnippet
26 |
27 | snippet textarea
28 |
29 | endsnippet
30 |
31 | snippet img
32 |
33 | endsnippet
34 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/htmljinja.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | extends html, jinja2
4 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/javascript-angular.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet iti "it (js, inject)" b
4 | it('${1:description}', inject(function($2) {
5 | $0
6 | }));
7 | endsnippet
8 |
9 | snippet befi "before each (js, inject)" b
10 | beforeEach(inject(function($1) {
11 | $0
12 | }));
13 | endsnippet
14 |
15 | snippet aconf "angular config" i
16 | config(function($1) {
17 | $0
18 | });
19 | endsnippet
20 |
21 | snippet acont "angular controller" i
22 | controller('${1:name}', [$2function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
23 | $0
24 | }]);
25 | endsnippet
26 |
27 | snippet aconts "angular controller with scope" i
28 | controller('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
29 | $0
30 | }]);
31 | endsnippet
32 |
33 | snippet adir "angular directive" i
34 | directive('$1', [$2function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
35 | return {
36 | restrict: '${3:EA}',
37 | link: function(scope, element, attrs) {
38 | $0
39 | }
40 | };
41 | }]);
42 | endsnippet
43 |
44 | snippet adirs "angular directive with scope" i
45 | directive('$1', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
46 | return {
47 | restrict: '${3:EA}',
48 | link: function(scope, element, attrs) {
49 | $0
50 | }
51 | };
52 | }]);
53 | endsnippet
54 |
55 | snippet afact "angular factory" i
56 | factory('${1:name}', [$2function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
57 | $0
58 | }]);
59 | endsnippet
60 |
61 | snippet afacts "angular factory with scope" i
62 | factory('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
63 | $0
64 | }]);
65 | endsnippet
66 |
67 | snippet aserv "angular service" i
68 | service('${1:name}', [$2function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
69 | $0
70 | }]);
71 | endsnippet
72 |
73 | snippet aservs "angular service" i
74 | service('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
75 | $0
76 | }]);
77 | endsnippet
78 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/javascript-ember.snippets:
--------------------------------------------------------------------------------
1 | ###################################################################
2 | # Ember snippets #
3 | ###################################################################
4 |
5 | priority -50
6 |
7 | # Application
8 | snippet eapp "App.Name = Ember.Application.create({});"
9 | import Application from '@ember/application';
10 |
11 | export default Application.extend({
12 | ${0://Properties here...}
13 | });
14 | endsnippet
15 |
16 | # Models
17 | snippet emod "import DS from 'ember-data';"
18 | import DS from 'ember-data';
19 |
20 | export default DS.Model.extend({
21 | ${0://Properties here...}
22 | });
23 | endsnippet
24 |
25 | # Controller
26 | snippet econtroller "import Controller from '@ember/controller';"
27 | import Controller from '@ember/controller';
28 |
29 | export default Controller.extend({
30 | ${0://Properties here...}
31 | });
32 | endsnippet
33 |
34 | # Route
35 | snippet eroute "import Route from '@ember/routing/route';"
36 | import Route from '@ember/routing/route';
37 |
38 | export default Route.extend({
39 | ${0://Properties here...}
40 | });
41 | endsnippet
42 |
43 | # Component
44 | snippet ecomponent "import Component from '@ember/component';"
45 | import Component from '@ember/component';
46 |
47 | export default Component.extend({
48 | ${0://Properties here...}
49 | });
50 | endsnippet
51 |
52 | # Object
53 | snippet eobj "import EmberObject from '@ember/object';"
54 | import EmberObject from '@ember/object';
55 |
56 | export default EmberObject.extend({
57 | ${0://Properties here...}
58 | });
59 | endsnippet
60 |
61 | # Mixin
62 | snippet emix "App.MixinName = Ember.Model.extend({...});"
63 | import Mixin from '@ember/object/mixin';
64 |
65 | export default Mixin.create({
66 | ${0://Properties here...}
67 | });
68 | endsnippet
69 |
70 | # Ember getter and setter
71 | snippet eget "this.get('property');"
72 | ${1:this}.get('${2:property}');
73 | endsnippet
74 |
75 | snippet eset "this.set('property', value);"
76 | ${1:this}.set('${2:property}', ${3:value});
77 | endsnippet
78 |
79 | # Computed properties
80 | snippet cproimport "import { computed } from '@ember/object';"
81 | import { computed } from '@ember/object';
82 | endsnippet
83 |
84 | snippet cpro "property_name: computed('...', function() {...}),"
85 | ${1:property_name}: computed('${3:argument}', function() {
86 | ${0://body...}
87 | }),
88 | endsnippet
89 |
90 | # Observers
91 | snippet prooimport "import { observer } from '@ember/object';"
92 | import { observer } from '@ember/object';
93 | endsnippet
94 |
95 | snippet proo "property_name: observer('...', function() {...}),"
96 | ${1:property_name}: observer('${3:argument}', function() {
97 | ${0://body...}
98 | }),
99 | endsnippet
100 |
101 | # vim:ft=snippets:
102 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/javascript-jasmine-arrow.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | # JavaScript versions -- from the TextMate bundle + some additions
4 | # for jasmine-jquery matchers
5 | #
6 |
7 | snippet des "Describe (js)" b
8 | describe('${1:description}', () => {
9 | $0
10 | });
11 | endsnippet
12 |
13 | snippet it "it (js)" b
14 | it('${1:description}', () => {
15 | $0
16 | });
17 | endsnippet
18 |
19 | snippet bef "before each (js)" b
20 | beforeEach(() => {
21 | $0
22 | });
23 | endsnippet
24 |
25 | snippet aft "after each (js)" b
26 | afterEach(() => {
27 | $0
28 | });
29 | endsnippet
30 |
31 | snippet befa "before all (js)" b
32 | beforeAll(() => {
33 | $0
34 | });
35 | endsnippet
36 |
37 | snippet afta "after all (js)" b
38 | afterAll(() => {
39 | $0
40 | });
41 | endsnippet
42 |
43 | snippet ru "runs (js)" b
44 | runs(() => {
45 | $0
46 | });
47 | endsnippet
48 |
49 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/javascript-jsdoc.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | # JSDoc snippets
4 |
5 | snippet /* "A JSDoc comment" b
6 | /**
7 | * ${1:${VISUAL}}$0
8 | */
9 | endsnippet
10 |
11 | snippet @au "@author email (First Last)"
12 | @author ${1:`!v g:snips_author`} [${2:`!v g:snips_author_email`}]
13 | endsnippet
14 |
15 | snippet @li "@license Description"
16 | @license ${1:MIT}$0
17 | endsnippet
18 |
19 | snippet @ver "@version Semantic version"
20 | @version ${1:0.1.0}$0
21 | endsnippet
22 |
23 | snippet @fileo "@fileoverview Description" b
24 | /**
25 | * @fileoverview ${1:${VISUAL:A description of the file}}$0
26 | */
27 | endsnippet
28 |
29 | snippet @constr "@constructor"
30 | @constructor
31 | endsnippet
32 |
33 | snippet @p "@param {Type} varname Description"
34 | @param {${1:Type}} ${2:varname} ${3:Description}
35 | endsnippet
36 |
37 | snippet @ret "@return {Type} Description"
38 | @return {${1:Type}} ${2:Description}
39 | endsnippet
40 |
41 | snippet @pri "@private"
42 | @private
43 | endsnippet
44 |
45 | snippet @over "@override"
46 | @override
47 | endsnippet
48 |
49 | snippet @pro "@protected"
50 | @protected
51 | endsnippet
52 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/javascript-node.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet #! "#!/usr/bin/env node" b
4 | #!/usr/bin/env node
5 | endsnippet
6 |
7 | snippet vreq "assign a CommonJS-style module to a var"
8 | var ${0:${1/(.+\/)*(\w+)(-|\b|$)(\..+$)?/\u$2/g}} = require('$1');
9 | endsnippet
10 |
11 | snippet ex "module.exports"
12 | module.exports = $1;
13 | endsnippet
14 |
15 | snippet hcs "http.createServer"
16 | http.createServer($1).listen($2);
17 | endsnippet
18 |
19 | snippet ncs "net.createServer"
20 | net.createServer(function(${1:socket}){
21 | $1.on('data', function(${3:data}){
22 | $4
23 | });
24 | $1.on('end', function(){
25 | $5
26 | });
27 | }).listen(${6:8124});
28 | endsnippet
29 |
30 | snippet pipe "pipe"
31 | pipe(${1:stream})$2
32 | endsnippet
33 |
34 | # Express snippets
35 |
36 | snippet eget "express GET"
37 | ${1:app}.get('$2', $3);
38 | endsnippet
39 |
40 | snippet epost "express POST"
41 | ${1:app}.post('$2', $3);
42 | endsnippet
43 |
44 | snippet eput "express PUT"
45 | ${1:app}.put('$2', $3);
46 | endsnippet
47 |
48 | snippet edelete "express DELETE"
49 | ${1:app}.delete('$2', $3);
50 | endsnippet
51 |
52 | # process snippets
53 |
54 | snippet stdout "stdout"
55 | process.stdout
56 | endsnippet
57 |
58 | snippet stdin "stdin"
59 | process.stdin
60 | endsnippet
61 |
62 | snippet stderr "stderr"
63 | process.stderr
64 | endsnippet
65 |
66 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/javascript_react.snippets:
--------------------------------------------------------------------------------
1 | global !p
2 | # Capitalize the first letter without affecting the rest of the letters
3 | def capitalize_first(word):
4 | if(word):
5 | word = word[0].upper() + word[1:]
6 | return word
7 | endglobal
8 |
9 | # Functional components
10 | snippet rfc "react functional component" b
11 | import React, {useState} from "react"
12 |
13 | function ${1:`!p snip.rv = snip.basename`}(${2}){
14 | return(
15 |
18 | )
19 | }
20 |
21 | export default $4`!p snip.rv = snip.basename`
22 | endsnippet
23 | # React Hooks
24 | snippet useS "useState Hook" b
25 | const [${1}, set`!p snip.rv=capitalize_first(t[1])`] = useState(${3:"${4}"})
26 | endsnippet
27 | snippet useE "useEffect Hook" b
28 | useEffect(() => {
29 | ${1:${0}}
30 | }${2})
31 | endsnippet
32 | snippet useC "useContext Hook" b
33 | const ${1:context} = useContext(${2})
34 | endsnippet
35 | snippet useRe "useReducer Hook" b
36 | const [${3:state}, ${4:dispatch}] = useReducer(${5:reducer}, ${2:initial_value})
37 | endsnippet
38 | snippet useCB "useCallback(fn, inputs)" b
39 | const ${1:callback} = useCallback((${2})) => ${3:{
40 | ${4}
41 | }}, [${5}])
42 | endsnippet
43 | snippet useM "useMemo(fn, inputs)" b
44 | const ${1:memorized} = useMemo(() => ${2:{
45 | ${3}
46 | }}, [${4}])
47 | endsnippet
48 | snippet useR "useRef(defaultValue)" b
49 | const ${1:ref} = useRef(${2:null})
50 | endsnippet
51 | snippet ir "import React"
52 | import React from "react"
53 | endsnippet
54 | snippet irc "import React and Component"
55 | import React, { Component } from "react"
56 | endsnippet
57 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/json.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet s "String" b
4 | "${1:key}": "${0:value}",
5 | endsnippet
6 |
7 | snippet n "Number" b
8 | "${1:key}": ${0:value},
9 | endsnippet
10 |
11 | snippet a "Array" b
12 | [
13 | ${VISUAL}$0
14 | ],
15 | endsnippet
16 |
17 | snippet na "Named array" b
18 | "${1:key}": [
19 | ${VISUAL}$0
20 | ],
21 | endsnippet
22 |
23 | snippet o "Object" b
24 | {
25 | ${VISUAL}$0
26 | },
27 | endsnippet
28 |
29 | snippet no "Named object" b
30 | "${1:key}": {
31 | ${VISUAL}$0
32 | },
33 | endsnippet
34 |
35 | snippet null "Null" b
36 | "${0:key}": null,
37 | endsnippet
38 |
39 |
40 | global !p
41 | def compB(t, opts):
42 | if t:
43 | opts = [m[len(t):] for m in opts if m.startswith(t)]
44 | if len(opts) == 1:
45 | return opts[0]
46 | return "(" + '|'.join(opts) + ')'
47 | endglobal
48 |
49 | snippet b "Bool" b
50 | "${1:key}": $2`!p snip.rv=compB(t[2], ['true', 'false'])`,
51 | endsnippet
52 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/julia.snippets:
--------------------------------------------------------------------------------
1 | # Documentation
2 | snippet docf "function documentation" b
3 | #' @description
4 | #'
5 | #' ${1:function description}
6 | #'
7 | #' ${2:@param ${3:name}::${4:Type} ${5:Description}}
8 | #'
9 | #' ${6:@returns ${7:name}::${8:Type} ${9:Description}}
10 | #'
11 | #' @examples
12 | #'
13 | #' ${10: function call examples}
14 | endsnippet
15 |
16 | snippet doct "type definition" b
17 | #' @description
18 | #'
19 | #' ${1:type description}
20 | #'
21 | #' ${2:@field ${3:name}::${4:Type} ${5:Description}}
22 | #'
23 | #' @examples
24 | #'
25 | #' ${10: constructor examples}
26 | endsnippet
27 |
28 | snippet par "function parameter documentation" b
29 | #' @param ${1:name}::${2:Type} ${0:Description}
30 | endsnippet
31 |
32 | snippet fld "type field documentation" b
33 | #' @field ${1:name}::${2:Type} ${0:Description}
34 | endsnippet
35 |
36 | # Debugging
37 | snippet deb "Debugger breakpoint" b
38 | Main.@bp
39 | endsnippet
40 |
41 | snippet inf "Infiltrator breakpoint" b
42 | Main.@infiltrate
43 | endsnippet
44 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/ledger.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet t "Transaction" b
4 | ${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} ${4:*} ${5:Payee}
5 | ${6:Expenses} \$${7:0.00}
6 | ${8:Assets:Checking}$0
7 | endsnippet
8 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/lhaskell.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | extends haskell
4 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/lua.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | #################################
4 | # Snippets for the Lua language #
5 | #################################
6 | snippet #! "#!/usr/bin/env lua" b
7 | #!/usr/bin/env lua
8 | $0
9 | endsnippet
10 |
11 | snippet assert "Assertion" b
12 | assert(${1:condition}`!p
13 | if t[2]:
14 | snip.rv = ", "
15 | else:
16 | snip.rv = ""
17 | `${2:msg})
18 | endsnippet
19 |
20 | snippet !fun(ction)?! "New function" br
21 | function ${1:new_function}(${2:args})
22 | $0
23 | end
24 | endsnippet
25 |
26 | snippet forp "pair for loop" b
27 | for ${1:name},${2:val} in pairs(${3:table_name}) do
28 | $0
29 | end
30 | endsnippet
31 |
32 | snippet fori "ipair for foop" b
33 | for ${1:idx},${2:val} in ipairs(${3:table_name}) do
34 | $0
35 | end
36 | endsnippet
37 |
38 | snippet for "numeric for loop" b
39 | for ${1:i}=${2:first},${3:last}${4/^..*/(?0:,:)/}${4:step} do
40 | $0
41 | end
42 | endsnippet
43 |
44 | snippet do "do block"
45 | do
46 | $0
47 | end
48 | endsnippet
49 |
50 | snippet repeat "repeat loop" b
51 | repeat
52 | $1
53 | until $0
54 | endsnippet
55 |
56 | snippet while "while loop" b
57 | while $1 do
58 | $0
59 | end
60 | endsnippet
61 |
62 | snippet if "if statement" b
63 | if $1 then
64 | $0
65 | end
66 | endsnippet
67 |
68 | snippet ife "if/else statement" b
69 | if $1 then
70 | $2
71 | else
72 | $0
73 | end
74 | endsnippet
75 |
76 | snippet eif "if/elseif statement" b
77 | if $1 then
78 | $2
79 | elseif $3 then
80 | $0
81 | end
82 | endsnippet
83 |
84 | snippet eife "if/elseif/else statement" b
85 | if $1 then
86 | $2
87 | elseif $3 then
88 | $4
89 | else
90 | $0
91 | end
92 | endsnippet
93 |
94 | snippet pcall "pcall statement" b
95 | local ok, err = pcall(${1:your_function})
96 | if not ok then
97 | handler(${2:ok, err})
98 | ${3:else
99 | success(${4:ok, err})
100 | }end
101 | endsnippet
102 |
103 | snippet local "local x = 1"
104 | local ${1:x} = ${0:1}
105 | endsnippet
106 |
107 | snippet use "Use" b
108 | use { '$1' }
109 | endsnippet
110 |
111 | snippet req "Require" b
112 | require('$1')
113 | endsnippet
114 |
115 |
116 | # vim:ft=snippets:
117 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/mako.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | #################
4 | # From snipmate #
5 | #################
6 | snippet def "definition" b
7 | <%def name="${1:name}">
8 | ${2:}
9 | %def>
10 | endsnippet
11 |
12 | snippet call "call" b
13 | <%call expr="${1:name}">
14 | ${2:}
15 | %call>
16 | endsnippet
17 |
18 | snippet doc "doc" b
19 | <%doc>
20 | ${1:}
21 | %doc>
22 | endsnippet
23 |
24 | snippet text "text" b
25 | <%text>
26 | ${1:}
27 | %text>
28 | endsnippet
29 |
30 | snippet for "for" b
31 | % for ${1:i} in ${2:iter}:
32 | ${3:}
33 | % endfor
34 | endsnippet
35 |
36 | snippet if "if " b
37 | % if ${1:condition}:
38 | ${2:}
39 | % endif
40 | endsnippet
41 |
42 | snippet if "if/else" b
43 | % if ${1:condition}:
44 | ${2:}
45 | % else:
46 | ${3:}
47 | % endif
48 | endsnippet
49 |
50 | snippet try "try" b
51 | % try:
52 | ${1:}
53 | % except${2:}:
54 | ${3:pass}
55 | % endtry
56 | endsnippet
57 |
58 | snippet wh "wh" b
59 | % while ${1:}:
60 | ${2:}
61 | % endwhile
62 | endsnippet
63 |
64 | snippet $ "$" i
65 | ${${1:}}
66 | endsnippet
67 |
68 | snippet <% "<%" b
69 | <% ${1:} %>
70 | endsnippet
71 |
72 | snippet
74 | endsnippet
75 |
76 | snippet inherit "inherit" b
77 | <%inherit file="${1:filename}" />
78 | endsnippet
79 |
80 | snippet include "include" b
81 | <%include file="${1:filename}" />
82 | endsnippet
83 |
84 | snippet namespace "namespace" b
85 | <%namespace file="${1:name}" />
86 | endsnippet
87 |
88 | snippet page "page" b
89 | <%page args="${1:}" />
90 | endsnippet
91 |
92 | # vim:ft=snippets:
93 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/matlab.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet switch "switch ... otherwise"
4 | switch ${1:n}
5 | case ${2:0}
6 | ${3}${4:
7 | otherwise
8 | ${5}}
9 | end
10 | endsnippet
11 |
12 | snippet clc "class with constructor" b
13 | classdef ${1:`!p
14 | snip.rv = snip.basename or "class_name"`}
15 | properties
16 | ${2}
17 | end
18 | methods
19 | function obj = $1(${3})
20 | ${4}
21 | end${0}
22 | end
23 | end
24 | endsnippet
25 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/ocaml.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet rs "raise" b
4 | raise (${1:Not_found})
5 | endsnippet
6 |
7 | snippet open "open"
8 | let open ${1:module} in
9 | ${2:e}
10 | endsnippet
11 |
12 | snippet try "try"
13 | try ${1:e}
14 | with ${2:Not_found} -> ${3:()}
15 | endsnippet
16 |
17 | snippet ref "ref"
18 | let ${1:name} = ref ${2:val} in
19 | ${3:e}
20 | endsnippet
21 |
22 | snippet matchl "pattern match on a list"
23 | match ${1:list} with
24 | | [] -> ${2:()}
25 | | x::xs -> ${3:()}
26 | endsnippet
27 |
28 | snippet matcho "pattern match on an option type"
29 | match ${1:x} with
30 | | Some(${2:y}) -> ${3:()}
31 | | None -> ${4:()}
32 | endsnippet
33 |
34 | snippet fun "anonymous function"
35 | (fun ${1:x} -> ${2:x})
36 | endsnippet
37 |
38 | snippet cc "commment"
39 | (* ${1:comment} *)
40 | endsnippet
41 |
42 | snippet let "let .. in binding"
43 | let ${1:x} = ${2:v} in
44 | ${3:e}
45 | endsnippet
46 |
47 | snippet lr "let rec"
48 | let rec ${1:f} =
49 | ${2:expr}
50 | endsnippet
51 |
52 | snippet if "if"
53 | if ${1:(* condition *)} then
54 | ${2:(* A *)}
55 | else
56 | ${3:(* B *)}
57 | endsnippet
58 |
59 | snippet If "If"
60 | if ${1:(* condition *)} then
61 | ${2:(* A *)}
62 | endsnippet
63 |
64 | snippet while "while"
65 | while ${1:(* condition *)} do
66 | ${2:(* A *)}
67 | done
68 | endsnippet
69 |
70 | snippet for "for"
71 | for ${1:i} = ${2:1} to ${3:10} do
72 | ${4:(* BODY *)}
73 | done
74 | endsnippet
75 |
76 | snippet match "match"
77 | match ${1:(* e1 *)} with
78 | | ${2:p} -> ${3:e2}
79 | endsnippet
80 |
81 | snippet Match "match"
82 | match ${1:(* e1 *)} with
83 | | ${2:p} -> ${3:e2}
84 | endsnippet
85 |
86 | snippet class "class"
87 | class ${1:name} = object
88 | ${2:methods}
89 | end
90 | endsnippet
91 |
92 | snippet obj "obj"
93 | object
94 | ${2:methods}
95 | end
96 | endsnippet
97 |
98 | snippet Obj "object"
99 | object (self)
100 | ${2:methods}
101 | end
102 | endsnippet
103 |
104 | snippet {{ "object functional update"
105 | {< ${1:x} = ${2:y} >}
106 | endsnippet
107 |
108 | snippet beg "beg"
109 | begin
110 | ${1:block}
111 | end
112 | endsnippet
113 |
114 | snippet ml "module instantiantion with functor"
115 | module ${1:Mod} = ${2:Functor}(${3:Arg})
116 | endsnippet
117 |
118 | snippet mod "module - no signature"
119 | module ${1:(* Name *)} = struct
120 | ${2:(* BODY *)}
121 | end
122 | endsnippet
123 |
124 | snippet Mod "module with signature"
125 | module ${1:(* Name *)} : ${2:(* SIG *)} = struct
126 | ${3:(* BODY *)}
127 | end
128 | endsnippet
129 |
130 | snippet sig "anonymous signature"
131 | sig
132 | ${2:(* BODY *)}
133 | end
134 | endsnippet
135 |
136 | snippet sigf "functor signature or anonymous functor"
137 | functor (${1:Arg} : ${2:ARG}) -> ${3:(* BODY *)}
138 | endsnippet
139 |
140 | snippet func "define functor - no signature"
141 | module ${1:M} (${2:Arg} : ${3:ARG}) = struct
142 | ${4:(* BODY *)}
143 | end
144 | endsnippet
145 |
146 | snippet Func "define functor - with signature"
147 | module ${1:M} (${2:Arg} : ${3:ARG}) : ${4:SIG} = struct
148 | ${5:(* BODY *)}
149 | end
150 | endsnippet
151 |
152 | snippet mot "Declare module signature"
153 | module type ${1:(* Name *)} = sig
154 | ${2:(* BODY *)}
155 | end
156 | endsnippet
157 |
158 | snippet module "Module with anonymous signature"
159 | module ${1:(* Name *)} : sig
160 | ${2:(* SIGNATURE *)}
161 | end = struct
162 | ${3:(* BODY *)}
163 | end
164 | endsnippet
165 |
166 | snippet oo "odoc"
167 | (** ${1:odoc} *)
168 | endsnippet
169 |
170 | snippet qt "inline qtest"
171 | (*$T ${1:name}
172 | ${2:test}
173 | *)
174 | endsnippet
175 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/octave.snippets:
--------------------------------------------------------------------------------
1 | extends matlab
2 |
3 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/pandoc.snippets:
--------------------------------------------------------------------------------
1 | extends markdown
2 |
3 | # overwrite if necessary
4 | priority -49
5 |
6 | snippet title "Title Header" b
7 | % ${1:`!v vim_snippets#Filename('$1', 'title')`}
8 | % ${2:`!v g:snips_author`}
9 | % ${3:`!v strftime("%d %B %Y")`}
10 |
11 | $0
12 | endsnippet
13 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/perl.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | ###########################################################################
4 | # TextMate Snippets #
5 | ###########################################################################
6 | snippet ife "Conditional if..else (ife)"
7 | if ($1) {
8 | ${2:# body...}
9 | }
10 | else {
11 | ${3:# else...}
12 | }
13 |
14 | endsnippet
15 |
16 | snippet ifee "Conditional if..elsif..else (ifee)"
17 | if ($1) {
18 | ${2:# body...}
19 | }
20 | elsif ($3) {
21 | ${4:# elsif...}
22 | }
23 | else {
24 | ${5:# else...}
25 | }
26 |
27 | endsnippet
28 |
29 | snippet xunless "Conditional one-line (unless)"
30 | ${1:expression} unless ${2:condition};
31 |
32 | endsnippet
33 |
34 | snippet xif "Conditional one-line (xif)"
35 | ${1:expression} if ${2:condition};
36 |
37 | endsnippet
38 |
39 | snippet sub "Function (sub)"
40 | sub ${1:function_name} {
41 | ${2:# body...}
42 | }
43 |
44 | endsnippet
45 |
46 | snippet xfore "Loop one-line (xforeach)"
47 | ${1:expression} foreach @${2:array};
48 |
49 | endsnippet
50 |
51 | snippet xwhile "Loop one-line (xwhile)"
52 | ${1:expression} while ${2:condition};
53 |
54 | endsnippet
55 |
56 | snippet test "Test"
57 | #!/usr/bin/env perl -w
58 |
59 | use strict;
60 | use Test::More tests => ${1:1};
61 | use ${2:ModuleName};
62 |
63 | ok(${3:assertion});
64 |
65 | endsnippet
66 |
67 | snippet class "class"
68 | package ${1:ClassName};
69 |
70 | ${2:use parent qw(${3:ParentClass});}${2/.+/\n\n/}sub new {
71 | my $class = shift;
72 | $class = ref $class if ref $class;
73 | my $self = bless {}, $class;
74 | $self;
75 | }
76 |
77 | 1;
78 |
79 | endsnippet
80 |
81 | snippet eval "eval"
82 | local $@;
83 | eval {
84 | ${1:# do something risky...}
85 | };
86 | if (my $${2:exception} = $@) {
87 | ${3:# handle failure...}
88 | }
89 |
90 | endsnippet
91 |
92 | snippet for "for"
93 | for (my $${1:var} = 0; $$1 < ${2:expression}; $$1++) {
94 | ${3:# body...}
95 | }
96 |
97 | endsnippet
98 |
99 | snippet fore "foreach"
100 | foreach ${1:my $${2:x}} (@${3:array}) {
101 | ${4:# body...}
102 | }
103 |
104 | endsnippet
105 |
106 | snippet if "if"
107 | if ($1) {
108 | ${2:# body...}
109 | }
110 |
111 | endsnippet
112 |
113 | snippet slurp "slurp"
114 | my $${1:var} = do { local $/ = undef; open my $fh, '<', ${2:$file}; <$fh> };
115 |
116 | endsnippet
117 |
118 | snippet unless "unless"
119 | unless ($1) {
120 | ${2:# body...}
121 | }
122 |
123 | endsnippet
124 |
125 | snippet while "while"
126 | while ($1) {
127 | ${2:# body...}
128 | }
129 |
130 | endsnippet
131 |
132 | snippet until "until"
133 | until ($1) {
134 | ${2:# body...}
135 | }
136 |
137 | endsnippet
138 |
139 | # vim:ft=snippets:
140 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/proto.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | global !p
4 | from vimsnippets import complete
5 |
6 | FIELD_TYPES = [
7 | 'double',
8 | 'float',
9 | 'int32',
10 | 'int64',
11 | 'uint32',
12 | 'uint64',
13 | 'sint32',
14 | 'sint64',
15 | 'fixed32',
16 | 'fixed64',
17 | 'sfixed32',
18 | 'sfixed64',
19 | 'bool',
20 | 'string',
21 | 'bytes']
22 | endglobal
23 |
24 | snippet mess "Proto message" b
25 | // ${2:TODO(`whoami`): Describe this message.}
26 | message ${1:Name} {
27 | $0
28 |
29 | // Next available id: 1
30 | }
31 | endsnippet
32 |
33 | snippet reqf "Required field" b
34 | // ${4:TODO(`whoami`): Describe this field.}
35 | optional $1`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1}; // Required
36 | endsnippet
37 |
38 | snippet optf "Optional field" b
39 | // ${4:TODO(`whoami`): Describe this field.}
40 | optional $1`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1};
41 | endsnippet
42 |
43 | snippet repf "Repeated field" b
44 | // ${4:TODO(`whoami`): Describe this field.}
45 | repeated $1`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1};
46 | endsnippet
47 |
48 | snippet enum "Enumeration" b
49 | // ${2:TODO(`whoami`): Describe this enum.}
50 | enum ${1:Name} {
51 | }
52 | endsnippet
53 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/rnoweb.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | extends tex, r
4 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/rust.snippets:
--------------------------------------------------------------------------------
1 | #######################################################################
2 | # Rust Snippets #
3 | #######################################################################
4 |
5 | priority -50
6 |
7 | snippet fn "fn name(?) -> ? {}"
8 | fn ${1:function_name}($2)${3/..*/ -> /}$3 {
9 | ${VISUAL}$0
10 | }
11 | endsnippet
12 |
13 | snippet pfn "pub fn name(?) -> ? {}"
14 | pub fn ${1:function_name}($2)${3/..*/ -> /}$3 {
15 | ${VISUAL}$0
16 | }
17 | endsnippet
18 |
19 | snippet afn "async fn name(?) -> ? {}"
20 | async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
21 | ${VISUAL}$0
22 | }
23 | endsnippet
24 |
25 | snippet pafn "pub async fn name(?) -> ? {}"
26 | pub async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
27 | ${VISUAL}$0
28 | }
29 | endsnippet
30 |
31 | snippet pri "print!(..)" b
32 | print!("$1"${2/..*/, /}$2);
33 | endsnippet
34 |
35 | snippet pln "println!(..)" b
36 | println!("$1"${2/..*/, /}$2);
37 | endsnippet
38 |
39 | snippet fmt "format!(..)"
40 | format!("$1"${2/..*/, /}$2);
41 | endsnippet
42 |
43 | snippet .it ".iter()" i
44 | .iter()$0
45 | endsnippet
46 |
47 | snippet impl "Struct/Trait implementation" b
48 | impl$4 ${1:Type/Trait}${2: for ${3:Type}}${4:<${5:T}>} {
49 | ${0}
50 | }
51 | endsnippet
52 |
53 | # vim:ft=snippets:
54 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/sh.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | global !p
4 | import vim
5 |
6 | # Tests for the existence of a variable declared by Vim's filetype detection
7 | # suggesting the type of shell script of the current file
8 | def testShell(scope, shell):
9 | return vim.eval("exists('" + scope + ":is_" + shell + "')")
10 |
11 | # Loops over the possible variables, checking for global variables
12 | # first since they indicate an override by the user.
13 | def getShell():
14 | for scope in ["g", "b"]:
15 | for shell in ["bash", "posix", "sh", "kornshell"]:
16 | if testShell(scope, shell) == "1":
17 | if shell == "kornshell":
18 | return "ksh"
19 | if shell == "posix":
20 | return "sh"
21 | return shell
22 | return "sh"
23 | endglobal
24 |
25 | ###########################################################################
26 | # TextMate Snippets #
27 | ###########################################################################
28 | snippet #! "#!/usr/bin/env (!env)" b
29 | `!p snip.rv = '#!/usr/bin/env ' + getShell() + "\n" `
30 | endsnippet
31 |
32 | snippet sbash "safe bash options" b
33 | #!/usr/bin/env bash
34 | set -euo pipefail
35 | IFS=$'\n\t'
36 | `!p snip.rv ='\n\n' `
37 | endsnippet
38 |
39 | snippet temp "Tempfile" b
40 | ${1:TMPFILE}="$(mktemp -t ${3:--suffix=${4:.SUFFIX}} ${2:`!p
41 | snip.rv = re.sub(r'[^a-zA-Z]', '_', snip.fn) or "untitled"
42 | `}.XXXXXX)"
43 | ${5:${6/(.+)/trap "/}${6:rm -f '$${1/.*\s//}'}${6/(.+)/" 0 # EXIT\n/}${7/(.+)/trap "/}${7:rm -f '$${1/.*\s//}'; exit 1}${7/(.+)/" 2 # INT\n/}${8/(.+)/trap "/}${8:rm -f '$${1/.*\s//}'; exit 1}${8/(.+)/" 1 15 # HUP TERM\n/}}
44 |
45 | endsnippet
46 |
47 | snippet /case|sw(itch)?/ "case .. esac (case)" rb
48 | case ${1:word} in
49 | ${2:pattern} )
50 | ${0:${VISUAL}};;
51 | esac
52 | endsnippet
53 |
54 | snippet elif "elif .. (elif)" b
55 | elif ${2:[[ ${1:condition} ]]}; then
56 | ${0:${VISUAL}}
57 | endsnippet
58 |
59 | snippet for "for ... done (for)" b
60 | for (( i = 0; i < ${1:10}; i++ )); do
61 | ${0:${VISUAL}}
62 | done
63 | endsnippet
64 |
65 | snippet forin "for ... in ... done (forin)" b
66 | for ${1:i}${2/.+/ in /}${2:words}; do
67 | ${0:${VISUAL}}
68 | done
69 | endsnippet
70 |
71 | snippet here "here document (here)"
72 | <<-${2:'${1:TOKEN}'}
73 | $0`echo \\n`${1/['"`](.+)['"`]/$1/}
74 | endsnippet
75 |
76 | snippet /ift(est)?/ "if ... then (if)" rb
77 | if ${2:[ ${1:condition} ]}; then
78 | ${0:${VISUAL}}
79 | fi
80 | endsnippet
81 |
82 | snippet if "if ... then (if)" b
83 | if [[ ${1:condition} ]]; then
84 | ${0:${VISUAL}}
85 | fi
86 | endsnippet
87 |
88 | snippet until "until ... (done)" b
89 | until ${2:[[ ${1:condition} ]]}; do
90 | ${0:${VISUAL}}
91 | done
92 | endsnippet
93 |
94 | snippet /wh(ile)?/ "while ... (done)" rb
95 | while ${2:[[ ${1:condition} ]]}; do
96 | ${0:${VISUAL}}
97 | done
98 | endsnippet
99 |
100 | snippet func "function() {...}" b
101 | ${1:function} () {
102 | ${0:${VISUAL}}
103 | }
104 | endsnippet
105 |
106 | # vim:ft=snippets:
107 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/smarty.snippets:
--------------------------------------------------------------------------------
1 | # snippets for smarty3
2 |
3 | extends html
4 | extends javascript
5 | extends css
6 |
7 |
8 |
9 |
10 | # https://www.smarty.net/docs/en/language.function.append.tpl
11 | snippet append "{append} is used for creating or appending template variable arrays during the execution of a template."
12 | {append var='${1}' value='${2}'${3: index='${4|first,last|}'}${5: scope='${6|parent,root,global|}'}}
13 | endsnippet
14 |
15 | # https://www.smarty.net/docs/en/language.function.assign.tpl
16 | snippet assign "{assign} is used for assigning template variables during the execution of a template."
17 | {assign var='${1}' value='${2}'${3: scope='${4|parent,root,global|}'}}
18 | endsnippet
19 |
20 | # https://www.smarty.net/docs/en/language.function.config.load.tpl
21 | snippet config_load "config_load"
22 | {config_load file='${1}'${2: section='${3}'}${4: scope='${5|local,parent,global|}'}}
23 | endsnippet
24 |
25 | # https://www.smarty.net/docs/en/language.function.include.tpl
26 | snippet include "{include} tags are used for including other templates in the current template. Any variables available in the current template are also available within the included template."
27 | {include file='${1}'${2: assign='${3}'}${4: cache_lifetime=${5}}${6: compile_id='${7}'}${8: cache_id='${9}'}${10: scope='${11|parent,root,global|}'}${12: variables}}
28 | endsnippet
29 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/snippets.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | # We use a little hack so that the snippet is expanded
4 | # and parsed correctly
5 | snippet usnip "Ultisnips snippet definition" b
6 | `!p snip.rv = "snippet"` ${1:Tab_trigger} "${2:Description}" ${3:b}
7 | ${0:${VISUAL}}
8 | `!p snip.rv = "endsnippet"`
9 | endsnippet
10 |
11 | snippet global "Global snippet" b
12 | `!p snip.rv = "global"` !p
13 | ${0:${VISUAL}}
14 | `!p snip.rv = "endglobal"`
15 | endsnippet
16 |
17 | snippet vis "${VISUAL}" i
18 | \$\{VISUAL${1:${2:default}${3:/transform/}}\}
19 | endsnippet
20 |
21 | # vim:ft=snippets:
22 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/soy.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | extends html
4 |
5 | snippet ns "Namespace" b
6 | {namespace ${1:name}}
7 | endsnippet
8 |
9 | snippet tmpl "Template" b
10 | /**
11 | * ${2:TODO(`whoami`): Describe this template.}
12 | */
13 | {template .${1:name}}
14 | $0
15 | {/template}
16 | endsnippet
17 |
18 | snippet msg "Message" b
19 | {msg desc="${1:description}"}
20 | $0
21 | {/msg}
22 | endsnippet
23 |
24 | snippet let "let command" b
25 | {let $${1:identifier}: ${2:expression} /}
26 | endsnippet
27 |
28 | snippet if "if .. (if)" b
29 | {if ${1:expression}}
30 | $0
31 | {/if}
32 | endsnippet
33 |
34 | snippet ife "if .. else (ife)" b
35 | {if ${1:expression}}
36 | $2
37 | {else}
38 | $0
39 | {/if}
40 | endsnippet
41 |
42 | snippet eli "else if .. (eli)" b
43 | {elif ${1:expression}}
44 | $0
45 | endsnippet
46 |
47 | snippet fore "foreach command" b
48 | {foreach $${1:var} in ${2:ref}}
49 | $0
50 | {/foreach}
51 | endsnippet
52 |
53 | snippet for "for command" b
54 | {for $${1:var} in range(${2:rangeexpr})}
55 | $0
56 | {/for}
57 | endsnippet
58 |
59 | snippet call "template call" b
60 | {call ${1:tmpl}}
61 | $0
62 | {/call}
63 | endsnippet
64 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/supercollider.snippets:
--------------------------------------------------------------------------------
1 | snippet for
2 | for (${1:1}, ${2:10}) {${3: |i}|}
3 | $0
4 | }
5 | endsnippet
6 | snippet sdef
7 | SynthDef(\\${1:synthName}, {${2: |${3:x}|}
8 | $0
9 | }).add;
10 | endsnippet
11 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/svelte.snippets:
--------------------------------------------------------------------------------
1 | extends html, javascript, css
2 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/tcl.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | ###########################################################################
4 | # TEXTMATE SNIPPETS #
5 | ###########################################################################
6 | snippet for "for... (for)" b
7 | for {${1:set i 0}} {${2:\$i < \$n}} {${3:incr i}} {
8 | $4
9 | }
10 |
11 | endsnippet
12 |
13 | snippet foreach "foreach... (foreach)"
14 | foreach ${1:var} ${2:\$list} {
15 | $3
16 | }
17 |
18 | endsnippet
19 |
20 | snippet if "if... (if)" b
21 | if {${1:condition}} {
22 | $2
23 | }
24 |
25 | endsnippet
26 |
27 | snippet proc "proc... (proc)" b
28 | proc ${1:name} {${2:args}} \
29 | {
30 | $3
31 | }
32 |
33 | endsnippet
34 |
35 | snippet switch "switch... (switch)" b
36 | switch ${1:-exact} -- ${2:\$var} {
37 | ${3:match} {
38 | $4
39 | }
40 | default {$5}
41 | }
42 |
43 | endsnippet
44 |
45 | snippet while "while... (while)" b
46 | while {${1:condition}} {
47 | $2
48 | }
49 |
50 | endsnippet
51 |
52 | # vim:ft=snippets:
53 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/texmath.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | ##############
4 | # MATH STUFF #
5 | ##############
6 |
7 | snippet eqnn "Equation without a number" b
8 | \begin{equation*}
9 | ${0:${VISUAL}}
10 | \end{equation*}
11 | endsnippet
12 |
13 | snippet al "Align" b
14 | \begin{align}
15 | ${0:${VISUAL}}
16 | \end{align}
17 | endsnippet
18 |
19 | snippet alnn "Align without a number" b
20 | \begin{align*}
21 | ${0:${VISUAL}}
22 | \end{align*}
23 | endsnippet
24 |
25 | snippet eqa "Equation array" b
26 | \begin{eqnarray}
27 | ${1:${VISUAL}} & ${2:${VISUAL}} & ${0:${VISUAL}}
28 | \end{eqnarray}
29 | endsnippet
30 |
31 | snippet eqann "Equation array without a number" b
32 | \begin{eqnarray*}
33 | ${1:${VISUAL}} & ${2:${VISUAL}} & ${0:${VISUAL}}
34 | \end{eqnarray*}
35 | endsnippet
36 |
37 | #################
38 | # PHYSICS STUFF #
39 | #################
40 |
41 | snippet dv "Derivative" w
42 | \dv[${1:${VISUAL}}]{${2}}{${3}}
43 | endsnippet
44 |
45 | snippet pdv "Partial Derivative" w
46 | \pdv[${1:${VISUAL}}]{${2}}{${3}}
47 | endsnippet
48 |
49 | snippet SI "SI-Unit" w
50 | \SI{${1:${VISUAL}}}{${2}}
51 | endsnippet
52 |
53 | # vim:ft=snippets:
54 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/typescript.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | extends javascript
4 |
5 | snippet int "interface"
6 | interface ${1} {
7 | }
8 | endsnippet
9 | snippet nspc "namespace"
10 | namespace ${1} {
11 | }
12 | endsnippet
13 | priority -49
14 | snippet fun "function (named)" b
15 | function ${1:function_name} (${2:argument}: ${3:argument_type}) {
16 | ${VISUAL}$0
17 | }
18 | endsnippet
19 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/typescript_react.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 | extends javascript_react
3 | extends typescript
4 |
5 | priority -49
6 | snippet rfc "react functional component"
7 | import React, { FC } from "react"
8 |
9 | interface ${1:function_name}Props {${4:props_types}}
10 |
11 | export const ${1:function_name}: FC<${1:function_name}Props> = (${2:props}) => ${3:function_body}
12 | endsnippet
13 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/vim.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | ###########################################################################
4 | # SnipMate Snippets #
5 | ###########################################################################
6 | snippet gvar "Global / configuration variable" b
7 | if !exists("g:${1:MyUltraImportantVar}")
8 | let g:$1 = ${2:"${3:}"}
9 | endif
10 | endsnippet
11 |
12 | snippet guard "script reload guard" b
13 | if exists('${1:did_`!p snip.rv = snip.fn.replace('.','_')`}') || &cp${2: || version < 700}
14 | finish
15 | endif
16 | let $1 = 1$3
17 | endsnippet
18 |
19 | snippet f "function" b
20 | fun ${1:function_name}($2)
21 | ${3:" code}
22 | endf
23 | endsnippet
24 | # vim:ft=snippets:
25 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/vue.snippets:
--------------------------------------------------------------------------------
1 | extends html, javascript, css
2 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/xhtml.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | extends html
4 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/xml.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | snippet xml "XML declaration" b
4 |
5 |
6 | endsnippet
7 |
8 | snippet t "Simple tag" b
9 | <${1:tag}>
10 | ${2:${VISUAL}}
11 | ${1/([\w:._-]+).*/$1/}>
12 | endsnippet
13 |
14 | snippet ti "Inline tag" b
15 | <${1:tag}>${2:${VISUAL}}${1/([\w:._-]+).*/$1/}>
16 | endsnippet
17 |
--------------------------------------------------------------------------------
/config/vim-snippets/UltiSnips/zsh.snippets:
--------------------------------------------------------------------------------
1 | priority -50
2 |
3 | extends sh
4 |
5 | priority -49
6 |
7 | snippet #! "#!/usr/bin/env zsh" b
8 | #!/usr/bin/env zsh
9 | $0
10 | endsnippet
11 |
12 | # vim:ft=snippets:
13 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/actionscript.snippets:
--------------------------------------------------------------------------------
1 | snippet main
2 | package {
3 | import flash.display.*;
4 | import flash.Events.*;
5 |
6 | public class Main extends Sprite {
7 | public function Main ( ) {
8 | trace("start");
9 | stage.scaleMode = StageScaleMode.NO_SCALE;
10 | stage.addEventListener(Event.RESIZE, resizeListener);
11 | }
12 |
13 | private function resizeListener (e:Event):void {
14 | trace("The application window changed size!");
15 | trace("New width: " + stage.stageWidth);
16 | trace("New height: " + stage.stageHeight);
17 | }
18 |
19 | }
20 |
21 | }
22 | snippet class
23 | ${1:public|internal} class ${2:name} ${0:extends } {
24 | public function $2 ( ) {
25 | ("start");
26 | }
27 | }
28 | snippet all
29 | package name {
30 |
31 | ${1:public|internal|final} class ${2:name} ${0:extends } {
32 | private|public| static const FOO = "abc";
33 | private|public| static var BAR = "abc";
34 |
35 | // class initializer - no JIT !! one time setup
36 | if Cababilities.os == "Linux|MacOS" {
37 | FOO = "other";
38 | }
39 |
40 | // constructor:
41 | public function $2 ( ){
42 | super2();
43 | trace("start");
44 | }
45 | public function name (a, b...){
46 | super.name(..);
47 | lable:break
48 | }
49 | }
50 | }
51 |
52 | function A(){
53 | // A can only be accessed within this file
54 | }
55 | snippet switch
56 | switch(${1}){
57 | case ${2}:
58 | ${0}
59 | break;
60 | default:
61 | }
62 | snippet case
63 | case ${1}:
64 | ${0}
65 | break;
66 | snippet package
67 | package ${1:package}{
68 | ${0}
69 | }
70 | snippet wh
71 | while ${1:cond}{
72 | ${0}
73 | }
74 | snippet do
75 | do {
76 | ${0}
77 | } while (${1:cond})
78 | snippet for enumerate names
79 | for (${1:var} in ${2:object}){
80 | ${0}
81 | }
82 | snippet for enumerate values
83 | for each (${1:var} in ${2:object}){
84 | ${0}
85 | }
86 | snippet get_set
87 | function get ${1:name} {
88 | return ${2}
89 | }
90 | function set $1 (newValue) {
91 | ${0}
92 | }
93 | snippet interface
94 | interface name {
95 | function method(${1}):${0:returntype};
96 | }
97 | snippet try
98 | try {
99 | ${1:${VISUAL}}
100 | } catch (error:ErrorType) {
101 | ${2}
102 | } finally {
103 | ${0}
104 | }
105 | # For Loop (same as c.snippet)
106 | snippet for for (..) {..}
107 | for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
108 | ${0}
109 | }
110 | # Custom For Loop
111 | snippet forr
112 | for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
113 | ${0}
114 | }
115 | # If Condition
116 | snippet if
117 | if ($1) {
118 | ${0:${VISUAL}}
119 | }
120 | snippet el
121 | else {
122 | ${0:${VISUAL}}
123 | }
124 | # Ternary conditional
125 | snippet t Ternary: `condition ? true : false`
126 | $1 ? $2 : $0
127 | snippet fun
128 | function ${1:function_name}(${2})${3}
129 | {
130 | ${0}
131 | }
132 | # FlxSprite (usefull when using the flixel library)
133 | snippet FlxSprite
134 | package
135 | {
136 | import org.flixel.*
137 |
138 | public class ${1:ClassName} extends ${2:FlxSprite}
139 | {
140 | public function $1(${3: X:Number, Y:Number}):void
141 | {
142 | super(X,Y);
143 | ${4}
144 | }
145 |
146 | override public function update():void
147 | {
148 | super.update();
149 | ${0}
150 | }
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/all.snippets:
--------------------------------------------------------------------------------
1 | extends _
2 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/alpaca.snippets:
--------------------------------------------------------------------------------
1 | snippet mod
2 | module ${0:`expand('%:t:r')`}
3 | snippet imp
4 | import ${0:http}
5 | snippet impt
6 | import type ${0:option.option}
7 | snippet exp
8 | export ${0}
9 | snippet expt
10 | export ${0}
11 | snippet fn
12 | val ${1:fn} ${2}: fn ${3:'a} -> ${4:'a}
13 | let $1 ${5} =
14 | ${0:${VISUAL}}
15 | snippet mat
16 | match ${1} with
17 | | ${2} -> ${0}
18 | snippet -
19 | | ${1} -> ${0}
20 | snippet let
21 | let ${1} = ${2:${VISUAL}} in
22 | ${0}
23 | snippet letf
24 | let ${1} =
25 | ${0:${VISUAL}}
26 | snippet ty
27 | type ${1:msg}
28 | = ${0}
29 | snippet test
30 | test "${1}" =
31 | ${0:${VISUAL}}
32 | snippet doc
33 | {-| ${0}
34 | -}
35 | snippet p
36 | |> ${0}
37 | snippet ae
38 | assert.equal ${0}
39 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/apache.snippets:
--------------------------------------------------------------------------------
1 | # Snippets for code blocks used oftenly in Apache files.
2 | #
3 | snippet dir
4 |
5 | DirectoryIndex ${0:index.html}
6 | Order Deny,Allow
7 | Deny from All
8 |
9 | #
10 | snippet filesmatch
11 |
12 | ${0:${VISUAL}}
13 |
14 | #
15 | snippet ifmodule
16 |
17 | ${0:${VISUAL}}
18 |
19 | #
20 | snippet limitexcept
21 |
22 | ${0:${VISUAL}}
23 |
24 | #
25 | snippet proxy
26 |
27 | ${0:${VISUAL}}
28 |
29 | #
30 | snippet virtualhost
31 |
32 | ServerAdmin ${3:webmaster@example.com}
33 | DocumentRoot ${4:/www/example.com}
34 | ServerName ${0:www.example.com}
35 |
36 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/arduino.snippets:
--------------------------------------------------------------------------------
1 | snippet setup
2 | void setup()
3 | {
4 | Serial.begin(${1:9600});
5 | ${2}
6 | }
7 |
8 | snippet loop
9 | void loop()
10 | {
11 | ${0}
12 | }
13 |
14 | snippet inc
15 | #include <${1}.h>
16 |
17 | snippet def
18 | #define ${1}
19 |
20 | # if
21 | snippet if
22 | if ($1) {
23 | ${0:${VISUAL}}
24 | }
25 | # else
26 | snippet el
27 | else {
28 | ${1}
29 | }
30 | # else if
31 | snippet elif
32 | else if ($1) {
33 | ${2}
34 | }
35 | # ifi
36 | snippet ifi
37 | if ($1) ${2};
38 |
39 | # switch
40 | snippet switch
41 | switch (${1:/* variable */}) {
42 | case ${2:/* variable case */}:
43 | ${3}
44 | ${4:break;}${5}
45 | default:
46 | ${6}
47 | }
48 |
49 | snippet case
50 | case ${1:/* variable case */}:
51 | ${2}
52 | ${3:break;}
53 |
54 | # for
55 | snippet for
56 | for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
57 | ${4}
58 | }
59 | # for (custom)
60 | snippet forr
61 | for (int ${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
62 | ${5}
63 | }
64 | # while
65 | snippet wh
66 | while ($1) {
67 | ${2}
68 | }
69 | # do... while
70 | snippet do
71 | do {
72 | ${2}
73 | } while ($1);
74 | ##
75 | ## Functions
76 | # function definition
77 | snippet fun
78 | ${1:void} ${2:function_name}(${3})
79 | {
80 | ${4}
81 | }
82 |
83 | ## IO
84 | # pinMode OUTPUT
85 | snippet pinout
86 | pinMode(${1}, OUTPUT);
87 | # pinMode INPUT
88 | snippet pinin
89 | pinMode(${1}, INPUT);
90 | # digitalWrite HIGH
91 | snippet dwHigh
92 | digitalWrite(${1}, HIGH);
93 | # digitalWrite LOW
94 | snippet dwLow
95 | digitalWrite(${1}, LOW);
96 | # digitalRead
97 | snippet dr
98 | digitalRead(${1});
99 | # analogRead
100 | snippet ar
101 | analogRead(${1});
102 | # analogWrite
103 | snippet aw
104 | analogWrite(${1});
105 | # serialRead
106 | snippet sr
107 | Serial.read();
108 | # serialWrite
109 | snippet sw
110 | Serial.write();
111 | # serial.print
112 | snippet sp
113 | Serial.print(${1});
114 | # serial.println
115 | snippet sl
116 | Serial.println(${1});
117 |
118 |
119 | # delay
120 | snippet dl
121 | delay(${1});
122 | # millis
123 | snippet ml
124 | millis();
125 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/asm.snippets:
--------------------------------------------------------------------------------
1 | snippet scode Start basic code for assembly
2 | .data
3 |
4 |
5 | .text
6 |
7 |
8 | .global main
9 |
10 |
11 | main:
12 |
13 |
14 | snippet scodes Start basic code for assembly with _start label
15 | .data
16 |
17 |
18 | .text
19 |
20 |
21 | .globl _start
22 |
23 |
24 | _start:
25 |
26 |
27 | snippet lo Long
28 | $1: .long $2
29 | snippet wo Word
30 | $1: .word $2
31 | snippet by Byte
32 | $1: .byte $2
33 | snippet sp Space
34 | $1: .space $2
35 | snippet ai Ascii
36 | $1: .ascii "$2"
37 | snippet az Asciz
38 | $1: .asciz "$2"
39 | snippet ze Zero
40 | $1: .zero "$2"
41 | snippet qu Quad
42 | $1: .quad "$2"
43 | snippet si Single
44 | $1: .single "$2"
45 | snippet do Double
46 | $1: .single "$2"
47 | snippet fl Float
48 | $1: .single "$2"
49 | snippet oc Octa
50 | $1: .single "$2"
51 | snippet sh Short
52 | $1: .single "$2"
53 | snippet exit0 Exit without error
54 | movl \$1, %eax
55 | xorl %ebx, %ebx
56 | int \$0x80
57 |
58 | snippet exit Exit with error
59 | mov \$1, %eax
60 | mov $1, %ebx
61 | int \$0x80
62 |
63 | snippet readfstdin Read fixed length text from stdin
64 | mov \$3, %eax
65 | mov \$2, %ebx
66 | mov $1, %ecx
67 | mov $2, %edx
68 | int \$0x80
69 |
70 | snippet writestdout Write text to stdout
71 | mov \$4, %eax
72 | mov \$1, %ebx
73 | mov $1, %ecx
74 | mov $2, %edx
75 | int \$0x80
76 |
77 | snippet writestderr Write text to stderr
78 | mov \$4, %eax
79 | mov \$2, %ebx
80 | mov $1, %ecx
81 | mov $2, %edx
82 | int \$0x80
83 |
84 | snippet * Multiplication
85 | mov $1, %eax
86 | mul $2
87 |
88 | snippet / Division
89 | mov $1, %eax
90 | div $2
91 |
92 | snippet jmpl Conditional lower jump
93 | cmp $1, $2
94 | jl $3
95 |
96 | snippet jmple Conditional lower or equal jump
97 | cmp $1, $2
98 | jle $3
99 |
100 | snippet jmpe Conditional equal jump
101 | cmp $1, $2
102 | je $3
103 |
104 | snippet jmpn Conditional not equal jump
105 | cmp $1, $2
106 | jn $3
107 |
108 | snippet jmpg Conditional greater jump
109 | cmp $1, $2
110 | jg $3
111 |
112 | snippet jmpge Conditional greater or equal jump
113 | cmp $1, $2
114 | je $3
115 |
116 | snippet loopn Loop n times
117 | mov $1, %ecx
118 |
119 | et_for:
120 | $2
121 |
122 | loop et_for
123 |
124 | snippet loopnn Loop n-1 times
125 | mov $1, %ecx
126 | dec %ecx
127 |
128 | et_for:
129 | $2
130 |
131 | loop et_for
132 |
133 | snippet loopv Loop through a vector
134 | lea $1, %edi
135 | xor %ecx, %ecx
136 |
137 | et_for:
138 | cmp %ecx, $2
139 | je $3
140 |
141 | $4
142 |
143 | inc %ecx
144 | jmp et_for
145 |
146 | snippet mul Multiply
147 | xor %edx, %edx
148 | mov $1, %eax
149 | mul $2
150 | snippet mul64 Multiply numbers greater than 2^32
151 | mov $1, %edx
152 | mov $2, %eax
153 | mul $3
154 | snippet div Divide
155 | xor %edx, %edx
156 | mov $1, %eax
157 | div $2
158 | snippet div64 Divide numbers greater than 2^32
159 | mov $1, %edx
160 | mov $2, %eax
161 | div $3
162 | snippet pr Call printf
163 | pushl $1
164 | call printf
165 | popl $2
166 | snippet sc Call scanf
167 | pushl $1
168 | call scanf
169 | popl $2
170 | snippet mindex Current index from a matrix
171 | xor %edx, %edx
172 | movl $1, %eax
173 | mull $2
174 | addl $3, %eax
175 | snippet ffl Call fflush
176 | pushl \$0
177 | call fflush
178 | popl $1
179 | snippet at Call atoi
180 | pushl $1
181 | call atoi
182 | popl $2
183 | snippet len Call strlen
184 | pushl $1
185 | call strlen
186 | popl $2
187 | snippet proc Basic procedure
188 | $1:
189 | pushl %ebp
190 | movl %esp, %ebp
191 |
192 | $2
193 |
194 | popl %ebp
195 | ret
196 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/autoit.snippets:
--------------------------------------------------------------------------------
1 | snippet if
2 | If $1 Then
3 | ${0:; True code}
4 | EndIf
5 | snippet el
6 | Else
7 | ${0}
8 | snippet eif
9 | ElseIf $1 Then
10 | ${0:; True code}
11 | # If/Else block
12 | snippet ife
13 | If $1 Then
14 | ${2:; True code}
15 | Else
16 | ${0:; Else code}
17 | EndIf
18 | # If/ElseIf/Else block - because there is eif this is not really neccessary
19 | snippet ifelif
20 | If ${1:condition 1} Then
21 | ${2:; True code}
22 | ElseIf ${3:condition 2} Then
23 | ${4:; True code}
24 | Else
25 | ${0:; Else code}
26 | EndIf
27 | # Switch block
28 | snippet switch
29 | Switch ($1)
30 | Case ${2:case1}:
31 | ${3:; Case 1 code}
32 | Case Else:
33 | ${0:; Else code}
34 | EndSwitch
35 | # Select block
36 | snippet select
37 | Select ($1)
38 | Case ${2:case1}:
39 | ${3:; Case 1 code}
40 | Case Else:
41 | ${0:; Else code}
42 | EndSelect
43 | # While loop
44 | snippet wh
45 | While ($1)
46 | ${0:; code...}
47 | WEnd
48 | # For loop
49 | snippet for
50 | For ${1:n} = ${3:1} to ${2:count}
51 | ${0:; code...}
52 | Next
53 | # New Function
54 | snippet func
55 | Func ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
56 | ${0:Return}
57 | EndFunc
58 | # Message box
59 | snippet msg
60 | MsgBox(${0:MsgType}, ${1:"Title"}, ${2:"Message Text"})
61 | # Debug Message
62 | snippet debug
63 | MsgBox(0, "Debug", ${0:"Debug Message"})
64 | # Show Variable Debug Message
65 | snippet showvar
66 | MsgBox(0, "${0:VarName}", $1)
67 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/awk.snippets:
--------------------------------------------------------------------------------
1 | # cannot use /usr/bin/env because it does not support parameters (as -f)
2 | snippet #! #!/usr/bin/awk -f
3 | #!/usr/bin/awk -f
4 | # @include is a gawk extension
5 | snippet inc @include
6 | @include "${1}"${0}
7 | # @load is a gawk extension
8 | snippet loa @load
9 | @load "${1}"${0}
10 | snippet beg BEGIN { ... }
11 | BEGIN {
12 | ${0}
13 | }
14 | # BEGINFILE is a gawk extension
15 | snippet begf BEGINFILE { ... }
16 | BEGINFILE {
17 | ${0}
18 | }
19 | snippet end END { ... }
20 | END {
21 | ${0}
22 | }
23 | # ENDFILE is a gawk extension
24 | snippet endf ENDFILE { ... }
25 | ENDFILE {
26 | ${0}
27 | }
28 | snippet pri print
29 | print ${1:"${2}"}${0}
30 | snippet printf printf
31 | printf("${1:%s}\n", ${2})${0}
32 | snippet ign IGNORECASE
33 | IGNORECASE = ${1:1}
34 | snippet if if {...}
35 | if (${1}) {
36 | ${0:${VISUAL}}
37 | }
38 | snippet ife if ... else ...
39 | if (${1}) {
40 | ${2:${VISUAL}}
41 | } else {
42 | ${0}
43 | }
44 | snippet eif else if ...
45 | else if (${1}) {
46 | ${0}
47 | }
48 | snippet el else {...}
49 | else {
50 | ${0}
51 | }
52 | snippet wh while
53 | while (${1}) {
54 | ${2}
55 | }
56 | snippet do do ... while
57 | do {
58 | ${0}
59 | } while (${1})
60 | snippet for for
61 | for (${2:i} = 0; i < ${1:n}; ${3:++i}) {
62 | ${0}
63 | }
64 | snippet fore for each
65 | for (${1:i} in ${2:array}) {
66 | ${0}
67 | }
68 | # the switch is a gawk extension
69 | snippet sw switch
70 | switch (${1}) {
71 | case ${2}:
72 | ${3}
73 | break
74 | default:
75 | ${0}
76 | break
77 | }
78 | # the switch is a gawk extension
79 | snippet case case
80 | case ${1}:
81 | ${0}
82 | break
83 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/bash.snippets:
--------------------------------------------------------------------------------
1 | extends sh
2 |
3 | # Shebang
4 | snippet #!
5 | #!/usr/bin/env bash
6 |
7 | snippet s#!
8 | #!/usr/bin/env bash
9 | set -eu
10 |
11 | snippet if
12 | if [[ $1 ]]; then
13 | ${0:${VISUAL}}
14 | fi
15 | snippet elif
16 | elif [[ $1 ]]; then
17 | ${0:${VISUAL}}
18 | snippet wh
19 | while [[ $1 ]]; do
20 | ${0:${VISUAL}}
21 | done
22 | snippet until
23 | until [[ $1 ]]; do
24 | ${0:${VISUAL}}
25 | done
26 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/clojure.snippets:
--------------------------------------------------------------------------------
1 | snippet comm
2 | (comment
3 | ${0})
4 | snippet condp
5 | (condp ${1:pred} ${2:expr}
6 | ${0})
7 | snippet def
8 | (def ${0})
9 | snippet defm
10 | (defmethod ${1:multifn} "${2:doc-string}" ${3:dispatch-val} [${4:args}]
11 | ${0:code})
12 | snippet defmm
13 | (defmulti ${1:name} "${2:doc-string}" ${0:dispatch-fn})
14 | snippet defma
15 | (defmacro ${1:name} "${2:doc-string}" ${0:dispatch-fn})
16 | snippet defn
17 | (defn ${1:name} "${2:doc-string}" [${3:arg-list}]
18 | ${0:code})
19 | snippet defp
20 | (defprotocol ${1:name}
21 | ${0:code})
22 | snippet defr
23 | (defrecord ${1:name} [${2:fields}]
24 | ${3:protocol}
25 | ${0:code})
26 | snippet deft
27 | (deftest ${1:name}
28 | (is (= ${0:assertion})))
29 | snippet is
30 | (is (= ${1} ${0}))
31 | snippet defty
32 | (deftype ${1:Name} [${2:fields}]
33 | ${3:Protocol}
34 | ${0:code})
35 | snippet doseq
36 | (doseq [${1:elem} ${2:coll}]
37 | ${0:code})
38 | snippet fn
39 | (fn [${1:arg-list}] ${0:code})
40 | snippet if
41 | (if ${1:test-expr}
42 | ${2:then-expr}
43 | ${0:else-expr})
44 | snippet if-let
45 | (if-let [${1:result} ${2:test-expr}]
46 | (${3:then-expr} $1)
47 | (${0:else-expr}))
48 | snippet imp
49 | (:import [${1:package}])
50 | & {:keys [${1:keys}] :or {${0:defaults}}}
51 | snippet let
52 | (let [${1:name} ${2:expr}]
53 | ${0:code})
54 | snippet letfn
55 | (letfn [(${1:name}) [${2:args}]
56 | ${0:code})])
57 | snippet map
58 | (map ${1:func} ${0:coll})
59 | snippet mapl
60 | (map #(${1:lambda}) ${0:coll})
61 | snippet met
62 | (${1:name} [${2:this} ${3:args}]
63 | ${0:code})
64 | snippet ns
65 | (ns ${0:name})
66 | snippet dotimes
67 | (dotimes [_ 10]
68 | (time
69 | (dotimes [_ ${1:times}]
70 | ${0:code})))
71 | snippet pmethod
72 | (${1:name} [${2:this} ${0:args}])
73 | snippet refer
74 | (:refer-clojure :exclude [${0}])
75 | snippet require
76 | (:require [${1:namespace} :as [${0}]])
77 | snippet use
78 | (:use [${1:namespace} :only [${0}]])
79 | snippet print
80 | (println ${0})
81 | snippet reduce
82 | (reduce ${1:(fn [p n] ${3})} ${2})
83 | snippet when
84 | (when ${1:test} $0)
85 | snippet when-let
86 | (when-let [${1:result} ${2:test}]
87 | $0)
88 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/cmake.snippets:
--------------------------------------------------------------------------------
1 | snippet init
2 | cmake_minimum_required(VERSION ${1:2.8.2})
3 | project(${2:ProjectName})
4 |
5 | find_package(${3:library})
6 |
7 | include_directories(${$3_INCLUDE_DIRS})
8 |
9 | add_subdirectory(${0:src})
10 |
11 | add_executable($2)
12 |
13 | target_link_libraries($2 ${$3_LIBRARIES})
14 |
15 | snippet proj
16 | project(${0:Name})
17 |
18 | snippet min
19 | cmake_minimum_required(VERSION ${0:2.8.2})
20 |
21 | snippet include
22 | include_directories(${${0:include_dir}})
23 |
24 | snippet find
25 | find_package(${1:library} ${0:REQUIRED})
26 |
27 | snippet glob
28 | file(glob ${1:srcs} *.${0:cpp})
29 |
30 | snippet subdir
31 | add_subdirectory(${0:src})
32 |
33 | snippet lib
34 | add_library(${1:lib} ${${0:srcs}})
35 |
36 | snippet link
37 | target_link_libraries(${1:bin} ${0:somelib})
38 |
39 | snippet bin
40 | add_executable(${1:bin})
41 |
42 | snippet set
43 | set(${1:var} ${0:val})
44 |
45 | snippet dep
46 | add_dependencies(${1:target}
47 | ${0:dep}
48 | )
49 |
50 | snippet Ext_url
51 | include(ExternalProject)
52 | ExternalProject_Add(${1:googletest}
53 | URL ${2:http://googletest.googlecode.com/files/gtest-1.7.0.zip}
54 | URL_HASH SHA1=${3:f85f6d2481e2c6c4a18539e391aa4ea8ab0394af}
55 | SOURCE_DIR "${4:${CMAKE_BINARY_DIR}/gtest-src}"
56 | BINARY_DIR "${0:${CMAKE_BINARY_DIR}/gtest-build}"
57 | CONFIGURE_COMMAND ""
58 | BUILD_COMMAND ""
59 | INSTALL_COMMAND ""
60 | TEST_COMMAND ""
61 | )
62 |
63 | snippet Ext_git
64 | include(ExternalProject)
65 | ExternalProject_Add(${1:googletest}
66 | GIT_REPOSITORY ${2:https://github.com/google/googletest.git}
67 | GIT_TAG ${3:master}
68 | SOURCE_DIR "${4:${CMAKE_BINARY_DIR}/googletest-src}"
69 | BINARY_DIR "${0:${CMAKE_BINARY_DIR}/googletest-build}"
70 | CONFIGURE_COMMAND ""
71 | BUILD_COMMAND ""
72 | INSTALL_COMMAND ""
73 | TEST_COMMAND ""
74 | )
75 |
76 | snippet props
77 | set_target_properties(${1:target}
78 | ${2:properties} ${3:compile_flags}
79 | ${0:"-O3 -Wall -pedantic"}
80 | )
81 |
82 | snippet test
83 | add_test(${1:ATestName} ${0:testCommand --options})
84 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/coffee/coffee.snippets:
--------------------------------------------------------------------------------
1 | # Closure loop
2 | snippet forindo
3 | for ${1:name} in ${2:array}
4 | do ($1) ->
5 | $0
6 | # Array comprehension
7 | snippet fora
8 | for ${1:name} in ${2:array}
9 | $0
10 | # Object comprehension
11 | snippet foro
12 | for ${1:key}, ${2:value} of ${3:object}
13 | $0
14 | # Range comprehension (inclusive)
15 | snippet forr
16 | for ${1:name} in [${2:start}..${3:finish}]
17 | $0
18 | snippet forrb
19 | for ${1:name} in [${2:start}..${3:finish}] by ${4:step}
20 | $0
21 | # Range comprehension (exclusive)
22 | snippet forrex
23 | for ${1:name} in [${2:start}...${3:finish}]
24 | $0
25 | snippet forrexb
26 | for ${1:name} in [${2:start}...${3:finish}] by ${4:step}
27 | $0
28 | # Function
29 | snippet fun
30 | (${1:args}) ->
31 | $0
32 | # Function (bound)
33 | snippet bfun
34 | (${1:args}) =>
35 | $0
36 | # Class
37 | snippet cla class ..
38 | class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
39 | ${0}
40 | snippet cla class .. constructor: ..
41 | class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
42 | constructor: (${2:args}) ->
43 | ${3}
44 |
45 | ${0}
46 | snippet cla class .. extends ..
47 | class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
48 | ${0}
49 | snippet cla class .. extends .. constructor: ..
50 | class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
51 | constructor: (${3:args}) ->
52 | ${4}
53 |
54 | ${0}
55 | # If
56 | snippet if
57 | if $1
58 | ${0:${VISUAL}}
59 | # If __ Else
60 | snippet ife
61 | if $1
62 | ${2:${VISUAL}}
63 | else
64 | ${0}
65 | # Else if
66 | snippet eif
67 | else if $1
68 | ${0:${VISUAL}}
69 | # Ternary If
70 | snippet ifte Ternary
71 | if $1 then $2 else $0
72 | # Unless
73 | snippet unl Unless
74 | $1 unless $0
75 | # Switch
76 | snippet swi
77 | switch ${1:object}
78 | when ${2:value}
79 | $0
80 |
81 | # Log
82 | snippet log
83 | console.log ${0}
84 | # Try __ Catch
85 | snippet try
86 | try
87 | ${1:${VISUAL}}
88 | catch ${2:error}
89 | ${0}
90 | # Require
91 | snippet req
92 | ${2:$1} = require '${1:sys}'
93 | # Export
94 | snippet exp
95 | ${0:root} = exports ? this
96 |
97 | snippet jsonp
98 | JSON.parse ${0:jstr}
99 | # JSON.stringify
100 | snippet jsons
101 | JSON.stringify ${0:object}
102 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/coffee/requirejs_coffee.snippets:
--------------------------------------------------------------------------------
1 | snippet def
2 | define ["${1:#dependencies1}"], (${2:#dependencies2}) ->
3 | ${0:TARGET}
4 |
5 | snippet defn
6 | define "${1:#name}", ["${2:#dependencies1}"], (${3:#dependencies2}) ->
7 | ${0:TARGET}
8 |
9 | snippet reqjs
10 | require ["${1:#dependencies1}"], (${2:#dependencies2}) ->
11 | ${0:TARGET}
12 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/crystal.snippets:
--------------------------------------------------------------------------------
1 | snippet req require
2 | require "${1}"
3 | snippet case
4 | case $1
5 | when $2
6 | ${0}
7 | end
8 | snippet when
9 | when $1
10 | ${0}
11 | snippet def
12 | def ${1:method_name}
13 | ${0}
14 | end
15 | snippet pdef
16 | private def ${1:method_name}
17 | ${0}
18 | end
19 | snippet if
20 | if $1
21 | ${0:${VISUAL}}
22 | end
23 | snippet ife
24 | if $1
25 | ${2:${VISUAL}}
26 | else
27 | ${0}
28 | end
29 | snippet wh
30 | while $1
31 | ${0:${VISUAL}}
32 | end
33 | snippet cla class .. end
34 | class ${1:`substitute(vim_snippets#Filename(), "\(_\|^\)\(.\)", "\u\2", "g")`}
35 | ${0}
36 | end
37 | snippet mod class .. end
38 | module ${1:`substitute(vim_snippets#Filename(), "\(_\|^\)\(.\)", "\u\2", "g")`}
39 | ${0}
40 | end
41 | snippet r
42 | getter ${0:name}
43 | snippet r!
44 | getter! ${0:name}
45 | snippet r?
46 | getter? ${0:name}
47 | snippet w
48 | setter ${0:name}
49 | snippet w!
50 | setter! ${0:name}
51 | snippet w?
52 | setter? ${0:name}
53 | snippet rw
54 | property ${0:name}
55 | snippet rw!
56 | property! ${0:name}
57 | snippet rw?
58 | property? ${0:name}
59 | snippet defs
60 | def self.${1:class_method_name}
61 | ${0}
62 | end
63 | snippet defi
64 | def initialize(${1})
65 | ${0}
66 | end
67 | snippet do
68 | do
69 | ${0:${VISUAL}}
70 | end
71 | snippet dov
72 | do |${1:v}|
73 | ${2}
74 | end
75 | snippet desc
76 | describe ${1:`substitute(substitute(vim_snippets#Filename(), "_spec$", "", ""), "\(_\|^\)\(.\)", "\u\2", "g")`} do
77 | ${0}
78 | end
79 | snippet it
80 | it "${1}" do
81 | ${0}
82 | end
83 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/cuda.snippets:
--------------------------------------------------------------------------------
1 | extends cpp
2 |
3 | snippet kern "Kernel definition"
4 | __global__ void ${1:kernel}(${2:void}) {
5 | ${0:// TODO: Implement}
6 | }
7 |
8 | snippet dev "Device function definition"
9 | __device__ ${1:int} ${2:foo}(${3:void}) {
10 | ${0:// TODO: Implement}
11 | return 0;
12 | }
13 |
14 | snippet call "Kernel call"
15 | ${1:kernel}<<<${2:args}>>>(${3});${0}
16 |
17 | snippet sync "Synchonize threads"
18 | __syncthreads();
19 |
20 | snippet tid "Thread Index"
21 | threadIdx.${0}
22 |
23 | snippet bid "Block Index"
24 | blockIdx.${0}
25 |
26 | snippet bdim "Block Dimension"
27 | blockDim.${0}
28 |
29 | snippet ii "Get current index (1D)"
30 | int ${1:index} = threadIdx.${2:x} + blockIdx.$2 * blockDim.$2;
31 |
32 | snippet ix "Get current X index (1D)"
33 | int ${1:x} = threadIdx.x + blockIdx.x * blockDim.x;
34 |
35 | snippet iy "Get current Y index (1D)"
36 | int ${1:y} = threadIdx.y + blockIdx.y * blockDim.y;
37 |
38 | snippet iz "Get current Z index (1D)"
39 | int ${1:z} = threadIdx.z + blockIdx.z * blockDim.z;
40 |
41 | snippet ixy "Get current X,Y index (2D)"
42 | int ${1:x} = threadIdx.x + blockIdx.x * blockDim.x;
43 | int ${2:y} = threadIdx.y + blockIdx.y * blockDim.y;
44 |
45 | snippet ixz "Get current X,Z index (2D)"
46 | int ${1:x} = threadIdx.x + blockIdx.x * blockDim.x;
47 | int ${3:z} = threadIdx.z + blockIdx.z * blockDim.z;
48 |
49 | snippet iyz "Get current Y,Z index (2D)"
50 | int ${2:y} = threadIdx.y + blockIdx.y * blockDim.y;
51 | int ${3:z} = threadIdx.z + blockIdx.z * blockDim.z;
52 |
53 | snippet ixyz "Get current X,Y,Z index (3D)"
54 | int ${1:x} = threadIdx.x + blockIdx.x * blockDim.x;
55 | int ${2:y} = threadIdx.y + blockIdx.y * blockDim.y;
56 | int ${3:z} = threadIdx.z + blockIdx.z * blockDim.z;
57 |
58 | snippet share "Shared memory declaration"
59 | __shared__ ${1:int} ${2:memo}[${3:SIZE}];${0}
60 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/dart-flutter.snippets:
--------------------------------------------------------------------------------
1 | # Snippets for dart in flutter project, to use add the following to your .vimrc
2 | # `autocmd BufRead,BufNewFile,BufEnter *.dart UltiSnipsAddFiletypes dart-flutter`
3 | # Flutter stateless widget
4 | snippet stless
5 | class $1 extends StatelessWidget {
6 | const $1({super.key});
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return Container(
11 | $2
12 | );
13 | }
14 | }
15 |
16 | # Flutter stateful widget
17 | snippet stful
18 | class $1 extends StatefulWidget {
19 | const $1({super.key});
20 |
21 | @override
22 | State<$1> createState() => _$1State();
23 | }
24 |
25 | class _$1State extends State<$1> {
26 | @override
27 | Widget build(BuildContext context) {
28 | return Container(
29 | $2
30 | );
31 | }
32 | }
33 |
34 | # Flutter widget with AnimationController
35 | snippet stanim
36 | class $1 extends StatefulWidget {
37 | const $1({super.key});
38 |
39 | @override
40 | State<$1> createState() => _$1State();
41 | }
42 |
43 | class _$1State extends State<$1>
44 | with SingleTickerProviderStateMixin {
45 | AnimationController _controller;
46 |
47 | @override
48 | void initState() {
49 | super.initState();
50 | _controller = AnimationController(vsync: this);
51 | }
52 |
53 | @override
54 | void dispose() {
55 | super.dispose();
56 | _controller.dispose();
57 | }
58 |
59 | @override
60 | Widget build(BuildContext context) {
61 | return Container(
62 | $2
63 | );
64 | }
65 | }
66 |
67 | # Flutter scaffold application
68 | snippet fsa
69 | void main() {
70 | runApp(
71 | MaterialApp(
72 | title: 'Flutter Demo',
73 | theme: ThemeData(
74 | primarySwatch: Colors.blue,
75 | ),
76 | debugShowCheckedModeBanner: false,
77 | home: const HomePage(),
78 | ),
79 | );
80 | }
81 |
82 | class HomePage extends StatelessWidget {
83 | const HomePage({Key? key}) : super(key: key);
84 |
85 | @override
86 | Widget build(BuildContext context) {
87 | return Scaffold(
88 | appBar: AppBar(
89 | title: const Text('Home Page'),
90 | ),
91 | );
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/dart.snippets:
--------------------------------------------------------------------------------
1 | snippet af
2 | (${1}) {${2}}${0}
3 | snippet pr
4 | print(${1});
5 | snippet deb
6 | debugger();
7 | ${0}
8 | snippet lib
9 | library ${1};
10 | ${0}
11 | snippet im
12 | import 'package:${1}/${2}.dart';
13 | ${0}
14 | snippet rgx
15 | new RegExp(r'${1}')
16 | snippet var
17 | var ${1} = ${2};
18 | snippet main
19 | main() {
20 | ${0}
21 | }
22 | snippet st
23 | static ${0}
24 | snippet fi
25 | final ${0}
26 | snippet re
27 | return ${0}
28 | snippet br
29 | break;
30 | snippet th
31 | throw ${0}
32 | snippet cl
33 | class ${1:`vim_snippets#Filename("", "untitled")`} ${0}
34 | snippet in
35 | interface ${1:`vim_snippets#Filename("", "untitled")`} ${0}
36 | snippet imp
37 | implements ${0}
38 | snippet ext
39 | extends ${0}
40 | snippet if
41 | if (${1:true}) {
42 | ${0}
43 | }
44 | snippet ife
45 | if (${1:true}) {
46 | ${2}
47 | } else {
48 | ${0}
49 | }
50 | snippet el
51 | else
52 | snippet sw
53 | switch (${1}) {
54 | ${0}
55 | }
56 | snippet cs
57 | case ${1}:
58 | ${0}
59 | snippet de
60 | default:
61 | ${0}
62 | snippet for
63 | for (var ${2:i} = 0, len = ${1:things}.length; $2 < len; ${3:++}$2) {
64 | ${0:$1[$2]}
65 | }
66 | snippet fore
67 | for (final ${2:item} in ${1:itemList}) {
68 | ${0}
69 | }
70 | snippet wh
71 | while ($1) {
72 | ${0}
73 | }
74 | snippet dowh
75 | do {
76 | ${0}
77 | } while ($0);
78 | snippet as
79 | assert($0);
80 | snippet try
81 | try {
82 | ${0:${VISUAL}}
83 | } catch (${1:Exception e}) {
84 | }
85 | snippet tryf
86 | try {
87 | ${0:${VISUAL}}
88 | } catch (${1:Exception e}) {
89 | } finally {
90 | }
91 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/diff.snippets:
--------------------------------------------------------------------------------
1 | # DEP-3 (http://dep.debian.net/deps/dep3/) style patch header
2 | snippet header DEP-3 style header
3 | Description: ${1}
4 | Origin: ${2:vendor|upstream|other}, ${3:url of the original patch}
5 | Bug: ${4:url in upstream bugtracker}
6 | Forwarded: ${5:no|not-needed|url}
7 | Author: ${6:`g:snips_author`}
8 | Reviewed-by: ${7:name and email}
9 | Last-Update: ${8:`strftime("%Y-%m-%d")`}
10 | Applied-Upstream: ${0:upstream version|url|commit}
11 |
12 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/dosini.snippets:
--------------------------------------------------------------------------------
1 | snippet ec
2 | ; http://editorconfig.org
3 |
4 | root = true
5 |
6 | [*]
7 | indent_style = ${1:space_or_tab}
8 | indent_size = ${2:indent_size}
9 | end_of_line = lf
10 | charset = utf-8
11 | trim_trailing_whitespace = true
12 | insert_final_newline = true
13 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/eelixir.snippets:
--------------------------------------------------------------------------------
1 | extends html
2 |
3 | snippet % <% %>
4 | <% ${0} %>
5 | snippet = <%= %>
6 | <%= ${0} %>
7 | snippet # <%# %>
8 | <%# ${0} %>
9 | snippet end
10 | <% end %>
11 | snippet for
12 | <%= for ${1:item} <- ${2:items} ${3:@conn} do %>
13 | ${0}
14 | <% end %>
15 | snippet if
16 | <%= if ${1} do %>
17 | ${0:${VISUAL}}
18 | <% end %>
19 | snippet ife
20 | <%= if ${1} do %>
21 | ${2:${VISUAL}}
22 | <% else %>
23 | ${0}
24 | <% end %>
25 | snippet cond
26 | <%= cond do %>
27 | <% ${1} -> %>
28 | ${2:${VISUAL}}
29 |
30 | <% true -> %>
31 | ${0}
32 | <% end %>
33 | snippet unless
34 | <%= unless ${1} do %>
35 | ${0:${VISUAL}}
36 | <% end %>
37 | snippet ft form_tag
38 | <%= form_tag(${1:"/users"}, method: ${2::post}) %>
39 | ${0}
40 |
41 |
42 | snippet sl select
43 | <%= select ${1:f}, :${2:field}, ${3:[{"key", "value"}]}, prompt: ${4:"Prompt"} %>
44 |
45 | snippet sb submit
46 | <%= submit ${1:"Submit"} %>
47 |
48 | snippet rb radio_button
49 | <%= radio_button ${1:f}, :${2:field}, ${3:"value"} %>
50 |
51 |
52 | snippet et error_tag
53 | <%= error_tag ${1:f}, :${2:field} %>
54 | snippet ti text_input
55 | <%= text_input ${1:f}, :${2:field} %>
56 | snippet la label
57 | <%= label ${1:f}, :${2:field}, "${3:Label}" %>
58 | snippet pi password_input
59 | <%= password_input ${1:f}, :${2:password} %>
60 | snippet render
61 | <%= render "${1:index}.html", ${2:var: @var} %>
62 | snippet lin link
63 | <%= link "${1:Submit}", to: ${2:"/users"}, method: ${3::delete} %>
64 | snippet ff form_for
65 | <%= form_for @changeset, ${1:"/users"}, fn f -> %>
66 | ${0}
67 |
68 | <%= submit "Submit" %>
69 | <% end %>
70 | snippet pry
71 | <% require IEx; IEx.pry %>
72 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/elm.snippets:
--------------------------------------------------------------------------------
1 | snippet mod
2 | module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` exposing (${1})
3 | ${0}
4 | snippet imp
5 | import ${0:Http}
6 | snippet impe
7 | import ${1:Html} exposing (${0:..})
8 | snippet impae
9 | import ${1:Json.Encode} as ${2:Encode} exposing (${0:Value})
10 | snippet fn
11 | ${1:fn} : ${2:a} -> ${3:a}
12 | $1 ${4} =
13 | ${0}
14 | snippet fn1
15 | ${1:fn} : ${2:a} -> ${3:a}
16 | $1 ${4} =
17 | ${0}
18 | snippet fn2
19 | ${1:fn} : ${2:a} -> ${3:a} -> ${4:a}
20 | $1 ${5} =
21 | ${0}
22 | snippet fn3
23 | ${1:fn} : ${2:a} -> ${3:a} -> ${4:a} -> ${5:a}
24 | $1 ${6} =
25 | ${0}
26 | snippet fn0
27 | ${1:fn} : ${2:a}
28 | $1 =
29 | ${0}
30 | snippet case
31 | case ${1} of
32 | ${2} ->
33 | ${0}
34 | snippet -
35 | ${1} ->
36 | ${0}
37 | snippet let
38 | let
39 | ${1} =
40 | ${2}
41 | in
42 | ${0}
43 | snippet if
44 | if ${1} then
45 | ${2:${VISUAL}}
46 | else
47 | ${0}
48 | snippet ty
49 | type ${1:Msg}
50 | = ${0}
51 | snippet tya
52 | type alias ${1:Model} =
53 | ${0}
54 | snippet test
55 | test "${1}" <| \_ -> $0
56 | snippet desc
57 | describe "${1}" [ $0 ]
58 | snippet doc
59 | {-| ${0}
60 | -}
61 | snippet p
62 | |> ${0}
63 | snippet program Elm 0.18 program
64 | import Html exposing (Html)
65 |
66 |
67 | type alias Model =
68 | {}
69 |
70 |
71 | type Msg
72 | = Noop
73 |
74 |
75 | main : Program Never Model Msg
76 | main =
77 | Html.program
78 | { init = init
79 | , view = view
80 | , update = update
81 | , subscriptions = subscriptions
82 | }
83 |
84 |
85 | init : ( Model, Cmd Msg )
86 | init =
87 | {} ! []
88 |
89 |
90 | update : Msg -> Model -> ( Model, Cmd Msg )
91 | update msg model =
92 | case msg of
93 | Noop ->
94 | model ! []
95 |
96 |
97 | subscriptions : Model -> Sub Msg
98 | subscriptions model =
99 | Sub.none
100 |
101 |
102 | view : Model -> Html Msg
103 | view model =
104 | Html.text "Hello, sailor!"
105 | snippet element
106 | module Main exposing (Model, Msg(..), init, main, subscriptions, update, view)
107 |
108 | import Browser
109 | import Html exposing (..)
110 | import Json.Encode
111 |
112 |
113 | main : Program Flags Model Msg
114 | main =
115 | Browser.element
116 | { init = init
117 | , update = update
118 | , subscriptions = subscriptions
119 | , view = view
120 | }
121 |
122 |
123 | type alias Model =
124 | {}
125 |
126 |
127 | type alias Flags =
128 | Json.Encode.Value
129 |
130 |
131 | init : Flags -> ( Model, Cmd Msg )
132 | init flags_ =
133 | ( {}
134 | , Cmd.none
135 | )
136 |
137 |
138 | type Msg
139 | = Noop
140 |
141 |
142 | update : Msg -> Model -> ( Model, Cmd Msg )
143 | update msg model =
144 | case msg of
145 | Noop ->
146 | ( model
147 | , Cmd.none
148 | )
149 |
150 |
151 | subscriptions : Model -> Sub Msg
152 | subscriptions model =
153 | Sub.none
154 |
155 |
156 | view : Model -> Html Msg
157 | view model =
158 | h1 [] [ text "Hello, world!" ]
159 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/falcon.snippets:
--------------------------------------------------------------------------------
1 | snippet #!
2 | #!/usr/bin/env falcon
3 |
4 | # Import
5 | snippet imp
6 | import ${0:module}
7 |
8 | # Function
9 | snippet fun
10 | function ${2:function_name}(${3})
11 | ${0}
12 | end
13 |
14 | # Class
15 | snippet class
16 | class ${1:class_name}(${2:class_params})
17 | ${0:/* members/methods */}
18 | end
19 |
20 | # If
21 | snippet if
22 | if $1
23 | ${0}
24 | end
25 |
26 | # If else
27 | snippet ife
28 | if $1
29 | ${0}
30 | else
31 | ${1}
32 | end
33 |
34 | # If else if
35 | snippet eif
36 | elif $1
37 | ${0}
38 |
39 | # Switch case
40 | snippet switch
41 | switch ${1:expression}
42 | case ${2:item}
43 | case ${0:item}
44 | default
45 | end
46 |
47 | # Select
48 | snippet select
49 | select ${1:variable}
50 | case ${2:TypeSpec}
51 | case ${0:TypeSpec}
52 | default
53 | end
54 |
55 | # For/in Loop
56 | snippet forin
57 | for ${1:element} in ${2:container}
58 | ${0}
59 | end
60 |
61 | # For/to Loop
62 | snippet forto
63 | for ${1:lowerbound} to ${2:upperbound}
64 | ${0}
65 | end
66 |
67 | # While Loop
68 | snippet wh
69 | while ${1:conidition}
70 | ${0}
71 | end
72 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/fortran.snippets:
--------------------------------------------------------------------------------
1 | snippet impl
2 | implicit none
3 | ${0}
4 | snippet prog
5 | program ${1:main}
6 | ${0}
7 | end program $1
8 | snippet mod
9 | module ${1:modulename}
10 | ${0}
11 | end module $1
12 | snippet proc
13 | procedure ${1:name}
14 | ${0}
15 | end procedure $1
16 | snippet iface
17 | interface ${1:name}
18 | ${0}
19 | end interface $1
20 | snippet doc
21 | ! """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
22 | ! File: ${2:`vim_snippets#Filename('$1')`}
23 | ! Author: `g:snips_author`
24 | ! Email: `g:snips_email`
25 | ! Github: `g:snips_github`
26 | ! Description: $1
27 | ! """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
28 | ${0}
29 | snippet dox
30 | !> @brief ${1}
31 | !!
32 | !> ${2}
33 | !> @author `g:snips_author`
34 | ${0}
35 | snippet doxp
36 | !> @param[${1}]${0}
37 | # Variables definitions
38 | # Boolean
39 | snippet bool
40 | logical :: ${0}
41 | # Integer
42 | snippet int
43 | integer :: ${0}
44 | snippet real
45 | real :: ${0}
46 | # Double Precision
47 | snippet double
48 | double precision :: ${0}
49 | # Char
50 | snippet str
51 | character(len=${1:*}) :: ${0:}
52 | # Types
53 | snippet type
54 | type(${1:name})
55 | ${0}
56 | end type
57 | snippet const
58 | ${1:type}, parameter :: $2 = ${0}
59 | snippet arr
60 | ${1:type}, ${2:allocatable, }dimension(${3::}) :: ${0}
61 | snippet intent
62 | ${1:type}, intent(inout) :: ${0}
63 | # Array
64 | snippet /
65 | (/ $1 /) ${2:,&} ${0}
66 | snippet if
67 | if ($1) then
68 | ${0}
69 | end if
70 | snippet case
71 | select case (${1:expr})
72 | case ($2)
73 | case default
74 | $3
75 | end select ${0}
76 | snippet do
77 | do ${1:i} = ${2:start}, ${3:end}, ${4:incr}
78 | ${0}
79 | end do
80 | snippet dow
81 | do while ($1)
82 | $2
83 | end do
84 | snippet sub
85 | subroutine ${1:name}($2)
86 | ${0}
87 | end subroutine $1
88 | snippet func
89 | function ${1:name}($2) result($3)
90 | ${0}
91 | end function $1
92 | snippet pr
93 | write(*,*) ${0}
94 | snippet dpr
95 | write(*,*) '$1 = ', $1
96 | snippet read
97 | read(unit = ${1:fp}, file = ${2:filename}, iostat = ${3:ierr}) ${0}
98 | snippet write
99 | write(unit = ${1:fp}, file = ${2:filename}, iostat = ${3:ierr}) ${0}
100 | snippet open
101 | open(unit = ${1:fp}, file = ${2:filename}, status = ${3:unknown}, iostat = ${4:ierr}) ${0}
102 | snippet close
103 | close(unit = ${1:fp}) ${0}
104 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/freemarker.snippets:
--------------------------------------------------------------------------------
1 | extends html
2 |
3 | # Freemarker version
4 | snippet ver "${.version}"
5 | \${.version}
6 | # Interpolation
7 | snippet int "${interpolation}"
8 | \${${0:interpolation${VISUAL}}\}
9 | # Interpolation with default string
10 | snippet intd "${interpolation!"default_string"}"
11 | \${${0:interpolation${VISUAL}}!"${1:default_string}"\}
12 | # Comment
13 | snippet com "<#-- comment -->"
14 | <#-- ${0:comment${VISUAL}} -->
15 | # Variable assignment on a single line
16 | snippet ass "<#assign variable_name = value />"
17 | <#assign ${1:variable_name} = ${0:value${VISUAL}} />
18 | # Variable assignments on multiple lines
19 | snippet assm "<#assign <#-- multiple lines --> />"
20 | <#assign
21 | ${1:variable_name} = ${0:value${VISUAL}}
22 | />
23 | # Local variable assignment on a single
24 | snippet loc "<#local variable_name = value />"
25 | <#local ${1:variable_name} = ${0:value${VISUAL}} />
26 | # Local variable assignments on multiple lines
27 | snippet locm "<#local <#-- multiple lines --> />"
28 | <#local
29 | ${1:variable_name} = ${0:value${VISUAL}}
30 | />
31 | # Include Freemarker file
32 | snippet inc "<#include \"file.ftl\" />"
33 | <#include "${0:file.ftl${VISUAL}}" />
34 | # If statement
35 | snippet if "<#if condition>...#if>"
36 | <#if ${1:true}>
37 | ${0:${VISUAL}}
38 | #if>
39 | # If/else statement
40 | snippet ife "<#if condition>...<#else>...#if>"
41 | <#if ${1:true}>
42 | ${0:${VISUAL}}
43 | <#else>
44 | ${2}
45 | #if>
46 | # Iteration over a sequence
47 | snippet lis "<#list sequence as element>...#list>"
48 | <#list ${1:sequence} as ${2:element}>
49 | ${0:${VISUAL}}
50 | #list>
51 | # Iteration over an hashmap
52 | snippet lish "<#list hashmap?keys as element>...#list>"
53 | <#list ${1:hashmap}?keys as ${2:key}>
54 | \${$2\}: \${$1[$2]\}${0:${VISUAL}}
55 | #list>
56 | # Macro statement
57 | snippet mac "<#macro macro_name param1>...#macro>"
58 | <#macro ${1:macro_name} ${2:param1}>
59 | ${0:${VISUAL}}
60 | #macro>
61 | # Function statement
62 | snippet fun "<#function function_name param1>...#function>"
63 | <#function ${1:function_name} ${2:param1}>
64 | ${0:${VISUAL}}
65 | #function>
66 | # Attempt statement (try-catch to prevent runtime exceptions)
67 | snippet att "<#attempt>...<#recover>#attempt>"
68 | <#attempt>
69 | ${0:${VISUAL}}
70 | <#recover>
71 | #attempt>
72 | # Then built-in for booleans
73 | snippet ?th "?then(true, false)"
74 | ?then(${1:true}, ${0:false${VISUAL}})
75 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/fsharp.snippets:
--------------------------------------------------------------------------------
1 | snippet doc
2 | /// ${0}
3 | snippet comment
4 | // ${0}
5 | snippet let
6 | let ${1} = ${0}
7 | snippet lit
8 | []
9 | let ${1} = ${0}
10 | snippet rec
11 | type ${1} = { ${0} }
12 | snippet arec
13 | {| ${0} |}
14 | snippet fn
15 | let ${1} =
16 | ${0}
17 | snippet fnr
18 | let rec ${1} =
19 | ${0}
20 | snippet lam
21 | (fun ${1} -> ${0})
22 | snippet mod
23 | module ${1} =
24 | ${0}
25 | snippet for
26 | for ${1} in ${2} do
27 | ${0}
28 | snippet if
29 | if ${1} then
30 | ${2}
31 | snippet ife
32 | if ${1} then
33 | ${2}
34 | else
35 | ${0}
36 | snippet ifee
37 | if ${1} then
38 | ${2}
39 | elif ${3} then
40 | ${4}
41 | else
42 | ${0}
43 | snippet eif
44 | elif ${1} then
45 | ${0}
46 | snippet el
47 | else
48 | ${0}
49 | snippet try
50 | try
51 | ${1}
52 | with ${0}
53 | snippet match
54 | match ${1} with
55 | | ${2} -> ${0}
56 | snippet |
57 | | ${1} -> ${0}
58 | snippet p
59 | |> ${0}
60 | snippet pr
61 | printfn "${1}" ${0}
62 | snippet pri
63 | printfn \$"${0}"
64 | snippet amap
65 | |> Array.map (fun ${1} -> ${0})
66 | snippet lmap
67 | |> List.map (fun ${1} -> ${0})
68 | snippet smap
69 | |> Seq.map (fun ${1} -> ${0})
70 | snippet atap
71 | |> Array.map (fun x -> printfn "%A" x; x) // tap
72 | snippet ltap
73 | |> List.map (fun x -> printfn "%A" x; x) // tap
74 | snippet stap
75 | |> Seq.map (fun x -> printfn "%A" x; x) // tap
76 | snippet main
77 | []
78 | let main argv =
79 | ${0}
80 | 0
81 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/gdscript.snippets:
--------------------------------------------------------------------------------
1 | snippet class
2 | class $1 extends ${2:Reference}
3 | \t$3
4 |
5 |
6 | snippet pr
7 | print($1)
8 |
9 |
10 | snippet ready
11 | func _ready():
12 | \t${1:pass}
13 |
14 |
15 | snippet init
16 | func _init():
17 | \t${1:pass}
18 |
19 |
20 | snippet process
21 | func _process(delta):
22 | \t${1:pass}
23 |
24 |
25 | snippet input
26 | func _input(event):
27 | \t${1:pass}
28 |
29 |
30 | snippet inpute
31 | func _input_event(event):
32 | \t${1:pass}
33 |
34 |
35 | snippet draw
36 | func _draw():
37 | \t${1:pass}
38 |
39 |
40 | snippet guii
41 | func _gui_input(event):
42 | \t${1:pass}
43 |
44 |
45 | snippet for
46 | for $1 in $2:
47 | \t${3:pass}
48 |
49 |
50 | snippet for
51 | for $1 in range(${2:start}{$3:,end}):
52 | \t${4:pass}
53 |
54 |
55 | snippet if
56 | if ${1:condition}:
57 | \t${3:pass}
58 | elif ${2:condition}:
59 | \t${4:pass}
60 | else:
61 | \t${5:pass}
62 |
63 |
64 | snippet if
65 | if ${1:condition}:
66 | \t${2:pass}
67 | else:
68 | \t${3:pass}
69 |
70 |
71 | snippet if
72 | if ${1:condition}:
73 | \t${2:pass}
74 |
75 |
76 | snippet while
77 | while ${1:condition}:
78 | \t${2:pass}
79 |
80 |
81 | snippet func
82 | func ${1:method}(${2:args}):
83 | \t${3:pass}
84 |
85 |
86 | snippet signal
87 | signal ${1:signalname}(${2:args})
88 |
89 |
90 | snippet export
91 | export(${1:type}${2:,other_configs}) var ${3:name}${4: = default}${5: setget }
92 |
93 |
94 | snippet var
95 | var ${1:name}${2: = default}${3: setget }
96 |
97 |
98 | snippet onready
99 | onready var ${1:name} = get_node($2)
100 |
101 |
102 | snippet is
103 | ${1:instance} is ${2:class}
104 |
105 |
106 | snippet in
107 | ${1:element} in ${$2:array}
108 |
109 |
110 | snippet gdscript
111 | extends ${1:BaseClass}
112 |
113 | # class member variables go here, for example:
114 | # var a = 2
115 | # var b = \textvar\
116 |
117 | func _ready():
118 | \t# Called every time the node is added to the scene.
119 | \t# Initialization here
120 | \tpass
121 |
122 |
123 |
124 | # snippet pass ##### do we really need this?
125 | # pass
126 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/gitcommit.snippets:
--------------------------------------------------------------------------------
1 | snippet co
2 | Co-authored-by: ${1} <${2}>
3 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/gleam.snippets:
--------------------------------------------------------------------------------
1 | snippet fn "fn"
2 | fn ${1:function_name}(${2}) -> ${3:Nil} {
3 | ${0:${VISUAL:todo}}
4 | }
5 |
6 | snippet pfn "pub fn"
7 | pub fn ${1:function_name}(${2}) -> ${3:Nil} {
8 | ${0:${VISUAL:todo}}
9 | }
10 |
11 | snippet test "test fn"
12 | pub fn ${1:name}_test() {
13 | ${0}
14 | }
15 |
16 | snippet af "anonymous fn"
17 | fn(${1}) { ${0:${VISUAL}} }
18 |
19 | snippet let "let binding"
20 | let ${1} = ${0}
21 |
22 | snippet l "let binding"
23 | let ${1} = ${0}
24 |
25 | snippet as "assert binding"
26 | let assert ${1} = ${0}
27 |
28 | snippet - "->"
29 | -> ${0}
30 |
31 | snippet case "case expression"
32 | case ${1} {
33 | ${2} -> ${0}
34 | }
35 |
36 | snippet ty "type"
37 | type ${1:Name} {
38 | ${0:$1}
39 | }
40 |
41 | snippet pty "pub type"
42 | pub type ${1:Name} {
43 | ${0:$1}
44 | }
45 |
46 | snippet tya "type alias"
47 | type ${1:Name} =
48 | ${0:$1}
49 |
50 | snippet ptya "pub type alias"
51 | pub type ${1:Name} =
52 | ${0:$1}
53 |
54 | snippet im "import"
55 | import ${0:gleam/result}
56 |
57 | snippet im. "import exposing"
58 | import ${1:gleam/result}.{${0}}
59 |
60 | snippet p "|>"
61 | |> ${0}
62 |
63 | snippet bl "block"
64 | {
65 | ${0:${VISUAL}}
66 | }
67 |
68 | snippet tf "fn(Type) -> Type"
69 | fn(${1}) -> ${0}
70 |
71 | snippet seq "should.equal"
72 | should.equal(${0:${VISUAL}})
73 |
74 | snippet strue "should.be_true"
75 | should.be_true(${0:${VISUAL}})
76 |
77 | snippet sfalse "should.be_false"
78 | should.be_false(${0:${VISUAL}})
79 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/haml.snippets:
--------------------------------------------------------------------------------
1 | snippet t
2 | %table
3 | %tr
4 | %th
5 | ${1:headers}
6 | %tr
7 | %td
8 | ${0:headers}
9 | snippet ul
10 | %ul
11 | %li
12 | ${0:item}
13 | %li
14 | snippet rp
15 | = render :partial => "${0:item}"
16 | snippet rpc
17 | = render :partial => "${1:item}", :collection => ${0:@$1s}
18 | snippet rpl
19 | = render :partial => "${1:item}", :locals => { :${2:$1} => ${0:@$1} }
20 | snippet rpo
21 | = render :partial => "${1:item}", :object => ${0:@$1}
22 | snippet lt
23 | = link_to ${1:name}, ${2:dest}
24 | snippet mt
25 | = mail_to ${1:email_address}, ${2:name}
26 | snippet mts
27 | = mail_to ${1:email_address}, ${2:name}, :subject => ${3}, :body => ${4}
28 | snippet ife
29 | - if $1
30 | ${2:${VISUAL}}
31 | - else
32 | ${0}
33 | snippet ifp
34 | - if $1.presence?
35 | ${0:${VISUAL}}
36 | snippet ntc
37 | = number_to_currency(${1})
38 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/handlebars.snippets:
--------------------------------------------------------------------------------
1 | snippet if # {{#if value}} ... {{/if}}
2 | {{#if ${1:value}}}
3 | ${0:${VISUAL}}
4 | {{/if}}
5 | snippet ifn # {{#unless value}} ... {{/unless}}
6 | {{#unless ${1:value}}}
7 | ${0:${VISUAL}}
8 | {{/unless}}
9 | snippet ife # {{#if value}} ... {{else}} .. {{/if}}
10 | {{#if ${1:value}}}
11 | ${2:${VISUAL}}
12 | {{else}}
13 | ${3}
14 | {{/if}}
15 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/heex.snippets:
--------------------------------------------------------------------------------
1 | extends eelixir
2 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/htmldjango.snippets:
--------------------------------------------------------------------------------
1 | # Generic tags
2 |
3 | extends html
4 |
5 | snippet %
6 | {% ${1} %}
7 | snippet %%
8 | {% ${1:tag_name} %}
9 | ${0}
10 | {% end$1 %}
11 | snippet {
12 | {{ ${1} }}
13 | # Template Tags
14 |
15 | snippet autoescape
16 | {% autoescape ${1:off} %}
17 | ${0}
18 | {% endautoescape %}
19 | snippet block
20 | {% block ${1} %}
21 | ${0}
22 | {% endblock %}
23 | snippet #
24 | {# ${0:comment} #}
25 | snippet comment
26 | {% comment %}
27 | ${0}
28 | {% endcomment %}
29 | snippet cycle
30 | {% cycle ${1:val1} ${2:val2} ${3:as ${4}} %}
31 | snippet debug
32 | {% debug %}
33 | snippet extends
34 | {% extends "${0:base.html}" %}
35 | snippet filter
36 | {% filter ${1} %}
37 | ${0}
38 | {% endfilter %}
39 | snippet firstof
40 | {% firstof ${1} %}
41 | snippet for
42 | {% for ${1} in ${2} %}
43 | ${0}
44 | {% endfor %}
45 | snippet empty
46 | {% empty %}
47 | ${0}
48 | snippet if
49 | {% if ${1} %}
50 | ${0}
51 | {% endif %}
52 | snippet el
53 | {% else %}
54 | ${1}
55 | snippet eif
56 | {% elif ${1} %}
57 | ${0}
58 | snippet ifchanged
59 | {% ifchanged %}${1}{% endifchanged %}
60 | snippet ifequal
61 | {% ifequal ${1} ${2} %}
62 | ${0}
63 | {% endifequal %}
64 | snippet ifnotequal
65 | {% ifnotequal ${1} ${2} %}
66 | ${0}
67 | {% endifnotequal %}
68 | snippet include
69 | {% include "${0}" %}
70 | snippet load
71 | {% load ${0} %}
72 | snippet now
73 | {% now "${0:jS F Y H:i}" %}
74 | snippet regroup
75 | {% regroup ${1} by ${2} as ${0} %}
76 | snippet spaceless
77 | {% spaceless %}${0}{% endspaceless %}
78 | snippet ssi
79 | {% ssi ${0} %}
80 | snippet trans
81 | {% trans "${0:string}" %}
82 | snippet url
83 | {% url ${1} as ${0} %}
84 | snippet widthratio
85 | {% widthratio ${1:this_value} ${2:max_value} ${0:100} %}
86 | snippet with
87 | {% with ${1} as ${2} %}
88 | ${0}
89 | {% endwith %}
90 |
91 | # Template Filters
92 |
93 | # Note: Since SnipMate can't determine which template filter you are
94 | # expanding without the "|" character, these do not add the "|"
95 | # character. These save a few keystrokes still.
96 |
97 | # Note: Template tags that take no arguments are not implemented.
98 |
99 | snippet add
100 | add:"${0}"
101 | snippet center
102 | center:"${0}"
103 | snippet cut
104 | cut:"${0}"
105 | snippet date
106 | date:"${0}"
107 | snippet default
108 | default:"${0}"
109 | snippet defaultifnone
110 | default_if_none:"${0}"
111 | snippet dictsort
112 | dictsort:"${0}"
113 | snippet dictsortrev
114 | dictsortreversed:"${0}"
115 | snippet divisibleby
116 | divisibleby:"${0}"
117 | snippet floatformat
118 | floatformat:"${0}"
119 | snippet getdigit
120 | get_digit:"${0}"
121 | snippet join
122 | join:"${0}"
123 | snippet lengthis
124 | length_is:"${0}"
125 | snippet pluralize
126 | pluralize:"${0}"
127 | snippet removetags
128 | removetags:"${0}"
129 | snippet slice
130 | slice:"${0}"
131 | snippet stringformat
132 | stringformat:"${0}"
133 | snippet time
134 | time:"${0}"
135 | snippet truncatewords
136 | truncatewords:${0}
137 | snippet truncatewordshtml
138 | truncatewords_html:${0}
139 | snippet urlizetrunc
140 | urlizetrunc:${0}
141 | snippet wordwrap
142 | wordwrap:${0}
143 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/htmltornado.snippets:
--------------------------------------------------------------------------------
1 | # Generic tags
2 |
3 | snippet {
4 | {{ ${0} }}
5 |
6 | # Template tags
7 |
8 | snippet extends
9 | {% extends "${0:base.html}" %}
10 | snippet autoescape
11 | {% autoescape ${0:xhtml_escape | None} %}
12 | snippet apply
13 | {% apply ${1:function} %}
14 | ${0}
15 | {% end %}
16 | snippet block
17 | {% block ${1} %}
18 | ${0}
19 | {% end %}
20 | snippet for
21 | {% for ${1:item} in ${2} %}
22 | ${0}
23 | {% end %}
24 | snippet from
25 | {% from ${1:x} import ${0:y} %}
26 | snippet if
27 | {% if $1 %}
28 | ${0}
29 | {% end %}
30 | snippet eif
31 | {% elif $0 %}
32 | snippet el
33 | {% else %}
34 | snippet import
35 | {% import ${0:module} %}
36 | snippet include
37 | {% include "${0:filename}" %}
38 | snippet module
39 | {% module ${0:expression} %}
40 | snippet raw
41 | {% raw ${0:expression} %}
42 | snippet set
43 | {% set ${1:x} = ${0:y} %}
44 | snippet try
45 | {% try %}
46 | ${1:${VISUAL}}
47 | {% except %}
48 | ${2}
49 | {% finallly %}
50 | ${0}
51 | {% end %}
52 | snippet wh
53 | {% while $1 %}
54 | ${0}
55 | {% end %}
56 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/idris.snippets:
--------------------------------------------------------------------------------
1 | snippet mod
2 | module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')`
3 | ${0}
4 | snippet imp
5 | import ${0:List}
6 | snippet fn
7 | ${1:fn} : ${2:a} -> ${3:a}
8 | $1 ${4} =
9 | ${0}
10 | snippet fn1
11 | ${1:fn} : ${2:a} -> ${3:a}
12 | $1 ${4} =
13 | ${0}
14 | snippet fn2
15 | ${1:fn} : ${2:a} -> ${3:a} -> ${4:a}
16 | $1 ${5} =
17 | ${0}
18 | snippet fn3
19 | ${1:fn} : ${2:a} -> ${3:a} -> ${4:a} -> ${5:a}
20 | $1 ${6} =
21 | ${0}
22 | snippet fn0
23 | ${1:fn} : ${2:a}
24 | $1 =
25 | ${0}
26 | snippet case
27 | case ${1} of
28 | ${2} =>
29 | ${0}
30 | snippet let
31 | let
32 | ${1} =
33 | ${2}
34 | in
35 | ${0}
36 | snippet wh
37 | where
38 | ${0}
39 | snippet if
40 | if ${1} then
41 | ${2:${VISUAL}}
42 | else
43 | ${0}
44 | ${0}
45 | snippet \ "Lambda function (\x => ...)"
46 | (\\${1:_} => ${0})
47 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/jade.snippets:
--------------------------------------------------------------------------------
1 | # Angular HTML
2 | snippet rep
3 | div(ng-repeat='${1} in ${2}')
4 |
5 | snippet repf
6 | div(ng-repeat='${1} in ${2}' | ${3})
7 |
8 | snippet repi
9 | div(ng-repeat='${1} in ${2}' track by $index)
10 |
11 | snippet hide
12 | div(ng-hide='${1}')
13 |
14 | snippet show
15 | div(ng-show='${1}')
16 |
17 | snippet if
18 | div(ng-if='${1}')
19 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/javascript-bemjson.snippets:
--------------------------------------------------------------------------------
1 | # Snippet for bemjson. https://en.bem.info/platform/bemjson/
2 |
3 | # Blocks
4 | snippet b
5 | {
6 | block : '${1:name}',
7 | content : [
8 | '${2:content}'
9 | ]
10 | }
11 |
12 | # btc - BEM block with text content
13 | snippet btc
14 | {
15 | block : '${1:name}',
16 | content: '${2:content}'
17 | }
18 |
19 | # bwm - BEM block with modifier.
20 | snippet bwm
21 | {
22 | block : '${1:name}',
23 | mods: { ${2:modName}: '${3:modVal}' },
24 | content : [
25 | '${4:content}'
26 | ]
27 | }
28 |
29 | # Elems
30 |
31 | # e - BEM elem
32 | snippet e
33 | {
34 | elem : '${1:name}',
35 | content : [
36 | '${2:content}'
37 | ]
38 | }
39 |
40 |
41 | # mo - Mods
42 | snippet mo
43 | mods : { ${1:modName} : '${2:modVal}' },
44 |
45 | # mi - BEM mix mod
46 | snippet mi
47 | mix : [ { ${1:block} : '${2:block}' } ],
48 |
49 | # a - BEM attrs mod
50 | snippet a
51 | attrs : { ${1:attr} : '${2:val}' },
52 |
53 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/javascript-d3.snippets:
--------------------------------------------------------------------------------
1 | snippet .attr
2 | .attr("${1}", ${2})
3 | snippet .style
4 | .style("${1}", ${2})
5 | snippet axis
6 | d3.svg.axis()
7 | .orient(${1})
8 | .scale(${2})
9 | snippet fd
10 | function(d) { ${1} }
11 | snippet fdi
12 | function(d, i) { ${1} }
13 | snippet marginconvention
14 | var ${1:margin} = { top: ${2:10}, right: ${3:10}, bottom: ${4:10}, left: ${5:10} };
15 | var ${6:width} = ${7:970} - $1.left - $1.right;
16 | var ${8:height} = ${9:500} - $1.top - $1.bottom;
17 |
18 | var ${10:svg} = d3.select("${11}").append("svg")
19 | .attr("width", $6 + $1.left + $1.right)
20 | .attr("height", $8 + $1.top + $1.bottom)
21 | .append("g")
22 | .attr("transform", "translate(" + $1.left + "," + $1.top + ")")
23 | snippet nest
24 | d3.nest()
25 | .key(${1})
26 | .entries(${2})
27 | snippet scale
28 | d3.scale.linear()
29 | .domain(${1})
30 | .range(${2})
31 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/javascript-mocha.snippets:
--------------------------------------------------------------------------------
1 | snippet des "describe('thing', function() { ... })" b
2 | describe('${1:}', function() {
3 | ${0:${VISUAL}}
4 | });
5 | snippet it "it('should do', function() { ... })" b
6 | it('${1:}', function() {
7 | ${0:${VISUAL}}
8 | });
9 | snippet xit "xit('should do', function() { ... })" b
10 | xit('${1:}', function() {
11 | ${0:${VISUAL}}
12 | });
13 | snippet bef "before(function() { ... })" b
14 | before(function() {
15 | ${0:${VISUAL}}
16 | });
17 | snippet befe "beforeEach(function() { ... })" b
18 | beforeEach(function() {
19 | ${0:${VISUAL}}
20 | });
21 | snippet aft "after(function() { ... })" b
22 | after(function() {
23 | ${0:${VISUAL}}
24 | });
25 | snippet afte "afterEach(function() { ... })" b
26 | afterEach(function() {
27 | ${0:${VISUAL}}
28 | });
29 | snippet exp "expect(...)" b
30 | expect(${1:})${0};
31 | snippet expe "expect(...).to.equal(...)" b
32 | expect(${1:}).to.equal(${0});
33 | snippet expd "expect(...).to.deep.equal(...)" b
34 | expect(${1:}).to.deep.equal(${0});
35 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/javascript/javascript-redux.snippets:
--------------------------------------------------------------------------------
1 | snippet ist
2 | import { createStore } from 'redux';
3 | snippet con
4 | connect(${1:mapStateToProps}, ${2:mapDispatchToProps})(<${3:VISUAL}/>);
5 | snippet act
6 | const ${1:actionName} = (${2:arg}) => {
7 | return {
8 | type: ${3:VISUAL},
9 | $2
10 | };
11 | };
12 | snippet rdc
13 | const ${1:reducerName} = (state={}, action) => {
14 | switch(action.type) {
15 | case ${1:action}:
16 | return {
17 | ...state,
18 | $2
19 | };
20 | default:
21 | return state;
22 | };
23 | };
24 | snippet mstp
25 | const mapStateToProps = (state) => {
26 | return {
27 | ${1:propName}: state.$1,
28 | };
29 | };
30 | snippet mdtp
31 | const mapDispatchToProps = (dispatch) => {
32 | return {
33 | ${1:propName}: () => {
34 | dispatch(${2:actionName}());
35 | },
36 | };
37 | };
38 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/javascript/javascript-requirejs.snippets:
--------------------------------------------------------------------------------
1 | snippet def
2 | define(["${1:#dependencies1}"], function (${2:#dependencies2}) {
3 | return ${0:TARGET};
4 | });
5 |
6 | snippet defn
7 | define("${1:#name}", ["${2:#dependencies1}"], function (${3:#dependencies2}) {
8 | return ${0:TARGET};
9 | });
10 |
11 | snippet reqjs
12 | require(["${1:#dependencies1}"], function (${2:#dependencies2}) {
13 | return ${0:TARGET};
14 | });
15 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/javascript/javascript.node.snippets:
--------------------------------------------------------------------------------
1 | snippet #!
2 | #!/usr/bin/env node
3 | # module exports
4 | snippet ex
5 | module.exports = ${1};
6 | # require
7 | snippet re
8 | const ${1} = require('${2:module_name}');
9 | # EventEmitter
10 | snippet on
11 | on('${1:event_name}', function(${2:stream}) {
12 | ${3}
13 | });
14 | snippet emit
15 | emit('${1:event_name}', ${2:args});
16 | snippet once
17 | once('${1:event_name}', function(${2:stream}) {
18 | ${3}
19 | });
20 | # http. User js function snippet as handler
21 | snippet http
22 | http.createServer(${1:handler}).listen(${2:port_number});
23 | # net
24 | snippet net
25 | net.createServer(function(${1:socket}){
26 | ${1}.on('data', function('data'){
27 | ${2}
28 | ]});
29 | ${1}.on('end', function(){
30 | ${3}
31 | });
32 | }).listen(${4:8124});
33 | # Stream snippets
34 | snippet pipe
35 | pipe(${1:stream})${2}
36 | # Express snippets
37 | snippet eget
38 | ${1:app}.get('${2:route}', ${3:handler});
39 | snippet epost
40 | ${1:app}.post('${2:route}', ${3:handler});
41 | snippet eput
42 | ${1:app}.put('${2:route}', ${3:handler});
43 | snippet edel
44 | ${1:app}.delete('${2:route}', ${3:handler});
45 | # process snippets
46 | snippet stdin
47 | process.stdin
48 | snippet stdout
49 | process.stdout
50 | snippet stderr
51 | process.stderr
52 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/jinja.snippets:
--------------------------------------------------------------------------------
1 | # Generic tags
2 |
3 | extends html
4 |
5 | snippet %
6 | {% ${1} %}
7 | snippet %%
8 | {% ${1:tag_name} %}
9 | ${0}
10 | {% end$1 %}
11 | snippet {
12 | {{ ${1} }}
13 | # Template Tags
14 |
15 | snippet autoescape
16 | {% autoescape ${1:off} %}
17 | ${0}
18 | {% endautoescape %}
19 | snippet block
20 | {% block ${1} %}
21 | ${0}
22 | {% endblock %}
23 | snippet #
24 | {# ${0:comment} #}
25 | snippet comment
26 | {% comment %}
27 | ${0}
28 | {% endcomment %}
29 | snippet cycle
30 | {% cycle ${1:val1} ${2:val2} ${3:as ${4}} %}
31 | snippet debug
32 | {% debug %}
33 | snippet extends
34 | {% extends "${0:base.html}" %}
35 | snippet filter
36 | {% filter ${1} %}
37 | ${0}
38 | {% endfilter %}
39 | snippet firstof
40 | {% firstof ${1} %}
41 | snippet for
42 | {% for ${1} in ${2} %}
43 | ${0}
44 | {% endfor %}
45 | snippet empty
46 | {% empty %}
47 | ${0}
48 | snippet if
49 | {% if ${1} %}
50 | ${0}
51 | {% endif %}
52 | snippet el
53 | {% else %}
54 | ${1}
55 | snippet eif
56 | {% elif ${1} %}
57 | ${0}
58 | snippet ifchanged
59 | {% ifchanged %}${1}{% endifchanged %}
60 | snippet ifequal
61 | {% ifequal ${1} ${2} %}
62 | ${0}
63 | {% endifequal %}
64 | snippet ifnotequal
65 | {% ifnotequal ${1} ${2} %}
66 | ${0}
67 | {% endifnotequal %}
68 | snippet include
69 | {% include "${0}" %}
70 | snippet load
71 | {% load ${0} %}
72 | snippet now
73 | {% now "${0:jS F Y H:i}" %}
74 | snippet regroup
75 | {% regroup ${1} by ${2} as ${0} %}
76 | snippet spaceless
77 | {% spaceless %}${0}{% endspaceless %}
78 | snippet ssi
79 | {% ssi ${0} %}
80 | snippet trans
81 | {% trans %}${0}{% endtrans %}
82 | snippet url
83 | {% url ${1} as ${0} %}
84 | snippet widthratio
85 | {% widthratio ${1:this_value} ${2:max_value} ${0:100} %}
86 | snippet with
87 | {% with ${1} as ${2} %}
88 | ${0}
89 | {% endwith %}
90 |
91 | # Template Filters
92 |
93 | # Note: Since SnipMate can't determine which template filter you are
94 | # expanding without the "|" character, these do not add the "|"
95 | # character. These save a few keystrokes still.
96 |
97 | # Note: Template tags that take no arguments are not implemented.
98 |
99 | snippet add
100 | add:"${0}"
101 | snippet center
102 | center:"${0}"
103 | snippet cut
104 | cut:"${0}"
105 | snippet date
106 | date:"${0}"
107 | snippet default
108 | default:"${0}"
109 | snippet defaultifnone
110 | default_if_none:"${0}"
111 | snippet dictsort
112 | dictsort:"${0}"
113 | snippet dictsortrev
114 | dictsortreversed:"${0}"
115 | snippet divisibleby
116 | divisibleby:"${0}"
117 | snippet floatformat
118 | floatformat:"${0}"
119 | snippet getdigit
120 | get_digit:"${0}"
121 | snippet join
122 | join:"${0}"
123 | snippet lengthis
124 | length_is:"${0}"
125 | snippet pluralize
126 | pluralize:"${0}"
127 | snippet removetags
128 | removetags:"${0}"
129 | snippet slice
130 | slice:"${0}"
131 | snippet stringformat
132 | stringformat:"${0}"
133 | snippet time
134 | time:"${0}"
135 | snippet truncatewords
136 | truncatewords:${0}
137 | snippet truncatewordshtml
138 | truncatewords_html:${0}
139 | snippet urlizetrunc
140 | urlizetrunc:${0}
141 | snippet wordwrap
142 | wordwrap:${0}
143 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/jsp.snippets:
--------------------------------------------------------------------------------
1 | snippet @page
2 | <%@page contentType="text/html" pageEncoding="UTF-8"%>
3 | snippet jstl
4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
6 | snippet jstl:c
7 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
8 | snippet jstl:fn
9 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
10 | snippet cpath
11 | ${pageContext.request.contextPath}
12 | snippet cout
13 |
14 | snippet cset
15 |
16 | snippet cremove
17 |
18 | snippet ccatch
19 |
20 | snippet cif
21 |
22 | ${0}
23 |
24 | snippet cchoose
25 |
26 | ${0}
27 |
28 | snippet cwhen
29 |
30 | ${0}
31 |
32 | snippet cother
33 |
34 | ${0}
35 |
36 | snippet cfore
37 |
38 | ${0:}
39 |
40 | snippet cfort
41 | ${2:item1,item2,item3}
42 |
43 | ${0:}
44 |
45 | snippet cparam
46 |
47 | snippet cparam+
48 |
49 | cparam+${0}
50 | snippet cimport
51 |
52 | snippet cimport+
53 |
54 |
55 | cparam+${0}
56 |
57 | snippet curl
58 |
59 | ${0}
60 | snippet curl+
61 |
62 |
63 | cparam+${0}
64 |
65 | ${3}
66 | snippet credirect
67 |
68 | snippet contains
69 | ${fn:contains(${1:string}, ${0:substr})}
70 | snippet contains:i
71 | ${fn:containsIgnoreCase(${1:string}, ${0:substr})}
72 | snippet endswith
73 | ${fn:endsWith(${1:string}, ${0:suffix})}
74 | snippet escape
75 | ${fn:escapeXml(${0:string})}
76 | snippet indexof
77 | ${fn:indexOf(${1:string}, ${0:substr})}
78 | snippet join
79 | ${fn:join(${1:collection}, ${0:delims})}
80 | snippet length
81 | ${fn:length(${0:collection_or_string})}
82 | snippet replace
83 | ${fn:replace(${1:string}, ${2:substr}, ${0:replace})}
84 | snippet split
85 | ${fn:split(${1:string}, ${0:delims})}
86 | snippet startswith
87 | ${fn:startsWith(${1:string}, ${0:prefix})}
88 | snippet substr
89 | ${fn:substring(${1:string}, ${2:begin}, ${0:end})}
90 | snippet substr:a
91 | ${fn:substringAfter(${1:string}, ${0:substr})}
92 | snippet substr:b
93 | ${fn:substringBefore(${1:string}, ${0:substr})}
94 | snippet lc
95 | ${fn:toLowerCase(${0:string})}
96 | snippet uc
97 | ${fn:toUpperCase(${0:string})}
98 | snippet trim
99 | ${fn:trim(${0:string})}
100 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/julia.snippets:
--------------------------------------------------------------------------------
1 | snippet #!
2 | #!/usr/bin/env julia
3 |
4 | # Functions
5 | snippet fun function definition
6 | function ${1}(${2})
7 | ${0}
8 | end
9 |
10 | snippet ret return
11 | return(${0})
12 |
13 | # Printing to console
14 | snippet pr print
15 | print("${1}")
16 | ${0}
17 |
18 | snippet prl print line
19 | println("${1}")
20 | ${0}
21 |
22 | # Includes
23 | snippet use load a package
24 | using ${0}
25 |
26 | snippet incl include source code
27 | include("${1}")
28 | ${0}
29 |
30 | # Loops
31 | snippet forc for loop iterating over iterable container
32 | for ${1} in ${2}
33 | ${0}
34 | end
35 |
36 | snippet for standard for loop
37 | for ${1} = ${2}
38 | ${0}
39 | end
40 |
41 | snippet fornest nested for loop
42 | for ${1} = ${2}, ${3} = ${4}
43 | ${0}
44 | end
45 |
46 | snippet wh while loop
47 | while ${1} ${2:<=} ${3}
48 | ${0}
49 | end
50 |
51 | # Conditionals
52 | snippet if if statement
53 | if ${1}
54 | ${0}
55 | end
56 |
57 | snippet el else part of statement
58 | else
59 | ${0}
60 |
61 | snippet eif else if part of if statement
62 | else if ${1}
63 | ${0}
64 |
65 | snippet ife full if-else statement
66 | if ${1}
67 | ${2}
68 | else
69 | ${0}
70 | end
71 |
72 | snippet tern ternary operator
73 | ${1} ? ${2} : ${3:nothing}
74 |
75 | # Exceptions
76 | snippet try try catch
77 | try
78 | ${1:${VISUAL}}
79 | catch ${2}
80 | ${0}
81 | end
82 |
83 | snippet fin finally statement
84 | finally
85 | ${0}
86 |
87 | snippet thr throw
88 | throw(${1})
89 | ${0}
90 |
91 | # Messages
92 | snippet @i
93 | @info "${1}" ${0}
94 |
95 | snippet @w
96 | @warn "${1}" ${0}
97 |
98 | snippet @e
99 | @error "${1}" ${0}
100 |
101 | snippet @d
102 | @debug "${1}" ${0}
103 |
104 | snippet @t @testset with @test
105 | @testset "${1}" begin
106 | ${2}
107 | @test ${0}
108 | end
109 |
110 | snippet @tt @testset with @test_throws
111 | @testset "${1}" begin
112 | ${2}
113 | @test_throws ${0}
114 | end
115 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/kotlin.snippets:
--------------------------------------------------------------------------------
1 | snippet fun
2 | fun ${1:name}(${2}): ${3:String} {
3 | ${4}
4 | }
5 | snippet pfun
6 | private fun ${1:name}(${2}): ${3:String} {
7 | ${4}
8 | }
9 | snippet main
10 | @JvmStatic
11 | fun main(args: Array) {
12 | ${0}
13 | }
14 | snippet ret
15 | return ${0}
16 | snippet whe
17 | when (${1:${VISUAL}}) {
18 | ${2} -> ${3}
19 | }
20 | snippet cla
21 | class ${1} {
22 | ${0:${VISUAL}}
23 | }
24 | snippet cobj
25 | companion object {
26 | ${0:${VISUAL}}
27 | }
28 | snippet obj
29 | object ${1} {
30 | ${0:${VISUAL}}
31 | }
32 | snippet if
33 | if (${1}) {
34 | ${0:${VISUAL}}
35 | }
36 | snippet ife
37 | if (${1}) {
38 | ${2:${VISUAL}}
39 | } else {
40 | ${0}
41 | }
42 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/ledger.snippets:
--------------------------------------------------------------------------------
1 | # Ledger
2 | snippet ent
3 | `strftime("%Y/%m/%d")` ${1:transaction}
4 | ${2:account} ${3:value}
5 | ${0:account}
6 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/lfe.snippets:
--------------------------------------------------------------------------------
1 | snippet defmo
2 | (defmodule ${1:`vim_snippets#Filename()`}
3 | (export ${2:all}))
4 | $0
5 | snippet def
6 | (defun $1 ($2)
7 | $0)
8 | snippet ltest
9 | (defmodule ${1:`vim_snippets#Filename()`}
10 | (behaviour ltest-unit)
11 | (export all))
12 |
13 | (include-lib "ltest/include/ltest-macros.lfe")
14 |
15 | $0
16 | snippet test
17 | (deftest $1
18 | $0)
19 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/ls.snippets:
--------------------------------------------------------------------------------
1 | # Closure loop
2 | snippet forinlet
3 | for ${1:name} in ${2:array}
4 | let $1
5 | ${3}
6 | # Array comprehension
7 | snippet fora
8 | for ${1:name} in ${2:array}
9 | ${3}
10 | # Object comprehension
11 | snippet foro
12 | for ${1:key}, ${2:value} of ${3:object}
13 | ${4}
14 | # Range comprehension (inclusive)
15 | snippet forr
16 | for ${1:name} from ${2:start} to ${3:finish}
17 | ${4}
18 | snippet forrb
19 | for ${1:name} from ${2:start} to ${3:finish} by ${4:step}
20 | ${5}
21 | # Range comprehension (exclusive)
22 | snippet forrex
23 | for ${1:name} from ${2:start} til ${3:finish}
24 | ${4}
25 | snippet forrexb
26 | for ${1:name} from ${2:start} til ${3:finish} by ${4:step}
27 | ${5}
28 | # Function
29 | snippet fun
30 | (${1:args}) ->
31 | ${2}
32 | # Function (bound)
33 | snippet bfun
34 | (${1:args}) ~>
35 | ${2}
36 | # Class
37 | snippet cla class ..
38 | class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
39 | ${2}
40 | snippet cla class .. constructor: ..
41 | class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
42 | (${2:args}) ->
43 | ${3}
44 |
45 | ${4}
46 | snippet cla class .. extends ..
47 | class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
48 | ${3}
49 | snippet cla class .. extends .. constructor: ..
50 | class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
51 | (${3:args}) ->
52 | ${4}
53 |
54 | ${5}
55 | # If
56 | snippet if
57 | if $1
58 | ${2}
59 | # If __ Else
60 | snippet ife
61 | if $1
62 | ${2}
63 | else
64 | ${3}
65 | # Else if
66 | snippet elif
67 | else if $1
68 | ${2}
69 | # Ternary If
70 | snippet ifte
71 | if $1 then $2 else $0
72 | # Unless
73 | snippet unl
74 | $1 unless $0
75 | # Switch
76 | snippet swi
77 | switch ${1:object}
78 | case ${2:value}
79 | ${3}
80 | default void
81 | snippet mat
82 | match ${1:object}
83 | | ${2:value} => ${3}
84 | | otherwise => void
85 |
86 | # Log
87 | snippet log
88 | console.log ${1}
89 | # stringify
90 | snippet str
91 | JSON.stringify ${1}, void, 2
92 |
93 | # Try __ Catch
94 | snippet try
95 | try
96 | ${1:${VISUAL}}
97 | catch ${2:error}
98 | ${3}
99 | # Require
100 | snippet req
101 | ${2:$1} = require '${1}'${3}
102 | # Require!
103 | snippet req!
104 | require! ${1}
105 |
106 | # Export
107 | snippet exp
108 | ${1:root} = exports ? this
109 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/lua.snippets:
--------------------------------------------------------------------------------
1 | snippet #!
2 | #!/usr/bin/env lua
3 | $1
4 | snippet local
5 | local ${1:x} = ${0:1}
6 | snippet fun
7 | function ${1:fname}(${2:...})
8 | $0
9 | end
10 | snippet for
11 | for ${1:i}=${2:1},${3:10} do
12 | ${0:print(i)}
13 | end
14 | snippet forp
15 | for ${1:i},${2:v} in pairs(${3:table_name}) do
16 | $0
17 | end
18 | snippet fori
19 | for ${1:i},${2:v} in ipairs(${3:table_name}) do
20 | $0
21 | end
22 | snippet if
23 | if $1 then
24 | $2
25 | end
26 | snippet ife
27 | if $1 then
28 | ${2:-- if condition}
29 | else
30 | ${0:-- else}
31 | end
32 | snippet elif
33 | elseif $1 then
34 | $0
35 | snippet repeat
36 | repeat
37 | $1
38 | until $0
39 | snippet while
40 | while $1 do
41 | $0
42 | end
43 | snippet wh
44 | while ${1:true} do
45 | ${0}
46 | end
47 | snippet wht
48 | while true do
49 | ${0}
50 | end
51 | snippet print
52 | print("${1:string}")
53 | snippet pr
54 | print($0)
55 | snippet prs
56 | print("$0")
57 | snippet prf
58 | print(string.format("${1:%s}"$0))
59 | snippet wr
60 | io.write($0)
61 | snippet wrs
62 | io.write("$0")
63 | snippet wrf
64 | io.write(string.format("${1:%s}"$0))
65 | snippet fwr
66 | io.${1:stderr}:write($0)
67 | snippet fwrs
68 | io.${1:stderr}:write("$0")
69 | snippet fwrf
70 | io.${1:stderr}:write(string.format("${2:%s}"$0))
71 | snippet req
72 | require('${1:mod}')
73 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/make.snippets:
--------------------------------------------------------------------------------
1 | # base
2 | snippet base
3 | .PHONY: clean, mrproper
4 | CC = gcc
5 | CFLAGS = -g -Wall
6 |
7 | all: $1
8 |
9 | %.o: %.c
10 | $(CC) $(CFLAGS) -c -o $@ $<
11 |
12 | ${1:out}: $1.o
13 | $(CC) $(CFLAGS) -o $@ $+
14 |
15 | clean:
16 | rm -f *.o core.*
17 |
18 | mrproper: clean
19 | rm -f $1
20 | # add
21 | snippet add
22 | ${1:out}: $1.o
23 | $(CC) $(CFLAGS) -o $@ $+
24 | # print
25 | snippet print
26 | print-%: ; @echo $*=$($*)
27 | # ifeq
28 | snippet if
29 | ifeq (${1:cond0}, ${2:cond1})
30 | ${0:${VISUAL}}
31 | endif
32 | # ifeq ... else ... endif
33 | snippet ife
34 | ifeq (${1:cond0}, ${2:cond1})
35 | ${3:${VISUAL}}
36 | else
37 | ${0}
38 | endif
39 | # else ...
40 | snippet el
41 | else
42 | ${0:${VISUAL}}
43 | # .DEFAULT_GOAL := target
44 | snippet default
45 | .DEFAULT_GOAL := ${1}
46 | # help target for self-documented Makefile
47 | snippet help
48 | help: ## Prints help for targets with comments
49 | @cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $\$1, $\$2}'
50 | ${0}
51 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/mako.snippets:
--------------------------------------------------------------------------------
1 | snippet def
2 | <%def name="${1:name}">
3 | ${0:}
4 | %def>
5 | snippet call
6 | <%call expr="${1:name}">
7 | ${0:}
8 | %call>
9 | snippet doc
10 | <%doc>
11 | ${0:}
12 | %doc>
13 | snippet text
14 | <%text>
15 | ${0:}
16 | %text>
17 | snippet for
18 | % for ${1:i} in ${2:iter}:
19 | ${0:}
20 | % endfor
21 | snippet if if
22 | % if $1:
23 | ${0:}
24 | % endif
25 | snippet ife if/else
26 | % if $1:
27 | ${2:}
28 | % else:
29 | ${0:}
30 | % endif
31 | snippet try
32 | % try:
33 | ${1:${VISUAL}}
34 | % except${2:}:
35 | ${0:pass}
36 | % endtry
37 | snippet wh
38 | % while ${1:}:
39 | ${0:}
40 | % endwhile
41 | snippet $
42 | ${ ${0:} }
43 | snippet <%
44 | <% ${0:} %>
45 | snippet
47 | snippet inherit
48 | <%inherit file="${0:filename}" />
49 | snippet include
50 | <%include file="${0:filename}" />
51 | snippet namespace
52 | <%namespace file="${0:name}" />
53 | snippet page
54 | <%page args="${0:}" />
55 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/markdown.snippets:
--------------------------------------------------------------------------------
1 | # Markdown
2 |
3 | # Includes octopress (http://octopress.org/) snippets
4 |
5 | # The suffix `c` stands for "Clipboard".
6 |
7 | snippet [
8 | [${1:text}](${2:address})
9 | snippet [*
10 | [${1:link}](${2:`@*`})
11 | snippet [c
12 | [${1:link}](${2:`@+`})
13 | snippet ["
14 | [${1:text}](https://${2:address} "${3:title}")
15 | snippet ["*
16 | [${1:link}](${2:`@*`} "${3:title}")
17 | snippet ["c
18 | [${1:link}](${2:`@+`} "${3:title}")
19 | snippet [:
20 | [${1:id}]: https://${2:url}
21 |
22 | snippet [:*
23 | [${1:id}]: ${2:`@*`}
24 |
25 | snippet [:c
26 | [${1:id}]: ${2:`@+`}
27 |
28 | snippet [:"
29 | [${1:id}]: https://${2:url} "${3:title}"
30 |
31 | snippet [:"*
32 | [${1:id}]: ${2:`@*`} "${3:title}"
33 |
34 | snippet [:"c
35 | [${1:id}]: ${2:`@+`} "${3:title}"
36 |
37 | snippet 
39 | snippet 
41 | snippet 
43 | snippet 
45 | snippet 
47 | snippet 
49 | snippet ![:
50 | ![${1:id}]: ${2:url}
51 |
52 | snippet ![:*
53 | ![${1:id}]: ${2:`@*`}
54 |
55 | snippet ![:"
56 | ![${1:id}]: ${2:url} "${3:title}"
57 |
58 | snippet ![:"*
59 | ![${1:id}]: ${2:`@*`} "${3:title}"
60 |
61 | snippet ![:"c
62 | ![${1:id}]: ${2:`@+`} "${3:title}"
63 |
64 | snippet <
65 |
66 | snippet <*
67 | <`@*`>
68 | snippet
70 | snippet ** Bold
71 | **$0**
72 | snippet __ Bold
73 | __$0__
74 | snippet --- Front matter
75 | ---
76 | $0
77 | ---
78 | snippet ====
79 | `repeat('=', strlen(getline(line('.') - 3)))`
80 |
81 | ${0}
82 | snippet -
83 | - ${0}
84 | snippet ----
85 | `repeat('-', strlen(getline(line('.') - 3)))`
86 |
87 | ${0}
88 | snippet blockquote
89 | {% blockquote %}
90 | ${0:quote}
91 | {% endblockquote %}
92 |
93 | snippet blockquote-author
94 | {% blockquote ${1:author}, ${2:title} %}
95 | ${0:quote}
96 | {% endblockquote %}
97 |
98 | snippet blockquote-link
99 | {% blockquote ${1:author} ${2:URL} ${3:link_text} %}
100 | ${0:quote}
101 | {% endblockquote %}
102 |
103 | snippet ```
104 | \`\`\`${1}
105 | ${0:${VISUAL}}
106 | \`\`\`
107 |
108 | # Language.
109 | snippet ```l
110 | \`\`\`${1:language}
111 | ${2:code}
112 | \`\`\`
113 |
114 | snippet codeblock-short
115 | {% codeblock %}
116 | ${0:code_snippet}
117 | {% endcodeblock %}
118 |
119 | snippet codeblock-full
120 | {% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %}
121 | ${0:code_snippet}
122 | {% endcodeblock %}
123 |
124 | snippet gist-full
125 | {% gist ${1:gist_id} ${0:filename} %}
126 |
127 | snippet gist-short
128 | {% gist ${0:gist_id} %}
129 |
130 | snippet img
131 | {% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${0:alt_text} %}
132 |
133 | snippet youtube
134 | {% youtube ${0:video_id} %}
135 |
136 | snippet tb
137 | | ${0:factors} | ${1:a} | ${2:b} |
138 | | ------------- |------------- | ------- |
139 | | ${3:f1} | Y | N |
140 | | ${4:f2} | Y | N |
141 |
142 | # The quote should appear only once in the text. It is inherently part of it.
143 | # See http://octopress.org/docs/plugins/pullquote/ for more info.
144 |
145 | snippet pullquote
146 | {% pullquote %}
147 | ${1:text} {" ${2:quote} "} ${0:text}
148 | {% endpullquote %}
149 |
150 | # Definition lists
151 | snippet : Definition list
152 | $1
153 | : $0
154 | snippet :: Alternate definition list
155 | $1
156 | - $0
157 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/matlab.snippets:
--------------------------------------------------------------------------------
1 | snippet if if
2 | if ${1}
3 | ${0}
4 | end
5 |
6 | snippet ife if ... else
7 | if ${1}
8 | ${2}
9 | else
10 | ${0}
11 | end
12 |
13 | snippet el else
14 | else
15 | ${0}
16 |
17 | snippet eif elsif
18 | elseif ${1}
19 | ${0}
20 |
21 | snippet wh while
22 | while ${1}
23 | ${0}
24 | end
25 |
26 | snippet for for
27 | for ${1:i} = ${2:1:n}
28 | ${0}
29 | end
30 |
31 | snippet parfor parfor
32 | parfor ${1:i} = ${2:1:n}
33 | ${0}
34 | end
35 |
36 | snippet fun function
37 | function [${3:out}] = ${1:`vim_snippets#Filename("$1", "fun_name")`}(${2})
38 | ${0}
39 |
40 | snippet try try ... catch
41 | try
42 | ${1}
43 | catch ${2:err}
44 | ${0}
45 | end
46 |
47 | snippet switch switch
48 | switch ${1:n}
49 | case ${2:0}
50 | ${0}
51 | end
52 |
53 | snippet @ anonymous function
54 | @(${1:x}) ${0:x*x}
55 |
56 | snippet cl class
57 | classdef ${1:`vim_snippets#Filename("$1", "class_name")`}
58 | properties
59 | ${2}
60 | end
61 | methods
62 | ${0}
63 | end
64 | end
65 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/mustache.snippets:
--------------------------------------------------------------------------------
1 | snippet if # {{#value}} ... {{/value}}
2 | {{#${1:value}}}
3 | ${0:${VISUAL}}
4 | {{/$1}}
5 | snippet ifn # {{^value}} ... {{/value}}
6 | {{^${1:value}}}
7 | ${0:${VISUAL}}
8 | {{/$1}}
9 | snippet ife # {{#value}} ... {{/value}} {{^value}} ... {{/value}}
10 | {{#${1:value}}}
11 | ${2:${VISUAL}}
12 | {{/$1}}
13 | {{^$1}}
14 | ${3}
15 | {{/$1}}
16 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/ocaml.snippets:
--------------------------------------------------------------------------------
1 | snippet doc
2 | (** ${0} *)
3 | snippet comment
4 | (* ${0} *)
5 | snippet let
6 | let ${1} = ${2} in
7 | ${0}
8 | snippet fn
9 | let ${1} =
10 | ${0}
11 | snippet fun
12 | type ${1} = ${0}
13 | snippet mod
14 | module ${1} = struct
15 | ${0}
16 | end
17 | snippet modty
18 | module type ${1} = sig
19 | ${0}
20 | end
21 | snippet sw
22 | match ${1} with
23 | | ${2} -> ${0}
24 | snippet |
25 | | ${1} -> ${0}
26 | snippet p
27 | |> ${0}
28 | snippet if
29 | if ${1} then
30 | ${2}
31 | else
32 | ${0}
33 | snippet fnr
34 | let rec ${1} =
35 | ${0}
36 | snippet try
37 | try
38 | ${1}
39 | with ${0}
40 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/octave.snippets:
--------------------------------------------------------------------------------
1 | extends matlab
2 |
3 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/openfoam.snippets:
--------------------------------------------------------------------------------
1 | # 0/*
2 | snippet fv
3 | type fixedValue;
4 | value uniform ${0};
5 | snippet zg
6 | type zeroGradient;
7 | snippet sym
8 | type symmetryPlane;
9 | # system/controlDict
10 | snippet forces
11 | forces
12 | {
13 | type forces;
14 | functionObjectLibs ("libforces.so");
15 | enabled true;
16 | outputControl ${1:timeStep};
17 | outputInterval ${2:1};
18 | patches (${3});
19 | log ${4:true};
20 | CofR (${0:0 0 0});
21 | }
22 | # system/fvSolution
23 | # solvers
24 | snippet gamg
25 | ${1:p}
26 | {
27 | solver GAMG;
28 | tolerance 1e-${2:6};
29 | relTol ${0:0.0};
30 | smoother GaussSeidel;
31 | cacheAgglomeration true;
32 | nCellsInCoarsestLevel 10;
33 | agglomerator faceAreaPair;
34 | mergeLevels 1;
35 | }
36 | snippet pbicg
37 | ${1:U}
38 | {
39 | solver PBiCG;
40 | preconditioner DILU;
41 | tolerance 1e-${2:6};
42 | relTol ${0:0.0};
43 | }
44 | # PIMPLE
45 | snippet pimple
46 | PIMPLE
47 | {
48 | nOuterCorrectors ${1:outer};
49 | nCorrectors ${2:inner};
50 | nNonOrthogonalCorrectors ${3:nonOrtho};
51 | pRefCell ${4:cell};
52 | pRefValue ${0:value for $4};
53 | }
54 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/org.snippets:
--------------------------------------------------------------------------------
1 | # Org Mode Snippets Imported from (https://github.com/doomemacs/snippets/)
2 | # Imported by ybenel (github.com/m1ndo)
3 |
4 | # Begin
5 | snippet begin
6 | #+begin_${1:type} ${2:options}
7 | $0
8 | #+end_$1
9 | # Begin Center
10 | snippet
8 | # Function
9 | snippet sub
10 | sub ${1:function_name}(${2:Str $var}) {
11 | ${3}
12 | }
13 | snippet mul
14 | multi ${1:function_name}(${2:Str $var}) {
15 | ${3}
16 | }
17 | # Conditional
18 | snippet if
19 | if ${1} {
20 | ${2}
21 | }
22 | # Conditional if..else
23 | snippet ife
24 | if ${1} {
25 | ${2}
26 | }
27 | else {
28 | ${3}
29 | }
30 | snippet eif
31 | elsif ${1} {
32 | ${2}
33 | }
34 | # Conditional One-line
35 | snippet xif
36 | ${1} if $2;
37 | # Unless conditional
38 | snippet unless
39 | unless ${1} {
40 | ${2}
41 | }
42 | # Unless conditional One-line
43 | snippet xunless
44 | ${1} unless $2;
45 | # Ternary conditional
46 | snippet tc
47 | $1 ?? ${2:value-if-true} !! ${3:value-if-false};
48 | # given - when (perl6 switch)
49 | snippet switch
50 | given ${1:$var} {
51 | when $2 {
52 | ${3:# code block ...}
53 | }
54 | ${4}
55 | default {
56 | ${5}
57 | }
58 | }
59 | # 'loop' - C's for.
60 | snippet loop
61 | loop (my ${1:$i} = 0; $$1 < ${2:count}; $$1++) {
62 | ${3}
63 | }
64 | # for loop
65 | snippet for
66 | for ${1:@array} -> ${2:$variable} {
67 | ${3}
68 | }
69 | # While Loop
70 | snippet wh
71 | while ${1} {
72 | ${2}
73 | }
74 | # Repeat while and repean until
75 | snippet rp
76 | repeat {
77 | ${1}
78 | } ${2:while|until} ${3};
79 | # classes ..
80 | snippet cl
81 | ${1:my} class ${2:ClassName} ${3:is|does Parent|Role}{
82 | ${4}
83 | }
84 | snippet has
85 | has ${1:Type} ${2:$!identifier};
86 | snippet mth
87 | method ${1:method_name}(${2:$attr}) {
88 | ${3}
89 | }
90 | snippet pmth
91 | method ${1:!}${2:method_name}(${3:$attr}) {
92 | ${4}
93 | }
94 | snippet smth
95 | submethod ${1:submethod_name}(${2:$attr}) {
96 | ${3}
97 | }
98 | # Tests
99 | snippet test
100 | use v6;
101 | use Test;
102 | ${1:use lib 'lib';}
103 |
104 | plan ${2:$num-tests};
105 |
106 | # IO
107 | snippet slurp
108 | my ${1:$var} = "${2:filename}".IO.slurp;
109 | snippet rfile
110 | for "${1:filename}".IO.lines -> $line {
111 | ${2}
112 | }
113 | snippet open
114 | my $fh = open "${1:filename}", ${2::r|:w|:a};
115 | ${3:# actions};
116 | $fh.close;
117 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/phoenix.snippets:
--------------------------------------------------------------------------------
1 | snippet cont
2 | defmodule ${1:AppName}Web.${2:ControllerName}Controller do
3 | use $1Web, :controller
4 |
5 | ${3}
6 | end
7 |
8 | snippet view
9 | defmodule ${1:AppName}Web.${2:ViewName}View do
10 | use $1Web, :view
11 | end
12 |
13 | snippet chan
14 | defmodule ${1:AppName}Web.${2:ChannelName}Channel do
15 | use $1Web, :channel
16 | end
17 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/plsql.snippets:
--------------------------------------------------------------------------------
1 | # create package spec
2 | snippet ps
3 | create or replace package ${1:name}
4 | as
5 | ${0:-- spec}
6 | end; -- end of package spec $1
7 | # create package body
8 | snippet pb
9 | create or replace package body ${1:name}
10 | as
11 | $0
12 | end; -- end of package body $1;
13 | # package procedure spec
14 | snippet pps
15 | procedure ${1:name}(${0:args});
16 | # package procedure body
17 | snippet ppb
18 | procedure ${1:name}(${2:args})
19 | as
20 | begin
21 | $0
22 | end $2;
23 | # package function spec
24 | snippet pfs
25 | function ${1:name}(${2:args})
26 | return ${0:type};
27 | # package function body
28 | snippet pfb
29 | function ${1:name}(${2:args})
30 | return ${3:type}
31 | as
32 | l_res $3;
33 | begin
34 | $0;
35 | return l_res;
36 | end $1;
37 | # snow errors
38 | snippet err
39 | show errors;
40 | # proc/func in parameter
41 | snippet p
42 | ${1:name} ${2:in} ${3:type} ${0: := null}
43 | # package type: record
44 | snippet tr
45 | type tr_${1:name} is record (${0:/* columns */});
46 | # package type: nested table
47 | snippet tt
48 | type tt_${1:name} is table of tr_${0:name};
49 | # package type: indexed table
50 | snippet tti
51 | type tt_${1:name} is table of tr_${0:name} index by binary_integer;
52 | # proc/func comment
53 | snippet doc
54 | /*
55 | * ${0: comment ...}
56 | */
57 | # plsql block
58 | snippet beg
59 | begin
60 | ${0}
61 | end;
62 | # plsql block with declare part
63 | snippet dec
64 | declare
65 | ${1}
66 | begin
67 | ${0}
68 | end;
69 | # return pipe row
70 | snippet rpipe
71 | for ${1:i} in 1 .. ${0:l_res}.count loop
72 | pipe row( $2($1) );
73 | end loop;
74 | return;
75 | # bulk collect
76 | snippet bc
77 | bulk collect into ${0}
78 | # local variable
79 | snippet l
80 | l_${1} ${0:number};
81 | # output
82 | snippet log
83 | dbms_output.put_line('${0}');
84 | # for loop
85 | snippet for
86 | for ${1:i} in ${2:1}..${3:42} loop
87 | ${0}
88 | end loop;
89 | # for loop with select
90 | snippet fors
91 | for ${1:rec} in (${2: select}) loop
92 | ${0}
93 | end loop;
94 | # for loop with collection
95 | snippet forc
96 | for ${1:i} in ${2:l_var}.first .. $2.last loop
97 | ${0: -- dbms_output.put_line($2($1)); }
98 | end loop;
99 | # if
100 | snippet if
101 | if ${1} then
102 | ${0}
103 | end if;
104 | snippet ife
105 | if ${1} then
106 | ${2}
107 | else
108 | ${0}
109 | end if;
110 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/po.snippets:
--------------------------------------------------------------------------------
1 | snippet msg
2 | msgid "${1}"
3 | msgstr "${2}"
4 |
5 | ${0}
6 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/progress.snippets:
--------------------------------------------------------------------------------
1 | # Progress/OpenEdge ABL snippets
2 | # define
3 | snippet defbuf
4 | DEFINE BUFFER b_${1:TableName} FOR $1 ${0}.
5 | snippet defvar
6 | DEFINE VARIABLE ${1:VariableName} AS ${0}.
7 | snippet nl
8 | NO-LOCK
9 | snippet ne
10 | NO-ERROR
11 | snippet nle
12 | NO-LOCK NO-ERROR
13 | snippet ini
14 | INITIAL ${0:?}
15 | snippet nu
16 | NO-UNDO
17 | snippet err
18 | ERROR
19 | snippet ff
20 | FIND FIRST ${1:BufferName}
21 | ${2:WHERE $1.${3}} ${0}
22 | snippet input
23 | DEFINE INPUT PARAMETER ${1:ParamName} AS ${0}.
24 | snippet output
25 | DEFINE OUTPUT PARAMETER ${1:ParamName} AS ${0:ParamType}.
26 | snippet proc
27 |
28 | /******************************************************************************/
29 |
30 | PROCEDURE ${1:ProcName}:
31 |
32 | ${0}
33 |
34 | END PROCEDURE. /* $1 */
35 |
36 | /******************************************************************************/
37 |
38 | snippet alert
39 | MESSAGE "${1:MessageContent}" ${2:Data} VIEW-AS ALERT-BOX.
40 | snippet if
41 | IF ${1:Condition}
42 | THEN ${2:Action}
43 | ${3:ELSE ${4:OtherWise}}
44 | snippet do
45 | DO${1: Clauses}:
46 | ${0}
47 | END.
48 | # datatypes
49 | snippet int
50 | INTEGER
51 | snippet char
52 | CHARACTER
53 | snippet log
54 | LOGICAL
55 | snippet dec
56 | DECIMAL
57 | snippet sep
58 | /* ------------------------------------------------------------------------- */
59 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/ps1.snippets:
--------------------------------------------------------------------------------
1 | # Snippets for
2 | # Authored by Trevor Sullivan
3 |
4 | # PowerShell Class
5 | snippet class
6 | class {
7 | [string] ${1:FirstName}
8 | }
9 |
10 | # PowerShell Advanced Function
11 | snippet function
12 | function ${1:name} {
13 | [CmdletBinding()]
14 | param (
15 | [Parameter(Mandatory = $true)]
16 | [string] ${2:Param}
17 | )
18 |
19 | begin {
20 | }
21 |
22 | process {
23 | }
24 |
25 | end {
26 | }
27 | }
28 |
29 | # PowerShell Splatting
30 | snippet splatting
31 | $Params = @{
32 | ${1:Param1} = '${2:Value1}'
33 | ${3:Param2} = '${4:Value2}'
34 | }
35 | ${5:CommandName} @Params
36 |
37 | # PowerShell Enumeration
38 | snippet enum
39 | enum ${1:name} {
40 | ${2:item1}
41 | ${3:item2}
42 | }
43 |
44 | # PowerShell if..then
45 | snippet if
46 | if ($1) {
47 | $0
48 | }
49 |
50 | # PowerShell if..else
51 | snippet ife
52 | if ( $1 ) {
53 | ${2}
54 | }
55 | else {
56 | ${3}
57 | }
58 |
59 | # PowerShell While Loop
60 | snippet while
61 | while ($1) {
62 | $0
63 | }
64 |
65 | # PowerShell Filter..Sort
66 | snippet filtersort
67 | ${1:command} | Where-Object -FilterScript { $PSItem.${2:property} -${3:operator} '${4:expression}' } | Sort-Object -Property ${5:sortproperty}
68 |
69 | # PowerShell foreach
70 | snippet foreach
71 | foreach ( $${1:iterator} in $${2:collection} ) {
72 | $0
73 | }
74 |
75 | # PowerShell export-csv
76 | snippet epcsv
77 | Export-CSV -NoTypeInformation -Path ${1:path}
78 |
79 | # Powershell Comment Based Help
80 | snippet help
81 | <#
82 | .SYNOPSIS
83 | ${1:Short Description}
84 | .DESCRIPTION
85 | ${2:Full Description}
86 | .PARAMETER ${3:Param1}
87 | ${4: $3 usage}
88 | .EXAMPLE
89 | ${5:Example}
90 | .NOTES
91 | ${6:notes}
92 | .LINK
93 | ${7:online help}
94 | #>
95 |
96 | # Powershell switch statement
97 | snippet switch
98 | switch ( ${1:test} ){
99 | ${2:condition1} { ${3:action} }
100 | ${4:condition2} { ${5:action} }
101 | default { ${6:action} }
102 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/purescript.snippets:
--------------------------------------------------------------------------------
1 | snippet mod
2 | module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')`
3 | (
4 | ) where
5 |
6 | import Prelude
7 |
8 | ${0}
9 | snippet imp
10 | import ${0:Data.List}
11 | snippet impq
12 | import ${1:Data.List} as ${0:List}
13 | snippet fn0
14 | ${1:name} :: ${2:a}
15 | $1 = ${0:undefined}
16 | snippet fn
17 | ${1:fn} :: ${2:a} -> ${3:a}
18 | $1 ${4}= ${0}
19 | snippet fn1
20 | ${1:fn} :: ${2:a} -> ${3:a}
21 | $1 ${4}= ${0}
22 | snippet fn2
23 | ${1:fn} :: ${2:a} -> ${3:a} -> ${4:a}
24 | $1 ${5}= ${0}
25 | snippet fn3
26 | ${1:fn} :: ${2:a} -> ${3:a} -> ${4:a} -> ${5:a}
27 | $1 ${6}= ${0}
28 | snippet case
29 | case ${1} of
30 | ${2} -> ${0}
31 | snippet let
32 | let
33 | ${1} = ${2}
34 | in
35 | ${3}
36 | snippet where
37 | where
38 | ${1} = ${0}
39 | snippet testunit
40 | module Test.Main where
41 |
42 | import Prelude
43 | import Test.Unit (suite, test)
44 | import Test.Unit.Main (runTest)
45 | import Test.Unit.Assert as Assert
46 |
47 | main = runTest do
48 | suite "${1}" do
49 | test "${2:the tests run}" do
50 | Assert.equal
51 | "Hello, world!"
52 | "Hello, sailor!"
53 | snippet if
54 | if ${1} then
55 | ${2:${VISUAL}}
56 | else
57 | ${0}
58 | snippet doc
59 | {-| ${0}
60 | -}
61 | snippet ty
62 | type ${1:Type} =
63 | ${0}
64 | snippet da
65 | data ${1:Type} =
66 | ${0:$1}
67 | snippet nty
68 | newtype ${1:Type} =
69 | ${2:$1} ${0:Int}
70 | snippet fi
71 | foreign import ${1} :: ${2}
72 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/r.snippets:
--------------------------------------------------------------------------------
1 | snippet #!
2 | #!/usr/bin/env Rscript
3 |
4 | # includes
5 | snippet lib
6 | library(${0:package})
7 | snippet req
8 | require(${0:package})
9 | snippet source
10 | source('${0:file}')
11 |
12 | # conditionals
13 | snippet if
14 | if ($1) {
15 | ${0}
16 | }
17 | snippet el
18 | else {
19 | ${0}
20 | }
21 | snippet ei
22 | else if ($1) {
23 | ${0}
24 | }
25 |
26 | # loops
27 | snippet wh
28 | while(${1:true}) {
29 | ${0}
30 | }
31 | snippet wht
32 | while(true) {
33 | ${0}
34 | }
35 | snippet for
36 | for (${1:item} in ${2:list}) {
37 | ${3}
38 | }
39 | snippet foreach
40 | foreach (${1:item} = ${2:list}) {
41 | ${3}
42 | }
43 |
44 | # functions
45 | snippet fun
46 | ${1:name} <- function (${2:variables}) {
47 | ${0}
48 | }
49 | snippet ret
50 | return(${0})
51 |
52 | # dataframes, lists, etc
53 | snippet df
54 | ${1:name}[${2:rows}, ${0:cols}]
55 | snippet c
56 | c(${0:items})
57 | snippet li
58 | list(${0:items})
59 | snippet mat
60 | matrix(${1:data}, nrow = ${2:rows}, ncol = ${0:cols})
61 |
62 | # apply functions
63 | snippet apply
64 | apply(${1:array}, ${2:margin}, ${0:function})
65 | snippet lapply
66 | lapply(${1:list}, ${0:function})
67 | snippet sapply
68 | lapply(${1:list}, ${0:function})
69 | snippet vapply
70 | vapply(${1:list}, ${2:function}, ${0:type})
71 | snippet mapply
72 | mapply(${1:function}, ${0:...})
73 | snippet tapply
74 | tapply(${1:vector}, ${2:index}, ${0:function})
75 | snippet rapply
76 | rapply(${1:list}, ${0:function})
77 |
78 | # plyr functions
79 | snippet dd
80 | ddply(${1:frame}, ${2:variables}, ${0:function})
81 | snippet dl
82 | dlply(${1:frame}, ${2:variables}, ${0:function})
83 | snippet da
84 | daply(${1:frame}, ${2:variables}, ${0:function})
85 | snippet d_
86 | d_ply(${1:frame}, ${2:variables}, ${0:function})
87 |
88 | snippet ad
89 | adply(${1:array}, ${2:margin}, ${0:function})
90 | snippet al
91 | alply(${1:array}, ${2:margin}, ${0:function})
92 | snippet aa
93 | aaply(${1:array}, ${2:margin}, ${0:function})
94 | snippet a_
95 | a_ply(${1:array}, ${2:margin}, ${0:function})
96 |
97 | snippet ld
98 | ldply(${1:list}, ${0:function})
99 | snippet ll
100 | llply(${1:list}, ${0:function})
101 | snippet la
102 | laply(${1:list}, ${0:function})
103 | snippet l_
104 | l_ply(${1:list}, ${0:function})
105 |
106 | snippet md
107 | mdply(${1:matrix}, ${0:function})
108 | snippet ml
109 | mlply(${1:matrix}, ${0:function})
110 | snippet ma
111 | maply(${1:matrix}, ${0:function})
112 | snippet m_
113 | m_ply(${1:matrix}, ${0:function})
114 |
115 | # plot functions
116 | snippet pl
117 | plot(${1:x}, ${0:y})
118 | snippet ggp
119 | ggplot(${1:data}, aes(${0:aesthetics}))
120 | snippet img
121 | ${1:(jpeg,bmp,png,tiff)}(filename = '${2:filename}', width = ${3}, height = ${4}, unit = '${5}')
122 | ${0:plot}
123 | dev.off()
124 |
125 | # statistical test functions
126 | snippet fis
127 | fisher.test(${1:x}, ${0:y})
128 | snippet chi
129 | chisq.test(${1:x}, ${0:y})
130 | snippet tt
131 | t.test(${1:x}, ${0:y})
132 | snippet wil
133 | wilcox.test(${1:x}, ${0:y})
134 | snippet cor
135 | cor.test(${1:x}, ${0:y})
136 | snippet fte
137 | var.test(${1:x}, ${0:y})
138 | snippet kvt
139 | kv.test(${1:x}, ${0:y})
140 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/racket.snippets:
--------------------------------------------------------------------------------
1 | # Languages
2 | snippet #r
3 | #lang racket
4 | snippet #tr
5 | #lang typed/racket
6 | snippet #rg
7 | #lang racket/gui
8 | snippet #sb
9 | #lang scribble/base
10 | snippet #d
11 | #lang datalog
12 | snippet #wi
13 | #lang web-server/insta
14 |
15 | # Defines
16 | snippet def
17 | (define ${1} ${0})
18 | snippet defun
19 | (define (${1})
20 | ${0})
21 | snippet defv "define-values"
22 | (define-values (${1}) (${0}))
23 | snippet defm "define/match"
24 | (define/match (${1})
25 | [(${2}) ${3}]
26 | ${0})
27 | snippet defs "define-syntax"
28 | (define-syntax (${1})
29 | ${0})
30 |
31 | # Conditionals
32 | snippet if
33 | (if ${1} ${2} ${0})
34 | snippet ifn
35 | (if (not ${1}) ${2} ${0})
36 | snippet ifl
37 | (if ${1}
38 | (let (${2})
39 | ${3})
40 | ${0})
41 | snippet ifnl
42 | (if (not ${1})
43 | (let (${2})
44 | ${3})
45 | ${0})
46 | snippet ifb
47 | (if ${1}
48 | (begin
49 | ${2})
50 | ${0})
51 | snippet ifnb
52 | (if (not ${1})
53 | (begin
54 | ${2})
55 | ${0})
56 | snippet when
57 | (when ${1}
58 | ${0})
59 | snippet unless
60 | (unless ${1} ${2} ${0})
61 | snippet cond
62 | (cond
63 | [(${1}) ${0}])
64 | snippet conde
65 | (cond
66 | [(${1}) ${2}]
67 | [else ${0}])
68 | snippet case
69 | (case ${1}
70 | [(${2}) ${0}])
71 | snippet match
72 | (match ${1}
73 | [(${2}) ${0}])
74 |
75 | # For iterations
76 | snippet for
77 | (for ([${1}])
78 | ${0})
79 | snippet forl "for/list"
80 | (for/list ([${1}])
81 | ${0})
82 | snippet forf "for/fold"
83 | (for/fold
84 | ([${1}])
85 | ([${2}])
86 | ${0})
87 | snippet forfr "for/foldr"
88 | (for/foldr
89 | ([${1}])
90 | ([${2}])
91 | ${0})
92 | snippet fora "for/and"
93 | (for/and ([${1}])
94 | ${0})
95 | snippet foro "for/or"
96 | (for/or ([${1}])
97 | ${0})
98 | snippet fors "for/sum"
99 | (for/sum ([${1}])
100 | ${0})
101 | snippet forp "for/product"
102 | (for/product ([${1}])
103 | ${0})
104 | snippet forfi "for/first"
105 | (for/first ([${1}])
106 | ${0})
107 | snippet forla "for/last"
108 | (for/last ([${1}])
109 | ${0})
110 |
111 | snippet lambda
112 | (lambda (${1}) ${0})
113 | snippet apply
114 | (apply ${1} ${0})
115 | snippet map
116 | (map ${1} ${0})
117 | snippet filter
118 | (filter ${1} ${0})
119 |
120 | snippet req
121 | (require ${0})
122 | snippet prov
123 | (provide ${0})
124 |
125 | snippet let
126 | (let ([${1}]) ${0})
127 | snippet letcc
128 | (let/cc here (set! ${1} here) ${0})
129 | snippet begin
130 | (begin
131 | ${0})
132 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/reason.snippets:
--------------------------------------------------------------------------------
1 | snippet doc
2 | /*
3 | ${0}
4 | */
5 | snippet let
6 | let ${1} = ${0};
7 | snippet fn
8 | let ${1} = (${2}) => {
9 | ${0}
10 | };
11 | snippet fun
12 | fun ${1} => ${0}
13 | snippet ty
14 | type ${1} = ${0};
15 | snippet mod
16 | module ${1} = {
17 | ${0}
18 | };
19 | snippet modty
20 | module type ${1} = {
21 | ${0}
22 | };
23 | snippet sw
24 | switch (${1}) {
25 | | ${2} => ${0}
26 | }
27 | snippet |
28 | | ${1} => ${0}
29 | snippet p
30 | |> ${0}
31 | snippet if
32 | if (${1}) {
33 | ${2}
34 | } else {
35 | ${0}
36 | }
37 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/rst.snippets:
--------------------------------------------------------------------------------
1 | # rst
2 |
3 | snippet :
4 | :${1:field name}: $0
5 | snippet *
6 | *${1:Emphasis}* ${0}
7 | snippet **
8 | **${1:Strong emphasis}** ${0}
9 | snippet _
10 | \`${1:hyperlink-name}\`_
11 | .. _\`$1\`: ${0:link-block}
12 | snippet =
13 | ${1:Title}
14 | =====${2:=}
15 | ${0}
16 | snippet -
17 | ${1:Title}
18 | -----${2:-}
19 | ${0}
20 | #some directive
21 | snippet img:
22 | .. |${1:alias}| image:: ${0:img}
23 | snippet fig:
24 | .. figure:: ${1:img}
25 | :alt: ${2:alter text}
26 |
27 | $0
28 | snippet con:
29 | .. contents:: ${1:Table of Contents}
30 |
31 | ${0:content}
32 | snippet cod:
33 | .. code:: ${1:type}
34 |
35 | ${0:write some code}
36 | snippet tip:
37 | .. tip::
38 | ${0:my tips}
39 | snippet not:
40 | .. note::
41 | ${0:my notes}
42 | snippet war:
43 | .. warning::
44 | ${0:attention!}
45 | snippet imp:
46 | .. important::
47 | ${0:this is importatnt}
48 | snippet att:
49 | .. attention::
50 | ${0:hey!}
51 | snippet dan:
52 | .. danger::
53 | ${0:ah!}
54 | snippet err:
55 | .. error::
56 | ${0:Error occur}
57 | snippet cau:
58 | .. caution::
59 | ${0:Watch out!}
60 | #Sphinx only
61 | snippet sid:
62 | .. sidebar:: ${1:Title}
63 |
64 | ${0}
65 | snippet tod:
66 | .. todo::
67 | ${0}
68 | snippet lis:
69 | .. list-table:: ${1:Title}
70 | :header-rows: 1
71 | :stub-columns: 0
72 |
73 | * - ${0:R1C1}
74 | - R1C2
75 | * - R2C1
76 | - R2C2
77 | snippet csv:
78 | .. csv-table:: ${1:Title}
79 | :header-rows: 1
80 | :stub-columns: 0
81 |
82 | ${0:R1C1}, R1C2
83 | R2C1, R2C2
84 | snippet toc:
85 | .. toctree::
86 | :maxdepth: 2
87 |
88 | ${0}
89 | snippet dow:
90 | :download:\`${1:text} <${0:path}>\`
91 | snippet ref:
92 | :ref:\`${1:text} <${0:path}>\`
93 | snippet doc:
94 | :doc:\`${1:text} <${0:path}>\`
95 | # CJK optimize, CJK has no space between charaters
96 | snippet *c
97 | \ *${1:Emphasis}*\ ${0}
98 | snippet **c
99 | \ **${1:Strong emphasis}**\ ${0}
100 |
101 | # vim:set list noet sts=0 sw=4 ts=4:
102 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/scheme.snippets:
--------------------------------------------------------------------------------
1 | snippet +
2 | (+ ${1}
3 | ${0})
4 |
5 | snippet -
6 | (- ${1}
7 | ${0})
8 |
9 | snippet /
10 | (/ ${1}
11 | ${0})
12 |
13 | snippet *
14 | (* ${1}
15 | ${0})
16 |
17 | # Definition
18 | snippet def
19 | (define (${1:name})
20 | ${0:definition})
21 |
22 | # Definition with lambda
23 | snippet defl
24 | (define ${1:name}
25 | (lambda (x)(${0:definition})))
26 |
27 | # Condition
28 | snippet cond
29 | (cond ((${1:predicate}) (${2:action}))
30 | ((${3:predicate}) (${0:action})))
31 |
32 | # If statement
33 | snippet if
34 | (if (${1:predicate})
35 | (${2:true-action})
36 | (${0:false-action}))
37 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/scss.snippets:
--------------------------------------------------------------------------------
1 | extends css
2 |
3 | snippet $
4 | $${1:variable}: ${0:value};
5 | snippet imp
6 | @import '${0}';
7 | snippet mix
8 | @mixin ${1:name}(${2}) {
9 | ${0}
10 | }
11 | snippet inc
12 | @include ${1:mixin}(${2});
13 | snippet ext
14 | @extend ${0};
15 | snippet fun
16 | @function ${1:name}(${2:args}) {
17 | ${0}
18 | }
19 | snippet if
20 | @if $1 {
21 | ${0}
22 | }
23 | snippet ife
24 | @if $1 {
25 | ${2}
26 | } @else {
27 | ${0}
28 | }
29 | snippet eif
30 | @else if $1 {
31 | ${0}
32 | }
33 | snippet for
34 | @for ${1:$i} from ${2:1} through ${3:3} {
35 | ${0}
36 | }
37 | snippet each
38 | @each ${1:$item} in ${2:items} {
39 | ${0}
40 | }
41 | snippet while
42 | @while ${1:$i} ${2:>} ${3:0} {
43 | ${0}
44 | }
45 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/sh.snippets:
--------------------------------------------------------------------------------
1 | # Shebang
2 | snippet #!
3 | #!/bin/sh
4 |
5 | snippet s#!
6 | #!/bin/sh
7 | set -eu
8 |
9 | snippet safe
10 | set -eu
11 |
12 | snippet bash
13 | #!/usr/bin/env bash
14 |
15 | snippet sbash
16 | #!/usr/bin/env bash
17 | set -euo pipefail
18 | IFS=$'\n\t'
19 |
20 | snippet if
21 | if [ $1 ]; then
22 | ${0:${VISUAL}}
23 | fi
24 | snippet elif
25 | elif [ $1 ]; then
26 | ${0:${VISUAL}}
27 | snippet for
28 | for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do
29 | ${0:${VISUAL}}
30 | done
31 | snippet fori
32 | for ${1:needle} in ${2:haystack} ; do
33 | ${0:${VISUAL}}
34 | done
35 | snippet wh
36 | while [ $1 ]; do
37 | ${0:${VISUAL}}
38 | done
39 | snippet wht
40 | while true; do
41 | ${0:${VISUAL}}
42 | done
43 | snippet until
44 | until [ $1 ]; do
45 | ${0:${VISUAL}}
46 | done
47 | snippet case
48 | case ${1:word} in
49 | ${2:pattern})
50 | ${0};;
51 | esac
52 | snippet go
53 | while getopts '${1:o}' ${2:opts}
54 | do
55 | case $$2 in
56 | ${3:o0})
57 | ${0:#staments};;
58 | esac
59 | done
60 | # Set SCRIPT_DIR variable to directory script is located.
61 | snippet sdir
62 | SCRIPT_DIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
63 | # getopt
64 | snippet getopt
65 | __ScriptVersion="${1:version}"
66 |
67 | #=== FUNCTION ================================================================
68 | # NAME: usage
69 | # DESCRIPTION: Display usage information.
70 | #===============================================================================
71 | function usage ()
72 | {
73 | echo "Usage : \$${0:0} [options] [--]
74 |
75 | Options:
76 | -h|help Display this message
77 | -v|version Display script version"
78 |
79 | } # ---------- end of function usage ----------
80 |
81 | #-----------------------------------------------------------------------
82 | # Handle command line arguments
83 | #-----------------------------------------------------------------------
84 |
85 | while getopts ":hv" opt
86 | do
87 | case \$opt in
88 |
89 | h|help ) usage; exit 0 ;;
90 |
91 | v|version ) echo "\$${0:0} -- Version \$__ScriptVersion"; exit 0 ;;
92 |
93 | * ) echo -e "\\n Option does not exist : \$OPTARG\\n"
94 | usage; exit 1 ;;
95 |
96 | esac # --- end of case ---
97 | done
98 | shift \$(($OPTIND-1))
99 | snippet root
100 | if [ \$(id -u) -ne 0 ]; then exec sudo \$0; fi
101 |
102 | snippet fun-sh
103 | ${1:function_name}() {
104 | $0
105 | }
106 |
107 | snippet fun
108 | function ${1:function_name}() {
109 | $0
110 | }
111 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/simplemvcf.snippets:
--------------------------------------------------------------------------------
1 | snippet sm_controller
2 | db->select('SELECT * FROM '.$table.' WHERE ${3:where}', $data);
49 | }
50 |
51 | public function getRows($where)
52 | {
53 | return $this->db->select('SELECT * FROM '.$table.');
54 | }
55 |
56 | public function insert($data)
57 | {
58 | $this->db->insert($table, $data);
59 | }
60 |
61 | public function update($data, $where)
62 | {
63 | $this->db->update($table ,$data, $where);
64 | }
65 |
66 | public function delete($where)
67 | {
68 | $this->db->delete($table, $where);
69 | }
70 | }
71 | snippet sm_render
72 | View::render('${1:view}', $${2:array});
73 | snippet sm_render_template
74 | View::renderTemplate('${1:part}', $${2:array});
75 |
76 | # database
77 | snippet sm_db_select
78 | $this->db->select(${1:sql}, ${2:where});
79 |
80 | snippet sm_db_insert
81 | $this->db->insert(${1:table}, ${2:data});
82 |
83 | snippet sm_db_update
84 | $this->db->update(${1:table}, ${2:data}, ${3:where});
85 |
86 | snippet sm_db_delete
87 | $this->db->delete(${1:table}, ${2:where});
88 |
89 | snippet sm_db_truncate
90 | $this->db->delete(${1:table});
91 |
92 | #session
93 | snippet sm_session_set
94 | Session::set(${1:key}, ${2:value});
95 |
96 | snippet sm_session_get
97 | Session::get(${1:key});
98 |
99 | snippet sm_session_pull
100 | Session::pull(${1:key});
101 |
102 | snippet sm_session_id
103 | Session::id();
104 |
105 | snippet sm_session_destroy
106 | Session::set(${1:key});
107 |
108 | snippet sm_session_display
109 | Session::display();
110 |
111 | #url
112 | snippet sm_url_redirect
113 | Url:redirect('${1:path}');
114 |
115 | snippet sm_url_previous
116 | Url:previous();
117 |
118 | snippet sm_url_templatepath
119 | Url:templatePath();
120 |
121 | snippet sm_url_autolink
122 | Url:autolink('${1:string}');
123 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/slim.snippets:
--------------------------------------------------------------------------------
1 | snippet pry
2 | - binding.pry
3 | snippet renp
4 | = render partial: '${0}'
5 | # Forms
6 | # =====
7 | snippet fieldset
8 | fieldset
9 | legend ${1}
10 | snippet css
11 | link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}"
12 | snippet script
13 | script src="${1:script.js}" type="text/javascript"
14 | # Some useful Unicode entities
15 | # ============================
16 | # Non-Breaking Space
17 | snippet nbs
18 |
19 | # ←
20 | snippet left
21 | ←
22 | # →
23 | snippet right
24 | →
25 | # ↑
26 | snippet up
27 | ↑
28 | # ↓
29 | snippet down
30 | ↓
31 | # ↩
32 | snippet return
33 | ↩
34 | # ⇤
35 | snippet backtab
36 | ⇤
37 | # ⇥
38 | snippet tab
39 | ⇥
40 | # ⇧
41 | snippet shift
42 | ⇧
43 | # ⌃
44 | snippet ctrl
45 | ⌃
46 | # ⌅
47 | snippet enter
48 | ⌅
49 | # ⌘
50 | snippet cmd
51 | ⌘
52 | # ⌥
53 | snippet option
54 | ⌥
55 | # ⌦
56 | snippet delete
57 | ⌦
58 | # ⌫
59 | snippet backspace
60 | ⌫
61 | # ⎋
62 | snippet esc
63 | ⎋
64 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/snippets.snippets:
--------------------------------------------------------------------------------
1 | # snippets for making snippets :)
2 | snippet snip
3 | snippet ${1:trigger} "${2:description}"
4 | ${0:${VISUAL}}
5 | snippet v
6 | {VISUAL}
7 | snippet $
8 | ${${1:1}:${0:text}}
9 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/sql.snippets:
--------------------------------------------------------------------------------
1 | snippet tbl
2 | create table ${1:table} (
3 | ${0:columns}
4 | );
5 | snippet col
6 | ${1:name} ${2:type} ${3:default ''} ${0:not null}
7 | snippet ccol
8 | ${1:name} varchar2(${2:size}) ${3:default ''} ${0:not null}
9 | snippet ncol
10 | ${1:name} number ${3:default 0} ${0:not null}
11 | snippet dcol
12 | ${1:name} date ${3:default sysdate} ${0:not null}
13 | snippet ind
14 | create index ${0:$1_$2} on ${1:table}(${2:column});
15 | snippet uind
16 | create unique index ${1:name} on ${2:table}(${0:column});
17 | snippet tblcom
18 | comment on table ${1:table} is '${0:comment}';
19 | snippet colcom
20 | comment on column ${1:table}.${2:column} is '${0:comment}';
21 | snippet addcol
22 | alter table ${1:table} add (${2:column} ${0:type});
23 | snippet seq
24 | create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${0:1};
25 | snippet s*
26 | select * from ${0:table}
27 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/supercollider.snippets:
--------------------------------------------------------------------------------
1 | snippet b
2 | (
3 | ${0}
4 | )
5 | snippet if
6 | if (${1}) {
7 | ${0}
8 | }
9 | snippet ife
10 | if (${1}) {
11 | ${2}
12 | } {
13 | ${0}
14 | }
15 | snippet for
16 | for (${1:1}, ${2:10}) { |i|
17 | ${0}
18 | }
19 | snippet sdef
20 | SynthDef(\\${1:synthName}, {${2}
21 | ${0}
22 | }).add;
23 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/svelte.snippets:
--------------------------------------------------------------------------------
1 | extends html, javascript, css
2 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/tcl.snippets:
--------------------------------------------------------------------------------
1 | # #!/usr/bin/env tclsh
2 | snippet #!
3 | #!/usr/bin/env tclsh
4 |
5 | # Process
6 | snippet pro
7 | proc ${1:function_name} {${2:args}} {
8 | ${0}
9 | }
10 | #xif
11 | snippet xif
12 | ${1:expr}? ${2:true} : ${0:false}
13 | # Conditional
14 | snippet if
15 | if {${1}} {
16 | ${0}
17 | }
18 | # Conditional if..else
19 | snippet ife
20 | if {${1}} {
21 | ${2}
22 | } else {
23 | ${0:# else...}
24 | }
25 | snippet eif
26 | elseif {${1}} {
27 | ${0}
28 | }
29 | # Conditional if..elsif..else
30 | snippet ifee
31 | if {${1}} {
32 | ${2}
33 | } elseif {${3}} {
34 | ${4:# elsif...}
35 | } else {
36 | ${0:# else...}
37 | }
38 | # If catch then
39 | snippet ifc
40 | if { [catch {${1:#do something...}} ${2:err}] } {
41 | ${0:# handle failure...}
42 | }
43 | # Catch
44 | snippet catch
45 | catch {${1}} ${2:err} ${0:options}
46 | # While Loop
47 | snippet wh
48 | while {${1}} {
49 | ${0}
50 | }
51 | # For Loop
52 | snippet for
53 | for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} {
54 | ${0}
55 | }
56 | # Foreach Loop
57 | snippet fore
58 | foreach ${1:x} {${2:#list}} {
59 | ${0}
60 | }
61 | # after ms script...
62 | snippet af
63 | after ${1:ms} ${0:#do something}
64 | # after cancel id
65 | snippet afc
66 | after cancel ${0:id or script}
67 | # after idle
68 | snippet afi
69 | after idle ${0:script}
70 | # after info id
71 | snippet afin
72 | after info ${0:id}
73 | # Expr
74 | snippet exp
75 | expr {${0:#expression here}}
76 | # Switch
77 | snippet sw
78 | switch ${1:var} {
79 | ${3:pattern 1} {
80 | ${0:#do something}
81 | }
82 | default {
83 | ${2:#do something}
84 | }
85 | }
86 | # Case
87 | snippet ca
88 | ${1:pattern} {
89 | ${2:#do something}
90 | }
91 | # Namespace eval
92 | snippet ns
93 | namespace eval ${1:path} {${0:#script...}}
94 | # Namespace current
95 | snippet nsc
96 | namespace current
97 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/textile.snippets:
--------------------------------------------------------------------------------
1 | # Jekyll post header
2 | snippet header
3 | ---
4 | title: ${1:title}
5 | layout: post
6 | date: ${2:date} ${0:hour:minute:second} -05:00
7 | ---
8 |
9 | # Image
10 | snippet img
11 | !${1:url}(${2:title}):${0:link}!
12 |
13 | # Table
14 | snippet |
15 | |${1}|
16 |
17 | # Link
18 | snippet link
19 | "${1:link text}":${0:url}
20 |
21 | # Acronym
22 | snippet (
23 | (${1:Expand acronym})
24 |
25 | # Footnote
26 | snippet fn
27 | [${1:ref number}] ${0}
28 |
29 | fn$1. ${2:footnote}
30 |
31 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/typescript.snippets:
--------------------------------------------------------------------------------
1 | extends javascript
2 |
3 | snippet tconst "ts const"
4 | const ${1}: ${2:any} = ${3};
5 | ${0}
6 | snippet tlet "ts let"
7 | let ${1}: ${2:any} = ${3};
8 | ${0}
9 | snippet tvar "ts var"
10 | var ${1}: ${2:any} = ${3};
11 | ${0}
12 | snippet + "ts create field"
13 | ${1}: ${0:any}
14 | snippet #+ "ts create private field using #"
15 | #${1}: ${0:any}
16 | snippet tpfi "ts create public field"
17 | public ${1}: ${0:any}
18 | snippet tprfi "ts create private field"
19 | private ${1}: ${0:any}
20 | snippet tprofi "ts create protected field"
21 | protected ${1}: ${0:any}
22 | snippet int "interface"
23 | interface ${1} {
24 | ${2}: ${3:any};
25 | ${0}
26 | }
27 | snippet intx "interface extends"
28 | interface ${1} extends ${2} {
29 | ${3}: ${4:any};
30 | ${0}
31 | }
32 | snippet tfun "ts function"
33 | function ${1}(${2}): ${3:any} {
34 | ${0}
35 | }
36 | snippet tpmet "ts public method"
37 | public ${1}(${2}): ${3:any} {
38 | ${0}
39 | }
40 | snippet tpsmet "ts public static method"
41 | public static ${1}(${2}): ${3:any} {
42 | ${0}
43 | }
44 | snippet tprmet "ts private method"
45 | private ${1}(${2}): ${3:any} {
46 | ${0}
47 | }
48 | snippet tpromet "ts protected method"
49 | protected ${1}(${2}): ${3:any} {
50 | ${0}
51 | }
52 | snippet tcla "ts class"
53 | class ${1} {
54 | ${2}
55 | constructor(public ${3}: ${4: any}) {
56 | ${5}
57 | }
58 | ${0}
59 | }
60 | snippet tclax "ts class extends"
61 | class ${1} extends ${2} {
62 | ${3}
63 | constructor(public ${4}: ${5: any}) {
64 | ${6}
65 | }
66 | ${0}
67 | }
68 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/typescriptreact.snippets:
--------------------------------------------------------------------------------
1 | extends typescript
2 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/verilog.snippets:
--------------------------------------------------------------------------------
1 | # if statement
2 | snippet if
3 | if (${1}) begin
4 | ${0}
5 | end
6 | # If/else statements
7 | snippet ife
8 | if (${1}) begin
9 | ${2}
10 | end
11 | else begin
12 | ${3}
13 | end
14 | # Else if statement
15 | snippet eif
16 | else if (${1}) begin
17 | ${0}
18 | end
19 | #Else statement
20 | snippet el
21 | else begin
22 | ${0}
23 | end
24 | # While statement
25 | snippet wh
26 | while (${1}) begin
27 | ${0}
28 | end
29 | # Repeat Loop
30 | snippet rep
31 | repeat (${1}) begin
32 | ${0}
33 | end
34 | # Case statement
35 | snippet case
36 | case (${1:/* variable */})
37 | ${2:/* value */}: begin
38 | ${3}
39 | end
40 | default: begin
41 | ${4}
42 | end
43 | endcase
44 | # CaseZ statement
45 | snippet casez
46 | casez (${1:/* variable */})
47 | ${2:/* value */}: begin
48 | ${3}
49 | end
50 | default: begin
51 | ${4}
52 | end
53 | endcase
54 | # Always block
55 | snippet al
56 | always @(${1:/* sensitive list */}) begin
57 | ${0}
58 | end
59 | # Module block
60 | snippet mod
61 | module ${1:`vim_snippets#Filename('$1', 'name')`} (${2});
62 | ${0}
63 | endmodule
64 | # For
65 | snippet for
66 | for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) begin
67 | ${4}
68 | end
69 | # Forever
70 | snippet forev
71 | forever begin
72 | ${0}
73 | end
74 | # Function
75 | snippet fun
76 | function ${1:void} ${2:name}(${3});
77 | ${0}
78 | endfunction: $2
79 | # Task
80 | snippet task
81 | task ${1:name}(${2});
82 | ${0}
83 | endtask: $1
84 | # Initial
85 | snippet ini
86 | initial begin
87 | ${0}
88 | end
89 | # typedef struct packed
90 | snippet tdsp
91 | typedef struct packed {
92 | int ${2:data};
93 | } ${1:`vim_snippets#Filename('$1_t', 'name')`};
94 | # typedef eum
95 | snippet tde
96 | typedef enum ${2:logic[15:0]}
97 | {
98 | ${3:REG = 16'h0000}
99 | } ${1:my_dest_t};
100 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/vhdl.snippets:
--------------------------------------------------------------------------------
1 | #
2 | ## Libraries
3 |
4 | snippet lib
5 | library ${1}
6 | use $1.${2}
7 |
8 | # Standard Libraries
9 | snippet libs
10 | library IEEE;
11 | use IEEE.std_logic_1164.ALL;
12 | use IEEE.numeric_std.ALL;
13 |
14 | # Xilinx Library
15 | snippet libx
16 | library UNISIM;
17 | use UNISIM.VCOMPONENTS.ALL;
18 |
19 | ## Entity Declaration
20 | snippet ent
21 | entity ${1:`vim_snippets#Filename()`} is
22 | generic (
23 | ${2}
24 | );
25 | port (
26 | ${3}
27 | );
28 | end entity $1;
29 |
30 | ## Architecture
31 | snippet arc
32 | architecture ${1:behav} of ${2:`vim_snippets#Filename()`} is
33 |
34 | ${3}
35 |
36 | begin
37 |
38 |
39 | end $1;
40 |
41 | ## Declarations
42 | # std_logic
43 | snippet st
44 | signal ${1} : std_logic;
45 | # std_logic_vector
46 | snippet sv
47 | signal ${1} : std_logic_vector (${2} downto 0);
48 | # std_logic in
49 | snippet ist
50 | ${1} : in std_logic;
51 | # std_logic_vector in
52 | snippet isv
53 | ${1} : in std_logic_vector (${2} downto 0);
54 | # std_logic out
55 | snippet ost
56 | ${1} : out std_logic;
57 | # std_logic_vector out
58 | snippet osv
59 | ${1} : out std_logic_vector (${2} downto 0);
60 | # unsigned
61 | snippet un
62 | signal ${1} : unsigned (${2} downto 0);
63 | ## Process Statements
64 | # process
65 | snippet pr
66 | process (${1})
67 | begin
68 | ${2}
69 | end process;
70 | # process with clock
71 | snippet prc
72 | process (${1:clk})
73 | begin
74 | if rising_edge ($1) then
75 | ${2}
76 | end if;
77 | end process;
78 | # process with clock and reset
79 | snippet prcr
80 | process (${1:clk}, ${2:nrst})
81 | begin
82 | if ($2 = '${3:0}') then
83 | ${4}
84 | elsif rising_edge($1) then
85 | ${5}
86 | end if;
87 | end process;
88 | # process all
89 | snippet pra
90 | process (${1:all})
91 | begin
92 | ${2}
93 | end process;
94 | ## Control Statements
95 | # if
96 | snippet if
97 | if ${1} then
98 | ${2}
99 | end if;
100 | # if
101 | snippet ife
102 | if ${1} then
103 | ${2}
104 | else
105 | ${3}
106 | end if;
107 | # else
108 | snippet el
109 | else
110 | ${1}
111 | # if
112 | snippet eif
113 | elsif ${1} then
114 | ${2}
115 | # case
116 | snippet ca
117 | case ${1} is
118 | ${2}
119 | end case;
120 | # when
121 | snippet wh
122 | when ${1} =>
123 | ${2}
124 | # for
125 | snippet for
126 | for ${1:i} in ${2} ${3:to} ${4} loop
127 | ${5}
128 | end loop;
129 | # while
130 | snippet wh
131 | while ${1} loop
132 | ${2}
133 | end loop;
134 | ## Misc
135 | # others
136 | snippet oth
137 | (others => '${1:0}');
138 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/vim.snippets:
--------------------------------------------------------------------------------
1 | snippet header standard Vim script file header
2 | " File: ${1:`expand('%:t')`}
3 | " Author: ${2:`g:snips_author`}
4 | " Description: ${3}
5 | ${0:" Last Modified: `strftime("%B %d, %Y")`}
6 | snippet guard script reload guard
7 | if exists('${1:did_`vim_snippets#Filename()`}') || &cp${2: || version < 700}
8 | finish
9 | endif
10 | let $1 = 1${0}
11 | snippet f function
12 | fun! ${1:`expand('%') =~ 'autoload' ? substitute(matchstr(expand('%:p'),'autoload/\zs.*\ze.vim'),'[/\\]','#','g').'#' : ''`}${2:function_name}(${3})
13 | ${0}
14 | endf
15 | snippet t try ... catch statement
16 | try
17 | ${1:${VISUAL}}
18 | catch ${2}
19 | ${0}
20 | endtry
21 | snippet for for ... in loop
22 | for ${1} in ${2}
23 | ${0:${VISUAL}}
24 | endfor
25 | snippet forkv for [key, value] in loop
26 | for [${1},${2}] in items(${3})
27 | ${0}
28 | unlet $1 $2
29 | endfor
30 | snippet wh while loop
31 | while ${1}
32 | ${0:${VISUAL}}
33 | endw
34 | snippet if if statement
35 | if ${1}
36 | ${0:${VISUAL}}
37 | endif
38 | snippet ife if ... else statement
39 | if ${1}
40 | ${2:${VISUAL}}
41 | else
42 | ${0}
43 | endif
44 | snippet au augroup ... autocmd block
45 | augroup ${1:AU_NAME}
46 | autocmd!
47 | autocmd ${2:BufRead,BufNewFile} ${3:*.ext,*.ext3|} ${0}
48 | augroup END
49 | snippet auv augroupvisual ... autocmd block with visual placeholder
50 | augroup ${1:AU_NAME}
51 | autocmd!
52 | ${0:${VISUAL}}
53 | augroup END
54 | snippet bun Vundle.vim Plugin definition
55 | Plugin '${0}'
56 | snippet plug vim-plug Plugin definition
57 | Plug '${0}'
58 | snippet plugdo vim-plug Plugin definition with { 'do': '' }
59 | Plug '${1}', { 'do': '${0}' }
60 | snippet plugon vim-plug Plugin definition with { 'on': '' }
61 | Plug '${1}', { 'on': '${0}' }
62 | snippet plugfor vim-plug Plugin definition with { 'for': '' }
63 | Plug '${1}', { 'for': '${0}' }
64 | snippet plugbr vim-plug Plugin definition with { 'branch': '' }
65 | Plug '${1}', { 'branch': '${0}' }
66 | snippet plugtag vim-plug Plugin definition with { 'tag': '' }
67 | Plug '${1}', { 'tag': '${0}' }
68 | snippet let
69 | let ${1:variable} = ${0: value}
70 | snippet se
71 | set ${1:setting};
72 | snippet set
73 | set ${1:setting} = ${0:value}
74 | snippet nn
75 | nnoremap ${1} ${2}
76 | snippet no
77 | noremap ${1} ${2}
78 | snippet vm
79 | vmap ${1} ${2}
80 | snippet im
81 | imap ${1} ${2}
82 | snippet exe
83 | execute ${1}
84 | snippet filename
85 | `Filename()`
86 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/xml.snippets:
--------------------------------------------------------------------------------
1 | # xml declaration
2 | snippet xml
3 |
4 | # tag
5 | snippet t
6 | <${1:}>
7 | ${2}
8 | $1>
9 | # inline tag
10 | snippet ti
11 | <${1:}>${2}$1>
12 |
13 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/xslt.snippets:
--------------------------------------------------------------------------------
1 | snippet apply-templates with-param
2 |
3 | ${3}${4}
4 |
5 |
6 | snippet apply-templates sort-by
7 |
8 | ${5}
9 |
10 |
11 | snippet apply-templates plain
12 |
13 |
14 | snippet attribute blank
15 | ${2}
16 |
17 | snippet attribute value-of
18 |
19 |
20 |
21 |
22 | snippet call-template
23 |
24 |
25 | snippet call-template with-param
26 |
27 | ${3}${4}
28 |
29 |
30 | snippet choose
31 |
32 |
33 | ${2}
34 |
35 |
36 |
37 | snippet copy-of
38 |
39 |
40 | snippet for-each
41 | ${2}
42 |
43 |
44 | snippet if
45 | ${2}
46 |
47 |
48 | snippet import
49 |
50 |
51 | snippet include
52 |
53 |
54 | snippet otherwise
55 | ${0}
56 |
57 |
58 | snippet param
59 | ${2}
60 |
61 |
62 | snippet stylesheet
63 | ${0}
65 |
66 |
67 | snippet template
68 | ${0}
69 |
70 |
71 | snippet template named
72 | ${0}
73 |
74 |
75 | snippet text
76 | ${0}
77 |
78 | snippet value-of
79 |
80 |
81 | snippet variable blank
82 | ${0}
83 |
84 |
85 | snippet variable select
86 |
87 |
88 | snippet when
89 | ${0}
90 |
91 |
92 | snippet with-param
93 | ${0}
94 |
95 | snippet with-param select
96 |
97 |
98 |
--------------------------------------------------------------------------------
/config/vim-snippets/snippets/zsh.snippets:
--------------------------------------------------------------------------------
1 | # #!/bin/zsh
2 | extends bash
3 |
4 | snippet #!
5 | #!/usr/bin/env zsh
6 |
7 | snippet if
8 | if $1; then
9 | ${0:${VISUAL}}
10 | fi
11 | snippet ife
12 | if $1; then
13 | ${2:${VISUAL}}
14 | else
15 | ${0:# statements}
16 | fi
17 | snippet eif
18 | elif $1; then
19 | ${0:${VISUAL}}
20 | snippet for
21 | for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do
22 | ${0:${VISUAL}}
23 | done
24 | snippet fori
25 | for ${1:needle} in ${2:haystack}; do
26 | ${0:${VISUAL}}
27 | done
28 | snippet fore
29 | for ${1:item} in ${2:list}; do
30 | ${0:${VISUAL}}
31 | done
32 | snippet wh
33 | while $1; do
34 | ${0:${VISUAL}}
35 | done
36 | snippet until
37 | until $1; do
38 | ${0:${VISUAL}}
39 | done
40 | snippet repeat
41 | repeat ${1:integer}; do
42 | ${0:${VISUAL}}
43 | done
44 | snippet case
45 | case ${1:word} in
46 | ${2:pattern})
47 | ${0};;
48 | esac
49 | snippet select
50 | select ${1:answer} in ${2:choices}; do
51 | ${0:${VISUAL}}
52 | done
53 | snippet (
54 | ( ${0:#statements} )
55 | snippet {
56 | { ${0:#statements} }
57 | snippet [
58 | [[ ${0:test} ]]
59 | snippet always
60 | { ${1:try} } always { ${0:always} }
61 | snippet fun
62 | ${1:function_name}() {
63 | ${0:# function_body}
64 | }
65 | snippet ffun
66 | function ${1:function_name}() {
67 | ${0:# function_body}
68 | }
69 |
--------------------------------------------------------------------------------
/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "livs neovim configuration, declaratively written using nix";
3 |
4 | inputs = {
5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6 | nixvim.url = "github:nix-community/nixvim";
7 | flake-parts.url = "github:hercules-ci/flake-parts";
8 | };
9 |
10 | outputs = {
11 | nixvim,
12 | flake-parts,
13 | ...
14 | } @ inputs:
15 | flake-parts.lib.mkFlake {inherit inputs;} {
16 | systems = [
17 | "x86_64-linux"
18 | "aarch64-linux"
19 | ];
20 |
21 | perSystem = {
22 | pkgs,
23 | system,
24 | ...
25 | }: let
26 | nixvimLib = nixvim.lib.${system};
27 | nixvim' = nixvim.legacyPackages.${system};
28 | nixvimModule = {
29 | inherit pkgs;
30 | module = import ./config; # import the module directly
31 | # You can use `extraSpecialArgs` to pass additional arguments to your module files
32 | extraSpecialArgs = {
33 | # inherit (inputs) foo;
34 | };
35 | };
36 | nvim = nixvim'.makeNixvimWithModule nixvimModule;
37 | in {
38 | checks = {
39 | # Run `nix flake check .` to verify that your config is not broken
40 | default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
41 | };
42 |
43 | packages = {
44 | # Lets you run `nix run .` to start nixvim
45 | default = nvim;
46 | };
47 | };
48 | };
49 | }
50 |
--------------------------------------------------------------------------------