diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..86e884b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7d6b72f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: rhysd/action-setup-vim@v1 + with: + neovim: true + version: v0.12 + - name: Validate config loads without errors + run: nvim --headless -c "lua vim.cmd('q!')" -c "qa!" + - name: Check Lua syntax + run: | + for f in $(find lua colors -name '*.lua' -not -path '*/lazy-lock.json'); do + nvim --headless -c "lua local ok, err = loadfile('$f'); if not ok then io.stderr:write(err..'\n'); vim.cmd('cquit!') else vim.cmd('q!') end" 2>/dev/null || exit 1 + done + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: JohnnyMorganz/stylua-action@v4 + with: + version: latest + args: --check lua/ diff --git a/.gitignore b/.gitignore index e21d6de..700e939 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -lazy-lock.json .DS_Store *.swp *.swo diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..89ea967 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", + "runtime": { + "version": "LuaJIT" + }, + "workspace": { + "checkThirdParty": false, + "library": [ + "${3rd}/luv/library", + "${3rd}/busted/library" + ] + }, + "diagnostics": { + "globals": ["vim"] + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1dc8745 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,51 @@ +# Changelog + +## 2026-06-26 + +### Bugfixes +- Fixed deprecated `vim.loop.fs_stat` -> `vim.uv.fs_stat` in lazy.lua +- Fixed inconsistent hex format in `seul` palette (`#1b1b1bff` -> `#1b1b1b`) +- Fixed selene config from `lua52` to `luajit` + +### Configuration improvements +- Updated Neovim requirement to >= 0.11 (README + badge) +- Enabled `update_in_insert = true` for real-time diagnostics +- Added `cmdheight = 0` for cleaner UI with noice.nvim +- Created `.luarc.json` for LuaLS project configuration +- Removed `lazy-lock.json` from gitignore (reproducible installs) +- Created `.editorconfig` for cross-editor consistency + +### New keymaps +- Window navigation: `` for moving between splits +- Clipboard: `y` (yank selection), `Y` (yank line) to system clipboard +- Terminal: `` to exit terminal mode +- DAP: `db/dC/dx/dr/di/dO>` for debugger control +- Harpoon: `ha` (add), `hh` (menu), `h1-4` (quick jump) +- Sessions: `qs` (save), `ql` (load), `qd` (stop) + +### New plugins +- `stevearc/dressing.nvim` - improved UI for vim.ui.select/input +- `ThePrimeagen/harpoon` (harpoon2) - quick file navigation +- `folke/persistence.nvim` - session save/restore +- `OXY2DEV/markview.nvim` - inline markdown rendering + +### LSP expansion +- Added 6 new language servers: `dockerls`, `emmet_ls`, `gopls`, `sqlls`, `taplo`, `vimls` + +### Formatters and linters +- Formatters: `shfmt` (shell), `taplo` (TOML), `sqlfluff` (SQL) +- Linters: `shellcheck` (sh/bash/zsh), `markdownlint` (markdown) + +### Dashboard +- Removed V character from alpha-nvim ASCII art +- Added flame accents (`~`) around the X +- Added quote: "The eternal withers and the ephemeral marks our memories." +- Added diagnostics section to lualine statusline + +### Nvim 0.12 features +- Enabled `vim.lsp.completion.enable()` for inline LSP completion + +### CI +- Pinned Neovim version to v0.12 (stable instead of nightly) +- Added StyLua formatting check job +- Added Lua syntax validation step via `loadfile` diff --git a/README.md b/README.md index c0e794d..f71c85b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

X

