Skip to content

Commit

Permalink
docs: update local AI usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Dung Huynh Duc committed Jul 25, 2024
1 parent bb103e2 commit 575148e
Showing 1 changed file with 48 additions and 50 deletions.
98 changes: 48 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ Update your settings.json file with the following configuration:
// use relative line numbers
"relative_line_numbers": true,
"tab_bar": {
"show": true
"show": true,
},
"scrollbar": {
"show": "never"
"show": "never",
},
// Indentation, rainbow indentation
"indent_guides": {
"enabled": true,
"coloring": "indent_aware"
"coloring": "indent_aware",
},
// NOTE: Zen mode, refer https://github.com/zed-industries/zed/issues/4382 when it's resolved
"centered_layout": {
"left_padding": 0.2,
"right_padding": 0.2
"right_padding": 0.2,
},
// Local AI with Ollama, refer https://zed.dev/docs/language-model-integration?highlight=ollama#using-ollama-on-macos
"assistant": {
Expand All @@ -76,27 +76,27 @@ Update your settings.json file with the following configuration:
"default_model": {
"name": "gpt-4-turbo-preview:latest",
"max_tokens": 2048,
"keep_alive": -1
"keep_alive": -1,
},
"name": "ollama"
}
"name": "ollama",
},
},
"language_models": {
"ollama": {
"api_url": "http://localhost:11434"
}
"api_url": "http://localhost:11434",
},
},
// Inlay hints preconfigured by Zed: Go, Rust, Typescript and Svelte
"inlay_hints": {
"enabled": true
"enabled": true,
},
// LSP
"lsp": {
"tailwindcss-language-server": {
"settings": {
"classAttributes": ["class", "className", "ngClass", "styles"]
}
}
"classAttributes": ["class", "className", "ngClass", "styles"],
},
},
},
"languages": {
// Refer https://zed.dev/docs/languages/javascript and https://zed.dev/docs/languages/typescript for more info
Expand All @@ -106,40 +106,39 @@ Update your settings.json file with the following configuration:
"enabled": true,
"show_parameter_hints": false,
"show_other_hints": true,
"show_type_hints": true
}
}
"show_type_hints": true,
},
},
},
// Use zed commit editor
"terminal": {
"env": {
"EDITOR": "zed --wait"
}
"EDITOR": "zed --wait",
},
},
// File syntax highlighting
"file_types": {
"Dockerfile": ["Dockerfile", "Dockerfile.*"],
"JSON": ["json", "jsonc", "*.code-snippets"]
"JSON": ["json", "jsonc", "*.code-snippets"],
},
// Turn off telemetry
"telemetry": {
"diagnostics": false,
"metrics": false
"metrics": false,
},
// Move all panel to the right
"project_panel": {
"button": true,
"dock": "right",
"git_status": true
"git_status": true,
},
"outline_panel": {
"dock": "right"
"dock": "right",
},
"collaboration_panel": {
"dock": "right"
}
"dock": "right",
},
}

```

<!-- ALL-SETTINGS:END -->
Expand Down Expand Up @@ -183,8 +182,8 @@ Update your keymap.json file with the following key bindings:
// Search word under cursor
"space s w": "pane::DeploySearch",
// Go to file with `gf`
"g f": "editor::OpenExcerpts"
}
"g f": "editor::OpenExcerpts",
},
},
{
"context": "Editor && vim_mode == normal && !VimWaiting && !menu",
Expand Down Expand Up @@ -241,8 +240,8 @@ Update your keymap.json file with the following key bindings:
"space space": "file_finder::Toggle",
// TODO: Open other files
// Show project panel with current file
"space e": "pane::RevealInProjectPanel"
}
"space e": "pane::RevealInProjectPanel",
},
},
// Empty pane, set of keybindings that are available when there is no active editor
{
Expand All @@ -251,50 +250,50 @@ Update your keymap.json file with the following key bindings:
// Open file finder
"space space": "file_finder::Toggle",
// Open recent project
"space f p": "projects::OpenRecent"
}
"space f p": "projects::OpenRecent",
},
},
// Comment code
{
"context": "Editor && vim_mode == visual && !VimWaiting && !menu",
"bindings": {
// visual, visual line & visual block modes
"g c": "editor::ToggleComments"
}
"g c": "editor::ToggleComments",
},
},
// Better escape
{
"context": "Editor && vim_mode == insert && !menu",
"bindings": {
"j j": "vim::NormalBefore" // remap jj in insert mode to escape
}
"j j": "vim::NormalBefore", // remap jj in insert mode to escape
},
},
// Rename
{
"context": "Editor && vim_operator == c",
"bindings": {
"c": "vim::CurrentLine",
"r": "editor::Rename" // zed specific
}
"r": "editor::Rename", // zed specific
},
},
// Code Action
{
"context": "Editor && vim_operator == c",
"bindings": {
"c": "vim::CurrentLine",
"a": "editor::ToggleCodeActions" // zed specific
}
"a": "editor::ToggleCodeActions", // zed specific
},
},
// Toggle terminal
{
"context": "Workspace",
"bindings": {
"ctrl-\\": "terminal_panel::ToggleFocus"
}
"ctrl-\\": "terminal_panel::ToggleFocus",
},
},
{
"context": "Terminal",
"bindings": {}
"bindings": {},
},
// File panel (netrw)
{
Expand All @@ -309,8 +308,8 @@ Update your keymap.json file with the following key bindings:
"p": "project_panel::Paste",
// Close project panel as project file panel on the right
"q": "workspace::ToggleRightDock",
"space e": "workspace::ToggleRightDock"
}
"space e": "workspace::ToggleRightDock",
},
},
// Panel nagivation
{
Expand All @@ -319,16 +318,16 @@ Update your keymap.json file with the following key bindings:
"ctrl-w h": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-w k": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-w j": ["workspace::ActivatePaneInDirection", "Down"]
}
"ctrl-w j": ["workspace::ActivatePaneInDirection", "Down"],
},
},
{
"context": "Workspace",
"bindings": {
// Map VSCode like keybindings
"cmd-b": "workspace::ToggleRightDock"
}
}
"cmd-b": "workspace::ToggleRightDock",
},
},
// Subword motion is not working really nice with `ciw`, disable for now
// {
// "context": "VimControl && !menu",
Expand All @@ -340,7 +339,6 @@ Update your keymap.json file with the following key bindings:
// }
// }
]

```

<!-- ALL-KEYMAPS:END -->
Expand Down

0 comments on commit 575148e

Please sign in to comment.