From b139246879bd611c0e119e3be2601cfc427b4ee7 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Sat, 4 Feb 2023 13:52:00 +0200 Subject: [PATCH] Update 04.02.2023 --- lua/user/autocommands.lua | 22 ++++++++++------ lua/user/colorizer.lua | 11 ++++---- lua/user/keymaps.lua | 6 +++++ lua/user/mason/mason-installer.lua | 16 ++++++------ lua/user/mason/null-ls.lua | 39 +++++++++++++++++++---------- lua/user/mason/settings/pyright.lua | 9 ------- lua/user/plugins.lua | 3 +++ 7 files changed, 64 insertions(+), 42 deletions(-) delete mode 100644 lua/user/mason/settings/pyright.lua diff --git a/lua/user/autocommands.lua b/lua/user/autocommands.lua index e4d415f..84341df 100644 --- a/lua/user/autocommands.lua +++ b/lua/user/autocommands.lua @@ -62,7 +62,7 @@ vim.api.nvim_create_autocmd({ "InsertEnter" }, { }) vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "c", "cpp", "yaml", "vimwiki", "markdown", "html", "css", "json" }, + pattern = { "vimwiki" }, callback = function() vim.opt_local.ts = 2 vim.opt_local.sw = 2 @@ -74,12 +74,20 @@ vim.api.nvim_create_autocmd({ "FileType" }, { vim.cmd([[ highlight CursorLine ctermbg=White cterm=bold guibg=#222222 highlight CursorColumn ctermbg=White cterm=bold guibg=#222222 - autocmd FileType python imap wexec "!python3" shellescape(@%, 1) - autocmd FileType python map wexec "!python3" shellescape(@%, 1) - autocmd FileType rust imap wexec "!cargo run" - autocmd FileType rust map wexec "!cargo run" - autocmd FileType tex imap wexec "silent !lualatex %" - autocmd FileType tex map wexec "silent !lualatex %" +]]) + +-- Run file +vim.cmd([[ + augroup run_file + autocmd FileType python imap wexec "!python3 %" + autocmd FileType python map wexec "!python3 %" + autocmd FileType rust imap wexec "!cargo run" + autocmd FileType rust map wexec "!cargo run" + autocmd FileType tex imap wexec "silent !lualatex %" + autocmd FileType tex map wexec "silent !lualatex %" + autocmd FileType cpp imap wexec "!g++ % -o %:r && %:r" + autocmd FileType cpp map wexec "!g++ % -o %:r && %:r" + augroup end ]]) -- Autocommand that reloads waybar whenever you save the ~/.config/waybar/config file diff --git a/lua/user/colorizer.lua b/lua/user/colorizer.lua index 176d052..225a6ae 100644 --- a/lua/user/colorizer.lua +++ b/lua/user/colorizer.lua @@ -4,11 +4,11 @@ if not status_ok then end colorizer.setup({ - filetypes = { "*" }, + filetypes = { "html", "css", "js" }, user_default_options = { RGB = true, -- #RGB hex codes RRGGBB = true, -- #RRGGBB hex codes - names = true, -- "Name" codes like Blue or blue + names = false, -- "Name" codes like Blue or blue RRGGBBAA = true, -- #RRGGBBAA hex codes AARRGGBB = true, -- 0xAARRGGBB hex codes rgb_fn = true, -- CSS rgb() and rgba() functions @@ -23,13 +23,12 @@ colorizer.setup({ -- parsers can contain values used in |user_default_options| sass = { enable = true, - parsers = { css }, + parsers = { "css" }, }, -- Enable sass colors virtualtext = "■", }, -- all the sub-options of filetypes apply to buftypes buftypes = {}, - html = { names = false }, - markdown = { names = false }, - vimwiki = { names = false }, + -- html = { names = true }, + -- css = { names = true }, }) diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index fb41229..c0c4a41 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -5,6 +5,7 @@ local opts = { silent = true } --Remap space as leader key keymap("", "", "", opts) +keymap("n", "q", "", opts) vim.g.mapleader = " " -- Modes @@ -16,6 +17,11 @@ vim.g.mapleader = " " -- command_mode = "c", -- Normal -- +keymap("n", "", "zz", opts) +keymap("n", "", "zz", opts) +keymap("n", "n", "nzzzv", opts) +keymap("n", "N", "Nzzzv", opts) + -- Better window navigation keymap("n", "", "h", opts) keymap("n", "", "j", opts) diff --git a/lua/user/mason/mason-installer.lua b/lua/user/mason/mason-installer.lua index 63dc451..33e7622 100644 --- a/lua/user/mason/mason-installer.lua +++ b/lua/user/mason/mason-installer.lua @@ -34,7 +34,8 @@ local servers = { "emmet_ls", "html", "jsonls", - "pyright", + -- "pyright", + "jedi_language_server", "rust_analyzer", "sumneko_lua", "taplo", @@ -55,11 +56,12 @@ mason_tool.setup({ "json-lsp", "lua-language-server", "marksman", - "pyright", + -- "pyright", + "jedi-language-server", "rust-analyzer", "taplo", "texlab", - -- "typescript-language-server", + "typescript-language-server", "vim-language-server", "yaml-language-server", }, @@ -81,10 +83,10 @@ for _, server in pairs(servers) do opts = vim.tbl_deep_extend("force", sumneko_opts, opts) end - if server == "pyright" then - local pyright_opts = require("user.mason.settings.pyright") - opts = vim.tbl_deep_extend("force", pyright_opts, opts) - end + -- if server == "jedi_language_server" then + -- local pyright_opts = require("user.mason.settings.jedi") + -- opts = vim.tbl_deep_extend("force", pyright_opts, opts) + -- end -- if server == "clangd" then -- local clangd_opts = require("user.mason.settings.clangd") diff --git a/lua/user/mason/null-ls.lua b/lua/user/mason/null-ls.lua index 8fc96ed..02edecc 100644 --- a/lua/user/mason/null-ls.lua +++ b/lua/user/mason/null-ls.lua @@ -17,20 +17,33 @@ local diagnostics = null_ls.builtins.diagnostics null_ls.setup({ debug = false, sources = { - formatting.prettier.with({ - extra_filetypes = { "toml" }, - extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote", "--no-bracket-spacing" }, - }), formatting.autopep8, - formatting.stylua, formatting.beautysh, formatting.djlint, - formatting.tidy, + formatting.prettier.with({ + extra_filetypes = { "toml" }, + extra_args = { + "--no-semi", + "--double-quote", + "--no-bracket-spacing", + "--tab-width", + "4", + "--bracket-same-line", + "--html-whitespace-sensitivity", + "strict", + }, + }), + formatting.shfmt, + formatting.stylua, + formatting.isort, + formatting.yamlfmt, diagnostics.cpplint, diagnostics.luacheck, - diagnostics.pylint, + diagnostics.flake8, diagnostics.mypy, diagnostics.zsh, + diagnostics.misspell, + diagnostics.codespell, }, }) @@ -38,17 +51,17 @@ mason_null_ls.setup({ ensure_installed = { "autopep8", "beautysh", - "djlint", - "shfmt", - "yamlfmt", "codespell", "cpplint", + "djlint", + "flake8", + "gitlint", + "html_lint", "luacheck", "misspell", - "pylint", "mypy", - "html_lint", - "gitlint", + "shfmt", + "yamlfmt", }, automatic_installation = true, automatic_setup = true, diff --git a/lua/user/mason/settings/pyright.lua b/lua/user/mason/settings/pyright.lua deleted file mode 100644 index 91cf74c..0000000 --- a/lua/user/mason/settings/pyright.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - settings = { - python = { - analysis = { - typeCheckingMode = "true", - }, - }, - }, -} diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index d362e7e..a1d396b 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -105,6 +105,7 @@ return packer.startup(function(use) use("nvim-treesitter/nvim-treesitter") use("p00f/nvim-ts-rainbow") use("mechatroner/rainbow_csv") + use("mtdl9/vim-log-highlighting") -- Git use("lewis6991/gitsigns.nvim") @@ -115,6 +116,8 @@ return packer.startup(function(use) use("jayp0521/mason-nvim-dap.nvim") use("ravenxrz/DAPInstall.nvim") + use("ThePrimeagen/vim-be-good") + -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if PACKER_BOOTSTRAP then