Compare commits
10 Commits
0a8097295b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 7284f02110 | |||
| 6dc027d5dc | |||
| d84776cf5a | |||
| 650c9ffa51 | |||
| ee59bde43e | |||
| d7d2adcf13 | |||
| 1ee9a1932c | |||
| 7ca47a7120 | |||
| b18ba35798 | |||
| 266414d0ea |
@@ -10,9 +10,10 @@ require("ward.lazy")
|
|||||||
|
|
||||||
--$ Neovide configuration if used
|
--$ Neovide configuration if used
|
||||||
if vim.g.neovide then
|
if vim.g.neovide then
|
||||||
vim.g.neovide_opacity = 0.75
|
vim.g.neovide_opacity = 0.85
|
||||||
vim.g.neovide_window_blurred = true
|
vim.g.neovide_window_blurred = true
|
||||||
-- vim.o.guifont = "Source Code Pro:h12"
|
-- vim.o.guifont = "Source Code Pro:h12"
|
||||||
|
vim.g.neovide_underline_stroke_scale = 1.5
|
||||||
|
|
||||||
-- Increase/Decrease scale factor
|
-- Increase/Decrease scale factor
|
||||||
local change_scale_factor = function(delta)
|
local change_scale_factor = function(delta)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ return {
|
|||||||
button("f", " Find Files", ":Telescope find_files <CR>"),
|
button("f", " Find Files", ":Telescope find_files <CR>"),
|
||||||
button("o", " Recent Files", "<cmd>Telescope oldfiles<cr>"),
|
button("o", " Recent Files", "<cmd>Telescope oldfiles<cr>"),
|
||||||
button("t", " Terminal", ":terminal<CR>i"),
|
button("t", " Terminal", ":terminal<CR>i"),
|
||||||
|
button("h", "⛨ check health", ":checkhealth<CR>"),
|
||||||
button("s", "S Find text/string", ":Telescope live_grep <CR>"),
|
button("s", "S Find text/string", ":Telescope live_grep <CR>"),
|
||||||
button("m", " Bookmarks", ":Telescope marks <CR>"),
|
button("m", " Bookmarks", ":Telescope marks <CR>"),
|
||||||
button("c", " Neovim config", "<cmd>e ~/.config/nvim/ | cd %:p:h<cr>"),
|
button("c", " Neovim config", "<cmd>e ~/.config/nvim/ | cd %:p:h<cr>"),
|
||||||
@@ -40,11 +41,12 @@ return {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local function footer()
|
local function footer()
|
||||||
local footer_datetime = os.date(" %m-%d-%Y %H:%M:%S")
|
local footer_datetime = os.date("%m-%d-%Y %H:%M:%S")
|
||||||
local version = vim.version()
|
local version = vim.version()
|
||||||
local nvim_version_info = " v" .. version.major .. "." .. version.minor .. "." .. version.patch
|
local nvim_version_info = " v" .. version.major .. "." .. version.minor .. "." .. version.patch
|
||||||
-- local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
-- local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||||
local value = footer_datetime .. " Plugins " .. total_plugins .. nvim_version_info
|
local root_dir = " ⌂" .. vim.fn['getcwd']()
|
||||||
|
local value = footer_datetime .. " Plugins " .. total_plugins .. nvim_version_info .. root_dir
|
||||||
return value
|
return value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
require("bufferline").setup({
|
require("bufferline").setup({
|
||||||
options = {
|
options = {
|
||||||
right_mouse_command = "BufferLineTogglePin",
|
right_mouse_command = "BufferLineTogglePin",
|
||||||
buffer_close_icon = "",
|
buffer_close_icon = "",
|
||||||
offsets = {
|
offsets = {
|
||||||
{
|
{
|
||||||
@@ -19,6 +19,10 @@ return {
|
|||||||
separator = true,
|
separator = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
-- separator_style = "slant",
|
||||||
|
-- indicator = {
|
||||||
|
-- style = "underline",
|
||||||
|
-- },
|
||||||
diagnostics = "nvim_lsp",
|
diagnostics = "nvim_lsp",
|
||||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||||
local s = " "
|
local s = " "
|
||||||
@@ -39,6 +43,9 @@ return {
|
|||||||
{ "<leader>bst", "<cmd>BufferLineSortByTabs<Cr>", desc = "Sort by tabs" },
|
{ "<leader>bst", "<cmd>BufferLineSortByTabs<Cr>", desc = "Sort by tabs" },
|
||||||
{ "<leader>bsh", "<cmd>BufferLineMovePrev<Cr>", desc = "Sort by tabs" },
|
{ "<leader>bsh", "<cmd>BufferLineMovePrev<Cr>", desc = "Sort by tabs" },
|
||||||
{ "<leader>bsl", "<cmd>BufferLineMoveNext<Cr>", desc = "Sort by tabs" },
|
{ "<leader>bsl", "<cmd>BufferLineMoveNext<Cr>", desc = "Sort by tabs" },
|
||||||
|
{ "<leader>bb", "<cmd>BufferLineCyclePrev<Cr>", desc = "Previous buffer" },
|
||||||
|
{ "<leader>bn", "<cmd>BufferLineCycleNext<Cr>", desc = "Next buffer" },
|
||||||
|
{ "<leader>n", "<cmd>BufferLineCycleNext<Cr>", desc = "Next buffer" },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ return {
|
|||||||
transparent_backgroud = true,
|
transparent_backgroud = true,
|
||||||
term_colors = true,
|
term_colors = true,
|
||||||
})
|
})
|
||||||
vim.cmd.colorscheme("catppuccin")
|
vim.cmd.colorscheme("catppuccin-nvim")
|
||||||
LineNumberColors()
|
LineNumberColors()
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,49 @@
|
|||||||
--Note: this will show what part of a file was changed deleted or added in a git repo
|
--Note: this will show what part of a file was changed deleted or added in a git repo
|
||||||
return {
|
return {
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
-- event = "BufReadPre",
|
-- event = "BufReadPre",
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
require("gitsigns").setup {
|
require("gitsigns").setup({
|
||||||
signs = {
|
signs = {
|
||||||
-- add = { text = "│" },
|
-- add = { text = "│" },
|
||||||
-- change = { text = "│" },
|
-- change = { text = "│" },
|
||||||
delete = { text = "_", show_count = true },
|
delete = { text = "_", show_count = true },
|
||||||
-- topdelete = { text = "‾" },
|
-- topdelete = { text = "‾" },
|
||||||
-- changedelete = { text = "~" },
|
-- changedelete = { text = "~" },
|
||||||
-- untracked = { text = "┆" },
|
-- untracked = { text = "┆" },
|
||||||
},
|
},
|
||||||
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
|
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
|
||||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||||
}
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<Leader>xs', function()
|
on_attach = function(bufnr)
|
||||||
require("gitsigns").refresh();
|
local gitsigns = require("gitsigns")
|
||||||
end, { desc = "Gitsigns refresh" })
|
local wk = require("which-key")
|
||||||
end,
|
wk.add({
|
||||||
|
{ "<leader>g", group = "Gitsigns" };
|
||||||
|
{ "<leader>gj", function ()
|
||||||
|
gitsigns.nav_hunk('next')
|
||||||
|
end, buffer = bufnr, desc = "next hunk" },
|
||||||
|
{ "<leader>gk", function ()
|
||||||
|
gitsigns.nav_hunk('prev')
|
||||||
|
end, buffer = bufnr, desc = "prev hunk" },
|
||||||
|
{ "<leader>gu", gitsigns.reset_buffer_index, buffer = bufnr, desc = "unstage buffer" },
|
||||||
|
{ "<leader>gp", gitsigns.preview_hunk, buffer = bufnr, desc = "preview hunk" },
|
||||||
|
{ "<leader>gP", gitsigns.preview_hunk_inline, buffer = bufnr, desc = "preview hunk inline" },
|
||||||
|
{ "<leader>gs", gitsigns.stage_hunk, buffer = bufnr, desc = "stage hunk" },
|
||||||
|
{ "<leader>gr", gitsigns.reset_hunk, buffer = bufnr, desc = "reset hunk" },
|
||||||
|
{ "<leader>gS", gitsigns.stage_buffer, buffer = bufnr, desc = "stage buffer" },
|
||||||
|
{ "<leader>gR", gitsigns.reset_buffer, buffer = bufnr, desc = "reset buffer" },
|
||||||
|
{ "<leader>gd", gitsigns.diffthis, buffer = bufnr, desc = "diff this" },
|
||||||
|
{ "<leader>gD", function()
|
||||||
|
gitsigns.diffthis('~')
|
||||||
|
end, buffer = bufnr, desc = "diff ~" },
|
||||||
|
{ "<leader>gt", group = "Gitsigns toggles" };
|
||||||
|
{ "<leader>gtr", gitsigns.refresh, desc = "Gitsigns refresh" },
|
||||||
|
{ "<leader>gtb", gitsigns.toggle_current_line_blame, desc = "toggle blame" },
|
||||||
|
{ "<leader>gtw", gitsigns.toggle_word_diff, desc = "toggle word diff" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,174 +2,170 @@
|
|||||||
-- NOTE: this adds a Language Server Provider for source files like C++, Java/-Script, etc.
|
-- NOTE: this adds a Language Server Provider for source files like C++, Java/-Script, etc.
|
||||||
-- It will check the code for errors, warnings, variables and structures and give suggestions.
|
-- It will check the code for errors, warnings, variables and structures and give suggestions.
|
||||||
return {
|
return {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
version = "*",
|
version = "*",
|
||||||
config = function()
|
config = function()
|
||||||
-- local lspconfig = require("lspconfig")
|
-- local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
vim.cmd([[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]])
|
vim.cmd([[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]])
|
||||||
vim.cmd([[autocmd! ColorScheme * highlight FloatBorder guifg=white guibg=#1f2335]])
|
vim.cmd([[autocmd! ColorScheme * highlight FloatBorder guifg=white guibg=#1f2335]])
|
||||||
|
|
||||||
-- Beautiful borders around LSP stuff like hover/signature_help
|
-- Beautiful borders around LSP stuff like hover/signature_help
|
||||||
local border = {
|
local border = {
|
||||||
{ "┌", "FloatBorder" },
|
{ "┌", "FloatBorder" },
|
||||||
{ "─", "FloatBorder" },
|
{ "─", "FloatBorder" },
|
||||||
{ "┐", "FloatBorder" },
|
{ "┐", "FloatBorder" },
|
||||||
{ "│", "FloatBorder" },
|
{ "│", "FloatBorder" },
|
||||||
{ "┘", "FloatBorder" },
|
{ "┘", "FloatBorder" },
|
||||||
{ "─", "FloatBorder" },
|
{ "─", "FloatBorder" },
|
||||||
{ "└", "FloatBorder" },
|
{ "└", "FloatBorder" },
|
||||||
{ "│", "FloatBorder" },
|
{ "│", "FloatBorder" },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- LSP settings (for overriding per client)
|
-- lspconfig.clangd.setup({
|
||||||
local handlers = {
|
vim.lsp.config("clangd", {
|
||||||
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }),
|
keys = {
|
||||||
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border }),
|
{ "<leader>pc", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
|
||||||
}
|
},
|
||||||
|
cmd = {
|
||||||
|
"clangd",
|
||||||
|
"--offset-encoding=utf-16",
|
||||||
|
"--background-index",
|
||||||
|
"--clang-tidy",
|
||||||
|
"--header-insertion=iwyu",
|
||||||
|
"--completion-style=detailed",
|
||||||
|
"--function-arg-placeholders",
|
||||||
|
"-j4",
|
||||||
|
"--fallback-style=llvm",
|
||||||
|
},
|
||||||
|
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "hpp", "h" },
|
||||||
|
-- init_options = {
|
||||||
|
-- fallbackFlags = { '-std=c17' },
|
||||||
|
-- },
|
||||||
|
})
|
||||||
|
|
||||||
-- lspconfig.clangd.setup({
|
-- lspconfig.glsl_analyzer.setup({
|
||||||
vim.lsp.config("clangd",{
|
vim.lsp.config("glsl_analyzer", {
|
||||||
keys = {
|
filetypes = { "glsl", "vert", "tese", "frag", "geom", "comp", "vs", "fs" },
|
||||||
{ "<leader>pc", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
|
})
|
||||||
},
|
|
||||||
cmd = {
|
|
||||||
"clangd",
|
|
||||||
"--offset-encoding=utf-16",
|
|
||||||
"--background-index",
|
|
||||||
"--clang-tidy",
|
|
||||||
"--header-insertion=iwyu",
|
|
||||||
"--completion-style=detailed",
|
|
||||||
"--function-arg-placeholders",
|
|
||||||
"-j4",
|
|
||||||
"--fallback-style=llvm",
|
|
||||||
},
|
|
||||||
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "hpp", "h" },
|
|
||||||
-- init_options = {
|
|
||||||
-- fallbackFlags = { '-std=c17' },
|
|
||||||
-- },
|
|
||||||
handlers = handlers,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- lspconfig.glsl_analyzer.setup({
|
-- diagnostics border
|
||||||
vim.lsp.config("glsl_analyzer",{
|
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
||||||
filetypes = { "glsl", "vert", "tese", "frag", "geom", "comp", "vs", "fs" },
|
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||||
handlers = handlers,
|
-- I would love to retrieve the severity level just here in order to modify opts.border
|
||||||
})
|
opts = opts or {}
|
||||||
|
opts.border = opts.border or border
|
||||||
|
return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
||||||
|
end
|
||||||
|
|
||||||
-- diagnostics border
|
-- adding filetypes to get glsl things
|
||||||
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
vim.filetype.add({
|
||||||
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
extension = {
|
||||||
-- I would love to retrieve the severity level just here in order to modify opts.border
|
vert = "glsl",
|
||||||
opts = opts or {}
|
tesc = "glsl",
|
||||||
opts.border = opts.border or border
|
tese = "glsl",
|
||||||
return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
frag = "glsl",
|
||||||
end
|
geom = "glsl",
|
||||||
|
comp = "glsl",
|
||||||
|
vs = "glsl",
|
||||||
|
fs = "glsl",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
-- adding filetypes to get glsl things
|
-- lspconfig.rust_analyzer.setup({
|
||||||
vim.filetype.add({
|
vim.lsp.config("rust_analyzer", {
|
||||||
extension = {
|
settings = {
|
||||||
vert = "glsl",
|
["rust-analyzer"] = {},
|
||||||
tesc = "glsl",
|
},
|
||||||
tese = "glsl",
|
})
|
||||||
frag = "glsl",
|
|
||||||
geom = "glsl",
|
|
||||||
comp = "glsl",
|
|
||||||
vs = "glsl",
|
|
||||||
fs = "glsl",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- lspconfig.rust_analyzer.setup({
|
-- These lsp keybinds only load when an LSP is attatched to the buffer.
|
||||||
vim.lsp.config("rust_analyzer",{
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
settings = {
|
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||||
["rust-analyzer"] = {},
|
callback = function(event)
|
||||||
},
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
handlers = handlers,
|
vim.bo[event.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
||||||
})
|
|
||||||
|
|
||||||
-- lspconfig.lua_ls.setup({
|
local map = function(keys, func, desc)
|
||||||
vim.lsp.config("lua_ls",{
|
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||||
handlers = handlers,
|
end
|
||||||
})
|
|
||||||
|
|
||||||
-- These lsp keybinds only load when an LSP is attatched to the buffer.
|
-- Jump to the definition of the word under your cursor.
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
-- To jump back, press <C-t>.
|
||||||
callback = function(event)
|
map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
|
||||||
vim.bo[event.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
|
||||||
|
|
||||||
local map = function(keys, func, desc)
|
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||||
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
-- For example, in C this would take you to the header.
|
||||||
end
|
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||||
|
|
||||||
-- Jump to the definition of the word under your cursor.
|
-- Find references for the word under your cursor.
|
||||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||||
-- To jump back, press <C-t>.
|
|
||||||
map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
|
|
||||||
|
|
||||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
-- Jump to the implementation of the word under your cursor.
|
||||||
-- For example, in C this would take you to the header.
|
-- Useful when your language has ways of declaring types without an actual implementation.
|
||||||
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
|
||||||
|
|
||||||
|
-- Jump to the type of the word under your cursor.
|
||||||
|
-- Useful when you're not sure what type a variable is and you want to see
|
||||||
|
-- the definition of its *type*, not where it was *defined*.
|
||||||
|
map("<leader>ld", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition")
|
||||||
|
|
||||||
-- Find references for the word under your cursor.
|
-- Jump to the type of the word under your cursor.
|
||||||
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
-- Useful when you're not sure what type a variable is and you want to see
|
||||||
|
-- the definition of its *type*, not where it was *defined*.
|
||||||
|
map("<leader>lD", vim.lsp.buf.declaration, "Go to [D]eclaration")
|
||||||
|
|
||||||
-- Jump to the implementation of the word under your cursor.
|
-- Fuzzy find all the symbols in your current document.
|
||||||
-- Useful when your language has ways of declaring types without an actual implementation.
|
-- Symbols are things like variables, functions, types, etc.
|
||||||
map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
|
map("<leader>ls", require("telescope.builtin").lsp_document_symbols, "document [S]ymbols")
|
||||||
|
|
||||||
-- Jump to the type of the word under your cursor.
|
-- Format file
|
||||||
-- Useful when you're not sure what type a variable is and you want to see
|
map("<leader>lf", vim.lsp.buf.format, "[F]ormat")
|
||||||
-- the definition of its *type*, not where it was *defined*.
|
|
||||||
map("<leader>ld", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition")
|
|
||||||
|
|
||||||
-- Jump to the type of the word under your cursor.
|
-- Fuzzy find all the symbols in your current workspace.
|
||||||
-- Useful when you're not sure what type a variable is and you want to see
|
-- Similar to document symbols, except searches over your entire project.
|
||||||
-- the definition of its *type*, not where it was *defined*.
|
map("<leader>lw", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace symbols")
|
||||||
map("<leader>lD", vim.lsp.buf.declaration, "Go to [D]eclaration")
|
map("<leader>li", vim.cmd.LspInfo, "Show lsp info")
|
||||||
|
map("<leader>lp", vim.diagnostic.goto_prev, "Go to [P]revious diagnostic message")
|
||||||
|
|
||||||
-- Fuzzy find all the symbols in your current document.
|
map("<leader>ln", vim.diagnostic.goto_next, "Go to [N]ext diagnostic message")
|
||||||
-- Symbols are things like variables, functions, types, etc.
|
|
||||||
map("<leader>ls", require("telescope.builtin").lsp_document_symbols, "document [S]ymbols")
|
|
||||||
|
|
||||||
-- Format file
|
map("<leader>le", vim.diagnostic.open_float, "Show diagnostic [E]rror messages")
|
||||||
map("<leader>lf", vim.lsp.buf.format, "[F]ormat")
|
vim.diagnostic.config({ virtual_text = false })
|
||||||
|
|
||||||
-- Fuzzy find all the symbols in your current workspace.
|
map("<leader>lq", vim.diagnostic.setloclist, "Open diagnostic [Q]uickfix list")
|
||||||
-- Similar to document symbols, except searches over your entire project.
|
|
||||||
map(
|
|
||||||
"<leader>lw",
|
|
||||||
require("telescope.builtin").lsp_dynamic_workspace_symbols,
|
|
||||||
"[W]orkspace symbols"
|
|
||||||
)
|
|
||||||
map("<leader>li", vim.cmd.LspInfo, "Show lsp info")
|
|
||||||
map("<leader>lp", vim.diagnostic.goto_prev, "Go to [P]revious diagnostic message")
|
|
||||||
|
|
||||||
map("<leader>ln", vim.diagnostic.goto_next, "Go to [N]ext diagnostic message")
|
-- Rename the variable under your cursor.
|
||||||
|
local function rename()
|
||||||
|
local clients = vim.lsp.get_clients({ bufnr = 0, method = "textDocument/rename" })
|
||||||
|
if #clients > 0 then
|
||||||
|
local targetClient = clients[1] -- Use the first client .. or angularls if available
|
||||||
|
for _, client in ipairs(clients) do
|
||||||
|
if client.name == "angularls" then
|
||||||
|
targetClient = client
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
vim.lsp.buf.rename(nil, { name = targetClient.name })
|
||||||
|
else
|
||||||
|
print("No LSP attached supports renaming")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
--Most Language Servers support renaming across files, etc.
|
||||||
|
map("<leader>lr", rename, "[R]ename")
|
||||||
|
|
||||||
map("<leader>le", vim.diagnostic.open_float, "Show diagnostic [E]rror messages")
|
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||||
vim.diagnostic.config({ virtual_text = false })
|
-- or a suggestion from your LSP for this to activate.
|
||||||
|
map("<leader>la", vim.lsp.buf.code_action, "code [A]ction")
|
||||||
|
|
||||||
map("<leader>lq", vim.diagnostic.setloclist, "Open diagnostic [Q]uickfix list")
|
-- Opens a popup that displays documentation about the word under your cursor
|
||||||
|
-- See `:help K` for why this keymap.
|
||||||
|
|
||||||
-- Rename the variable under your cursor.
|
map("<leader>th", function()
|
||||||
-- Most Language Servers support renaming across files, etc.
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
||||||
map("<leader>lr", vim.lsp.buf.rename, "[R]ename")
|
end, "[T]oggle Inlay [H]ints")
|
||||||
|
end,
|
||||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
})
|
||||||
-- or a suggestion from your LSP for this to activate.
|
end,
|
||||||
map("<leader>la", vim.lsp.buf.code_action, "code [A]ction")
|
|
||||||
|
|
||||||
-- Opens a popup that displays documentation about the word under your cursor
|
|
||||||
-- See `:help K` for why this keymap.
|
|
||||||
|
|
||||||
map("<leader>th", function()
|
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
|
||||||
end, "[T]oggle Inlay [H]ints")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,5 +13,6 @@ return {
|
|||||||
},
|
},
|
||||||
extensions = { "nvim-tree" },
|
extensions = { "nvim-tree" },
|
||||||
})
|
})
|
||||||
|
vim.o.cmdheight = 0
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
--$ :help telescope
|
--$ :help telescope
|
||||||
return {
|
return {
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
tag = '0.1.8',
|
tag = 'v0.2.2',
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
|
|||||||
@@ -2,19 +2,28 @@
|
|||||||
--$ URL: https://github.com/nvim-treesitter/nvim-treesitter
|
--$ URL: https://github.com/nvim-treesitter/nvim-treesitter
|
||||||
--# :help treesitter
|
--# :help treesitter
|
||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
branch = "main",
|
||||||
|
lazy = false,
|
||||||
|
build = ":TSUpdate",
|
||||||
|
|
||||||
config = function()
|
-- config = function()
|
||||||
local configs = require("nvim-treesitter.configs")
|
-- local configs = require("nvim-treesitter.configs")
|
||||||
|
--
|
||||||
configs.setup({
|
-- configs.setup({
|
||||||
ensure_installed = {
|
-- ensure_installed = {
|
||||||
"c", "lua", "vim", "vimdoc", "javascript", "html", "python", "typescript"
|
-- "c",
|
||||||
},
|
-- "lua",
|
||||||
sync_install = false,
|
-- "vim",
|
||||||
highlight = { enable = true },
|
-- "vimdoc",
|
||||||
indent = { enable = true },
|
-- "javascript",
|
||||||
})
|
-- "html",
|
||||||
end
|
-- "python",
|
||||||
|
-- "typescript",
|
||||||
|
-- },
|
||||||
|
-- sync_install = false,
|
||||||
|
-- highlight = { enable = true },
|
||||||
|
-- indent = { enable = true },
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,5 +35,5 @@ end
|
|||||||
LineNumberColors()
|
LineNumberColors()
|
||||||
|
|
||||||
-- Set spell checker
|
-- Set spell checker
|
||||||
vim.opt.spell = true
|
-- vim.opt.spell = true
|
||||||
vim.opt.spelllang = { 'en_gb', 'nl' }
|
vim.opt.spelllang = { 'en_gb', 'nl' }
|
||||||
|
|||||||
Reference in New Issue
Block a user