Compare commits
10 Commits
836586ebc9
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| cc98f9145b | |||
| 98a9cab64b | |||
| bdcdcc11ea | |||
| ca8ece9655 | |||
| 96af179451 | |||
| 81a3e4d280 | |||
| 0172fecd84 | |||
| ad97e8e3ed | |||
| 849e73fe5b | |||
| 7db12f00f1 |
@@ -8,6 +8,9 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
|||||||
-- For conciseness
|
-- For conciseness
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
|
-- This is for CodeCompanion Plugin. I will move this later
|
||||||
|
vim.keymap.set('n', '<leader><leader>', ':CodeCompanionChat Toggle<CR>', opts)
|
||||||
|
|
||||||
-- save file
|
-- save file
|
||||||
vim.keymap.set('n', '<C-s>', '<cmd> w <CR>', opts)
|
vim.keymap.set('n', '<C-s>', '<cmd> w <CR>', opts)
|
||||||
|
|
||||||
|
|||||||
@@ -97,8 +97,9 @@ return { -- Autocompletion
|
|||||||
-- If you prefer more traditional completion keymaps,
|
-- If you prefer more traditional completion keymaps,
|
||||||
-- you can uncomment the following lines
|
-- you can uncomment the following lines
|
||||||
['<CR>'] = cmp.mapping.confirm { select = true },
|
['<CR>'] = cmp.mapping.confirm { select = true },
|
||||||
--['<Tab>'] = cmp.mapping.select_next_item(),
|
-- ['<Tab>'] = cmp.mapping.confirm { select = true },
|
||||||
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||||
|
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||||
|
|
||||||
-- Manually trigger a completion from nvim-cmp.
|
-- Manually trigger a completion from nvim-cmp.
|
||||||
-- Generally you don't need this, because nvim-cmp will display
|
-- Generally you don't need this, because nvim-cmp will display
|
||||||
@@ -127,24 +128,24 @@ return { -- Autocompletion
|
|||||||
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||||
-- Select next/previous item with Tab / Shift + Tab
|
-- Select next/previous item with Tab / Shift + Tab
|
||||||
['<Tab>'] = cmp.mapping(function(fallback)
|
-- ['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
-- if cmp.visible() then
|
||||||
cmp.select_next_item()
|
-- cmp.select_next_item()
|
||||||
elseif luasnip.expand_or_locally_jumpable() then
|
-- elseif luasnip.expand_or_locally_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
-- luasnip.expand_or_jump()
|
||||||
else
|
-- else
|
||||||
fallback()
|
-- fallback()
|
||||||
end
|
-- end
|
||||||
end, { 'i', 's' }),
|
-- end, { 'i', 's' }),
|
||||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
-- ['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
-- if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
-- cmp.select_prev_item()
|
||||||
elseif luasnip.locally_jumpable(-1) then
|
-- elseif luasnip.locally_jumpable(-1) then
|
||||||
luasnip.jump(-1)
|
-- luasnip.jump(-1)
|
||||||
else
|
-- else
|
||||||
fallback()
|
-- fallback()
|
||||||
end
|
-- end
|
||||||
end, { 'i', 's' }),
|
-- end, { 'i', 's' }),
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ return {
|
|||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
},
|
},
|
||||||
config = {
|
config = {
|
||||||
|
-- keymaps = {
|
||||||
|
--
|
||||||
|
-- }
|
||||||
prompt_library = {
|
prompt_library = {
|
||||||
['prompt2prompt'] = {
|
['prompt2prompt'] = {
|
||||||
strategy = 'chat',
|
strategy = 'chat',
|
||||||
@@ -22,6 +25,22 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
adapters = {
|
adapters = {
|
||||||
|
codellama = function()
|
||||||
|
return require('codecompanion.adapters').extend('ollama', {
|
||||||
|
name = 'codellama', -- Give this adapter a different name to differentiate it from the default ollama adapter
|
||||||
|
schema = {
|
||||||
|
model = {
|
||||||
|
default = 'codellama',
|
||||||
|
},
|
||||||
|
-- num_ctx = {
|
||||||
|
-- default = 16384,
|
||||||
|
-- },
|
||||||
|
-- num_predict = {
|
||||||
|
-- default = -1,
|
||||||
|
-- },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
llama3 = function()
|
llama3 = function()
|
||||||
return require('codecompanion.adapters').extend('ollama', {
|
return require('codecompanion.adapters').extend('ollama', {
|
||||||
name = 'llama3', -- Give this adapter a different name to differentiate it from the default ollama adapter
|
name = 'llama3', -- Give this adapter a different name to differentiate it from the default ollama adapter
|
||||||
@@ -38,6 +57,18 @@ return {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
openai = function()
|
||||||
|
return require('codecompanion.adapters').extend('openai', {
|
||||||
|
env = {
|
||||||
|
api_key = os.getenv 'OPEN_API_KEY',
|
||||||
|
},
|
||||||
|
schema = {
|
||||||
|
model = {
|
||||||
|
default = 'gpt-3.5-turbo',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
deepseekr1 = function()
|
deepseekr1 = function()
|
||||||
return require('codecompanion.adapters').extend('ollama', {
|
return require('codecompanion.adapters').extend('ollama', {
|
||||||
name = 'deepseekr1', -- Give this adapter a different name to differentiate it from the default ollama adapter
|
name = 'deepseekr1', -- Give this adapter a different name to differentiate it from the default ollama adapter
|
||||||
@@ -57,10 +88,10 @@ return {
|
|||||||
},
|
},
|
||||||
strategies = {
|
strategies = {
|
||||||
chat = {
|
chat = {
|
||||||
adapter = 'deepseekr1',
|
adapter = 'llama3',
|
||||||
},
|
},
|
||||||
inline = {
|
inline = {
|
||||||
adapter = 'deepseekr1',
|
adapter = 'llama3',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return {
|
|||||||
-- Example config in lua
|
-- Example config in lua
|
||||||
vim.g.nord_contrast = true
|
vim.g.nord_contrast = true
|
||||||
vim.g.nord_borders = false
|
vim.g.nord_borders = false
|
||||||
vim.g.nord_disable_background = true
|
vim.g.nord_disable_background = false
|
||||||
vim.g.nord_italic = false
|
vim.g.nord_italic = false
|
||||||
vim.g.nord_uniform_diff_background = true
|
vim.g.nord_uniform_diff_background = true
|
||||||
vim.g.nord_bold = false
|
vim.g.nord_bold = false
|
||||||
|
|||||||
@@ -162,6 +162,10 @@ return {
|
|||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
-- https://github.com/pmizio/typescript-tools.nvim
|
||||||
--
|
--
|
||||||
-- But for many setups, the LSP (`tsserver`) will work just fine
|
-- But for many setups, the LSP (`tsserver`) will work just fine
|
||||||
|
astro = {},
|
||||||
|
rubocop = {},
|
||||||
|
rufo = {},
|
||||||
|
ruby_lsp = {},
|
||||||
tsserver = {},
|
tsserver = {},
|
||||||
ruff = {},
|
ruff = {},
|
||||||
pylsp = {
|
pylsp = {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ return {
|
|||||||
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||||
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
||||||
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||||
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
vim.keymap.set('n', '<leader>b', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
||||||
|
|
||||||
-- Slightly advanced example of overriding default behavior and theme
|
-- Slightly advanced example of overriding default behavior and theme
|
||||||
vim.keymap.set('n', '<leader>/', function()
|
vim.keymap.set('n', '<leader>/', function()
|
||||||
|
|||||||
Reference in New Issue
Block a user