nvim: leader use space, fix keybing show

hl todo, note ...
This commit is contained in:
Mathieu Maret 2024-06-03 00:27:56 +02:00
parent a478f0948e
commit 8fd349f506

View File

@ -1,15 +1,15 @@
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.cmd([[ vim.cmd([[
set runtimepath^=~/.vim runtimepath+=~/.vim/after set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath let &packpath = &runtimepath
source ~/.vimrc source ~/.vimrc
]]) ]])
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
-- vim.g.mapleader = ' '
--vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal -- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = true vim.g.have_nerd_font = true
@ -25,6 +25,17 @@ vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next [D]iagn
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Show diagnostic [E]rror messages" }) vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Show diagnostic [E]rror messages" })
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" }) vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
-- See `:help vim.highlight.on_yank()`
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking (copying) text",
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
@ -48,6 +59,10 @@ require("lazy").setup({
{ -- Useful plugin to show you pending keybinds. { -- Useful plugin to show you pending keybinds.
"folke/which-key.nvim", "folke/which-key.nvim",
event = "VimEnter", -- Sets the loading event to 'VimEnter' event = "VimEnter", -- Sets the loading event to 'VimEnter'
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
config = function() -- This is the function that runs, AFTER loading config = function() -- This is the function that runs, AFTER loading
require("which-key").setup() require("which-key").setup()
@ -84,6 +99,13 @@ require("lazy").setup({
"rhysd/vim-grammarous", "rhysd/vim-grammarous",
"liuchengxu/vista.vim", "liuchengxu/vista.vim",
"https://git.mathux.org/mathieu/taglist.git", "https://git.mathux.org/mathieu/taglist.git",
-- Highlight todo, notes, etc in comments
{
"folke/todo-comments.nvim",
event = "VimEnter",
dependencies = { "nvim-lua/plenary.nvim" },
opts = { signs = false },
},
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", build = ":TSUpdate",