Tweak neovim config
- Add noice, navic - Tweak theme configuration - Tweak cder configuration - Update .ignore file
This commit is contained in:
parent
aa1af14bfd
commit
8336ec5048
15 changed files with 211 additions and 63 deletions
|
@ -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
|
||||
|
|
48
home/.config/nvim/lua/plugins/colorscheme.lua
Normal file
48
home/.config/nvim/lua/plugins/colorscheme.lua
Normal 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
|
|
@ -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"),
|
||||
|
|
17
home/.config/nvim/lua/plugins/lualine.lua
Normal file
17
home/.config/nvim/lua/plugins/lualine.lua
Normal 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
|
|
@ -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()
|
||||
|
|
18
home/.config/nvim/lua/plugins/noice.lua
Normal file
18
home/.config/nvim/lua/plugins/noice.lua
Normal 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
|
||||
},
|
||||
}
|
|
@ -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") },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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", "<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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue