Last active
May 18, 2023 12:42
-
-
Save CamilleMo/cd8893fcba06ca060392a7c7f017d780 to your computer and use it in GitHub Desktop.
my Lunar Vim config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- paste the default config before this comment | |
-- perso | |
-- copilot https://medium.com/aimonks/a-guide-to-integrating-lunarvim-github-copilot-61d92f764913 | |
lvim.plugins = { | |
{ | |
"zbirenbaum/copilot.lua", | |
cmd = "Copilot", | |
event = "InsertEnter", | |
}, | |
{ | |
"zbirenbaum/copilot-cmp", | |
after = { "copilot.lua" }, | |
config = function() | |
require("copilot_cmp").setup() | |
end, | |
}, | |
} | |
local ok, copilot = pcall(require, "copilot") | |
if not ok then | |
return | |
end | |
copilot.setup { | |
suggestion = { | |
keymap = { | |
accept = "<c-l>", | |
next = "<c-j>", | |
prev = "<c-k>", | |
dismiss = "<c-h>", | |
}, | |
}, | |
} | |
local opts = { noremap = true, silent = true } | |
vim.api.nvim_set_keymap("n", "<c-s>", "<cmd>lua require('copilot.suggestion').toggle_auto_trigger()<CR>", opts) | |
-- python special https://betterprogramming.pub/lunarvim-as-a-python-ide-ca8f57ca9f3a | |
lvim.builtin.treesitter.ensure_installed = { | |
"python", | |
} | |
local formatters = require "lvim.lsp.null-ls.formatters" | |
formatters.setup { { name = "black" }, } | |
-- next lines are for auto formatting on save | |
-- lvim.format_on_save.enabled = true | |
-- lvim.format_on_save.pattern = { "*.py" } | |
local linters = require "lvim.lsp.null-ls.linters" | |
linters.setup { { command = "flake8", filetypes = { "python" } } } | |
-- this is to be able to change the python virtual env | |
lvim.plugins = { | |
"ChristianChiarulli/swenv.nvim", | |
"stevearc/dressing.nvim", | |
} | |
lvim.builtin.which_key.mappings["C"] = { | |
name = "Python", | |
c = { "<cmd>lua require('swenv.api').pick_venv()<cr>", "Choose Env" }, | |
} | |
-- go out of insert mode with the jk mapping | |
lvim.keys.insert_mode["jk"] = "<ESC>" | |
-- remapping for the terminal toggle | |
lvim.builtin.terminal.open_mapping = "<c-t>" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment