Added some minor changes

This commit is contained in:
FilipMyhren 2023-09-19 08:03:27 +02:00
parent bdee3f372f
commit 800a7fe305
1 changed files with 14 additions and 27 deletions

View File

@ -177,13 +177,6 @@ require('lazy').setup({
end, end,
}, },
{ -- Jumping between windows
'ThePrimeagen/harpoon',
dependencies = {
'nvim-lua/plenary.nvim'
},
},
{ -- go tools { -- go tools
'darrikonn/vim-gofmt' 'darrikonn/vim-gofmt'
}, },
@ -258,21 +251,8 @@ vim.o.relativenumber = true
-- See `:help vim.keymap.set()` -- See `:help vim.keymap.set()`
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true }) vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
vim.keymap.set('n', '<leader>sr', ':%s/<C-r><C-w>/<C-r><C-w>/g<Left><Left>', { desc = "Find and replace all words under the cursor" }) vim.keymap.set('n', '<leader>sr', ':%s/<C-r><C-w>/<C-r><C-w>/g<Left><Left>', { desc = "Find and replace all words under the cursor" })
vim.keymap.set('n', '<leader>cv', '<cmd>Ex<CR>', { desc = "Back to file tree" }) vim.keymap.set('n', '<leader>cv', '<cmd>Ex<CR>', { desc = "Back to file tree one step" })
vim.keymap.set('n', '<leader>pv', '<cmd>Ex .<CR>', { desc = "Back to file tree one step" }) vim.keymap.set('n', '<leader>pv', '<cmd>Ex .<CR>', { desc = "Back to file tree root" })
-- Harpoon keymaps
vim.keymap.set('n', '<C-a>', require('harpoon.mark').add_file, { desc = "Add file to harpoon list" })
vim.keymap.set('n', '<C-e>', require('harpoon.ui').toggle_quick_menu, { desc = "Toggle harpoon quick menu" })
vim.keymap.set('n', '<leader>1', function() require('harpoon.ui').nav_file(1) end, { desc = "Navigate to file at posistion 1" })
vim.keymap.set('n', '<leader>2', function() require('harpoon.ui').nav_file(2) end, { desc = "Navigate to file at posistion 2" })
vim.keymap.set('n', '<leader>3', function() require('harpoon.ui').nav_file(3) end, { desc = "Navigate to file at posistion 3" })
vim.keymap.set('n', '<leader>4', function() require('harpoon.ui').nav_file(4) end, { desc = "Navigate to file at posistion 4" })
vim.keymap.set('n', '<leader>5', function() require('harpoon.ui').nav_file(5) end, { desc = "Navigate to file at posistion 5" })
vim.keymap.set('n', '<leader>6', function() require('harpoon.ui').nav_file(6) end, { desc = "Navigate to file at posistion 6" })
vim.keymap.set('n', '<leader>7', function() require('harpoon.ui').nav_file(7) end, { desc = "Navigate to file at posistion 7" })
vim.keymap.set('n', '<leader>8', function() require('harpoon.ui').nav_file(8) end, { desc = "Navigate to file at posistion 8" })
vim.keymap.set('n', '<leader>9', function() require('harpoon.ui').nav_file(9) end, { desc = "Navigate to file at posistion 9" })
-- [[ Highlight on yank ]] -- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()` -- See `:help vim.highlight.on_yank()`
@ -322,7 +302,7 @@ vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { de
-- See `:help nvim-treesitter` -- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter -- 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!) -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false, auto_install = false,
@ -441,11 +421,11 @@ end
-- Add any additional override configuration in the following tables. They will be passed to -- 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. -- the `settings` field of the server config. You must look up that documentation yourself.
local servers = { local servers = {
-- hls = {},
-- clangd = {}, -- clangd = {},
-- gopls = {}, -- gopls = {},
-- pyright = {}, -- pyright = {},
-- rust_analyzer = {}, -- rust_analyzer = {},
-- tsserver = {},
tsserver = { tsserver = {
Javascript = { Javascript = {
init_options = { init_options = {
@ -455,7 +435,6 @@ local servers = {
}, },
}, },
}, },
lua_ls = { lua_ls = {
Lua = { Lua = {
workspace = { checkThirdParty = false }, workspace = { checkThirdParty = false },
@ -529,10 +508,18 @@ cmp.setup {
fallback() fallback()
end end
end, { 'i', 's' }), end, { 'i', 's' }),
["<C-k>"] = cmp.mapping(function()
if cmp.visible() then
cmp.close()
else
cmp.complete()
end
end, { 'i', 's' }),
}, },
sources = { sources = {
{ name = 'nvim_lsp' }, { name = 'nvim_lsp', keyword_length = 5 },
{ name = 'luasnip' }, { name = 'luasnip', keyword_length = 5 },
{ name = 'buffer', keyword_length = 5 },
}, },
} }