- new neovim config
This commit is contained in:
5
lua/plugins/autotag.lua
Normal file
5
lua/plugins/autotag.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
opts = {}
|
||||
}
|
||||
|
49
lua/plugins/blink.lua
Normal file
49
lua/plugins/blink.lua
Normal file
@ -0,0 +1,49 @@
|
||||
return {
|
||||
'saghen/blink.cmp',
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||
|
||||
version = '1.*',
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = 'default' },
|
||||
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = 'normal'
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = true } },
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
}
|
||||
|
9
lua/plugins/colorscheme.lua
Normal file
9
lua/plugins/colorscheme.lua
Normal file
@ -0,0 +1,9 @@
|
||||
return {
|
||||
"thesimonho/kanagawa-paper.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
init = function()
|
||||
vim.cmd.colorscheme("kanagawa-paper-ink")
|
||||
end,
|
||||
opts = {...},
|
||||
}
|
132
lua/plugins/lspconfig.lua
Normal file
132
lua/plugins/lspconfig.lua
Normal file
@ -0,0 +1,132 @@
|
||||
return { -- LSP Configuration & Plugins
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
-- Automatically install LSPs and related tools to stdpath for neovim
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
|
||||
-- Useful status updates for LSP.
|
||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
},
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(event)
|
||||
local map = function(keys, func, desc)
|
||||
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
end
|
||||
-- map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
map('gd', function() vim.lsp.buf.definition() end, '[G]oto [D]efinition')
|
||||
-- map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
-- map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
-- map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
-- map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||
-- map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
map('<leader>bf', vim.lsp.buf.format, '[B]uffer [F]ormat')
|
||||
|
||||
-- The following two autocommands are used to highlight references of the
|
||||
-- word under your cursor when your cursor rests there for a little while.
|
||||
-- See `:help CursorHold` for information about when this is executed
|
||||
--
|
||||
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client.server_capabilities.documentHighlightProvider then
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
buffer = event.buf,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||
buffer = event.buf,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
end
|
||||
|
||||
-- autoformat
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = event.buf,
|
||||
callback = function()
|
||||
vim.lsp.buf.format { async = false, id = event.data.client_id }
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- Ensure the servers and tools above are installed
|
||||
-- To check the current status of installed tools and/or manually install
|
||||
-- other tools, you can run
|
||||
-- :Mason
|
||||
--
|
||||
-- You can press `g?` for help in this menu
|
||||
require('mason').setup()
|
||||
|
||||
-- You can add other tools here that you want Mason to install
|
||||
-- for you, so that they are available from within Neovim.
|
||||
require('mason-tool-installer').setup {}
|
||||
|
||||
require('mason-lspconfig').setup {}
|
||||
|
||||
vim.lsp.config("lua_ls", {
|
||||
settings = {
|
||||
Lua = {
|
||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||
-- diagnostics = { disable = { 'missing-fields' } },
|
||||
diagnostics = { globals = { "vim", "require" } },
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
-- local vue_path = vim.fn.stdpath("data") ..
|
||||
-- "/mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@vue/typescript-plugin"
|
||||
|
||||
local vue_path = vim.fn.stdpath("data") ..
|
||||
"/mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@vue/typescript-plugin"
|
||||
|
||||
vim.lsp.config('ts_ls', {
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
-- location = vim.fn.stdpath("data") .. "/erikcustom/language-tools/packages/typescript-plugin",
|
||||
-- /mason/packages/vue-language-server/node_modules/@vue/language-server/node_modules/@vue/typescript-plugin
|
||||
location = vue_path,
|
||||
languages = { "javascript", "typescript", "vue" },
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
typescript = {
|
||||
tsserver = {
|
||||
useSyntaxServer = false,
|
||||
},
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = 'all',
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayVariableTypeHintsWhenTypeMatchesName = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"typescript",
|
||||
"vue",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
39
lua/plugins/mini.lua
Normal file
39
lua/plugins/mini.lua
Normal file
@ -0,0 +1,39 @@
|
||||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
config = function()
|
||||
require("mini.statusline").setup({
|
||||
use_icons = true,
|
||||
content = {
|
||||
active = function()
|
||||
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
|
||||
local git = MiniStatusline.section_git({ trunc_width = 75 })
|
||||
local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 })
|
||||
local filename = MiniStatusline.section_filename({ trunc_width = 40 })
|
||||
local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
|
||||
local location = MiniStatusline.section_location({ trunc_width = 75 })
|
||||
local search = MiniStatusline.section_searchcount({ trunc_width = 75 })
|
||||
local lsp = MiniStatusline.section_lsp({ trunc_width = 75 })
|
||||
local recording = vim.fn.reg_recording()
|
||||
if recording:len() > 0 then
|
||||
recording = "Rec: " .. recording
|
||||
end
|
||||
|
||||
return MiniStatusline.combine_groups({
|
||||
{ hl = mode_hl, strings = { mode } },
|
||||
{ hl = mode_hl, strings = { recording } },
|
||||
{ hl = 'MiniStatuslineDevinfo', strings = { git, diagnostics } },
|
||||
'%<', -- Mark general truncate point
|
||||
{ hl = 'MiniStatuslineFilename', strings = { filename } },
|
||||
'%=', -- End left alignment
|
||||
{ hl = 'MiniStatuslineDevinfo', strings = { lsp } },
|
||||
{ hl = 'MiniStatuslineFileinfo', strings = { fileinfo } },
|
||||
{ hl = mode_hl, strings = { search, location } },
|
||||
})
|
||||
end
|
||||
}
|
||||
})
|
||||
require("mini.tabline").setup()
|
||||
require("mini.pairs").setup()
|
||||
require("mini.colors").setup()
|
||||
end
|
||||
}
|
27
lua/plugins/telescope.lua
Normal file
27
lua/plugins/telescope.lua
Normal file
@ -0,0 +1,27 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim", tag = "0.1.8",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" },
|
||||
opts = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', "<leader>ff", builtin.find_files, {desc = "[F]ind [F]iles"})
|
||||
vim.keymap.set('n', "<leader>fg", builtin.live_grep, {desc = "[F]ind [G]rep"})
|
||||
vim.keymap.set('n', "<leader>fb", builtin.buffers, {desc = "[F]ind [B]uffers"})
|
||||
vim.keymap.set('n', "<leader>fh", builtin.help_tags, {desc = "[F]ind [H]elp"})
|
||||
vim.keymap.set('n', "<leader>fd", builtin.diagnostics, {desc = "[F]ind [D]iagnostics"})
|
||||
vim.keymap.set('n', "<leader>fo", builtin.resume, {desc = "[F]ind [O]Resume"})
|
||||
end,
|
||||
|
||||
-- keys = {
|
||||
-- { "<leader>ff", require("telescope.builtin").find_files, desc = "[F]ind [F]iles" },
|
||||
-- { "<leader>fg", require("telescope.builtin").live_grep, desc = "[F]ind [G]rep" },
|
||||
-- { "<leader>fb", require("telescope.builtin").buffers, desc = "[F]ind [B]uffers" },
|
||||
-- { "<leader>fh", require("telescope.builtin").help_tags, desc = "[F]ind [H]elp" },
|
||||
-- { "<leader>fd", require("telescope.builtin").diagnostics, desc = "[F]ind [D]iagnostics" },
|
||||
-- { "<leader>fo", require("telescope.builtin").resume, desc = "[F]ind [O]Resume" },
|
||||
-- {
|
||||
-- "<leader>fp",
|
||||
-- function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
|
||||
-- desc = "[F]ind [P]lugin file",
|
||||
-- },
|
||||
-- },
|
||||
}
|
12
lua/plugins/treesitter.lua
Normal file
12
lua/plugins/treesitter.lua
Normal file
@ -0,0 +1,12 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = 'master',
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
event = { "BufRead" },
|
||||
opts = { -- Das Plugin bietet noch diverse weitere Optionen.
|
||||
indent = { enable = true }, -- Automatische Einrückungen mit Tree-sitter
|
||||
highlight = { enable = true }, -- Das Syntax-Highlighting einschalten
|
||||
auto_install = true, -- Highlighting-Daten automatisch installieren
|
||||
}
|
||||
}
|
20
lua/plugins/whichkey.lua
Normal file
20
lua/plugins/whichkey.lua
Normal file
@ -0,0 +1,20 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
config = function()
|
||||
local wk = require("which-key")
|
||||
wk.add({
|
||||
{ "<leader>f", group = "Telescope" }
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user