nvim: inline treesitter config

This commit is contained in:
He4eT 2024-04-04 00:53:40 +02:00
commit 92eee842b1

View file

@ -347,76 +347,9 @@ require('lazy').setup({
'nvim-treesitter/nvim-treesitter-textobjects',
},
build = ':TSUpdate',
},
{
'nomnivore/ollama.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
},
cmd = { 'Ollama', 'OllamaModel' },
keys = {
{
'<leader>j',
':Ollama<CR>',
desc = 'Ollama Menu',
mode = { 'v' },
},
{
'<leader>j',
":lua require('ollama').prompt('Generate_Code')<cr>",
desc = 'Ollama Code Generation',
mode = { 'n' },
},
},
opts = {
model = 'mistral',
url = 'http://ollama.internal:11434', -- see /etc/hosts
prompts = {
Ask_About_Code = false,
Simplify_Code = false,
Improve_Text = {
prompt = 'Make this text simple and readable. Respond with improved version of this text: ```$sel```',
extract = false,
action = 'replace',
},
Modify_Text = {
prompt = 'Modify this text in the following way: $input\n\n' .. '```$sel```',
extract = false,
action = 'replace',
},
Use_selection_as_prompt = {
prompt = '$sel',
extract = false,
action = 'replace',
},
},
},
},
}, {
-- Lazy options
ui = {
size = { width = 0.85, height = 0.7 },
border = 'solid',
icons = {
cmd = '[cmd]',
config = '[cfg]',
event = '[e]',
ft = '[ft]',
init = '[init]',
keys = '[key]',
plugin = '[plugin]',
runtime = '[rt]',
source = '[src]',
start = '[active]',
task = '[task]',
lazy = '[lazy]',
},
},
})
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup {
config = function ()
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = {
'vim',
@ -487,7 +420,74 @@ require('nvim-treesitter.configs').setup {
},
},
},
}
}
end
},
{
'nomnivore/ollama.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
},
cmd = { 'Ollama', 'OllamaModel' },
keys = {
{
'<leader>j',
':Ollama<CR>',
desc = 'Ollama Menu',
mode = { 'v' },
},
{
'<leader>j',
":lua require('ollama').prompt('Generate_Code')<cr>",
desc = 'Ollama Code Generation',
mode = { 'n' },
},
},
opts = {
model = 'mistral',
url = 'http://ollama.internal:11434', -- see /etc/hosts
prompts = {
Ask_About_Code = false,
Simplify_Code = false,
Improve_Text = {
prompt = 'Make this text simple and readable. Respond with improved version of this text: ```$sel```',
extract = false,
action = 'replace',
},
Modify_Text = {
prompt = 'Modify this text in the following way: $input\n\n' .. '```$sel```',
extract = false,
action = 'replace',
},
Use_selection_as_prompt = {
prompt = '$sel',
extract = false,
action = 'replace',
},
},
},
},
}, {
-- Lazy options
ui = {
size = { width = 0.85, height = 0.7 },
border = 'solid',
icons = {
cmd = '[cmd]',
config = '[cfg]',
event = '[e]',
ft = '[ft]',
init = '[init]',
keys = '[key]',
plugin = '[plugin]',
runtime = '[rt]',
source = '[src]',
start = '[active]',
task = '[task]',
lazy = '[lazy]',
},
},
})
-- [[ LSP settings ]]
-- This function gets run when an LSP connects to a particular buffer.