Cleanup nvim config
This commit is contained in:
parent
33cce48101
commit
d9e2c81e42
16 changed files with 174 additions and 488 deletions
|
|
@ -1,4 +1,4 @@
|
|||
-- [[ Highlight on yank ]]
|
||||
-- Highlight on yank
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,15 @@ local function default(desc)
|
|||
}
|
||||
end
|
||||
|
||||
local function fixIdentation()
|
||||
local indent = 2
|
||||
vim.opt.tabstop = indent
|
||||
vim.opt.shiftwidth = indent
|
||||
vim.opt.softtabstop = indent
|
||||
|
||||
vim.cmd("retab")
|
||||
end
|
||||
|
||||
-- Keymaps for better default experience
|
||||
-- See `:help vim.keymap.set()`
|
||||
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
|
||||
|
|
@ -29,24 +38,22 @@ vim.keymap.set("n", "N", "Nzzzv", default("Keep cursor centered while searching"
|
|||
|
||||
vim.keymap.set("n", "Q", "<nop>", {})
|
||||
|
||||
vim.keymap.set("n", "<leader>lj", function()
|
||||
vim.diagnostic.goto_next()
|
||||
end, default("Go to next diagnostic"))
|
||||
vim.keymap.set("n", "<leader>lk", function()
|
||||
vim.diagnostic.goto_prev()
|
||||
end, default("Go to prev diagnostic"))
|
||||
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>r",
|
||||
"<leader>rw",
|
||||
[[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
|
||||
default("Search and replace current word")
|
||||
)
|
||||
|
||||
vim.keymap.set("n", "<leader>R", ":%s/", default("Search and replace in the whole file"))
|
||||
vim.keymap.set("n", "<leader>rR", ":s/", default("Search and replace inline"))
|
||||
vim.keymap.set("n", "<leader>rr", ":%s/", default("Search and replace globally"))
|
||||
vim.keymap.set("v", "<leader>r", ":s/", default("Search and replace in selection"))
|
||||
|
||||
vim.keymap.set("v", "p", [["_dP]], default("Paste whitout lossing yanked text"))
|
||||
vim.keymap.set({ "n", "v" }, "<Leader>y", [["+y]], default("Yank to system clipboard"))
|
||||
vim.keymap.set({ "n", "v" }, "<Leader>Y", [["+Y]], default("Yank line to system clipboard"))
|
||||
vim.keymap.set({ "n", "v" }, "<Leader>p", [["+p]], default("Paste from system clipboard"))
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", default("Move selection down"))
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", default("Move selection up"))
|
||||
vim.keymap.set("n", "<Leader>uI", fixIdentation, default("Fix identation"))
|
||||
|
|
|
|||
|
|
@ -2,96 +2,53 @@
|
|||
-- See `:help vim.o`
|
||||
|
||||
-- Set <space> as the leader key
|
||||
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
--
|
||||
-- -- Set highlight on search
|
||||
-- vim.o.hlsearch = false
|
||||
--
|
||||
-- -- Make line numbers default
|
||||
-- vim.wo.number = true
|
||||
-- vim.opt.relativenumber = true
|
||||
--
|
||||
-- -- Enable mouse mode
|
||||
-- vim.o.mouse = "a"
|
||||
--
|
||||
-- -- Sync clipboard between OS and Neovim.
|
||||
-- -- Remove this option if you want your OS clipboard to remain independent.
|
||||
-- -- See `:help 'clipboard'`
|
||||
-- vim.o.clipboard = "unnamedplus"
|
||||
--
|
||||
-- -- Enable break indent
|
||||
-- vim.o.breakindent = true
|
||||
--
|
||||
-- -- Save undo history
|
||||
-- vim.o.undofile = true
|
||||
--
|
||||
-- -- Case insensitive searching UNLESS /C or capital in search
|
||||
-- vim.o.ignorecase = true
|
||||
-- vim.o.smartcase = true
|
||||
--
|
||||
-- -- Keep signcolumn on by default
|
||||
-- vim.wo.signcolumn = "yes"
|
||||
--
|
||||
-- -- Decrease update time
|
||||
-- vim.o.updatetime = 250
|
||||
-- vim.o.timeout = true
|
||||
-- vim.o.timeoutlen = 300
|
||||
--
|
||||
-- -- Set completeopt to have a better completion experience
|
||||
-- vim.o.completeopt = "menuone,noselect"
|
||||
--
|
||||
-- -- NOTE: You should make sure your terminal supports this
|
||||
-- vim.o.termguicolors = true
|
||||
--
|
||||
-- vim.o.showmode = false
|
||||
-- vim.o.conceallevel = 3
|
||||
|
||||
-- LazyVim options
|
||||
local opt = vim.opt
|
||||
|
||||
opt.autowrite = true -- Enable auto write
|
||||
opt.clipboard = "unnamedplus" -- Sync with system clipboard
|
||||
-- stylua: ignore
|
||||
opt.autowrite = true -- Enable auto write
|
||||
--opt.clipboard = "unnamedplus" -- Sync with system clipboard
|
||||
opt.completeopt = "menu,menuone,noselect"
|
||||
opt.conceallevel = 3 -- Hide * markup for bold and italic
|
||||
opt.confirm = true -- Confirm to save changes before exiting modified buffer
|
||||
opt.cursorline = true -- Enable highlighting of the current line
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||
opt.conceallevel = 3 -- Hide * markup for bold and italic
|
||||
opt.confirm = true -- Confirm to save changes before exiting modified buffer
|
||||
opt.cursorline = true -- Enable highlighting of the current line
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||
opt.grepformat = "%f:%l:%c:%m"
|
||||
opt.grepprg = "rg --vimgrep"
|
||||
opt.ignorecase = true -- Ignore case
|
||||
opt.inccommand = "nosplit" -- preview incremental substitute
|
||||
opt.ignorecase = true -- Ignore case
|
||||
opt.inccommand = "nosplit" -- preview incremental substitute
|
||||
opt.laststatus = 0
|
||||
opt.list = true -- Show some invisible characters (tabs...
|
||||
opt.mouse = "a" -- Enable mouse mode
|
||||
opt.number = true -- Print line number
|
||||
opt.pumblend = 10 -- Popup blend
|
||||
opt.pumheight = 10 -- Maximum number of entries in a popup
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.scrolloff = 8 -- Lines of context
|
||||
opt.list = true -- Show some invisible characters (tabs...
|
||||
opt.mouse = "a" -- Enable mouse mode
|
||||
opt.number = true -- Print line number
|
||||
opt.pumblend = 10 -- Popup blend
|
||||
opt.pumheight = 10 -- Maximum number of entries in a popup
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.scrolloff = 8 -- Lines of context
|
||||
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
|
||||
opt.shiftround = true -- Round indent
|
||||
opt.shiftwidth = 2 -- Size of an indent
|
||||
opt.shiftround = true -- Round indent
|
||||
opt.shiftwidth = 2 -- Size of an indent
|
||||
opt.shortmess:append({ W = true, I = true, c = true })
|
||||
opt.showmode = false -- Dont show mode since we have a statusline
|
||||
opt.sidescrolloff = 8 -- Columns of context
|
||||
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||
opt.smartcase = true -- Don't ignore case with capitals
|
||||
opt.smartindent = true -- Insert indents automatically
|
||||
opt.showmode = false -- Dont show mode since we have a statusline
|
||||
opt.sidescrolloff = 8 -- Columns of context
|
||||
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||
opt.smartcase = true -- Don't ignore case with capitals
|
||||
opt.smartindent = true -- Insert indents automatically
|
||||
opt.spelllang = { "en" }
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.timeoutlen = 300
|
||||
opt.undofile = true
|
||||
opt.undolevels = 10000
|
||||
opt.updatetime = 200 -- Save swap file and trigger CursorHold
|
||||
opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||
opt.winminwidth = 5 -- Minimum window width
|
||||
opt.wrap = false -- Disable line wrap
|
||||
opt.updatetime = 200 -- Save swap file and trigger CursorHold
|
||||
opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||
opt.winminwidth = 5 -- Minimum window width
|
||||
opt.wrap = false -- Disable line wrap
|
||||
|
||||
vim.filetype.add({
|
||||
-- Detect and assign filetype based on the extension of the filename
|
||||
|
|
|
|||
|
|
@ -9,12 +9,11 @@ return { -- Change colors.none if not using a transparent background
|
|||
cmp = true,
|
||||
indent_blankline = {
|
||||
enabled = true,
|
||||
scope_color = "lavender", -- catppuccin color (eg. `lavender`) Default: text
|
||||
colored_indent_levels = true,
|
||||
},
|
||||
},
|
||||
custom_highlights = function(colors)
|
||||
return {
|
||||
-- Fix colors for cmp
|
||||
Pmenu = { bg = colors.none, blend = 0 },
|
||||
FloatBorder = { bg = colors.none },
|
||||
CmpItemMenu = { fg = colors.text, bg = colors.none },
|
||||
|
|
|
|||
|
|
@ -3,20 +3,21 @@ return {
|
|||
"echasnovski/mini.comment",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
depends = {
|
||||
{ "nvim-treesitter/nvim-treesitter-context" },
|
||||
},
|
||||
opts = {
|
||||
options = {
|
||||
custom_commentstring = function()
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring()
|
||||
or vim.bo.commentstring
|
||||
or vim.bo.commentstring
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"LudoPinelli/comment-box.nvim",
|
||||
-- init = nil,
|
||||
event = "VeryLazy",
|
||||
-- opts = {},
|
||||
config = function()
|
||||
require("comment-box").setup({
|
||||
outer_blank_lines = true,
|
||||
|
|
@ -25,9 +26,9 @@ return {
|
|||
local cb = require("comment-box")
|
||||
|
||||
-- left aligned fixed size box with left aligned text
|
||||
MAP({ "n", "v" }, "<Leader>cb", cb.lcbox, "Create a comment box")
|
||||
MAP({ "n", "v" }, "gcb", cb.lcbox, "Create a comment box")
|
||||
-- centered adapted box with centered text
|
||||
MAP({ "n", "v" }, "<Leader>cl", cb.cline, "Create a comment line")
|
||||
MAP({ "n", "v" }, "gcl", cb.cline, "Create a comment line")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ return {
|
|||
local window_opts = {
|
||||
border = "rounded",
|
||||
side_padding = 1,
|
||||
-- fix colors for catppuccin colorscheme
|
||||
winhighlight = "Normal:Pmenu,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
|
||||
}
|
||||
return {
|
||||
|
|
@ -35,6 +36,7 @@ return {
|
|||
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<BR>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<S-CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ return {
|
|||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("LDR f f", " Find File ", "<leader>ff"),
|
||||
dashboard.button("LDR e", "פּ File Explorer ", "<leader>fe"),
|
||||
dashboard.button("LDR LDR t", " Harpoon", "<leader><leader>t"),
|
||||
dashboard.button("LDR g g", " Git ", "<leader>gg"),
|
||||
}
|
||||
|
||||
dashboard.section.footer.val =
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
return {
|
||||
"stevearc/dressing.nvim",
|
||||
opts = {
|
||||
input = {
|
||||
-- handle by noice
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
-- better imputs
|
||||
"stevearc/dressing.nvim",
|
||||
opts = {
|
||||
input = {
|
||||
-- handle by noice
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- See aviable formatters in: https://github.com/stevearc/conform.nvim#formatters
|
||||
-- Formatters can be installed by mason
|
||||
formatters_by_ft = {
|
||||
-- Conform will run multiple formatters sequentially
|
||||
lua = { "stylua" },
|
||||
|
|
@ -14,9 +17,27 @@ return {
|
|||
-- have other formatters configured.
|
||||
["_"] = { "trim_whitespace" },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable with a global or buffer-local variable
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return { timeout_ms = 500, lsp_fallback = true }
|
||||
end,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("conform").setup(opts)
|
||||
|
||||
local function toggleAutoFormat()
|
||||
-- to make this global, change b to g
|
||||
if vim.b.disable_autoformat == nil then
|
||||
vim.b.disable_autoformat = true
|
||||
return
|
||||
end
|
||||
|
||||
vim.b.disable_autoformat = not vim.b.disable_autoformat
|
||||
end
|
||||
|
||||
MAP("n", "<leader>uf", toggleAutoFormat, "Toggle auto format")
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
return {
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
-- See `:help gitsigns.txt`
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
on_attach = function(buffer)
|
||||
local gs = package.loaded.gitsigns
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
-- See `:help gitsigns.txt`
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
on_attach = function(buffer)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, "<leader>g" .. l, r, { buffer = buffer, desc = desc })
|
||||
end
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, "<leader>g" .. l, r, { buffer = buffer, desc = desc })
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "j", gs.next_hunk, "Next Hunk")
|
||||
|
|
@ -27,59 +27,59 @@ return {
|
|||
map("n", "u", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||
map("n", "R", gs.reset_buffer, "Reset Buffer")
|
||||
map("n", "p", gs.preview_hunk, "Preview Hunk")
|
||||
map("n", "l", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||
map("n", "l", function() gs.blame_line() end, "Blame Line")
|
||||
map("n", "d", gs.diffthis, "Diff This")
|
||||
map("n", "D", function() gs.diffthis("~") end, "Diff This ~")
|
||||
end,
|
||||
},
|
||||
},
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
-- Testing main Git plugin
|
||||
-- Testing main Git plugin
|
||||
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<leader>gG", ":Git<CR>", { desc = "Fugitive" } },
|
||||
},
|
||||
},
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<leader>gG", ":Git<CR>", desc = "Fugitive" },
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"kdheepak/lazygit.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>gL", ":LazyGit<CR>", { desc = "Lazygit" } },
|
||||
},
|
||||
},
|
||||
{
|
||||
"kdheepak/lazygit.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>gL", ":LazyGit<CR>", desc = "Lazygit" },
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"NeogitOrg/neogit",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim", -- required
|
||||
"nvim-telescope/telescope.nvim", -- optional
|
||||
"sindrets/diffview.nvim", -- optional
|
||||
"ibhagwan/fzf-lua", -- optional
|
||||
},
|
||||
config = true,
|
||||
opts = {
|
||||
disable_insert_on_commit = "auto",
|
||||
kind = "replace",
|
||||
disable_line_numbers = false,
|
||||
commit_editor = {
|
||||
kind = "replace",
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>gg",
|
||||
function()
|
||||
require("neogit").open()
|
||||
end,
|
||||
{ desc = "Neogit" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"NeogitOrg/neogit",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim", -- required
|
||||
"nvim-telescope/telescope.nvim", -- optional
|
||||
"sindrets/diffview.nvim", -- optional
|
||||
"ibhagwan/fzf-lua", -- optional
|
||||
},
|
||||
config = true,
|
||||
opts = {
|
||||
disable_insert_on_commit = "auto",
|
||||
kind = "replace",
|
||||
disable_line_numbers = false,
|
||||
commit_editor = {
|
||||
kind = "replace",
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>gg",
|
||||
function()
|
||||
require("neogit").open()
|
||||
end,
|
||||
desc = "Neogit",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,17 +46,18 @@ return {
|
|||
miniclue.gen_clues.windows(),
|
||||
miniclue.gen_clues.z(),
|
||||
|
||||
{ mode = "n", keys = "<Leader>b", desc = "+Buffers" },
|
||||
{ mode = "n", keys = "<Leader>c", desc = "+Comments" },
|
||||
{ mode = "n", keys = "<Leader>bh", postkeys = "<Leader>b" },
|
||||
{ mode = "n", keys = "<Leader>bl", postkeys = "<Leader>b" },
|
||||
{ mode = "n", keys = "<Leader>l", desc = "+LSP" },
|
||||
{ mode = "n", keys = "<Leader>f", desc = "+Find" },
|
||||
{ mode = "n", keys = "<Leader>g", desc = "+Git" },
|
||||
{ mode = "n", keys = "<Leader>w", desc = "+Workspace" },
|
||||
{ mode = "n", keys = "<Leader>u", desc = "+UI" },
|
||||
{ mode = "n", keys = "<Leader>un", desc = "+Noice" },
|
||||
{ mode = "n", keys = "<Leader><Leader>", desc = "+Harpoon" },
|
||||
{ mode = "n", keys = "<Leader>b", desc = "+Buffers" },
|
||||
{ mode = "n", keys = "<Leader>bh", postkeys = "<Leader>b" },
|
||||
{ mode = "n", keys = "<Leader>bl", postkeys = "<Leader>b" },
|
||||
{ mode = "n", keys = "<Leader>c", desc = "+Comments" },
|
||||
{ mode = "n", keys = "<Leader>f", desc = "+Find" },
|
||||
{ mode = "n", keys = "<Leader>g", desc = "+Git" },
|
||||
{ mode = "n", keys = "<Leader>l", desc = "+LSP" },
|
||||
{ mode = "n", keys = "<Leader>r", desc = "+Replace" },
|
||||
{ mode = "n", keys = "<Leader>u", desc = "+UI & Config" },
|
||||
{ mode = "n", keys = "<Leader>un", desc = "+Noice" },
|
||||
{ mode = "n", keys = "<Leader>w", desc = "+Workspace" },
|
||||
},
|
||||
|
||||
-- Clue window settings
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ return {
|
|||
"williamboman/mason-lspconfig.nvim",
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
},
|
||||
|
||||
config = function()
|
||||
|
|
@ -43,6 +43,9 @@ return {
|
|||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, "Workspace List Folders")
|
||||
|
||||
nmap("<leader>lj", vim.diagnostic.goto_next, "Go to next diagnostic")
|
||||
nmap("<leader>lk", vim.diagnostic.goto_prev, "Go to prev diagnostic")
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
|
||||
vim.lsp.buf.format()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue