decent config ngl
This commit is contained in:
parent
285c67a2a9
commit
a269e21cbc
36
init.lua
36
init.lua
|
@ -196,19 +196,28 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
|
|||
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' })
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
-- markdown keybinds
|
||||
on_attach =
|
||||
function(bufnr)
|
||||
local map = vim.keymap.set
|
||||
local opts = { buffer = bufnr }
|
||||
map({ 'n', 'i' }, '<M-l><M-o>', '<Cmd>MDListItemBelow<CR>', opts)
|
||||
map({ 'n', 'i' }, '<M-L><M-O>', '<Cmd>MDListItemAbove<CR>', opts)
|
||||
map('n', '<M-c>', '<Cmd>MDTaskToggle<CR>', opts)
|
||||
map('x', '<M-c>', ':MDTaskToggle<CR>', opts)
|
||||
end,
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
-- Highlight when yanking (copying) text
|
||||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
})
|
||||
|
||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||
|
@ -486,6 +495,12 @@ require('lazy').setup({
|
|||
'hrsh7th/cmp-nvim-lsp',
|
||||
},
|
||||
config = function()
|
||||
-- personal setup for bracket autocompletion
|
||||
|
||||
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
|
||||
local cmp = require 'cmp'
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
|
||||
-- Brief aside: **What is LSP?**
|
||||
--
|
||||
-- LSP is an initialism you've probably heard, but might not understand what it is.
|
||||
|
@ -561,6 +576,9 @@ require('lazy').setup({
|
|||
-- or a suggestion from your LSP for this to activate.
|
||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
|
||||
|
||||
-- open explorer
|
||||
map('<leader>E', ':NvimTreeOpen<CR>', '[E]xplorer')
|
||||
|
||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||
-- For example, in C this would take you to the header.
|
||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
|
@ -841,7 +859,7 @@ require('lazy').setup({
|
|||
-- Accept ([y]es) the completion.
|
||||
-- This will auto-import if your LSP supports it.
|
||||
-- This will expand snippets if the LSP sent a snippet.
|
||||
['<C-y>'] = cmp.mapping.confirm { select = true },
|
||||
['<Tab>'] = cmp.mapping.confirm { select = true },
|
||||
|
||||
-- If you prefer more traditional completion keymaps,
|
||||
-- you can uncomment the following lines
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {
|
||||
-- snacks type shit
|
||||
{
|
||||
'folke/snacks.nvim',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
|
@ -20,7 +22,6 @@ return {
|
|||
picker = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
styles = {
|
||||
|
@ -196,4 +197,53 @@ return {
|
|||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- bracket autocomplete
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- typst preview
|
||||
{
|
||||
'chomosuke/typst-preview.nvim',
|
||||
lazy = false,
|
||||
version = '1.*',
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- mini
|
||||
{ 'echasnovski/mini.nvim', version = '*' },
|
||||
|
||||
-- file explorer
|
||||
{
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
version = '*',
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function()
|
||||
require('nvim-tree').setup {}
|
||||
end,
|
||||
},
|
||||
|
||||
-- markdown stuff
|
||||
{
|
||||
'tadmccorkle/markdown.nvim',
|
||||
ft = 'markdown', -- or 'event = "VeryLazy"'
|
||||
opts = {
|
||||
-- configuration here or empty for defaults
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue