diff --git a/config.toml b/config.toml index 9c7f89e..56a966e 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,8 @@ +#:schema ../../dotdrop-config-schema.json + [actions] dconf-load = "dconf load / < ~/.config/dconf.ini" +kanagawa-compile = "vim +KanagawaCompile +qa" [config] backup = true @@ -33,6 +36,8 @@ src = ".config/imapnotify" [dotfiles.d_nvim] dst = "~/.config/nvim" src = ".config/nvim" +instignore = [""] +actions = ["kanagawa-compile"] [dotfiles.d_rofi] dst = "~/.config/rofi" @@ -331,6 +336,7 @@ dotfiles = ["f_librewolf_overrides", "f_dconf.ini"] [profiles.mko-laptop.variables] wayland = true +scale_factor = 1.5 [profiles.Isengard] include = ["terminal"] diff --git a/home/.config/nvim/lazy-lock.json b/home/.config/nvim/lazy-lock.json index b25bc2b..accd6c8 100644 --- a/home/.config/nvim/lazy-lock.json +++ b/home/.config/nvim/lazy-lock.json @@ -20,13 +20,14 @@ "indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" }, "kanagawa.nvim": { "branch": "master", "commit": "c19b9023842697ec92caf72cd3599f7dd7be4456" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, - "lsp_signature.nvim": { "branch": "master", "commit": "1fba8f477b8c65add5e07cda0504cf7f81a9a4ab" }, "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "faeb361507aa1ef1b0e5645781e2aa0d36a4aa84" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "e4f34741daa9cf95de68a603d3e7a6844a69fdf0" }, "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, "neoformat": { "branch": "master", "commit": "e5fe7e8f7c3dd071b90f19af0e8c7cfa56cdedc7" }, + "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, + "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" }, "nvim-asciidoc-preview": { "branch": "main", "commit": "b1b757ccaff84fba37fb254421ffa34d3cbe3edb" }, "nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" }, "nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" }, @@ -34,11 +35,13 @@ "nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" }, "nvim-jdtls": { "branch": "master", "commit": "503a399e0d0b5d432068ab5ae24b9848891b0d53" }, "nvim-lspconfig": { "branch": "master", "commit": "d5d7412ff267b92a11a94e6559d5507c43670a52" }, + "nvim-navic": { "branch": "master", "commit": "0ffa7ffe6588f3417e680439872f5049e38a24db" }, + "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, "nvim-tree.lua": { "branch": "master", "commit": "80cfeadf179d5cba76f0f502c71dbcff1b515cd8" }, "nvim-treesitter": { "branch": "master", "commit": "8b9f99660294dcd11d42572c84ee33a1e284f70d" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "6c30f3c8915d7b31c3decdfe6c7672432da1809d" }, "nvim-ufo": { "branch": "main", "commit": "a6132d058f23d15686f07b8e1ca252e060a0e0ce" }, - "nvim-web-devicons": { "branch": "master", "commit": "11eb26fc166742db8d1e8a6f5a7de9df37b09aae" }, + "nvim-web-devicons": { "branch": "master", "commit": "3523d6e6d40ab11fd66c1b2732b3d6b60affa951" }, "password-store": { "branch": "master", "commit": "28cec11f1dbe6c4273d30370af45b69c9f408386" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" }, diff --git a/home/.config/nvim/lua/neovide.lua b/home/.config/nvim/lua/neovide.lua index 314dbd7..d2c9d6a 100644 --- a/home/.config/nvim/lua/neovide.lua +++ b/home/.config/nvim/lua/neovide.lua @@ -1,7 +1,8 @@ local g = vim.g +local o = vim.o -- Change scale factor with C= and C- -g.neovide_scale_factor = 1.0 +g.neovide_scale_factor = {{@@ scale_factor|default(1.0) @@}} local change_scale_factor = function(delta) g.neovide_scale_factor = g.neovide_scale_factor * delta end @@ -17,3 +18,9 @@ g.neovide_hide_mouse_when_typing = true -- Enable cursor particles in neovide g.neovide_cursor_vfx_mode = "railgun" + +-- Enable dark/light theme detection +g.neovide_theme = "auto" + +-- Set font +--o.guifont = "Hack Nerd Font Mono:h15" diff --git a/home/.config/nvim/lua/plugins/cmp.lua b/home/.config/nvim/lua/plugins/cmp.lua index a740ae6..020c371 100644 --- a/home/.config/nvim/lua/plugins/cmp.lua +++ b/home/.config/nvim/lua/plugins/cmp.lua @@ -61,6 +61,15 @@ return function() { name = "spell" }, { name = "path" }, }, + -- window = { + -- completion = { + -- winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None", + -- }, + + -- documentation = { + -- winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None", + -- }, + -- }, }) -- Enable autopairs when enter is processed diff --git a/home/.config/nvim/lua/plugins/colorscheme.lua b/home/.config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..ca26060 --- /dev/null +++ b/home/.config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,48 @@ +return function() + require("kanagawa").setup({ + compile = true, + dimInactive = true, + colors = { + theme = { + all = { + ui = { + bg_gutter = "none", -- Hide gutter background + }, + }, + }, + }, + background = { + dark = "wave", + light = "lotus", + }, + overrides = function(colors) + local theme = colors.theme + return { + -- Transparent floating windows + NormalFloat = { bg = "none" }, + FloatBorder = { bg = "none" }, + FloatTitle = { bg = "none" }, + NormalDark = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m3 }, + LazyNormal = { bg = theme.ui.bg_m3, fg = theme.ui.fg_dim }, + MasonNormal = { bg = theme.ui.bg_m3, fg = theme.ui.fg_dim }, + + -- Block-like modern Telescope UI + TelescopeTitle = { fg = theme.ui.special, bold = true }, + TelescopePromptNormal = { bg = theme.ui.bg_p1 }, + TelescopePromptBorder = { fg = theme.ui.bg_p1, bg = theme.ui.bg_p1 }, + TelescopeResultsNormal = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m1 }, + TelescopeResultsBorder = { fg = theme.ui.bg_m1, bg = theme.ui.bg_m1 }, + TelescopePreviewNormal = { bg = theme.ui.bg_dim }, + TelescopePreviewBorder = { bg = theme.ui.bg_dim, fg = theme.ui.bg_dim }, + + -- More uniform look for the popup menu + Pmenu = { fg = theme.ui.shade0, bg = theme.ui.bg_p1, blend = vim.o.pumblend }, + PmenuSel = { fg = "NONE", bg = theme.ui.bg_p2 }, + PmenuSbar = { bg = theme.ui.bg_m1 }, + PmenuThumb = { bg = theme.ui.bg_p2 }, + } + end, + }) + + vim.cmd("colorscheme kanagawa") +end diff --git a/home/.config/nvim/lua/plugins/init.lua b/home/.config/nvim/lua/plugins/init.lua index 9a3da45..0018004 100644 --- a/home/.config/nvim/lua/plugins/init.lua +++ b/home/.config/nvim/lua/plugins/init.lua @@ -17,40 +17,36 @@ local plugins = { -- Colorscheme { "rebelot/kanagawa.nvim", - config = function() - vim.cmd("colorscheme kanagawa") - end, + config = require("plugins.colorscheme"), + }, + + -- Replace much of neovim's default UI + -- with a modern replacement + { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" }, + opts = require("plugins.noice"), }, -- Statusline { "nvim-lualine/lualine.nvim", dependencies = { "kyazdani42/nvim-web-devicons" }, - config = true, - }, - - -- Git status in signcolumn - { - "lewis6991/gitsigns.nvim", - config = true, + config = require("plugins.lualine"), }, -- Tabline/bufferline - { - "akinsho/bufferline.nvim", - version = "v3.*", - dependencies = { "kyazdani42/nvim-web-devicons" }, - config = true, - }, + { "akinsho/bufferline.nvim", version = "v3.*", dependencies = { "kyazdani42/nvim-web-devicons" }, config = true }, + + -- Git status in signcolumn + { "lewis6991/gitsigns.nvim", config = true }, -- Git commands "tpope/vim-fugitive", -- Indent characters - { - "lukas-reineke/indent-blankline.nvim", - config = require("plugins.indent-blankline"), - }, + { "lukas-reineke/indent-blankline.nvim", config = require("plugins.indent-blankline") }, -- Tree explorer { @@ -64,14 +60,19 @@ local plugins = { "nvim-telescope/telescope.nvim", config = require("plugins.telescope"), dependencies = { - "nvim-lua/plenary.nvim", -- Internal dep for telescope + -- Internal dependency for telescope + "nvim-lua/plenary.nvim", + -- Use fzf for fuzzy finder { "nvim-telescope/telescope-fzf-native.nvim", build = "make", }, - "nvim-telescope/telescope-ui-select.nvim", -- Replace vim built in select with telescope - "zane-/cder.nvim", -- cd plugin for telescope + -- Replace vim built in select with telescope + "nvim-telescope/telescope-ui-select.nvim", + + -- cd plugin for telescope + "zane-/cder.nvim", }, }, @@ -95,19 +96,12 @@ local plugins = { -- Additional LSP features for Java "mfussenegger/nvim-jdtls", + -- Show code LSP context in winbar + { "SmiteshP/nvim-navic", config = true, opts = { mouse = true } }, + -- DAP plugin { "mfussenegger/nvim-dap", config = require("plugins.dap") }, - -- Display function signature - { - "ray-x/lsp_signature.nvim", - event = "VeryLazy", - opts = { always_trigger = true }, - config = function(_, opts) - require("lsp_signature").setup(opts) - end, - }, - -- Snippets plugin { "L3MON4D3/LuaSnip", @@ -176,9 +170,18 @@ local plugins = { build = function() vim.fn["firenvim#install"](0) end, + config = function() + vim.g.firenvim_config = { + localSettings = { + [".*"] = { + takeOver = "never", + }, + }, + } + end, }, - -- Vim <3 Asciidoctor + -- Vim ♥️ Asciidoctor "habamax/vim-asciidoctor", -- Asciidoc preview @@ -216,6 +219,7 @@ local plugins = { -- Better folds { + enabled = false, "kevinhwang91/nvim-ufo", dependencies = { "kevinhwang91/promise-async" }, config = require("plugins.ufo"), diff --git a/home/.config/nvim/lua/plugins/lualine.lua b/home/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..37c8065 --- /dev/null +++ b/home/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,17 @@ +return function() + require("lualine").setup({ + sections = { + lualine_y = {}, + lualine_z = {}, + }, + winbar = { + lualine_a = { "progress" }, + lualine_c = { + "navic", + color_correction = nil, + navic_opts = nil, + }, + lualine_z = { "location" }, + }, + }) +end diff --git a/home/.config/nvim/lua/plugins/mason.lua b/home/.config/nvim/lua/plugins/mason.lua index cccc862..7d84e0f 100644 --- a/home/.config/nvim/lua/plugins/mason.lua +++ b/home/.config/nvim/lua/plugins/mason.lua @@ -1,9 +1,10 @@ local m = {} function m.setup() - local function on_attach() - -- Setup lsp signature plugin - require("lsp_signature").setup({}) + local function on_attach(client, bufnr) + + -- Attach navic + require("nvim-navic").attach(client, bufnr) -- Setup keybinds m.map_keys() diff --git a/home/.config/nvim/lua/plugins/noice.lua b/home/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..83cb3d9 --- /dev/null +++ b/home/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,18 @@ +return { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, +} diff --git a/home/.config/nvim/lua/plugins/telescope.lua b/home/.config/nvim/lua/plugins/telescope.lua index 3dac263..5a30c1a 100644 --- a/home/.config/nvim/lua/plugins/telescope.lua +++ b/home/.config/nvim/lua/plugins/telescope.lua @@ -6,6 +6,29 @@ return function() pickers = { find_files = { find_command = { "fd", "-Ht", "f" } }, lsp_references = { show_line = false }, + live_grep = { + additional_args = function(opts) + return { "--hidden" } + end, + }, + }, + extensions = { + cder = { + previewer_command = "eza " + .. "-a " + .. "--color=always " + .. "-T " + .. "--level=3 " + .. "--icons " + .. "--git-ignore " + .. "--long " + .. "--no-permissions " + .. "--no-user " + .. "--no-filesize " + .. "--git " + .. "--ignore-glob=.git", + dir_command = { "fd", "-Ht", "d", ".", os.getenv("HOME") }, + }, }, }) diff --git a/home/.config/nvim/lua/plugins/treesitter.lua b/home/.config/nvim/lua/plugins/treesitter.lua index 317f527..ca53a23 100644 --- a/home/.config/nvim/lua/plugins/treesitter.lua +++ b/home/.config/nvim/lua/plugins/treesitter.lua @@ -4,6 +4,11 @@ return function() "bash", "css", "dockerfile", + "git_config", + "git_rebase", + "gitattributes", + "gitcommit", + "gitignore", "html", "http", "java", @@ -14,6 +19,7 @@ return function() "lua", "make", "markdown", + "markdown_inline", "php", "python", "rasi", @@ -23,6 +29,7 @@ return function() "toml", "tsx", "typescript", + "vim", "yaml", }, highlight = { enable = true }, diff --git a/home/.config/nvim/lua/plugins/ufo.lua b/home/.config/nvim/lua/plugins/ufo.lua index dbdce24..d758224 100644 --- a/home/.config/nvim/lua/plugins/ufo.lua +++ b/home/.config/nvim/lua/plugins/ufo.lua @@ -1,7 +1,20 @@ return function() - require("ufo").setup({ + local keymap = vim.keymap + local o = vim.o + local ufo = require("ufo") + ufo.setup({ close_fold_kinds = { "imports", }, }) + + -- Using ufo, need to remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself + keymap.set("n", "zR", ufo.openAllFolds) + keymap.set("n", "zM", ufo.closeAllFolds) + + -- Fold settings + o.foldcolumn = "1" + o.foldlevel = 99 + o.foldlevelstart = 99 + o.foldenable = true end diff --git a/home/.config/nvim/lua/plugins/which-key.lua b/home/.config/nvim/lua/plugins/which-key.lua index e7e9fad..7c1cbf8 100644 --- a/home/.config/nvim/lua/plugins/which-key.lua +++ b/home/.config/nvim/lua/plugins/which-key.lua @@ -15,10 +15,15 @@ return function() ["]"] = { h = { gitsigns.next_hunk, "Next hunk" } }, }) + -- Open cder + wk.register({ cd = { + function() + vim.cmd("Telescope cder") + end, + "Change directories", + } }) + -- Exit terminal insert mode with esc vim.keymap.set("t", "", "", {}) - -- Using ufo, need to remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself - vim.keymap.set("n", "zR", require("ufo").openAllFolds) - vim.keymap.set("n", "zM", require("ufo").closeAllFolds) end diff --git a/home/.config/nvim/lua/settings.lua b/home/.config/nvim/lua/settings.lua index 06c984a..aad296f 100644 --- a/home/.config/nvim/lua/settings.lua +++ b/home/.config/nvim/lua/settings.lua @@ -1,7 +1,9 @@ local o = vim.o local g = vim.g +o.pumblend = 10 -- Relative line numbers +o.number = true o.relativenumber = true -- True colors @@ -20,8 +22,6 @@ o.diffopt = "filler,internal,algorithm:histogram,indent-heuristic" -- Allow switching buffers with unsaved changes o.hidden = true --- Show line numbers -o.number = true o.guicursor = table.concat({ "i:ver1", -- Vertical bar cursor in insert mode @@ -31,8 +31,6 @@ o.guicursor = table.concat({ -- Enable global statusline o.laststatus = 3 -o.cmdheight = 1 - -- Use suda by default g.suda_smart_edit = 1 @@ -47,18 +45,3 @@ g.mapleader = " " o.tabstop = 4 o.shiftwidth = 4 o.smartindent = true - --- Firenvim settings -g.firenvim_config = { - localSettings = { - [".*"] = { - takeOver = "never", - }, - }, -} - --- Fold settings (for ufo) -o.foldcolumn = "1" -o.foldlevel = 99 -o.foldlevelstart = 99 -o.foldenable = true diff --git a/home/.ignore b/home/.ignore index 2dc5ae4..d140230 100644 --- a/home/.ignore +++ b/home/.ignore @@ -16,3 +16,7 @@ .android/ .audacity-data/ .zcompdump* +.var/ +.npm/ +.vscode-oss/ +.git/