mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 03:14:55 +02:00
update nvim config
This commit is contained in:
parent
6c7551640d
commit
07a49ce2d2
16 changed files with 157 additions and 46 deletions
|
|
@ -20,6 +20,7 @@ return {
|
|||
red = '#cc817f',
|
||||
green = '#7ccfaf',
|
||||
yellow = '#ffcc99',
|
||||
orange = '#ffcc99',
|
||||
blue = '#8ac6f2',
|
||||
cyan = '#8abeb7',
|
||||
purple = '#9999cc'
|
||||
|
|
@ -28,9 +29,23 @@ return {
|
|||
["@string"] = { fg = "$purple" },
|
||||
["@function"] = { fg = "$fg" },
|
||||
["@keyword"] = { fg = "$yellow" },
|
||||
["@keyword.import"] = { fg = "$yellow" },
|
||||
["@keyword.function"] = { fg = "$yellow" },
|
||||
["@keyword.conditional"] = { fg = "$yellow" },
|
||||
["@keyword.operator"] = { fg = "$yellow" },
|
||||
["@type"] = { fg = "$blue" },
|
||||
["@type.qualifier"] = { fg = "$yellow" },
|
||||
["@type.definition"] = { fg = "$blue" },
|
||||
["@type.builtin"] = { fg = "$blue" },
|
||||
["@function.method"] = { fg = "$fg" },
|
||||
["@number"] = { fg = "$red" },
|
||||
["@variable"] = { fg = "$green" },
|
||||
["@variable.builtin"] = { fg = "$green" },
|
||||
["@variable.parameter"] = { fg = "$fg" },
|
||||
["@property"] = { fg = "$green" },
|
||||
["@punctuation.delimiter"] = { fg = "$fg" },
|
||||
["@punctuation.bracket"] = { fg = "$fg" }
|
||||
["@punctuation.bracket"] = { fg = "$fg" },
|
||||
["@module"] = { fg = "$fg" },
|
||||
}
|
||||
},
|
||||
config = function(_, opts)
|
||||
|
|
|
|||
27
nvim/lua/plugins/dashboard.lua
Normal file
27
nvim/lua/plugins/dashboard.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
'nvimdev/dashboard-nvim',
|
||||
name = 'dashboard',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
},
|
||||
event = 'VimEnter',
|
||||
opts = {
|
||||
config = {
|
||||
header = {
|
||||
'::::::::: :::: ::: ::: :::',
|
||||
':+: :+: :+:+: :+: :+: :+:',
|
||||
'+:+ +:+ :+:+:+ +:+ +:+ +:+ ',
|
||||
'+#++:++#+ +#+ +:+ +#+ +#++:+ ',
|
||||
'+#+ +#+ +#+#+# +#+ +#+ ',
|
||||
'#+# #+# #+#+# #+# #+#',
|
||||
'### ### #### ### ###',
|
||||
'',
|
||||
},
|
||||
shortcut = {
|
||||
{ desc = ' Update', group = '@property', action = 'Lazy update', key = 'u' }
|
||||
},
|
||||
footer = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,11 +1,15 @@
|
|||
return {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ '<leader>gp', '<cmd>Gitsigns preview_hunk<cr>', desc = 'Git preview diff' },
|
||||
{ '<leader>gb', '<cmd>Gitsigns blame_line<cr>', desc = 'Git blame' }
|
||||
},
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = '│' },
|
||||
add = { text = '▌' },
|
||||
delete = { text = '' },
|
||||
change = { text = '│' },
|
||||
change = { text = '▌' },
|
||||
untracked = { text = '+'}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
14
nvim/lua/plugins/go.lua
Normal file
14
nvim/lua/plugins/go.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
"ray-x/go.nvim",
|
||||
dependencies = {
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
config = function()
|
||||
require("go").setup()
|
||||
end,
|
||||
event = {"CmdlineEnter"},
|
||||
ft = {"go", 'gomod'},
|
||||
build = ':lua require("go.install").update_all_sync()'
|
||||
}
|
||||
|
|
@ -1,10 +1,16 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
opts = {
|
||||
scope = {
|
||||
enabled = true,
|
||||
show_exact_scope = true
|
||||
show_exact_scope = true,
|
||||
},
|
||||
exclude = {
|
||||
filetypes = {
|
||||
'help',
|
||||
'dashboard'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,11 +13,14 @@ vim.opt.rtp:prepend(lazypath)
|
|||
|
||||
require("lazy").setup({
|
||||
|
||||
{ import = "plugins.dashboard" },
|
||||
|
||||
-- Highlight
|
||||
{ import = "plugins.colorscheme" },
|
||||
|
||||
{ import = "plugins.indent" },
|
||||
{ import = "plugins.nvim-autopairs" },
|
||||
{ import = "plugins.mini-comment" },
|
||||
|
||||
-- Filetree
|
||||
{ import = "plugins.neo-tree" },
|
||||
|
|
@ -30,12 +33,17 @@ require("lazy").setup({
|
|||
|
||||
-- Keybind helper
|
||||
{ import = "plugins.which-key" },
|
||||
|
||||
|
||||
-- Treesitter
|
||||
{ import = "plugins.treesitter" },
|
||||
|
||||
-- LSP
|
||||
{ import = "plugins.lsp" },
|
||||
{ import = "plugins.nvim-cmp" },
|
||||
|
||||
{ import = "plugins.go" },
|
||||
|
||||
{ import = "plugins.nvim-test" },
|
||||
|
||||
-- Git changes in gutter
|
||||
{ import = "plugins.gitsigns" },
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ return {
|
|||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
require('plugins.cmp')
|
||||
},
|
||||
config = function()
|
||||
-- Setup Mason to automatically install LSP servers
|
||||
|
|
@ -12,25 +11,19 @@ return {
|
|||
local lspconfig = require('lspconfig')
|
||||
-- local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
-- PHP
|
||||
lspconfig.intelephense.setup({
|
||||
commands = {
|
||||
IntelephenseIndex = {
|
||||
function() vim.lsp.buf.execute_command({ command = 'intelephense.index.workspace' }) end,
|
||||
},
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
end,
|
||||
-- capabilities = capabilities
|
||||
-- php - phpactor
|
||||
lspconfig.phpactor.setup({
|
||||
init_options = {
|
||||
["language_server_phpstan.enabled"] = true,
|
||||
["language_server_psalm.enabled"] = false,
|
||||
}
|
||||
})
|
||||
|
||||
-- GO
|
||||
lspconfig.gopls.setup({})
|
||||
-- Tailwind CSS
|
||||
--require('lspconfig').tailwindcss.setup({ capabilities = capabilities })
|
||||
|
||||
|
||||
-- Format on save.
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = '*.go',
|
||||
|
|
@ -41,7 +34,30 @@ return {
|
|||
|
||||
-- Typescript
|
||||
lspconfig.tsserver.setup({})
|
||||
|
||||
|
||||
-- lua
|
||||
lspconfig.lua_ls.setup({
|
||||
on_init = function(client)
|
||||
local path = client.workspace_folders[1].name
|
||||
if not vim.loop.fs_stat(path..'/.luarc.json') and not vim.loop.fs_stat(path..'/.luarc.jsonc') then
|
||||
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT'
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
return true
|
||||
end
|
||||
})
|
||||
|
||||
-- Config
|
||||
-- Sign configuration
|
||||
vim.fn.sign_define('DiagnosticSignError', { text = '', texthl = 'DiagnosticSignError' })
|
||||
|
|
|
|||
7
nvim/lua/plugins/mini-comment.lua
Normal file
7
nvim/lua/plugins/mini-comment.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'echasnovski/mini.comment',
|
||||
version = '*',
|
||||
config = function()
|
||||
require('mini.comment').setup({})
|
||||
end
|
||||
}
|
||||
3
nvim/lua/plugins/nvim-test.lua
Normal file
3
nvim/lua/plugins/nvim-test.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"klen/nvim-test",
|
||||
}
|
||||
|
|
@ -5,10 +5,7 @@ return {
|
|||
'nvim-lua/plenary.nvim',
|
||||
'kyazdani42/nvim-web-devicons'
|
||||
},
|
||||
keys = {
|
||||
{ '<leader>f', function() require('telescope.builtin').find_files() end },
|
||||
{ '<leader>F', function() require('telescope.builtin').git_files() end },
|
||||
},
|
||||
keys = require('config.telescope'),
|
||||
config = function()
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
|
|
|
|||
|
|
@ -10,18 +10,19 @@ return {
|
|||
-- A list of parser names
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"c",
|
||||
"cpp",
|
||||
"ninja",
|
||||
"cmake",
|
||||
"lua",
|
||||
"vim",
|
||||
"make",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query",
|
||||
"query",
|
||||
"php",
|
||||
"blade",
|
||||
"go",
|
||||
"javascript",
|
||||
"go",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"css",
|
||||
"scss",
|
||||
|
|
@ -33,7 +34,7 @@ return {
|
|||
"toml",
|
||||
"xml",
|
||||
"glsl",
|
||||
"hlsl",
|
||||
"hlsl",
|
||||
"markdown"
|
||||
},
|
||||
|
||||
|
|
@ -54,9 +55,9 @@ return {
|
|||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
|
||||
indent = {
|
||||
enable = true
|
||||
}
|
||||
-- indent = {
|
||||
-- enable = true
|
||||
--}
|
||||
},
|
||||
config = function(_, opts)
|
||||
local parser_config = require('nvim-treesitter.parsers').get_parser_configs()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue