Extend nvim config. Setup nonicons usage
This commit is contained in:
parent
277de4cd4f
commit
d5861f05e8
@ -16,6 +16,7 @@ LICENSE
|
|||||||
.config/nvim/lazyvim.json
|
.config/nvim/lazyvim.json
|
||||||
.config/nvim/stylua.toml
|
.config/nvim/stylua.toml
|
||||||
.config/nvim/lua/config
|
.config/nvim/lua/config
|
||||||
|
.config/nvim/lua/plugins/telescope.lua
|
||||||
.config/nvim/lua/plugins/core.lua
|
.config/nvim/lua/plugins/core.lua
|
||||||
.config/nvim/lua/plugins/test.lua
|
.config/nvim/lua/plugins/test.lua
|
||||||
.config/nvim/lua/plugins/disabled.lua
|
.config/nvim/lua/plugins/disabled.lua
|
||||||
|
@ -28,8 +28,6 @@ o.encoding = "utf-8"
|
|||||||
o.backspace = "indent,eol,start" -- backspace works on every char in insert mode
|
o.backspace = "indent,eol,start" -- backspace works on every char in insert mode
|
||||||
o.completeopt = { 'menu', 'menuone', 'noselect' }
|
o.completeopt = { 'menu', 'menuone', 'noselect' }
|
||||||
o.history = 1000
|
o.history = 1000
|
||||||
-- o.dictionary = '/home/jan/.vim/dict/words'
|
|
||||||
-- o.dictionary = '/usr/share/dict/words'
|
|
||||||
o.startofline = true
|
o.startofline = true
|
||||||
o.title = true
|
o.title = true
|
||||||
o.clipboard = 'unnamedplus'
|
o.clipboard = 'unnamedplus'
|
||||||
@ -62,11 +60,11 @@ o.eol = false -- show if there's no eol char
|
|||||||
o.showbreak = '↪' -- character to show when line is broken
|
o.showbreak = '↪' -- character to show when line is broken
|
||||||
|
|
||||||
-- Folding
|
-- Folding
|
||||||
o.foldenable = true
|
-- o.foldenable = true
|
||||||
o.foldnestmax = 2
|
-- o.foldnestmax = 2
|
||||||
o.foldminlines = 10
|
-- o.foldminlines = 10
|
||||||
o.foldmethod = "expr"
|
-- o.foldmethod = "expr"
|
||||||
o.foldexpr = "nvim_treesitter#foldexpr()"
|
-- o.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
|
|
||||||
-- workaround for Telescope bug
|
-- workaround for Telescope bug
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||||
@ -159,8 +157,8 @@ local map = vim.keymap.set
|
|||||||
|
|
||||||
map({ 'n', 'v' }, '<Space>', "<Nop>", { silent = true })
|
map({ 'n', 'v' }, '<Space>', "<Nop>", { silent = true })
|
||||||
|
|
||||||
-- clear the search buffer when hitting return
|
-- Clear search with <esc>
|
||||||
map('n', '<CR>', '{->v:hlsearch ? ":nohl\\<CR>" : "\\<CR>"}()', { expr = true })
|
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
||||||
|
|
||||||
-- sane regexes
|
-- sane regexes
|
||||||
map({ 'n', 'v' }, '/', '/\\v', { noremap = true, silent = true })
|
map({ 'n', 'v' }, '/', '/\\v', { noremap = true, silent = true })
|
||||||
@ -168,9 +166,13 @@ map({ 'n', 'v' }, '/', '/\\v', { noremap = true, silent = true })
|
|||||||
-- don't jump when using *
|
-- don't jump when using *
|
||||||
map('n', '*', '*<c-o>')
|
map('n', '*', '*<c-o>')
|
||||||
|
|
||||||
-- keep search matches in the middle of the window
|
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
|
||||||
map('n', 'n', 'nzzzv')
|
map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next search result" })
|
||||||
map('n', 'N', 'Nzzzv')
|
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||||
|
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||||
|
map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev search result" })
|
||||||
|
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||||
|
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||||
|
|
||||||
-- Same when jumping around
|
-- Same when jumping around
|
||||||
map('n', 'g;', 'g;zz')
|
map('n', 'g;', 'g;zz')
|
||||||
@ -179,6 +181,22 @@ map('n', 'g;', 'g;zz')
|
|||||||
map('n', 'Q', '@q')
|
map('n', 'Q', '@q')
|
||||||
map('v', 'Q', '<cmd>norm @q<CR>')
|
map('v', 'Q', '<cmd>norm @q<CR>')
|
||||||
|
|
||||||
|
-- save file
|
||||||
|
map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
|
||||||
|
|
||||||
|
-- better indenting
|
||||||
|
map("v", "<", "<gv")
|
||||||
|
map("v", ">", ">gv")
|
||||||
|
|
||||||
|
-- lazy
|
||||||
|
map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
|
||||||
|
|
||||||
|
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
|
||||||
|
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
|
||||||
|
|
||||||
|
map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
|
||||||
|
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
||||||
|
|
||||||
-- Shortcut to close quickfix windows
|
-- Shortcut to close quickfix windows
|
||||||
map('n', '<leader>a', '<cmd>windo lcl|ccl<CR>')
|
map('n', '<leader>a', '<cmd>windo lcl|ccl<CR>')
|
||||||
|
|
||||||
@ -200,7 +218,11 @@ map('n', '<down>', '<cmd>resize +2<CR>')
|
|||||||
map('n', '<left>', '<cmd>vertical resize -2<CR>')
|
map('n', '<left>', '<cmd>vertical resize -2<CR>')
|
||||||
map('n', '<right>', '<cmd>vertical resize +2<CR>')
|
map('n', '<right>', '<cmd>vertical resize +2<CR>')
|
||||||
|
|
||||||
map('n', '<leader>g', '<cmd>vertical rightbelow Git<cr>', { noremap = true, silent = true })
|
-- windows
|
||||||
|
map("n", "<leader>ww", "<C-W>p", { desc = "Other window", remap = true })
|
||||||
|
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
|
||||||
|
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
|
||||||
|
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
|
||||||
{{ else }}
|
{{ else }}
|
||||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
|
@ -45,8 +45,35 @@ return {
|
|||||||
},
|
},
|
||||||
opts = function()
|
opts = function()
|
||||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
||||||
|
local kind_icons = {
|
||||||
|
Text = "",
|
||||||
|
Method = "",
|
||||||
|
Function = "",
|
||||||
|
Constructor = "",
|
||||||
|
Field = "",
|
||||||
|
Variable = "",
|
||||||
|
Class = "",
|
||||||
|
Interface = "",
|
||||||
|
Module = "",
|
||||||
|
Property = "",
|
||||||
|
Unit = "",
|
||||||
|
Value = "",
|
||||||
|
Enum = "",
|
||||||
|
Keyword = "",
|
||||||
|
Snippet = "",
|
||||||
|
Color = "",
|
||||||
|
File = "",
|
||||||
|
Reference = "",
|
||||||
|
Folder = "",
|
||||||
|
EnumMember = "",
|
||||||
|
Constant = "",
|
||||||
|
Struct = "",
|
||||||
|
Event = "",
|
||||||
|
Operator = "",
|
||||||
|
TypeParameter = "",
|
||||||
|
}
|
||||||
|
|
||||||
local luasnip = require('luasnip')
|
local luasnip = require('luasnip')
|
||||||
local lspkind = require('lspkind')
|
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local defaults = require("cmp.config.default")()
|
local defaults = require("cmp.config.default")()
|
||||||
return {
|
return {
|
||||||
@ -55,7 +82,7 @@ return {
|
|||||||
},
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
require("luasnip").lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
@ -83,10 +110,19 @@ return {
|
|||||||
{ name = "buffer", keyword_length = 3 },
|
{ name = "buffer", keyword_length = 3 },
|
||||||
}),
|
}),
|
||||||
formatting = {
|
formatting = {
|
||||||
format = lspkind.cmp_format({
|
format = function(entry, vim_item)
|
||||||
mode = 'symbol_text', -- show only symbol annotations
|
-- Kind icons
|
||||||
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatenates the icons with the name of the item kind
|
||||||
})
|
-- Source
|
||||||
|
vim_item.menu = ({
|
||||||
|
buffer = "[Buffer]",
|
||||||
|
nvim_lsp = "[LSP]",
|
||||||
|
luasnip = "[LuaSnip]",
|
||||||
|
nvim_lua = "[Lua]",
|
||||||
|
latex_symbols = "[LaTeX]",
|
||||||
|
})[entry.source.name]
|
||||||
|
return vim_item
|
||||||
|
end
|
||||||
},
|
},
|
||||||
experimental = {
|
experimental = {
|
||||||
ghost_text = {
|
ghost_text = {
|
||||||
@ -103,6 +139,17 @@ return {
|
|||||||
require("cmp").setup(opts)
|
require("cmp").setup(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"kylechui/nvim-surround",
|
||||||
|
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
require("nvim-surround").setup({
|
||||||
|
-- Configuration here, or leave empty to use defaults
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
return {
|
return {
|
||||||
|
|
||||||
-- Fuzzy finder.
|
-- Fuzzy finder.
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
@ -7,15 +6,19 @@ return {
|
|||||||
version = false, -- telescope did only one release, so use HEAD for now
|
version = false, -- telescope did only one release, so use HEAD for now
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
"nvim-telescope/telescope-file-browser.nvim",
|
build = "gmake",
|
||||||
|
config = function()
|
||||||
|
require("telescope").load_extension("fzf")
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<C-n>", "<cmd>Telescope file_browser<cr>", desc = "File browser" },
|
{ "<leader><space>", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
|
||||||
{ "<leader>e", "<cmd>Telescope find_files<cr>", desc = "Find file" },
|
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||||
{ "<leader>b", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
{ "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Switch Buffer" },
|
||||||
{ "<leader>f", "<cmd>Telescope live_grep<cr>", desc = "Switch Buffer" },
|
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Search help tags" },
|
||||||
{ "<leader>h", "<cmd>Telescope help_tags<cr>", desc = "Search help tags" },
|
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
||||||
{ "z=", "<cmd>Telescope spell_suggest<cr>", desc = "Spell options" },
|
{ "z=", "<cmd>Telescope spell_suggest<cr>", desc = "Spell options" },
|
||||||
|
{ "<leader>ss", "<cmd>Telescope lsp_document_symbols<cr>", desc = "Goto Symbol" },
|
||||||
},
|
},
|
||||||
opts = function()
|
opts = function()
|
||||||
local actions = require("telescope.actions")
|
local actions = require("telescope.actions")
|
||||||
@ -58,16 +61,18 @@ return {
|
|||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- add telescope-fzf-native
|
|
||||||
{
|
{
|
||||||
"telescope.nvim",
|
'numToStr/Comment.nvim',
|
||||||
dependencies = {
|
opts = {
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
-- add any options here
|
||||||
build = "gmake",
|
},
|
||||||
config = function()
|
lazy = false,
|
||||||
require("telescope").load_extension("fzf")
|
},
|
||||||
end,
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
event = "InsertEnter",
|
||||||
|
opts = {
|
||||||
|
fast_wrap = {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -181,35 +186,6 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- buffer remove
|
|
||||||
{
|
|
||||||
"echasnovski/mini.bufremove",
|
|
||||||
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>bd",
|
|
||||||
function()
|
|
||||||
local bd = require("mini.bufremove").delete
|
|
||||||
if vim.bo.modified then
|
|
||||||
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()),
|
|
||||||
"&Yes\n&No\n&Cancel")
|
|
||||||
if choice == 1 then -- Yes
|
|
||||||
vim.cmd.write()
|
|
||||||
bd(0)
|
|
||||||
elseif choice == 2 then -- No
|
|
||||||
bd(0, true)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
bd(0)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
desc = "Delete Buffer",
|
|
||||||
},
|
|
||||||
-- stylua: ignore
|
|
||||||
{ "<leader>bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- better diagnostics list and others
|
-- better diagnostics list and others
|
||||||
{
|
{
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
@ -267,4 +243,16 @@ return {
|
|||||||
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"folke/flash.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||||
|
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||||
|
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||||
|
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||||
|
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,6 @@ return {
|
|||||||
-- lspconfig
|
-- lspconfig
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
|
||||||
"onsails/lspkind.nvim",
|
|
||||||
"lukas-reineke/lsp-format.nvim",
|
|
||||||
},
|
|
||||||
opts = {
|
opts = {
|
||||||
-- options for vim.diagnostic.config()
|
-- options for vim.diagnostic.config()
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
@ -35,7 +31,7 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local lsp= require('lspconfig')
|
local lsp = require('lspconfig')
|
||||||
local lsp_defaults = lsp.util.default_config
|
local lsp_defaults = lsp.util.default_config
|
||||||
|
|
||||||
lsp_defaults.capabilities = vim.tbl_deep_extend(
|
lsp_defaults.capabilities = vim.tbl_deep_extend(
|
||||||
@ -58,7 +54,7 @@ return {
|
|||||||
sign({ name = 'DiagnosticSignHint', text = '⚑' })
|
sign({ name = 'DiagnosticSignHint', text = '⚑' })
|
||||||
sign({ name = 'DiagnosticSignInfo', text = '' })
|
sign({ name = 'DiagnosticSignInfo', text = '' })
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
float = {
|
float = {
|
||||||
@ -67,7 +63,7 @@ vim.diagnostic.config({
|
|||||||
header = '',
|
header = '',
|
||||||
prefix = '',
|
prefix = '',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
|
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
|
||||||
vim.lsp.handlers.hover,
|
vim.lsp.handlers.hover,
|
||||||
@ -92,18 +88,11 @@ vim.diagnostic.config({
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lsp-format").setup {
|
local on_attach = function(client)
|
||||||
html = {
|
|
||||||
exclude = { "html" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local on_attach = function(client)
|
|
||||||
local bufmap = function(mode, lhs, rhs)
|
local bufmap = function(mode, lhs, rhs)
|
||||||
local opts = {buffer = true}
|
local opts = { buffer = true }
|
||||||
vim.keymap.set(mode, lhs, rhs, opts)
|
vim.keymap.set(mode, lhs, rhs, opts)
|
||||||
end
|
end
|
||||||
require("lsp-format").on_attach(client)
|
|
||||||
|
|
||||||
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
||||||
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
||||||
@ -113,38 +102,91 @@ local on_attach = function(client)
|
|||||||
bufmap('n', 'gA', '<cmd>Telescope diagnostics<cr>')
|
bufmap('n', 'gA', '<cmd>Telescope diagnostics<cr>')
|
||||||
bufmap('n', 'gr', '<cmd>Telescope lsp_references<cr>')
|
bufmap('n', 'gr', '<cmd>Telescope lsp_references<cr>')
|
||||||
bufmap('n', 'gi', '<cmd>Telescope lsp_implementations<cr>')
|
bufmap('n', 'gi', '<cmd>Telescope lsp_implementations<cr>')
|
||||||
bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
bufmap('n', '<leader>cr', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
||||||
bufmap('n', '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>')
|
bufmap('n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
||||||
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
|
||||||
bufmap('x', '<F4>', '<cmd>lua vim.lsp.buf.range_code_action()<cr>')
|
|
||||||
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
||||||
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
||||||
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
||||||
end
|
end
|
||||||
|
|
||||||
lsp.gopls.setup {
|
lsp.gopls.setup {
|
||||||
settings = {
|
settings = {
|
||||||
gopls = {
|
gopls = {
|
||||||
analyses = {
|
gofumpt = true,
|
||||||
unusedparams = true,
|
codelenses = {
|
||||||
unusedvariable = true,
|
gc_details = false,
|
||||||
shadow = true
|
generate = true,
|
||||||
|
regenerate_cgo = true,
|
||||||
|
run_govulncheck = true,
|
||||||
|
test = true,
|
||||||
|
tidy = true,
|
||||||
|
upgrade_dependency = true,
|
||||||
|
vendor = true,
|
||||||
},
|
},
|
||||||
|
hints = {
|
||||||
|
assignVariableTypes = true,
|
||||||
|
compositeLiteralFields = true,
|
||||||
|
compositeLiteralTypes = true,
|
||||||
|
constantValues = true,
|
||||||
|
functionTypeParameters = true,
|
||||||
|
parameterNames = true,
|
||||||
|
rangeVariableTypes = true,
|
||||||
|
},
|
||||||
|
analyses = {
|
||||||
|
fieldalignment = true,
|
||||||
|
shadow = true,
|
||||||
|
unusedvariable = true,
|
||||||
|
unusedwrite = true,
|
||||||
|
useany = true,
|
||||||
|
},
|
||||||
|
usePlaceholders = true,
|
||||||
|
completeUnimported = true,
|
||||||
staticcheck = true,
|
staticcheck = true,
|
||||||
|
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
|
||||||
|
semanticTokens = true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
on_attach = on_attach
|
on_attach = on_attach
|
||||||
}
|
}
|
||||||
lsp.clangd.setup { on_attach = on_attach }
|
lsp.clangd.setup {
|
||||||
lsp.ltex.setup {
|
settings = {
|
||||||
|
clangd = {
|
||||||
|
cmd = {
|
||||||
|
"clangd",
|
||||||
|
"--background-index",
|
||||||
|
"--clang-tidy",
|
||||||
|
"--header-insertion=iwyu",
|
||||||
|
"--completion-style=detailed",
|
||||||
|
"--function-arg-placeholders",
|
||||||
|
"--fallback-style=llvm",
|
||||||
|
},
|
||||||
|
init_options = {
|
||||||
|
usePlaceholders = true,
|
||||||
|
completeUnimported = true,
|
||||||
|
clangdFileStatus = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
on_attach = on_attach
|
||||||
|
}
|
||||||
|
lsp.ltex.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
filetypes = { "latex", "tex", "bib", "mkd", "gitcommit", "text" },
|
filetypes = { "latex", "tex", "bib", "mkd", "gitcommit", "text" },
|
||||||
}
|
}
|
||||||
lsp.svelte.setup { on_attach = on_attach }
|
lsp.svelte.setup { on_attach = on_attach }
|
||||||
lsp.tsserver.setup { on_attach = on_attach }
|
lsp.tsserver.setup { on_attach = on_attach }
|
||||||
lsp.lua_ls.setup {
|
lsp.lua_ls.setup {
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
},
|
||||||
|
codeLens = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
callSnippet = "Replace",
|
||||||
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = { 'vim' }
|
globals = { 'vim' }
|
||||||
},
|
},
|
||||||
@ -153,5 +195,5 @@ lsp.lua_ls.setup {
|
|||||||
on_attach = on_attach
|
on_attach = on_attach
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,10 +50,30 @@ return {
|
|||||||
vim.o.laststatus = 0
|
vim.o.laststatus = 0
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
icons_enabled = true,
|
options = {
|
||||||
theme = 'auto',
|
theme = 'auto',
|
||||||
component_separators = '|',
|
icons_enabled = true,
|
||||||
section_separators = '',
|
globalstatus = true,
|
||||||
|
component_separators = "|",
|
||||||
|
disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } },
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = { "mode" },
|
||||||
|
lualine_b = { { "branch", icon = " " }, "diagnostics" },
|
||||||
|
lualine_c = { "filename" },
|
||||||
|
lualine_x = { "encoding",
|
||||||
|
{
|
||||||
|
"fileformat",
|
||||||
|
symbols = {
|
||||||
|
unix = " ",
|
||||||
|
dos = " ",
|
||||||
|
mac = " "
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "filetype", icon_only = true } },
|
||||||
|
lualine_y = { "progress" },
|
||||||
|
lualine_z = { "location" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -185,23 +205,175 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- -- lsp symbol navigation for lualine. This shows where
|
-- icons
|
||||||
-- in the code structure you are - within functions, classes,
|
|
||||||
-- etc - in the statusline.
|
|
||||||
{
|
{
|
||||||
"SmiteshP/nvim-navic",
|
"nvim-tree/nvim-web-devicons",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
opts = function()
|
opts = function()
|
||||||
return {
|
local devicons = require("nvim-web-devicons")
|
||||||
separator = " ",
|
local palette = {
|
||||||
highlight = true,
|
orange = "#d18616",
|
||||||
depth_limit = 5,
|
black = "#586069",
|
||||||
lazy_update_context = true,
|
bright_black = "#959da5",
|
||||||
|
white = "#d1d5da",
|
||||||
|
bright_white = "#fafbfc",
|
||||||
|
red = "#ea4a5a",
|
||||||
|
bright_red = "#f97583",
|
||||||
|
green = "#34d058",
|
||||||
|
bright_green = "#85e89d",
|
||||||
|
yellow = "#ffea7f",
|
||||||
|
bright_yellow = "#ffea7f",
|
||||||
|
blue = "#2188ff",
|
||||||
|
bright_blue = "#79b8ff",
|
||||||
|
magenta = "#b392f0",
|
||||||
|
bright_magenta = "#b392f0",
|
||||||
|
cyan = "#39c5cf",
|
||||||
|
bright_cyan = "#56d4dd",
|
||||||
}
|
}
|
||||||
|
devicons.set_icon({
|
||||||
|
[".zshrc"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_black,
|
||||||
|
name = "Zshrc",
|
||||||
|
},
|
||||||
|
["bash"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_black,
|
||||||
|
name = "Bash",
|
||||||
|
},
|
||||||
|
["c"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "C",
|
||||||
|
},
|
||||||
|
["c++"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_red,
|
||||||
|
name = "CPlusPlus",
|
||||||
|
},
|
||||||
|
["cc"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_red,
|
||||||
|
name = "CPlusPlus",
|
||||||
|
},
|
||||||
|
["go"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "Go",
|
||||||
|
},
|
||||||
|
["js"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.yellow,
|
||||||
|
name = "Js",
|
||||||
|
},
|
||||||
|
["lua"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "Lua",
|
||||||
|
},
|
||||||
|
["markdown"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "Markdown",
|
||||||
|
},
|
||||||
|
["md"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "Md",
|
||||||
|
},
|
||||||
|
["mdx"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "Mdx",
|
||||||
|
},
|
||||||
|
["php"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.magenta,
|
||||||
|
name = "Php",
|
||||||
|
},
|
||||||
|
["pl"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "Pl",
|
||||||
|
},
|
||||||
|
["py"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "Py",
|
||||||
|
},
|
||||||
|
["pyc"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "Pyc",
|
||||||
|
},
|
||||||
|
["pyd"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "Pyd",
|
||||||
|
},
|
||||||
|
["pyo"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_blue,
|
||||||
|
name = "Pyo",
|
||||||
|
},
|
||||||
|
["rake"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_red,
|
||||||
|
name = "Rake",
|
||||||
|
},
|
||||||
|
["rakefile"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_red,
|
||||||
|
name = "Rakefile",
|
||||||
|
},
|
||||||
|
["rb"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_red,
|
||||||
|
name = "Rb",
|
||||||
|
},
|
||||||
|
["sh"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_black,
|
||||||
|
name = "Sh",
|
||||||
|
},
|
||||||
|
["sql"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_black,
|
||||||
|
name = "Sql",
|
||||||
|
},
|
||||||
|
["svelte"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.orange,
|
||||||
|
name = "Svelte"
|
||||||
|
},
|
||||||
|
["yaml"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_black,
|
||||||
|
name = "Yaml",
|
||||||
|
},
|
||||||
|
["yml"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_black,
|
||||||
|
name = "Yml",
|
||||||
|
},
|
||||||
|
["zsh"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_black,
|
||||||
|
name = "Zsh",
|
||||||
|
},
|
||||||
|
["terminal"] = {
|
||||||
|
icon = " ",
|
||||||
|
color = palette.bright_black,
|
||||||
|
name = "Terminal",
|
||||||
|
},
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- icons
|
{
|
||||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
"yamatsum/nvim-nonicons",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
lazy = true
|
||||||
|
},
|
||||||
|
|
||||||
-- ui components
|
-- ui components
|
||||||
{ "MunifTanjim/nui.nvim", lazy = true },
|
{ "MunifTanjim/nui.nvim", lazy = true },
|
||||||
@ -247,7 +419,7 @@ return {
|
|||||||
{
|
{
|
||||||
"nvimdev/dashboard-nvim",
|
"nvimdev/dashboard-nvim",
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
opts = function(_, opts)
|
opts = function()
|
||||||
local logo = [[
|
local logo = [[
|
||||||
_ _ _ _
|
_ _ _ _
|
||||||
| | (_) | | | |
|
| | (_) | | | |
|
||||||
@ -258,9 +430,15 @@ return {
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
||||||
opts.config.header = vim.split(logo, "\n")
|
|
||||||
opts.theme = "doom"
|
local opts = {
|
||||||
opts.config.center = {
|
theme = "doom",
|
||||||
|
hide = {
|
||||||
|
statusline = false,
|
||||||
|
},
|
||||||
|
config = {
|
||||||
|
header = vim.split(logo, "\n"),
|
||||||
|
center = {
|
||||||
{
|
{
|
||||||
action = "Telescope find_files",
|
action = "Telescope find_files",
|
||||||
desc = " Find file",
|
desc = " Find file",
|
||||||
@ -298,7 +476,32 @@ return {
|
|||||||
key = "l",
|
key = "l",
|
||||||
},
|
},
|
||||||
{ action = "qa", desc = " Quit", icon = " ", key = "q" },
|
{ action = "qa", desc = " Quit", icon = " ", key = "q" },
|
||||||
|
},
|
||||||
|
footer = function()
|
||||||
|
local stats = require("lazy").stats()
|
||||||
|
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||||
|
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, button in ipairs(opts.config.center) do
|
||||||
|
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
||||||
|
button.key_format = " %s"
|
||||||
|
end
|
||||||
|
|
||||||
|
-- close Lazy and re-open when the dashboard is ready
|
||||||
|
if vim.o.filetype == "lazy" then
|
||||||
|
vim.cmd.close()
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "DashboardLoaded",
|
||||||
|
callback = function()
|
||||||
|
require("lazy").show()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return opts
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -70,5 +70,5 @@ source $HOME/perl5/perlbrew/etc/bashrc
|
|||||||
export PATH=/opt/homebrew/bin:$PATH
|
export PATH=/opt/homebrew/bin:$PATH
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
|
||||||
eval "$(atuin init zsh)"
|
eval "$(atuin init zsh)"
|
||||||
|
{{- end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user