From 20aec846b5513014b379f88ded3b258129b8df45 Mon Sep 17 00:00:00 2001 From: lorenzhohermuth Date: Wed, 15 May 2024 10:57:05 +0200 Subject: [PATCH] format plus some more --- lua/lorenz/cmp.lua | 1 - lua/lorenz/init.lua | 2 +- lua/lorenz/kickstart.lua | 60 ++---------------------- lua/lorenz/{golsp-config.lua => lsp.lua} | 0 lua/lorenz/remap.lua | 18 +++++-- lua/lorenz/set.lua | 6 --- 6 files changed, 18 insertions(+), 69 deletions(-) rename lua/lorenz/{golsp-config.lua => lsp.lua} (100%) diff --git a/lua/lorenz/cmp.lua b/lua/lorenz/cmp.lua index e6b305d..a09778a 100644 --- a/lua/lorenz/cmp.lua +++ b/lua/lorenz/cmp.lua @@ -45,6 +45,5 @@ cmp.setup { }, sources = { { name = 'nvim_lsp' }, - { name = 'luasnip' }, }, } diff --git a/lua/lorenz/init.lua b/lua/lorenz/init.lua index 5dd4fc9..625d032 100644 --- a/lua/lorenz/init.lua +++ b/lua/lorenz/init.lua @@ -2,7 +2,7 @@ require("lorenz.remap") require("lorenz.set") require("lorenz.kickstart") require("lorenz.nvim-tree") -require("lorenz.golsp-config") +require("lorenz.lsp") require("lorenz.autoclose") require("lorenz.cmp") require("lorenz.catppuccin") diff --git a/lua/lorenz/kickstart.lua b/lua/lorenz/kickstart.lua index 4a4f66c..febedf0 100644 --- a/lua/lorenz/kickstart.lua +++ b/lua/lorenz/kickstart.lua @@ -1,43 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== - -Kickstart.nvim is *not* a distribution. - -Kickstart.nvim is a template for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you should start exploring, configuring and tinkering to - explore Neovim! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example: - - https://learnxinyminutes.com/docs/lua/ - - - And then you can explore or search through `:help lua-guide` - - https://neovim.io/doc/user/lua-guide.html - - -Kickstart Guide: - -I have left several `:help X` comments throughout the init.lua -You should run that command and read that help section for more information. - -In addition, I have some `NOTE:` items throughout the file. -These are for you, the reader to help understand what is happening. Feel free to delete -them once you know what you're doing, but they should serve as a guide for when you -are first encountering a few different constructs in your nvim config. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now :) ---]] - -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) @@ -61,13 +21,7 @@ end vim.opt.rtp:prepend(lazypath) -- [[ Configure plugins ]] --- NOTE: Here is where you install your plugins. --- You can configure plugins using the `config` key. --- --- You can also configure plugins after the setup call, --- as they will be available in your neovim runtime. require('lazy').setup({ - -- NOTE: First, some plugins that don't require any configuration { 'neoclide/coc.nvim' , branch = 'release' @@ -91,6 +45,9 @@ require('lazy').setup({ cmd = "Git" }, + -- Autoformatter + 'vim-autoformat/vim-autoformat', + -- Detect tabstop and shiftwidth automatically 'tpope/vim-sleuth', @@ -290,17 +247,6 @@ require('lazy').setup({ -- Keymaps for better default experience -- See `:help vim.keymap.set()` -vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) - --- Remap for dealing with word wrap -vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) - --- Diagnostic keymaps -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) -vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` diff --git a/lua/lorenz/golsp-config.lua b/lua/lorenz/lsp.lua similarity index 100% rename from lua/lorenz/golsp-config.lua rename to lua/lorenz/lsp.lua diff --git a/lua/lorenz/remap.lua b/lua/lorenz/remap.lua index c83f4e3..f57faba 100644 --- a/lua/lorenz/remap.lua +++ b/lua/lorenz/remap.lua @@ -13,11 +13,21 @@ vim.keymap.set("n", "y", "\"+y") vim.keymap.set("v", "y", "\"+y") vim.keymap.set("n", "Y", "\"+Y") -vim.keymap.set("n", "", "cnextzz") -vim.keymap.set("n", "", "cprevzz") -vim.keymap.set("n", "k", "lnextzz") - vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) vim.keymap.set("n", "ö", "$") vim.keymap.set("v", "ö", "$") + +vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) + +-- Remap for dealing with word wrap +vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) + +-- Diagnostic keymaps +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) + +vim.keymap.set('n', 'F', ":Format") diff --git a/lua/lorenz/set.lua b/lua/lorenz/set.lua index 509ef80..1694676 100644 --- a/lua/lorenz/set.lua +++ b/lua/lorenz/set.lua @@ -3,7 +3,6 @@ vim.opt.relativenumber = true vim.opt.smartindent = true - -- set termguicolors to enable highlight groups vim.opt.termguicolors = true vim.wo.wrap = false @@ -25,11 +24,6 @@ vim.wo.number = true -- Enable mouse mode vim.o.mouse = 'a' --- Sync clipboard between OS and Neovim. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.o.clipboard = 'unnamedplus' - -- Enable break indent vim.o.breakindent = true