From 800a7fe305cd84e4475a7b7352f87efbbc7a62f0 Mon Sep 17 00:00:00 2001 From: FilipMyhren Date: Tue, 19 Sep 2023 08:03:27 +0200 Subject: [PATCH] Added some minor changes --- init.lua | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/init.lua b/init.lua index 2f04a274..5805f7c7 100644 --- a/init.lua +++ b/init.lua @@ -177,13 +177,6 @@ require('lazy').setup({ end, }, - { -- Jumping between windows - 'ThePrimeagen/harpoon', - dependencies = { - 'nvim-lua/plenary.nvim' - }, - }, - { -- go tools 'darrikonn/vim-gofmt' }, @@ -258,21 +251,8 @@ vim.o.relativenumber = true -- See `:help vim.keymap.set()` vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) vim.keymap.set('n', 'sr', ':%s///g', { desc = "Find and replace all words under the cursor" }) -vim.keymap.set('n', 'cv', 'Ex', { desc = "Back to file tree" }) -vim.keymap.set('n', 'pv', 'Ex .', { desc = "Back to file tree one step" }) --- Harpoon keymaps - -vim.keymap.set('n', '', require('harpoon.mark').add_file, { desc = "Add file to harpoon list" }) -vim.keymap.set('n', '', require('harpoon.ui').toggle_quick_menu, { desc = "Toggle harpoon quick menu" }) -vim.keymap.set('n', '1', function() require('harpoon.ui').nav_file(1) end, { desc = "Navigate to file at posistion 1" }) -vim.keymap.set('n', '2', function() require('harpoon.ui').nav_file(2) end, { desc = "Navigate to file at posistion 2" }) -vim.keymap.set('n', '3', function() require('harpoon.ui').nav_file(3) end, { desc = "Navigate to file at posistion 3" }) -vim.keymap.set('n', '4', function() require('harpoon.ui').nav_file(4) end, { desc = "Navigate to file at posistion 4" }) -vim.keymap.set('n', '5', function() require('harpoon.ui').nav_file(5) end, { desc = "Navigate to file at posistion 5" }) -vim.keymap.set('n', '6', function() require('harpoon.ui').nav_file(6) end, { desc = "Navigate to file at posistion 6" }) -vim.keymap.set('n', '7', function() require('harpoon.ui').nav_file(7) end, { desc = "Navigate to file at posistion 7" }) -vim.keymap.set('n', '8', function() require('harpoon.ui').nav_file(8) end, { desc = "Navigate to file at posistion 8" }) -vim.keymap.set('n', '9', function() require('harpoon.ui').nav_file(9) end, { desc = "Navigate to file at posistion 9" }) +vim.keymap.set('n', 'cv', 'Ex', { desc = "Back to file tree one step" }) +vim.keymap.set('n', 'pv', 'Ex .', { desc = "Back to file tree root" }) -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` @@ -322,7 +302,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', 'vim', 'go'}, + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vim', 'go', 'haskell', 'terraform'}, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, @@ -441,11 +421,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 = { + -- hls = {}, -- clangd = {}, -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, - -- tsserver = {}, tsserver = { Javascript = { init_options = { @@ -455,7 +435,6 @@ local servers = { }, }, }, - lua_ls = { Lua = { workspace = { checkThirdParty = false }, @@ -529,10 +508,18 @@ cmp.setup { fallback() end end, { 'i', 's' }), + [""] = cmp.mapping(function() + if cmp.visible() then + cmp.close() + else + cmp.complete() + end + end, { 'i', 's' }), }, sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, + { name = 'nvim_lsp', keyword_length = 5 }, + { name = 'luasnip', keyword_length = 5 }, + { name = 'buffer', keyword_length = 5 }, }, }