-- You can add your own plugins here or in other files in this directory! -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information vim.cmd 'language en_GB.UTF-8' vim.opt.encoding = 'utf-8' vim.opt.fileencoding = 'utf-8' vim.opt.fileencodings = { 'utf-8' } vim.opt.termguicolors = true vim.opt.winblend = 0 vim.opt.pumblend = 0 vim.g.background = 'dark' vim.opt.wrap = true vim.diagnostic.config { update_in_insert = true, underline = false, } vim.cmd 'filetype plugin on' -- NOTE: keymaps local map = vim.keymap.set local opts = { noremap = true, silent = true } -- basic function map('n', ';', ':', { desc = '' }) -- buffer control map('n', '', 'bnext', { desc = 'Next buffer' }) map('n', 'x', 'bdelete', { desc = 'delete buffer' }) -- telescope map('n', 'tc', 'Telescope colorscheme', { desc = '[T]elescope [C]olorscheme' }) -- toggleterm map('n', 'H', 'ToggleTerm size=16 direction=horizontal', { desc = 'Open Terminal Horizontal' }) -- map('t', 'H', 'ToggleTerm size=20 direction=horizontal', { desc = 'Open Terminal Horizontal' }) map('n', 'V', 'ToggleTerm size=80 direction=vertical', { desc = 'Open Terminal Vertical' }) -- map('t', 'V', 'ToggleTerm size=80 direction=vertical', { desc = 'Open Terminal Vertical' }) map('n', '', 'ToggleTerm direction=float', { desc = 'Open Terminal floating' }) map('t', '', 'ToggleTerm direction=float', { desc = 'Open Terminal floating' }) -- CopilotChat.nvim map('n', 'cci', 'CopilotChat ', { desc = ':CopilotChat', unpack(opts) }) map('n', 'cco', 'CopilotChatOpen', { desc = ':CopilotChatOpen', unpack(opts) }) map('n', 'ccq', 'CopilotChatClose', { desc = ':CopilotChatClose', unpack(opts) }) map('n', 'cct', 'CopilotChatToggle', { desc = ':CopilotChatToggle', unpack(opts) }) map('n', 'ccs', 'CopilotChatStop', { desc = ':CopilotChatStop', unpack(opts) }) map('n', 'ccr', 'CopilotChatReset', { desc = ':CopilotChatReset', unpack(opts) }) map('n', 'ccS', 'CopilotChatSave ', { desc = 'Save Copilot Chat history', noremap = true, silent = false }) map('n', 'ccL', 'CopilotChatLoad ', { desc = 'Load Copilot Chat history', noremap = true, silent = false }) map('n', 'ccp', 'CopilotChatPrompts', { desc = 'Copilot Chat prompt templates', unpack(opts) }) map('n', 'ccm', 'CopilotChatModels', { desc = 'Copilot Chat models', unpack(opts) }) map('n', 'ccE', 'CopilotChat', { desc = 'Copilot Chat prompt template', noremap = true, silent = false }) -- macos like keybindings for text editing in insert mode map('i', '', '^', opts) map('i', '', '$', opts) map('i', '', 'D', opts) map('i', '', 'd0', opts) map('i', '', '', opts) map('i', '', '', opts) map('i', '', '', opts) map('i', '', '', opts) map('i', '', '', opts) map('i', '', '', opts) -- NOTE: keymaps end -- NOTE: neovide local function set_ime(args) if args.event:match 'Enter$' then vim.g.neovide_input_ime = true else vim.g.neovide_input_ime = false end end local ime_input = vim.api.nvim_create_augroup('ime_input', { clear = true }) vim.api.nvim_create_autocmd({ 'InsertEnter', 'InsertLeave' }, { group = ime_input, pattern = '*', callback = set_ime, }) vim.api.nvim_create_autocmd({ 'CmdlineEnter', 'CmdlineLeave' }, { group = ime_input, pattern = '[/\\?]', callback = set_ime, }) vim.g.neovide_cursor_animation_length = 0.1 -- NOTE: neovide end return {}