diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2021-12-21 20:26:50 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2021-12-21 20:26:50 +0000 |
commit | f8acb4edc93d2570856381eb7fb6f75db3955cf6 (patch) | |
tree | d8db466f88799f7d796e0b93d6a2ad8394c599c9 /.config/nvim/lua | |
parent | 2169a4155362a7f1639e4ad78033abb193f2d565 (diff) | |
download | dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar.gz dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar.bz2 dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar.lz dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar.xz dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar.zst dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.zip |
Initial commit2
Diffstat (limited to '.config/nvim/lua')
-rw-r--r-- | .config/nvim/lua/custom/chadrc.lua | 39 | ||||
-rw-r--r-- | .config/nvim/lua/custom/init.lua | 84 |
2 files changed, 123 insertions, 0 deletions
diff --git a/.config/nvim/lua/custom/chadrc.lua b/.config/nvim/lua/custom/chadrc.lua new file mode 100644 index 0000000..bc4b88e --- /dev/null +++ b/.config/nvim/lua/custom/chadrc.lua @@ -0,0 +1,39 @@ +-- 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 M = {} +M.options, M.ui, M.mappings, M.plugins = {}, {}, {}, {} + +-- NOTE: To use this, make a copy with `cp example_chadrc.lua chadrc.lua` + +-------------------------------------------------------------------- + +-- To use this file, copy the structure of `core/default_config.lua`, +-- examples of setting relative number & changing theme: + +-- M.options = { +-- relativenumber = true, +-- } + +M.ui = { + theme = "chadracula" +} + +-- NvChad included plugin options & overrides +M.plugins = { + options = { + -- lspconfig = { + -- path of file containing setups of different lsps (ex : "custom.plugins.lspconfig"), read the docs for more info + -- setup_lspconf = "", + -- }, + }, + -- To change the Packer `config` of a plugin that comes with NvChad, + -- add a table entry below matching the plugin github name + -- '-' -> '_', remove any '.lua', '.nvim' extensions + -- this string will be called in a `require` + -- use "(custom.configs).my_func()" to call a function + -- use "custom.blankline" to call a file + default_plugin_config_replace = {}, +} + +return M diff --git a/.config/nvim/lua/custom/init.lua b/.config/nvim/lua/custom/init.lua new file mode 100644 index 0000000..473ff84 --- /dev/null +++ b/.config/nvim/lua/custom/init.lua @@ -0,0 +1,84 @@ +-- 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" +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") +vim.api.nvim_command("inoremap <A-k> <Esc>:m .-2<CR>==gi") +vim.api.nvim_command("vnoremap <A-j> :m '>+1<CR>gv=gv") +vim.api.nvim_command("vnoremap <A-k> :m '<-2<CR>gv=gv") + +-- NOTE: To use this, make a copy with `cp example_init.lua init.lua` + +-------------------------------------------------------------------- + +-- To modify packaged plugin configs, use the overrides functionality +-- if the override does not exist in the plugin config, make or request a PR, +-- 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) +-- current.virtual_text = false; +-- return current; +-- end) + +-- To add new mappings, use the "setup_mappings" hook, +-- you can set one or many mappings +-- example below: + +-- hooks.add("setup_mappings", function(map) +-- map("n", "<leader>cc", "gg0vG$d", opt) -- example to delete the buffer +-- .... many more mappings .... +-- end) + +-- To add new plugins, use the "install_plugin" hook, +-- NOTE: we heavily suggest using Packer's lazy loading (with the 'event' field) +-- see: https://github.com/wbthomason/packer.nvim +-- examples below: + +hooks.add("install_plugins", function(use) + use { + "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 + use { "nathom/filetype.nvim" } + + use { + "karb94/neoscroll.nvim", + opt = true, + config = function() + require("neoscroll").setup() + end, + + -- lazy loading + setup = function() + require("core.utils").packer_lazy_load "neoscroll.nvim" + end, + } + + use { + "prettier/vim-prettier", + } + use { + "editorconfig/editorconfig-vim", + } +end) + +-- alternatively, put this in a sub-folder like "lua/custom/plugins/mkdir" +-- then source it with + +-- require "custom.plugins.mkdir" |