change(nvim): changed config for nvchad v2.0

This commit is contained in:
Gerrit Pannek 2023-03-15 13:06:11 +01:00 committed by nold
parent d832c29659
commit a8f1f6e8f7
8 changed files with 166 additions and 65 deletions

View file

@ -10,24 +10,8 @@ M.ui = {
theme = "tokyonight" theme = "tokyonight"
} }
M.plugins = require "custom.plugins" M.plugins = "custom.plugins"
M.mappings = require "custom.mappings"
M.mappings = {
teleskope = {
n = {
["<leader>?"] = { "<cmd> Telescope keymaps <CR>", "show keys" },
}
}
-- -- custom = {}, -- custom user mappings
--
-- custom = {
-- cheatsheet = "<leader>ch",
-- line_number_toggle = "<leader>n", -- toggle line number
-- update_nvchad = "<leader>uu",
-- new_tab = "<leader>t",
-- },
}
return M return M

View file

@ -0,0 +1,17 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
-- if you just want default config for the servers then put them in a table
local servers = { "ansiblels", "bashls", "pylsp", "yamlls", "marksman", "terraform_lsp", "jsonls" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
end
--
-- lspconfig.pyright.setup { blabla}

View file

@ -0,0 +1,25 @@
local present, null_ls = pcall(require, "null-ls")
if not present then
return
end
local b = null_ls.builtins
local sources = {
-- webdev stuff
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
b.formatting.prettier.with { filetypes = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes
-- Lua
b.formatting.stylua,
-- cpp
b.formatting.clang_format,
}
null_ls.setup {
debug = true,
sources = sources,
}

View file

@ -0,0 +1,77 @@
local M = {}
M.treesitter = {
ensure_installed = {
"diff",
"gitcommit",
"git_rebase",
"yaml",
"toml",
"dockerfile",
"python",
"go",
"php",
"make",
"jq",
"bash",
"json5",
"vim",
"lua",
"html",
"css",
"javascript",
"c",
"markdown",
"markdown_inline",
},
indent = {
enable = true,
disable = {
"python"
},
},
}
M.mason = {
ensure_installed = {
-- LSP:
"yaml-language-server",
"python-lsp-server",
"lua-language-server",
"bash-language-server",
"ansible-language-server",
"dockerfile-language-server",
"json-lsp",
"marksman",
"terraform-ls",
-- Formater:
"yamlfmt",
"shfmt",
"fixjson",
-- Linter:
"gitlint",
"yamllint",
"prettier",
"markdownlint",
},
}
-- git support in nvimtree
M.nvimtree = {
git = {
enable = true,
},
renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}
return M

View file

@ -1,14 +1,14 @@
-- AutoCMD: -- AutoCMD:
--vim.cmd([[ -- vim.cmd([[
-- stuff -- stuff
-- stuff -- stuff
--]]) -- ]])
-- Open a file from its last left off position -- Open a file from its last left off position
vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]] -- vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
-- uncomment this if you want to open nvim with a dir -- uncomment this if you want to open nvim with a dir
vim.cmd [[ autocmd BufEnter * if &buftype != "terminal" | lcd %:p:h | endif ]] -- vim.cmd [[ autocmd BufEnter * if &buftype != "terminal" | lcd %:p:h | endif ]]
-- File extension specific tabbing -- File extension specific tabbing
vim.cmd [[ autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 ]] -- vim.cmd [[ autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 ]]

View file

@ -0,0 +1,12 @@
---@type MappingsTable
local M = {}
M.general = {
n = {
[";"] = { ":", "enter command mode", opts = { nowait = true } },
},
}
-- more keybinds!
return M

View file

@ -0,0 +1,28 @@
local overrides = require("custom.configs.overrides")
---@type NvPluginSpec[]
local plugins = {
{
"neovim/nvim-lspconfig",
dependencies = {
-- format & linting
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require "custom.configs.null-ls"
end,
},
},
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end, -- Override to setup mason-lspconfig
},
-- overrde plugin configs
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
},
}
return plugins

View file

@ -1,42 +0,0 @@
-- Additional Plugins
--
return {
['cappyzawa/trim.nvim'] = {
override_options = {
config = function()
require('trim').setup({
-- if you want to ignore markdown file.
-- you can specify filetypes.
disable = {"markdown"},
-- if you want to ignore space of top
patterns = {
[[%s/\s\+$//e]], -- remove unwanted spaces
[[%s/\($\n\s*\)\+\%$//]], -- trim last line
[[%s/\%^\n\+//]], -- trim first line
-- [[%s/\(\n\n\)\n\+/\1/]], -- replace multiple blank lines with a single line
},
})
end
}
},
-- disable dashboard
['goolord/alpha-nvim'] = { disable = true },
-- UI
["NvChad/ui"] = {
override_options = {
statusline = {
separator_style = "arrow", -- default/round/block/arrow
overriden_modules = nil,
},
-- lazyload it when there are 1+ buffers
tabufline = {
enabled = true,
lazyload = true,
overriden_modules = nil,
},
}
},
}