-![Neovim](https://img.shields.io/badge/Neovim-0.10+-57A143?style=flat&logo=neovim&logoColor=white) +![Neovim](https://img.shields.io/badge/Neovim-0.11+-57A143?style=flat&logo=neovim&logoColor=white) ![Lua](https://img.shields.io/badge/Lua-5.1-2C2D72?style=flat&logo=lua&logoColor=white) ![License](https://img.shields.io/badge/license-MIT-blue?style=flat) ![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat) @@ -20,7 +20,10 @@ Complete Neovim configuration with essential plugins, LSP, DAP, formatting, lint
  • Themes
  • Keybindings
  • Included Plugins
  • +
  • Colors
  • Notes
  • +
  • Related Documents
  • +
  • Related Repos
  • X
  • @@ -28,7 +31,7 @@ Complete Neovim configuration with essential plugins, LSP, DAP, formatting, lint

    Requirements

      -
    • Neovim >= 0.10 (nightly for vim.lsp.config API)
    • +
    • Neovim >= 0.11
    • git
    • ripgrep
    • fd
    • @@ -137,7 +140,7 @@ vim.g.langmap_en = ""

      If a formatter or linter binary is not installed, conform and nvim-lint will skip it without failing. Use Mason or your preferred package manager to install them.

      -

      Related documents

      +
      • Cheatsheet
      • diff --git a/docs/cheatsheet.md b/docs/cheatsheet.md index 317ccff..5e2e507 100644 --- a/docs/cheatsheet.md +++ b/docs/cheatsheet.md @@ -45,6 +45,15 @@ - `q` → Quit all (`:qa`). - `e` → Open file explorer (Oil.nvim). - `t` → Toggle terminal (ToggleTerm). +- `y` → Yank selected text to system clipboard. +- `Y` → Yank current line to system clipboard. + +### Window Navigation +- `` → Move to left window. +- `` → Move to window below. +- `` → Move to window above. +- `` → Move to right window. +- `` → Exit terminal mode. ### Telescope - `ff` → Find files. @@ -68,4 +77,25 @@ - `[d` → Previous diagnostic. - `]d` → Next diagnostic. - `do`→ Open diagnostic float. -- `dl`→ Send diagnostics to location list. \ No newline at end of file +- `dl`→ Send diagnostics to location list. + +### Debug (DAP) +- `db`→ Toggle breakpoint. +- `dC`→ Continue. +- `dx`→ Terminate. +- `dr`→ Step over. +- `di`→ Step into. +- `dO`→ Step out. + +### Harpoon +- `ha`→ Add current file to harpoon. +- `hh`→ Toggle harpoon menu. +- `h1`→ Go to harpoon file 1. +- `h2`→ Go to harpoon file 2. +- `h3`→ Go to harpoon file 3. +- `h4`→ Go to harpoon file 4. + +### Sessions +- `qs`→ Save current session. +- `ql`→ Load last session. +- `qd`→ Stop session (no auto-save). \ No newline at end of file diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index bb6f989..7e82abc 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -1,14 +1,59 @@

        Troubleshooting

        -If theres an issue with treesitter just run: +

        Treesitter issues

        + +

        If you see missing syntax highlighting or parser errors:

        ```bash rm -rf ~/.local/share/nvim/lazy/nvim-treesitter -# after you should open this again: nvim -#run lazy -:lazy -#and press -U -S -``` \ No newline at end of file +``` + +

        Then run :Lazy and press U to update, or rebuild parsers with:

        + +```vim +:TSUpdate +``` + +

        LSP not working

        + +

        Check that servers are installed:

        + +```vim +:Mason +``` + +

        If a server is missing, install it from Mason. Then verify the language server starts:

        + +```vim +:checkhealth lsp +``` + +

        Missing icons

        + +

        If you see missing or broken icons, make sure you have a Nerd Font installed and +configured in your terminal. The config uses nvim-web-devicons +which requires a patched font.

        + +

        Plugin not loading

        + +```vim +:Lazy +``` + +

        Press I to install missing plugins, or U to update all.

        + +

        To reset a single plugin:

        + +```bash +rm -rf ~/.local/share/nvim/lazy/PLUGIN_NAME +nvim +``` + +

        General health check

        + +```vim +:checkhealth +``` + +

        This runs diagnostics for Neovim and all configured plugins.

        \ No newline at end of file diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..19df643 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,53 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" }, + "alpha-nvim": { "branch": "main", "commit": "6c6a89d5b068b5251c8bdf0dd57bb921bcfeeb09" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, + "fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "gitsigns.nvim": { "branch": "main", "commit": "2038c666bd9d8a0b7349a0b6ee00dc83104b9ecf" }, + "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, + "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, + "markview.nvim": { "branch": "main", "commit": "301e431c7b618235f5447d54465c70934bd33668" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "50bf3871b539896bd0650b882f6e6b467cc1c1eb" }, + "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, + "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-dap": { "branch": "master", "commit": "9e848e09a697ee95302a3ef2dd43fd6eb709e570" }, + "nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" }, + "nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" }, + "nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" }, + "nvim-lint": { "branch": "master", "commit": "a219b2c9e5b4765e5c845aba119dad55806fcaf1" }, + "nvim-lspconfig": { "branch": "master", "commit": "3371bf298c1f56efc26771ee961f461176958fb5" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, + "nvim-surround": { "branch": "main", "commit": "8b47db616ef658b8fc27e61db2896aa2f40134de" }, + "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, + "nvim-treesitter-context": { "branch": "master", "commit": "b311b30818951d01f7b4bf650521b868b3fece16" }, + "nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" }, + "nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" }, + "oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" }, + "persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" }, + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" }, + "telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, + "vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +} diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 7338c26..53e0038 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -18,3 +18,12 @@ map("n", "dl", vim.diagnostic.setloclist, { desc = "Diagnostic list" }) map("n", "t", "ToggleTerm", { desc = "Toggle terminal" }) map("t", "t", "ToggleTerm", { desc = "Toggle terminal" }) +map("t", "", "", { desc = "Exit terminal mode" }) + +map("n", "", "h", { desc = "Window left" }) +map("n", "", "j", { desc = "Window down" }) +map("n", "", "k", { desc = "Window up" }) +map("n", "", "l", { desc = "Window right" }) + +map({ "n", "x" }, "y", '"+y', { desc = "Yank to clipboard" }) +map("n", "Y", '"+Y', { desc = "Yank line to clipboard" }) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index a516c2f..c3bba47 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,6 +1,6 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then +if not vim.uv.fs_stat(lazypath) then vim.fn.system({ "git", "clone", diff --git a/lua/config/options.lua b/lua/config/options.lua index d6dfc1a..af5361a 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -27,13 +27,14 @@ opt.backup = false opt.confirm = true opt.laststatus = 3 opt.showmode = false +opt.cmdheight = 0 opt.list = true opt.listchars = { tab = "->", trail = ".", extends = ">", precedes = "<", nbsp = "+" } opt.fillchars = { eob = " " } vim.diagnostic.config({ underline = true, - update_in_insert = false, + update_in_insert = true, severity_sort = true, float = { border = "rounded" }, signs = true, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 48337b8..97bb0cd 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -12,12 +12,18 @@ return { ensure_installed = { "bashls", "cssls", + "dockerls", + "emmet_ls", + "gopls", "html", "jsonls", "lua_ls", "pyright", "rust_analyzer", + "sqlls", + "taplo", "ts_ls", + "vimls", "yamlls", }, }, @@ -43,6 +49,8 @@ return { config = function() local capabilities = require("cmp_nvim_lsp").default_capabilities() + vim.lsp.completion.enable(true, nil, { cmp = true }) + local function on_attach(_, bufnr) local map = function(mode, lhs, rhs, desc) vim.keymap.set(mode, lhs, rhs, { buffer = bufnr, desc = desc }) @@ -60,6 +68,9 @@ return { local servers = { bashls = {}, cssls = {}, + dockerls = {}, + emmet_ls = {}, + gopls = {}, html = {}, jsonls = {}, lua_ls = { @@ -72,7 +83,10 @@ return { }, pyright = {}, rust_analyzer = {}, + sqlls = {}, + taplo = {}, ts_ls = {}, + vimls = {}, yamlls = {}, } diff --git a/lua/plugins/tools.lua b/lua/plugins/tools.lua index 0e8c482..369e4f9 100644 --- a/lua/plugins/tools.lua +++ b/lua/plugins/tools.lua @@ -35,7 +35,7 @@ return { "stevearc/conform.nvim", event = "BufWritePre", opts = { - format_on_save = { timeout_ms = 1000, lsp_fallback = true }, + format_on_save = { timeout_ms = 2000, lsp_fallback = true }, formatters_by_ft = { lua = { "stylua" }, javascript = { "prettier" }, @@ -46,6 +46,10 @@ return { python = { "black" }, rust = { "rustfmt" }, go = { "gofmt" }, + sh = { "shfmt" }, + bash = { "shfmt" }, + toml = { "taplo" }, + sql = { "sqlfluff" }, }, }, }, @@ -58,9 +62,13 @@ return { javascript = { "eslint_d" }, typescript = { "eslint_d" }, python = { "ruff" }, + sh = { "shellcheck" }, + bash = { "shellcheck" }, + zsh = { "shellcheck" }, + markdown = { "markdownlint" }, } - vim.api.nvim_create_autocmd({ "BufWritePost", "BufReadPost", "InsertLeave" }, { + vim.api.nvim_create_autocmd({ "BufWritePost", "BufReadPost" }, { callback = function() lint.try_lint() end, @@ -84,6 +92,15 @@ return { { "mfussenegger/nvim-dap", event = "VeryLazy", + config = function() + local dap = require("dap") + vim.keymap.set("n", "db", dap.toggle_breakpoint, { desc = "DAP toggle breakpoint" }) + vim.keymap.set("n", "dC", dap.continue, { desc = "DAP continue" }) + vim.keymap.set("n", "dx", dap.terminate, { desc = "DAP terminate" }) + vim.keymap.set("n", "dr", dap.step_over, { desc = "DAP step over" }) + vim.keymap.set("n", "di", dap.step_into, { desc = "DAP step into" }) + vim.keymap.set("n", "dO", dap.step_out, { desc = "DAP step out" }) + end, }, { "rcarriga/nvim-dap-ui", @@ -106,4 +123,51 @@ return { end end, }, + { + "mfussenegger/nvim-dap-python", + event = "VeryLazy", + dependencies = { "mfussenegger/nvim-dap" }, + config = function() + require("dap-python").setup("python") + end, + }, + { + "mxsdev/nvim-dap-vscode-js", + event = "VeryLazy", + dependencies = { "mfussenegger/nvim-dap" }, + opts = { + adapters = { "pwa-node", "pwa-chrome" }, + }, + }, + { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") + harpoon:setup() + vim.keymap.set("n", "ha", function() harpoon:list():add() end, { desc = "Harpoon add file" }) + vim.keymap.set("n", "hh", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = "Harpoon menu" }) + vim.keymap.set("n", "h1", function() harpoon:list():select(1) end, { desc = "Harpoon file 1" }) + vim.keymap.set("n", "h2", function() harpoon:list():select(2) end, { desc = "Harpoon file 2" }) + vim.keymap.set("n", "h3", function() harpoon:list():select(3) end, { desc = "Harpoon file 3" }) + vim.keymap.set("n", "h4", function() harpoon:list():select(4) end, { desc = "Harpoon file 4" }) + end, + }, + { + "folke/persistence.nvim", + event = "BufReadPre", + opts = {}, + config = function(_, opts) + require("persistence").setup(opts) + vim.keymap.set("n", "qs", function() require("persistence").save() end, { desc = "Save session" }) + vim.keymap.set("n", "ql", function() require("persistence").load() end, { desc = "Load last session" }) + vim.keymap.set("n", "qd", function() require("persistence").stop() end, { desc = "Stop session" }) + end, + }, + { + "OXY2DEV/markview.nvim", + ft = "markdown", + opts = {}, + }, } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 2f9175d..11bb1e0 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -3,14 +3,25 @@ return { "nvim-lualine/lualine.nvim", event = "VeryLazy", dependencies = { "nvim-tree/nvim-web-devicons" }, - opts = { - options = { - theme = "auto", - section_separators = "", - component_separators = "|", - globalstatus = true, - }, - }, + opts = function() + return { + options = { + theme = require("themes.lualine").theme(), + section_separators = "", + component_separators = "|", + globalstatus = true, + }, + sections = { + lualine_c = { + { + "diagnostics", + sources = { "nvim_lsp" }, + symbols = { error = "E:", warn = "W:", info = "I:", hint = "H:" }, + }, + }, + }, + } + end, }, { "akinsho/bufferline.nvim", @@ -71,23 +82,37 @@ return { local alpha = require("alpha") local dashboard = require("alpha.themes.dashboard") dashboard.section.header.val = { - "XX XX", - " XX XX ", - " XX XX ", - " XXX ", - " XX XX ", - " XX XX ", - "XX XX", + "~ ██╗ ██╗ ~", + "~ ╚██╗██╔╝ ~", + "~ ╚███╔╝ ~", + "~ ██╔██╗ ~", + "~ ██╔╝ ██╗ ~", + "~ ╚═╝ ╚═╝ ~", + "", + "The eternal", + "withers ", + "and the ephemeral", + "marks our memories.", } dashboard.section.buttons.val = { dashboard.button("e", "New file", ":ene startinsert "), dashboard.button("f", "Find file", ":Telescope find_files"), dashboard.button("r", "Recent", ":Telescope oldfiles"), + dashboard.button("o", "Explorer", ":Oil"), + dashboard.button("t", "Terminal", ":ToggleTerm"), + dashboard.button("s", "Session", ":lua require('persistence').load()"), + dashboard.button("l", "Lazy", ":Lazy"), + dashboard.button("c", "Theme", ":Theme "), dashboard.button("q", "Quit", ":qa"), } alpha.setup(dashboard.config) end, }, + { + "stevearc/dressing.nvim", + event = "VeryLazy", + opts = {}, + }, { "norcalli/nvim-colorizer.lua", event = "BufReadPost", diff --git a/lua/themes/init.lua b/lua/themes/init.lua index dfbb087..6715185 100644 --- a/lua/themes/init.lua +++ b/lua/themes/init.lua @@ -197,6 +197,40 @@ function M.apply(name) set_hl("GitSignsChange", { fg = c.yellow }) set_hl("GitSignsDelete", { fg = c.red }) + set_hl("BufferLineFill", { bg = c.bg_alt }) + set_hl("BufferLineBackground", { fg = c.comment, bg = c.bg_alt }) + set_hl("BufferLineBufferVisible", { fg = c.fg, bg = c.bg_alt }) + set_hl("BufferLineBufferSelected", { fg = c.fg, bg = c.bg }) + + set_hl("NoiceCmdlinePopup", { fg = c.fg, bg = c.bg_alt }) + set_hl("NoiceCmdlinePopupBorder", { fg = c.cyan, bg = c.bg_alt }) + set_hl("NoicePopup", { fg = c.fg, bg = c.bg_alt }) + + set_hl("NotifyERROR", { fg = c.red }) + set_hl("NotifyWARN", { fg = c.yellow }) + set_hl("NotifyINFO", { fg = c.cyan }) + set_hl("NotifyDEBUG", { fg = c.comment }) + set_hl("NotifyTRACE", { fg = c.purple }) + + set_hl("TroubleNormal", { fg = c.fg, bg = c.bg }) + set_hl("TroubleText", { fg = c.fg }) + + set_hl("TodoFgTODO", { fg = c.bright_yellow }) + set_hl("TodoFgFIX", { fg = c.red }) + set_hl("TodoFgHACK", { fg = c.purple }) + set_hl("TodoSignTODO", { fg = c.bright_yellow }) + set_hl("TodoSignFIX", { fg = c.red }) + + set_hl("WhichKey", { fg = c.cyan }) + set_hl("WhichKeyGroup", { fg = c.yellow }) + set_hl("WhichKeyDesc", { fg = c.fg }) + set_hl("WhichKeySeparator", { fg = c.comment }) + + set_hl("CmpItemAbbr", { fg = c.fg }) + set_hl("CmpItemAbbrMatch", { fg = c.bright_cyan, bold = true }) + set_hl("CmpItemKind", { fg = c.purple }) + set_hl("CmpItemMenu", { fg = c.comment }) + vim.g.terminal_color_0 = c.bg vim.g.terminal_color_1 = c.red vim.g.terminal_color_2 = c.green @@ -217,8 +251,14 @@ end M.names = vim.tbl_keys(palettes) -vim.api.nvim_create_user_command("Theme", function(opts) + vim.api.nvim_create_user_command("Theme", function(opts) M.apply(opts.args) + pcall(function() + local lualine_ok, lualine = pcall(require, "lualine") + if lualine_ok then + lualine.setup({ options = { theme = require("themes.lualine").theme(opts.args) } }) + end + end) end, { nargs = 1, complete = function() return M.names end }) diff --git a/lua/themes/lualine.lua b/lua/themes/lualine.lua new file mode 100644 index 0000000..7f302f8 --- /dev/null +++ b/lua/themes/lualine.lua @@ -0,0 +1,69 @@ +local palettes = require("themes.palettes") + +local function strip_alpha(hex) + if #hex == 9 then + return hex:sub(1, 7) + end + return hex +end + +local M = {} + +function M.theme(name) + name = name or vim.g.colors_name or "x" + local p = palettes[name] + if not p then + p = palettes.x + end + + local c = { + bg = strip_alpha(p.background), + fg = strip_alpha(p.foreground), + bg_alt = strip_alpha(p.color8), + comment = strip_alpha(p.color8), + red = strip_alpha(p.color1), + green = strip_alpha(p.color2), + yellow = strip_alpha(p.color3), + cyan = strip_alpha(p.color6), + } + + return { + normal = { + a = { bg = c.cyan, fg = c.bg, gui = "bold" }, + b = { bg = c.bg_alt, fg = c.fg }, + c = { bg = c.bg, fg = c.fg }, + }, + insert = { + a = { bg = c.green, fg = c.bg, gui = "bold" }, + b = { bg = c.bg_alt, fg = c.fg }, + c = { bg = c.bg, fg = c.fg }, + }, + visual = { + a = { bg = c.yellow, fg = c.bg, gui = "bold" }, + b = { bg = c.bg_alt, fg = c.fg }, + c = { bg = c.bg, fg = c.fg }, + }, + replace = { + a = { bg = c.red, fg = c.bg, gui = "bold" }, + b = { bg = c.bg_alt, fg = c.fg }, + c = { bg = c.bg, fg = c.fg }, + }, + command = { + a = { bg = c.red, fg = c.bg, gui = "bold" }, + b = { bg = c.bg_alt, fg = c.fg }, + c = { bg = c.bg, fg = c.fg }, + }, + terminal = { + a = { bg = c.bg_alt, fg = c.green, gui = "bold" }, + b = { bg = c.bg_alt, fg = c.fg }, + c = { bg = c.bg, fg = c.fg }, + }, + inactive = { + a = { bg = c.bg_alt, fg = c.comment, gui = "bold" }, + b = { bg = c.bg_alt, fg = c.comment }, + c = { bg = c.bg, fg = c.comment }, + }, + } +end + +return M diff --git a/lua/themes/palettes.lua b/lua/themes/palettes.lua index 3a7eac4..a0186f3 100644 --- a/lua/themes/palettes.lua +++ b/lua/themes/palettes.lua @@ -60,7 +60,7 @@ return { foreground = "#f7f1ff", }, seul = { - color0 = "#1b1b1bff", + color0 = "#1b1b1b", color1 = "#FF4C8B", color2 = "#7FFFD4", color3 = "#FFD84C", diff --git a/selene.toml b/selene.toml new file mode 100644 index 0000000..faa6ec9 --- /dev/null +++ b/selene.toml @@ -0,0 +1,9 @@ +[base] +config = "selene" +std = "luajit" + +[style] +allow_unused_variable_prefixes = "_" + +[lint] +unused_arguments = "warn"