From 927c5023eb3ad8e3b8b6395b31127d135c06f789 Mon Sep 17 00:00:00 2001 From: Joost Agterhoek Date: Wed, 6 Nov 2024 08:11:16 +0100 Subject: [PATCH] made my own autocorrect keymap :) --- init.lua | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 06faac8..c1c7c12 100644 --- a/init.lua +++ b/init.lua @@ -16,6 +16,8 @@ vim.opt.spelllang = { 'en_us', 'nl' } vim.opt.spell = true vim.keymap.set('n', '', ':!feh --geometry 640x480+1200+50 ', { desc = 'Show image under cursor with feh' }) +vim.keymap.set('i', '', '[s1z=ea', { desc = 'Correct previous misspelt word with the first spell suggestion' }) +vim.keymap.set('n', '', '[s1z=$', { desc = 'Correct previous misspelt word with the first spell suggestion' }) require 'keymaps' @@ -610,9 +612,12 @@ require('lazy').setup({ local servers = { clangd = {}, gopls = {}, - pyright = {}, + pyright = { root_dir = require('lspconfig').util.root_pattern('.git', '.') }, + pylyzer = { root_dir = require('lspconfig').util.root_pattern('.git', '.') }, rust_analyzer = {}, - -- typos_lsp = {}, doesn't work well all the time with Dutch words + html = {}, + -- typos_lsp = {}, + -- doesn't work well all the time with Dutch words -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: @@ -652,7 +657,8 @@ require('lazy').setup({ vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code 'black', -- Used to format Python code - 'isort', -- Used to format Python code + -- 'isort', -- Used to format Python code + 'htmlbeautifier', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -700,7 +706,9 @@ require('lazy').setup({ formatters_by_ft = { lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially - python = { 'isort', 'black' }, + python = { 'isort', 'black', stop_after_first = true }, + html = { 'htmlbeautifier' }, + -- -- You can use 'stop_after_first' to run the first available formatter from the list -- javascript = { "prettierd", "prettier", stop_after_first = true }, @@ -848,13 +856,15 @@ require('lazy').setup({ -- change the command in the config to whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', + -- 'folke/tokyonight.nvim', + 'catppuccin/nvim', priority = 1000, -- Make sure to load this before all the other start plugins. init = function() -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + -- vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'catppuccin-macchiato' -- You can configure highlights by doing something like: vim.cmd.hi 'Comment gui=none'