Tweak neovim config

- Add noice, navic
- Tweak theme configuration
- Tweak cder configuration
- Update .ignore file
This commit is contained in:
Marko Korhonen 2023-11-17 08:01:52 +02:00
parent ad3d734adc
commit c99903e78e
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
15 changed files with 211 additions and 63 deletions

View file

@ -1,5 +1,8 @@
#:schema ../../dotdrop-config-schema.json
[actions] [actions]
dconf-load = "dconf load / < ~/.config/dconf.ini" dconf-load = "dconf load / < ~/.config/dconf.ini"
kanagawa-compile = "vim +KanagawaCompile +qa"
[config] [config]
backup = true backup = true
@ -33,6 +36,8 @@ src = ".config/imapnotify"
[dotfiles.d_nvim] [dotfiles.d_nvim]
dst = "~/.config/nvim" dst = "~/.config/nvim"
src = ".config/nvim" src = ".config/nvim"
instignore = [""]
actions = ["kanagawa-compile"]
[dotfiles.d_rofi] [dotfiles.d_rofi]
dst = "~/.config/rofi" dst = "~/.config/rofi"
@ -331,6 +336,7 @@ dotfiles = ["f_librewolf_overrides", "f_dconf.ini"]
[profiles.mko-laptop.variables] [profiles.mko-laptop.variables]
wayland = true wayland = true
scale_factor = 1.5
[profiles.Isengard] [profiles.Isengard]
include = ["terminal"] include = ["terminal"]

View file

@ -20,13 +20,14 @@
"indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" }, "indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" },
"kanagawa.nvim": { "branch": "master", "commit": "c19b9023842697ec92caf72cd3599f7dd7be4456" }, "kanagawa.nvim": { "branch": "master", "commit": "c19b9023842697ec92caf72cd3599f7dd7be4456" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lsp_signature.nvim": { "branch": "master", "commit": "1fba8f477b8c65add5e07cda0504cf7f81a9a4ab" },
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "faeb361507aa1ef1b0e5645781e2aa0d36a4aa84" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "faeb361507aa1ef1b0e5645781e2aa0d36a4aa84" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "e4f34741daa9cf95de68a603d3e7a6844a69fdf0" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "e4f34741daa9cf95de68a603d3e7a6844a69fdf0" },
"mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" },
"neoformat": { "branch": "master", "commit": "e5fe7e8f7c3dd071b90f19af0e8c7cfa56cdedc7" }, "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-asciidoc-preview": { "branch": "main", "commit": "b1b757ccaff84fba37fb254421ffa34d3cbe3edb" },
"nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" }, "nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" },
"nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" }, "nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" },
@ -34,11 +35,13 @@
"nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" }, "nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" },
"nvim-jdtls": { "branch": "master", "commit": "503a399e0d0b5d432068ab5ae24b9848891b0d53" }, "nvim-jdtls": { "branch": "master", "commit": "503a399e0d0b5d432068ab5ae24b9848891b0d53" },
"nvim-lspconfig": { "branch": "master", "commit": "d5d7412ff267b92a11a94e6559d5507c43670a52" }, "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-tree.lua": { "branch": "master", "commit": "80cfeadf179d5cba76f0f502c71dbcff1b515cd8" },
"nvim-treesitter": { "branch": "master", "commit": "8b9f99660294dcd11d42572c84ee33a1e284f70d" }, "nvim-treesitter": { "branch": "master", "commit": "8b9f99660294dcd11d42572c84ee33a1e284f70d" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "6c30f3c8915d7b31c3decdfe6c7672432da1809d" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "6c30f3c8915d7b31c3decdfe6c7672432da1809d" },
"nvim-ufo": { "branch": "main", "commit": "a6132d058f23d15686f07b8e1ca252e060a0e0ce" }, "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" }, "password-store": { "branch": "master", "commit": "28cec11f1dbe6c4273d30370af45b69c9f408386" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" }, "promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },

View file

@ -1,7 +1,8 @@
local g = vim.g local g = vim.g
local o = vim.o
-- Change scale factor with C= and C- -- 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) local change_scale_factor = function(delta)
g.neovide_scale_factor = g.neovide_scale_factor * delta g.neovide_scale_factor = g.neovide_scale_factor * delta
end end
@ -17,3 +18,9 @@ g.neovide_hide_mouse_when_typing = true
-- Enable cursor particles in neovide -- Enable cursor particles in neovide
g.neovide_cursor_vfx_mode = "railgun" g.neovide_cursor_vfx_mode = "railgun"
-- Enable dark/light theme detection
g.neovide_theme = "auto"
-- Set font
--o.guifont = "Hack Nerd Font Mono:h15"

View file

