diff --git a/after/queries/blade/highlights.scm b/after/queries/blade/highlights.scm deleted file mode 100644 index b3d442a..0000000 --- a/after/queries/blade/highlights.scm +++ /dev/null @@ -1,4 +0,0 @@ -(directive) @tag -(directive_start) @tag -(directive_end) @tag -(comment) @comment diff --git a/after/queries/blade/injections.scm b/after/queries/blade/injections.scm deleted file mode 100644 index a20bbf2..0000000 --- a/after/queries/blade/injections.scm +++ /dev/null @@ -1,25 +0,0 @@ -((text) @injection.content - (#not-has-ancestor? @injection.content "envoy") - (#set! injection.combined) - (#set! injection.language php)) - -; tree-sitter-comment injection -; if available -((comment) @injection.content - (#set! injection.language "comment")) - -; could be bash or zsh -; or whatever tree-sitter grammar you have. -((text) @injection.content - (#has-ancestor? @injection.content "envoy") - (#set! injection.combined) - (#set! injection.language bash)) - -((php_only) @injection.content - (#set! injection.language php_only)) - -((parameter) @injection.content - (#set! injection.include-children) ; You may need this, depending on your editor e.g Helix - (#set! injection.language "php-only")) - - diff --git a/init.lua b/init.lua index 0d61e3c..bc05e64 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,11 @@ +-- Keybinds +require 'editor.keymaps.split-navigation' +require 'editor.keymaps.quickfix-list' +require 'editor.keymaps.custom' + -- Import vim options and such -require 'core.options' -require 'core.autocommands' +require 'editor.options.options' +require 'editor.autocommands.autocommands' -- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -18,55 +23,10 @@ require('lazy').setup({ 'tpope/vim-sleuth', 'tpope/vim-surround', - -- Highlight todo, notes, etc in comments - { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, - - { -- Collection of various small independent plugins/modules - 'echasnovski/mini.nvim', - config = function() - -- Better Around/Inside textobjects - -- - -- Examples: - -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [Q]uote - -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } - - -- Add/delete/replace surroundings (brackets, quotes, etc.) - -- - -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren - -- - sd' - [S]urround [D]elete [']quotes - -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() - - -- Simple and easy statusline. - -- You could remove this setup call if you don't like it, - -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end - - -- ... and there is more! - -- Check out: https://github.com/echasnovski/mini.nvim - end, - }, - - { import = 'core.plugins' }, - { import = 'custom' }, - require 'optional.plugins.whichkey', - -- - -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` - -- Or use telescope! - -- In normal mode type `sh` then write `lazy.nvim-plugin` - -- you can continue same window with `sr` which resumes last telescope search + { import = 'plugins.themes.catpuccin' }, + { import = 'plugins.core' }, + { import = 'plugins.optional' }, + -- { import = 'plugins.languages' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the @@ -88,6 +48,6 @@ require('lazy').setup({ }, }, }) --- Import keymaps after plugins so we don't get --- any "Module not found" errors -require 'core.keymaps' + +-- Plugin keymaps +require 'editor.keymaps.plugins.telescope' diff --git a/lua/core/autocommands.lua b/lua/editor/autocommands/autocommands.lua similarity index 100% rename from lua/core/autocommands.lua rename to lua/editor/autocommands/autocommands.lua diff --git a/lua/editor/keymaps/custom.lua b/lua/editor/keymaps/custom.lua new file mode 100644 index 0000000..8a2c06f --- /dev/null +++ b/lua/editor/keymaps/custom.lua @@ -0,0 +1,13 @@ +vim.keymap.set('i', 'jj', '') +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` +vim.keymap.set('n', '', 'nohlsearch') + +-- Diagnostic keymaps +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +-- Disable arrow keys in normal mode +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') diff --git a/lua/core/keymaps.lua b/lua/editor/keymaps/plugins/telescope.lua similarity index 51% rename from lua/core/keymaps.lua rename to lua/editor/keymaps/plugins/telescope.lua index 8689eb7..0c7b28e 100644 --- a/lua/core/keymaps.lua +++ b/lua/editor/keymaps/plugins/telescope.lua @@ -1,32 +1,3 @@ -vim.keymap.set('i', 'jj', '') --- Clear highlights on search when pressing in normal mode --- See `:help hlsearch` -vim.keymap.set('n', '', 'nohlsearch') - --- Diagnostic keymaps -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) - --- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier --- for people to discover. Otherwise, you normally need to press , which --- is not what someone will guess without a bit more experience. --- --- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping --- or just use to exit terminal mode -vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) - --- Keybinds to make split navigation easier. --- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) - --- Keybinds for using the quickfix list -vim.keymap.set('n', '', 'cnext', { desc = 'Go to the next item in quickfix' }) -vim.keymap.set('n', '', 'cprev', { desc = 'Go to the previous item in quickfix' }) - --- TELESCOPE --- -- See `:help telescope.builtin` local tpb = require 'telescope.builtin' vim.keymap.set('n', 'sh', tpb.help_tags, { desc = '[S]earch [H]elp' }) @@ -62,9 +33,3 @@ end, { desc = '[S]earch [/] in Open Files' }) vim.keymap.set('n', 'sn', function() tpb.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) - --- Disable arrow keys in normal mode -vim.keymap.set('n', '', 'echo "Use h to move!!"') -vim.keymap.set('n', '', 'echo "Use l to move!!"') -vim.keymap.set('n', '', 'echo "Use k to move!!"') -vim.keymap.set('n', '', 'echo "Use j to move!!"') diff --git a/lua/editor/keymaps/quickfix-list.lua b/lua/editor/keymaps/quickfix-list.lua new file mode 100644 index 0000000..a414305 --- /dev/null +++ b/lua/editor/keymaps/quickfix-list.lua @@ -0,0 +1,2 @@ +vim.keymap.set('n', '', 'cnext', { desc = 'Go to the next item in quickfix' }) +vim.keymap.set('n', '', 'cprev', { desc = 'Go to the previous item in quickfix' }) diff --git a/lua/editor/keymaps/split-navigation.lua b/lua/editor/keymaps/split-navigation.lua new file mode 100644 index 0000000..038d6bd --- /dev/null +++ b/lua/editor/keymaps/split-navigation.lua @@ -0,0 +1,4 @@ +vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) diff --git a/lua/core/options.lua b/lua/editor/options/options.lua similarity index 100% rename from lua/core/options.lua rename to lua/editor/options/options.lua diff --git a/lua/core/plugins/autocomplete.lua b/lua/plugins/core/autocomplete.lua similarity index 100% rename from lua/core/plugins/autocomplete.lua rename to lua/plugins/core/autocomplete.lua diff --git a/lua/core/plugins/autoformat.lua b/lua/plugins/core/autoformat.lua similarity index 100% rename from lua/core/plugins/autoformat.lua rename to lua/plugins/core/autoformat.lua diff --git a/lua/core/plugins/autopairs.lua b/lua/plugins/core/autopairs.lua similarity index 100% rename from lua/core/plugins/autopairs.lua rename to lua/plugins/core/autopairs.lua diff --git a/lua/core/plugins/gitsigns.lua b/lua/plugins/core/gitsigns.lua similarity index 100% rename from lua/core/plugins/gitsigns.lua rename to lua/plugins/core/gitsigns.lua diff --git a/lua/core/plugins/lsp.lua b/lua/plugins/core/lsp.lua similarity index 100% rename from lua/core/plugins/lsp.lua rename to lua/plugins/core/lsp.lua diff --git a/lua/core/plugins/neo-tree.lua b/lua/plugins/core/neo-tree.lua similarity index 100% rename from lua/core/plugins/neo-tree.lua rename to lua/plugins/core/neo-tree.lua diff --git a/lua/core/plugins/telescope.lua b/lua/plugins/core/telescope.lua similarity index 100% rename from lua/core/plugins/telescope.lua rename to lua/plugins/core/telescope.lua diff --git a/lua/core/plugins/treesitter.lua b/lua/plugins/core/treesitter.lua similarity index 100% rename from lua/core/plugins/treesitter.lua rename to lua/plugins/core/treesitter.lua diff --git a/lua/plugins/optional/mini.lua b/lua/plugins/optional/mini.lua new file mode 100644 index 0000000..05cf1d7 --- /dev/null +++ b/lua/plugins/optional/mini.lua @@ -0,0 +1,37 @@ +return { -- Collection of various small independent plugins/modules + 'echasnovski/mini.nvim', + config = function() + -- Better Around/Inside textobjects + -- + -- Examples: + -- - va) - [V]isually select [A]round [)]paren + -- - yinq - [Y]ank [I]nside [N]ext [Q]uote + -- - ci' - [C]hange [I]nside [']quote + require('mini.ai').setup { n_lines = 500 } + + -- Add/delete/replace surroundings (brackets, quotes, etc.) + -- + -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren + -- - sd' - [S]urround [D]elete [']quotes + -- - sr)' - [S]urround [R]eplace [)] ['] + require('mini.surround').setup() + + -- Simple and easy statusline. + -- You could remove this setup call if you don't like it, + -- and try some other statusline plugin + local statusline = require 'mini.statusline' + -- set use_icons to true if you have a Nerd Font + statusline.setup { use_icons = vim.g.have_nerd_font } + + -- You can configure sections in the statusline by overriding their + -- default behavior. For example, here we set the section for + -- cursor location to LINE:COLUMN + ---@diagnostic disable-next-line: duplicate-set-field + statusline.section_location = function() + return '%2l:%-2v' + end + + -- ... and there is more! + -- Check out: https://github.com/echasnovski/mini.nvim + end, +} diff --git a/lua/plugins/optional/todo-comments.lua b/lua/plugins/optional/todo-comments.lua new file mode 100644 index 0000000..a513126 --- /dev/null +++ b/lua/plugins/optional/todo-comments.lua @@ -0,0 +1,9 @@ +-- Highlight todo, notes, etc in comments +return { + 'folke/todo-comments.nvim', + event = 'VimEnter', + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = { + signs = false, + }, +} diff --git a/lua/optional/plugins/whichkey.lua b/lua/plugins/optional/whichkey.lua similarity index 100% rename from lua/optional/plugins/whichkey.lua rename to lua/plugins/optional/whichkey.lua diff --git a/lua/custom/theme.lua b/lua/plugins/themes/catpuccin.lua similarity index 100% rename from lua/custom/theme.lua rename to lua/plugins/themes/catpuccin.lua