From a5950ac59dedc63a255c76726a17367220eeb22c Mon Sep 17 00:00:00 2001 From: David Francis Date: Wed, 28 Feb 2024 12:58:39 +0000 Subject: [PATCH] Update init.lua --- init.lua | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 4155cbe7..75394896 100644 --- a/init.lua +++ b/init.lua @@ -70,6 +70,9 @@ require('lazy').setup({ }, }, + -- Plugin to autopair brackets + { 'windwp/nvim-autopairs', event = 'InsertEnter', opts = {} }, + -- Useful plugin to show you pending keybinds. { 'folke/which-key.nvim', opts = {} }, { @@ -192,6 +195,23 @@ vim.keymap.set('n', 'yy', '"+yy', { desc = 'Yank line to system clipboar vim.keymap.set('n', 'Y', '"+y$', { desc = 'Yank to end of line to system clipboard' }) vim.keymap.set('v', 'Y', '"+Y', { desc = 'Yank highlighted lines to system clipboard' }) +-- Escape terminal mode +vim.keymap.set('t', '', '', { desc = 'Escape terminal mode'}) + +-- Use ALT+{h,j,k,l} to navigate windows from any mode (see :help terminal) +vim.keymap.set('t', '', 'h') +vim.keymap.set('t', '', 'j') +vim.keymap.set('t', '', 'k') +vim.keymap.set('t', '', 'l') +vim.keymap.set('i', '', 'h') +vim.keymap.set('i', '', 'j') +vim.keymap.set('i', '', 'k') +vim.keymap.set('i', '', 'l') +vim.keymap.set('n', '', 'h') +vim.keymap.set('n', '', 'j') +vim.keymap.set('n', '', 'k') +vim.keymap.set('n', '', 'l') + -- Enable break indent vim.o.breakindent = true @@ -218,8 +238,8 @@ vim.o.termguicolors = true -- Think these are set automatically by a plugin instead -- vim.o.tabstop = 4 --- vim.o.shiftwidth = 4 --- vim.o.expandtab = true +vim.o.shiftwidth = 4 +vim.o.expandtab = true vim.o.scrolloff = 8 @@ -300,7 +320,7 @@ vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { de -- See `:help nvim-treesitter` require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'c_sharp' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, @@ -419,11 +439,11 @@ end -- Add any additional override configuration in the following tables. They will be passed to -- the `settings` field of the server config. You must look up that documentation yourself. local servers = { - -- clangd = {}, - -- gopls = {}, + clangd = {}, + gopls = {}, -- pyright = {}, -- rust_analyzer = {}, - -- tsserver = {}, + tsserver = {}, lua_ls = { Lua = {