@ -61,6 +61,15 @@ return function()
{ name = "spell" }, { name = "spell" },
{ name = "path" }, { 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 -- Enable autopairs when enter is processed

View file

@ -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

View file

@ -17,40 +17,36 @@ local plugins = {
-- Colorscheme -- Colorscheme
{ {
"rebelot/kanagawa.nvim", "rebelot/kanagawa.nvim",
config = function() config = require("plugins.colorscheme"),
vim.cmd("colorscheme kanagawa") },
end,
-- 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 -- Statusline
{ {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
dependencies = { "kyazdani42/nvim-web-devicons" }, dependencies = { "kyazdani42/nvim-web-devicons" },
config = true, config = require("plugins.lualine"),
},
-- Git status in signcolumn
{
"lewis6991/gitsigns.nvim",
config = true,
}, },
-- Tabline/bufferline -- Tabline/bufferline
{ { "akinsho/bufferline.nvim", version = "v3.*", dependencies = { "kyazdani42/nvim-web-devicons" }, config = true },
"akinsho/bufferline.nvim",
version = "v3.*", -- Git status in signcolumn
dependencies = { "kyazdani42/nvim-web-devicons" }, { "lewis6991/gitsigns.nvim", config = true },
config = true,
},
-- Git commands -- Git commands
"tpope/vim-fugitive", "tpope/vim-fugitive",
-- Indent characters -- Indent characters
{ { "lukas-reineke/indent-blankline.nvim", config = require("plugins.indent-blankline") },
"lukas-reineke/indent-blankline.nvim",
config = require("plugins.indent-blankline"),
},
-- Tree explorer -- Tree explorer
{ {
@ -64,14 +60,19 @@ local plugins = {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
config = require("plugins.telescope"), config = require("plugins.telescope"),
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", -- Internal dep for telescope -- Internal dependency for telescope
"nvim-lua/plenary.nvim",
-- Use fzf for fuzzy finder -- Use fzf for fuzzy finder
{ {
"nvim-telescope/telescope-fzf-native.nvim", "nvim-telescope/telescope-fzf-native.nvim",
build = "make", build = "make",
}, },
"nvim-telescope/telescope-ui-select.nvim", -- Replace vim built in select with telescope -- Replace vim built in select with telescope
"zane-/cder.nvim", -- cd plugin for 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 -- Additional LSP features for Java
"mfussenegger/nvim-jdtls", "mfussenegger/nvim-jdtls",
-- Show code LSP context in winbar
{ "SmiteshP/nvim-navic", config = true, opts = { mouse = true } },
-- DAP plugin -- DAP plugin
{ "mfussenegger/nvim-dap", config = require("plugins.dap") }, { "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 -- Snippets plugin
{ {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
@ -176,9 +170,18 @@ local plugins = {
build = function() build = function()
vim.fn["firenvim#install"](0) vim.fn["firenvim#install"](0)
end, end,
config = function()
vim.g.firenvim_config = {
localSettings = {
[".*"] = {
takeOver = "never",
},
},
}
end,
}, },
-- Vim <3 Asciidoctor -- Vim ♥️ Asciidoctor
"habamax/vim-asciidoctor", "habamax/vim-asciidoctor",
-- Asciidoc preview -- Asciidoc preview
@ -216,6 +219,7 @@ local plugins = {
-- Better folds -- Better folds
{ {
enabled = false,
"kevinhwang91/nvim-ufo", "kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" }, dependencies = { "kevinhwang91/promise-async" },
config = require("plugins.ufo"), config = require("plugins.ufo"),

View file

@ -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

View file

@ -1,9 +1,10 @@
local m = {} local m = {}
function m.setup() function m.setup()
local function on_attach() local function on_attach(client, bufnr)
-- Setup lsp signature plugin
require("lsp_signature").setup({}) -- Attach navic
require("nvim-navic").attach(client, bufnr)
-- Setup keybinds -- Setup keybinds
m.map_keys() m.map_keys()

View file

@ -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
},
}

View file

@ -6,6 +6,29 @@ return function()
pickers = { pickers = {
find_files = { find_command = { "fd", "-Ht", "f" } }, find_files = { find_command = { "fd", "-Ht", "f" } },
lsp_references = { show_line = false }, 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") },
},
}, },
}) })

View file

@ -4,6 +4,11 @@ return function()
"bash", "bash",
"css", "css",
"dockerfile", "dockerfile",
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"html", "html",
"http", "http",
"java", "java",
@ -14,6 +19,7 @@ return function()
"lua", "lua",
"make", "make",
"markdown", "markdown",
"markdown_inline",
"php", "php",
"python", "python",
"rasi", "rasi",
@ -23,6 +29,7 @@ return function()
"toml", "toml",
"tsx", "tsx",
"typescript", "typescript",
"vim",
"yaml", "yaml",
}, },
highlight = { enable = true }, highlight = { enable = true },

View file

@ -1,7 +1,20 @@
return function() return function()
require("ufo").setup({ local keymap = vim.keymap
local o = vim.o
local ufo = require("ufo")
ufo.setup({
close_fold_kinds = { close_fold_kinds = {
"imports", "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 end

View file

@ -15,10 +15,15 @@ return function()
["]"] = { h = { gitsigns.next_hunk, "Next hunk" } }, ["]"] = { 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 -- Exit terminal insert mode with esc
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", {}) vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", {})
-- 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 end

View file

@ -1,7 +1,9 @@
local o = vim.o local o = vim.o
local g = vim.g local g = vim.g
o.pumblend = 10
-- Relative line numbers -- Relative line numbers
o.number = true
o.relativenumber = true o.relativenumber = true
-- True colors -- True colors
@ -20,8 +22,6 @@ o.diffopt = "filler,internal,algorithm:histogram,indent-heuristic"
-- Allow switching buffers with unsaved changes -- Allow switching buffers with unsaved changes
o.hidden = true o.hidden = true
-- Show line numbers
o.number = true
o.guicursor = table.concat({ o.guicursor = table.concat({
"i:ver1", -- Vertical bar cursor in insert mode "i:ver1", -- Vertical bar cursor in insert mode
@ -31,8 +31,6 @@ o.guicursor = table.concat({
-- Enable global statusline -- Enable global statusline
o.laststatus = 3 o.laststatus = 3
o.cmdheight = 1
-- Use suda by default -- Use suda by default
g.suda_smart_edit = 1 g.suda_smart_edit = 1
@ -47,18 +45,3 @@ g.mapleader = " "
o.tabstop = 4 o.tabstop = 4
o.shiftwidth = 4 o.shiftwidth = 4
o.smartindent = true 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

View file

@ -16,3 +16,7 @@
.android/ .android/
.audacity-data/ .audacity-data/
.zcompdump* .zcompdump*
.var/
.npm/
.vscode-oss/
.git/