Fixing supermaven
This commit is contained in:
parent
9c28dc3048
commit
158d52493b
1 changed files with 8 additions and 3 deletions
11
init.lua
11
init.lua
|
|
@ -70,8 +70,8 @@ vim.pack.add({
|
||||||
|
|
||||||
-- Theme (auto light/dark based on OS appearance)
|
-- Theme (auto light/dark based on OS appearance)
|
||||||
require('tokyonight').setup({
|
require('tokyonight').setup({
|
||||||
style = 'storm',
|
-- style = 'storm',
|
||||||
light_style = 'day',
|
-- light_style = 'day',
|
||||||
})
|
})
|
||||||
vim.cmd.colorscheme('tokyonight')
|
vim.cmd.colorscheme('tokyonight')
|
||||||
|
|
||||||
|
|
@ -177,7 +177,7 @@ vim.lsp.enable({
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
if client and client.supports_method('textDocument/inlayHint') then
|
if client and client:supports_method('textDocument/inlayHint') then
|
||||||
vim.lsp.inlay_hint.enable(true, { bufnr = args.buf })
|
vim.lsp.inlay_hint.enable(true, { bufnr = args.buf })
|
||||||
end
|
end
|
||||||
vim.lsp.completion.enable(true, args.data.client_id, args.buf)
|
vim.lsp.completion.enable(true, args.data.client_id, args.buf)
|
||||||
|
|
@ -197,6 +197,11 @@ vim.keymap.set({ 'n', 'x', 'o' }, 'S', function() require('flash').treesitter()
|
||||||
|
|
||||||
-- Completion keymaps
|
-- Completion keymaps
|
||||||
vim.keymap.set('i', '<Tab>', function()
|
vim.keymap.set('i', '<Tab>', function()
|
||||||
|
local suggestion = require('supermaven-nvim.completion_preview')
|
||||||
|
if suggestion.has_suggestion() then
|
||||||
|
suggestion.on_accept_suggestion()
|
||||||
|
return
|
||||||
|
end
|
||||||
return vim.fn.pumvisible() == 1 and '<C-n>' or '<Tab>'
|
return vim.fn.pumvisible() == 1 and '<C-n>' or '<Tab>'
|
||||||
end, { expr = true })
|
end, { expr = true })
|
||||||
vim.keymap.set('i', '<S-Tab>', function()
|
vim.keymap.set('i', '<S-Tab>', function()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue