Minor changes

This commit is contained in:
FilipMyhren 2023-04-17 11:53:55 +02:00
parent 163e0c33a7
commit abeae4c67e
1 changed files with 15 additions and 1 deletions

View File

@ -46,6 +46,7 @@ vim.g.maplocalleader = ' '
-- https://github.com/folke/lazy.nvim -- https://github.com/folke/lazy.nvim
-- `:help lazy.nvim.txt` for more info -- `:help lazy.nvim.txt` for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
local autocmd = vim.api.nvim_create_autocmd
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system { vim.fn.system {
'git', 'git',
@ -56,6 +57,10 @@ if not vim.loop.fs_stat(lazypath) then
lazypath, lazypath,
} }
end end
autocmd('FileType', {
pattern = { 'go' },
command = 'setlocal indentkeys-=<:> indentkeys-=:'
})
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
-- NOTE: Here is where you install your plugins. -- NOTE: Here is where you install your plugins.
@ -178,6 +183,10 @@ require('lazy').setup({
'nvim-lua/plenary.nvim' 'nvim-lua/plenary.nvim'
}, },
}, },
{ -- go tools
'darrikonn/vim-gofmt'
},
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository. -- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them. -- Uncomment any of the lines below to enable them.
@ -214,6 +223,9 @@ vim.o.clipboard = 'unnamedplus'
-- Enable break indent -- Enable break indent
vim.o.breakindent = true vim.o.breakindent = true
vim.o.tabstop = 2
vim.o.sts = 2
vim.o.sw = 2
-- Save undo history -- Save undo history
vim.o.undofile = true vim.o.undofile = true
@ -238,6 +250,7 @@ vim.o.termguicolors = true
-- Always keep cursor verical centered -- Always keep cursor verical centered
vim.o.scrolloff = 999 vim.o.scrolloff = 999
vim.o.relativenumber = true
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
@ -245,7 +258,8 @@ vim.o.scrolloff = 999
-- 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>pv', '<cmd>Ex<CR>', { desc = "Back to file tree" }) vim.keymap.set('n', '<leader>cv', '<cmd>Ex<CR>', { desc = "Back to file tree" })
vim.keymap.set('n', '<leader>pv', '<cmd>Ex .<CR>', { desc = "Back to file tree one step" })
-- Harpoon keymaps -- Harpoon keymaps
vim.keymap.set('n', '<C-a>', require('harpoon.mark').add_file, { desc = "Add file to harpoon list" }) vim.keymap.set('n', '<C-a>', require('harpoon.mark').add_file, { desc = "Add file to harpoon list" })