Skip to content

Commit

Permalink
Disable Copilot + add Gen + change tab indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorian Maspataud committed Apr 30, 2024
1 parent 6a09bf6 commit ac6bdb3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
8 changes: 6 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ vim.opt.clipboard = 'unnamedplus'

-- Enable break indent
vim.opt.breakindent = true

vim.opt.autoindent = true
vim.opt.smartindent = true
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
-- Save undo history
vim.opt.undofile = true

Expand Down Expand Up @@ -256,13 +259,14 @@ require('lazy').setup({
changedelete = { text = '~' },
},
},
vim.api.nvim_set_keymap('n', '<leader>gb', ':Gitsigns blame_line<CR>', { noremap = true, silent = true }),
},

-- NOTE: Plugins can also be configured to run lua code when they are loaded.
--
-- This is often very useful to both group configuration, as well as handle
-- lazy loading plugins that don't need to be loaded immediately at startup.
--
--:
-- For example, in the following configuration, we use:
-- event = 'VimEnter'
--
Expand Down
10 changes: 6 additions & 4 deletions lua/custom/plugins/copilot.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
return {
'github/copilot.vim',
version = '*',
}
-- return {
-- 'github/copilot.vim',
-- version = '*',
-- }
--
return {}
28 changes: 28 additions & 0 deletions lua/custom/plugins/gen.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
return {
'David-Kunz/gen.nvim',
opts = {
model = 'llama3', -- The default model to use.
host = 'localhost', -- The host running the Ollama service.
port = '11434', -- The port on which the Ollama service is listening.
quit_map = 'q', -- set keymap for close the response window
retry_map = '<c-r>', -- set keymap to re-send the current prompt
init = function(options)
pcall(io.popen, 'ollama serve > /dev/null 2>&1 &')
end,
-- Function to initialize Ollama
command = function(options)
local body = { model = options.model, stream = true }
return 'curl --silent --no-buffer -X POST http://' .. options.host .. ':' .. options.port .. '/api/chat -d $body'
end,
-- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped).
-- This can also be a command string.
-- The executed command must return a JSON object with { response, context }
-- (context property is optional).
-- list_models = '<omitted lua function>', -- Retrieves a list of model names
display_mode = 'float', -- The display mode. Can be "float" or "split".
show_prompt = false, -- Shows the prompt submitted to Ollama.
show_model = false, -- Displays which model you are using at the beginning of your chat session.
no_auto_close = false, -- Never closes the window automatically.
debug = false, -- Prints errors and the command which is run.
},
}

0 comments on commit ac6bdb3

Please sign in to comment.