Last active
September 18, 2023 18:36
-
-
Save aanari/045f4a01021dae07350fbcef7dcc9aa7 to your computer and use it in GitHub Desktop.
NvChad Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local M = {} | |
M.options, M.ui, M.mappings, M.plugins = {}, {}, {}, {} | |
M.options.tabstop = 4 | |
M.plugins = { | |
status = { | |
neoscroll = true, | |
colorizer = true, | |
truezen = true, | |
}, | |
options = { | |
nvimtree = { | |
enable_git = 1, | |
}, | |
lspconfig = { | |
setup_lspconf = "custom.plugins.lspconfig" | |
} | |
}, | |
} | |
M.ui = { | |
theme = "nord", | |
} | |
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim.g.did_load_filetypes = 1 | |
local hooks = require "core.hooks" | |
hooks.add("install_plugins", function(use) | |
use { | |
"jose-elias-alvarez/null-ls.nvim", | |
after = "nvim-lspconfig", | |
config = function() | |
require("custom.plugins.null-ls").setup() | |
end, | |
} | |
use { | |
"Pocco81/TrueZen.nvim", | |
cmd = { | |
"TZAtaraxis", | |
"TZMinimalist", | |
"TZFocus", | |
}, | |
config = function() | |
require("true-zen").setup() | |
end | |
} | |
use { | |
'ruifm/gitlinker.nvim', | |
requires = 'nvim-lua/plenary.nvim', | |
config = function() | |
require("gitlinker").setup{ | |
opts = { | |
action_callback = function(url) | |
-- yank to unnamed register | |
vim.api.nvim_command('let @" = \'' .. url .. '\'') | |
-- copy to the system clipboard using OSC52 | |
vim.fn.OSCYankString(url) | |
end, | |
}, | |
} | |
end, | |
} | |
use "f-person/git-blame.nvim" | |
use "christoomey/vim-tmux-navigator" | |
use "nathom/filetype.nvim" | |
use "tversteeg/registers.nvim" | |
use { | |
"ojroques/vim-oscyank", | |
config = function() | |
if vim.env.SSH_CLIENT or vim.env.SSH_TTY then | |
vim.cmd("autocmd!") | |
vim.cmd("autocmd TextYankPost * OSCYankReg +<CR>") | |
end | |
end | |
} | |
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local M = {} | |
M.setup_lsp = function(attach, capabilities) | |
local lspconfig = require "lspconfig" | |
local servers = { "html", "cssls", "bashls", "clangd" , "gopls", "rls", "tsserver", "pyright" } | |
for _, lsp in ipairs(servers) do | |
lspconfig[lsp].setup { | |
on_attach = attach, | |
capabilities = capabilities, | |
-- root_dir = vim.loop.cwd, | |
flags = { | |
debounce_text_changes = 150, | |
}, | |
} | |
end | |
-- emmet | |
local configs = require "lspconfig/configs" | |
configs.ls_emmet = { | |
default_config = { | |
cmd = { "ls_emmet", "--stdio" }, | |
filetypes = { "html", "css", "scss" }, | |
root_dir = function(fname) | |
return vim.loop.cwd() | |
end, | |
settings = {}, | |
}, | |
} | |
end | |
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ok, null_ls = pcall(require, "null-ls") | |
if not ok then | |
return | |
end | |
local sources = { | |
null_ls.builtins.formatting.black, | |
null_ls.builtins.formatting.clang_format, | |
null_ls.builtins.formatting.isort, | |
null_ls.builtins.formatting.rustfmt, | |
null_ls.builtins.formatting.prettierd.with { | |
filetypes = { "html", "json", "markdown", "scss", "css", "typescript" }, | |
}, | |
null_ls.builtins.diagnostics.eslint.with { | |
command = "eslint_d", | |
}, | |
null_ls.builtins.formatting.shfmt, | |
null_ls.builtins.diagnostics.shellcheck.with { diagnostics_format = "#{m} [#{c}]" }, | |
} | |
local M = {} | |
M.setup = function(on_attach) | |
null_ls.config { | |
sources = sources, | |
} | |
require("lspconfig")["null-ls"].setup { on_attach = on_attach } | |
end | |
return M |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment