style(init): Modularize entire init.lua

Now each plugin is in it's own seperate file that returns the plugin and
it's configs. This makes it simpler for me apply lazy loading to this
config.

Settings, Keymaps, Yank-highlight are inside kickstart directory within
their seperate files.
This commit is contained in:
rajvatsal 2024-01-08 18:09:07 +05:30
parent 6215c8b7ba
commit c0e3bb9036
15 changed files with 585 additions and 587 deletions

15
lua/kickstart/keymaps.lua Normal file
View file

@ -0,0 +1,15 @@
-- [[ Basic Keymaps ]]
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
-- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })