Bit of reorganization
This commit is contained in:
parent
d29c9fa7e5
commit
678e7bbca6
@ -1,4 +0,0 @@
|
|||||||
(directive) @tag
|
|
||||||
(directive_start) @tag
|
|
||||||
(directive_end) @tag
|
|
||||||
(comment) @comment
|
|
@ -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"))
|
|
||||||
|
|
||||||
|
|
68
init.lua
68
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
|
-- Import vim options and such
|
||||||
require 'core.options'
|
require 'editor.options.options'
|
||||||
require 'core.autocommands'
|
require 'editor.autocommands.autocommands'
|
||||||
|
|
||||||
-- Bootstrap lazy.nvim
|
-- Bootstrap lazy.nvim
|
||||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||||
@ -18,55 +23,10 @@ require('lazy').setup({
|
|||||||
'tpope/vim-sleuth',
|
'tpope/vim-sleuth',
|
||||||
'tpope/vim-surround',
|
'tpope/vim-surround',
|
||||||
|
|
||||||
-- Highlight todo, notes, etc in comments
|
{ import = 'plugins.themes.catpuccin' },
|
||||||
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
{ import = 'plugins.core' },
|
||||||
|
{ import = 'plugins.optional' },
|
||||||
{ -- Collection of various small independent plugins/modules
|
-- { import = 'plugins.languages' },
|
||||||
'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 `<space>sh` then write `lazy.nvim-plugin`
|
|
||||||
-- you can continue same window with `<space>sr` which resumes last telescope search
|
|
||||||
}, {
|
}, {
|
||||||
ui = {
|
ui = {
|
||||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
-- 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
|
-- Plugin keymaps
|
||||||
require 'core.keymaps'
|
require 'editor.keymaps.plugins.telescope'
|
||||||
|
13
lua/editor/keymaps/custom.lua
Normal file
13
lua/editor/keymaps/custom.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
vim.keymap.set('i', 'jj', '<Esc>')
|
||||||
|
-- Clear highlights on search when pressing <Esc> in normal mode
|
||||||
|
-- See `:help hlsearch`
|
||||||
|
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||||
|
|
||||||
|
-- Diagnostic keymaps
|
||||||
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||||
|
|
||||||
|
-- Disable arrow keys in normal mode
|
||||||
|
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||||
|
vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||||
|
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||||
|
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
@ -1,32 +1,3 @@
|
|||||||
vim.keymap.set('i', 'jj', '<Esc>')
|
|
||||||
-- Clear highlights on search when pressing <Esc> in normal mode
|
|
||||||
-- See `:help hlsearch`
|
|
||||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
|
||||||
|
|
||||||
-- Diagnostic keymaps
|
|
||||||
vim.keymap.set('n', '<leader>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 <C-\><C-n>, 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 <C-\><C-n> to exit terminal mode
|
|
||||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
|
||||||
|
|
||||||
-- Keybinds to make split navigation easier.
|
|
||||||
-- See `:help wincmd` for a list of all window commands
|
|
||||||
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
|
||||||
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
|
||||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
|
||||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
|
||||||
|
|
||||||
-- Keybinds for using the quickfix list
|
|
||||||
vim.keymap.set('n', '<C-]>', '<cmd>cnext<CR>', { desc = 'Go to the next item in quickfix' })
|
|
||||||
vim.keymap.set('n', '<C-[>', '<cmd>cprev<CR>', { desc = 'Go to the previous item in quickfix' })
|
|
||||||
|
|
||||||
-- TELESCOPE
|
|
||||||
--
|
|
||||||
-- See `:help telescope.builtin`
|
-- See `:help telescope.builtin`
|
||||||
local tpb = require 'telescope.builtin'
|
local tpb = require 'telescope.builtin'
|
||||||
vim.keymap.set('n', '<leader>sh', tpb.help_tags, { desc = '[S]earch [H]elp' })
|
vim.keymap.set('n', '<leader>sh', tpb.help_tags, { desc = '[S]earch [H]elp' })
|
||||||
@ -62,9 +33,3 @@ end, { desc = '[S]earch [/] in Open Files' })
|
|||||||
vim.keymap.set('n', '<leader>sn', function()
|
vim.keymap.set('n', '<leader>sn', function()
|
||||||
tpb.find_files { cwd = vim.fn.stdpath 'config' }
|
tpb.find_files { cwd = vim.fn.stdpath 'config' }
|
||||||
end, { desc = '[S]earch [N]eovim files' })
|
end, { desc = '[S]earch [N]eovim files' })
|
||||||
|
|
||||||
-- Disable arrow keys in normal mode
|
|
||||||
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
|
||||||
vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
|
||||||
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
|
||||||
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
|
2
lua/editor/keymaps/quickfix-list.lua
Normal file
2
lua/editor/keymaps/quickfix-list.lua
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
vim.keymap.set('n', '<C-]>', '<cmd>cnext<CR>', { desc = 'Go to the next item in quickfix' })
|
||||||
|
vim.keymap.set('n', '<C-[>', '<cmd>cprev<CR>', { desc = 'Go to the previous item in quickfix' })
|
4
lua/editor/keymaps/split-navigation.lua
Normal file
4
lua/editor/keymaps/split-navigation.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
||||||
|
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
||||||
|
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||||
|
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
37
lua/plugins/optional/mini.lua
Normal file
37
lua/plugins/optional/mini.lua
Normal file
@ -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,
|
||||||
|
}
|
9
lua/plugins/optional/todo-comments.lua
Normal file
9
lua/plugins/optional/todo-comments.lua
Normal file
@ -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,
|
||||||
|
},
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user