├── .gitignore ├── LICENSE ├── README.md ├── bin ├── .clang-format └── snippets │ ├── _.snippets │ ├── actionscript.snippets │ ├── ada.snippets │ ├── all.snippets │ ├── alpaca.snippets │ ├── apache.snippets │ ├── arduino.snippets │ ├── autoit.snippets │ ├── awk.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 │ ├── gitcommit.snippets │ ├── go.snippets │ ├── haml.snippets │ ├── handlebars.snippets │ ├── haskell.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 │ ├── lua_snip │ ├── all.lua │ ├── javascript.lua │ ├── lua.lua │ └── markdown.lua │ ├── make.snippets │ ├── mako.snippets │ ├── markdown.snippets │ ├── matlab.snippets │ ├── mustache.snippets │ ├── objc.snippets │ ├── ocaml.snippets │ ├── octave.snippets │ ├── openfoam.snippets │ ├── package.json │ ├── 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 │ ├── snippets.snippets │ ├── sql.snippets │ ├── stylus.snippets │ ├── supercollider.snippets │ ├── svelte.snippets │ ├── systemverilog.snippets │ ├── tcl.snippets │ ├── tex.snippets │ ├── textile.snippets │ ├── twig.snippets │ ├── txt.snippets │ ├── typescript.snippets │ ├── typescriptreact.snippets │ ├── verilog.snippets │ ├── vhdl.snippets │ ├── vim.snippets │ ├── vue.snippets │ ├── xml.snippets │ ├── xslt.snippets │ ├── yii-chtml.snippets │ ├── yii.snippets │ └── zsh.snippets ├── colors ├── dull.lua ├── everforest.lua ├── google-light.lua ├── gruvbox.vim ├── monokai.lua ├── nvstar.vim └── wave.lua ├── init.lua └── lua ├── core ├── abbreviations.lua ├── autocmds.lua ├── colors.lua ├── colorscheme.lua ├── constants.lua ├── maps.lua ├── options.lua ├── plugins.lua ├── user.lua └── utils │ ├── assistance.lua │ ├── docker.lua │ ├── init.lua │ ├── notify.lua │ └── toggle.lua └── plug ├── chatgpt.lua ├── cheatsheet.lua ├── cmp ├── dynamic.lua ├── init.lua ├── luasnip.lua └── tabnine.lua ├── colorizer.lua ├── dadbod.lua ├── fzf.lua ├── hydra ├── dap.lua ├── git.lua ├── init.lua ├── options.lua ├── spelling.lua ├── telescope.lua └── windows.lua ├── init.lua ├── lsp ├── diagnostics-highlight-override.lua ├── init.lua ├── lsp-installer.lua ├── null-ls.lua └── servers │ ├── bashls.lua │ ├── clangd.lua │ ├── emmet-ls.lua │ ├── gopls.lua │ ├── itex.lua │ ├── jsonls.lua │ ├── marksman.lua │ ├── pyright.lua │ ├── sqls.lua │ ├── sumneko-lua.lua │ ├── taplo.lua │ ├── texlab.lua │ ├── vimls.lua │ └── yamlls.lua ├── lspkind.lua ├── mason.lua ├── nvim-tree.lua ├── other.lua ├── regexp.lua ├── tabout.lua ├── telescope ├── init.lua └── options.lua ├── terminal.lua ├── todo-comments.lua ├── toggle.lua ├── treesitter.lua ├── trouble.lua ├── ts-context.lua ├── ui ├── bufferline.lua ├── dashboard.lua ├── git-sign.lua ├── indentscope.lua ├── init.lua ├── minimap.lua ├── noice.lua ├── notify.lua └── statusline.lua └── whichkey.lua /.gitignore: -------------------------------------------------------------------------------- 1 | plugin 2 | friendly-snippets 3 | .gitignore 4 | 5 | luasnip_snippets 6 | 7 | .luarc.json 8 | db_ui 9 | -------------------------------------------------------------------------------- /bin/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:/* condition */}) { 118 | ${0:${VISUAL}} 119 | } 120 | snippet el 121 | else { 122 | ${0:${VISUAL}} 123 | } 124 | # Ternary conditional 125 | snippet t 126 | ${1:/* condition */} ? ${2:a} : ${0:b} 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 | 154 | -------------------------------------------------------------------------------- /bin/snippets/all.snippets: -------------------------------------------------------------------------------- 1 | snippet lorem "Lorem Ipsum - 50 Words" b 2 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 3 | 4 | snippet gibrish "gibrish text" 5 | Who would by a we have spurns, and thus contumely, to be, the might himself might, and more; and the wills weath, those that undiscorns of time, their to, 'tis quietus thers the rub; fortune, or not them? To be wills we know no trave spurns, and scorns of soment makes us cowardels be wish'd. To dreat may weath thousand the unwortal shocks turns that dread of so lover'd consummatience dreams a sleep; to die: ther a sleep; to say consients the name with a sea off troublesh is rathe the dreat fly to be 6 | 7 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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:/* condition */}) { 23 | ${0:${VISUAL}} 24 | } 25 | # else 26 | snippet el 27 | else { 28 | ${1} 29 | } 30 | # else if 31 | snippet elif 32 | else if (${1:/* condition */}) { 33 | ${2} 34 | } 35 | # ifi 36 | snippet ifi 37 | if (${1:/* condition */}) ${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:/* condition */}) { 67 | ${2} 68 | } 69 | # do... while 70 | snippet do 71 | do { 72 | ${2} 73 | } while (${1:/* condition */}); 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 | -------------------------------------------------------------------------------- /bin/snippets/autoit.snippets: -------------------------------------------------------------------------------- 1 | snippet if 2 | If ${1:condition} Then 3 | ${0:; True code} 4 | EndIf 5 | snippet el 6 | Else 7 | ${0} 8 | snippet eif 9 | ElseIf ${1:condition} Then 10 | ${0:; True code} 11 | # If/Else block 12 | snippet ife 13 | If ${1:condition} 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:condition}) 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:condition}) 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:condition}) 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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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:body}) 85 | snippet when-let 86 | (when-let [${1:result} ${2:test}] 87 | ${0:body}) 88 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/coffee/coffee.snippets: -------------------------------------------------------------------------------- 1 | # Closure loop 2 | snippet forindo 3 | for ${1:name} in ${2:array} 4 | do ($1) -> 5 | ${0:// body} 6 | # Array comprehension 7 | snippet fora 8 | for ${1:name} in ${2:array} 9 | ${0:# body...} 10 | # Object comprehension 11 | snippet foro 12 | for ${1:key}, ${2:value} of ${3:object} 13 | ${0:# body...} 14 | # Range comprehension (inclusive) 15 | snippet forr 16 | for ${1:name} in [${2:start}..${3:finish}] 17 | ${0:# body...} 18 | snippet forrb 19 | for ${1:name} in [${2:start}..${3:finish}] by ${4:step} 20 | ${0:# body...} 21 | # Range comprehension (exclusive) 22 | snippet forrex 23 | for ${1:name} in [${2:start}...${3:finish}] 24 | ${0:# body...} 25 | snippet forrexb 26 | for ${1:name} in [${2:start}...${3:finish}] by ${4:step} 27 | ${0:# body...} 28 | # Function 29 | snippet fun 30 | (${1:args}) -> 31 | ${0:# body...} 32 | # Function (bound) 33 | snippet bfun 34 | (${1:args}) => 35 | ${0:# body...} 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:condition} 58 | ${0:${VISUAL}} 59 | # If __ Else 60 | snippet ife 61 | if ${1:condition} 62 | ${2:${VISUAL}} 63 | else 64 | ${0:# body...} 65 | # Else if 66 | snippet eif 67 | else if ${1:condition} 68 | ${0:${VISUAL}} 69 | # Ternary If 70 | snippet ifte 71 | if ${1:condition} then ${2:value} else ${0:other} 72 | # Unless 73 | snippet unl 74 | ${1:action} unless ${0:condition} 75 | # Switch 76 | snippet swi 77 | switch ${1:object} 78 | when ${2:value} 79 | ${0:# body...} 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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/crystal.snippets: -------------------------------------------------------------------------------- 1 | snippet req require 2 | require "${1}" 3 | snippet case 4 | case ${1:object} 5 | when ${2:condition} 6 | ${0} 7 | end 8 | snippet when 9 | when ${1:condition} 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:condition} 21 | ${0:${VISUAL}} 22 | end 23 | snippet ife 24 | if ${1:condition} 25 | ${2:${VISUAL}} 26 | else 27 | ${0} 28 | end 29 | snippet wh 30 | while ${1:condition} 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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | @override 7 | Widget build(BuildContext context) { 8 | return Container( 9 | $2 10 | ); 11 | } 12 | } 13 | 14 | # Flutter stateful widget 15 | snippet stful 16 | class $1 extends StatefulWidget { 17 | @override 18 | _$1State createState() => _$1State(); 19 | } 20 | 21 | class _$1State extends State<$1> { 22 | @override 23 | Widget build(BuildContext context) { 24 | return Container( 25 | $2 26 | ); 27 | } 28 | } 29 | 30 | # Flutter widget with AnimationController 31 | snippet stanim 32 | class $1 extends StatefulWidget { 33 | @override 34 | _$1State createState() => _$1State(); 35 | } 36 | 37 | class _$1State extends State<$1> 38 | with SingleTickerProviderStateMixin { 39 | AnimationController _controller; 40 | 41 | @override 42 | void initState() { 43 | super.initState(); 44 | _controller = AnimationController(vsync: this); 45 | } 46 | 47 | @override 48 | void dispose() { 49 | super.dispose(); 50 | _controller.dispose(); 51 | } 52 | 53 | @override 54 | Widget build(BuildContext context) { 55 | return Container( 56 | $2 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /bin/snippets/dart.snippets: -------------------------------------------------------------------------------- 1 | snippet lib 2 | library ${1}; 3 | ${0} 4 | snippet im 5 | import 'package:${1}/${2}.dart'; 6 | ${0} 7 | snippet rgx 8 | new RegExp(r'${1}') 9 | snippet var 10 | var ${1} = ${2}; 11 | snippet main 12 | main() { 13 | ${0} 14 | } 15 | snippet st 16 | static ${0} 17 | snippet fi 18 | final ${0} 19 | snippet re 20 | return ${0} 21 | snippet br 22 | break; 23 | snippet th 24 | throw ${0} 25 | snippet cl 26 | class ${1:`vim_snippets#Filename("", "untitled")`} ${0} 27 | snippet in 28 | interface ${1:`vim_snippets#Filename("", "untitled")`} ${0} 29 | snippet imp 30 | implements ${0} 31 | snippet ext 32 | extends ${0} 33 | snippet if 34 | if (${1:true}) { 35 | ${0} 36 | } 37 | snippet ife 38 | if (${1:true}) { 39 | ${2} 40 | } else { 41 | ${0} 42 | } 43 | snippet el 44 | else 45 | snippet sw 46 | switch (${1}) { 47 | ${0} 48 | } 49 | snippet cs 50 | case ${1}: 51 | ${0} 52 | snippet de 53 | default: 54 | ${0} 55 | snippet for 56 | for (var ${2:i} = 0, len = ${1:things}.length; $2 < len; ${3:++}$2) { 57 | ${0:$1[$2]} 58 | } 59 | snippet fore 60 | for (final ${2:item} in ${1:itemList}) { 61 | ${0} 62 | } 63 | snippet wh 64 | while (${1:/* condition */}) { 65 | ${0} 66 | } 67 | snippet dowh 68 | do { 69 | ${0} 70 | } while (${0:/* condition */}); 71 | snippet as 72 | assert(${0:/* condition */}); 73 | snippet try 74 | try { 75 | ${0:${VISUAL}} 76 | } catch (${1:Exception e}) { 77 | } 78 | snippet tryf 79 | try { 80 | ${0:${VISUAL}} 81 | } catch (${1:Exception e}) { 82 | } finally { 83 | } 84 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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:condition} 23 | ${0} 24 | end 25 | 26 | # If else 27 | snippet ife 28 | if ${1:condition} 29 | ${0} 30 | else 31 | ${1} 32 | end 33 | 34 | # If else if 35 | snippet eif 36 | elif ${1:condition} 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 | -------------------------------------------------------------------------------- /bin/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:condition}) 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:condition}) 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 | -------------------------------------------------------------------------------- /bin/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>..." 36 | <#if ${1:true}> 37 | ${0:${VISUAL}} 38 | 39 | # If/else statement 40 | snippet ife "<#if condition>...<#else>..." 41 | <#if ${1:true}> 42 | ${0:${VISUAL}} 43 | <#else> 44 | ${2} 45 | 46 | # Iteration over a sequence 47 | snippet lis "<#list sequence as element>..." 48 | <#list ${1:sequence} as ${2:element}> 49 | ${0:${VISUAL}} 50 | 51 | # Iteration over an hashmap 52 | snippet lish "<#list hashmap?keys as element>..." 53 | <#list ${1:hashmap}?keys as ${2:key}> 54 | \${$2\}: \${$1[$2]\}${0:${VISUAL}} 55 | 56 | # Macro statement 57 | snippet mac "<#macro macro_name param1>..." 58 | <#macro ${1:macro_name} ${2:param1}> 59 | ${0:${VISUAL}} 60 | 61 | # Function statement 62 | snippet fun "<#function function_name param1>..." 63 | <#function ${1:function_name} ${2:param1}> 64 | ${0:${VISUAL}} 65 | 66 | # Attempt statement (try-catch to prevent runtime exceptions) 67 | snippet att "<#attempt>...<#recover>" 68 | <#attempt> 69 | ${0:${VISUAL}} 70 | <#recover> 71 | 72 | # Then built-in for booleans 73 | snippet ?th "?then(true, false)" 74 | ?then(${1:true}, ${0:false${VISUAL}}) 75 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/gitcommit.snippets: -------------------------------------------------------------------------------- 1 | snippet co 2 | Co-authored-by: ${1} <${2}> 3 | -------------------------------------------------------------------------------- /bin/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:condition} 30 | ${2:${VISUAL}} 31 | - else 32 | ${0} 33 | snippet ifp 34 | - if ${1:condition}.presence? 35 | ${0:${VISUAL}} 36 | snippet ntc 37 | = number_to_currency(${1}) 38 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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:condition} %} 28 | ${0} 29 | {% end %} 30 | snippet eif 31 | {% elif ${0:condition} %} 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:condition} %} 54 | ${0} 55 | {% end %} 56 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/javascript-mocha.snippets: -------------------------------------------------------------------------------- 1 | snippet des "describe('thing', () => { ... })" b 2 | describe('${1:}', () => { 3 | ${0:${VISUAL}} 4 | }); 5 | snippet it "it('should do', () => { ... })" b 6 | it('${1:}', () => { 7 | ${0:${VISUAL}} 8 | }); 9 | snippet xit "xit('should do', () => { ... })" b 10 | xit('${1:}', () => { 11 | ${0:${VISUAL}} 12 | }); 13 | snippet bef "before(() => { ... })" b 14 | before(() => { 15 | ${0:${VISUAL}} 16 | }); 17 | snippet befe "beforeEach(() => { ... })" b 18 | beforeEach(() => { 19 | ${0:${VISUAL}} 20 | }); 21 | snippet aft "after(() => { ... })" b 22 | after(() => { 23 | ${0:${VISUAL}} 24 | }); 25 | snippet afte "afterEach(() => { ... })" b 26 | afterEach(() => { 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 | -------------------------------------------------------------------------------- /bin/snippets/javascript/javascript-react.snippets: -------------------------------------------------------------------------------- 1 | # Import 2 | snippet ir import React 3 | import React from 'react'; 4 | 5 | snippet irc import React and Component 6 | import React, { Component } from 'react'; 7 | 8 | snippet irh import React hooks 9 | import { use$1 } from 'react'; 10 | 11 | snippet ird import ReactDOM 12 | import ReactDOM from 'react-dom'; 13 | 14 | snippet irp import PropTypes 15 | import PropTypes from 'prop-types'; 16 | 17 | # Lifecycle Methods 18 | snippet cdm componentDidMount 19 | componentDidMount() { 20 | ${1} 21 | }; 22 | 23 | snippet cdup componentDidUpdate 24 | componentDidUpdate(prevProps, prevState) { 25 | ${1} 26 | }; 27 | 28 | snippet cwm componentWillMount 29 | componentWillMount() { 30 | ${1} 31 | }; 32 | 33 | snippet cwr componentWillReceiveProps 34 | componentWillReceiveProps(nextProps) { 35 | ${1} 36 | }; 37 | 38 | snippet cwun componentWillUnmount 39 | componentWillUnmount() { 40 | ${1} 41 | }; 42 | 43 | snippet cwu componentWillUpdate 44 | componentWillUpdate(nextProps, nextState) { 45 | ${1} 46 | }; 47 | 48 | snippet scu shouldComponentUpdate 49 | shouldComponentUpdate(nextProps, nextState) { 50 | ${1} 51 | } 52 | 53 | # Props 54 | snippet spt static propTypes 55 | static propTypes = { 56 | ${1}: PropTypes.${2} 57 | }; 58 | 59 | snippet pt propTypes 60 | ${1}.propTypes = { 61 | ${2}: PropTypes.${2} 62 | }; 63 | 64 | snippet sdp static defaultProps 65 | static defaultProps = { 66 | ${1}: ${2} 67 | }; 68 | 69 | snippet dp defaultProps 70 | ${1}.defaultProps = { 71 | ${2}: ${3} 72 | }; 73 | 74 | snippet pp props 75 | props.${1}; 76 | 77 | snippet tp this props 78 | this.props.${1}; 79 | 80 | # State 81 | snippet st 82 | state = { 83 | ${1}: ${2}, 84 | }; 85 | 86 | snippet sst 87 | this.setState({ 88 | ${1}: ${2} 89 | }); 90 | 91 | snippet tst 92 | this.state.${1}; 93 | 94 | # Component 95 | snippet raf 96 | const ${1:ComponentName} = (${2:props}) => { 97 | ${3:state} 98 | 99 | return ( 100 | <> 101 | ${4} 102 | 103 | ); 104 | }; 105 | 106 | snippet rcla 107 | class ${1:ClassName} extends Component { 108 | render() { 109 | return ( 110 | <> 111 | ${2} 112 | 113 | ); 114 | } 115 | } 116 | 117 | snippet ercla 118 | export default class ${1:ClassName} extends Component { 119 | render() { 120 | return ( 121 | <> 122 | ${2} 123 | 124 | ); 125 | }; 126 | }; 127 | 128 | snippet ctor 129 | constructor() { 130 | super(); 131 | 132 | ${1:state} 133 | } 134 | 135 | snippet ren 136 | render() { 137 | return ( 138 | <> 139 | ${2} 140 | 141 | ); 142 | } 143 | 144 | snippet fup 145 | forceUpdate(${1:callback}); 146 | 147 | # Hooks 148 | snippet uses useState 149 | const [${1:state}, set${2}] = useState(${3:initialState}); 150 | 151 | snippet usee useEffect 152 | useEffect(() => { 153 | ${1} 154 | }); 155 | 156 | snippet userd useReducer 157 | const [${1:state}, ${2:dispatch}] = useReducer(${3:reducer}); 158 | 159 | snippet userf useRef 160 | const ${1:refContainer} = useRef(${2:initialValue}); 161 | 162 | snippet usect useContext 163 | const ${1:value} = useContext(${2:MyContext}); 164 | 165 | snippet usecb useCallback 166 | const ${1:memoizedCallback} = useCallback( 167 | () => { 168 | ${2}(${3}) 169 | }, 170 | [$3] 171 | ); 172 | 173 | snippet usem useMemo 174 | const ${1:memoizedCallback} = useMemo(() => ${2}(${3}), [$3]); 175 | 176 | snippet usei useImperativeHandle 177 | useImperativeHandle(${1:ref}, ${2:createHandle}); 178 | 179 | snippet used useDebugValue 180 | useDebugValue(${1:value}); 181 | 182 | # ReactDOM methods 183 | snippet rdr ReactDOM.render 184 | ReactDOM.render(${1}, ${2}); 185 | 186 | snippet rdh ReactDOM.hydrate 187 | ReactDOM.hydrate(${1:element}, ${2:container}[, ${3:callback}]); 188 | 189 | snippet rdcp ReactDOM.createPortal 190 | ReactDOM.createPortal(${1:child}, ${2:container}); 191 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 ret 10 | return ${0} 11 | snippet whe 12 | when (${1:${VISUAL}}) { 13 | ${2} -> ${3} 14 | } 15 | snippet cla 16 | class ${1} { 17 | ${0:${VISUAL}} 18 | } 19 | snippet cobj 20 | companion object { 21 | ${0:${VISUAL}} 22 | } 23 | snippet obj 24 | object ${1} { 25 | ${0:${VISUAL}} 26 | } 27 | snippet if 28 | if (${1}) { 29 | ${0:${VISUAL}} 30 | } 31 | snippet ife 32 | if (${1}) { 33 | ${2:${VISUAL}} 34 | } else { 35 | ${0} 36 | } 37 | -------------------------------------------------------------------------------- /bin/snippets/ledger.snippets: -------------------------------------------------------------------------------- 1 | # Ledger 2 | snippet ent 3 | `strftime("%Y/%m/%d")` ${1:transaction} 4 | ${2:account} ${3:value} 5 | ${0:account} 6 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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:condition} 58 | ${2} 59 | # If __ Else 60 | snippet ife 61 | if ${1:condition} 62 | ${2} 63 | else 64 | ${3} 65 | # Else if 66 | snippet elif 67 | else if ${1:condition} 68 | ${2} 69 | # Ternary If 70 | snippet ifte 71 | if ${1:condition} then ${2:value} else ${3:other} 72 | # Unless 73 | snippet unl 74 | ${1:action} unless ${2:condition} 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 | -------------------------------------------------------------------------------- /bin/snippets/lua.snippets: -------------------------------------------------------------------------------- 1 | snippet #! 2 | #!/usr/bin/env lua 3 | $1 4 | snippet _skel 5 | #!/usr/bin/env lua 6 | -- Filename: ${TM_FILENAME} 7 | -- Last Change: ${CURRENT_DAY_NAME_SHORT}, ${CURRENT_DATE} ${CURRENT_MONTH_NAME_SHORT} ${CURRENT_YEAR} - ${CURRENT_HOUR}:${CURRENT_MINUTE} 8 | $1 9 | snippet lc "Insert last change" 10 | -- Filename: ${TM_FILENAME} 11 | -- Last Change: ${CURRENT_DAY_NAME_SHORT}, ${CURRENT_DATE} ${CURRENT_MONTH_NAME_SHORT} ${CURRENT_YEAR} - ${CURRENT_HOUR}:${CURRENT_MINUTE} 12 | snippet local 13 | local ${1:x} = ${0:1} 14 | snippet fun 15 | function ${1:fname}(${2:...}) 16 | ${0:-- body} 17 | end 18 | snippet for 19 | for ${1:i}=${2:1},${3:10} do 20 | ${0:print(i)} 21 | end 22 | snippet forp 23 | for ${1:i},${2:v} in pairs(${3:table_name}) do 24 | ${0:-- body} 25 | end 26 | snippet fori 27 | for ${1:i},${2:v} in ipairs(${3:table_name}) do 28 | ${0:-- body} 29 | end 30 | snippet if 31 | if ${1:condition} then 32 | ${2:-- body} 33 | end 34 | snippet ife 35 | if ${1:condition} then 36 | ${2:-- if condition} 37 | else 38 | ${0:-- else} 39 | end 40 | snippet elif 41 | elseif ${1:condition} then 42 | ${0:--body} 43 | snippet repeat 44 | repeat 45 | ${1:--body} 46 | until ${0:condition} 47 | snippet while 48 | while ${1:condition} do 49 | ${0:--body} 50 | end 51 | snippet print 52 | print("${1:string}") 53 | snippet im 54 | import "${1:import file}" 55 | -------------------------------------------------------------------------------- /bin/snippets/lua_snip/all.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") --{{{ 2 | local s = ls.s 3 | local i = ls.i 4 | local t = ls.t 5 | 6 | local d = ls.dynamic_node 7 | local c = ls.choice_node 8 | local f = ls.function_node 9 | local sn = ls.snippet_node 10 | 11 | local fmt = require("luasnip.extras.fmt").fmt 12 | local rep = require("luasnip.extras").rep 13 | 14 | local snippets, autosnippets = {}, {} --}}} 15 | 16 | local group = vim.api.nvim_create_augroup("Javascript Snippets", { clear = true }) 17 | local file_pattern = "*.js" 18 | 19 | local function cs(trigger, nodes, opts) --{{{ 20 | local snippet = s(trigger, nodes) 21 | local target_table = snippets 22 | 23 | local pattern = file_pattern 24 | local keymaps = {} 25 | 26 | if opts ~= nil then 27 | -- check for custom pattern 28 | if opts.pattern then 29 | pattern = opts.pattern 30 | end 31 | 32 | -- if opts is a string 33 | if type(opts) == "string" then 34 | if opts == "auto" then 35 | target_table = autosnippets 36 | else 37 | table.insert(keymaps, { "i", opts }) 38 | end 39 | end 40 | 41 | -- if opts is a table 42 | if opts ~= nil and type(opts) == "table" then 43 | for _, keymap in ipairs(opts) do 44 | if type(keymap) == "string" then 45 | table.insert(keymaps, { "i", keymap }) 46 | else 47 | table.insert(keymaps, keymap) 48 | end 49 | end 50 | end 51 | 52 | -- set autocmd for each keymap 53 | if opts ~= "auto" then 54 | for _, keymap in ipairs(keymaps) do 55 | vim.api.nvim_create_autocmd("BufEnter", { 56 | pattern = pattern, 57 | group = group, 58 | callback = function() 59 | vim.keymap.set(keymap[1], keymap[2], function() 60 | ls.snip_expand(snippet) 61 | end, { noremap = true, silent = true, buffer = true }) 62 | end, 63 | }) 64 | end 65 | end 66 | end 67 | 68 | table.insert(target_table, snippet) -- insert snippet into appropriate table 69 | end --}}} 70 | 71 | -- Begin Refactoring -- 72 | cs( "todo", 73 | fmt([=[{}: {}]=],{ 74 | c(1, { 75 | t("TODO"), 76 | t("FIXME"), 77 | t("NOTE"), 78 | t("BUG"), 79 | t("HACK"), 80 | t("REVIEW"), 81 | t("CHANGED"), 82 | t("XXX"), 83 | t("IDEA"), 84 | t("TEMP"), 85 | t("OPTIMIZE"), 86 | t("WARNING"), 87 | t("INFO"), 88 | t("QUESTION"), 89 | t("PERFORMANCE"), 90 | t("REFACTOR")}), 91 | 92 | i(2, "Description") 93 | })) 94 | 95 | 96 | -- End Refactoring -- 97 | 98 | return snippets, autosnippets -------------------------------------------------------------------------------- /bin/snippets/lua_snip/markdown.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.s 3 | local i = ls.i 4 | local t = ls.t 5 | 6 | local d = ls.dynamic_node 7 | local c = ls.choice_node 8 | local f = ls.function_node 9 | local sn = ls.snippet_node 10 | 11 | local fmt = require("luasnip.extras.fmt").fmt 12 | local rep = require("luasnip.extras").rep 13 | 14 | -- -- 15 | 16 | local snippets = {} 17 | local autosnippets = {} 18 | 19 | local autocmd = vim.api.nvim_create_autocmd 20 | local augroup = vim.api.nvim_create_augroup 21 | local map = vim.keymap.set 22 | local opts = { noremap = true, silent = true, buffer = true } 23 | local group = augroup("Markdown Snippets", { clear = true }) 24 | 25 | local function cs(trigger, nodes, keymap) --> cs stands for create snippet 26 | local snippet = s(trigger, nodes) 27 | table.insert(snippets, snippet) 28 | 29 | if keymap ~= nil then 30 | local pattern = "*.md" 31 | if type(keymap) == "table" then 32 | pattern = keymap[1] 33 | keymap = keymap[2] 34 | end 35 | autocmd("BufEnter", { 36 | pattern = pattern, 37 | group = group, 38 | callback = function() 39 | map({ "i" }, keymap, function() 40 | ls.snip_expand(snippet) 41 | end, opts) 42 | end, 43 | }) 44 | end 45 | end 46 | 47 | local function lp(package_name) -- Load Package Function 48 | package.loaded[package_name] = nil 49 | return require(package_name) 50 | end 51 | 52 | -- Utility Functions -- 53 | 54 | -- Start Refactoring -- 55 | 56 | -- Start Refactoring -- 57 | 58 | return snippets, autosnippets -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/mako.snippets: -------------------------------------------------------------------------------- 1 | snippet def 2 | <%def name="${1:name}"> 3 | ${0:} 4 | 5 | snippet call 6 | <%call expr="${1:name}"> 7 | ${0:} 8 | 9 | snippet doc 10 | <%doc> 11 | ${0:} 12 | 13 | snippet text 14 | <%text> 15 | ${0:} 16 | 17 | snippet for 18 | % for ${1:i} in ${2:iter}: 19 | ${0:} 20 | % endfor 21 | snippet if if 22 | % if ${1:condition}: 23 | ${0:} 24 | % endif 25 | snippet ife if/else 26 | % if ${1:condition}: 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 | -------------------------------------------------------------------------------- /bin/snippets/markdown.snippets: -------------------------------------------------------------------------------- 1 | # Markdown 2 | 3 | # Includes octopress (http://octopress.org/) snippets 4 | 5 | # The suffix `c` stands for "Clipboard". 6 | 7 | snippet lc "Insert last change" 8 | ```txt 9 | Filename: ${TM_FILENAME} 10 | Last Change: ${CURRENT_DAY_NAME_SHORT}, ${CURRENT_DATE} ${CURRENT_MONTH_NAME_SHORT} ${CURRENT_YEAR} - ${CURRENT_HOUR}:${CURRENT_MINUTE} 11 | ``` 12 | $0 13 | snippet [ 14 | [${1:text}](https://${2:address}) 15 | snippet [* 16 | [${1:link}](${2:`@*`}) 17 | snippet [c 18 | [${1:link}](${2:`@+`}) 19 | snippet [" 20 | [${1:text}](https://${2:address} "${3:title}") 21 | snippet ["* 22 | [${1:link}](${2:`@*`} "${3:title}") 23 | snippet ["c 24 | [${1:link}](${2:`@+`} "${3:title}") 25 | snippet [: 26 | [${1:id}]: https://${2:url} 27 | 28 | snippet [:* 29 | [${1:id}]: ${2:`@*`} 30 | 31 | snippet [:c 32 | [${1:id}]: ${2:`@+`} 33 | 34 | snippet [:" 35 | [${1:id}]: https://${2:url} "${3:title}" 36 | 37 | snippet [:"* 38 | [${1:id}]: ${2:`@*`} "${3:title}" 39 | 40 | snippet [:"c 41 | [${1:id}]: ${2:`@+`} "${3:title}" 42 | 43 | snippet ![ 44 | ![${1:alttext}](${2:/images/image.jpg}) 45 | snippet ![* 46 | ![${1:alt}](${2:`@*`}) 47 | snippet ![c 48 | ![${1:alt}](${2:`@+`}) 49 | snippet ![" 50 | ![${1:alttext}](${2:/images/image.jpg} "${3:title}") 51 | snippet !["* 52 | ![${1:alt}](${2:`@*`} "${3:title}") 53 | snippet !["c 54 | ![${1:alt}](${2:`@+`} "${3:title}") 55 | snippet ![: 56 | ![${1:id}]: ${2:url} 57 | 58 | snippet ![:* 59 | ![${1:id}]: ${2:`@*`} 60 | 61 | snippet ![:" 62 | ![${1:id}]: ${2:url} "${3:title}" 63 | 64 | snippet ![:"* 65 | ![${1:id}]: ${2:`@*`} "${3:title}" 66 | 67 | snippet ![:"c 68 | ![${1:id}]: ${2:`@+`} "${3:title}" 69 | 70 | snippet < 71 | 72 | snippet <* 73 | <`@*`> 74 | snippet 76 | snippet ** 77 | **${1:bold}** 78 | snippet __ 79 | __${1:bold}__ 80 | snippet === 81 | `repeat('=', strlen(getline(line('.') - 3)))` 82 | 83 | ${0} 84 | snippet - 85 | - ${0} 86 | snippet --- 87 | `repeat('-', strlen(getline(line('.') - 3)))` 88 | 89 | ${0} 90 | snippet blockquote 91 | {% blockquote %} 92 | ${0:quote} 93 | {% endblockquote %} 94 | 95 | snippet blockquote-author 96 | {% blockquote ${1:author}, ${2:title} %} 97 | ${0:quote} 98 | {% endblockquote %} 99 | 100 | snippet blockquote-link 101 | {% blockquote ${1:author} ${2:URL} ${3:link_text} %} 102 | ${0:quote} 103 | {% endblockquote %} 104 | 105 | snippet ``` 106 | \`\`\`${1} 107 | ${0:${VISUAL}} 108 | \`\`\` 109 | 110 | # Language. 111 | snippet ```l 112 | \`\`\`${1:language} 113 | ${2:code} 114 | \`\`\` 115 | 116 | snippet codeblock-short 117 | {% codeblock %} 118 | ${0:code_snippet} 119 | {% endcodeblock %} 120 | 121 | snippet codeblock-full 122 | {% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %} 123 | ${0:code_snippet} 124 | {% endcodeblock %} 125 | 126 | snippet gist-full 127 | {% gist ${1:gist_id} ${0:filename} %} 128 | 129 | snippet gist-short 130 | {% gist ${0:gist_id} %} 131 | 132 | snippet img 133 | {% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${0:alt_text} %} 134 | 135 | snippet youtube 136 | {% youtube ${0:video_id} %} 137 | 138 | snippet tb 139 | | ${0:factors} | ${1:a} | ${2:b} | 140 | | ------------- |------------- | ------- | 141 | | ${3:f1} | Y | N | 142 | | ${4:f2} | Y | N | 143 | 144 | # The quote should appear only once in the text. It is inherently part of it. 145 | # See http://octopress.org/docs/plugins/pullquote/ for more info. 146 | 147 | snippet pullquote 148 | {% pullquote %} 149 | ${1:text} {" ${2:quote} "} ${0:text} 150 | {% endpullquote %} 151 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/octave.snippets: -------------------------------------------------------------------------------- 1 | extends matlab 2 | 3 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/pandoc.snippets: -------------------------------------------------------------------------------- 1 | extends markdown 2 | 3 | -------------------------------------------------------------------------------- /bin/snippets/perl6.snippets: -------------------------------------------------------------------------------- 1 | # shebang 2 | snippet #! 3 | #!/usr/bin/env perl6 4 | 5 | # Hash Pointer 6 | snippet . 7 | => 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:expression} if ${2:condition}; 37 | # Unless conditional 38 | snippet unless 39 | unless ${1} { 40 | ${2} 41 | } 42 | # Unless conditional One-line 43 | snippet xunless 44 | ${1:expression} unless ${2:condition}; 45 | # Ternary conditional 46 | snippet tc 47 | ${1:condition} ?? ${2:value-if-true} !! ${3:value-if-false}; 48 | # given - when (perl6 switch) 49 | snippet switch 50 | given ${1:$var} { 51 | when ${2:condition} { 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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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:-- body} 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:-- body} 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:-- body}; 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 | -------------------------------------------------------------------------------- /bin/snippets/po.snippets: -------------------------------------------------------------------------------- 1 | snippet msg 2 | msgid "${1}" 3 | msgstr "${2}" 4 | 5 | ${0} 6 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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:condition}) { 47 | ${2:statement} 48 | } 49 | 50 | # PowerShell if..else 51 | snippet ife 52 | if ( ${1:condition} ) { 53 | ${2} 54 | } 55 | else { 56 | ${3} 57 | } 58 | 59 | # PowerShell While Loop 60 | snippet while 61 | while (${1:condition}) { 62 | ${2:statement} 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 | ${3:statement} 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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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:condition}) { 15 | ${0} 16 | } 17 | snippet el 18 | else { 19 | ${0} 20 | } 21 | snippet ei 22 | else if (${1:condition}) { 23 | ${0} 24 | } 25 | 26 | # loops 27 | snippet wh 28 | while(${1}) { 29 | ${2} 30 | } 31 | snippet for 32 | for (${1:item} in ${2:list}) { 33 | ${3} 34 | } 35 | snippet foreach 36 | foreach (${1:item} = ${2:list}) { 37 | ${3} 38 | } 39 | 40 | # functions 41 | snippet fun 42 | ${1:name} <- function (${2:variables}) { 43 | ${0} 44 | } 45 | snippet ret 46 | return(${0}) 47 | 48 | # dataframes, lists, etc 49 | snippet df 50 | ${1:name}[${2:rows}, ${0:cols}] 51 | snippet c 52 | c(${0:items}) 53 | snippet li 54 | list(${0:items}) 55 | snippet mat 56 | matrix(${1:data}, nrow = ${2:rows}, ncol = ${0:cols}) 57 | 58 | # apply functions 59 | snippet apply 60 | apply(${1:array}, ${2:margin}, ${0:function}) 61 | snippet lapply 62 | lapply(${1:list}, ${0:function}) 63 | snippet sapply 64 | lapply(${1:list}, ${0:function}) 65 | snippet vapply 66 | vapply(${1:list}, ${2:function}, ${0:type}) 67 | snippet mapply 68 | mapply(${1:function}, ${0:...}) 69 | snippet tapply 70 | tapply(${1:vector}, ${2:index}, ${0:function}) 71 | snippet rapply 72 | rapply(${1:list}, ${0:function}) 73 | 74 | # plyr functions 75 | snippet dd 76 | ddply(${1:frame}, ${2:variables}, ${0:function}) 77 | snippet dl 78 | dlply(${1:frame}, ${2:variables}, ${0:function}) 79 | snippet da 80 | daply(${1:frame}, ${2:variables}, ${0:function}) 81 | snippet d_ 82 | d_ply(${1:frame}, ${2:variables}, ${0:function}) 83 | 84 | snippet ad 85 | adply(${1:array}, ${2:margin}, ${0:function}) 86 | snippet al 87 | alply(${1:array}, ${2:margin}, ${0:function}) 88 | snippet aa 89 | aaply(${1:array}, ${2:margin}, ${0:function}) 90 | snippet a_ 91 | a_ply(${1:array}, ${2:margin}, ${0:function}) 92 | 93 | snippet ld 94 | ldply(${1:list}, ${0:function}) 95 | snippet ll 96 | llply(${1:list}, ${0:function}) 97 | snippet la 98 | laply(${1:list}, ${0:function}) 99 | snippet l_ 100 | l_ply(${1:list}, ${0:function}) 101 | 102 | snippet md 103 | mdply(${1:matrix}, ${0:function}) 104 | snippet ml 105 | mlply(${1:matrix}, ${0:function}) 106 | snippet ma 107 | maply(${1:matrix}, ${0:function}) 108 | snippet m_ 109 | m_ply(${1:matrix}, ${0:function}) 110 | 111 | # plot functions 112 | snippet pl 113 | plot(${1:x}, ${0:y}) 114 | snippet ggp 115 | ggplot(${1:data}, aes(${0:aesthetics})) 116 | snippet img 117 | ${1:(jpeg,bmp,png,tiff)}(filename = '${2:filename}', width = ${3}, height = ${4}, unit = '${5}') 118 | ${0:plot} 119 | dev.off() 120 | 121 | # statistical test functions 122 | snippet fis 123 | fisher.test(${1:x}, ${0:y}) 124 | snippet chi 125 | chisq.test(${1:x}, ${0:y}) 126 | snippet tt 127 | t.test(${1:x}, ${0:y}) 128 | snippet wil 129 | wilcox.test(${1:x}, ${0:y}) 130 | snippet cor 131 | cor.test(${1:x}, ${0:y}) 132 | snippet fte 133 | var.test(${1:x}, ${0:y}) 134 | snippet kvt 135 | kv.test(${1:x}, ${0:y}) 136 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/rst.snippets: -------------------------------------------------------------------------------- 1 | # rst 2 | 3 | snippet : 4 | :${1:field name}: ${0:field body} 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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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:condition} { 21 | ${0} 22 | } 23 | snippet ife 24 | @if ${1:condition} { 25 | ${2} 26 | } @else { 27 | ${0} 28 | } 29 | snippet eif 30 | @else if ${1:condition} { 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 | -------------------------------------------------------------------------------- /bin/snippets/sh.snippets: -------------------------------------------------------------------------------- 1 | # Shebang. Executing bash via /usr/bin/env makes scripts more portable. 2 | snippet #! 3 | #!/usr/bin/env sh 4 | 5 | snippet here 6 | cat <<-EOF 7 | ${1:Type your text here} 8 | EOF 9 | ${0} 10 | 11 | snippet s#! 12 | #!/usr/bin/env sh 13 | set -eu 14 | 15 | # date YY-MM-DD 16 | snippet cdate 17 | "${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}" 18 | 19 | snippet _skel 20 | #!/usr/bin/env bash 21 | # Filename: ${TM_FILENAME} 22 | # Last Change: ${CURRENT_DAY_NAME_SHORT}, ${CURRENT_DATE} ${CURRENT_MONTH_NAME_SHORT} ${CURRENT_YEAR} - ${CURRENT_HOUR}:${CURRENT_MINUTE} 23 | # Autor: ${1:Sérgio Araújo} 24 | # site: ${2:https://dev/to/voyeg3r} 25 | # Licence: GPL (see http://www.gnu.org/licenses/gpl.txt) 26 | 27 | snippet safe 28 | set -eu 29 | 30 | snippet bash 31 | #!/usr/bin/env bash 32 | 33 | snippet sbash 34 | #!/usr/bin/env bash 35 | set -euo pipefail 36 | IFS=$'\n\t' 37 | 38 | snippet if 39 | if [[ ${1:condition} ]]; then 40 | ${0:${VISUAL}} 41 | fi 42 | snippet elif 43 | elif [[ ${1:condition} ]]; then 44 | ${0:${VISUAL}} 45 | snippet for 46 | for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do 47 | ${0:${VISUAL}} 48 | done 49 | snippet fori 50 | for ${1:needle} in ${2:haystack} ; do 51 | ${0:${VISUAL}} 52 | done 53 | snippet wh 54 | while [[ ${1:condition} ]]; do 55 | ${0:${VISUAL}} 56 | done 57 | snippet until 58 | until [[ ${1:condition} ]]; do 59 | ${0:${VISUAL}} 60 | done 61 | snippet case 62 | case ${1:word} in 63 | ${2:pattern}) 64 | ${0};; 65 | esac 66 | snippet go 67 | while getopts '${1:o}' ${2:opts} 68 | do 69 | case $$2 in 70 | ${3:o0}) 71 | ${0:#staments};; 72 | esac 73 | done 74 | 75 | # Set SCRIPT_DIR variable to directory script is located. 76 | snippet sdir 77 | SCRIPT_DIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" && pwd )" 78 | 79 | # getopt 80 | snippet getopt 81 | __ScriptVersion="${1:version}" 82 | 83 | #=== FUNCTION ================================================================ 84 | # NAME: usage 85 | # DESCRIPTION: Display usage information. 86 | #=============================================================================== 87 | function usage () 88 | { 89 | echo "Usage : $${0:0} [options] [--] 90 | 91 | Options: 92 | -h|help Display this message 93 | -v|version Display script version" 94 | 95 | } # ---------- end of function usage ---------- 96 | 97 | #----------------------------------------------------------------------- 98 | # Handle command line arguments 99 | #----------------------------------------------------------------------- 100 | 101 | while getopts ":hv" opt 102 | do 103 | case $opt in 104 | 105 | h|help ) usage; exit 0 ;; 106 | 107 | v|version ) echo "$${0:0} -- Version $__ScriptVersion"; exit 0 ;; 108 | 109 | * ) echo -e "\n Option does not exist : $OPTARG\n" 110 | usage; exit 1 ;; 111 | 112 | esac # --- end of case --- 113 | done 114 | shift $(($OPTIND-1)) 115 | snippet root 116 | if [ \$(id -u) -ne 0 ]; then exec sudo \$0; fi 117 | 118 | snippet fun-sh 119 | ${1:function_name}() { 120 | ${0:#function_body} 121 | } 122 | 123 | snippet fun 124 | function ${1:function_name}() { 125 | ${0:#function_body} 126 | } 127 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/svelte.snippets: -------------------------------------------------------------------------------- 1 | extends html, javascript, css 2 | -------------------------------------------------------------------------------- /bin/snippets/systemverilog.snippets: -------------------------------------------------------------------------------- 1 | extends verilog 2 | 3 | # Foreach Loop 4 | snippet forea 5 | foreach (${1}) begin 6 | ${0} 7 | end 8 | # Do-while statement 9 | snippet dowh 10 | do begin 11 | ${0} 12 | end while (${1}); 13 | # Combinational always block 14 | snippet alc 15 | always_comb begin ${1:: statement_label} 16 | ${0} 17 | end $1 18 | # Sequential logic 19 | snippet alff 20 | always_ff @(posedge ${1:clk}) begin ${2:: statement_label} 21 | ${0} 22 | end $2 23 | # Latched logic 24 | snippet all 25 | always_latch begin ${1:: statement_label} 26 | ${0} 27 | end $1 28 | # Class 29 | snippet cl 30 | class ${1:class_name}; 31 | // data or class properties 32 | ${0} 33 | 34 | // initialization 35 | function new(); 36 | endfunction : new 37 | 38 | endclass : $1 39 | # Typedef structure 40 | snippet types 41 | typedef struct { 42 | ${0} 43 | } ${1:name_t}; 44 | # Program block 45 | snippet prog 46 | program ${1:program_name} (); 47 | ${0} 48 | endprogram : $1 49 | # Interface block 50 | snippet intf 51 | interface ${1:program_name} (); 52 | // nets 53 | ${0} 54 | // clocking 55 | 56 | // modports 57 | 58 | endinterface : $1 59 | # Clocking Block 60 | snippet clock 61 | clocking ${1:clocking_name} @(${2:posedge} ${3:clk}); 62 | ${0} 63 | endclocking : $1 64 | # Covergroup construct 65 | snippet cg 66 | covergroup ${1:group_name} @(${2:posedge} ${3:clk}); 67 | ${0} 68 | endgroup : $1 69 | # Package declaration 70 | snippet pkg 71 | package ${1:package_name}; 72 | ${0} 73 | endpackage : $1 74 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/txt.snippets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityastomar67/NvStar/8a03d93daeea620206a8cc8a9dc11f47fbca6022/bin/snippets/txt.snippets -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/typescriptreact.snippets: -------------------------------------------------------------------------------- 1 | extends typescript 2 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/vue.snippets: -------------------------------------------------------------------------------- 1 | # This snippet file enables vue files to use tabs for html, js and css. It also 2 | # includes some vue-specific html-like snippets, as well as some general 3 | # boilerplate code for vue. 4 | 5 | extends html, javascript, css 6 | 7 | # These snippets form a port of Sarah Drasner's vue-sublime-snippets 8 | 9 | # some html-like snippets 10 | 11 | snippet slot 12 | 13 | 14 | snippet template 15 | 16 | 17 | snippet transition 18 | 19 | 20 | # The following snippets create more complex boilerplate code. 21 | 22 | snippet vbase 23 | 28 | 29 | 34 | 35 | 38 | 39 | snippet vimport:c 40 | import ${1:Name} from './components/$1.vue'; 41 | 42 | export default { 43 | components: { 44 | $1 45 | } 46 | } 47 | 48 | snippet vactions 49 | actions: { 50 | ${1:updateValue}({commit}, ${2:payload}) { 51 | commit($1, $2); 52 | } 53 | } 54 | 55 | # Add in js animation hooks 56 | snippet vanim:js:el 57 | 68 | 69 | 70 | 71 | snippet vanim:js:method 72 | methods: { 73 | beforeEnter(el) { 74 | console.log('beforeEnter'); 75 | }, 76 | enter(el, done) { 77 | console.log('enter'); 78 | done(); 79 | }, 80 | afterEnter(el) { 81 | console.log('afterEnter'); 82 | }, 83 | enterCancelled(el, done) { 84 | console.log('enterCancelled'); 85 | }, 86 | beforeLeave(el) { 87 | console.log('beforeLeave'); 88 | }, 89 | leave(el, done) { 90 | console.log('leave'); 91 | done(); 92 | }, 93 | afterLeave(el) { 94 | console.log('afterLeave'); 95 | }, 96 | leaveCancelled(el, done) { 97 | console.log('leaveCancelled'); 98 | } 99 | } 100 | 101 | snippet vcl 102 | @click="${1}" 103 | 104 | snippet vdata 105 | data() { 106 | return { 107 | ${1:key}: ${2:value} 108 | }; 109 | } 110 | 111 | snippet vfilter 112 | filters: { 113 | ${1:fnName}: function(${2:value}) { 114 | return; 115 | } 116 | } 117 | 118 | snippet vfor 119 |
120 | {{ $1 }} 121 |
122 | 123 | snippet vgetters 124 | getters: { 125 | ${1:value}: state => { 126 | return state.$1; 127 | } 128 | } 129 | 130 | snippet vimport 131 | import ${1:New} from './components/$1.vue'; 132 | 133 | snippet vkeep 134 | 135 | 136 |

default

137 |
138 |
139 | 140 | snippet vmixin 141 | const ${1:mixinName} = { 142 | mounted() { 143 | console.log('hello from mixin!') 144 | }, 145 | } 146 | const ${2:Component} = Vue.extend({ 147 | mixins: [$1] 148 | }) 149 | 150 | snippet vmutations 151 | mutations: { 152 | ${1:updateValue}(state, ${3:payload}) => { 153 | state.${2:value} = $3; 154 | } 155 | } 156 | 157 | snippet vprops:d 158 | ${1:propName}: { 159 | type: ${2:Number}, 160 | default: ${0} 161 | }, 162 | 163 | snippet vprops 164 | ${1:propName}: { 165 | type: ${2:Number} 166 | }, 167 | 168 | snippet vstore 169 | import Vue from 'vue'; 170 | import Vuex from 'vuex'; 171 | 172 | Vue.use(Vuex); 173 | 174 | export const store = new Vuex.Store({ 175 | state: { 176 | ${1:key}: ${2:value} 177 | } 178 | }); 179 | 180 | 181 | # vue-i18n snippets https://github.com/kazupon/vue-i18n 182 | 183 | snippet trans 184 | $t('$1') 185 | 186 | # Translation with parameter 187 | snippet transc 188 | $t('$1', { $2: $3 }) 189 | 190 | -------------------------------------------------------------------------------- /bin/snippets/xml.snippets: -------------------------------------------------------------------------------- 1 | # xml declaration 2 | snippet xml 3 | 4 | # tag 5 | snippet t 6 | <${1:}> 7 | ${2} 8 | 9 | # inline tag 10 | snippet ti 11 | <${1:}>${2} 12 | 13 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/snippets/zsh.snippets: -------------------------------------------------------------------------------- 1 | # shell bang 2 | snippet #! 3 | #!/bin/zsh 4 | 5 | snippet _skel 6 | #!/usr/bin/env zsh 7 | # Filename: ${TM_FILENAME} 8 | # Last Change: ${CURRENT_DAY_NAME_SHORT}, ${CURRENT_DATE} ${CURRENT_MONTH_NAME_SHORT} ${CURRENT_YEAR} - ${CURRENT_HOUR}:${CURRENT_MINUTE} 9 | # Autor: ${1:Sérgio Araújo} 10 | # site: ${2:https://dev/to/voyeg3r} 11 | # Licence: GPL (see http://www.gnu.org/licenses/gpl.txt) 12 | 13 | snippet if 14 | if ${1:condition}; then 15 | ${0:${VISUAL}} 16 | fi 17 | snippet ife 18 | if ${1:condition}; then 19 | ${2:${VISUAL}} 20 | else 21 | ${0:# statements} 22 | fi 23 | snippet eif 24 | elif ${1:condition}; then 25 | ${0:${VISUAL}} 26 | snippet for 27 | for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do 28 | ${0:${VISUAL}} 29 | done 30 | snippet fori 31 | for ${1:needle} in ${2:haystack}; do 32 | ${0:${VISUAL}} 33 | done 34 | snippet fore 35 | for ${1:item} in ${2:list}; do 36 | ${0:${VISUAL}} 37 | done 38 | snippet wh 39 | while ${1:condition}; do 40 | ${0:${VISUAL}} 41 | done 42 | snippet until 43 | until ${1:condition}; do 44 | ${0:${VISUAL}} 45 | done 46 | snippet repeat 47 | repeat ${1:integer}; do 48 | ${0:${VISUAL}} 49 | done 50 | snippet case 51 | case ${1:word} in 52 | ${2:pattern}) 53 | ${0};; 54 | esac 55 | snippet select 56 | select ${1:answer} in ${2:choices}; do 57 | ${0:${VISUAL}} 58 | done 59 | snippet ( 60 | ( ${0:#statements} ) 61 | snippet { 62 | { ${0:#statements} } 63 | snippet [ 64 | [[ ${0:test} ]] 65 | snippet always 66 | { ${1:try} } always { ${0:always} } 67 | snippet fun 68 | ${1:function_name}() { 69 | ${0:# function_body} 70 | } 71 | snippet ffun 72 | function ${1:function_name}() { 73 | ${0:# function_body} 74 | } 75 | -------------------------------------------------------------------------------- /colors/everforest.lua: -------------------------------------------------------------------------------- 1 | vim.g.colors_name = "everforest" 2 | 3 | require("core.colors").setup { 4 | base00 = "#2b3339", 5 | base01 = "#323c41", 6 | base02 = "#503946", 7 | base03 = "#868d80", 8 | base04 = "#d3c6aa", 9 | base05 = "#d3c6aa", 10 | base06 = "#e9e8d2", 11 | base07 = "#fff9e8", 12 | base08 = "#7fbbb3", 13 | base09 = "#d699b6", 14 | base0A = "#83c092", 15 | base0B = "#dbbc7f", 16 | base0C = "#e69875", 17 | base0D = "#a7c080", 18 | base0E = "#e67e80", 19 | base0F = "#d699b6", 20 | } -------------------------------------------------------------------------------- /colors/google-light.lua: -------------------------------------------------------------------------------- 1 | vim.g.colors_name = "google-light" 2 | 3 | require("core.colors").setup { 4 | base00 = "#ffffff", 5 | base01 = "#e0e0e0", 6 | base02 = "#c5c8c6", 7 | base03 = "#b4b7b4", 8 | base04 = "#969896", 9 | base05 = "#373b41", 10 | base06 = "#282a2e", 11 | base07 = "#1d1f21", 12 | base08 = "#cc342b", 13 | base09 = "#f96a38", 14 | base0A = "#fba922", 15 | base0B = "#198844", 16 | base0C = "#3971ed", 17 | base0D = "#3971ed", 18 | base0E = "#a36ac7", 19 | base0F = "#3971ed", 20 | } -------------------------------------------------------------------------------- /colors/monokai.lua: -------------------------------------------------------------------------------- 1 | vim.g.colors_name = "monokai" 2 | 3 | require("core.colors").setup { 4 | base00 = "#272822", 5 | base01 = "#383830", 6 | base02 = "#49483e", 7 | base03 = "#75715e", 8 | base04 = "#a59f85", 9 | base05 = "#f8f8f2", 10 | base06 = "#f5f4f1", 11 | base07 = "#f9f8f5", 12 | base08 = "#f92672", 13 | base09 = "#fd971f", 14 | base0A = "#f4bf75", 15 | base0B = "#a6e22e", 16 | base0C = "#a1efe4", 17 | base0D = "#66d9ef", 18 | base0E = "#ae81ff", 19 | base0F = "#cc6633", 20 | } -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | local impatient_ok, impatient = pcall(require, "impatient") 2 | if impatient_ok then 3 | impatient.enable_profile() 4 | end 5 | 6 | for _, source in ipairs({ 7 | 8 | -- CORE 9 | "core.plugins", 10 | "core.abbreviations", 11 | "core.maps", 12 | "core.options", 13 | "core.utils", 14 | "core.autocmds", 15 | "core.colorscheme", 16 | "plug", 17 | 18 | }) do 19 | local status_ok, fault = pcall(require, source) 20 | if not status_ok then 21 | local err = "Failed to load " .. source .. "\n\n" .. fault 22 | notify(err, "error", { title = "Require Error" }) 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lua/core/abbreviations.lua: -------------------------------------------------------------------------------- 1 | local cmd = vim.cmd 2 | 3 | cmd([[cnoreab cls Cls]]) 4 | cmd([[cnoreab Bo BufOnly]]) 5 | cmd([[cnoreab W w]]) 6 | cmd([[cnoreab W! w!]]) 7 | cmd([[cnoreab Bw Blockwise]]) 8 | cmd([[inoreab Fname =expand("%:p")]]) 9 | cmd([[inoreab Iname =expand("%:p")]]) 10 | cmd([[inoreab fname =expand("%:t")]]) 11 | cmd([[inoreab iname =expand("%:t")]]) 12 | cmd([[inoreabbrev idate =strftime("%b %d %Y %H:%M")]]) -------------------------------------------------------------------------------- /lua/core/colorscheme.lua: -------------------------------------------------------------------------------- 1 | local cmp_status_ok, kanagawa = pcall(require, "kanagawa") 2 | if not cmp_status_ok then 3 | return 4 | end 5 | 6 | local kanagawa_opts = { 7 | undercurl = true, -- undercurl is enabled by default 8 | specialReturn = true, -- special highlight for the return keyword 9 | specialKeyword = true, -- special highlight for the keyword "return" 10 | specialException = true, -- special highlight for exception handling keywords 11 | dimInactive = false, -- dim inactive window `:h hl-NormalNC` 12 | globalStatus = false, -- adjust window separators highlight for laststatus = 3 13 | commentStyle = { italic = true }, -- Italicize comments 14 | functionStyle = { italic = true }, -- Italicize functions 15 | keywordStyle = { italic = true }, -- Italic Keywords 16 | statementStyle = { bold = true }, -- Bold is the default for statements. 17 | typeStyle = { italic = true }, -- Italic is used for type names. 18 | variablebuiltinStyle = { italic = true }, -- Italic for builtin variables 19 | colors = {}, 20 | overrides = {}, 21 | } 22 | 23 | local colorscheme = require("core.user").colorscheme 24 | local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) 25 | if not status_ok then 26 | vim.notify("colorscheme " .. colorscheme .. " not found!") 27 | return 28 | end 29 | 30 | -- Data for limelight_conceal 31 | vim.cmd("let g:limelight_conceal_ctermfg = 'gray'") 32 | vim.cmd("let g:limelight_conceal_ctermfg = 240") 33 | vim.cmd("let g:limelight_conceal_guifg = 'DarkGray'") 34 | vim.cmd("let g:limelight_conceal_guifg = '#777777'") 35 | vim.cmd("let g:limelight_default_coefficient = 0.9") 36 | -------------------------------------------------------------------------------- /lua/core/constants.lua: -------------------------------------------------------------------------------- 1 | local runtime_path = vim.split(package.path, ';') 2 | table.insert(runtime_path, "lua/?.lua") 3 | table.insert(runtime_path, "lua/?/init.lua") 4 | 5 | local consts = { 6 | modes = { 7 | all = "", 8 | normal = "n", 9 | visual_select = "v", 10 | select = "s", 11 | visual = "x", 12 | operator_pending = "o", 13 | insert_command = "!", 14 | insert = "i", 15 | insert_command_lang_arg = "l", 16 | command_line = "c", 17 | terminal = "t" 18 | }, 19 | runtime_path = runtime_path 20 | } 21 | 22 | return consts -------------------------------------------------------------------------------- /lua/core/user.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.completion = 1 4 | M.transparency = 0 5 | M.diagnostic = true 6 | M.colorscheme = "wave" 7 | 8 | return M -------------------------------------------------------------------------------- /lua/core/utils/docker.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local TERMINAL = require("toggleterm.terminal").Terminal 4 | 5 | -- Docker 6 | local docker_tui = "lazydocker" 7 | 8 | local docker_client = TERMINAL:new({ 9 | cmd = docker_tui, 10 | dir = "git_dir", 11 | hidden = true, 12 | direction = "float", 13 | float_opts = { 14 | border = "double", 15 | }, 16 | }) 17 | 18 | function M.docker_client_toggle() 19 | docker_client:toggle() 20 | end 21 | 22 | -- Docker ctop 23 | local docker_ctop = "ctop" 24 | 25 | local docker_ctop = TERMINAL:new({ 26 | cmd = docker_ctop, 27 | dir = "git_dir", 28 | hidden = true, 29 | direction = "float", 30 | float_opts = { 31 | border = "double", 32 | }, 33 | }) 34 | 35 | function M.docker_ctop_toggle() 36 | docker_ctop:toggle() 37 | end 38 | 39 | -- Docker dockly 40 | local docker_dockly = "dockly" 41 | 42 | local docker_dockly = TERMINAL:new({ 43 | cmd = docker_dockly, 44 | dir = "git_dir", 45 | hidden = true, 46 | direction = "float", 47 | float_opts = { 48 | border = "double", 49 | }, 50 | }) 51 | 52 | function M.docker_dockly_toggle() 53 | docker_dockly:toggle() 54 | end 55 | 56 | return M 57 | -------------------------------------------------------------------------------- /lua/core/utils/notify.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | function M.warn(msg, name) vim.notify(msg, vim.log.levels.WARN, {title = name}) end 4 | 5 | function M.error(msg, name) vim.notify(msg, vim.log.levels.ERROR, {title = name}) end 6 | 7 | function M.info(msg, name) vim.notify(msg, vim.log.levels.INFO, {title = name}) end 8 | 9 | return M -------------------------------------------------------------------------------- /lua/core/utils/toggle.lua: -------------------------------------------------------------------------------- 1 | local cmp_status_ok, User = pcall(require, "core.user") 2 | if not cmp_status_ok then 3 | return 4 | end 5 | 6 | local CMP = User.completion 7 | local TRANSPARENCY = User.transparency 8 | local DIAGNOSTIC = User.diagnostic 9 | 10 | local M = {} 11 | 12 | -- Toggle Diagnostics 13 | M.toggle_diagnostics = function() 14 | DIAGNOSTIC = not DIAGNOSTIC 15 | if DIAGNOSTIC then 16 | vim.diagnostic.show() 17 | else 18 | vim.diagnostic.hide() 19 | end 20 | end 21 | 22 | -- Toggle Completions 23 | M.toggle_cmp = function() 24 | if CMP == 1 then 25 | vim.cmd("lua require('cmp').setup.buffer { enabled = false }") 26 | CMP = 0 27 | else 28 | vim.cmd("lua require('cmp').setup.buffer { enabled = true }") 29 | CMP = 1 30 | end 31 | end 32 | 33 | -- Toggle Transparency 34 | M.toggle_transparency = function() 35 | if TRANSPARENCY == 1 then 36 | vim.cmd("hi Normal guibg=NONE ctermbg=NONE") 37 | vim.cmd("hi SignColumn guibg=NONE ctermbg=NONE") 38 | vim.cmd("hi CursorLineNR guibg=NONE ctermbg=NONE") 39 | vim.cmd("hi StalineFilename guibg=NONE guifg=NONE") 40 | vim.cmd("hi TodoSignDONE guibg=NONE") 41 | vim.cmd("hi TodoSignFIX guibg=NONE") 42 | vim.cmd("hi TodoSignHACK guibg=NONE") 43 | vim.cmd("hi TodoSignNOTE guibg=NONE") 44 | vim.cmd("hi TodoSignPERF guibg=NONE") 45 | vim.cmd("hi TodoSignTEST guibg=NONE") 46 | vim.cmd("hi TodoSignTODO guibg=NONE") 47 | vim.cmd("hi TodoSignWARN guibg=NONE") 48 | vim.cmd("hi VertSplit guibg=NONE") 49 | TRANSPARENCY = 0 50 | else 51 | vim.cmd("hi Normal guibg=#0f0f0f ctermbg=NONE") 52 | TRANSPARENCY = 1 53 | end 54 | end 55 | 56 | return M -------------------------------------------------------------------------------- /lua/plug/chatgpt.lua: -------------------------------------------------------------------------------- 1 | local ok, chatGPT = pcall(require, "chatgpt") 2 | if not ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | -- welcome_message = WELCOME_MESSAGE, -- set to "" if you don't like the fancy robot 8 | loading_text = "loading", 9 | question_sign = "", -- you can use emoji if you want e.g. 🙂 10 | answer_sign = "ﮧ", -- 🤖 11 | max_line_length = 120, 12 | yank_register = "+", 13 | chat_layout = { 14 | relative = "editor", 15 | position = "50%", 16 | size = { 17 | height = "80%", 18 | width = "80%", 19 | }, 20 | }, 21 | chat_window = { 22 | filetype = "chatgpt", 23 | border = { 24 | highlight = "FloatBorder", 25 | style = "rounded", 26 | text = { 27 | top = " ChatGPT ", 28 | }, 29 | }, 30 | }, 31 | chat_input = { 32 | prompt = "  ", 33 | border = { 34 | highlight = "FloatBorder", 35 | style = "rounded", 36 | text = { 37 | top_align = "center", 38 | top = " Prompt ", 39 | }, 40 | }, 41 | win_options = { 42 | winhighlight = "Normal:Normal", 43 | }, 44 | }, 45 | openai_params = { 46 | model = "text-davinci-003", 47 | frequency_penalty = 0, 48 | presence_penalty = 0, 49 | max_tokens = 300, 50 | temperature = 0, 51 | top_p = 1, 52 | n = 1, 53 | }, 54 | keymaps = { 55 | close = "", 56 | yank_last = "", 57 | scroll_up = "", 58 | scroll_down = "", 59 | }, 60 | } 61 | 62 | chatGPT.setup() 63 | -------------------------------------------------------------------------------- /lua/plug/cheatsheet.lua: -------------------------------------------------------------------------------- 1 | local status_ok, cheatsheet = pcall(require, "cheatsheet") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local status_ok, action = pcall(require, "cheatsheet.telescope.actions") 7 | if not status_ok then 8 | return 9 | end 10 | 11 | local SETTINGS = { 12 | -- Whether to show bundled cheatsheets 13 | 14 | -- For generic cheatsheets like default, unicode, nerd-fonts, etc 15 | -- bundled_cheatsheets = { 16 | -- enabled = {}, 17 | -- disabled = {}, 18 | -- }, 19 | bundled_cheatsheets = true, 20 | 21 | -- For plugin specific cheatsheets 22 | -- bundled_plugin_cheatsheets = { 23 | -- enabled = {}, 24 | -- disabled = {}, 25 | -- } 26 | bundled_plugin_cheatsheets = true, 27 | 28 | -- For bundled plugin cheatsheets, do not show a sheet if you 29 | -- don't have the plugin installed (searches runtimepath for 30 | -- same directory name) 31 | include_only_installed_plugins = true, 32 | 33 | -- Key mappings bound inside the telescope window 34 | telescope_mappings = { 35 | [""] = action.select_or_fill_commandline, 36 | [""] = action.select_or_execute, 37 | [""] = action.copy_cheat_value, 38 | [""] = action.edit_user_cheatsheet, 39 | }, 40 | } 41 | 42 | cheatsheet.setup(SETTINGS) 43 | -------------------------------------------------------------------------------- /lua/plug/cmp/dynamic.lua: -------------------------------------------------------------------------------- 1 | local snip_status_ok, dynamic = pcall(require, "cmp_dynamic") 2 | if not snip_status_ok then 3 | return 4 | end 5 | 6 | local Date = require("cmp_dynamic.utils.date") 7 | 8 | local SETTINGS = { 9 | { 10 | label = "today", 11 | insertText = 1, 12 | cb = { 13 | function() 14 | return os.date("%Y/%m/%d") 15 | end, 16 | }, 17 | cache = true -- default: false 18 | }, 19 | { 20 | label = "next Monday", 21 | insertText = 1, 22 | cb = { 23 | function() 24 | return Date.new():add_date(7):day(1):format("%Y/%m/%d") 25 | end, 26 | }, 27 | }, 28 | { 29 | label = "next Tuesday", 30 | insertText = 1, 31 | cb = { 32 | function() 33 | return Date.new():add_date(7):day(2):format("%Y/%m/%d") 34 | end, 35 | }, 36 | }, 37 | { 38 | label = "next Wednesday", 39 | insertText = 1, 40 | cb = { 41 | function() 42 | return Date.new():add_date(7):day(3):format("%Y/%m/%d") 43 | end, 44 | }, 45 | }, 46 | { 47 | label = "next Thursday", 48 | insertText = 1, 49 | cb = { 50 | function() 51 | return Date.new():add_date(7):day(4):format("%Y/%m/%d") 52 | end, 53 | }, 54 | }, 55 | { 56 | label = "next Friday", 57 | insertText = 1, 58 | cb = { 59 | function() 60 | return Date.new():add_date(7):day(5):format("%Y/%m/%d") 61 | end, 62 | }, 63 | { 64 | label = "next Saturday", 65 | insertText = 1, 66 | cb = { 67 | function() 68 | return Date.new():add_date(7):day(6):format("%Y/%m/%d") 69 | end, 70 | }, 71 | }, 72 | { 73 | label = "next Sunday", 74 | insertText = 1, 75 | cb = { 76 | function() 77 | return Date.new():add_date(7):day(7):format("%Y/%m/%d") 78 | end, 79 | }, 80 | }, 81 | } 82 | } 83 | 84 | dynamic.register(SETTINGS) 85 | -------------------------------------------------------------------------------- /lua/plug/cmp/luasnip.lua: -------------------------------------------------------------------------------- 1 | local status_ok, ls = pcall(require, "luasnip") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local key = vim.keymap.set 7 | 8 | require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/bin/snippets/lua_snip/" }) 9 | ls.config.setup({ store_selection_keys = "" }) 10 | 11 | vim.cmd([[command! LuaSnipEdit :lua require("luasnip.loaders.from_lua").edit_snippet_files()]]) 12 | 13 | local types = require("luasnip.util.types") 14 | ls.config.set_config({ 15 | history = true, --keep around last snippet local to jump back 16 | updateevents = "TextChanged,TextChangedI", --update changes as you type 17 | enable_autosnippets = true, 18 | ext_opts = { 19 | [types.choiceNode] = { 20 | active = { 21 | virt_text = { { " ●" } }, 22 | }, 23 | }, 24 | }, 25 | }) 26 | 27 | key({ "i", "s" }, "", ":w") 28 | key({ "i", "s" }, "", 'lua require("luasnip.extras.select_choice")()') 29 | 30 | key({ "i", "s" }, "", function() 31 | if ls.expand_or_jumpable() then 32 | ls.expand() 33 | end 34 | end, { silent = true }) 35 | 36 | key({ "i", "s" }, "", "o", { silent = true }) 37 | 38 | key({ "i", "s" }, "", function() 39 | if ls.jumpable(-1) then 40 | ls.jump(-1) 41 | end 42 | end, { silent = true }) 43 | key({ "i", "s" }, "", function() 44 | if ls.jumpable(1) then 45 | ls.jump(1) 46 | end 47 | end, { silent = true }) 48 | 49 | key({ "i", "s" }, "", function() 50 | if ls.choice_active() then 51 | ls.change_choice(1) 52 | else 53 | -- print current time 54 | local t = os.date("*t") 55 | local time = string.format("%02d:%02d:%02d", t.hour, t.min, t.sec) 56 | print(time) 57 | end 58 | end) 59 | key({ "i", "s" }, "", function() 60 | if ls.choice_active() then 61 | ls.change_choice(-1) 62 | end 63 | end) 64 | 65 | key("n", "", "LuaSnipEdit", { silent = true, noremap = true }) 66 | -------------------------------------------------------------------------------- /lua/plug/cmp/tabnine.lua: -------------------------------------------------------------------------------- 1 | local snip_status_ok, tabnine = pcall(require, "cmp_tabnine.config") 2 | if not snip_status_ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | max_lines = 1000, 8 | max_num_results = 20, 9 | sort = true, 10 | run_on_every_keystroke = true, 11 | snippet_placeholder = "..", 12 | show_prediction_strength = false, 13 | } 14 | 15 | tabnine.setup(SETTINGS) -------------------------------------------------------------------------------- /lua/plug/colorizer.lua: -------------------------------------------------------------------------------- 1 | local status_ok, colorizer = pcall(require, "colorizer") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | colorizer.setup() 7 | -------------------------------------------------------------------------------- /lua/plug/dadbod.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | function M.setup() 3 | vim.g.db_ui_save_location = "~/.config/nvim/db_ui" 4 | end 5 | return M 6 | -------------------------------------------------------------------------------- /lua/plug/fzf.lua: -------------------------------------------------------------------------------- 1 | local status_ok, fzf = pcall(require, "fzf-lua") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | fzf.setup({}) 7 | -------------------------------------------------------------------------------- /lua/plug/hydra/dap.lua: -------------------------------------------------------------------------------- 1 | local status_ok, Hydra = pcall(require, "hydra") 2 | if not status_ok then return end 3 | local dap = require("dap") 4 | 5 | local hint = [[ 6 | _n_: step over _s_: Continue/Start _b_: Breakpoint 7 | _i_: step into _x_: Disconnect _K_: Hover Variables 8 | _o_: step out _X_: Quit _E_: Evaluate 9 | _c_: to cursor _C_: Close UI _r_: Toggle Repl 10 | ^ 11 | ^ ^ _q_: exit 12 | ]] 13 | 14 | local dap_hydra = Hydra({ 15 | hint = hint, 16 | config = { 17 | color = "pink", 18 | invoke_on_body = true, 19 | hint = { 20 | position = "bottom", 21 | border = "rounded", 22 | }, 23 | }, 24 | name = "dap", 25 | mode = { "n", "x" }, 26 | body = "", 27 | heads = { 28 | { "C", "lua require('dapui').close():DapVirtualTextForceRefresh", { silent = true } }, 29 | { "E", "lua require('dapui').eval()", { silent = true } }, 30 | { "K", "lua require('dap.ui.widgets').hover()", { silent = true } }, 31 | { "X", dap.close, { silent = true } }, 32 | { "b", dap.toggle_breakpoint, { silent = true } }, 33 | { "c", dap.run_to_cursor, { silent = true } }, 34 | { "i", dap.step_into, { silent = true } }, 35 | { "n", dap.step_over, { silent = true } }, 36 | { "o", dap.step_out, { silent = true } }, 37 | { "r", dap.repl.toggle, { silent = true } }, 38 | { "s", dap.continue, { silent = true } }, 39 | { "x", "lua require'dap'.disconnect({ terminateDebuggee = false })", { exit = true, silent = true } }, 40 | { "q", nil, { exit = true, nowait = true } }, 41 | { "", nil, { exit = true, nowait = true } }, 42 | }, 43 | }) 44 | 45 | Hydra.spawn = function(head) 46 | if head == "dap-hydra" then 47 | dap_hydra:activate() 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /lua/plug/hydra/git.lua: -------------------------------------------------------------------------------- 1 | local status_ok, Hydra = pcall(require, "hydra") 2 | if not status_ok then return end 3 | 4 | local status_ok, gitsigns = pcall(require, "gitsigns") 5 | if not status_ok then return end 6 | 7 | local function cmd(command) 8 | return table.concat({ "", command, "" }) 9 | end 10 | 11 | local hint = [[ 12 | 13 | 14 | _J_: next hunk _s_: stage hunk _p_: preview hunk _b_: toggle blame 15 | _K_: prev hunk _u_: undo stage hunk _d_: show deleted _B_: blame show full 16 | _S_: stage buffer _U_: undo stage buffer _/_: show base file 17 | _r_: reset hunk _R_: reset buffer _g_: status 18 | _h_: Branches _M_: checkout commit (current file) _m_: checkout commit 19 | _c_: Commit buffer _P_: Push 20 | ^ 21 | __: Neogit _q_: exit 22 | ]] 23 | 24 | local opts = { exit = true, nowait = true } 25 | 26 | Hydra({ 27 | hint = hint, 28 | config = { 29 | color = "pink", 30 | invoke_on_body = true, 31 | hint = { 32 | position = "bottom", 33 | border = "none", 34 | }, 35 | }, 36 | mode = { "n", "x" }, 37 | body = "", 38 | heads = { 39 | { 40 | "J", 41 | function() 42 | if vim.wo.diff then 43 | return "]c" 44 | end 45 | vim.schedule(function() 46 | gitsigns.next_hunk() 47 | end) 48 | return "" 49 | end, 50 | { expr = true }, 51 | }, 52 | { 53 | "K", 54 | function() 55 | if vim.wo.diff then 56 | return "[c" 57 | end 58 | vim.schedule(function() 59 | gitsigns.prev_hunk() 60 | end) 61 | return "" 62 | end, 63 | { expr = true }, 64 | }, 65 | { "h", cmd("Telescope git_branches"), opts }, 66 | { "c", cmd("G commit %") }, 67 | { "P", cmd("G push"), opts }, 68 | { "m", cmd("Telescope git_commits"), opts }, 69 | { "M", cmd("Telescope git_bcommits"), opts }, 70 | { "g", cmd("Telescope git_status"), opts }, 71 | { "s", gitsigns.stage_hunk, { silent = true } }, 72 | { "R", gitsigns.reset_buffer }, 73 | { "r", gitsigns.reset_hunk }, 74 | { "u", gitsigns.undo_stage_hunk }, 75 | { "U", gitsigns.undo_stage_buffer }, 76 | { "S", gitsigns.stage_buffer }, 77 | { "p", gitsigns.preview_hunk }, 78 | { "d", gitsigns.toggle_deleted, { nowait = true } }, 79 | { "b", cmd("GitBlameToggle"), { exit = true } }, 80 | { 81 | "B", 82 | function() 83 | gitsigns.blame_line({ full = true }) 84 | end, 85 | }, 86 | { "/", gitsigns.show, opts }, -- show the base of the file 87 | { "", "Neogit", opts }, 88 | { "q", nil, opts }, 89 | { "", nil, opts }, 90 | }, 91 | }) 92 | -------------------------------------------------------------------------------- /lua/plug/hydra/init.lua: -------------------------------------------------------------------------------- 1 | for _, source in ipairs({ 2 | 3 | "plug.hydra.dap", 4 | "plug.hydra.git", 5 | "plug.hydra.options", 6 | "plug.hydra.spelling", 7 | "plug.hydra.telescope", 8 | "plug.hydra.windows", 9 | 10 | }) do 11 | local status_ok, fault = pcall(require, source) 12 | if not status_ok then 13 | local err = "Failed to load " .. source .. "\n\n" .. fault 14 | notify(err, "error") 15 | end 16 | end 17 | 18 | 19 | -------------------------------------------------------------------------------- /lua/plug/hydra/options.lua: -------------------------------------------------------------------------------- 1 | local status_ok, Hydra = pcall(require, "hydra") 2 | if not status_ok then return end 3 | 4 | local hint = [[ 5 | 6 | ^ ^ Options ^ ^ 7 | ^ ^ ^ 8 | _v_ %{ve} virtual edit ^ ^ 9 | _i_ %{list} invisible characters ^ ^^ 10 | _s_ %{spell} spell ^ ^ 11 | _w_ %{wrap} wrap ^ ^ 12 | _c_ %{cul} cursor line ^ ^ 13 | _n_ %{nu} number ^ ^ 14 | _r_ %{rnu} relative number ^ ^ 15 | ^ ^ ^ 16 | ^^^^_q_, __: Exit ^ ^ 17 | ^ 18 | ]] 19 | 20 | Hydra({ 21 | name = "Options", 22 | hint = hint, 23 | config = { 24 | color = "amaranth", 25 | invoke_on_body = true, 26 | hint = { 27 | border = "none", 28 | position = "middle", 29 | }, 30 | }, 31 | mode = { "n", "x" }, 32 | body = "", 33 | heads = { 34 | { 35 | "n", 36 | function() 37 | if vim.o.number == true then 38 | vim.o.number = false 39 | else 40 | vim.o.number = true 41 | end 42 | end, 43 | { desc = "number" }, 44 | }, 45 | { 46 | "r", 47 | function() 48 | if vim.o.relativenumber == true then 49 | vim.o.relativenumber = false 50 | else 51 | vim.o.number = true 52 | vim.o.relativenumber = true 53 | end 54 | end, 55 | { desc = "relativenumber" }, 56 | }, 57 | { 58 | "v", 59 | function() 60 | if vim.o.virtualedit == "all" then 61 | vim.o.virtualedit = "block" 62 | else 63 | vim.o.virtualedit = "all" 64 | end 65 | end, 66 | { desc = "virtualedit" }, 67 | }, 68 | { 69 | "i", 70 | function() 71 | if vim.o.list == true then 72 | vim.o.list = false 73 | else 74 | vim.o.list = true 75 | end 76 | end, 77 | { desc = "show invisible" }, 78 | }, 79 | { 80 | "s", 81 | function() 82 | if vim.o.spell == true then 83 | vim.o.spell = false 84 | else 85 | vim.o.spell = true 86 | end 87 | end, 88 | { exit = true, desc = "spell" }, 89 | }, 90 | { 91 | "w", 92 | function() 93 | if vim.o.wrap == true then 94 | vim.o.wrap = false 95 | else 96 | vim.o.wrap = true 97 | end 98 | end, 99 | { desc = "wrap" }, 100 | }, 101 | { 102 | "c", 103 | function() 104 | if vim.o.cursorline == true then 105 | vim.o.cursorline = false 106 | else 107 | vim.o.cursorline = true 108 | end 109 | end, 110 | { desc = "cursor line" }, 111 | }, 112 | { "", nil, { exit = true } }, 113 | { "q", nil, { exit = true } }, 114 | }, 115 | }) 116 | -------------------------------------------------------------------------------- /lua/plug/hydra/spelling.lua: -------------------------------------------------------------------------------- 1 | local status_ok, Hydra = pcall(require, "hydra") 2 | if not status_ok then return end 3 | 4 | local function cmd(command) 5 | return table.concat({ "", command, "" }) 6 | end 7 | 8 | local hint = [[ 9 | _J_: next _K_: previous 10 | _a_: add word _l_: list corrections 11 | _f_: use first correction 12 | 13 | ^ 14 | _q_: Exit 15 | ]] 16 | 17 | Hydra({ 18 | name = "Spelling", 19 | hint = hint, 20 | config = { 21 | invoke_on_body = true, 22 | hint = { 23 | position = "bottom", 24 | border = "rounded", 25 | }, 26 | }, 27 | mode = "n", 28 | body = "", 29 | heads = { 30 | { "J", "]s" }, 31 | { "K", "[s" }, 32 | { "a", "zg" }, 33 | { "l", cmd("Telescope spell_suggest") }, 34 | { "f", "1z=" }, 35 | { "q", nil, { exit = true, nowait = true } }, 36 | { "", nil, { exit = true, nowait = true } }, 37 | }, 38 | }) 39 | -------------------------------------------------------------------------------- /lua/plug/hydra/telescope.lua: -------------------------------------------------------------------------------- 1 | local status_ok, Hydra = pcall(require, "hydra") 2 | if not status_ok then return end 3 | 4 | -- local function cmd(command) 5 | -- return table.concat({ "", command, "" }) 6 | -- end 7 | 8 | local Hydra = require('hydra') 9 | local cmd = require('hydra.keymap-util').cmd 10 | 11 | local hint = [[ 12 | 13 | (``', 14 | / `''/ 15 | o\/ / 16 | \, / _ 17 | ( / ,',`, 18 | /x`''7/_________r_ ,=, 19 | (x //---, (------',=, 20 | / `''7' \ \ ' ,=, 21 | / / \ \ '-' 22 | ( / ) \ 23 | `''' /(o)\ 24 | `|~~~|` 25 | | | 26 | / \ 27 | ,-----'` `'-----, 28 | `~~~~~~~~~~~~~~~~~~~~~~~` 29 | 30 | ]] 31 | 32 | Hydra({ 33 | name = 'Telescope', 34 | hint = hint, 35 | config = { 36 | color = 'teal', 37 | invoke_on_body = true, 38 | hint = { 39 | position = 'middle', 40 | border = 'none', 41 | }, 42 | }, 43 | mode = 'n', 44 | body = '', 45 | heads = { 46 | { "b", cmd 'lua require("plug.telescope").buffers()' , { desc = "Buffers" } }, 47 | { "n", cmd 'lua require("plug.telescope").nvim_files()' , { desc = "Nvim Files" } }, 48 | { "d", cmd 'lua require("plug.telescope").xdg_config()' , { desc = "DotFiles" } }, 49 | { "e", cmd "Telescope emoji" , { desc = "Emoji Picker" } }, 50 | { "c", cmd "Telescope commands" , { desc = "execute command" } }, 51 | { "f", cmd "Telescope find_files " }, 52 | { "t", cmd "Telescope file_browser" }, 53 | { "m", cmd "Telescope media_files" }, 54 | { "g", cmd "Telescope live_grep" , { desc = "Find with Word" } }, 55 | { "h", cmd "Telescope help_tags" , { desc = "vim help" } }, 56 | { "k", cmd "Telescope keymaps" }, 57 | { "O", cmd "Telescope vim_options" }, 58 | { "p", cmd "Telescope projects" , { desc = "projects" } }, 59 | { "r", cmd "Telescope oldfiles" , { desc = "recently opened files" } }, 60 | { "R", cmd "Telescope registers" }, 61 | { "s", cmd "Telescope grep_string" , { desc = "Text under cursor" } }, 62 | { "S", cmd "Telescope symbols" }, 63 | { "/", cmd "Telescope current_buffer_fuzzy_find" , { desc = "search in file" } }, 64 | { "?", cmd "Telescope search_history" , { desc = "search history" } }, 65 | { ";", cmd "Telescope command_history" , { desc = "command-line history" } }, 66 | { "", cmd("Telescope"), { exit = true, desc = "list all pickers" } }, 67 | { "q", nil, { exit = true, nowait = true } }, 68 | { "", nil, { exit = true, nowait = true } }, 69 | } 70 | }) 71 | -------------------------------------------------------------------------------- /lua/plug/hydra/windows.lua: -------------------------------------------------------------------------------- 1 | local status_ok, Hydra = pcall(require, "hydra") 2 | if not status_ok then return end 3 | 4 | local status_ok, winshift = pcall(require, "winshift") 5 | if not status_ok then return end 6 | 7 | local status_ok, picker = pcall(require, "window-picker") 8 | if not status_ok then return end 9 | 10 | local function cmd(command) 11 | return table.concat({ "", command, "" }) 12 | end 13 | 14 | local hint = [[ 15 | Move Size Splits 16 | ----- ------ --------- 17 | ^ ^ _K_ ^ ^ ^ ^ _k_ ^ ^ _s_: horizontally 18 | _H_ ^ ^ _L_ _h_ ^ ^ _l_ _v_: vertically 19 | ^ ^ _J_ ^ ^ ^ ^ _j_ ^ ^ _c_: close 20 | 21 | _=_: equalize _W_: swap 22 | _p_: pick _w_: shift 23 | ^ 24 | _q_: exit 25 | ]] 26 | 27 | local pick_window = function() 28 | local picked_window_id = picker.pick_window() or vim.api.nvim_get_current_win() 29 | vim.api.nvim_set_current_win(picked_window_id) 30 | end 31 | 32 | local opts = { exit = true, nowait = true } 33 | 34 | Hydra({ 35 | name = "Windows", 36 | hint = hint, 37 | config = { 38 | color = "pink", 39 | invoke_on_body = true, 40 | hint = { 41 | position = "middle", 42 | border = "rounded", 43 | }, 44 | }, 45 | mode = "n", 46 | body = "", 47 | heads = { 48 | { "s", cmd("split"), opts }, 49 | { "v", cmd("vsplit"), opts }, 50 | { "c", cmd("close"), opts }, -- close current window 51 | 52 | -- window resizing 53 | { "=", cmd("wincmd =") }, 54 | { "k", cmd("wincmd +") }, 55 | { "j", cmd("wincmd -") }, 56 | { "h", cmd("wincmd <") }, 57 | { "l", cmd("wincmd >") }, 58 | 59 | -- move window around 60 | { "H", cmd("WinShift left") }, 61 | { "J", cmd("WinShift down") }, 62 | { "K", cmd("WinShift up") }, 63 | { "L", cmd("WinShift right") }, 64 | 65 | { "p", pick_window, opts }, -- pick window 66 | -- WinShift modes 67 | { "w", cmd("WinShift") }, 68 | { "W", cmd("WinShift swap") }, 69 | { "q", nil, opts }, 70 | { "", nil, opts }, 71 | }, 72 | }) 73 | -------------------------------------------------------------------------------- /lua/plug/init.lua: -------------------------------------------------------------------------------- 1 | local impatient_ok, impatient = pcall(require, "impatient") 2 | if impatient_ok then 3 | impatient.enable_profile() 4 | end 5 | 6 | local status_ok, notify = pcall(require, "notify") 7 | if not status_ok then 8 | return 9 | end 10 | 11 | for _, source in ipairs({ 12 | 13 | "plug.ui", 14 | "plug.whichkey", 15 | "plug.nvim-tree", 16 | "plug.ts-context", 17 | "plug.terminal", 18 | "plug.telescope", 19 | "plug.mason", 20 | "plug.cmp", 21 | "plug.lsp", 22 | "plug.trouble", 23 | "plug.todo-comments", 24 | -- "plug.hydra", 25 | -- "plug.cheatsheet", 26 | "plug.fzf", 27 | "plug.regexp", 28 | "plug.chatgpt", 29 | "plug.other", 30 | "plug.tabout", 31 | "plug.treesitter", 32 | 33 | }) do 34 | local status_ok, fault = pcall(require, source) 35 | if not status_ok then 36 | local err = "Failed to load " .. source .. "\n\n" .. fault 37 | notify(err, "error", {title = "Require Error"}) 38 | end 39 | end 40 | 41 | 42 | require("plug.dadbod").setup() 43 | -------------------------------------------------------------------------------- /lua/plug/lsp/diagnostics-highlight-override.lua: -------------------------------------------------------------------------------- 1 | local util = require("core.utils") 2 | 3 | -- Custom vertual text highlight groups for lsp_lines 4 | local c = require("kanagawa.colors").setup().diag 5 | local bg = require("kanagawa.colors").setup().bg 6 | local alpha = 0.4 7 | 8 | vim.api.nvim_set_hl(0, "DiagnosticVirtualTextError", { bg = "NONE", fg = util.blend(c.error, bg, alpha) }) 9 | vim.api.nvim_set_hl(0, "DiagnosticVirtualTextWarn", { bg = "NONE", fg = util.blend(c.warning, bg, alpha) }) 10 | vim.api.nvim_set_hl(0, "DiagnosticVirtualTextInfo", { bg = "NONE", fg = util.blend(c.info, bg, alpha) }) 11 | vim.api.nvim_set_hl(0, "DiagnosticVirtualTextHint", { bg = "NONE", fg = util.blend(c.hint, bg, alpha) }) 12 | 13 | -- require("lsp_lines").setup() 14 | -- -- Disable virtual_text since it's redundant due to lsp_lines. 15 | -- vim.diagnostic.config({ 16 | -- virtual_text = false, 17 | -- }) 18 | 19 | -- vim.keymap.set("", "ll", require("lsp_lines").toggle, { desc = "Toggle lsp_lines" }) 20 | -------------------------------------------------------------------------------- /lua/plug/lsp/init.lua: -------------------------------------------------------------------------------- 1 | local status_ok, lsp = pcall(require, "lspconfig") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | require("plug.lsp.lsp-installer") 7 | -- require('lspsaga').setup({}) -- Special symbols for moere info about buffer in winbar...MUST TRY!! 8 | require("plug.lsp.null-ls") 9 | 10 | vim.diagnostic.config({ virtual_text = true }) 11 | 12 | local diagnostic_signs = { 13 | { name = "DiagnosticSignError", text = "" }, 14 | { name = "DiagnosticSignWarn" , text = "" }, 15 | { name = "DiagnosticSignHint" , text = "" }, 16 | { name = "DiagnosticSignInfo" , text = "" }, 17 | } 18 | 19 | for _, sign in ipairs(diagnostic_signs) do 20 | vim.fn.sign_define(sign.name, { 21 | texthl = sign.name, 22 | text = sign.text, 23 | numhl = sign.name, 24 | }) 25 | end 26 | 27 | lsp.html.setup({}) 28 | -- lsp.jdtls.setup({}) 29 | lsp.eslint.setup({}) 30 | lsp.pyright.setup({}) 31 | lsp.tsserver.setup({}) 32 | lsp.tailwindcss.setup({}) 33 | lsp.sqlls.setup({}) 34 | -- lsp.bashls.setup(require("plug.lsp.servers.bashls")) 35 | lsp.jsonls.setup(require("plug.lsp.servers.jsonls")) 36 | lsp.clangd.setup(require("plug.lsp.servers.clangd")) 37 | lsp.emmet_ls.setup(require("plug.lsp.servers.emmet-ls")) 38 | lsp.lua_ls.setup(require("plug.lsp.servers.sumneko-lua")) 39 | 40 | -- Highlight Groups for Diagnostics (Dimmed Colored) 41 | require("plug.lsp.diagnostics-highlight-override") 42 | -------------------------------------------------------------------------------- /lua/plug/lsp/lsp-installer.lua: -------------------------------------------------------------------------------- 1 | local status_ok, installer = pcall(require, "nvim-lsp-installer") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | -- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer", "sumneko_lua" } 8 | -- This setting has no relation with the `automatic_installation` setting. 9 | ensure_installed = { 10 | "html", 11 | "pyright", 12 | "clangd", 13 | "tsserver", 14 | -- "jdtls", 15 | "emmet_ls", 16 | "bashls", 17 | "sqlls", 18 | "sumneko_lua", 19 | "jsonls", 20 | "eslint", 21 | "tailwindcss", 22 | }, 23 | 24 | -- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed. 25 | -- This setting has no relation with the `ensure_installed` setting. 26 | -- Can either be: 27 | -- - false: Servers are not automatically installed. 28 | -- - true: All servers set up via lspconfig are automatically installed. 29 | -- - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed. 30 | -- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } } 31 | automatic_installation = true, 32 | 33 | ui = { 34 | -- Whether to automatically check for outdated servers when opening the UI window. 35 | check_outdated_servers_on_open = true, 36 | 37 | -- The border to use for the UI window. Accepts same border values as |nvim_open_win()|. 38 | -- border = "none", 39 | 40 | icons = { 41 | -- The list icon to use for installed servers. 42 | server_installed = "✓", 43 | -- The list icon to use for servers that are pending installation. 44 | server_pending = "➜", 45 | -- The list icon to use for servers that are not installed. 46 | server_uninstalled = "✗", 47 | }, 48 | keymaps = { 49 | -- Keymap to expand a server in the UI 50 | toggle_server_expand = "", 51 | -- Keymap to install the server under the current cursor position 52 | install_server = "i", 53 | -- Keymap to reinstall/update the server under the current cursor position 54 | update_server = "u", 55 | -- Keymap to check for new version for the server under the current cursor position 56 | check_server_version = "c", 57 | -- Keymap to update all installed servers 58 | update_all_servers = "U", 59 | -- Keymap to check which installed servers are outdated 60 | check_outdated_servers = "C", 61 | -- Keymap to uninstall a server 62 | uninstall_server = "X", 63 | }, 64 | }, 65 | 66 | -- The directory in which to install all servers. 67 | -- install_root_dir = path.concat {vim.fn.stdpath "data", "lsp_servers"}, 68 | 69 | pip = { 70 | -- These args will be added to `pip install` calls. Note that setting extra args might impact intended behavior 71 | -- and is not recommended. 72 | -- 73 | -- Example: { "--proxy", "https://proxyserver" } 74 | install_args = {}, 75 | }, 76 | 77 | -- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when 78 | -- debugging issues with server installations. 79 | log_level = vim.log.levels.INFO, 80 | 81 | -- Limit for the maximum amount of servers to be installed at the same time. Once this limit is reached, any further 82 | -- servers that are requested to be installed will be put in a queue. 83 | max_concurrent_installers = 4, 84 | 85 | github = { 86 | -- The template URL to use when downloading assets from GitHub. 87 | -- The placeholders are the following (in order): 88 | -- 1. The repository (e.g. "rust-lang/rust-analyzer") 89 | -- 2. The release version (e.g. "v0.3.0") 90 | -- 3. The asset name (e.g. "rust-analyzer-v0.3.0-x86_64-unknown-linux-gnu.tar.gz") 91 | download_url_template = "https://github.com/%s/releases/download/%s/%s", 92 | }, 93 | } 94 | 95 | installer.setup(SETTINGS) 96 | -------------------------------------------------------------------------------- /lua/plug/lsp/null-ls.lua: -------------------------------------------------------------------------------- 1 | local status_ok, null_ls = pcall(require, "null-ls") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local b = null_ls.builtins 7 | 8 | local sources = { 9 | 10 | -- webdev stuff 11 | b.formatting.deno_fmt, b.formatting.prettier.with({ 12 | filetypes = {"html", "markdown", "css"}, 13 | extra_args = {"--no-semi", "--single-quote", "--jsx-single-quote"} 14 | }), -- Lua 15 | b.formatting.stylua, -- Shell 16 | b.formatting.shfmt, 17 | b.diagnostics.shellcheck.with({diagnostics_format = "#{m} [#{c}]"}), -- cpp 18 | b.formatting.clang_format, -- pyhton 19 | b.formatting.black.with({extra_args = {"--fast"}}), b.diagnostics.flake8 20 | } 21 | 22 | null_ls.setup({debug = true, sources = sources}) 23 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/bashls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | cmd = { "bash-language-server", "start" }, 3 | filetypes = { "bash", "sh" }, 4 | } 5 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/clangd.lua: -------------------------------------------------------------------------------- 1 | local capabilities = vim.lsp.protocol.make_client_capabilities() 2 | capabilities.offsetEncoding = { "utf-16" } 3 | 4 | local SETTINGS = { 5 | capabilities = capabilities, 6 | cmd = { 7 | "clangd", 8 | "--background-index", 9 | "--pch-storage=memory", 10 | "--clang-tidy", 11 | "--suggest-missing-includes", 12 | "--cross-file-rename", 13 | "--completion-style=detailed", 14 | }, 15 | init_options = { 16 | clangdFileStatus = true, 17 | usePlaceholders = true, 18 | completeUnimported = true, 19 | semanticHighlighting = true, 20 | }, 21 | filetypes = { "c", "cpp", "objc", "objcpp", "cuda" }, 22 | log_level = 2, 23 | root_dir = require("lspconfig.util").root_pattern({ 24 | ".clangd", 25 | ".clang-tidy", 26 | ".clang-format", 27 | "compile_commands.json", 28 | "compile_flags.txt", 29 | "configure.ac", 30 | ".git", 31 | }) or vim.loop.cwd(), 32 | single_file_support = true, 33 | } 34 | 35 | return SETTINGS 36 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/emmet-ls.lua: -------------------------------------------------------------------------------- 1 | local SETTINGS = { 2 | default_config = { 3 | cmd = { "ls_emmet", "--stdio" }, 4 | filetypes = { 5 | "html", 6 | "css", 7 | "scss", 8 | "javascript", 9 | "javascriptreact", 10 | "typescript", 11 | "typescriptreact", 12 | "haml", 13 | "xml", 14 | "xsl", 15 | "pug", 16 | "slim", 17 | "sass", 18 | "stylus", 19 | "less", 20 | "sss", 21 | }, 22 | root_dir = function(fname) 23 | return vim.loop.cwd() 24 | end, 25 | }, 26 | } 27 | 28 | return SETTINGS 29 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/gopls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | flags = { debounce_text_changes = 500 }, 3 | cmd = { "gopls", "-remote=auto" }, 4 | settings = { 5 | gopls = { 6 | usePlaceholders = true, 7 | analyses = { 8 | nilness = true, 9 | shadow = true, 10 | unusedparams = true, 11 | unusewrites = true, 12 | }, 13 | }, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/itex.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/ltex.lua 2 | -- https://gist.github.com/lbiaggi/a3eb761ac2fdbff774b29c88844355b8 3 | 4 | return { 5 | settings = { 6 | ltex = { language = "en-US" }, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/marksman.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/marksman.lua 2 | return { 3 | cmd = { "marksman", "server" }, 4 | filetypes = { "markdown" }, 5 | single_file_support = false, 6 | } 7 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/pyright.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/pyright.lua 2 | return { 3 | settings = { 4 | python = { 5 | analysis = { 6 | inlayHints = { 7 | variableTypes = true, 8 | functionReturnTypes = true, 9 | }, 10 | }, 11 | }, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/sqls.lua: -------------------------------------------------------------------------------- 1 | local SETTINGS = { 2 | sqls = { 3 | connections = { 4 | { 5 | driver = 'mysql', 6 | dataSourceName = "Server=localhost;Database=employees;User Id=;Password=;", 7 | }, 8 | { 9 | driver = 'postgresql', 10 | dataSourceName = 'host=127.0.0.1 port=15432 user=postgres password=mysecretpassword1234 dbname=dvdrental sslmode=disable', 11 | }, 12 | }, 13 | }, 14 | } 15 | 16 | return SETTINGS 17 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/sumneko-lua.lua: -------------------------------------------------------------------------------- 1 | local SETTINGS = { 2 | settings = { 3 | Lua = { 4 | diagnostics = { 5 | -- Get the language server to recognize the `vim` global 6 | globals = { "vim" }, 7 | }, 8 | workspace = { 9 | -- Make the server aware of Neovim runtime files 10 | library = { 11 | [vim.fn.expand("$VIMRUNTIME/lua")] = true, 12 | [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, 13 | }, 14 | }, 15 | }, 16 | }, 17 | } 18 | 19 | return SETTINGS 20 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/taplo.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/taplo.lua 2 | return {} 3 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/texlab.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/texlab.lua 2 | return {} 3 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/vimls.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/vimls.lua 2 | return {} 3 | -------------------------------------------------------------------------------- /lua/plug/lsp/servers/yamlls.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/yamlls.lua 2 | return { 3 | yaml = { 4 | schemaStore = { 5 | enable = true, 6 | }, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /lua/plug/mason.lua: -------------------------------------------------------------------------------- 1 | local status_ok, mason = pcall(require, "mason") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | ui = { 8 | check_outdated_packages_on_open = true, 9 | border = "none", 10 | icons = { 11 | package_installed = "✓", 12 | package_pending = "➜", 13 | package_uninstalled = "✗" 14 | }, 15 | keymaps = { 16 | -- Keymap to expand a package 17 | toggle_package_expand = "", 18 | -- Keymap to install the package under the current cursor position 19 | install_package = "i", 20 | -- Keymap to reinstall/update the package under the current cursor position 21 | update_package = "u", 22 | -- Keymap to check for new version for the package under the current cursor position 23 | check_package_version = "c", 24 | -- Keymap to update all installed packages 25 | update_all_packages = "U", 26 | -- Keymap to check which installed packages are outdated 27 | check_outdated_packages = "C", 28 | -- Keymap to uninstall a package 29 | uninstall_package = "X", 30 | -- Keymap to cancel a package installation 31 | cancel_installation = "", 32 | -- Keymap to apply language filter 33 | apply_language_filter = "", 34 | } 35 | } 36 | } 37 | 38 | mason.setup(SETTINGS) 39 | -------------------------------------------------------------------------------- /lua/plug/other.lua: -------------------------------------------------------------------------------- 1 | local status, comment = pcall(require, "nvim_comment") 2 | if not status then 3 | return 4 | end 5 | 6 | local status, autopair = pcall(require, "nvim-autopairs") 7 | if not status then 8 | return 9 | end 10 | 11 | local status, leap = pcall(require, "leap") 12 | if not status then 13 | return 14 | end 15 | 16 | local status, flit = pcall(require, "flit") 17 | if not status then 18 | return 19 | end 20 | 21 | local status, neural = pcall(require, "neural") 22 | if not status then 23 | return 24 | end 25 | 26 | comment.setup({}) 27 | autopair.setup({}) 28 | leap.add_default_mappings() 29 | flit.setup { 30 | keys = { f = 'f', F = 'F', t = 't', T = 'T' }, 31 | -- A string like "nv", "nvo", "o", etc. 32 | labeled_modes = "nx", 33 | multiline = true, 34 | -- Like `leap`s similar argument (call-specific overrides). 35 | -- E.g.: opts = { equivalence_classes = {} } 36 | opts = {} 37 | } 38 | -- hop.setup({ keys = 'etovxqpdygfblzhckisuran' }) 39 | 40 | -- require('hlargs').setup { 41 | -- color = '#FFEEAF', 42 | -- } 43 | 44 | local api = require("core.utils").get_api_key() 45 | neural.setup({ 46 | open_ai = { 47 | api_key = api 48 | } 49 | }) 50 | -------------------------------------------------------------------------------- /lua/plug/regexp.lua: -------------------------------------------------------------------------------- 1 | require'regexplainer'.setup { 2 | -- 'narrative' 3 | mode = 'narrative', -- TODO: 'ascii', 'graphical' 4 | 5 | -- automatically show the explainer when the cursor enters a regexp 6 | auto = false, 7 | 8 | -- filetypes (i.e. extensions) in which to run the autocommand 9 | filetypes = { 10 | 'html', 11 | 'js', 12 | 'cjs', 13 | 'mjs', 14 | 'ts', 15 | 'jsx', 16 | 'tsx', 17 | 'cjsx', 18 | 'mjsx', 19 | 'lua', 20 | }, 21 | 22 | -- Whether to log debug messages 23 | debug = false, 24 | 25 | -- 'split', 'popup' 26 | display = 'popup', 27 | 28 | mappings = { 29 | toggle = 'gR', 30 | -- examples, not defaults: 31 | -- show = 'gS', 32 | -- hide = 'gH', 33 | -- show_split = 'gP', 34 | -- show_popup = 'gU', 35 | }, 36 | 37 | narrative = { 38 | separator = '\n', 39 | }, 40 | } 41 | 42 | -------------------------------------------------------------------------------- /lua/plug/tabout.lua: -------------------------------------------------------------------------------- 1 | require("tabout").setup({ 2 | tabkey = "", -- key to trigger tabout, set to an empty string to disable 3 | backwards_tabkey = "", -- key to trigger backwards tabout, set to an empty string to disable 4 | act_as_tab = true, -- shift content if tab out is not possible 5 | act_as_shift_tab = false, -- reverse shift content if tab out is not possible (if your keyboard/terminal supports ) 6 | default_tab = "", -- shift default action (only at the beginning of a line, otherwise is used) 7 | default_shift_tab = "", -- reverse shift default action, 8 | enable_backwards = true, -- well ... 9 | completion = true, -- if the tabkey is used in a completion pum 10 | tabouts = { 11 | { open = "'", close = "'" }, 12 | { open = '"', close = '"' }, 13 | { open = "`", close = "`" }, 14 | { open = "(", close = ")" }, 15 | { open = "[", close = "]" }, 16 | { open = "{", close = "}" }, 17 | }, 18 | ignore_beginning = true, --[[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]] 19 | exclude = {}, -- tabout will ignore these filetypes 20 | }) 21 | -------------------------------------------------------------------------------- /lua/plug/telescope/options.lua: -------------------------------------------------------------------------------- 1 | local status_ok, builtin = pcall(require, "telescope.builtin") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local M = {} 7 | 8 | M.xdg_config = function() 9 | builtin.find_files({ 10 | prompt_title = "XDG-CONFIG", 11 | -- prompt_prefix = "▶ ", 12 | find_command = { "fd", "--no-ignore-vcs" }, 13 | sorting_strategy = "ascending", 14 | file_ignore_patterns = { "lua-language-server", "chromium" }, 15 | cwd = "~/.dotfiles", 16 | layout_config = { width = 0.7, height = 0.3 }, 17 | results_height = 20, 18 | hidden = true, 19 | previewer = false, 20 | borderchars = { 21 | { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, 22 | preview = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, 23 | }, 24 | }) 25 | end 26 | 27 | M.buffers = function() 28 | builtin.buffers({ 29 | prompt_title = "BUFFERS", 30 | -- prompt_prefix = "▶ ", 31 | sorting_strategy = "ascending", 32 | file_ignore_patterns = { "lua-language-server", "chromium" }, 33 | previewer = false, 34 | layout_config = { width = 0.5, height = 0.3 }, 35 | hidden = true, 36 | }) 37 | end 38 | 39 | M.nvim_files = function() 40 | builtin.find_files({ 41 | prompt_title = "NVIM-FILES", 42 | -- prompt_prefix = "▶ ", 43 | previewer = false, 44 | find_command = { "fd", "--no-ignore-vcs" }, 45 | sorting_strategy = "ascending", 46 | file_ignore_patterns = { ".git", "lua-language-server", "bin/" }, 47 | cwd = "~/.config/nvim", 48 | hidden = true, 49 | }) 50 | end 51 | 52 | M.search_dotfiles = function() 53 | builtin.find_files({ 54 | prompt_title = "DOTFILES", 55 | -- prompt_prefix = "▶ ", 56 | find_command = { "fd", "--no-ignore-vcs" }, 57 | shorten_path = true, 58 | sorting_strategy = "ascending", 59 | cwd = vim.env.DOTFILES, 60 | hidden = true, 61 | previewer = false, 62 | layout_config = { height = 0.3, width = 0.5 }, 63 | }) 64 | end 65 | 66 | M.search_oldfiles = function() 67 | builtin.oldfiles({ 68 | prompt_title = "RECENT-FILES", 69 | -- prompt_prefix = "▶ ", 70 | previewer = false, 71 | shorten_path = true, 72 | sorting_strategy = "ascending", 73 | hidden = true, 74 | layout_config = { height = 0.3, width = 0.5 }, 75 | }) 76 | end 77 | 78 | M.grep_dotfiles = function() 79 | builtin.live_grep({ 80 | prompt_title = "GREP-DOTFILES", 81 | -- prompt_prefix = "▶ ", 82 | shorten_path = true, 83 | sorting_strategy = "ascending", 84 | cwd = vim.env.DOTFILES, 85 | hidden = true, 86 | }) 87 | end 88 | 89 | M.grep_wiki = function() 90 | builtin.live_grep({ 91 | hidden = true, 92 | search_dirs = { "~/.dotfiles/wiki" }, 93 | -- prompt_prefix = "▶ ", 94 | prompt_title = "GREP-WIKI", 95 | path_display = { "smart" }, 96 | }) 97 | end 98 | 99 | M.git_branches = function() 100 | builtin.git_branches({ 101 | -- prompt_prefix = "▶ ", 102 | prompt_title = "GIT-BRANCHES", 103 | path_display = { "smart" }, 104 | attach_mappings = function(prompt_bufnr, map) 105 | map("i", "", actions.git_delete_branch) 106 | map("n", "dd", actions.git_delete_branch) 107 | return true 108 | end, 109 | }) 110 | end 111 | 112 | M.installed_plugins = function() 113 | builtin.find_files({ 114 | hidden = true, 115 | cwd = vim.fn.stdpath("data") .. "/site/pack/packer/start/", 116 | -- prompt_prefix = "▶ ", 117 | prompt_title = "INSTALLED-PLUGS", 118 | path_display = { "smart" }, 119 | }) 120 | end 121 | 122 | return M -------------------------------------------------------------------------------- /lua/plug/terminal.lua: -------------------------------------------------------------------------------- 1 | local status_ok, term = pcall(require, "toggleterm") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | size = 13, 8 | open_mapping = [[]], 9 | shade_filetypes = {}, 10 | shade_terminals = true, 11 | shading_factor = "1", 12 | start_in_insert = true, 13 | persist_size = true, 14 | direction = "horizontal", 15 | highlights = { 16 | -- highlights which map to a highlight group name and a table of it's values 17 | -- NOTE: this is only a subset of values, any group placed here will be set for the terminal window split 18 | Normal = { guibg = "#0f0f0f" }, 19 | NormalFloat = { guibg = "#18181a" }, 20 | FloatBorder = { guifg = "#18181a" , guibg = "#18181a" }, 21 | }, 22 | float_opts = { 23 | -- The border key is *almost* the same as 'nvim_open_win' 24 | -- see :h nvim_open_win for details on borders however 25 | -- the 'curved' border is a custom border type 26 | -- not natively supported but implemented in this plugin. 27 | border = "curved", 28 | -- like `size`, width and height can be a number or function which is passed the current terminal 29 | winblend = 3, 30 | }, 31 | } 32 | 33 | term.setup(SETTINGS) -------------------------------------------------------------------------------- /lua/plug/todo-comments.lua: -------------------------------------------------------------------------------- 1 | local status_ok, todo = pcall(require, "todo-comments") 2 | if not status_ok then return end 3 | 4 | local SETTINGS = { 5 | signs = true, 6 | sign_priority = 8, 7 | keywords = { 8 | FIX = { 9 | icon = " ", 10 | color = "#C34043", 11 | alt = {"FIXME", "BUG", "FIXIT", "ISSUE"} 12 | -- signs = false, -- configure signs for some keywords individually 13 | }, 14 | TODO = {icon = "", color = "info"}, 15 | DONE = {icon = " ", color = "done"}, 16 | HACK = {icon = " ", color = "warning"}, 17 | WARN = {icon = " ", color = "error", alt = {"WARNING", "XXX"}}, 18 | PERF = {icon = " ", alt = {"OPTIM", "PERFORMANCE", "OPTIMIZE"}}, 19 | NOTE = {icon = " ", color = "hint", alt = {"INFO"}} 20 | }, 21 | merge_keywords = true, -- when true, custom keywords will be merged with the defaults 22 | highlight = { 23 | before = "", -- "fg" or "bg" or empty 24 | keyword = "wide", -- "fg", "bg", "wide" or empty. 25 | after = "fg", -- "fg" or "bg" or empty 26 | pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlightng (vim regex) 27 | comments_only = true, -- uses treesitter to match keywords in comments only 28 | max_line_len = 400, -- ignore lines longer than this 29 | exclude = {} -- list of file types to exclude highlighting 30 | }, 31 | colors = { 32 | error = {"DiagnosticError" , "ErrorMsg" , "#DC2626"}, 33 | warning = {"DiagnosticWarning", "WarningMsg", "#FBBF24"}, 34 | info = {"DiagnosticInfo" , "#7FB4CA"}, 35 | done = {"DiagnosticDone" , "#00A600"}, 36 | hint = {"DiagnosticHint" , "#10B981"}, 37 | default = {"Identifier" , "#C34043"} 38 | }, 39 | search = { 40 | command = "rg", 41 | args = { 42 | "--color=never", "--no-heading", "--with-filename", "--line-number", 43 | "--column" 44 | }, 45 | pattern = [[\b(KEYWORDS):]] -- ripgrep regex 46 | } 47 | } 48 | todo.setup(SETTINGS) 49 | -------------------------------------------------------------------------------- /lua/plug/toggle.lua: -------------------------------------------------------------------------------- 1 | local t = vim.tbl_add_reverse_lookup({ 2 | 3 | ["true"] = "false", 4 | ["yes"] = "no", 5 | ["on"] = "off", 6 | ["left"] = "right", 7 | ["up"] = "down", 8 | ["1"] = "0", 9 | 10 | ["True"] = "False", 11 | ["Yes"] = "No", 12 | ["On"] = "Off", 13 | ["Left"] = "Right", 14 | ["Up"] = "Down", 15 | }) 16 | 17 | local setup = function(u_tbl) 18 | t = vim.tbl_extend("force", t, vim.tbl_add_reverse_lookup(u_tbl or {})) 19 | end 20 | 21 | local c = { 22 | ["n"] = "norm! ciw", 23 | ["v"] = "norm! c", 24 | } 25 | 26 | local toggle = function() 27 | local i = vim.tbl_get(t, vim.fn.expand("")) 28 | xpcall(function() 29 | vim.cmd(vim.tbl_get(c, vim.api.nvim_get_mode().mode) .. i) 30 | end, function() 31 | print("toggler: unsupported value.") 32 | end) 33 | end 34 | 35 | return { setup = setup, toggle = toggle } 36 | -------------------------------------------------------------------------------- /lua/plug/treesitter.lua: -------------------------------------------------------------------------------- 1 | require'nvim-treesitter.configs'.setup { 2 | -- A list of parser names, or "all" (the four listed parsers should always be installed) 3 | ensure_installed = { "javascript", "python", "cpp", "c", "lua", "vim", "help", "bash", "css", "html", "json", "regex", "rust", "toml", "yaml", "go", "java", "markdown", "typescript", "sql" }, 4 | 5 | -- Install parsers synchronously (only applied to `ensure_installed`) 6 | sync_install = false, 7 | 8 | -- Automatically install missing parsers when entering buffer 9 | -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally 10 | auto_install = true, 11 | 12 | -- List of parsers to ignore installing (for "all") 13 | ignore_install = { }, 14 | 15 | ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) 16 | -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! 17 | 18 | highlight = { 19 | -- `false` will disable the whole extension 20 | enable = true, 21 | 22 | -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to 23 | -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is 24 | -- the name of the parser) 25 | -- list of language that will be disabled 26 | disable = { "rust" }, 27 | -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files 28 | disable = function(lang, buf) 29 | local max_filesize = 100 * 1024 -- 100 KB 30 | local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) 31 | if ok and stats and stats.size > max_filesize then 32 | return true 33 | end 34 | end, 35 | 36 | -- Setting this to true will run `:h syntax` and tree-sitter at the same time. 37 | -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). 38 | -- Using this option may slow down your editor, and you may see some duplicate highlights. 39 | -- Instead of true it can also be a list of languages 40 | additional_vim_regex_highlighting = false, 41 | }, 42 | } 43 | -------------------------------------------------------------------------------- /lua/plug/trouble.lua: -------------------------------------------------------------------------------- 1 | local status_ok, trouble = pcall(require, "trouble") 2 | if not status_ok then return end 3 | 4 | local SETTINGS = { 5 | position = "bottom", -- position of the list can be: bottom, top, left, right 6 | height = 10, -- height of the trouble list when position is top or bottom 7 | width = 50, -- width of the list when position is left or right 8 | icons = true, -- use devicons for filenames 9 | mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" 10 | fold_open = "", -- icon used for open folds 11 | fold_closed = "", -- icon used for closed folds 12 | group = true, -- group results by file 13 | padding = true, -- add an extra new line on top of the list 14 | action_keys = { -- key mappings for actions in the trouble list 15 | -- map to {} to remove a mapping, for example: 16 | -- close = {}, 17 | close = "q", -- close the list 18 | cancel = "", -- cancel the preview and get back to your last window / buffer / cursor 19 | refresh = "r", -- manually refresh 20 | jump = {"", ""}, -- jump to the diagnostic or open / close folds 21 | open_split = {""}, -- open buffer in new split 22 | open_vsplit = {""}, -- open buffer in new vsplit 23 | open_tab = {""}, -- open buffer in new tab 24 | jump_close = {"o"}, -- jump to the diagnostic and close the list 25 | toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode 26 | toggle_preview = "P", -- toggle auto_preview 27 | hover = "K", -- opens a small popup with the full multiline message 28 | preview = "p", -- preview the diagnostic location 29 | close_folds = {"zM", "zm"}, -- close all folds 30 | open_folds = {"zR", "zr"}, -- open all folds 31 | toggle_fold = {"zA", "za"}, -- toggle fold of current file 32 | previous = "k", -- previous item 33 | next = "j" -- next item 34 | }, 35 | indent_lines = true, -- add an indent guide below the fold icons 36 | auto_open = false, -- automatically open the list when you have diagnostics 37 | auto_close = false, -- automatically close the list when you have no diagnostics 38 | auto_preview = true, -- automatically preview the location of the diagnostic. to close preview and go back to last window 39 | auto_fold = false, -- automatically fold a file trouble list at creation 40 | auto_jump = {"lsp_definitions"}, -- for the given modes, automatically jump if there is only a single result 41 | signs = { 42 | -- icons / text used for a diagnostic 43 | error = "", 44 | warning = "", 45 | hint = "", 46 | information = "", 47 | other = "﫠" 48 | }, 49 | use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client 50 | } 51 | 52 | trouble.setup(SETTINGS) 53 | -------------------------------------------------------------------------------- /lua/plug/ts-context.lua: -------------------------------------------------------------------------------- 1 | local status_ok, ts_context = pcall(require, "treesitter-context") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) 8 | max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. 9 | trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' 10 | min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. 11 | patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries. 12 | -- For all filetypes 13 | -- Note that setting an entry here replaces all other patterns for this entry. 14 | -- By setting the 'default' entry below, you can control which nodes you want to 15 | -- appear in the context window. 16 | default = { 17 | 'class', 'function', 'method', 'for', 'while', 'if', 'switch', 'elif', 'case' 18 | }, 19 | -- Patterns for specific filetypes 20 | -- If a pattern is missing, *open a PR* so everyone can benefit. 21 | tex = {'chapter', 'section', 'subsection', 'subsubsection'}, 22 | rust = {'impl_item', 'struct', 'enum'}, 23 | scala = {'object_definition'}, 24 | vhdl = {'process_statement', 'architecture_body', 'entity_declaration'}, 25 | markdown = {'section'}, 26 | elixir = { 27 | 'anonymous_function', 'arguments', 'block', 'do_block', 'list', 28 | 'map', 'tuple', 'quoted_content' 29 | }, 30 | json = {'pair'}, 31 | yaml = {'block_mapping_pair'} 32 | }, 33 | exact_patterns = { 34 | -- Example for a specific filetype with Lua patterns 35 | -- Treat patterns.rust as a Lua pattern (i.e "^impl_item$" will 36 | -- exactly match "impl_item" only) 37 | -- rust = true, 38 | }, 39 | 40 | -- [!] The options below are exposed but shouldn't require your attention, 41 | -- you can safely ignore them. 42 | 43 | zindex = 20, -- The Z-index of the context window 44 | mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline' 45 | -- Separator between context and content. Should be a single character string, like '-'. 46 | -- When separator is set, the context will only show up when there are at least 2 lines above cursorline. 47 | separator = nil 48 | } 49 | 50 | ts_context.setup(SETTINGS) 51 | -------------------------------------------------------------------------------- /lua/plug/ui/bufferline.lua: -------------------------------------------------------------------------------- 1 | local status_ok, bufferline = pcall(require, "bufferline") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | options = { 8 | buffer_close_icon = "", 9 | modified_icon = "", 10 | close_icon = "", 11 | left_trunc_marker = "", 12 | right_trunc_marker = "", 13 | separator_style = "thick", 14 | color_icons = true, 15 | offsets = { 16 | { 17 | filetype = "NvimTree", 18 | text = "File Explorer", 19 | text_align = "center", 20 | separator = false, 21 | }, 22 | }, 23 | }, 24 | } 25 | 26 | bufferline.setup(SETTINGS) 27 | 28 | vim.cmd([[ 29 | nnoremap :BufferLineCycleNext 30 | nnoremap :BufferLineCyclePrev 31 | ]]) 32 | -------------------------------------------------------------------------------- /lua/plug/ui/dashboard.lua: -------------------------------------------------------------------------------- 1 | local status_ok, alpha = pcall(require, "alpha") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local status_ok, dashboard = pcall(require, "alpha.themes.dashboard") 7 | if not status_ok then 8 | return 9 | end 10 | 11 | math.randomseed(os.time()) 12 | local function pick_color() 13 | local colors = {"String", "Identifier", "Keyword", "Number"} 14 | return colors[math.random(#colors)] 15 | end 16 | 17 | local nvim_version_info = "  v" .. vim.version().major .. "." .. vim.version().minor .. "." .. vim.version().patch 18 | 19 | local function button(sc, txt, keybind, keybind_opts) 20 | local b = dashboard.button(sc, txt, keybind, keybind_opts) 21 | b.opts.hl = "AlphaButton" 22 | b.opts.hl_shortcut = "AlphaFooter" 23 | return b 24 | end 25 | 26 | local logo = { 27 | "", "", "", "", "", "", 28 | "███╗ ██╗ ╔██████╗████████╗ █████╗ ██████╗", 29 | "████╗ ██║██╗ ██╗║██╔═══╝╚══██╔══╝██╔══██╗██╔══██╗", 30 | "██╔██╗██║╚██╗ ██╔╝╚█████╗ ██║ ███████║██████╔╝", 31 | "██║╚████║ ╚████╔╝ ╚═══██╗ ██║ ██╔══██║██╔══██╗", 32 | "██║ ╚███║ ╚██╔╝ ██████╔╝ ██║ ██║ ██║██║ ██║", 33 | "╚═╝ ╚══╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝", 34 | "  " .. vim.fn.hostname(), "", 35 | } 36 | 37 | dashboard.section.header.val = logo 38 | dashboard.section.buttons.val = { 39 | button("Leader + fr", " Recent Files" , "Telescope oldfiles"), 40 | button("Ctrl + b" , " File Explorer", "NvimTreeToggle"), 41 | button("Leader + ff", " Find File" , "Telescope find_files"), 42 | button("Leader + fr", " Find Word" , "Telescope live_grep"), 43 | button("Leader + tf", " Open Terminal", "TermExec size=30 direction=float cmd=\"clear\""), 44 | button("q/Q" , " Quit" , ":qa") 45 | } 46 | dashboard.section.footer.val = { 47 | "", "", 48 | "I Dont want to be Horny,", 49 | " I Just wanna be happy. ", 50 | " 🚀 ", 51 | nvim_version_info, "", 52 | } 53 | dashboard.section.header.opts.hl = pick_color() 54 | dashboard.section.footer.opts.hl = pick_color() 55 | 56 | local opts = { 57 | layout = { 58 | {type = "padding", val = 5}, dashboard.section.header, 59 | {type = "padding", val = 3}, dashboard.section.buttons, 60 | {type = "padding", val = 1}, dashboard.section.footer 61 | }, 62 | opts = {margin = 5} 63 | } 64 | alpha.setup(dashboard.opts) 65 | 66 | vim.cmd([[ autocmd FileType alpha setlocal nofoldenable]]) 67 | vim.api.nvim_create_augroup("alpha_tabline", {clear = true}) 68 | vim.api.nvim_create_autocmd("FileType", { 69 | group = "alpha_tabline", 70 | pattern = "alpha", 71 | command = "set showtabline=0 laststatus=0 noruler" 72 | }) 73 | vim.api.nvim_create_autocmd("FileType", { 74 | group = "alpha_tabline", 75 | pattern = "alpha", 76 | callback = function() 77 | vim.api.nvim_create_autocmd("BufUnload", { 78 | group = "alpha_tabline", 79 | buffer = 0, 80 | command = "set showtabline=2 ruler laststatus=3" 81 | }) 82 | end 83 | }) 84 | -------------------------------------------------------------------------------- /lua/plug/ui/git-sign.lua: -------------------------------------------------------------------------------- 1 | local status_ok, gitsigns = pcall(require, "gitsigns") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | signs = { 8 | add = { 9 | hl = "GitSignsAdd", 10 | text = "▎", 11 | numhl = "GitSignsAddNr", 12 | linehl = "GitSignsAddLn" 13 | }, 14 | change = { 15 | hl = "GitSignsChange", 16 | text = "▎", 17 | numhl = "GitSignsChangeNr", 18 | linehl = "GitSignsChangeLn" 19 | }, 20 | delete = { 21 | hl = "GitSignsDelete", 22 | text = "契", 23 | numhl = "GitSignsDeleteNr", 24 | linehl = "GitSignsDeleteLn" 25 | }, 26 | topdelete = { 27 | hl = "GitSignsDelete", 28 | text = "契", 29 | numhl = "GitSignsDeleteNr", 30 | linehl = "GitSignsDeleteLn" 31 | }, 32 | changedelete = { 33 | hl = "GitSignsChange", 34 | text = "▎", 35 | numhl = "GitSignsChangeNr", 36 | linehl = "GitSignsChangeLn" 37 | } 38 | }, 39 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` 40 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` 41 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` 42 | word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` 43 | watch_gitdir = {interval = 1000, follow_files = true}, 44 | attach_to_untracked = true, 45 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` 46 | current_line_blame_opts = { 47 | virt_text = true, 48 | virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' 49 | delay = 1000, 50 | ignore_whitespace = false 51 | }, 52 | current_line_blame_formatter_opts = {relative_time = false}, 53 | sign_priority = 6, 54 | update_debounce = 100, 55 | status_formatter = nil, -- Use default 56 | max_file_length = 40000, 57 | yadm = {enable = false}, 58 | preview_config = { 59 | -- Options passed to nvim_open_win 60 | border = "single", 61 | style = "minimal", 62 | relative = "cursor", 63 | row = 0, 64 | col = 1 65 | }, 66 | } 67 | 68 | gitsigns.setup(SETTINGS) 69 | -------------------------------------------------------------------------------- /lua/plug/ui/indentscope.lua: -------------------------------------------------------------------------------- 1 | -- { 2 | -- "echasnovski/mini.indentscope", 3 | -- version = false, -- wait till new 0.7.0 release to put it back on semver 4 | -- event = { "BufReadPre", "BufNewFile" }, 5 | -- opts = { 6 | -- -- symbol = "▏", 7 | -- symbol = "│", 8 | -- options = { try_as_border = true }, 9 | -- }, 10 | -- config = function(_, opts) 11 | -- vim.api.nvim_create_autocmd("FileType", { 12 | -- pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" }, 13 | -- callback = function() 14 | -- vim.b.miniindentscope_disable = true 15 | -- end, 16 | -- }) 17 | -- require("mini.indentscope").setup(opts) 18 | -- end, 19 | -- }, 20 | local status_ok, indent = pcall(require, "mini.indentscope") 21 | if not status_ok then return end 22 | 23 | vim.api.nvim_create_autocmd("FileType", { 24 | pattern = { 25 | "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" 26 | }, 27 | callback = function() vim.b.miniindentscope_disable = true end 28 | }) 29 | 30 | local SETTINGS = { 31 | -- symbol = "▏", 32 | symbol = "│", 33 | options = {try_as_border = true} 34 | } 35 | 36 | indent.setup(SETTINGS) 37 | -------------------------------------------------------------------------------- /lua/plug/ui/init.lua: -------------------------------------------------------------------------------- 1 | local impatient_ok, impatient = pcall(require, "impatient") 2 | if impatient_ok then 3 | impatient.enable_profile() 4 | end 5 | 6 | local status_ok, notify = pcall(require, "notify") 7 | if not status_ok then 8 | return 9 | end 10 | 11 | for _, source in ipairs({ 12 | 13 | "plug.ui.notify", 14 | "plug.ui.dashboard", 15 | "plug.ui.bufferline", 16 | "plug.ui.git-sign", 17 | "plug.ui.minimap", 18 | "plug.ui.statusline", 19 | "plug.ui.indentscope", 20 | -- "plug.ui.noice", 21 | 22 | }) do 23 | local status_ok, fault = pcall(require, source) 24 | if not status_ok then 25 | local err = "Failed to load " .. source .. "\n\n" .. fault 26 | notify(err, "error", {title = "Require Error"}) 27 | end 28 | end 29 | 30 | vim.cmd([[set showtabline=0]]) -------------------------------------------------------------------------------- /lua/plug/ui/minimap.lua: -------------------------------------------------------------------------------- 1 | local status_ok, minimap = pcall(require, "codewindow") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | minimap_width = 15, -- The width of the text part of the minimap 8 | width_multiplier = 4, -- How many characters one dot represents 9 | use_lsp = true, -- Use the builtin LSP to show errors and warnings 10 | use_treesitter = true, -- Use nvim-treesitter to highlight the code 11 | exclude_filetypes = {}, -- Choose certain filetypes to not show minimap on 12 | z_index = 1, -- The z-index the floating window will be on 13 | max_minimap_height = nil, -- The maximum height the minimap can take (including borders) 14 | } 15 | 16 | minimap.setup(SETTINGS) 17 | minimap.apply_default_keybinds() 18 | -------------------------------------------------------------------------------- /lua/plug/ui/noice.lua: -------------------------------------------------------------------------------- 1 | local status_ok, noice = pcall(require, "noice") 2 | if not status_ok then return end 3 | 4 | local SETTINGS = { 5 | cmdline = { 6 | enabled = true, -- enables the Noice cmdline UI 7 | view = "cmdline", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom 8 | opts = { buf_options = { filetype = "vim" } }, -- enable syntax highlighting in the cmdline 9 | ---@type table 10 | format = { 11 | -- conceal: (default=true) This will hide the text in the cmdline that matches the pattern. 12 | -- view: (default is cmdline view) 13 | -- opts: any options passed to the view 14 | -- icon_hl_group: optional hl_group for the icon 15 | cmdline = { pattern = "^:", icon = "" }, 16 | search_down = { kind = "search", pattern = "^/", icon = " ", ft = "regex" }, 17 | search_up = { kind = "search", pattern = "^%?", icon = " ", ft = "regex" }, 18 | filter = { pattern = "^:%s*!", icon = "$", ft = "sh" }, 19 | lua = { pattern = "^:%s*lua%s+", icon = "", ft = "lua" }, 20 | -- lua = false, -- to disable a format, set to `false` 21 | }, 22 | }, 23 | messages = { 24 | -- NOTE: If you enable messages, then the cmdline is enabled automatically. 25 | -- This is a current Neovim limitation. 26 | enabled = true, -- enables the Noice messages UI 27 | view = "notify", -- default view for messages 28 | view_error = "notify", -- view for errors 29 | view_warn = "notify", -- view for warnings 30 | view_history = "split", -- view for :messages 31 | view_search = "virtualtext", -- view for search count messages. Set to `false` to disable 32 | }, 33 | popupmenu = { 34 | enabled = false, -- enables the Noice popupmenu UI 35 | ---@type 'nui'|'cmp' 36 | backend = "nui", -- backend to use to show regular cmdline completions 37 | }, 38 | ---@type NoiceRouteConfig 39 | history = { 40 | -- options for the message history that you get with `:Noice` 41 | view = "split", 42 | opts = { enter = true, format = "details" }, 43 | filter = { event = { "msg_show", "notify" }, ["not"] = { kind = { "search_count", "echo" } } }, 44 | }, 45 | notify = { 46 | -- Noice can be used as `vim.notify` so you can route any notification like other messages 47 | -- Notification messages have their level and other properties set. 48 | -- event is always "notify" and kind can be any log level as a string 49 | -- The default routes will forward notifications to nvim-notify 50 | -- Benefit of using Noice for this is the routing and consistent history view 51 | enabled = true, 52 | view = "notify", 53 | }, 54 | lsp_progress = { 55 | enabled = true, 56 | -- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin 57 | -- See the section on formatting for more details on how to customize. 58 | --- @type NoiceFormat|string 59 | format = "lsp_progress", 60 | --- @type NoiceFormat|string 61 | format_done = "lsp_progress_done", 62 | throttle = 1000 / 30, -- frequency to update lsp progress message 63 | view = "mini", 64 | }, 65 | throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode. 66 | ---@type NoiceConfigViews 67 | views = {}, ---@see section on views 68 | ---@type NoiceRouteConfig[] 69 | routes = {}, --- @see section on routes 70 | ---@type table 71 | status = {}, --- @see section on statusline components 72 | ---@type NoiceFormatOptions 73 | format = {}, --- @see section on formatting 74 | } 75 | 76 | noice.setup(SETTINGS) -------------------------------------------------------------------------------- /lua/plug/ui/notify.lua: -------------------------------------------------------------------------------- 1 | local status_ok, notify = pcall(require, "notify") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | icons = { 8 | DEBUG = "  ", 9 | ERROR = "  ", 10 | WARN = "  ", 11 | TRACE = "  ", 12 | INFO = "  " 13 | }, 14 | fps = 60, 15 | max_height = 5, 16 | max_widht = 10, 17 | render = "minimal", 18 | background_colour = "#000000", 19 | } 20 | 21 | notify.setup(SETTINGS) 22 | -------------------------------------------------------------------------------- /lua/plug/ui/statusline.lua: -------------------------------------------------------------------------------- 1 | local status_ok, staline = pcall(require, "staline") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local SETTINGS = { 7 | defaults = { 8 | expand_null_ls = false, -- This expands out all the null-ls sources to be shown 9 | left_separator = " ", 10 | right_separator = "", 11 | full_path = false, 12 | line_column = "[%l/%L] :%c", 13 | inactive_color = "#212126", 14 | inactive_bgcolor = "none", 15 | true_colors = true, -- true lsp colors. 16 | font_active = "none", -- "bold", "italic", "bold,italic", etc 17 | mod_symbol = "*", 18 | lsp_client_symbol = "", 19 | branch_symbol = " ", 20 | cool_symbol = "  ", -- Change this to override default OS icon. 21 | null_ls_symbol = "" -- A symbol to indicate that a source is coming from null-ls 22 | -- fg = "#0f0f0f", -- Foreground text color. 23 | -- bg = "#0f0f0f", -- Default background is transparent. 24 | }, 25 | mode_colors = { 26 | n = "#6d92b7", 27 | i = "#74be88", 28 | c = "#da696d", 29 | V = "#e1b56a", 30 | v = "#e1b56a" 31 | 32 | }, 33 | mode_icons = { 34 | n = "  NORMAL ", 35 | i = "  INSERT ", 36 | c = "  COMMAND ", 37 | V = "  SELECT", 38 | v = "  BLOCK " 39 | }, 40 | sections = { 41 | left = { 42 | -- '-mode', 'left_sep_double', 43 | {'StalineFilename', 'file_name'}, 44 | {"StalineBranch", "branch"}, ' ', 'lsp' 45 | }, 46 | mid = {' '}, 47 | right = { 48 | ' ' 49 | -- {'StalineLogo', 'cool_symbol'}, {'StalineFolderSep', 'right_sep'}, 50 | -- {'StalineFolderIcon', ' '}, {'StalineFolderText', 'cwd'}, ' ', 51 | -- {"StalineProgressSep", 'right_sep'}, 52 | -- {"StalineProgressSepIcon", '  '}, 53 | -- {'StalineProgress', 'line_column'} 54 | } 55 | }, 56 | special_table = { 57 | NvimTree = {'NvimTree', ' '}, 58 | packer = {'Packer', ' '}, 59 | toggleterm = {'Terminal', " "} -- etc 60 | }, 61 | lsp_symbols = { 62 | Error = "  ", 63 | Info = "  ", 64 | Warn = "  ", 65 | Hint = "  " 66 | } 67 | } 68 | 69 | staline.setup(SETTINGS) 70 | --------------------------------------------------------------------------------