-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
182 additions
and
149 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import { | ||
ActionGroupBuilder, | ||
Plugin, | ||
PluginOptsBase, | ||
andActions, | ||
} from "@core/model"; | ||
|
||
const spec: PluginOptsBase = { | ||
shortUrl: "dnlhc/glance.nvim", | ||
lazy: { | ||
lazy: true, | ||
cmd: ["Glance"], | ||
config: () => { | ||
let glance = luaRequire("glance"); | ||
let actions = glance.actions; | ||
|
||
glance.setup({ | ||
detached: (winid: number) => { | ||
return vim.api.nvim_win_get_width(winid) < 100; | ||
}, | ||
preview_win_opts: { cursorline: true, number: true, wrap: false }, | ||
border: { disable: true, top_char: "―", bottom_char: "―" }, | ||
theme: { enable: true }, | ||
list: { width: 0.2 }, | ||
mappings: { | ||
list: { | ||
["j"]: actions.next, | ||
["k"]: actions.previous, | ||
["<Down>"]: false, | ||
["<Up>"]: false, | ||
["<Tab>"]: actions.next_location, | ||
["<S-Tab>"]: actions.previous_location, | ||
["<C-u>"]: actions.preview_scroll_win(5), | ||
["<C-d>"]: actions.preview_scroll_win(-5), | ||
["v"]: false, | ||
["s"]: false, | ||
["t"]: false, | ||
["<CR>"]: actions.jump, | ||
["o"]: false, | ||
["<leader>l"]: false, | ||
["q"]: actions.close, | ||
["Q"]: actions.close, | ||
["<Esc>"]: actions.close, | ||
}, | ||
preview: { | ||
["Q"]: actions.close, | ||
["<Tab>"]: false, | ||
["<S-Tab>"]: false, | ||
["<leader>l"]: false, | ||
}, | ||
}, | ||
folds: { fold_closed: "", fold_open: "", folded: false }, | ||
indent_lines: { enable: false }, | ||
winbar: { enable: true }, | ||
hooks: { | ||
before_open: ( | ||
results: any[], | ||
open: any, | ||
jump: any, | ||
method: string | ||
) => { | ||
if (method === "references" || method === "implementations") { | ||
open(results); | ||
} else if (results.length === 1) { | ||
jump(results[0]); | ||
} else { | ||
open(results); | ||
} | ||
}, | ||
}, | ||
}); | ||
}, | ||
}, | ||
}; | ||
|
||
function generateActions() { | ||
return ActionGroupBuilder.start() | ||
.category("LSP") | ||
.from("glance.nvim") | ||
.condition((buf) => { | ||
return buf.lspServers.length > 0; | ||
}) | ||
.addOpts({ | ||
id: "glance.goto-definition", | ||
title: "Goto definition", | ||
callback: () => { | ||
luaRequire("glance").open("definitions"); | ||
}, | ||
}) | ||
.addOpts({ | ||
id: "glance.goto-implementation", | ||
title: "Goto implementation", | ||
callback: () => { | ||
luaRequire("glance").open("implementations"); | ||
}, | ||
}) | ||
.addOpts({ | ||
id: "glance.goto-type-definition", | ||
title: "Goto type definition", | ||
callback: () => { | ||
luaRequire("glance").open("type_definitions"); | ||
}, | ||
}) | ||
.addOpts({ | ||
id: "glance.goto-reference", | ||
title: "Goto reference", | ||
callback: () => { | ||
luaRequire("glance").open("references"); | ||
}, | ||
}) | ||
.build(); | ||
} | ||
|
||
export const plugin = new Plugin(andActions(spec, generateActions)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import { plugin as mason } from "./mason"; | ||
import { plugin as aerial } from "./aerial"; | ||
import { plugin as typescriptToolsNvim } from "./typescript-tools-nvim"; | ||
import { plugin as glanceNvim } from "./glance-nvim"; | ||
import { plugin as lspkindNvim } from "./lspkind-nvim"; | ||
|
||
export const plugins = [mason, aerial, typescriptToolsNvim] as const; | ||
export const plugins = [ | ||
mason, | ||
aerial, | ||
typescriptToolsNvim, | ||
glanceNvim, | ||
lspkindNvim, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Plugin, PluginOptsBase } from "@core/model"; | ||
|
||
const spec: PluginOptsBase = { | ||
shortUrl: "onsails/lspkind.nvim", | ||
lazy: { | ||
lazy: true, | ||
dependencies: ["nvim-tree/nvim-web-devicons"], | ||
config: true, | ||
opts: { | ||
mode: "symbol_text", | ||
symbol_map: { | ||
Array: "", | ||
Boolean: "", | ||
Class: "", | ||
Color: "", | ||
Constant: "", | ||
Constructor: "", | ||
Enum: "", | ||
EnumMember: "", | ||
Event: "", | ||
Field: "", | ||
File: "", | ||
Folder: "", | ||
Function: "", | ||
Interface: "", | ||
Key: "", | ||
Keyword: "", | ||
Method: "", | ||
Module: "", | ||
Namespace: "", | ||
Null: "", | ||
Number: "", | ||
Object: "", | ||
Operator: "", | ||
Package: "", | ||
Property: "", | ||
Reference: "", | ||
Snippet: "", | ||
String: "", | ||
Struct: "", | ||
Text: "", | ||
TypeParameter: "", | ||
Unit: "", | ||
Value: "", | ||
Variable: "", | ||
Copilot: "", | ||
Codeium: "", | ||
Math: "", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const plugin = new Plugin(spec); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters