aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/custom/init.lua
blob: 6d1f5fb2735b25aea2724215ea08f2b4858a79e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
-- This is where your custom modules and plugins go.
-- See the wiki for a guide on how to extend NvChad
--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")
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

-- customPlugins.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:

-- customPlugins.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:

--[[
customPlugins.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"