aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim
diff options
context:
space:
mode:
authorLuca Matei Pintilie <lucafulger@gmail.com>2022-02-11 16:33:32 +0000
committerLuca Matei Pintilie <lucafulger@gmail.com>2022-02-11 16:33:32 +0000
commit4417eb0a77892f4b24eeb5adc97b8890f14187fb (patch)
treeafae6a2e2f7b9c0ceb5109d8c5f4fd33df994d4d /.config/nvim
parentf8acb4edc93d2570856381eb7fb6f75db3955cf6 (diff)
downloaddotfiles-4417eb0a77892f4b24eeb5adc97b8890f14187fb.tar
dotfiles-4417eb0a77892f4b24eeb5adc97b8890f14187fb.tar.gz
dotfiles-4417eb0a77892f4b24eeb5adc97b8890f14187fb.tar.bz2
dotfiles-4417eb0a77892f4b24eeb5adc97b8890f14187fb.tar.lz
dotfiles-4417eb0a77892f4b24eeb5adc97b8890f14187fb.tar.xz
dotfiles-4417eb0a77892f4b24eeb5adc97b8890f14187fb.tar.zst
dotfiles-4417eb0a77892f4b24eeb5adc97b8890f14187fb.zip
Update NvChad config
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/lua/custom/chadrc.lua17
-rw-r--r--.config/nvim/lua/custom/init.lua23
-rw-r--r--.config/nvim/lua/custom/plugins/init.lua42
3 files changed, 68 insertions, 14 deletions
diff --git a/.config/nvim/lua/custom/chadrc.lua b/.config/nvim/lua/custom/chadrc.lua
index bc4b88e..a5de99c 100644
--- a/.config/nvim/lua/custom/chadrc.lua
+++ b/.config/nvim/lua/custom/chadrc.lua
@@ -1,8 +1,9 @@
-- IMPORTANT NOTE : This is the user config, can be edited. Will be preserved if updated with internal updater
-- This file is for NvChad options & tools, custom settings are split between here and 'lua/custom/init.lua'
+local userPlugins = require "custom.plugins"
local M = {}
-M.options, M.ui, M.mappings, M.plugins = {}, {}, {}, {}
+-- M.options, M.ui, M.mappings, M.plugins = {}, {}, {}, {}
-- NOTE: To use this, make a copy with `cp example_chadrc.lua chadrc.lua`
@@ -11,16 +12,22 @@ M.options, M.ui, M.mappings, M.plugins = {}, {}, {}, {}
-- To use this file, copy the structure of `core/default_config.lua`,
-- examples of setting relative number & changing theme:
--- M.options = {
--- relativenumber = true,
--- }
+M.options = {
+ relativenumber = true,
+ expandtab = false,
+ shiftwidth = 4,
+ smartindent = false,
+ tabstop = 4,
+}
M.ui = {
- theme = "chadracula"
+ theme = "chadracula",
+ transparency = true,
}
-- NvChad included plugin options & overrides
M.plugins = {
+ install = userPlugins,
options = {
-- lspconfig = {
-- path of file containing setups of different lsps (ex : "custom.plugins.lspconfig"), read the docs for more info
diff --git a/.config/nvim/lua/custom/init.lua b/.config/nvim/lua/custom/init.lua
index 473ff84..6d1f5fb 100644
--- a/.config/nvim/lua/custom/init.lua
+++ b/.config/nvim/lua/custom/init.lua
@@ -1,6 +1,7 @@
-- This is where your custom modules and plugins go.
-- See the wiki for a guide on how to extend NvChad
-local hooks = require "core.hooks"
+--local customPlugins = require "core.customPlugins"
+
vim.api.nvim_command("nnoremap <A-j> :m .+1<CR>==")
vim.api.nvim_command("nnoremap <A-k> :m .-2<CR>==")
vim.api.nvim_command("inoremap <A-j> <Esc>:m .+1<CR>==gi")
@@ -17,7 +18,7 @@ vim.api.nvim_command("vnoremap <A-k> :m '<-2<CR>gv=gv")
-- or you can override the whole plugin config with 'chadrc' -> M.plugins.default_plugin_config_replace{}
-- this will run your config instead of the NvChad config for the given plugin
--- hooks.override("lsp", "publish_diagnostics", function(current)
+-- customPlugins.override("lsp", "publish_diagnostics", function(current)
-- current.virtual_text = false;
-- return current;
-- end)
@@ -26,7 +27,7 @@ vim.api.nvim_command("vnoremap <A-k> :m '<-2<CR>gv=gv")
-- you can set one or many mappings
-- example below:
--- hooks.add("setup_mappings", function(map)
+-- customPlugins.add("setup_mappings", function(map)
-- map("n", "<leader>cc", "gg0vG$d", opt) -- example to delete the buffer
-- .... many more mappings ....
-- end)
@@ -36,7 +37,8 @@ vim.api.nvim_command("vnoremap <A-k> :m '<-2<CR>gv=gv")
-- see: https://github.com/wbthomason/packer.nvim
-- examples below:
-hooks.add("install_plugins", function(use)
+--[[
+customPlugins.add("install_plugins", function(use)
use {
"williamboman/nvim-lsp-installer",
config = function()
@@ -51,11 +53,14 @@ hooks.add("install_plugins", function(use)
server:setup(opts)
vim.cmd [[ do User LspAttachBuffers ]]
- end)
- end,
- }
+-- end)
+-- end,
+-- }
+ --]]
-- Custom stuff
- use { "nathom/filetype.nvim" }
+ -- use { "nathom/filetype.nvim" }
+ --[[
+
use {
"karb94/neoscroll.nvim",
@@ -77,7 +82,7 @@ hooks.add("install_plugins", function(use)
"editorconfig/editorconfig-vim",
}
end)
-
+--]]
-- alternatively, put this in a sub-folder like "lua/custom/plugins/mkdir"
-- then source it with
diff --git a/.config/nvim/lua/custom/plugins/init.lua b/.config/nvim/lua/custom/plugins/init.lua
new file mode 100644
index 0000000..5b40def
--- /dev/null
+++ b/.config/nvim/lua/custom/plugins/init.lua
@@ -0,0 +1,42 @@
+ return {
+{
+ "williamboman/nvim-lsp-installer",
+ config = function()
+ local lsp_installer = require "nvim-lsp-installer"
+
+ lsp_installer.on_server_ready(function(server)
+ local opts = {}
+
+ if server.name == "denols" then
+ opts.root_dir = vim.loop.cwd
+ end
+
+ server:setup(opts)
+ vim.cmd [[ do User LspAttachBuffers ]]
+ end)
+ end,
+ }
+ -- Custom stuff
+ ,{ "nathom/filetype.nvim" }
+
+ ,{
+ "karb94/neoscroll.nvim",
+ opt = true,
+ config = function()
+ require("neoscroll").setup()
+ end,
+
+ -- lazy loading
+ setup = function()
+ require("core.utils").packer_lazy_load "neoscroll.nvim"
+ end,
+ }
+
+ ,{
+ "prettier/vim-prettier",
+ }
+ ,{
+ "editorconfig/editorconfig-vim",
+ }
+
+}