Skip to content

Commit e13094f

Browse files
committed
some presentation stuffs
1 parent 8d56cc3 commit e13094f

10 files changed

Lines changed: 468 additions & 2 deletions

File tree

presentations/lua_snip_1.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Video 1 - Getting Start
2+
3+
- Explain what a snippet is.
4+
- Show two example snippets:
5+
- one really simple one (like expanding a func -> func()\n{...}
6+
- tree sitter one, to motivate where we could end up.
7+
- keymaps
8+
- explain keymaps
9+
- vim.keymap style would be cool
10+
- basic options
11+
- Adding snippets:
12+
- Show simple text snippets
13+
- lsp.parse
14+
- `TM_FILENAME` expansions
15+
- Create your own lua snippets
16+
- `s("trigger", {nodes...})`
17+
- Text Node
18+
- Insert Node
19+
- fmt("...", { nodes...})
20+
21+
Outro: https://www.youtube.com/results?search_query=angry+kylo+ren
22+
Outro: https://www.youtube.com/watch?v=grtJjUmkJmk
23+
24+
-----------------------------------
25+
26+
# Video 2 - Advanced Features
27+
28+
- function nodes
29+
- choice nodes
30+
- snippet nodes
31+
- dynamic node
32+
33+
```lua
34+
-- in a lua file: search lua-, then c-, then all-snippets.
35+
ls.filetype_extend("lua", { "c" })
36+
37+
-- in a cpp file: search c-snippets, then all-snippets only (no cpp-snippets!!).
38+
ls.filetype_set("cpp", { "c" })
39+
```
40+
41+
# Video 3 - Show off how cool it can be
42+
43+
- treesitter based golang snippet
44+
- $$ (.*) snippet
45+
46+
47+
# Notes
48+
- luasnip telescope integ: https://github.com/benfowler/telescope-luasnip.nvim || https://github.com/abzcoding/lvim/tree/main/lua/telescope/_extensions

presentations/luasnip/advanced.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package introduction
2+
3+
// Show example of much more complicated expansion
4+
func MyFunc(x, y string) (string, bool, error) {
5+
var combined string
6+
7+
combined, err := OtherFunc(x, y)
8+
if err != nil {
9+
return "", false, errors.Wrap(err, "OtherFunc")
10+
}
11+
12+
combined, err := OtherFunc(x, y)
13+
if err != nil {
14+
return "", false, err
15+
}
16+
17+
18+
return combined, true, nil
19+
}
20+
21+
// Silly function that doesn't do anything useful
22+
func OtherFunc(x, y string) (string, error) {
23+
return x + y, nil
24+
}

presentations/luasnip/intro.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package introduction
2+
3+
// Show example of simple function expansion
4+
func Example(x, y string) string {
5+
return x + "," + y
6+
}
7+
8+
func AnotherExample(x, y string) string {
9+
return x + "," + y
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
debug/
4+
target/
5+
6+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
7+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8+
Cargo.lock
9+
10+
# These are backup files generated by rustfmt
11+
**/*.rs.bk
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "bragging"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#![allow(dead_code)]
2+
3+
fn main() {
4+
println!("Hello, world!");
5+
}
6+
7+
fn kindof_double_example(val: i32) -> i32 {
8+
// haha got you end user.
9+
if val == 5 {
10+
return 5;
11+
}
12+
return val * 2;
13+
}
14+
15+
#[cfg(test)]
16+
mod test {
17+
use super::*;
18+
19+
#[test]
20+
fn show_this_func_pass() {
21+
assert_eq!(6, kindof_double_example(3))
22+
}
23+
24+
#[test]
25+
fn show_this_func_fail() {
26+
let x = kindof_double_example(5);
27+
let expected = 6;
28+
assert_eq!(expected, x)
29+
}
30+
}

presentations/pde/go/main.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package main
2+
3+
import (
4+
"errors"
5+
"fmt"
6+
)
7+
8+
func main() {
9+
fmt.Println("Hello", (func() int {
10+
// Overally complicated just to show treesitter :)
11+
ret, _, _, _ := (func() (int, error, string, int) {
12+
value := 0
13+
14+
value, err := exampleFunction()
15+
if err != nil {
16+
return 0, err, "", 0
17+
}
18+
19+
return value, errors.New("hello world"), "", 0
20+
})()
21+
22+
return ret
23+
})(), "Another")
24+
}
25+
26+
func exampleFunction() (int, error) {
27+
return 5, nil
28+
}
29+
30+
func anotherFunction() int {
31+
x, _ := exampleFunction()
32+
return x
33+
}

presentations/pde/presentation.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
title: PDE
3+
author: TJ DeVries (twitch.tv/teej_dv)
4+
date: 2022-02-10
5+
---
6+
7+
- TODO: Consider re-recording as a ted talk
8+
9+
# PDE
10+
11+
# Intro
12+
13+
- Who am I?
14+
- [tjdevries](https://github.com/tjdevries)
15+
- Neovim core member
16+
- Telescope.nvim author
17+
- [Twitch](twitch.tv/teej_dv): `teej_dv`
18+
- [YouTube](youtube.com/c/TjDeVries): `TjDeVries`
19+
20+
21+
# PDE?
22+
23+
Personalized Development Environment
24+
25+
# PDE
26+
27+
> Text Editor <-> IDE
28+
29+
- The above seems like too limited of a spectrum.
30+
- It seems to confuse people (especially those who have never tried something like neovim) as to what the purpose would be of using them.
31+
32+
# PDE
33+
34+
> Text Editor <-> PDE <-> IDE
35+
36+
Something in between Text Editor and IDE I think could be useful to add to our vocabulary
37+
38+
# PDE
39+
40+
## Requirements
41+
42+
> Some assembly required
43+
44+
# PDE
45+
46+
## Requirements
47+
48+
- Coding "basics":
49+
- Syntax highlighting
50+
- Folding
51+
- (basically just not Notepad...)
52+
53+
# PDE
54+
55+
## Requirements
56+
57+
- Coding "basics":
58+
- Syntax highlighting
59+
- Folding
60+
- (basically just not Notepad...)
61+
- Code Intelligence
62+
- For example: LSP
63+
- (Can be builtin or plugin)
64+
65+
# PDE
66+
67+
## Requirements
68+
69+
- Coding "basics":
70+
- Syntax highlighting
71+
- Folding
72+
- (basically just not Notepad...)
73+
- Code Intelligence
74+
- For example: LSP
75+
- (Can be builtin or plugin)
76+
- PDE provides:
77+
- Composition of tools
78+
- Scriptable & Extensible
79+
80+
# PDE
81+
82+
## Requirements
83+
84+
- YOU ARE HAVING FUN!
85+
86+
_side rant about "faster" as an argument for a tool_
87+
88+
89+
# Neovim as PDE
90+
91+
It can do syntax highlighting, folding, movements, editing files, etc.
92+
93+
I don't think that's really contested by anyone, not even the `ackshually` crowd.
94+
95+
# Neovim as PDE
96+
97+
- API
98+
- Exposes robust api (`:help api`)
99+
100+
```lua
101+
vim.api.nvim_buf_set_lines(0, 0, -1, false, {
102+
"First Line",
103+
"Second Line"
104+
})
105+
```
106+
107+
# Neovim as PDE
108+
109+
- Lua-ify Everything
110+
- Settings
111+
- Keymaps
112+
- Commands
113+
- Autocmds (soon)
114+
- etc.
115+
116+
Scripting is configuration. Configuration is scripting.
117+
118+
# Neovim as PDE
119+
120+
- Treesitter
121+
- Syntax highlighting
122+
- But so much more than syntax highlighting!
123+
124+
# Neovim as PDE
125+
126+
- Builtin LSP
127+
128+
# Neovim as PDE
129+
130+
- nvim-dap
131+
- vimspector

0 commit comments

Comments
 (0)