From a407764a62e4ab4922260010d96bc50c1f9e419d Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 30 Jul 2023 00:50:07 +0200 Subject: [PATCH] Improved configuration --- .config/nushell/alias.nu | 5 ++-- .config/nvim/lazy-lock.json | 2 +- .config/nvim/lua/config/autocmds.lua | 13 ++++++++++ .config/nvim/lua/config/lazy.lua | 26 ++++--------------- .config/nvim/lua/config/options.lua | 1 + .../lua/plugins/{files.lua => explorer.lua} | 0 .config/nvim/lua/plugins/formatters.lua | 13 ++++++++++ .../lua/plugins/{syntax.lua => highlight.lua} | 5 +++- .../lua/plugins/{lsp.lua => languages.lua} | 10 ++++--- .config/nvim/lua/plugins/mason.lua | 15 +++++++++++ .config/nvim/lua/plugins/prettier.lua | 15 ----------- .../lua/plugins/{colors.lua => theme.lua} | 0 12 files changed, 62 insertions(+), 43 deletions(-) rename .config/nvim/lua/plugins/{files.lua => explorer.lua} (100%) create mode 100644 .config/nvim/lua/plugins/formatters.lua rename .config/nvim/lua/plugins/{syntax.lua => highlight.lua} (89%) rename .config/nvim/lua/plugins/{lsp.lua => languages.lua} (90%) create mode 100644 .config/nvim/lua/plugins/mason.lua delete mode 100644 .config/nvim/lua/plugins/prettier.lua rename .config/nvim/lua/plugins/{colors.lua => theme.lua} (100%) diff --git a/.config/nushell/alias.nu b/.config/nushell/alias.nu index 45dd0a7..125973b 100644 --- a/.config/nushell/alias.nu +++ b/.config/nushell/alias.nu @@ -3,11 +3,12 @@ $env.EDITOR = 'nvim' $env.GOPATH = $"($env.HOME)/.go" # Aliases -alias ll = ls -la alias gb = go build alias gt = go test alias gd = git diff alias gp = git pull alias gs = git status alias hex = hexdump -C -alias home = /usr/bin/git $"--git-dir=($env.HOME)/.home/" $"--work-tree=($env.HOME)" +alias home = git $"--git-dir=($env.HOME)/.home/" $"--work-tree=($env.HOME)" +alias ll = ls -la +alias n = nvim diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 6a30af1..0513e0c 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -41,7 +41,7 @@ "onedark.nvim": { "branch": "master", "commit": "cae5fdf035ee92c407a29ee2ccfcff503d2be7f1" }, "persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, - "telescope.nvim": { "branch": "master", "commit": "22735947d84d78f29436c203f0a4b8dc15dda204" }, + "telescope.nvim": { "branch": "master", "commit": "b6fccfb0f7589a87587875206786daccba62acc3" }, "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, "tokyonight.nvim": { "branch": "main", "commit": "1ee11019f8a81dac989ae1db1a013e3d582e2033" }, "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index 27e9e06..e122466 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -1,3 +1,16 @@ -- Autocmds are automatically loaded on the VeryLazy event -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua -- Add any additional autocmds here + +-- Disable spell checking +vim.api.nvim_clear_autocmds({ + group = "lazyvim_wrap_spell", +}) + +-- Enable wrapping +vim.api.nvim_create_autocmd("FileType", { + pattern = { "gitcommit", "markdown" }, + callback = function() + vim.opt_local.wrap = true + end, +}) diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index aac01af..8cf7bb6 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -1,41 +1,25 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) + -- stylua: ignore + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) end vim.opt.rtp:prepend(vim.env.LAZY or lazypath) require("lazy").setup({ spec = { - -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, - -- { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, - -- import/override with your plugins { import = "plugins" }, }, defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = false, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver + version = false, }, - install = { colorscheme = { "tokyonight", "habamax" } }, - checker = { enabled = true }, -- automatically check for plugin updates + install = { colorscheme = { "onedark" } }, + checker = { enabled = true }, performance = { rtp = { - -- disable some rtp plugins disabled_plugins = { "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", "tarPlugin", "tohtml", "tutor", diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua index b8aabfb..1d78e03 100644 --- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -10,4 +10,5 @@ opt.tabstop = 4 opt.softtabstop = 4 opt.autoindent = true opt.smartindent = true +opt.spell = false opt.conceallevel = 0 diff --git a/.config/nvim/lua/plugins/files.lua b/.config/nvim/lua/plugins/explorer.lua similarity index 100% rename from .config/nvim/lua/plugins/files.lua rename to .config/nvim/lua/plugins/explorer.lua diff --git a/.config/nvim/lua/plugins/formatters.lua b/.config/nvim/lua/plugins/formatters.lua new file mode 100644 index 0000000..fc869d6 --- /dev/null +++ b/.config/nvim/lua/plugins/formatters.lua @@ -0,0 +1,13 @@ +return { + "jose-elias-alvarez/null-ls.nvim", + opts = function() + local nls = require("null-ls") + return { + sources = { + nls.builtins.formatting.prettierd, + nls.builtins.formatting.shfmt, + nls.builtins.formatting.stylua, + }, + } + end, +} diff --git a/.config/nvim/lua/plugins/syntax.lua b/.config/nvim/lua/plugins/highlight.lua similarity index 89% rename from .config/nvim/lua/plugins/syntax.lua rename to .config/nvim/lua/plugins/highlight.lua index 492ff6d..83284fc 100644 --- a/.config/nvim/lua/plugins/syntax.lua +++ b/.config/nvim/lua/plugins/highlight.lua @@ -1,15 +1,18 @@ --- syntax highlighting return { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = { "lua", + + -- web dev "html", "css", "javascript", "typescript", "svelte", "json", + + -- go "go", "gomod", "gowork", diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/languages.lua similarity index 90% rename from .config/nvim/lua/plugins/lsp.lua rename to .config/nvim/lua/plugins/languages.lua index fb90f81..f9136f2 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/languages.lua @@ -2,8 +2,15 @@ return { "neovim/nvim-lspconfig", opts = { servers = { + lua_ls = {}, + + -- web dev cssls = {}, html = {}, + tsserver = {}, + svelte = {}, + + -- go gopls = { settings = { gopls = { @@ -11,9 +18,6 @@ return { }, }, }, - lua_ls = {}, - svelte = {}, - tsserver = {}, }, }, } diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..d09139b --- /dev/null +++ b/.config/nvim/lua/plugins/mason.lua @@ -0,0 +1,15 @@ +return { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + -- Go + "gofumpt", + -- HTML, CSS, JS, TS, JSON, Markdown, YAML + "prettierd", + -- Bash + "shfmt", + -- Lua + "stylua", + }, + }, +} diff --git a/.config/nvim/lua/plugins/prettier.lua b/.config/nvim/lua/plugins/prettier.lua deleted file mode 100644 index 6227ef6..0000000 --- a/.config/nvim/lua/plugins/prettier.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - { - "williamboman/mason.nvim", - opts = function(_, opts) - table.insert(opts.ensure_installed, "prettierd") - end, - }, - { - "jose-elias-alvarez/null-ls.nvim", - opts = function(_, opts) - local nls = require("null-ls") - table.insert(opts.sources, nls.builtins.formatting.prettierd) - end, - }, -} diff --git a/.config/nvim/lua/plugins/colors.lua b/.config/nvim/lua/plugins/theme.lua similarity index 100% rename from .config/nvim/lua/plugins/colors.lua rename to .config/nvim/lua/plugins/theme.lua