1
1
if not vim .g .vscode then return {} end -- don't do anything in non-vscode instances
2
2
3
3
-- Set `vim.notify` to VS Code notifications
4
- vim .notify = require (" vscode-neovim " ).notify
4
+ vim .notify = require (" vscode" ).notify
5
5
6
6
local enabled = {}
7
7
vim .tbl_map (function (plugin ) enabled [plugin ] = true end , {
@@ -55,21 +55,21 @@ return {
55
55
local maps = assert (opts .mappings )
56
56
57
57
-- basic actions
58
- maps .n [" <Leader>q" ] = function () require (" vscode-neovim " ).action " workbench.action.closeWindow" end
59
- maps .n [" <Leader>w" ] = function () require (" vscode-neovim " ).action " workbench.action.files.save" end
60
- maps .n [" <Leader>n" ] = function () require (" vscode-neovim " ).action " welcome.showNewFileEntries" end
58
+ maps .n [" <Leader>q" ] = function () require (" vscode" ).action " workbench.action.closeWindow" end
59
+ maps .n [" <Leader>w" ] = function () require (" vscode" ).action " workbench.action.files.save" end
60
+ maps .n [" <Leader>n" ] = function () require (" vscode" ).action " welcome.showNewFileEntries" end
61
61
62
62
-- splits navigation
63
- maps .n [" |" ] = function () require (" vscode-neovim " ).action " workbench.action.splitEditor" end
64
- maps .n [" \\ " ] = function () require (" vscode-neovim " ).action " workbench.action.splitEditorDown" end
65
- maps .n [" <C-H>" ] = function () require (" vscode-neovim " ).action " workbench.action.navigateLeft" end
66
- maps .n [" <C-J>" ] = function () require (" vscode-neovim " ).action " workbench.action.navigateDown" end
67
- maps .n [" <C-K>" ] = function () require (" vscode-neovim " ).action " workbench.action.navigateUp" end
68
- maps .n [" <C-L>" ] = function () require (" vscode-neovim " ).action " workbench.action.navigateRight" end
63
+ maps .n [" |" ] = function () require (" vscode" ).action " workbench.action.splitEditor" end
64
+ maps .n [" \\ " ] = function () require (" vscode" ).action " workbench.action.splitEditorDown" end
65
+ maps .n [" <C-H>" ] = function () require (" vscode" ).action " workbench.action.navigateLeft" end
66
+ maps .n [" <C-J>" ] = function () require (" vscode" ).action " workbench.action.navigateDown" end
67
+ maps .n [" <C-K>" ] = function () require (" vscode" ).action " workbench.action.navigateUp" end
68
+ maps .n [" <C-L>" ] = function () require (" vscode" ).action " workbench.action.navigateRight" end
69
69
70
70
-- terminal
71
- maps .n [" <F7>" ] = function () require (" vscode-neovim " ).action " workbench.action.terminal.toggleTerminal" end
72
- maps .n [" <C-'>" ] = function () require (" vscode-neovim " ).action " workbench.action.terminal.toggleTerminal" end
71
+ maps .n [" <F7>" ] = function () require (" vscode" ).action " workbench.action.terminal.toggleTerminal" end
72
+ maps .n [" <C-'>" ] = function () require (" vscode" ).action " workbench.action.terminal.toggleTerminal" end
73
73
74
74
-- buffer management
75
75
maps .n [" ]b" ] = " <Cmd>Tabnext<CR>"
@@ -79,44 +79,44 @@ return {
79
79
maps .n [" <Leader>bp" ] = " <Cmd>Tablast<CR>"
80
80
81
81
-- file explorer
82
- maps .n [" <Leader>e" ] = function () require (" vscode-neovim " ).action " workbench.files.action.focusFilesExplorer" end
83
- maps .n [" <Leader>o" ] = function () require (" vscode-neovim " ).action " workbench.files.action.focusFilesExplorer" end
82
+ maps .n [" <Leader>e" ] = function () require (" vscode" ).action " workbench.files.action.focusFilesExplorer" end
83
+ maps .n [" <Leader>o" ] = function () require (" vscode" ).action " workbench.files.action.focusFilesExplorer" end
84
84
85
85
-- indentation
86
- maps .v [" <Tab>" ] = function () require (" vscode-neovim " ).action " editor.action.indentLines" end
87
- maps .v [" <S-Tab>" ] = function () require (" vscode-neovim " ).action " editor.action.outdentLines" end
86
+ maps .v [" <Tab>" ] = function () require (" vscode" ).action " editor.action.indentLines" end
87
+ maps .v [" <S-Tab>" ] = function () require (" vscode" ).action " editor.action.outdentLines" end
88
88
89
89
-- diagnostics
90
- maps .n [" ]d" ] = function () require (" vscode-neovim " ).action " editor.action.marker.nextInFiles" end
91
- maps .n [" [d" ] = function () require (" vscode-neovim " ).action " editor.action.marker.prevInFiles" end
90
+ maps .n [" ]d" ] = function () require (" vscode" ).action " editor.action.marker.nextInFiles" end
91
+ maps .n [" [d" ] = function () require (" vscode" ).action " editor.action.marker.prevInFiles" end
92
92
93
93
-- pickers (emulate telescope mappings)
94
94
maps .n [" <Leader>fc" ] = function ()
95
- require (" vscode-neovim " ).action (" workbench.action.findInFiles" , { args = { query = vim .fn .expand " <cword>" } })
95
+ require (" vscode" ).action (" workbench.action.findInFiles" , { args = { query = vim .fn .expand " <cword>" } })
96
96
end
97
- maps .n [" <Leader>fC" ] = function () require (" vscode-neovim " ).action " workbench.action.showCommands" end
98
- maps .n [" <Leader>ff" ] = function () require (" vscode-neovim " ).action " workbench.action.quickOpen" end
99
- maps .n [" <Leader>fn" ] = function () require (" vscode-neovim " ).action " notifications.showList" end
100
- maps .n [" <Leader>fo" ] = function () require (" vscode-neovim " ).action " workbench.action.openRecent" end
101
- maps .n [" <Leader>ft" ] = function () require (" vscode-neovim " ).action " workbench.action.selectTheme" end
102
- maps .n [" <Leader>fw" ] = function () require (" vscode-neovim " ).action " workbench.action.findInFiles" end
97
+ maps .n [" <Leader>fC" ] = function () require (" vscode" ).action " workbench.action.showCommands" end
98
+ maps .n [" <Leader>ff" ] = function () require (" vscode" ).action " workbench.action.quickOpen" end
99
+ maps .n [" <Leader>fn" ] = function () require (" vscode" ).action " notifications.showList" end
100
+ maps .n [" <Leader>fo" ] = function () require (" vscode" ).action " workbench.action.openRecent" end
101
+ maps .n [" <Leader>ft" ] = function () require (" vscode" ).action " workbench.action.selectTheme" end
102
+ maps .n [" <Leader>fw" ] = function () require (" vscode" ).action " workbench.action.findInFiles" end
103
103
104
104
-- git client
105
- maps .n [" <Leader>gg" ] = function () require (" vscode-neovim " ).action " workbench.view.scm" end
105
+ maps .n [" <Leader>gg" ] = function () require (" vscode" ).action " workbench.view.scm" end
106
106
107
107
-- LSP Mappings
108
- maps .n [" K" ] = function () require (" vscode-neovim " ).action " editor.action.showHover" end
109
- maps .n [" gI" ] = function () require (" vscode-neovim " ).action " editor.action.goToImplementation" end
110
- maps .n [" gd" ] = function () require (" vscode-neovim " ).action " editor.action.revealDefinition" end
111
- maps .n [" gD" ] = function () require (" vscode-neovim " ).action " editor.action.revealDeclaration" end
112
- maps .n [" gr" ] = function () require (" vscode-neovim " ).action " editor.action.goToReferences" end
113
- maps .n [" gy" ] = function () require (" vscode-neovim " ).action " editor.action.goToTypeDefinition" end
114
- maps .n [" <Leader>la" ] = function () require (" vscode-neovim " ).action " editor.action.quickFix" end
115
- maps .n [" <Leader>lG" ] = function () require (" vscode-neovim " ).action " workbench.action.showAllSymbols" end
116
- maps .n [" <Leader>lR" ] = function () require (" vscode-neovim " ).action " editor.action.goToReferences" end
117
- maps .n [" <Leader>lr" ] = function () require (" vscode-neovim " ).action " editor.action.rename" end
118
- maps .n [" <Leader>ls" ] = function () require (" vscode-neovim " ).action " workbench.action.gotoSymbol" end
119
- maps .n [" <Leader>lf" ] = function () require (" vscode-neovim " ).action " editor.action.formatDocument" end
108
+ maps .n [" K" ] = function () require (" vscode" ).action " editor.action.showHover" end
109
+ maps .n [" gI" ] = function () require (" vscode" ).action " editor.action.goToImplementation" end
110
+ maps .n [" gd" ] = function () require (" vscode" ).action " editor.action.revealDefinition" end
111
+ maps .n [" gD" ] = function () require (" vscode" ).action " editor.action.revealDeclaration" end
112
+ maps .n [" gr" ] = function () require (" vscode" ).action " editor.action.goToReferences" end
113
+ maps .n [" gy" ] = function () require (" vscode" ).action " editor.action.goToTypeDefinition" end
114
+ maps .n [" <Leader>la" ] = function () require (" vscode" ).action " editor.action.quickFix" end
115
+ maps .n [" <Leader>lG" ] = function () require (" vscode" ).action " workbench.action.showAllSymbols" end
116
+ maps .n [" <Leader>lR" ] = function () require (" vscode" ).action " editor.action.goToReferences" end
117
+ maps .n [" <Leader>lr" ] = function () require (" vscode" ).action " editor.action.rename" end
118
+ maps .n [" <Leader>ls" ] = function () require (" vscode" ).action " workbench.action.gotoSymbol" end
119
+ maps .n [" <Leader>lf" ] = function () require (" vscode" ).action " editor.action.formatDocument" end
120
120
end ,
121
121
},
122
122
-- disable treesitter highlighting
0 commit comments