Adds more modular setup

This commit is contained in:
zwergius 2024-01-23 13:12:55 +01:00
parent 7912584d7a
commit 7633efd06c
4 changed files with 41 additions and 88 deletions

View file

@ -110,8 +110,7 @@ require('lazy').setup({
},
-- Useful plugin to show you pending keybinds.
{
'folke/which-key.nvim', opts = {} },
{ 'folke/which-key.nvim', opts = {} },
{
-- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
@ -153,11 +152,10 @@ require('lazy').setup({
{
-- Theme inspired by Atom
-- 'navarasu/onedark.nvim',
'rmehri01/onenord.nvim',
'navarasu/onedark.nvim',
priority = 1000,
config = function()
vim.cmd.colorscheme 'onenord'
vim.cmd.colorscheme 'onedark'
end,
},
@ -168,17 +166,10 @@ require('lazy').setup({
opts = {
options = {
icons_enabled = false,
theme = 'onenord',
theme = 'onedark',
component_separators = '|',
section_separators = '',
},
sections = {
lualine_c = {
{
'filename', path = 4
}
}
}
},
},
@ -192,7 +183,7 @@ require('lazy').setup({
},
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
{ 'numToStr/Comment.nvim', opts = {} },
-- Fuzzy Finder (files, lsp, etc)
{
@ -228,7 +219,7 @@ require('lazy').setup({
-- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them.
require 'kickstart.plugins.autoformat',
require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.debug',
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
@ -243,20 +234,8 @@ require('lazy').setup({
-- See `:help vim.o`
-- NOTE: You can change these options as you wish!
-- Line & relative line numbers
vim.opt.number = true
vim.opt.relativenumber = true
-- Indents
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.smartindent = true
-- Set highlight on search
vim.o.hlsearch = false
vim.opt.incsearch = true
-- Make line numbers default
vim.wo.number = true
@ -292,12 +271,8 @@ vim.o.completeopt = 'menuone,noselect'
-- NOTE: You should make sure your terminal supports this
vim.o.termguicolors = true
-- Filetype overrides
vim.filetype.add({
extension = {
postcss = 'css',
}
})
-- Custum Options
require 'custom.zwergius.set'
-- [[ Basic Keymaps ]]
@ -305,16 +280,6 @@ vim.filetype.add({
-- See `:help vim.keymap.set()`
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
-- Easy save with CTRL + s
vim.keymap.set('n', '<C-s>', ':update<cr>', { noremap = true })
vim.keymap.set({ 'i', 'v' }, '<C-s>', '<Esc>:update<cr>', { noremap = true })
-- Split Movement
vim.keymap.set('n', '<C-h>', '<C-w>h', { noremap = true, silent = true })
vim.keymap.set('n', '<C-j>', '<C-w>j', { noremap = true, silent = true })
vim.keymap.set('n', '<C-k>', '<C-w>k', { noremap = true, silent = true })
vim.keymap.set('n', '<C-l>', '<C-w>l', { noremap = true, 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 })
@ -381,6 +346,7 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc =
vim.defer_fn(function()
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
-- ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' },
ensure_installed = {
"bash",
"javascript",
@ -458,8 +424,12 @@ end, 0)
-- 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>do', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>dd', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
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' })
-- Custom Remaps
require 'custom.zwergius.remap'
-- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer.
@ -620,6 +590,3 @@ cmp.setup {
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
-- Autocommand create folder(s) for new file
vim.cmd 'source ~/.config/nvim/auto-mkdir.vim'